Lines Matching defs:tfm

447 	shash->tfm = data->ctx->shash;
833 static void sa_cipher_cra_exit(struct crypto_skcipher *tfm)
835 struct sa_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
839 __func__, tfm, ctx->enc.sc_id, &ctx->enc.sc_phys,
848 static int sa_cipher_cra_init(struct crypto_skcipher *tfm)
850 struct sa_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
852 const char *name = crypto_tfm_alg_name(&tfm->base);
876 crypto_skcipher_set_reqsize(tfm, crypto_skcipher_reqsize(child) +
880 __func__, tfm, ctx->enc.sc_id, &ctx->enc.sc_phys,
885 static int sa_cipher_setkey(struct crypto_skcipher *tfm, const u8 *key,
888 struct sa_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
903 cfg.iv_size = crypto_skcipher_ivsize(tfm);
906 crypto_skcipher_set_flags(child, tfm->base.crt_flags &
947 static int sa_aes_cbc_setkey(struct crypto_skcipher *tfm, const u8 *key,
964 return sa_cipher_setkey(tfm, key, keylen, &ad);
967 static int sa_aes_ecb_setkey(struct crypto_skcipher *tfm, const u8 *key,
982 return sa_cipher_setkey(tfm, key, keylen, &ad);
985 static int sa_3des_cbc_setkey(struct crypto_skcipher *tfm, const u8 *key,
996 return sa_cipher_setkey(tfm, key, keylen, &ad);
999 static int sa_3des_ecb_setkey(struct crypto_skcipher *tfm, const u8 *key,
1007 return sa_cipher_setkey(tfm, key, keylen, &ad);
1301 struct crypto_alg *alg = req->base.tfm->__crt_alg;
1357 struct crypto_ahash *tfm;
1366 tfm = crypto_ahash_reqtfm(req);
1367 authsize = crypto_ahash_digestsize(tfm);
1382 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1383 int sa_digest_size = crypto_ahash_digestsize(tfm);
1492 static int sa_sha_cra_init_alg(struct crypto_tfm *tfm, const char *alg_base)
1494 struct sa_tfm_ctx *ctx = crypto_tfm_ctx(tfm);
1524 __func__, tfm, ctx->enc.sc_id, &ctx->enc.sc_phys,
1527 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
1541 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1543 struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
1546 crypto_ahash_digestsize(tfm), rctx);
1557 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1559 struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
1572 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1574 struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
1586 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1588 struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
1604 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1605 struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
1617 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1618 struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
1627 static int sa_sha1_cra_init(struct crypto_tfm *tfm)
1630 struct sa_tfm_ctx *ctx = crypto_tfm_ctx(tfm);
1632 sa_sha_cra_init_alg(tfm, "sha1");
1643 static int sa_sha256_cra_init(struct crypto_tfm *tfm)
1646 struct sa_tfm_ctx *ctx = crypto_tfm_ctx(tfm);
1648 sa_sha_cra_init_alg(tfm, "sha256");
1659 static int sa_sha512_cra_init(struct crypto_tfm *tfm)
1662 struct sa_tfm_ctx *ctx = crypto_tfm_ctx(tfm);
1664 sa_sha_cra_init_alg(tfm, "sha512");
1675 static void sa_sha_cra_exit(struct crypto_tfm *tfm)
1677 struct sa_tfm_ctx *ctx = crypto_tfm_ctx(tfm);
1681 __func__, tfm, ctx->enc.sc_id, &ctx->enc.sc_phys,
1684 if (crypto_tfm_alg_type(tfm) == CRYPTO_ALG_TYPE_AHASH)
1695 struct crypto_aead *tfm;
1706 tfm = crypto_aead_reqtfm(req);
1708 authsize = crypto_aead_authsize(tfm);
1730 static int sa_cra_init_aead(struct crypto_aead *tfm, const char *hash,
1733 struct sa_tfm_ctx *ctx = crypto_aead_ctx(tfm);
1755 crypto_aead_set_reqsize(tfm, sizeof(struct aead_request) +
1769 __func__, tfm, ctx->enc.sc_id, &ctx->enc.sc_phys,
1775 static int sa_cra_init_aead_sha1(struct crypto_aead *tfm)
1777 return sa_cra_init_aead(tfm, "sha1",
1781 static int sa_cra_init_aead_sha256(struct crypto_aead *tfm)
1783 return sa_cra_init_aead(tfm, "sha256",
1787 static void sa_exit_tfm_aead(struct crypto_aead *tfm)
1789 struct sa_tfm_ctx *ctx = crypto_aead_ctx(tfm);
1876 static int sa_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize)
1878 struct sa_tfm_ctx *ctx = crypto_tfm_ctx(crypto_aead_tfm(tfm));
1911 struct crypto_aead *tfm = crypto_aead_reqtfm(req);
1912 struct sa_tfm_ctx *ctx = crypto_aead_ctx(tfm);
1920 enc_size -= crypto_aead_authsize(tfm);
1921 auth_size -= crypto_aead_authsize(tfm);