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()
219 static int shash_digest_unaligned(struct shash_desc *desc, const u8 *data, in shash_digest_unaligned() argument
222 return crypto_shash_init(desc) ?: in shash_digest_unaligned()
223 shash_update_unaligned(desc, data, len) ?: in shash_digest_unaligned()
224 shash_final_unaligned(desc, out); in shash_digest_unaligned()
227 int crypto_shash_digest(struct shash_desc *desc, const u8 *data, in crypto_shash_digest() argument
230 struct crypto_shash *tfm = desc->tfm; in crypto_shash_digest()
245 err = shash_digest_unaligned(desc, data, len, out); in crypto_shash_digest()
247 err = shash->digest(desc, data, len, out); in crypto_shash_digest()
256 SHASH_DESC_ON_STACK(desc, tfm); in crypto_shash_tfm_digest()
259 desc->tfm = tfm; in crypto_shash_tfm_digest()
261 err = crypto_shash_digest(desc, data, len, out); in crypto_shash_tfm_digest()
263 shash_desc_zero(desc); in crypto_shash_tfm_digest()
269 static int shash_default_export(struct shash_desc *desc, void *out) in shash_default_export() argument
271 memcpy(out, shash_desc_ctx(desc), crypto_shash_descsize(desc->tfm)); in shash_default_export()
275 static int shash_default_import(struct shash_desc *desc, const void *in) in shash_default_import() argument
277 memcpy(shash_desc_ctx(desc), in, crypto_shash_descsize(desc->tfm)); in shash_default_import()
292 struct shash_desc *desc = ahash_request_ctx(req); in shash_async_init() local
294 desc->tfm = *ctx; in shash_async_init()
296 return crypto_shash_init(desc); in shash_async_init()
299 int shash_ahash_update(struct ahash_request *req, struct shash_desc *desc) in shash_ahash_update() argument
306 nbytes = crypto_shash_update(desc, walk.data, nbytes); in shash_ahash_update()
322 int shash_ahash_finup(struct ahash_request *req, struct shash_desc *desc) in shash_ahash_finup() argument
329 return crypto_shash_final(desc, req->result); in shash_ahash_finup()
333 crypto_shash_finup(desc, walk.data, nbytes, in shash_ahash_finup()
335 crypto_shash_update(desc, walk.data, nbytes); in shash_ahash_finup()
346 struct shash_desc *desc = ahash_request_ctx(req); in shash_async_finup() local
348 desc->tfm = *ctx; in shash_async_finup()
350 return shash_ahash_finup(req, desc); in shash_async_finup()
353 int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc) in shash_ahash_digest() argument
366 err = crypto_shash_digest(desc, data + offset, nbytes, in shash_ahash_digest()
370 err = crypto_shash_init(desc) ?: in shash_ahash_digest()
371 shash_ahash_finup(req, desc); in shash_ahash_digest()
380 struct shash_desc *desc = ahash_request_ctx(req); in shash_async_digest() local
382 desc->tfm = *ctx; in shash_async_digest()
384 return shash_ahash_digest(req, desc); in shash_async_digest()
395 struct shash_desc *desc = ahash_request_ctx(req); in shash_async_import() local
397 desc->tfm = *ctx; in shash_async_import()
399 return crypto_shash_import(desc, in); in shash_async_import()