ECC double point: SECP112R2 and SEC128R2 are Koblitz curves

SECP112r2 and SECP128R2 are Koblitz curves, so don't compile them in
unless HAVE_ECC_KOBLITZ is defined. This requires custom curves which
enables point doubling to support A != -3.
This commit is contained in:
Sean Parkinson
2023-11-07 12:32:28 +10:00
parent 8f7adb2c16
commit 2213306386

View File

@@ -337,7 +337,7 @@ enum {
#endif
#define ecc_oid_secp112r1_sz CODED_SECP112R1_SZ
#endif /* !NO_ECC_SECP */
#ifdef HAVE_ECC_SECPR2
#if defined(HAVE_ECC_SECPR2) && defined(HAVE_ECC_KOBLITZ)
#ifdef HAVE_OID_ENCODING
#define CODED_SECP112R2 {1,3,132,0,7}
#define CODED_SECP112R2_SZ 5
@@ -351,7 +351,7 @@ enum {
#define ecc_oid_secp112r2 CODED_SECP112R2
#endif
#define ecc_oid_secp112r2_sz CODED_SECP112R2_SZ
#endif /* HAVE_ECC_SECPR2 */
#endif /* HAVE_ECC_SECPR2 && HAVE_ECC_KOBLITZ */
#endif /* ECC112 */
#ifdef ECC128
#ifndef NO_ECC_SECP
@@ -369,7 +369,7 @@ enum {
#endif
#define ecc_oid_secp128r1_sz CODED_SECP128R1_SZ
#endif /* !NO_ECC_SECP */
#ifdef HAVE_ECC_SECPR2
#if defined(HAVE_ECC_SECPR2) && defined(HAVE_ECC_KOBLITZ)
#ifdef HAVE_OID_ENCODING
#define CODED_SECP128R2 {1,3,132,0,29}
#define CODED_SECP128R2_SZ 5
@@ -383,7 +383,7 @@ enum {
#define ecc_oid_secp128r2 CODED_SECP128R2
#endif
#define ecc_oid_secp128r2_sz CODED_SECP128R2_SZ
#endif /* HAVE_ECC_SECPR2 */
#endif /* HAVE_ECC_SECPR2 && HAVE_ECC_KOBLITZ */
#endif /* ECC128 */
#ifdef ECC160
#ifndef FP_ECC
@@ -790,7 +790,7 @@ const ecc_set_type ecc_sets[] = {
1, /* cofactor */
},
#endif /* !NO_ECC_SECP */
#ifdef HAVE_ECC_SECPR2
#if defined(HAVE_ECC_SECPR2) && defined(HAVE_ECC_KOBLITZ)
{
14, /* size/bytes */
ECC_SECP112R2, /* ID */
@@ -806,7 +806,7 @@ const ecc_set_type ecc_sets[] = {
ECC_SECP112R2_OID, /* oid sum */
4, /* cofactor */
},
#endif /* HAVE_ECC_SECPR2 */
#endif /* HAVE_ECC_SECPR2 && HAVE_ECC_KOBLITZ */
#endif /* ECC112 */
#ifdef ECC128
#ifndef NO_ECC_SECP
@@ -826,7 +826,7 @@ const ecc_set_type ecc_sets[] = {
1, /* cofactor */
},
#endif /* !NO_ECC_SECP */
#ifdef HAVE_ECC_SECPR2
#if defined(HAVE_ECC_SECPR2) && defined(HAVE_ECC_KOBLITZ)
{
16, /* size/bytes */
ECC_SECP128R2, /* ID */
@@ -842,7 +842,7 @@ const ecc_set_type ecc_sets[] = {
ECC_SECP128R2_OID, /* oid sum */
4, /* cofactor */
},
#endif /* HAVE_ECC_SECPR2 */
#endif /* HAVE_ECC_SECPR2 && HAVE_ECC_KOBLITZ */
#endif /* ECC128 */
#ifdef ECC160
#ifndef FP_ECC