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: ecc - Use ECC_CURVE_NIST_P192/256/384_DIGITS where possible

Replace hard-coded numbers with ECC_CURVE_NIST_P192/256/384_DIGITS where
possible.

Tested-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Stefan Berger and committed by
Herbert Xu
526d23fc 0880bb3b

+6 -6
+6 -6
crypto/ecc.c
··· 689 689 static void vli_mmod_fast_192(u64 *result, const u64 *product, 690 690 const u64 *curve_prime, u64 *tmp) 691 691 { 692 - const unsigned int ndigits = 3; 692 + const unsigned int ndigits = ECC_CURVE_NIST_P192_DIGITS; 693 693 int carry; 694 694 695 695 vli_set(result, product, ndigits); ··· 717 717 const u64 *curve_prime, u64 *tmp) 718 718 { 719 719 int carry; 720 - const unsigned int ndigits = 4; 720 + const unsigned int ndigits = ECC_CURVE_NIST_P256_DIGITS; 721 721 722 722 /* t */ 723 723 vli_set(result, product, ndigits); ··· 800 800 const u64 *curve_prime, u64 *tmp) 801 801 { 802 802 int carry; 803 - const unsigned int ndigits = 6; 803 + const unsigned int ndigits = ECC_CURVE_NIST_P384_DIGITS; 804 804 805 805 /* t */ 806 806 vli_set(result, product, ndigits); ··· 932 932 } 933 933 934 934 switch (ndigits) { 935 - case 3: 935 + case ECC_CURVE_NIST_P192_DIGITS: 936 936 vli_mmod_fast_192(result, product, curve_prime, tmp); 937 937 break; 938 - case 4: 938 + case ECC_CURVE_NIST_P256_DIGITS: 939 939 vli_mmod_fast_256(result, product, curve_prime, tmp); 940 940 break; 941 - case 6: 941 + case ECC_CURVE_NIST_P384_DIGITS: 942 942 vli_mmod_fast_384(result, product, curve_prime, tmp); 943 943 break; 944 944 default: