Lines Matching refs:tfm
168 static int ahash_setkey_unaligned(struct crypto_ahash *tfm, const u8 *key, in ahash_setkey_unaligned() argument
171 unsigned long alignmask = crypto_ahash_alignmask(tfm); in ahash_setkey_unaligned()
183 ret = tfm->setkey(tfm, alignbuffer, keylen); in ahash_setkey_unaligned()
188 static int ahash_nosetkey(struct crypto_ahash *tfm, const u8 *key, in ahash_nosetkey() argument
194 static void ahash_set_needkey(struct crypto_ahash *tfm) in ahash_set_needkey() argument
196 const struct hash_alg_common *alg = crypto_hash_alg_common(tfm); in ahash_set_needkey()
198 if (tfm->setkey != ahash_nosetkey && in ahash_set_needkey()
200 crypto_ahash_set_flags(tfm, CRYPTO_TFM_NEED_KEY); in ahash_set_needkey()
203 int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key, in crypto_ahash_setkey() argument
206 unsigned long alignmask = crypto_ahash_alignmask(tfm); in crypto_ahash_setkey()
210 err = ahash_setkey_unaligned(tfm, key, keylen); in crypto_ahash_setkey()
212 err = tfm->setkey(tfm, key, keylen); in crypto_ahash_setkey()
215 ahash_set_needkey(tfm); in crypto_ahash_setkey()
219 crypto_ahash_clear_flags(tfm, CRYPTO_TFM_NEED_KEY); in crypto_ahash_setkey()
232 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ahash_save_req() local
233 unsigned long alignmask = crypto_ahash_alignmask(tfm); in ahash_save_req()
234 unsigned int ds = crypto_ahash_digestsize(tfm); in ahash_save_req()
362 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_op() local
363 unsigned long alignmask = crypto_ahash_alignmask(tfm); in crypto_ahash_op()
373 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_final() local
374 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_final()
387 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_finup() local
388 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_finup()
401 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in crypto_ahash_digest() local
402 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_digest()
407 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_ahash_digest()
410 ret = crypto_ahash_op(req, tfm->digest); in crypto_ahash_digest()
464 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in ahash_def_finup() local
471 err = tfm->update(req); in ahash_def_finup()
478 static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) in crypto_ahash_init_tfm() argument
480 struct crypto_ahash *hash = __crypto_ahash_cast(tfm); in crypto_ahash_init_tfm()
485 if (tfm->__crt_alg->cra_type != &crypto_ahash_type) in crypto_ahash_init_tfm()
486 return crypto_init_shash_ops_async(tfm); in crypto_ahash_init_tfm()