Update SM9 schemes

Update SM9 schemes based on the default sm9bn256v1 r-ate pairing. To be continued.
This commit is contained in:
Zhi Guan
2018-09-28 22:21:44 +08:00
parent c7aa2cc1ff
commit b54a3d35e6
21 changed files with 6629 additions and 7367 deletions

View File

@@ -10,7 +10,7 @@
*/
/* Serialized OID's */
static const unsigned char so[7797] = {
static const unsigned char so[7876] = {
0x2A,0x86,0x48,0x86,0xF7,0x0D, /* [ 0] OBJ_rsadsi */
0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, /* [ 6] OBJ_pkcs */
0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x02, /* [ 13] OBJ_md2 */
@@ -1092,9 +1092,17 @@ static const unsigned char so[7797] = {
0x2A,0x81,0x1C,0xD7,0x63,0x01,0x01, /* [ 7771] OBJ_wapi_ec */
0x2A,0x81,0x1C,0xD7,0x63,0x01,0x01,0x01, /* [ 7778] OBJ_wapi_ecdsa192_sha256 */
0x2B,0x06,0x01,0x04,0x01,0x83,0x83,0x0D,0x09,0x01, /* [ 7786] OBJ_sm9bn256v1 */
0x2A,0x81,0x1C,0xCF,0x55,0x01,0x82,0x2E,0x04, /* [ 7796] OBJ_sm9hash1 */
0x2A,0x81,0x1C,0xCF,0x55,0x01,0x82,0x2E,0x04,0x01, /* [ 7805] OBJ_sm9hash1_with_sm3 */
0x2A,0x81,0x1C,0xCF,0x55,0x01,0x82,0x2E,0x04,0x02, /* [ 7815] OBJ_sm9hash1_with_sha256 */
0x2A,0x81,0x1C,0xCF,0x55,0x01,0x82,0x2E,0x01,0x01, /* [ 7825] OBJ_sm9sign_with_sm3 */
0x2A,0x81,0x1C,0xCF,0x55,0x01,0x82,0x2E,0x01,0x02, /* [ 7835] OBJ_sm9sign_with_sha256 */
0x2A,0x81,0x1C,0xCF,0x55,0x01,0x82,0x2E,0x03,0x01, /* [ 7845] OBJ_sm9encrypt_with_sm3_xor */
0x2A,0x81,0x1C,0xCF,0x55,0x01,0x82,0x2E,0x03,0x02, /* [ 7855] OBJ_sm9encrypt_with_sm3_sms4_cbc */
0x2A,0x81,0x1C,0xCF,0x55,0x01,0x82,0x2E,0x03,0x03, /* [ 7865] OBJ_sm9encrypt_with_sm3_sms4_ctr */
};
#define NUM_NID 1201
#define NUM_NID 1209
static const ASN1_OBJECT nid_objs[NUM_NID] = {
{"UNDEF", "undefined", NID_undef},
{"rsadsi", "RSA Data Security, Inc.", NID_rsadsi, 6, &so[0]},
@@ -2297,9 +2305,17 @@ static const ASN1_OBJECT nid_objs[NUM_NID] = {
{"wapi-ec", "wapi-ec", NID_wapi_ec, 7, &so[7771]},
{"wapi-ecdsa192-sha256", "wapi-ecdsa192-sha256", NID_wapi_ecdsa192_sha256, 8, &so[7778]},
{"sm9bn256v1", "sm9bn256v1", NID_sm9bn256v1, 10, &so[7786]},
{"sm9hash1", "sm9hash1", NID_sm9hash1, 9, &so[7796]},
{"sm9hash1-with-sm3", "sm9hash1-with-sm3", NID_sm9hash1_with_sm3, 10, &so[7805]},
{"sm9hash1-with-sha256", "sm9hash1-with-sha256", NID_sm9hash1_with_sha256, 10, &so[7815]},
{"sm9sign-with-sm3", "sm9sign-with-sm3", NID_sm9sign_with_sm3, 10, &so[7825]},
{"sm9sign-with-sha256", "sm9sign-with-sha256", NID_sm9sign_with_sha256, 10, &so[7835]},
{"sm9encrypt-with-sm3-xor", "sm9encrypt-with-sm3-xor", NID_sm9encrypt_with_sm3_xor, 10, &so[7845]},
{"sm9encrypt-with-sm3-sms4-cbc", "sm9encrypt-with-sm3-sms4-cbc", NID_sm9encrypt_with_sm3_sms4_cbc, 10, &so[7855]},
{"sm9encrypt-with-sm3-sms4-ctr", "sm9encrypt-with-sm3-sms4-ctr", NID_sm9encrypt_with_sm3_sms4_ctr, 10, &so[7865]},
};
#define NUM_SN 1190
#define NUM_SN 1198
static const unsigned int sn_objs[NUM_SN] = {
364, /* "AD_DVCS" */
419, /* "AES-128-CBC" */
@@ -3424,8 +3440,16 @@ static const unsigned int sn_objs[NUM_SN] = {
1117, /* "sm2sign" */
1200, /* "sm9bn256v1" */
1125, /* "sm9encrypt" */
1207, /* "sm9encrypt-with-sm3-sms4-cbc" */
1208, /* "sm9encrypt-with-sm3-sms4-ctr" */
1206, /* "sm9encrypt-with-sm3-xor" */
1201, /* "sm9hash1" */
1203, /* "sm9hash1-with-sha256" */
1202, /* "sm9hash1-with-sm3" */
1124, /* "sm9keyagreement" */
1123, /* "sm9sign" */
1205, /* "sm9sign-with-sha256" */
1204, /* "sm9sign-with-sm3" */
387, /* "snmpv2" */
660, /* "street" */
85, /* "subjectAltName" */
@@ -3493,7 +3517,7 @@ static const unsigned int sn_objs[NUM_SN] = {
1194, /* "zuc-128eia3" */
};
#define NUM_LN 1190
#define NUM_LN 1198
static const unsigned int ln_objs[NUM_LN] = {
363, /* "AD Time Stamping" */
405, /* "ANSI X9.62" */
@@ -4602,8 +4626,16 @@ static const unsigned int ln_objs[NUM_LN] = {
1088, /* "sm6-ofb" */
1200, /* "sm9bn256v1" */
1125, /* "sm9encrypt" */
1207, /* "sm9encrypt-with-sm3-sms4-cbc" */
1208, /* "sm9encrypt-with-sm3-sms4-ctr" */
1206, /* "sm9encrypt-with-sm3-xor" */
1201, /* "sm9hash1" */
1203, /* "sm9hash1-with-sha256" */
1202, /* "sm9hash1-with-sm3" */
1124, /* "sm9keyagreement" */
1123, /* "sm9sign" */
1205, /* "sm9sign-with-sha256" */
1204, /* "sm9sign-with-sm3" */
1103, /* "sms4-cbc" */
1110, /* "sms4-ccm" */
1105, /* "sms4-cfb" */
@@ -4687,7 +4719,7 @@ static const unsigned int ln_objs[NUM_LN] = {
1194, /* "zuc-128eia3" */
};
#define NUM_OBJ 1087
#define NUM_OBJ 1095
static const unsigned int obj_objs[NUM_OBJ] = {
0, /* OBJ_undef 0 */
181, /* OBJ_iso 1 */
@@ -5428,6 +5460,7 @@ static const unsigned int obj_objs[NUM_OBJ] = {
1123, /* OBJ_sm9sign 1 2 156 10197 1 302 1 */
1124, /* OBJ_sm9keyagreement 1 2 156 10197 1 302 2 */
1125, /* OBJ_sm9encrypt 1 2 156 10197 1 302 3 */
1201, /* OBJ_sm9hash1 1 2 156 10197 1 302 4 */
1127, /* OBJ_hmac_sm3 1 2 156 10197 1 401 2 */
1193, /* OBJ_zuc_128eea3 1 2 156 10197 1 800 1 */
1194, /* OBJ_zuc_128eia3 1 2 156 10197 1 800 2 */
@@ -5635,6 +5668,13 @@ static const unsigned int obj_objs[NUM_OBJ] = {
457, /* OBJ_qualityLabelledData 0 9 2342 19200300 100 4 22 */
1120, /* OBJ_sm2encrypt_recommendedParameters 1 2 156 10197 1 301 3 1 */
1121, /* OBJ_sm2encrypt_specifiedParameters 1 2 156 10197 1 301 3 2 */
1204, /* OBJ_sm9sign_with_sm3 1 2 156 10197 1 302 1 1 */
1205, /* OBJ_sm9sign_with_sha256 1 2 156 10197 1 302 1 2 */
1206, /* OBJ_sm9encrypt_with_sm3_xor 1 2 156 10197 1 302 3 1 */
1207, /* OBJ_sm9encrypt_with_sm3_sms4_cbc 1 2 156 10197 1 302 3 2 */
1208, /* OBJ_sm9encrypt_with_sm3_sms4_ctr 1 2 156 10197 1 302 3 3 */
1202, /* OBJ_sm9hash1_with_sm3 1 2 156 10197 1 302 4 1 */
1203, /* OBJ_sm9hash1_with_sha256 1 2 156 10197 1 302 4 2 */
1139, /* OBJ_type1curve 1 2 840 1 114334 1 1 1 */
1140, /* OBJ_type2curve 1 2 840 1 114334 1 1 2 */
1141, /* OBJ_type3curve 1 2 840 1 114334 1 1 3 */