mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
Merge pull request #8901 from SparkiDev/ecc_config_fixex_1
ECC configuration fixes
This commit is contained in:
@ -62834,11 +62834,13 @@ static const sp_digit p256_order[8] = {
|
||||
0x00000000,0xffffffff
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P256 minus 2. */
|
||||
static const sp_digit p256_order2[8] = {
|
||||
0xfc63254f,0xf3b9cac2,0xa7179e84,0xbce6faad,0xffffffff,0xffffffff,
|
||||
0x00000000,0xffffffff
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[8] = {
|
||||
@ -62876,7 +62878,8 @@ static const sp_point_256 p256_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p256_b[8] = {
|
||||
0x27d2604b,0x3bce3c3e,0xcc53b0f6,0x651d06b0,0x769886bc,0xb3ebbd55,
|
||||
0xaa3a93e7,0x5ac635d8
|
||||
@ -78249,6 +78252,7 @@ int sp_ecc_mulmod_base_add_256(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* a A single precision integer.
|
||||
@ -78287,6 +78291,7 @@ static void sp_256_add_one_8(sp_digit* a)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -81217,7 +81222,7 @@ int sp_ecc_verify_256_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -81786,7 +81791,7 @@ static const sp_digit p384_norm_mod[12] = {
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x00000001;
|
||||
static const sp_digit p384_mp_mod = 0x00000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P384. */
|
||||
@ -81795,11 +81800,13 @@ static const sp_digit p384_order[12] = {
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P384 minus 2. */
|
||||
static const sp_digit p384_order2[12] = {
|
||||
0xccc52971,0xecec196a,0x48b0a77a,0x581a0db2,0xf4372ddf,0xc7634d81,
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[12] = {
|
||||
@ -81809,7 +81816,7 @@ static const sp_digit p384_norm_order[12] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0xe88fdc45;
|
||||
static const sp_digit p384_mp_order = 0xe88fdc45;
|
||||
#endif
|
||||
/* The base point of curve P384. */
|
||||
static const sp_point_384 p384_base = {
|
||||
@ -81840,7 +81847,8 @@ static const sp_point_384 p384_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p384_b[12] = {
|
||||
0xd3ec2aef,0x2a85c8ed,0x8a2ed19d,0xc656398d,0x5013875a,0x0314088f,
|
||||
0xfe814112,0x181d9c6e,0xe3f82d19,0x988e056b,0xe23ee7e4,0xb3312fa7
|
||||
@ -96412,6 +96420,7 @@ int sp_ecc_mulmod_base_add_384(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* a A single precision integer.
|
||||
@ -96456,6 +96465,7 @@ static void sp_384_add_one_12(sp_digit* a)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -99619,7 +99629,7 @@ int sp_ecc_verify_384_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -100220,7 +100230,7 @@ static const sp_digit p521_norm_mod[17] = {
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P521. */
|
||||
static sp_digit p521_mp_mod = 0x00000001;
|
||||
static const sp_digit p521_mp_mod = 0x00000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P521. */
|
||||
@ -100230,12 +100240,14 @@ static const sp_digit p521_order[17] = {
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x000001ff
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P521 minus 2. */
|
||||
static const sp_digit p521_order2[17] = {
|
||||
0x91386407,0xbb6fb71e,0x899c47ae,0x3bb5c9b8,0xf709a5d0,0x7fcc0148,
|
||||
0xbf2f966b,0x51868783,0xfffffffa,0xffffffff,0xffffffff,0xffffffff,
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x000001ff
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P521. */
|
||||
static const sp_digit p521_norm_order[17] = {
|
||||
@ -100246,7 +100258,7 @@ static const sp_digit p521_norm_order[17] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P521. */
|
||||
static sp_digit p521_mp_order = 0x79a995c7;
|
||||
static const sp_digit p521_mp_order = 0x79a995c7;
|
||||
#endif
|
||||
/* The base point of curve P521. */
|
||||
static const sp_point_521 p521_base = {
|
||||
@ -100283,7 +100295,8 @@ static const sp_point_521 p521_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p521_b[17] = {
|
||||
0x6b503f00,0xef451fd4,0x3d2c34f1,0x3573df88,0x3bb1bf07,0x1652c0bd,
|
||||
0xec7e937b,0x56193951,0x8ef109e1,0xb8b48991,0x99b315f3,0xa2da725b,
|
||||
@ -124501,6 +124514,7 @@ int sp_ecc_mulmod_base_add_521(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* a A single precision integer.
|
||||
@ -124554,6 +124568,7 @@ static void sp_521_add_one_17(sp_digit* a)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -128921,7 +128936,7 @@ int sp_ecc_verify_521_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -159628,7 +159643,7 @@ int sp_Pairing_precomp_1024(const ecc_point* pm, const ecc_point* qm,
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
|
@ -21745,11 +21745,13 @@ static const sp_digit p256_order[4] = {
|
||||
0xffffffff00000000L
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P256 minus 2. */
|
||||
static const sp_digit p256_order2[4] = {
|
||||
0xf3b9cac2fc63254fL,0xbce6faada7179e84L,0xffffffffffffffffL,
|
||||
0xffffffff00000000L
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[4] = {
|
||||
@ -21786,7 +21788,8 @@ static const sp_point_256 p256_base = {
|
||||
0
|
||||
};
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p256_b[4] = {
|
||||
0x3bce3c3e27d2604bL,0x651d06b0cc53b0f6L,0xb3ebbd55769886bcL,
|
||||
0x5ac635d8aa3a93e7L
|
||||
@ -39614,6 +39617,7 @@ int sp_ecc_mulmod_base_add_256(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* a A single precision integer.
|
||||
@ -39636,6 +39640,7 @@ static void sp_256_add_one_4(sp_digit* a)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -42051,7 +42056,7 @@ int sp_ecc_verify_256_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
@ -42664,7 +42669,7 @@ static const sp_digit p384_norm_mod[6] = {
|
||||
0x0000000000000000L,0x0000000000000000L,0x0000000000000000L
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x0000000100000001;
|
||||
static const sp_digit p384_mp_mod = 0x0000000100000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P384. */
|
||||
@ -42673,11 +42678,13 @@ static const sp_digit p384_order[6] = {
|
||||
0xffffffffffffffffL,0xffffffffffffffffL,0xffffffffffffffffL
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P384 minus 2. */
|
||||
static const sp_digit p384_order2[6] = {
|
||||
0xecec196accc52971L,0x581a0db248b0a77aL,0xc7634d81f4372ddfL,
|
||||
0xffffffffffffffffL,0xffffffffffffffffL,0xffffffffffffffffL
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[6] = {
|
||||
@ -42687,7 +42694,7 @@ static const sp_digit p384_norm_order[6] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0x6ed46089e88fdc45L;
|
||||
static const sp_digit p384_mp_order = 0x6ed46089e88fdc45L;
|
||||
#endif
|
||||
#ifdef WOLFSSL_SP_SMALL
|
||||
/* The base point of curve P384. */
|
||||
@ -42717,7 +42724,8 @@ static const sp_point_384 p384_base = {
|
||||
0
|
||||
};
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p384_b[6] = {
|
||||
0x2a85c8edd3ec2aefL,0xc656398d8a2ed19dL,0x0314088f5013875aL,
|
||||
0x181d9c6efe814112L,0x988e056be3f82d19L,0xb3312fa7e23ee7e4L
|
||||
@ -66354,6 +66362,7 @@ int sp_ecc_mulmod_base_add_384(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* a A single precision integer.
|
||||
@ -66380,6 +66389,7 @@ static void sp_384_add_one_6(sp_digit* a)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -68152,7 +68162,7 @@ int sp_ecc_verify_384_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -68753,7 +68763,7 @@ static const sp_digit p521_norm_mod[9] = {
|
||||
0x0000000000000000L,0x0000000000000000L,0x0000000000000000L
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P521. */
|
||||
static sp_digit p521_mp_mod = 0x0000000000000001;
|
||||
static const sp_digit p521_mp_mod = 0x0000000000000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P521. */
|
||||
@ -68763,12 +68773,14 @@ static const sp_digit p521_order[9] = {
|
||||
0xffffffffffffffffL,0xffffffffffffffffL,0x00000000000001ffL
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P521 minus 2. */
|
||||
static const sp_digit p521_order2[9] = {
|
||||
0xbb6fb71e91386407L,0x3bb5c9b8899c47aeL,0x7fcc0148f709a5d0L,
|
||||
0x51868783bf2f966bL,0xfffffffffffffffaL,0xffffffffffffffffL,
|
||||
0xffffffffffffffffL,0xffffffffffffffffL,0x00000000000001ffL
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P521. */
|
||||
static const sp_digit p521_norm_order[9] = {
|
||||
@ -68779,7 +68791,7 @@ static const sp_digit p521_norm_order[9] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P521. */
|
||||
static sp_digit p521_mp_order = 0x1d2f5ccd79a995c7L;
|
||||
static const sp_digit p521_mp_order = 0x1d2f5ccd79a995c7L;
|
||||
#endif
|
||||
#ifdef WOLFSSL_SP_SMALL
|
||||
/* The base point of curve P521. */
|
||||
@ -68812,7 +68824,8 @@ static const sp_point_521 p521_base = {
|
||||
0
|
||||
};
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p521_b[9] = {
|
||||
0xef451fd46b503f00L,0x3573df883d2c34f1L,0x1652c0bd3bb1bf07L,
|
||||
0x56193951ec7e937bL,0xb8b489918ef109e1L,0xa2da725b99b315f3L,
|
||||
@ -111488,6 +111501,7 @@ int sp_ecc_mulmod_base_add_521(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* a A single precision integer.
|
||||
@ -111522,6 +111536,7 @@ static void sp_521_add_one_9(sp_digit* a)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -113074,7 +113089,7 @@ int sp_ecc_verify_521_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -125109,7 +125124,7 @@ int sp_Pairing_precomp_1024(const ecc_point* pm, const ecc_point* qm,
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
|
@ -96690,11 +96690,13 @@ static const sp_digit p256_order[8] = {
|
||||
0x00000000,0xffffffff
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P256 minus 2. */
|
||||
static const sp_digit p256_order2[8] = {
|
||||
0xfc63254f,0xf3b9cac2,0xa7179e84,0xbce6faad,0xffffffff,0xffffffff,
|
||||
0x00000000,0xffffffff
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[8] = {
|
||||
@ -96732,7 +96734,8 @@ static const sp_point_256 p256_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p256_b[8] = {
|
||||
0x27d2604b,0x3bce3c3e,0xcc53b0f6,0x651d06b0,0x769886bc,0xb3ebbd55,
|
||||
0xaa3a93e7,0x5ac635d8
|
||||
@ -103819,6 +103822,7 @@ int sp_ecc_mulmod_base_add_256(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* a A single precision integer.
|
||||
@ -103904,6 +103908,7 @@ SP_NOINLINE static void sp_256_add_one_8(sp_digit* a)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -107681,7 +107686,7 @@ int sp_ecc_verify_256_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -108250,7 +108255,7 @@ static const sp_digit p384_norm_mod[12] = {
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x00000001;
|
||||
static const sp_digit p384_mp_mod = 0x00000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P384. */
|
||||
@ -108259,11 +108264,13 @@ static const sp_digit p384_order[12] = {
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P384 minus 2. */
|
||||
static const sp_digit p384_order2[12] = {
|
||||
0xccc52971,0xecec196a,0x48b0a77a,0x581a0db2,0xf4372ddf,0xc7634d81,
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[12] = {
|
||||
@ -108273,7 +108280,7 @@ static const sp_digit p384_norm_order[12] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0xe88fdc45;
|
||||
static const sp_digit p384_mp_order = 0xe88fdc45;
|
||||
#endif
|
||||
/* The base point of curve P384. */
|
||||
static const sp_point_384 p384_base = {
|
||||
@ -108304,7 +108311,8 @@ static const sp_point_384 p384_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p384_b[12] = {
|
||||
0xd3ec2aef,0x2a85c8ed,0x8a2ed19d,0xc656398d,0x5013875a,0x0314088f,
|
||||
0xfe814112,0x181d9c6e,0xe3f82d19,0x988e056b,0xe23ee7e4,0xb3312fa7
|
||||
@ -114692,6 +114700,7 @@ int sp_ecc_mulmod_base_add_384(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* a A single precision integer.
|
||||
@ -114813,6 +114822,7 @@ SP_NOINLINE static void sp_384_add_one_12(sp_digit* a)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -118866,7 +118876,7 @@ int sp_ecc_verify_384_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -119467,7 +119477,7 @@ static const sp_digit p521_norm_mod[17] = {
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P521. */
|
||||
static sp_digit p521_mp_mod = 0x00000001;
|
||||
static const sp_digit p521_mp_mod = 0x00000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P521. */
|
||||
@ -119477,12 +119487,14 @@ static const sp_digit p521_order[17] = {
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x000001ff
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P521 minus 2. */
|
||||
static const sp_digit p521_order2[17] = {
|
||||
0x91386407,0xbb6fb71e,0x899c47ae,0x3bb5c9b8,0xf709a5d0,0x7fcc0148,
|
||||
0xbf2f966b,0x51868783,0xfffffffa,0xffffffff,0xffffffff,0xffffffff,
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x000001ff
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P521. */
|
||||
static const sp_digit p521_norm_order[17] = {
|
||||
@ -119493,7 +119505,7 @@ static const sp_digit p521_norm_order[17] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P521. */
|
||||
static sp_digit p521_mp_order = 0x79a995c7;
|
||||
static const sp_digit p521_mp_order = 0x79a995c7;
|
||||
#endif
|
||||
/* The base point of curve P521. */
|
||||
static const sp_point_521 p521_base = {
|
||||
@ -119530,7 +119542,8 @@ static const sp_point_521 p521_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p521_b[17] = {
|
||||
0x6b503f00,0xef451fd4,0x3d2c34f1,0x3573df88,0x3bb1bf07,0x1652c0bd,
|
||||
0xec7e937b,0x56193951,0x8ef109e1,0xb8b48991,0x99b315f3,0xa2da725b,
|
||||
@ -128889,6 +128902,7 @@ int sp_ecc_mulmod_base_add_521(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* a A single precision integer.
|
||||
@ -129055,6 +129069,7 @@ SP_NOINLINE static void sp_521_add_one_17(sp_digit* a)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -135798,7 +135813,7 @@ int sp_ecc_verify_521_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -218497,7 +218512,7 @@ int sp_Pairing_precomp_1024(const ecc_point* pm, const ecc_point* qm,
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
|
@ -19973,11 +19973,13 @@ static const sp_digit p256_order[9] = {
|
||||
0x0003ffff,0x1fe00000,0x00ffffff
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P256 minus 2. */
|
||||
static const sp_digit p256_order2[9] = {
|
||||
0x1c63254f,0x1dce5617,0x05e7a13c,0x0df55b4e,0x1ffffbce,0x1fffffff,
|
||||
0x0003ffff,0x1fe00000,0x00ffffff
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[9] = {
|
||||
@ -20015,7 +20017,8 @@ static const sp_point_256 p256_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p256_b[9] = {
|
||||
0x07d2604b,0x1e71e1f1,0x14ec3d8e,0x1a0d6198,0x086bc651,0x1eaabb4c,
|
||||
0x0f9ecfae,0x1b154752,0x005ac635
|
||||
@ -24790,6 +24793,7 @@ int sp_ecc_mulmod_base_add_256(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -24801,6 +24805,7 @@ SP_NOINLINE static void sp_256_add_one_9(sp_digit* a)
|
||||
sp_256_norm_9(a);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -26467,7 +26472,7 @@ int sp_ecc_verify_256_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -27038,7 +27043,7 @@ static const sp_digit p384_norm_mod[15] = {
|
||||
0x0000000
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x000001;
|
||||
static const sp_digit p384_mp_mod = 0x000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P384. */
|
||||
@ -27048,12 +27053,14 @@ static const sp_digit p384_order[15] = {
|
||||
0x00fffff
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P384 minus 2. */
|
||||
static const sp_digit p384_order2[15] = {
|
||||
0x0c52971,0x3065ab3,0x277aece,0x2c922c2,0x3581a0d,0x10dcb77,0x234d81f,
|
||||
0x3ffff1d,0x3ffffff,0x3ffffff,0x3ffffff,0x3ffffff,0x3ffffff,0x3ffffff,
|
||||
0x00fffff
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[15] = {
|
||||
@ -27064,7 +27071,7 @@ static const sp_digit p384_norm_order[15] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0x8fdc45;
|
||||
static const sp_digit p384_mp_order = 0x8fdc45;
|
||||
#endif
|
||||
/* The base point of curve P384. */
|
||||
static const sp_point_384 p384_base = {
|
||||
@ -27098,7 +27105,8 @@ static const sp_point_384 p384_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p384_b[15] = {
|
||||
0x3ec2aef,0x1723b74,0x119d2a8,0x23628bb,0x2c65639,0x004e1d6,0x14088f5,
|
||||
0x104480c,0x06efe81,0x2460767,0x23f82d1,0x23815af,0x2e7e498,0x3e9f88f,
|
||||
@ -32831,6 +32839,7 @@ int sp_ecc_mulmod_base_add_384(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -32842,6 +32851,7 @@ SP_NOINLINE static void sp_384_add_one_15(sp_digit* a)
|
||||
sp_384_norm_15(a);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -34523,7 +34533,7 @@ int sp_ecc_verify_384_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -35124,7 +35134,7 @@ static const sp_digit p521_norm_mod[21] = {
|
||||
0x0000000,0x0000000,0x0000000,0x0000000,0x0000000,0x0000000,0x0000000
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P521. */
|
||||
static sp_digit p521_mp_mod = 0x000001;
|
||||
static const sp_digit p521_mp_mod = 0x000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P521. */
|
||||
@ -35134,12 +35144,14 @@ static const sp_digit p521_order[21] = {
|
||||
0x1ffffff,0x1ffffff,0x1ffffff,0x1ffffff,0x1ffffff,0x1ffffff,0x01fffff
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P521 minus 2. */
|
||||
static const sp_digit p521_order2[21] = {
|
||||
0x1386407,0x1db8f48,0x1ebaedb,0x1113388,0x1bb5c9b,0x04d2e81,0x00523dc,
|
||||
0x0d6ff98,0x1bf2f96,0x0c343c1,0x1fffe94,0x1ffffff,0x1ffffff,0x1ffffff,
|
||||
0x1ffffff,0x1ffffff,0x1ffffff,0x1ffffff,0x1ffffff,0x1ffffff,0x01fffff
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P521. */
|
||||
static const sp_digit p521_norm_order[21] = {
|
||||
@ -35150,7 +35162,7 @@ static const sp_digit p521_norm_order[21] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P521. */
|
||||
static sp_digit p521_mp_order = 0x1a995c7;
|
||||
static const sp_digit p521_mp_order = 0x1a995c7;
|
||||
#endif
|
||||
/* The base point of curve P521. */
|
||||
static const sp_point_521 p521_base = {
|
||||
@ -35190,7 +35202,8 @@ static const sp_point_521 p521_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p521_b[21] = {
|
||||
0x1503f00,0x08fea35,0x13c7bd1,0x107a586,0x1573df8,0x18df839,0x102f4ee,
|
||||
0x0f62ca5,0x1ec7e93,0x10c9ca8,0x0427855,0x13231de,0x13b8b48,0x0cd98af,
|
||||
@ -40920,6 +40933,7 @@ int sp_ecc_mulmod_base_add_521(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -40931,6 +40945,7 @@ SP_NOINLINE static void sp_521_add_one_21(sp_digit* a)
|
||||
sp_521_norm_21(a);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -42673,7 +42688,7 @@ int sp_ecc_verify_521_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -54491,7 +54506,7 @@ int sp_Pairing_precomp_1024(const ecc_point* pm, const ecc_point* qm,
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
|
@ -21122,11 +21122,13 @@ static const sp_digit p256_order[5] = {
|
||||
0x0ffffffff0000L
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P256 minus 2. */
|
||||
static const sp_digit p256_order2[5] = {
|
||||
0x9cac2fc63254fL,0xada7179e84f3bL,0xfffffffbce6faL,0x0000fffffffffL,
|
||||
0x0ffffffff0000L
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[5] = {
|
||||
@ -21161,7 +21163,8 @@ static const sp_point_256 p256_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p256_b[5] = {
|
||||
0xe3c3e27d2604bL,0xb0cc53b0f63bcL,0x69886bc651d06L,0x93e7b3ebbd557L,
|
||||
0x05ac635d8aa3aL
|
||||
@ -25686,6 +25689,7 @@ int sp_ecc_mulmod_base_add_256(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -25697,6 +25701,7 @@ SP_NOINLINE static void sp_256_add_one_5(sp_digit* a)
|
||||
sp_256_norm_5(a);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -27350,7 +27355,7 @@ int sp_ecc_verify_256_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -27919,7 +27924,7 @@ static const sp_digit p384_norm_mod[7] = {
|
||||
0x00000000000000L,0x00000000000000L,0x00000000000000L
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x0000100000001;
|
||||
static const sp_digit p384_mp_mod = 0x0000100000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P384. */
|
||||
@ -27928,11 +27933,13 @@ static const sp_digit p384_order[7] = {
|
||||
0x7fffffffffffffL,0x7fffffffffffffL,0x3fffffffffffffL
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P384 minus 2. */
|
||||
static const sp_digit p384_order2[7] = {
|
||||
0x6c196accc52971L,0x1b6491614ef5d9L,0x07d0dcb77d6068L,0x7ffffffe3b1a6cL,
|
||||
0x7fffffffffffffL,0x7fffffffffffffL,0x3fffffffffffffL
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[7] = {
|
||||
@ -27942,7 +27949,7 @@ static const sp_digit p384_norm_order[7] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0x546089e88fdc45L;
|
||||
static const sp_digit p384_mp_order = 0x546089e88fdc45L;
|
||||
#endif
|
||||
/* The base point of curve P384. */
|
||||
static const sp_point_384 p384_base = {
|
||||
@ -27970,7 +27977,8 @@ static const sp_point_384 p384_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p384_b[7] = {
|
||||
0x05c8edd3ec2aefL,0x731b145da33a55L,0x3d404e1d6b1958L,0x740a089018a044L,
|
||||
0x02d19181d9c6efL,0x7c9311c0ad7c7fL,0x2ccc4be9f88fb9L
|
||||
@ -33152,6 +33160,7 @@ int sp_ecc_mulmod_base_add_384(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -33163,6 +33172,7 @@ SP_NOINLINE static void sp_384_add_one_7(sp_digit* a)
|
||||
sp_384_norm_7(a);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -34793,7 +34803,7 @@ int sp_ecc_verify_384_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -35394,7 +35404,7 @@ static const sp_digit p521_norm_mod[9] = {
|
||||
0x000000000000000L
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P521. */
|
||||
static sp_digit p521_mp_mod = 0x00000000000001;
|
||||
static const sp_digit p521_mp_mod = 0x00000000000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P521. */
|
||||
@ -35404,12 +35414,14 @@ static const sp_digit p521_order[9] = {
|
||||
0x1ffffffffffffffL
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P521 minus 2. */
|
||||
static const sp_digit p521_order2[9] = {
|
||||
0x36fb71e91386407L,0x1726e226711ebaeL,0x0148f709a5d03bbL,0x20efcbe59adff30L,
|
||||
0x3fffffffa518687L,0x3ffffffffffffffL,0x3ffffffffffffffL,0x3ffffffffffffffL,
|
||||
0x1ffffffffffffffL
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P521. */
|
||||
static const sp_digit p521_norm_order[9] = {
|
||||
@ -35420,7 +35432,7 @@ static const sp_digit p521_norm_order[9] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P521. */
|
||||
static sp_digit p521_mp_order = 0x12f5ccd79a995c7L;
|
||||
static const sp_digit p521_mp_order = 0x12f5ccd79a995c7L;
|
||||
#endif
|
||||
/* The base point of curve P521. */
|
||||
static const sp_point_521 p521_base = {
|
||||
@ -35451,7 +35463,8 @@ static const sp_point_521 p521_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p521_b[9] = {
|
||||
0x3451fd46b503f00L,0x0f7e20f4b0d3c7bL,0x00bd3bb1bf07357L,0x147b1fa4dec594bL,
|
||||
0x18ef109e1561939L,0x26cc57cee2d2264L,0x0540eea2da725b9L,0x2687e4a688682daL,
|
||||
@ -40569,6 +40582,7 @@ int sp_ecc_mulmod_base_add_521(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -40580,6 +40594,7 @@ SP_NOINLINE static void sp_521_add_one_9(sp_digit* a)
|
||||
sp_521_norm_9(a);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -42253,7 +42268,7 @@ int sp_ecc_verify_521_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -53064,7 +53079,7 @@ int sp_Pairing_precomp_1024(const ecc_point* pm, const ecc_point* qm,
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
|
@ -31652,11 +31652,13 @@ static const sp_digit p256_order[8] = {
|
||||
0x00000000,0xffffffff
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P256 minus 2. */
|
||||
static const sp_digit p256_order2[8] = {
|
||||
0xfc63254f,0xf3b9cac2,0xa7179e84,0xbce6faad,0xffffffff,0xffffffff,
|
||||
0x00000000,0xffffffff
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[8] = {
|
||||
@ -31694,7 +31696,8 @@ static const sp_point_256 p256_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p256_b[8] = {
|
||||
0x27d2604b,0x3bce3c3e,0xcc53b0f6,0x651d06b0,0x769886bc,0xb3ebbd55,
|
||||
0xaa3a93e7,0x5ac635d8
|
||||
@ -39666,6 +39669,7 @@ int sp_ecc_mulmod_base_add_256(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* a A single precision integer.
|
||||
@ -39699,6 +39703,7 @@ static void sp_256_add_one_8(sp_digit* a)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -41977,7 +41982,7 @@ int sp_ecc_verify_256_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -42546,7 +42551,7 @@ static const sp_digit p384_norm_mod[12] = {
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x00000001;
|
||||
static const sp_digit p384_mp_mod = 0x00000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P384. */
|
||||
@ -42555,11 +42560,13 @@ static const sp_digit p384_order[12] = {
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P384 minus 2. */
|
||||
static const sp_digit p384_order2[12] = {
|
||||
0xccc52971,0xecec196a,0x48b0a77a,0x581a0db2,0xf4372ddf,0xc7634d81,
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[12] = {
|
||||
@ -42569,7 +42576,7 @@ static const sp_digit p384_norm_order[12] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0xe88fdc45;
|
||||
static const sp_digit p384_mp_order = 0xe88fdc45;
|
||||
#endif
|
||||
/* The base point of curve P384. */
|
||||
static const sp_point_384 p384_base = {
|
||||
@ -42600,7 +42607,8 @@ static const sp_point_384 p384_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p384_b[12] = {
|
||||
0xd3ec2aef,0x2a85c8ed,0x8a2ed19d,0xc656398d,0x5013875a,0x0314088f,
|
||||
0xfe814112,0x181d9c6e,0xe3f82d19,0x988e056b,0xe23ee7e4,0xb3312fa7
|
||||
@ -49777,6 +49785,7 @@ int sp_ecc_mulmod_base_add_384(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* a A single precision integer.
|
||||
@ -49816,6 +49825,7 @@ static void sp_384_add_one_12(sp_digit* a)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -52091,7 +52101,7 @@ int sp_ecc_verify_384_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -52692,7 +52702,7 @@ static const sp_digit p521_norm_mod[17] = {
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P521. */
|
||||
static sp_digit p521_mp_mod = 0x00000001;
|
||||
static const sp_digit p521_mp_mod = 0x00000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P521. */
|
||||
@ -52702,12 +52712,14 @@ static const sp_digit p521_order[17] = {
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x000001ff
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P521 minus 2. */
|
||||
static const sp_digit p521_order2[17] = {
|
||||
0x91386407,0xbb6fb71e,0x899c47ae,0x3bb5c9b8,0xf709a5d0,0x7fcc0148,
|
||||
0xbf2f966b,0x51868783,0xfffffffa,0xffffffff,0xffffffff,0xffffffff,
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x000001ff
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P521. */
|
||||
static const sp_digit p521_norm_order[17] = {
|
||||
@ -52718,7 +52730,7 @@ static const sp_digit p521_norm_order[17] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P521. */
|
||||
static sp_digit p521_mp_order = 0x79a995c7;
|
||||
static const sp_digit p521_mp_order = 0x79a995c7;
|
||||
#endif
|
||||
/* The base point of curve P521. */
|
||||
static const sp_point_521 p521_base = {
|
||||
@ -52755,7 +52767,8 @@ static const sp_point_521 p521_base = {
|
||||
/* infinity */
|
||||
0
|
||||
};
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p521_b[17] = {
|
||||
0x6b503f00,0xef451fd4,0x3d2c34f1,0x3573df88,0x3bb1bf07,0x1652c0bd,
|
||||
0xec7e937b,0x56193951,0x8ef109e1,0xb8b48991,0x99b315f3,0xa2da725b,
|
||||
@ -62581,6 +62594,7 @@ int sp_ecc_mulmod_base_add_521(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
/* Add 1 to a. (a = a + 1)
|
||||
*
|
||||
* a A single precision integer.
|
||||
@ -62629,6 +62643,7 @@ static void sp_521_add_one_17(sp_digit* a)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
@ -65719,7 +65734,7 @@ int sp_ecc_verify_521_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -82233,7 +82248,7 @@ int sp_Pairing_precomp_1024(const ecc_point* pm, const ecc_point* qm,
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Read big endian unsigned byte array into r.
|
||||
*
|
||||
* r A single precision integer.
|
||||
|
@ -8021,11 +8021,13 @@ static const sp_digit p256_order[4] = {
|
||||
0xffffffff00000000L
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P256 minus 2. */
|
||||
static const sp_digit p256_order2[4] = {
|
||||
0xf3b9cac2fc63254fL,0xbce6faada7179e84L,0xffffffffffffffffL,
|
||||
0xffffffff00000000L
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[4] = {
|
||||
@ -8062,7 +8064,8 @@ static const sp_point_256 p256_base = {
|
||||
0
|
||||
};
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p256_b[4] = {
|
||||
0x3bce3c3e27d2604bL,0x651d06b0cc53b0f6L,0xb3ebbd55769886bcL,
|
||||
0x5ac635d8aa3a93e7L
|
||||
@ -24510,6 +24513,7 @@ int sp_ecc_mulmod_base_add_256(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -24517,6 +24521,7 @@ extern void sp_256_add_one_4(sp_digit* a);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -26433,7 +26438,7 @@ int sp_ecc_verify_256_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -27098,7 +27103,7 @@ static const sp_digit p384_norm_mod[6] = {
|
||||
0x0000000000000000L,0x0000000000000000L,0x0000000000000000L
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x0000000100000001;
|
||||
static const sp_digit p384_mp_mod = 0x0000000100000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P384. */
|
||||
@ -27107,11 +27112,13 @@ static const sp_digit p384_order[6] = {
|
||||
0xffffffffffffffffL,0xffffffffffffffffL,0xffffffffffffffffL
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P384 minus 2. */
|
||||
static const sp_digit p384_order2[6] = {
|
||||
0xecec196accc52971L,0x581a0db248b0a77aL,0xc7634d81f4372ddfL,
|
||||
0xffffffffffffffffL,0xffffffffffffffffL,0xffffffffffffffffL
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[6] = {
|
||||
@ -27121,7 +27128,7 @@ static const sp_digit p384_norm_order[6] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0x6ed46089e88fdc45L;
|
||||
static const sp_digit p384_mp_order = 0x6ed46089e88fdc45L;
|
||||
#endif
|
||||
#ifdef WOLFSSL_SP_SMALL
|
||||
/* The base point of curve P384. */
|
||||
@ -27151,7 +27158,8 @@ static const sp_point_384 p384_base = {
|
||||
0
|
||||
};
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p384_b[6] = {
|
||||
0x2a85c8edd3ec2aefL,0xc656398d8a2ed19dL,0x0314088f5013875aL,
|
||||
0x181d9c6efe814112L,0x988e056be3f82d19L,0xb3312fa7e23ee7e4L
|
||||
@ -49544,6 +49552,7 @@ int sp_ecc_mulmod_base_add_384(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -49551,6 +49560,7 @@ extern void sp_384_add_one_6(sp_digit* a);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -51408,7 +51418,7 @@ int sp_ecc_verify_384_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -52130,7 +52140,7 @@ static const sp_digit p521_norm_mod[9] = {
|
||||
0x0000000000000000L,0x0000000000000000L,0x0000000000000000L
|
||||
};
|
||||
/* The Montgomery multiplier for modulus of the curve P521. */
|
||||
static sp_digit p521_mp_mod = 0x0000000000000001;
|
||||
static const sp_digit p521_mp_mod = 0x0000000000000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
/* The order of the curve P521. */
|
||||
@ -52140,12 +52150,14 @@ static const sp_digit p521_order[9] = {
|
||||
0xffffffffffffffffL,0xffffffffffffffffL,0x00000000000001ffL
|
||||
};
|
||||
#endif
|
||||
#ifndef WC_NO_RNG
|
||||
/* The order of the curve P521 minus 2. */
|
||||
static const sp_digit p521_order2[9] = {
|
||||
0xbb6fb71e91386407L,0x3bb5c9b8899c47aeL,0x7fcc0148f709a5d0L,
|
||||
0x51868783bf2f966bL,0xfffffffffffffffaL,0xffffffffffffffffL,
|
||||
0xffffffffffffffffL,0xffffffffffffffffL,0x00000000000001ffL
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery normalizer for order of the curve P521. */
|
||||
static const sp_digit p521_norm_order[9] = {
|
||||
@ -52156,7 +52168,7 @@ static const sp_digit p521_norm_order[9] = {
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montgomery multiplier for order of the curve P521. */
|
||||
static sp_digit p521_mp_order = 0x1d2f5ccd79a995c7L;
|
||||
static const sp_digit p521_mp_order = 0x1d2f5ccd79a995c7L;
|
||||
#endif
|
||||
#ifdef WOLFSSL_SP_SMALL
|
||||
/* The base point of curve P521. */
|
||||
@ -52189,7 +52201,8 @@ static const sp_point_521 p521_base = {
|
||||
0
|
||||
};
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || defined(HAVE_COMP_KEY)
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER) || \
|
||||
defined(HAVE_COMP_KEY)
|
||||
static const sp_digit p521_b[9] = {
|
||||
0xef451fd46b503f00L,0x3573df883d2c34f1L,0x1652c0bd3bb1bf07L,
|
||||
0x56193951ec7e937bL,0xb8b489918ef109e1L,0xa2da725b99b315f3L,
|
||||
@ -90637,6 +90650,7 @@ int sp_ecc_mulmod_base_add_521(const mp_int* km, const ecc_point* am,
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
#endif /* WOLFSSL_VALIDATE_ECC_KEYGEN | HAVE_ECC_SIGN | HAVE_ECC_VERIFY */
|
||||
#ifndef WC_NO_RNG
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -90644,6 +90658,7 @@ extern void sp_521_add_one_9(sp_digit* a);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -92575,7 +92590,7 @@ int sp_ecc_verify_521_nb(sp_ecc_ctx_t* sp_ctx, const byte* hash,
|
||||
#endif /* WOLFSSL_SP_NONBLOCK */
|
||||
#endif /* HAVE_ECC_VERIFY */
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
/* Check that the x and y ordinates are a valid point on the curve.
|
||||
*
|
||||
* point EC point.
|
||||
@ -105446,7 +105461,7 @@ int sp_Pairing_precomp_1024(const ecc_point* pm, const ecc_point* qm, mp_int* re
|
||||
return err;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ECC_CHECK_KEY
|
||||
#if defined(HAVE_ECC_CHECK_KEY) || !defined(NO_ECC_CHECK_PUBKEY_ORDER)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -32052,7 +32052,8 @@ done:
|
||||
}
|
||||
#endif /* !WOLFSSL_ATECC508A && HAVE_ECC_KEY_IMPORT && HAVE_ECC_KEY_EXPORT */
|
||||
|
||||
#if !defined(NO_SIG_WRAPPER) && !defined(WOLF_CRYPTO_CB_ONLY_ECC)
|
||||
#if !defined(NO_SIG_WRAPPER) && !defined(WOLF_CRYPTO_CB_ONLY_ECC) && \
|
||||
!defined(NO_ECC_SIGN)
|
||||
static wc_test_ret_t ecc_sig_test(WC_RNG* rng, ecc_key* key)
|
||||
{
|
||||
wc_test_ret_t ret;
|
||||
@ -32393,7 +32394,7 @@ static wc_test_ret_t ecc_def_curve_test(WC_RNG *rng)
|
||||
goto done;
|
||||
}
|
||||
|
||||
#ifndef NO_SIG_WRAPPER
|
||||
#if !defined(NO_SIG_WRAPPER) && !defined(NO_ECC_SIGN)
|
||||
ret = ecc_sig_test(rng, key);
|
||||
if (ret < 0)
|
||||
goto done;
|
||||
|
Reference in New Issue
Block a user