Lines Matching refs:desc
91 static int shash_update_unaligned(struct shash_desc *desc, const u8 *data, in shash_update_unaligned() argument
94 struct crypto_shash *tfm = desc->tfm; in shash_update_unaligned()
114 err = shash->update(desc, buf, unaligned_len); in shash_update_unaligned()
118 shash->update(desc, data + unaligned_len, len - unaligned_len); in shash_update_unaligned()
121 int crypto_shash_update(struct shash_desc *desc, const u8 *data, in crypto_shash_update() argument
124 struct crypto_shash *tfm = desc->tfm; in crypto_shash_update()
129 return shash_update_unaligned(desc, data, len); in crypto_shash_update()
131 return shash->update(desc, data, len); in crypto_shash_update()
135 static int shash_final_unaligned(struct shash_desc *desc, u8 *out) in shash_final_unaligned() argument
137 struct crypto_shash *tfm = desc->tfm; in shash_final_unaligned()
152 err = shash->final(desc, buf); in shash_final_unaligned()
163 int crypto_shash_final(struct shash_desc *desc, u8 *out) in crypto_shash_final() argument
165 struct crypto_shash *tfm = desc->tfm; in crypto_shash_final()
170 return shash_final_unaligned(desc, out); in crypto_shash_final()
172 return shash->final(desc, out); in crypto_shash_final()
176 static int shash_finup_unaligned(struct shash_desc *desc, const u8 *data, in shash_finup_unaligned() argument
179 return crypto_shash_update(desc, data, len) ?: in shash_finup_unaligned()
180 crypto_shash_final(desc, out); in shash_finup_unaligned()
183 int crypto_shash_finup(struct shash_desc *desc, const u8 *data, in crypto_shash_finup() argument
186 struct crypto_shash *tfm = desc->tfm; in crypto_shash_finup()
191 return shash_finup_unaligned(desc, data, len, out); in crypto_shash_finup()
193 return shash->finup(desc, data, len, out); in crypto_shash_finup()
197 static int shash_digest_unaligned(struct shash_desc *desc, const u8 *data, in shash_digest_unaligned() argument
200 return crypto_shash_init(desc) ?: in shash_digest_unaligned()
201 crypto_shash_finup(desc, data, len, out); in shash_digest_unaligned()
204 int crypto_shash_digest(struct shash_desc *desc, const u8 *data, in crypto_shash_digest() argument
207 struct crypto_shash *tfm = desc->tfm; in crypto_shash_digest()
215 return shash_digest_unaligned(desc, data, len, out); in crypto_shash_digest()
217 return shash->digest(desc, data, len, out); in crypto_shash_digest()
224 SHASH_DESC_ON_STACK(desc, tfm); in crypto_shash_tfm_digest()
227 desc->tfm = tfm; in crypto_shash_tfm_digest()
229 err = crypto_shash_digest(desc, data, len, out); in crypto_shash_tfm_digest()
231 shash_desc_zero(desc); in crypto_shash_tfm_digest()
237 static int shash_default_export(struct shash_desc *desc, void *out) in shash_default_export() argument
239 memcpy(out, shash_desc_ctx(desc), crypto_shash_descsize(desc->tfm)); in shash_default_export()
243 static int shash_default_import(struct shash_desc *desc, const void *in) in shash_default_import() argument
245 memcpy(shash_desc_ctx(desc), in, crypto_shash_descsize(desc->tfm)); in shash_default_import()
260 struct shash_desc *desc = ahash_request_ctx(req); in shash_async_init() local
262 desc->tfm = *ctx; in shash_async_init()
264 return crypto_shash_init(desc); in shash_async_init()
267 int shash_ahash_update(struct ahash_request *req, struct shash_desc *desc) in shash_ahash_update() argument
274 nbytes = crypto_shash_update(desc, walk.data, nbytes); in shash_ahash_update()
290 int shash_ahash_finup(struct ahash_request *req, struct shash_desc *desc) in shash_ahash_finup() argument
297 return crypto_shash_final(desc, req->result); in shash_ahash_finup()
301 crypto_shash_finup(desc, walk.data, nbytes, in shash_ahash_finup()
303 crypto_shash_update(desc, walk.data, nbytes); in shash_ahash_finup()
314 struct shash_desc *desc = ahash_request_ctx(req); in shash_async_finup() local
316 desc->tfm = *ctx; in shash_async_finup()
318 return shash_ahash_finup(req, desc); in shash_async_finup()
321 int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc) in shash_ahash_digest() argument
334 err = crypto_shash_digest(desc, data + offset, nbytes, in shash_ahash_digest()
338 err = crypto_shash_init(desc) ?: in shash_ahash_digest()
339 shash_ahash_finup(req, desc); in shash_ahash_digest()
348 struct shash_desc *desc = ahash_request_ctx(req); in shash_async_digest() local
350 desc->tfm = *ctx; in shash_async_digest()
352 return shash_ahash_digest(req, desc); in shash_async_digest()
363 struct shash_desc *desc = ahash_request_ctx(req); in shash_async_import() local
365 desc->tfm = *ctx; in shash_async_import()
367 return crypto_shash_import(desc, in); in shash_async_import()