summaryrefslogtreecommitdiff
path: root/crypto/ecc.h
diff options
context:
space:
mode:
authorSaulo Alessandre <saulo.alessandre@tse.jus.br>2021-03-16 17:07:34 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2021-03-26 19:41:58 +1100
commit2f64c0b78fc58a4dac336a3b1f611fe866b1cd24 (patch)
tree632da8cdfe137479d02fc86296569ea3c1438c7e /crypto/ecc.h
parent9f8a901b7ebf10355faa58f017be1bb26841b4b5 (diff)
downloadlinux-crypto-2f64c0b78fc58a4dac336a3b1f611fe866b1cd24.tar.gz
linux-crypto-2f64c0b78fc58a4dac336a3b1f611fe866b1cd24.zip
crypto: ecc - Add math to support fast NIST P384
Add the math needed for NIST P384 and adapt certain functions' parameters so that the ecc_curve is passed to vli_mmod_fast. This allows to identify the curve by its name prefix and the appropriate function for fast mmod calculation can be used. Summary of changes: * crypto/ecc.c - add vli_mmod_fast_384 - change some routines to pass ecc_curve forward until vli_mmod_fast * crypto/ecc.h - add ECC_CURVE_NIST_P384_DIGITS - change ECC_MAX_DIGITS to P384 size Signed-off-by: Saulo Alessandre <saulo.alessandre@tse.jus.br> Tested-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/ecc.h')
-rw-r--r--crypto/ecc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/ecc.h b/crypto/ecc.h
index e0e2aed0..3bee655d 100644
--- a/crypto/ecc.h
+++ b/crypto/ecc.h
@@ -29,7 +29,8 @@
/* One digit is u64 qword. */
#define ECC_CURVE_NIST_P192_DIGITS 3
#define ECC_CURVE_NIST_P256_DIGITS 4
-#define ECC_MAX_DIGITS (512 / 64)
+#define ECC_CURVE_NIST_P384_DIGITS 6
+#define ECC_MAX_DIGITS (512 / 64) /* due to ecrdsa */
#define ECC_DIGITS_TO_BYTES_SHIFT 3