Lines Matching defs:tfm

130 static int ahash_setkey_unaligned(struct crypto_ahash *tfm, const u8 *key,
133 unsigned long alignmask = crypto_ahash_alignmask(tfm);
145 ret = tfm->setkey(tfm, alignbuffer, keylen);
150 static int ahash_nosetkey(struct crypto_ahash *tfm, const u8 *key,
156 static void ahash_set_needkey(struct crypto_ahash *tfm)
158 const struct hash_alg_common *alg = crypto_hash_alg_common(tfm);
160 if (tfm->setkey != ahash_nosetkey &&
162 crypto_ahash_set_flags(tfm, CRYPTO_TFM_NEED_KEY);
165 int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
168 unsigned long alignmask = crypto_ahash_alignmask(tfm);
172 err = ahash_setkey_unaligned(tfm, key, keylen);
174 err = tfm->setkey(tfm, key, keylen);
177 ahash_set_needkey(tfm);
181 crypto_ahash_clear_flags(tfm, CRYPTO_TFM_NEED_KEY);
189 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
190 unsigned long alignmask = crypto_ahash_alignmask(tfm);
191 unsigned int ds = crypto_ahash_digestsize(tfm);
200 reqsize = crypto_ahash_reqsize(tfm);
212 ahash_request_set_tfm(subreq, tfm);
223 state = kmalloc(crypto_ahash_statesize(tfm), gfp);
290 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
291 unsigned long alignmask = crypto_ahash_alignmask(tfm);
299 return crypto_hash_errstat(crypto_hash_alg_common(tfm), err);
304 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
305 struct hash_alg_common *alg = crypto_hash_alg_common(tfm);
310 return crypto_ahash_op(req, tfm->final, true);
316 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
317 struct hash_alg_common *alg = crypto_hash_alg_common(tfm);
326 return crypto_ahash_op(req, tfm->finup, true);
332 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
333 struct hash_alg_common *alg = crypto_hash_alg_common(tfm);
342 if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
345 return crypto_ahash_op(req, tfm->digest, false);
400 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
407 err = tfm->update(req->priv);
414 static void crypto_ahash_exit_tfm(struct crypto_tfm *tfm)
416 struct crypto_ahash *hash = __crypto_ahash_cast(tfm);
422 static int crypto_ahash_init_tfm(struct crypto_tfm *tfm)
424 struct crypto_ahash *hash = __crypto_ahash_cast(tfm);
431 if (tfm->__crt_alg->cra_type != &crypto_ahash_type)
432 return crypto_init_shash_ops_async(tfm);
448 tfm->exit = crypto_ahash_exit_tfm;
545 struct crypto_tfm *tfm = crypto_ahash_tfm(hash);
551 tfm = crypto_tfm_get(tfm);
552 if (IS_ERR(tfm))
553 return ERR_CAST(tfm);
558 nhash = crypto_clone_tfm(&crypto_ahash_type, tfm);
574 if (tfm->__crt_alg->cra_type != &crypto_ahash_type)