diff options
author | Stefan Berger <stefanb@linux.ibm.com> | 2024-04-04 16:18:48 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2024-04-12 09:07:52 +0200 |
commit | c0d6bd1fd367a5374bff7e3f3bdf47beb84893c8 (patch) | |
tree | e599648a46283c0efbaba045b872648f6d01a757 /include/crypto | |
parent | crypto: ecdsa - Extend res.x mod n calculation for NIST P521 (diff) | |
download | linux-c0d6bd1fd367a5374bff7e3f3bdf47beb84893c8.tar.xz linux-c0d6bd1fd367a5374bff7e3f3bdf47beb84893c8.zip |
crypto: ecc - Add nbits field to ecc_curve structure
Add the number of bits a curve has to the ecc_curve definition to be able
to derive the number of bytes a curve requires for its coordinates from it.
It also allows one to identify a curve by its particular size. Set the
number of bits on all curve definitions.
Tested-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/ecc_curve.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/crypto/ecc_curve.h b/include/crypto/ecc_curve.h index 70964781eb68..7d90c5e82266 100644 --- a/include/crypto/ecc_curve.h +++ b/include/crypto/ecc_curve.h @@ -23,6 +23,7 @@ struct ecc_point { * struct ecc_curve - definition of elliptic curve * * @name: Short name of the curve. + * @nbits: The number of bits of a curve. * @g: Generator point of the curve. * @p: Prime number, if Barrett's reduction is used for this curve * pre-calculated value 'mu' is appended to the @p after ndigits. @@ -34,6 +35,7 @@ struct ecc_point { */ struct ecc_curve { char *name; + u32 nbits; struct ecc_point g; u64 *p; u64 *n; |