Lines Matching refs:tfm

23 int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,  in shash_no_setkey()  argument
30 static int shash_setkey_unaligned(struct crypto_shash *tfm, const u8 *key, in shash_setkey_unaligned() argument
33 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_setkey_unaligned()
34 unsigned long alignmask = crypto_shash_alignmask(tfm); in shash_setkey_unaligned()
46 err = shash->setkey(tfm, alignbuffer, keylen); in shash_setkey_unaligned()
51 static void shash_set_needkey(struct crypto_shash *tfm, struct shash_alg *alg) in shash_set_needkey() argument
55 crypto_shash_set_flags(tfm, CRYPTO_TFM_NEED_KEY); in shash_set_needkey()
58 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key, in crypto_shash_setkey() argument
61 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_setkey()
62 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_setkey()
66 err = shash_setkey_unaligned(tfm, key, keylen); in crypto_shash_setkey()
68 err = shash->setkey(tfm, key, keylen); in crypto_shash_setkey()
71 shash_set_needkey(tfm, shash); in crypto_shash_setkey()
75 crypto_shash_clear_flags(tfm, CRYPTO_TFM_NEED_KEY); in crypto_shash_setkey()
83 struct crypto_shash *tfm = desc->tfm; in shash_update_unaligned() local
84 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_update_unaligned()
85 unsigned long alignmask = crypto_shash_alignmask(tfm); in shash_update_unaligned()
113 struct crypto_shash *tfm = desc->tfm; in crypto_shash_update() local
114 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_update()
115 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_update()
126 struct crypto_shash *tfm = desc->tfm; in shash_final_unaligned() local
127 unsigned long alignmask = crypto_shash_alignmask(tfm); in shash_final_unaligned()
128 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_final_unaligned()
129 unsigned int ds = crypto_shash_digestsize(tfm); in shash_final_unaligned()
154 struct crypto_shash *tfm = desc->tfm; in crypto_shash_final() local
155 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_final()
156 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_final()
175 struct crypto_shash *tfm = desc->tfm; in crypto_shash_finup() local
176 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_finup()
177 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_finup()
196 struct crypto_shash *tfm = desc->tfm; in crypto_shash_digest() local
197 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_digest()
198 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_digest()
200 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_digest()
212 memcpy(out, shash_desc_ctx(desc), crypto_shash_descsize(desc->tfm)); in shash_default_export()
218 memcpy(shash_desc_ctx(desc), in, crypto_shash_descsize(desc->tfm)); in shash_default_import()
222 static int shash_async_setkey(struct crypto_ahash *tfm, const u8 *key, in shash_async_setkey() argument
225 struct crypto_shash **ctx = crypto_ahash_ctx(tfm); in shash_async_setkey()
235 desc->tfm = *ctx; in shash_async_init()
289 desc->tfm = *ctx; in shash_async_finup()
323 desc->tfm = *ctx; in shash_async_digest()
338 desc->tfm = *ctx; in shash_async_import()
343 static void crypto_exit_shash_ops_async(struct crypto_tfm *tfm) in crypto_exit_shash_ops_async() argument
345 struct crypto_shash **ctx = crypto_tfm_ctx(tfm); in crypto_exit_shash_ops_async()
350 int crypto_init_shash_ops_async(struct crypto_tfm *tfm) in crypto_init_shash_ops_async() argument
352 struct crypto_alg *calg = tfm->__crt_alg; in crypto_init_shash_ops_async()
354 struct crypto_ahash *crt = __crypto_ahash_cast(tfm); in crypto_init_shash_ops_async()
355 struct crypto_shash **ctx = crypto_tfm_ctx(tfm); in crypto_init_shash_ops_async()
368 tfm->exit = crypto_exit_shash_ops_async; in crypto_init_shash_ops_async()
389 static int crypto_shash_init_tfm(struct crypto_tfm *tfm) in crypto_shash_init_tfm() argument
391 struct crypto_shash *hash = __crypto_shash_cast(tfm); in crypto_shash_init_tfm()