陈旭东 пре 3 година
родитељ
комит
82fe751bf1

+ 0 - 0
luat/modules/luat_lib_sm.c → components/SM/src/luat_lib_sm.c


+ 1 - 1
components/mbedtls/include/mbedtls/config.h

@@ -37,7 +37,7 @@
  * This section sets system specific settings.
  * \{
  */
-#define ECP_DP_SM2_256V1_ENABLED
+
 /**
  * \def MBEDTLS_HAVE_ASM
  *

+ 2 - 2
components/mbedtls/library/ecp.c

@@ -542,9 +542,9 @@ static const mbedtls_ecp_curve_info ecp_supported_curves[] =
 #if defined(MBEDTLS_ECP_DP_CURVE448_ENABLED)
     { MBEDTLS_ECP_DP_CURVE448,     30,     448,    "x448"              },
 #endif
-//#if defined(ECP_DP_SM2_256V1_ENABLED)
+#if defined(ECP_DP_SM2_256V1_ENABLED)
     {ECP_DP_SM2_256V1,              2,     256,    "sm2_256v1"         },
-//#endif
+#endif
     { MBEDTLS_ECP_DP_NONE,          0,     0,      NULL                },
 };
 

+ 4 - 5
components/mbedtls/library/ecp_curves.c

@@ -516,8 +516,7 @@ static const mbedtls_mpi_uint brainpoolP512r1_n[] = {
 #endif /* MBEDTLS_ECP_DP_BP512R1_ENABLED */
 
 /* sm2 */
-//#if defined(ECP_DP_SM2_256V1_ENABLED)
-
+#if defined(ECP_DP_SM2_256V1_ENABLED)
 static const mbedtls_mpi_uint sm2_256v1_p[] = {
     MBEDTLS_BYTES_TO_T_UINT_8(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF),
     MBEDTLS_BYTES_TO_T_UINT_8(0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF),
@@ -563,7 +562,7 @@ static const mbedtls_mpi_uint sm2_256v1_n[] = {
     MBEDTLS_BYTES_TO_T_UINT_8(0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF),
 };
 
-//#endif  /*end sm2 */
+#endif  /*end sm2 */
 
 #if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) ||   \
     defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) ||   \
@@ -882,11 +881,11 @@ int mbedtls_ecp_group_load( mbedtls_ecp_group *grp, mbedtls_ecp_group_id id )
             return( ecp_use_curve448( grp ) );
 #endif /* MBEDTLS_ECP_DP_CURVE448_ENABLED */
 
-//#if defined(ECP_DP_SM2_256V1_ENABLED)
+#if defined(ECP_DP_SM2_256V1_ENABLED)
         case ECP_DP_SM2_256V1:
             //todo
             return (LOAD_GROUP_A(sm2_256v1));
-//#endif
+#endif
         default:
             grp->id = MBEDTLS_ECP_DP_NONE;
             return( MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE );