Lines Matching refs:tfm

34 int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,  in shash_no_setkey()  argument
41 static int shash_setkey_unaligned(struct crypto_shash *tfm, const u8 *key, in shash_setkey_unaligned() argument
44 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_setkey_unaligned()
45 unsigned long alignmask = crypto_shash_alignmask(tfm); in shash_setkey_unaligned()
57 err = shash->setkey(tfm, alignbuffer, keylen); in shash_setkey_unaligned()
62 static void shash_set_needkey(struct crypto_shash *tfm, struct shash_alg *alg) in shash_set_needkey() argument
65 crypto_shash_set_flags(tfm, CRYPTO_TFM_NEED_KEY); in shash_set_needkey()
68 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key, in crypto_shash_setkey() argument
71 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_setkey()
72 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_setkey()
76 err = shash_setkey_unaligned(tfm, key, keylen); in crypto_shash_setkey()
78 err = shash->setkey(tfm, key, keylen); in crypto_shash_setkey()
81 shash_set_needkey(tfm, shash); in crypto_shash_setkey()
85 crypto_shash_clear_flags(tfm, CRYPTO_TFM_NEED_KEY); in crypto_shash_setkey()
93 struct crypto_shash *tfm = desc->tfm; in shash_update_unaligned() local
94 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_update_unaligned()
95 unsigned long alignmask = crypto_shash_alignmask(tfm); in shash_update_unaligned()
123 struct crypto_shash *tfm = desc->tfm; in crypto_shash_update() local
124 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_update()
125 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_update()
142 struct crypto_shash *tfm = desc->tfm; in shash_final_unaligned() local
143 unsigned long alignmask = crypto_shash_alignmask(tfm); in shash_final_unaligned()
144 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_final_unaligned()
145 unsigned int ds = crypto_shash_digestsize(tfm); in shash_final_unaligned()
170 struct crypto_shash *tfm = desc->tfm; in crypto_shash_final() local
171 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_final()
172 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_final()
197 struct crypto_shash *tfm = desc->tfm; in crypto_shash_finup() local
198 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_finup()
199 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_finup()
230 struct crypto_shash *tfm = desc->tfm; in crypto_shash_digest() local
231 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_digest()
232 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_digest()
242 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_digest()
253 int crypto_shash_tfm_digest(struct crypto_shash *tfm, const u8 *data, in crypto_shash_tfm_digest() argument
256 SHASH_DESC_ON_STACK(desc, tfm); in crypto_shash_tfm_digest()
259 desc->tfm = tfm; in crypto_shash_tfm_digest()
271 memcpy(out, shash_desc_ctx(desc), crypto_shash_descsize(desc->tfm)); in shash_default_export()
277 memcpy(shash_desc_ctx(desc), in, crypto_shash_descsize(desc->tfm)); in shash_default_import()
281 static int shash_async_setkey(struct crypto_ahash *tfm, const u8 *key, in shash_async_setkey() argument
284 struct crypto_shash **ctx = crypto_ahash_ctx(tfm); in shash_async_setkey()
294 desc->tfm = *ctx; in shash_async_init()
348 desc->tfm = *ctx; in shash_async_finup()
382 desc->tfm = *ctx; in shash_async_digest()
397 desc->tfm = *ctx; in shash_async_import()
402 static void crypto_exit_shash_ops_async(struct crypto_tfm *tfm) in crypto_exit_shash_ops_async() argument
404 struct crypto_shash **ctx = crypto_tfm_ctx(tfm); in crypto_exit_shash_ops_async()
409 int crypto_init_shash_ops_async(struct crypto_tfm *tfm) in crypto_init_shash_ops_async() argument
411 struct crypto_alg *calg = tfm->__crt_alg; in crypto_init_shash_ops_async()
413 struct crypto_ahash *crt = __crypto_ahash_cast(tfm); in crypto_init_shash_ops_async()
414 struct crypto_shash **ctx = crypto_tfm_ctx(tfm); in crypto_init_shash_ops_async()
427 tfm->exit = crypto_exit_shash_ops_async; in crypto_init_shash_ops_async()
466 static void crypto_shash_exit_tfm(struct crypto_tfm *tfm) in crypto_shash_exit_tfm() argument
468 struct crypto_shash *hash = __crypto_shash_cast(tfm); in crypto_shash_exit_tfm()
474 static int crypto_shash_init_tfm(struct crypto_tfm *tfm) in crypto_shash_init_tfm() argument
476 struct crypto_shash *hash = __crypto_shash_cast(tfm); in crypto_shash_init_tfm()
485 tfm->exit = crypto_shash_exit_tfm; in crypto_shash_init_tfm()
587 struct crypto_tfm *tfm = crypto_shash_tfm(hash); in crypto_clone_shash() local
593 tfm = crypto_tfm_get(tfm); in crypto_clone_shash()
594 if (IS_ERR(tfm)) in crypto_clone_shash()
595 return ERR_CAST(tfm); in crypto_clone_shash()
603 nhash = crypto_clone_tfm(&crypto_shash_type, tfm); in crypto_clone_shash()