Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: hisilicon/hpre - Use helper to set reqsize

The value of reqsize must only be changed through the helper.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: Longfang Liu <liulongfang@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

+13 -6
+13 -6
drivers/crypto/hisilicon/hpre/hpre_crypto.c
··· 740 740 { 741 741 struct hpre_ctx *ctx = kpp_tfm_ctx(tfm); 742 742 743 + kpp_set_reqsize(tfm, sizeof(struct hpre_asym_request) + HPRE_ALIGN_SZ); 744 + 743 745 return hpre_ctx_init(ctx, HPRE_V2_ALG_TYPE); 744 746 } 745 747 ··· 1166 1164 pr_err("Can not alloc_akcipher!\n"); 1167 1165 return PTR_ERR(ctx->rsa.soft_tfm); 1168 1166 } 1167 + 1168 + akcipher_set_reqsize(tfm, sizeof(struct hpre_asym_request) + 1169 + HPRE_ALIGN_SZ); 1169 1170 1170 1171 ret = hpre_ctx_init(ctx, HPRE_V2_ALG_TYPE); 1171 1172 if (ret) ··· 1622 1617 1623 1618 ctx->curve_id = ECC_CURVE_NIST_P192; 1624 1619 1620 + kpp_set_reqsize(tfm, sizeof(struct hpre_asym_request) + HPRE_ALIGN_SZ); 1621 + 1625 1622 return hpre_ctx_init(ctx, HPRE_V3_ECC_ALG_TYPE); 1626 1623 } 1627 1624 ··· 1633 1626 1634 1627 ctx->curve_id = ECC_CURVE_NIST_P256; 1635 1628 1629 + kpp_set_reqsize(tfm, sizeof(struct hpre_asym_request) + HPRE_ALIGN_SZ); 1630 + 1636 1631 return hpre_ctx_init(ctx, HPRE_V3_ECC_ALG_TYPE); 1637 1632 } 1638 1633 ··· 1643 1634 struct hpre_ctx *ctx = kpp_tfm_ctx(tfm); 1644 1635 1645 1636 ctx->curve_id = ECC_CURVE_NIST_P384; 1637 + 1638 + kpp_set_reqsize(tfm, sizeof(struct hpre_asym_request) + HPRE_ALIGN_SZ); 1646 1639 1647 1640 return hpre_ctx_init(ctx, HPRE_V3_ECC_ALG_TYPE); 1648 1641 } ··· 1972 1961 { 1973 1962 struct hpre_ctx *ctx = kpp_tfm_ctx(tfm); 1974 1963 1964 + kpp_set_reqsize(tfm, sizeof(struct hpre_asym_request) + HPRE_ALIGN_SZ); 1965 + 1975 1966 return hpre_ctx_init(ctx, HPRE_V3_ECC_ALG_TYPE); 1976 1967 } 1977 1968 ··· 1994 1981 .max_size = hpre_rsa_max_size, 1995 1982 .init = hpre_rsa_init_tfm, 1996 1983 .exit = hpre_rsa_exit_tfm, 1997 - .reqsize = sizeof(struct hpre_asym_request) + HPRE_ALIGN_SZ, 1998 1984 .base = { 1999 1985 .cra_ctxsize = sizeof(struct hpre_ctx), 2000 1986 .cra_priority = HPRE_CRYPTO_ALG_PRI, ··· 2010 1998 .max_size = hpre_dh_max_size, 2011 1999 .init = hpre_dh_init_tfm, 2012 2000 .exit = hpre_dh_exit_tfm, 2013 - .reqsize = sizeof(struct hpre_asym_request) + HPRE_ALIGN_SZ, 2014 2001 .base = { 2015 2002 .cra_ctxsize = sizeof(struct hpre_ctx), 2016 2003 .cra_priority = HPRE_CRYPTO_ALG_PRI, ··· 2027 2016 .max_size = hpre_ecdh_max_size, 2028 2017 .init = hpre_ecdh_nist_p192_init_tfm, 2029 2018 .exit = hpre_ecdh_exit_tfm, 2030 - .reqsize = sizeof(struct hpre_asym_request) + HPRE_ALIGN_SZ, 2031 2019 .base = { 2032 2020 .cra_ctxsize = sizeof(struct hpre_ctx), 2033 2021 .cra_priority = HPRE_CRYPTO_ALG_PRI, ··· 2041 2031 .max_size = hpre_ecdh_max_size, 2042 2032 .init = hpre_ecdh_nist_p256_init_tfm, 2043 2033 .exit = hpre_ecdh_exit_tfm, 2044 - .reqsize = sizeof(struct hpre_asym_request) + HPRE_ALIGN_SZ, 2045 2034 .base = { 2046 2035 .cra_ctxsize = sizeof(struct hpre_ctx), 2047 2036 .cra_priority = HPRE_CRYPTO_ALG_PRI, ··· 2055 2046 .max_size = hpre_ecdh_max_size, 2056 2047 .init = hpre_ecdh_nist_p384_init_tfm, 2057 2048 .exit = hpre_ecdh_exit_tfm, 2058 - .reqsize = sizeof(struct hpre_asym_request) + HPRE_ALIGN_SZ, 2059 2049 .base = { 2060 2050 .cra_ctxsize = sizeof(struct hpre_ctx), 2061 2051 .cra_priority = HPRE_CRYPTO_ALG_PRI, ··· 2072 2064 .max_size = hpre_curve25519_max_size, 2073 2065 .init = hpre_curve25519_init_tfm, 2074 2066 .exit = hpre_curve25519_exit_tfm, 2075 - .reqsize = sizeof(struct hpre_asym_request) + HPRE_ALIGN_SZ, 2076 2067 .base = { 2077 2068 .cra_ctxsize = sizeof(struct hpre_ctx), 2078 2069 .cra_priority = HPRE_CRYPTO_ALG_PRI,