• Home
  • Raw
  • Download

Lines Matching refs:walk

27 static int hash_walk_next(struct crypto_hash_walk *walk)  in hash_walk_next()  argument
29 unsigned int alignmask = walk->alignmask; in hash_walk_next()
30 unsigned int offset = walk->offset; in hash_walk_next()
31 unsigned int nbytes = min(walk->entrylen, in hash_walk_next()
34 walk->data = crypto_kmap(walk->pg, 0); in hash_walk_next()
35 walk->data += offset; in hash_walk_next()
40 walk->entrylen -= nbytes; in hash_walk_next()
44 static int hash_walk_new_entry(struct crypto_hash_walk *walk) in hash_walk_new_entry() argument
48 sg = walk->sg; in hash_walk_new_entry()
49 walk->pg = sg_page(sg); in hash_walk_new_entry()
50 walk->offset = sg->offset; in hash_walk_new_entry()
51 walk->entrylen = sg->length; in hash_walk_new_entry()
53 if (walk->entrylen > walk->total) in hash_walk_new_entry()
54 walk->entrylen = walk->total; in hash_walk_new_entry()
55 walk->total -= walk->entrylen; in hash_walk_new_entry()
57 return hash_walk_next(walk); in hash_walk_new_entry()
60 int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err) in crypto_hash_walk_done() argument
62 unsigned int alignmask = walk->alignmask; in crypto_hash_walk_done()
63 unsigned int nbytes = walk->entrylen; in crypto_hash_walk_done()
65 walk->data -= walk->offset; in crypto_hash_walk_done()
67 if (nbytes && walk->offset & alignmask && !err) { in crypto_hash_walk_done()
68 walk->offset += alignmask - 1; in crypto_hash_walk_done()
69 walk->offset = ALIGN(walk->offset, alignmask + 1); in crypto_hash_walk_done()
70 walk->data += walk->offset; in crypto_hash_walk_done()
73 ((unsigned int)(PAGE_SIZE)) - walk->offset); in crypto_hash_walk_done()
74 walk->entrylen -= nbytes; in crypto_hash_walk_done()
79 crypto_kunmap(walk->data, 0); in crypto_hash_walk_done()
80 crypto_yield(walk->flags); in crypto_hash_walk_done()
85 walk->offset = 0; in crypto_hash_walk_done()
88 return hash_walk_next(walk); in crypto_hash_walk_done()
90 if (!walk->total) in crypto_hash_walk_done()
93 walk->sg = scatterwalk_sg_next(walk->sg); in crypto_hash_walk_done()
95 return hash_walk_new_entry(walk); in crypto_hash_walk_done()
100 struct crypto_hash_walk *walk) in crypto_hash_walk_first() argument
102 walk->total = req->nbytes; in crypto_hash_walk_first()
104 if (!walk->total) in crypto_hash_walk_first()
107 walk->alignmask = crypto_ahash_alignmask(crypto_ahash_reqtfm(req)); in crypto_hash_walk_first()
108 walk->sg = req->src; in crypto_hash_walk_first()
109 walk->flags = req->base.flags; in crypto_hash_walk_first()
111 return hash_walk_new_entry(walk); in crypto_hash_walk_first()
116 struct crypto_hash_walk *walk, in crypto_hash_walk_first_compat() argument
119 walk->total = len; in crypto_hash_walk_first_compat()
121 if (!walk->total) in crypto_hash_walk_first_compat()
124 walk->alignmask = crypto_hash_alignmask(hdesc->tfm); in crypto_hash_walk_first_compat()
125 walk->sg = sg; in crypto_hash_walk_first_compat()
126 walk->flags = hdesc->flags; in crypto_hash_walk_first_compat()
128 return hash_walk_new_entry(walk); in crypto_hash_walk_first_compat()