Lines Matching defs:tfm

450 	struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
451 struct skcipher_alg *alg = crypto_skcipher_alg(tfm);
468 walk->blocksize = crypto_skcipher_blocksize(tfm);
469 walk->ivsize = crypto_skcipher_ivsize(tfm);
470 walk->alignmask = crypto_skcipher_alignmask(tfm);
511 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
537 walk->blocksize = crypto_aead_blocksize(tfm);
538 walk->stride = crypto_aead_chunksize(tfm);
539 walk->ivsize = crypto_aead_ivsize(tfm);
540 walk->alignmask = crypto_aead_alignmask(tfm);
562 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
564 walk->total = req->cryptlen - crypto_aead_authsize(tfm);
570 static void skcipher_set_needkey(struct crypto_skcipher *tfm)
572 if (crypto_skcipher_max_keysize(tfm) != 0)
573 crypto_skcipher_set_flags(tfm, CRYPTO_TFM_NEED_KEY);
576 static int skcipher_setkey_unaligned(struct crypto_skcipher *tfm,
579 unsigned long alignmask = crypto_skcipher_alignmask(tfm);
580 struct skcipher_alg *cipher = crypto_skcipher_alg(tfm);
592 ret = cipher->setkey(tfm, alignbuffer, keylen);
597 int crypto_skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key,
600 struct skcipher_alg *cipher = crypto_skcipher_alg(tfm);
601 unsigned long alignmask = crypto_skcipher_alignmask(tfm);
605 struct crypto_lskcipher **ctx = crypto_skcipher_ctx(tfm);
609 crypto_skcipher_get_flags(tfm) &
619 err = skcipher_setkey_unaligned(tfm, key, keylen);
621 err = cipher->setkey(tfm, key, keylen);
625 skcipher_set_needkey(tfm);
629 crypto_skcipher_clear_flags(tfm, CRYPTO_TFM_NEED_KEY);
636 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
637 struct skcipher_alg *alg = crypto_skcipher_alg(tfm);
639 if (crypto_skcipher_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
649 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
650 struct skcipher_alg *alg = crypto_skcipher_alg(tfm);
652 if (crypto_skcipher_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
662 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
665 ivs = PTR_ALIGN(ivs, crypto_skcipher_alignmask(tfm) + 1);
667 memcpy(out, ivs + crypto_skcipher_ivsize(tfm),
668 crypto_skcipher_statesize(tfm));
675 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
678 ivs = PTR_ALIGN(ivs, crypto_skcipher_alignmask(tfm) + 1);
680 memcpy(ivs + crypto_skcipher_ivsize(tfm), in,
681 crypto_skcipher_statesize(tfm));
698 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
699 struct skcipher_alg *alg = crypto_skcipher_alg(tfm);
709 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
710 struct skcipher_alg *alg = crypto_skcipher_alg(tfm);
718 static void crypto_skcipher_exit_tfm(struct crypto_tfm *tfm)
720 struct crypto_skcipher *skcipher = __crypto_skcipher_cast(tfm);
726 static int crypto_skcipher_init_tfm(struct crypto_tfm *tfm)
728 struct crypto_skcipher *skcipher = __crypto_skcipher_cast(tfm);
733 if (tfm->__crt_alg->cra_type != &crypto_skcipher_type) {
742 return crypto_init_lskcipher_ops_sg(tfm);
843 struct crypto_skcipher *tfm;
848 tfm = crypto_alloc_tfm(alg_name, &crypto_skcipher_type, type, mask);
854 if (!IS_ERR(tfm) && WARN_ON(crypto_skcipher_reqsize(tfm) >
856 crypto_free_skcipher(tfm);
860 return (struct crypto_sync_skcipher *)tfm;
978 static int skcipher_setkey_simple(struct crypto_skcipher *tfm, const u8 *key,
981 struct crypto_cipher *cipher = skcipher_cipher_simple(tfm);
984 crypto_cipher_set_flags(cipher, crypto_skcipher_get_flags(tfm) &
989 static int skcipher_init_tfm_simple(struct crypto_skcipher *tfm)
991 struct skcipher_instance *inst = skcipher_alg_instance(tfm);
993 struct skcipher_ctx_simple *ctx = crypto_skcipher_ctx(tfm);
1004 static void skcipher_exit_tfm_simple(struct crypto_skcipher *tfm)
1006 struct skcipher_ctx_simple *ctx = crypto_skcipher_ctx(tfm);
1024 * overridden if needed. The tfm context defaults to skcipher_ctx_simple, and