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
54 crypto_shash_set_flags(tfm, CRYPTO_TFM_NEED_KEY); in shash_set_needkey()
57 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key, in crypto_shash_setkey() argument
60 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_setkey()
61 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_setkey()
65 err = shash_setkey_unaligned(tfm, key, keylen); in crypto_shash_setkey()
67 err = shash->setkey(tfm, key, keylen); in crypto_shash_setkey()
70 shash_set_needkey(tfm, shash); in crypto_shash_setkey()
74 crypto_shash_clear_flags(tfm, CRYPTO_TFM_NEED_KEY); in crypto_shash_setkey()
82 struct crypto_shash *tfm = desc->tfm; in shash_update_unaligned() local
83 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_update_unaligned()
84 unsigned long alignmask = crypto_shash_alignmask(tfm); in shash_update_unaligned()
112 struct crypto_shash *tfm = desc->tfm; in crypto_shash_update() local
113 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_update()
114 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_update()
125 struct crypto_shash *tfm = desc->tfm; in shash_final_unaligned() local
126 unsigned long alignmask = crypto_shash_alignmask(tfm); in shash_final_unaligned()
127 struct shash_alg *shash = crypto_shash_alg(tfm); in shash_final_unaligned()
128 unsigned int ds = crypto_shash_digestsize(tfm); in shash_final_unaligned()
153 struct crypto_shash *tfm = desc->tfm; in crypto_shash_final() local
154 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_final()
155 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_final()
174 struct crypto_shash *tfm = desc->tfm; in crypto_shash_finup() local
175 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_finup()
176 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_finup()
195 struct crypto_shash *tfm = desc->tfm; in crypto_shash_digest() local
196 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_digest()
197 unsigned long alignmask = crypto_shash_alignmask(tfm); in crypto_shash_digest()
199 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_digest()
209 int crypto_shash_tfm_digest(struct crypto_shash *tfm, const u8 *data, in crypto_shash_tfm_digest() argument
212 SHASH_DESC_ON_STACK(desc, tfm); in crypto_shash_tfm_digest()
215 desc->tfm = tfm; in crypto_shash_tfm_digest()
227 memcpy(out, shash_desc_ctx(desc), crypto_shash_descsize(desc->tfm)); in shash_default_export()
233 memcpy(shash_desc_ctx(desc), in, crypto_shash_descsize(desc->tfm)); in shash_default_import()
237 static int shash_async_setkey(struct crypto_ahash *tfm, const u8 *key, in shash_async_setkey() argument
240 struct crypto_shash **ctx = crypto_ahash_ctx(tfm); in shash_async_setkey()
250 desc->tfm = *ctx; in shash_async_init()
304 desc->tfm = *ctx; in shash_async_finup()
338 desc->tfm = *ctx; in shash_async_digest()
353 desc->tfm = *ctx; in shash_async_import()
358 static void crypto_exit_shash_ops_async(struct crypto_tfm *tfm) in crypto_exit_shash_ops_async() argument
360 struct crypto_shash **ctx = crypto_tfm_ctx(tfm); in crypto_exit_shash_ops_async()
365 int crypto_init_shash_ops_async(struct crypto_tfm *tfm) in crypto_init_shash_ops_async() argument
367 struct crypto_alg *calg = tfm->__crt_alg; in crypto_init_shash_ops_async()
369 struct crypto_ahash *crt = __crypto_ahash_cast(tfm); in crypto_init_shash_ops_async()
370 struct crypto_shash **ctx = crypto_tfm_ctx(tfm); in crypto_init_shash_ops_async()
383 tfm->exit = crypto_exit_shash_ops_async; in crypto_init_shash_ops_async()
404 static void crypto_shash_exit_tfm(struct crypto_tfm *tfm) in crypto_shash_exit_tfm() argument
406 struct crypto_shash *hash = __crypto_shash_cast(tfm); in crypto_shash_exit_tfm()
412 static int crypto_shash_init_tfm(struct crypto_tfm *tfm) in crypto_shash_init_tfm() argument
414 struct crypto_shash *hash = __crypto_shash_cast(tfm); in crypto_shash_init_tfm()
423 tfm->exit = crypto_shash_exit_tfm; in crypto_shash_init_tfm()