Lines Matching refs:tfm
23 static int shash_no_setkey(struct crypto_shash *tfm, const u8 *key, in shash_no_setkey() argument
42 static int shash_setkey_unaligned(struct crypto_shash *tfm, const u8 *key, in shash_setkey_unaligned() argument
45 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_setkey_unaligned()
46 unsigned long alignmask = crypto_shash_alignmask(tfm); in shash_setkey_unaligned()
58 err = shash->setkey(tfm, alignbuffer, keylen); in shash_setkey_unaligned()
63 static void shash_set_needkey(struct crypto_shash *tfm, struct shash_alg *alg) in shash_set_needkey() argument
66 crypto_shash_set_flags(tfm, CRYPTO_TFM_NEED_KEY); in shash_set_needkey()
69 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key, in crypto_shash_setkey() argument
72 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_setkey()
73 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_setkey()
77 err = shash_setkey_unaligned(tfm, key, keylen); in crypto_shash_setkey()
79 err = shash->setkey(tfm, key, keylen); in crypto_shash_setkey()
82 shash_set_needkey(tfm, shash); in crypto_shash_setkey()
86 crypto_shash_clear_flags(tfm, CRYPTO_TFM_NEED_KEY); in crypto_shash_setkey()
94 struct crypto_shash *tfm = desc->tfm; in shash_update_unaligned() local
95 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_update_unaligned()
96 unsigned long alignmask = crypto_shash_alignmask(tfm); in shash_update_unaligned()
124 struct crypto_shash *tfm = desc->tfm; in crypto_shash_update() local
125 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_update()
126 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_update()
137 struct crypto_shash *tfm = desc->tfm; in shash_final_unaligned() local
138 unsigned long alignmask = crypto_shash_alignmask(tfm); in shash_final_unaligned()
139 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_final_unaligned()
140 unsigned int ds = crypto_shash_digestsize(tfm); in shash_final_unaligned()
165 struct crypto_shash *tfm = desc->tfm; in crypto_shash_final() local
166 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_final()
167 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_final()
186 struct crypto_shash *tfm = desc->tfm; in crypto_shash_finup() local
187 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_finup()
188 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_finup()
207 struct crypto_shash *tfm = desc->tfm; in crypto_shash_digest() local
208 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_digest()
209 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_digest()
211 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_digest()
221 int crypto_shash_tfm_digest(struct crypto_shash *tfm, const u8 *data, in crypto_shash_tfm_digest() argument
224 SHASH_DESC_ON_STACK(desc, tfm); in crypto_shash_tfm_digest()
227 desc->tfm = tfm; in crypto_shash_tfm_digest()
239 memcpy(out, shash_desc_ctx(desc), crypto_shash_descsize(desc->tfm)); in shash_default_export()
245 memcpy(shash_desc_ctx(desc), in, crypto_shash_descsize(desc->tfm)); in shash_default_import()
249 static int shash_async_setkey(struct crypto_ahash *tfm, const u8 *key, in shash_async_setkey() argument
252 struct crypto_shash **ctx = crypto_ahash_ctx(tfm); in shash_async_setkey()
262 desc->tfm = *ctx; in shash_async_init()
316 desc->tfm = *ctx; in shash_async_finup()
350 desc->tfm = *ctx; in shash_async_digest()
365 desc->tfm = *ctx; in shash_async_import()
370 static void crypto_exit_shash_ops_async(struct crypto_tfm *tfm) in crypto_exit_shash_ops_async() argument
372 struct crypto_shash **ctx = crypto_tfm_ctx(tfm); in crypto_exit_shash_ops_async()
377 int crypto_init_shash_ops_async(struct crypto_tfm *tfm) in crypto_init_shash_ops_async() argument
379 struct crypto_alg *calg = tfm->__crt_alg; in crypto_init_shash_ops_async()
381 struct crypto_ahash *crt = __crypto_ahash_cast(tfm); in crypto_init_shash_ops_async()
382 struct crypto_shash **ctx = crypto_tfm_ctx(tfm); in crypto_init_shash_ops_async()
395 tfm->exit = crypto_exit_shash_ops_async; in crypto_init_shash_ops_async()
416 static void crypto_shash_exit_tfm(struct crypto_tfm *tfm) in crypto_shash_exit_tfm() argument
418 struct crypto_shash *hash = __crypto_shash_cast(tfm); in crypto_shash_exit_tfm()
424 static int crypto_shash_init_tfm(struct crypto_tfm *tfm) in crypto_shash_init_tfm() argument
426 struct crypto_shash *hash = __crypto_shash_cast(tfm); in crypto_shash_init_tfm()
435 tfm->exit = crypto_shash_exit_tfm; in crypto_shash_init_tfm()