Lines Matching defs:tfm

422 	shash->tfm = data->ctx->shash;
810 static void sa_cipher_cra_exit(struct crypto_skcipher *tfm)
812 struct sa_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
816 __func__, tfm, ctx->enc.sc_id, &ctx->enc.sc_phys,
825 static int sa_cipher_cra_init(struct crypto_skcipher *tfm)
827 struct sa_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
829 const char *name = crypto_tfm_alg_name(&tfm->base);
853 __func__, tfm, ctx->enc.sc_id, &ctx->enc.sc_phys,
858 static int sa_cipher_setkey(struct crypto_skcipher *tfm, const u8 *key,
861 struct sa_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
875 cfg.iv_size = crypto_skcipher_ivsize(tfm);
880 tfm->base.crt_flags &
921 static int sa_aes_cbc_setkey(struct crypto_skcipher *tfm, const u8 *key,
938 return sa_cipher_setkey(tfm, key, keylen, &ad);
941 static int sa_aes_ecb_setkey(struct crypto_skcipher *tfm, const u8 *key,
956 return sa_cipher_setkey(tfm, key, keylen, &ad);
959 static int sa_3des_cbc_setkey(struct crypto_skcipher *tfm, const u8 *key,
970 return sa_cipher_setkey(tfm, key, keylen, &ad);
973 static int sa_3des_ecb_setkey(struct crypto_skcipher *tfm, const u8 *key,
981 return sa_cipher_setkey(tfm, key, keylen, &ad);
1275 struct crypto_alg *alg = req->base.tfm->__crt_alg;
1334 struct crypto_ahash *tfm;
1343 tfm = crypto_ahash_reqtfm(req);
1344 authsize = crypto_ahash_digestsize(tfm);
1359 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1360 int sa_digest_size = crypto_ahash_digestsize(tfm);
1468 static int sa_sha_cra_init_alg(struct crypto_tfm *tfm, const char *alg_base)
1470 struct sa_tfm_ctx *ctx = crypto_tfm_ctx(tfm);
1500 __func__, tfm, ctx->enc.sc_id, &ctx->enc.sc_phys,
1503 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
1517 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1519 struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
1522 crypto_ahash_digestsize(tfm), rctx);
1533 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1535 struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
1548 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1550 struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
1562 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1564 struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
1580 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1581 struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
1593 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1594 struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
1603 static int sa_sha1_cra_init(struct crypto_tfm *tfm)
1606 struct sa_tfm_ctx *ctx = crypto_tfm_ctx(tfm);
1608 sa_sha_cra_init_alg(tfm, "sha1");
1619 static int sa_sha256_cra_init(struct crypto_tfm *tfm)
1622 struct sa_tfm_ctx *ctx = crypto_tfm_ctx(tfm);
1624 sa_sha_cra_init_alg(tfm, "sha256");
1635 static int sa_sha512_cra_init(struct crypto_tfm *tfm)
1638 struct sa_tfm_ctx *ctx = crypto_tfm_ctx(tfm);
1640 sa_sha_cra_init_alg(tfm, "sha512");
1651 static void sa_sha_cra_exit(struct crypto_tfm *tfm)
1653 struct sa_tfm_ctx *ctx = crypto_tfm_ctx(tfm);
1657 __func__, tfm, ctx->enc.sc_id, &ctx->enc.sc_phys,
1660 if (crypto_tfm_alg_type(tfm) == CRYPTO_ALG_TYPE_AHASH)
1671 struct crypto_aead *tfm;
1683 tfm = crypto_aead_reqtfm(req);
1685 authsize = crypto_aead_authsize(tfm);
1710 static int sa_cra_init_aead(struct crypto_aead *tfm, const char *hash,
1713 struct sa_tfm_ctx *ctx = crypto_aead_ctx(tfm);
1734 crypto_aead_set_reqsize(tfm, sizeof(struct aead_request) +
1748 __func__, tfm, ctx->enc.sc_id, &ctx->enc.sc_phys,
1754 static int sa_cra_init_aead_sha1(struct crypto_aead *tfm)
1756 return sa_cra_init_aead(tfm, "sha1",
1760 static int sa_cra_init_aead_sha256(struct crypto_aead *tfm)
1762 return sa_cra_init_aead(tfm, "sha256",
1766 static void sa_exit_tfm_aead(struct crypto_aead *tfm)
1768 struct sa_tfm_ctx *ctx = crypto_aead_ctx(tfm);
1855 static int sa_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize)
1857 struct sa_tfm_ctx *ctx = crypto_tfm_ctx(crypto_aead_tfm(tfm));
1890 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
1891 struct sa_tfm_ctx *ctx = crypto_aead_ctx(tfm);
1899 enc_size -= crypto_aead_authsize(tfm);
1900 auth_size -= crypto_aead_authsize(tfm);