crypto: ecc - Implement vli_mmod_fast_521 for NIST p521
authorStefan Berger <stefanb@linux.ibm.com>
Thu, 4 Apr 2024 14:18:49 +0000 (10:18 -0400)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 12 Apr 2024 07:07:52 +0000 (15:07 +0800)
commite7fb062754ef9f656ee004f2be8f59ce8a79bffb
tree1f93573ef86eb6e7133dd14d5e6e90ceb94f3fa7
parentc0d6bd1fd367a5374bff7e3f3bdf47beb84893c8
crypto: ecc - Implement vli_mmod_fast_521 for NIST p521

Implement vli_mmod_fast_521 following the description for how to calculate
the modulus for NIST P521 in the NIST publication "Recommendations for
Discrete Logarithm-Based Cryptography: Elliptic Curve Domain Parameters"
section G.1.4.

NIST p521 requires 9 64bit digits, so increase the ECC_MAX_DIGITS so that
the vli digit array provides enough elements to fit the larger integers
required by this curve.

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>
crypto/ecc.c
include/crypto/internal/ecc.h