Lines Matching refs:tfm

19 int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,  in shash_no_setkey()  argument
26 static void shash_set_needkey(struct crypto_shash *tfm, struct shash_alg *alg) in shash_set_needkey() argument
29 crypto_shash_set_flags(tfm, CRYPTO_TFM_NEED_KEY); in shash_set_needkey()
32 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key, in crypto_shash_setkey() argument
35 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_setkey()
38 err = shash->setkey(tfm, key, keylen); in crypto_shash_setkey()
40 shash_set_needkey(tfm, shash); in crypto_shash_setkey()
44 crypto_shash_clear_flags(tfm, CRYPTO_TFM_NEED_KEY); in crypto_shash_setkey()
52 return crypto_shash_alg(desc->tfm)->update(desc, data, len); in crypto_shash_update()
58 return crypto_shash_alg(desc->tfm)->final(desc, out); in crypto_shash_final()
65 struct shash_alg *shash = crypto_shash_alg(desc->tfm); in shash_default_finup()
74 return crypto_shash_alg(desc->tfm)->finup(desc, data, len, out); in crypto_shash_finup()
81 struct shash_alg *shash = crypto_shash_alg(desc->tfm); in shash_default_digest()
90 struct crypto_shash *tfm = desc->tfm; in crypto_shash_digest() local
92 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_digest()
95 return crypto_shash_alg(tfm)->digest(desc, data, len, out); in crypto_shash_digest()
99 int crypto_shash_tfm_digest(struct crypto_shash *tfm, const u8 *data, in crypto_shash_tfm_digest() argument
102 SHASH_DESC_ON_STACK(desc, tfm); in crypto_shash_tfm_digest()
105 desc->tfm = tfm; in crypto_shash_tfm_digest()
117 struct crypto_shash *tfm = desc->tfm; in crypto_shash_export() local
118 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_export()
123 memcpy(out, shash_desc_ctx(desc), crypto_shash_descsize(tfm)); in crypto_shash_export()
130 struct crypto_shash *tfm = desc->tfm; in crypto_shash_import() local
131 struct shash_alg *shash = crypto_shash_alg(tfm); in crypto_shash_import()
133 if (crypto_shash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY) in crypto_shash_import()
139 memcpy(shash_desc_ctx(desc), in, crypto_shash_descsize(tfm)); in crypto_shash_import()
144 static void crypto_shash_exit_tfm(struct crypto_tfm *tfm) in crypto_shash_exit_tfm() argument
146 struct crypto_shash *hash = __crypto_shash_cast(tfm); in crypto_shash_exit_tfm()
152 static int crypto_shash_init_tfm(struct crypto_tfm *tfm) in crypto_shash_init_tfm() argument
154 struct crypto_shash *hash = __crypto_shash_cast(tfm); in crypto_shash_init_tfm()
163 tfm->exit = crypto_shash_exit_tfm; in crypto_shash_init_tfm()
256 struct crypto_tfm *tfm = crypto_shash_tfm(hash); in crypto_clone_shash() local
262 tfm = crypto_tfm_get(tfm); in crypto_clone_shash()
263 if (IS_ERR(tfm)) in crypto_clone_shash()
264 return ERR_CAST(tfm); in crypto_clone_shash()
272 nhash = crypto_clone_tfm(&crypto_shash_type, tfm); in crypto_clone_shash()