曲线sm2p256v1基于ANSI X9.62 elliptic curve prime256v1 (aka secp256r1, NIST P-256)
椭圆曲线 NID
- NID_X9_62_prime256v1
- NID_sm2p256v1
(256 bit prime)
_EC_SM2_PRIME_256V1 - NID_sm2b257v1 曲线方程
f(x) = x^257 + x^12 + 1
257比特二进制域椭圆曲线域参数 - NID_wapi192v1
(WAPI curve over a 192 bit prime field)
代码 https://github.com/guanzhi/GmSSL/blob/master/crypto/ec/ec_curve.c
typedef struct {
int field_type; /* either NID_X9_62_prime_field or
* NID_X9_62_characteristic_two_field */
int seed_len;
int param_len;
unsigned int cofactor; /* promoted to BN_ULONG */
} EC_CURVE_DATA;
#ifndef OPENSSL_NO_SM2
static const struct {
EC_CURVE_DATA h;
unsigned char data[0 + 32 * 6];
} _EC_SM2_PRIME_256V1 = {
{
NID_X9_62_prime_field, 0, 32, 1
},
{
/* no seed */
/* p */
0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
/* a */
0xFF, 0xFF, 0xFF, 0xFE, 0xFF