Lines Matching refs:tfm

111 	struct crypto_tfm *tfm = req->base.tfm;  in ablkcipher_walk_done()  local
142 memcpy(req->info, walk->iv, tfm->crt_ablkcipher.ivsize); in ablkcipher_walk_done()
190 struct crypto_tfm *tfm, in ablkcipher_copy_iv() argument
194 unsigned int ivsize = tfm->crt_ablkcipher.ivsize; in ablkcipher_copy_iv()
228 struct crypto_tfm *tfm = req->base.tfm; in ablkcipher_walk_next() local
233 alignmask = crypto_tfm_alg_alignmask(tfm); in ablkcipher_walk_next()
235 if (unlikely(n < crypto_tfm_alg_blocksize(tfm))) { in ablkcipher_walk_next()
273 struct crypto_tfm *tfm = req->base.tfm; in ablkcipher_walk_first() local
276 alignmask = crypto_tfm_alg_alignmask(tfm); in ablkcipher_walk_first()
287 int err = ablkcipher_copy_iv(walk, tfm, alignmask); in ablkcipher_walk_first()
302 walk->blocksize = crypto_tfm_alg_blocksize(req->base.tfm); in ablkcipher_walk_phys()
307 static int setkey_unaligned(struct crypto_ablkcipher *tfm, const u8 *key, in setkey_unaligned() argument
310 struct ablkcipher_alg *cipher = crypto_ablkcipher_alg(tfm); in setkey_unaligned()
311 unsigned long alignmask = crypto_ablkcipher_alignmask(tfm); in setkey_unaligned()
323 ret = cipher->setkey(tfm, alignbuffer, keylen); in setkey_unaligned()
329 static int setkey(struct crypto_ablkcipher *tfm, const u8 *key, in setkey() argument
332 struct ablkcipher_alg *cipher = crypto_ablkcipher_alg(tfm); in setkey()
333 unsigned long alignmask = crypto_ablkcipher_alignmask(tfm); in setkey()
336 crypto_ablkcipher_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); in setkey()
341 return setkey_unaligned(tfm, key, keylen); in setkey()
343 return cipher->setkey(tfm, key, keylen); in setkey()
362 static int crypto_init_ablkcipher_ops(struct crypto_tfm *tfm, u32 type, in crypto_init_ablkcipher_ops() argument
365 struct ablkcipher_alg *alg = &tfm->__crt_alg->cra_ablkcipher; in crypto_init_ablkcipher_ops()
366 struct ablkcipher_tfm *crt = &tfm->crt_ablkcipher; in crypto_init_ablkcipher_ops()
378 crt->base = __crypto_ablkcipher_cast(tfm); in crypto_init_ablkcipher_ops()
444 static int crypto_init_givcipher_ops(struct crypto_tfm *tfm, u32 type, in crypto_init_givcipher_ops() argument
447 struct ablkcipher_alg *alg = &tfm->__crt_alg->cra_ablkcipher; in crypto_init_givcipher_ops()
448 struct ablkcipher_tfm *crt = &tfm->crt_ablkcipher; in crypto_init_givcipher_ops()
453 crt->setkey = tfm->__crt_alg->cra_flags & CRYPTO_ALG_GENIV ? in crypto_init_givcipher_ops()
459 crt->base = __crypto_ablkcipher_cast(tfm); in crypto_init_givcipher_ops()
676 struct crypto_tfm *tfm; in crypto_alloc_ablkcipher() local
691 tfm = __crypto_alloc_tfm(alg, type, mask); in crypto_alloc_ablkcipher()
692 if (!IS_ERR(tfm)) in crypto_alloc_ablkcipher()
693 return __crypto_ablkcipher_cast(tfm); in crypto_alloc_ablkcipher()
696 err = PTR_ERR(tfm); in crypto_alloc_ablkcipher()