Skip to content

Commit

Permalink
Merge pull request #6633 from SparkiDev/sm2_not_with_sp_math
Browse files Browse the repository at this point in the history
SM2 and SP_MATH: don't enable SM2 with SP_MATH
  • Loading branch information
JacobBarthelmeh authored Jul 19, 2023
2 parents 8065ba1 + dceb7c0 commit acd819c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3460,6 +3460,10 @@ AC_ARG_ENABLE([sm2],
[ ENABLED_SM2=no ]
)

if test "$ENABLED_SP_MATH" = "yes"
then
ENABLED_SM2="no"
fi
if test "$ENABLED_SM2" = "yes"
then
if test "$ENABLED_ECC" = "no"
Expand Down Expand Up @@ -9341,6 +9345,7 @@ echo " * ECC Minimum Bits: $ENABLED_ECCMINSZ"
echo " * FPECC: $ENABLED_FPECC"
echo " * ECC_ENCRYPT: $ENABLED_ECC_ENCRYPT"
echo " * Brainpool: $ENABLED_BRAINPOOL"
echo " * SM2: $ENABLED_SM2"
echo " * CURVE25519: $ENABLED_CURVE25519"
echo " * ED25519: $ENABLED_ED25519"
echo " * ED25519 streaming: $ENABLED_ED25519_STREAM"
Expand Down
8 changes: 4 additions & 4 deletions wolfcrypt/src/ecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ enum {
#endif
#define ecc_oid_brainpoolp256r1_sz CODED_BRAINPOOLP256R1_SZ
#endif /* HAVE_ECC_BRAINPOOL */
#ifdef WOLFSSL_SM2
#if defined(WOLFSSL_SM2) && !defined(WOLFSSL_SP_MATH)
#ifdef HAVE_OID_ENCODING
#define CODED_SM2P256V1 {1,2,156,10197,1,301}
#define CODED_SM2P256V1_SZ 6
Expand All @@ -680,7 +680,7 @@ enum {
#define ecc_oid_sm2p256v1 CODED_SM2P256V1
#endif
#define ecc_oid_sm2p256v1_sz CODED_SM2P256V1_SZ
#endif /* WOLFSSL_SM2 */
#endif /* WOLFSSL_SM2 && !WOLFSSL_SP_MATH */
#endif /* ECC256 */
#ifdef ECC320
#ifdef HAVE_ECC_BRAINPOOL
Expand Down Expand Up @@ -1161,7 +1161,7 @@ const ecc_set_type ecc_sets[] = {
1, /* cofactor */
},
#endif /* HAVE_ECC_BRAINPOOL */
#ifdef WOLFSSL_SM2
#if defined(WOLFSSL_SM2) && !defined(WOLFSSL_SP_MATH)
{
32, /* size/bytes */
ECC_SM2P256V1, /* ID */
Expand All @@ -1179,7 +1179,7 @@ const ecc_set_type ecc_sets[] = {
ECC_SM2P256V1_OID, /* oid sum */
1, /* cofactor */
},
#endif /* WOLFSSL_SM2 */
#endif /* WOLFSSL_SM2 && !WOLFSSL_SP_MATH */
#endif /* ECC256 */
#ifdef ECC320
#ifdef HAVE_ECC_BRAINPOOL
Expand Down

0 comments on commit acd819c

Please sign in to comment.