Lines Matching defs:tfm
451 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
468 walk->blocksize = crypto_skcipher_blocksize(tfm);
469 walk->stride = crypto_skcipher_walksize(tfm);
470 walk->ivsize = crypto_skcipher_ivsize(tfm);
471 walk->alignmask = crypto_skcipher_alignmask(tfm);
513 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
539 walk->blocksize = crypto_aead_blocksize(tfm);
540 walk->stride = crypto_aead_chunksize(tfm);
541 walk->ivsize = crypto_aead_ivsize(tfm);
542 walk->alignmask = crypto_aead_alignmask(tfm);
564 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
566 walk->total = req->cryptlen - crypto_aead_authsize(tfm);
572 static void skcipher_set_needkey(struct crypto_skcipher *tfm)
574 if (crypto_skcipher_max_keysize(tfm) != 0)
575 crypto_skcipher_set_flags(tfm, CRYPTO_TFM_NEED_KEY);
578 static int skcipher_setkey_unaligned(struct crypto_skcipher *tfm,
581 unsigned long alignmask = crypto_skcipher_alignmask(tfm);
582 struct skcipher_alg *cipher = crypto_skcipher_alg(tfm);
594 ret = cipher->setkey(tfm, alignbuffer, keylen);
599 int crypto_skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key,
602 struct skcipher_alg *cipher = crypto_skcipher_alg(tfm);
603 unsigned long alignmask = crypto_skcipher_alignmask(tfm);
610 err = skcipher_setkey_unaligned(tfm, key, keylen);
612 err = cipher->setkey(tfm, key, keylen);
615 skcipher_set_needkey(tfm);
619 crypto_skcipher_clear_flags(tfm, CRYPTO_TFM_NEED_KEY);
626 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
627 struct crypto_alg *alg = tfm->base.__crt_alg;
632 if (crypto_skcipher_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
635 ret = crypto_skcipher_alg(tfm)->encrypt(req);
643 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
644 struct crypto_alg *alg = tfm->base.__crt_alg;
649 if (crypto_skcipher_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
652 ret = crypto_skcipher_alg(tfm)->decrypt(req);
658 static void crypto_skcipher_exit_tfm(struct crypto_tfm *tfm)
660 struct crypto_skcipher *skcipher = __crypto_skcipher_cast(tfm);
666 static int crypto_skcipher_init_tfm(struct crypto_tfm *tfm)
668 struct crypto_skcipher *skcipher = __crypto_skcipher_cast(tfm);
768 struct crypto_skcipher *tfm;
773 tfm = crypto_alloc_tfm(alg_name, &crypto_skcipher_type, type, mask);
779 if (!IS_ERR(tfm) && WARN_ON(crypto_skcipher_reqsize(tfm) >
781 crypto_free_skcipher(tfm);
785 return (struct crypto_sync_skcipher *)tfm;
879 static int skcipher_setkey_simple(struct crypto_skcipher *tfm, const u8 *key,
882 struct crypto_cipher *cipher = skcipher_cipher_simple(tfm);
885 crypto_cipher_set_flags(cipher, crypto_skcipher_get_flags(tfm) &
890 static int skcipher_init_tfm_simple(struct crypto_skcipher *tfm)
892 struct skcipher_instance *inst = skcipher_alg_instance(tfm);
894 struct skcipher_ctx_simple *ctx = crypto_skcipher_ctx(tfm);
905 static void skcipher_exit_tfm_simple(struct crypto_skcipher *tfm)
907 struct skcipher_ctx_simple *ctx = crypto_skcipher_ctx(tfm);
925 * overridden if needed. The tfm context defaults to skcipher_ctx_simple, and