• Home
  • Raw
  • Download

Lines Matching refs:desc

90 static int shash_update_unaligned(struct shash_desc *desc, const u8 *data,  in shash_update_unaligned()  argument
93 struct crypto_shash *tfm = desc->tfm; in shash_update_unaligned()
113 err = shash->update(desc, buf, unaligned_len); in shash_update_unaligned()
117 shash->update(desc, data + unaligned_len, len - unaligned_len); in shash_update_unaligned()
120 int crypto_shash_update(struct shash_desc *desc, const u8 *data, in crypto_shash_update() argument
123 struct crypto_shash *tfm = desc->tfm; in crypto_shash_update()
132 err = shash_update_unaligned(desc, data, len); in crypto_shash_update()
134 err = shash->update(desc, data, len); in crypto_shash_update()
140 static int shash_final_unaligned(struct shash_desc *desc, u8 *out) in shash_final_unaligned() argument
142 struct crypto_shash *tfm = desc->tfm; in shash_final_unaligned()
157 err = shash->final(desc, buf); in shash_final_unaligned()
168 int crypto_shash_final(struct shash_desc *desc, u8 *out) in crypto_shash_final() argument
170 struct crypto_shash *tfm = desc->tfm; in crypto_shash_final()
179 err = shash_final_unaligned(desc, out); in crypto_shash_final()
181 err = shash->final(desc, out); in crypto_shash_final()
187 static int shash_finup_unaligned(struct shash_desc *desc, const u8 *data, in shash_finup_unaligned() argument
190 return shash_update_unaligned(desc, data, len) ?: in shash_finup_unaligned()
191 shash_final_unaligned(desc, out); in shash_finup_unaligned()
194 int crypto_shash_finup(struct shash_desc *desc, const u8 *data, in crypto_shash_finup() argument
197 struct crypto_shash *tfm = desc->tfm; in crypto_shash_finup()
210 err = shash_finup_unaligned(desc, data, len, out); in crypto_shash_finup()
212 err = shash->finup(desc, data, len, out); in crypto_shash_finup()
220 shash_finup_mb_fallback(struct shash_desc *desc, const u8 * const data[], in shash_finup_mb_fallback() argument
224 struct crypto_shash *tfm = desc->tfm; in shash_finup_mb_fallback()
231 memcpy(shash_desc_ctx(desc2), shash_desc_ctx(desc), in shash_finup_mb_fallback()
237 return crypto_shash_finup(desc, data[i], len, outs[i]); in shash_finup_mb_fallback()
240 int crypto_shash_finup_mb(struct shash_desc *desc, const u8 * const data[], in crypto_shash_finup_mb() argument
244 struct shash_alg *alg = crypto_shash_alg(desc->tfm); in crypto_shash_finup_mb()
248 return crypto_shash_finup(desc, data[0], len, outs[0]); in crypto_shash_finup_mb()
256 err = alg->finup_mb(desc, data, len, outs, num_msgs); in crypto_shash_finup_mb()
262 return shash_finup_mb_fallback(desc, data, len, outs, num_msgs); in crypto_shash_finup_mb()
266 static int shash_digest_unaligned(struct shash_desc *desc, const u8 *data, in shash_digest_unaligned() argument
269 return crypto_shash_init(desc) ?: in shash_digest_unaligned()
270 shash_update_unaligned(desc, data, len) ?: in shash_digest_unaligned()
271 shash_final_unaligned(desc, out); in shash_digest_unaligned()
274 int crypto_shash_digest(struct shash_desc *desc, const u8 *data, in crypto_shash_digest() argument
277 struct crypto_shash *tfm = desc->tfm; in crypto_shash_digest()
292 err = shash_digest_unaligned(desc, data, len, out); in crypto_shash_digest()
294 err = shash->digest(desc, data, len, out); in crypto_shash_digest()
303 SHASH_DESC_ON_STACK(desc, tfm); in crypto_shash_tfm_digest()
306 desc->tfm = tfm; in crypto_shash_tfm_digest()
308 err = crypto_shash_digest(desc, data, len, out); in crypto_shash_tfm_digest()
310 shash_desc_zero(desc); in crypto_shash_tfm_digest()
316 static int shash_default_export(struct shash_desc *desc, void *out) in shash_default_export() argument
318 memcpy(out, shash_desc_ctx(desc), crypto_shash_descsize(desc->tfm)); in shash_default_export()
322 static int shash_default_import(struct shash_desc *desc, const void *in) in shash_default_import() argument
324 memcpy(shash_desc_ctx(desc), in, crypto_shash_descsize(desc->tfm)); in shash_default_import()
339 struct shash_desc *desc = ahash_request_ctx(req); in shash_async_init() local
341 desc->tfm = *ctx; in shash_async_init()
343 return crypto_shash_init(desc); in shash_async_init()
346 int shash_ahash_update(struct ahash_request *req, struct shash_desc *desc) in shash_ahash_update() argument
353 nbytes = crypto_shash_update(desc, walk.data, nbytes); in shash_ahash_update()
369 int shash_ahash_finup(struct ahash_request *req, struct shash_desc *desc) in shash_ahash_finup() argument
376 return crypto_shash_final(desc, req->result); in shash_ahash_finup()
380 crypto_shash_finup(desc, walk.data, nbytes, in shash_ahash_finup()
382 crypto_shash_update(desc, walk.data, nbytes); in shash_ahash_finup()
393 struct shash_desc *desc = ahash_request_ctx(req); in shash_async_finup() local
395 desc->tfm = *ctx; in shash_async_finup()
397 return shash_ahash_finup(req, desc); in shash_async_finup()
400 int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc) in shash_ahash_digest() argument
413 err = crypto_shash_digest(desc, data + offset, nbytes, in shash_ahash_digest()
417 err = crypto_shash_init(desc) ?: in shash_ahash_digest()
418 shash_ahash_finup(req, desc); in shash_ahash_digest()
427 struct shash_desc *desc = ahash_request_ctx(req); in shash_async_digest() local
429 desc->tfm = *ctx; in shash_async_digest()
431 return shash_ahash_digest(req, desc); in shash_async_digest()
442 struct shash_desc *desc = ahash_request_ctx(req); in shash_async_import() local
444 desc->tfm = *ctx; in shash_async_import()
446 return crypto_shash_import(desc, in); in shash_async_import()