Lines Matching defs:tfm
470 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
487 walk->blocksize = crypto_skcipher_blocksize(tfm);
488 walk->stride = crypto_skcipher_walksize(tfm);
489 walk->ivsize = crypto_skcipher_ivsize(tfm);
490 walk->alignmask = crypto_skcipher_alignmask(tfm);
526 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
552 walk->blocksize = crypto_aead_blocksize(tfm);
553 walk->stride = crypto_aead_chunksize(tfm);
554 walk->ivsize = crypto_aead_ivsize(tfm);
555 walk->alignmask = crypto_aead_alignmask(tfm);
577 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
579 walk->total = req->cryptlen - crypto_aead_authsize(tfm);
585 static void skcipher_set_needkey(struct crypto_skcipher *tfm)
587 if (crypto_skcipher_max_keysize(tfm) != 0)
588 crypto_skcipher_set_flags(tfm, CRYPTO_TFM_NEED_KEY);
591 static int skcipher_setkey_unaligned(struct crypto_skcipher *tfm,
594 unsigned long alignmask = crypto_skcipher_alignmask(tfm);
595 struct skcipher_alg *cipher = crypto_skcipher_alg(tfm);
607 ret = cipher->setkey(tfm, alignbuffer, keylen);
612 int crypto_skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key,
615 struct skcipher_alg *cipher = crypto_skcipher_alg(tfm);
616 unsigned long alignmask = crypto_skcipher_alignmask(tfm);
623 err = skcipher_setkey_unaligned(tfm, key, keylen);
625 err = cipher->setkey(tfm, key, keylen);
628 skcipher_set_needkey(tfm);
632 crypto_skcipher_clear_flags(tfm, CRYPTO_TFM_NEED_KEY);
639 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
640 struct skcipher_alg *alg = crypto_skcipher_alg(tfm);
650 if (crypto_skcipher_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
661 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
662 struct skcipher_alg *alg = crypto_skcipher_alg(tfm);
672 if (crypto_skcipher_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
681 static void crypto_skcipher_exit_tfm(struct crypto_tfm *tfm)
683 struct crypto_skcipher *skcipher = __crypto_skcipher_cast(tfm);
689 static int crypto_skcipher_init_tfm(struct crypto_tfm *tfm)
691 struct crypto_skcipher *skcipher = __crypto_skcipher_cast(tfm);
810 struct crypto_skcipher *tfm;
815 tfm = crypto_alloc_tfm(alg_name, &crypto_skcipher_type, type, mask);
821 if (!IS_ERR(tfm) && WARN_ON(crypto_skcipher_reqsize(tfm) >
823 crypto_free_skcipher(tfm);
827 return (struct crypto_sync_skcipher *)tfm;
925 static int skcipher_setkey_simple(struct crypto_skcipher *tfm, const u8 *key,
928 struct crypto_cipher *cipher = skcipher_cipher_simple(tfm);
931 crypto_cipher_set_flags(cipher, crypto_skcipher_get_flags(tfm) &
936 static int skcipher_init_tfm_simple(struct crypto_skcipher *tfm)
938 struct skcipher_instance *inst = skcipher_alg_instance(tfm);
940 struct skcipher_ctx_simple *ctx = crypto_skcipher_ctx(tfm);
951 static void skcipher_exit_tfm_simple(struct crypto_skcipher *tfm)
953 struct skcipher_ctx_simple *ctx = crypto_skcipher_ctx(tfm);
971 * overridden if needed. The tfm context defaults to skcipher_ctx_simple, and