Add sm9 and paillier pem support

This commit is contained in:
Zhi Guan
2018-11-16 15:26:30 +08:00
parent 5baad7e043
commit 9a999ae907
38 changed files with 7956 additions and 6992 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1080,143 +1080,129 @@ cmac_aes128_ecies 1079
cmac_aes192_ecies 1080
cmac_aes256_ecies 1081
cbc_mac 1082
ISO_CN 1083
oscca 1084
sm_scheme 1085
sm6_ecb 1086
sm6_cbc 1087
sm6_ofb128 1088
sm6_cfb128 1089
sm1_ecb 1090
sm1_cbc 1091
sm1_ofb128 1092
sm1_cfb128 1093
sm1_cfb1 1094
sm1_cfb8 1095
ssf33_ecb 1096
ssf33_cbc 1097
ssf33_ofb128 1098
ssf33_cfb128 1099
ssf33_cfb1 1100
ssf33_cfb8 1101
sms4_ecb 1102
sms4_cbc 1103
sms4_ofb128 1104
sms4_cfb128 1105
sms4_cfb1 1106
sms4_cfb8 1107
sms4_ctr 1108
sms4_gcm 1109
sms4_ccm 1110
sms4_xts 1111
sms4_wrap 1112
sms4_wrap_pad 1113
sms4_ocb 1114
sm5 1115
sm2p256v1 1116
sm2sign 1117
sm2keyagreement 1118
sm2encrypt 1119
sm2encrypt_recommendedParameters 1120
sm2encrypt_specifiedParameters 1121
id_sm9PublicKey 1122
sm9sign 1123
sm9keyagreement 1124
sm9encrypt 1125
sm3 1126
hmac_sm3 1127
sm2sign_with_sm3 1128
sm2sign_with_sha1 1129
sm2sign_with_sha256 1130
sm2sign_with_sha512 1131
sm2sign_with_sha224 1132
sm2sign_with_sha384 1133
sm2sign_with_rmd160 1134
wapip192v1 1135
zuc 1136
bfibe 1137
bb1 1138
type1curve 1139
type2curve 1140
type3curve 1141
type4curve 1142
tate_pairing 1143
weil_pairing 1144
ate_pairing 1145
r_ate_pairing 1146
cpk 1147
paillier 1148
sm2exchange 1149
GmSSL 1150
cpk_map 1151
cpk_sha1_map 1152
cpk_sha256_map 1153
cpk_sm3_map 1154
sm2encrypt_with_sm3 1155
sm2encrypt_with_sha1 1156
sm2encrypt_with_sha224 1157
sm2encrypt_with_sha256 1158
sm2encrypt_with_sha384 1159
sm2encrypt_with_sha512 1160
sm2encrypt_with_rmd160 1161
sm2encrypt_with_whirlpool 1162
sm2encrypt_with_blake2b512 1163
sm2encrypt_with_blake2s256 1164
sm2encrypt_with_md5 1165
sm2sign_with_whirlpool 1166
sm2sign_with_blake2b512 1167
sm2sign_with_blake2s256 1168
ecies_with_x9_63_sha1_xor_hmac 1169
ecies_with_x9_63_sha256_xor_hmac 1170
ecies_with_x9_63_sha512_xor_hmac 1171
ecies_with_x9_63_sha1_aes128_cbc_hmac 1172
ecies_with_x9_63_sha256_aes128_cbc_hmac 1173
ecies_with_x9_63_sha512_aes256_cbc_hmac 1174
ecies_with_x9_63_sha256_aes128_ctr_hmac 1175
ecies_with_x9_63_sha512_aes256_ctr_hmac 1176
ecies_with_x9_63_sha256_aes128_cbc_hmac_half 1177
ecies_with_x9_63_sha512_aes256_cbc_hmac_half 1178
ecies_with_x9_63_sha256_aes128_ctr_hmac_half 1179
ecies_with_x9_63_sha512_aes256_ctr_hmac_half 1180
ecies_with_x9_63_sha1_aes128_cbc_cmac 1181
ecies_with_x9_63_sha256_aes128_cbc_cmac 1182
ecies_with_x9_63_sha512_aes256_cbc_cmac 1183
ecies_with_x9_63_sha256_aes128_ctr_cmac 1184
ecies_with_x9_63_sha512_aes256_ctr_cmac 1185
kx_sm2 1186
auth_sm2 1187
kx_sm9 1188
auth_sm9 1189
kx_sm2dhe 1190
kx_sm2_psk 1191
kx_sm9dhe 1192
zuc_128eea3 1193
zuc_128eia3 1194
pbe_WithSM3AndSMS4_CBC 1195
bwips 1196
wapi_crypto 1197
wapi_ec 1198
wapi_ecdsa192_sha256 1199
sm9bn256v1 1200
sm9hash1 1201
sm9hash1_with_sm3 1202
sm9hash1_with_sha256 1203
sm9sign_with_sm3 1204
sm9sign_with_sha256 1205
sm9encrypt_with_sm3_xor 1206
sm9encrypt_with_sm3_sms4_cbc 1207
sm9encrypt_with_sm3_sms4_ctr 1208
sm9kdf 1209
sm9kdf_with_sm3 1210
sm9kdf_with_sha256 1211
cpk_map32x32_sha1 1212
cpk_map32x256_sha256 1213
cpk_map32x256_sm3 1214
cpk_map_with_sha1 1215
cpk_map_with_sha256 1216
cpk_map_with_sm3 1217
cpk_map_sha1 1218
cpk_map_sha256 1219
cpk_map_sm3 1220
cpk_map_sha384 1221
cpk_map_sha512 1222
pbe_WithSM3AndSMS4_CBC 1083
ecies_with_x9_63_sha1_xor_hmac 1084
ecies_with_x9_63_sha256_xor_hmac 1085
ecies_with_x9_63_sha512_xor_hmac 1086
ecies_with_x9_63_sha1_aes128_cbc_hmac 1087
ecies_with_x9_63_sha256_aes128_cbc_hmac 1088
ecies_with_x9_63_sha512_aes256_cbc_hmac 1089
ecies_with_x9_63_sha256_aes128_ctr_hmac 1090
ecies_with_x9_63_sha512_aes256_ctr_hmac 1091
ecies_with_x9_63_sha256_aes128_cbc_hmac_half 1092
ecies_with_x9_63_sha512_aes256_cbc_hmac_half 1093
ecies_with_x9_63_sha256_aes128_ctr_hmac_half 1094
ecies_with_x9_63_sha512_aes256_ctr_hmac_half 1095
ecies_with_x9_63_sha1_aes128_cbc_cmac 1096
ecies_with_x9_63_sha256_aes128_cbc_cmac 1097
ecies_with_x9_63_sha512_aes256_cbc_cmac 1098
ecies_with_x9_63_sha256_aes128_ctr_cmac 1099
ecies_with_x9_63_sha512_aes256_ctr_cmac 1100
ibcs1 1101
type1curve 1102
bfibe 1103
bb1ibe 1104
ISO_CN 1105
oscca 1106
sm_scheme 1107
ssf33_ecb 1108
ssf33_cbc 1109
ssf33_ofb128 1110
ssf33_cfb128 1111
ssf33_cfb1 1112
ssf33_cfb8 1113
ssf33_cbc_mac 1114
sm1_ecb 1115
sm1_cbc 1116
sm1_ofb128 1117
sm1_cfb128 1118
sm1_cfb1 1119
sm1_cfb8 1120
sm2p256v1 1121
sm2sign 1122
sm2exchange 1123
sm2encrypt 1124
sm2sign_with_sm3 1125
sm2sign_with_sha1 1126
sm2sign_with_sha256 1127
sm2sign_with_sha512 1128
sm2sign_with_sha224 1129
sm2sign_with_sha384 1130
sm2sign_with_rmd160 1131
sm2sign_with_whirlpool 1132
sm2sign_with_blake2b512 1133
sm2sign_with_blake2s256 1134
sm2encrypt_recommendedParameters 1135
sm2encrypt_specifiedParameters 1136
sm2encrypt_with_sm3 1137
sm2encrypt_with_sha1 1138
sm2encrypt_with_sha224 1139
sm2encrypt_with_sha256 1140
sm2encrypt_with_sha384 1141
sm2encrypt_with_sha512 1142
sm2encrypt_with_rmd160 1143
sm2encrypt_with_whirlpool 1144
sm2encrypt_with_blake2b512 1145
sm2encrypt_with_blake2s256 1146
sm2encrypt_with_md5 1147
sm3 1148
hmac_sm3 1149
sms4_ecb 1150
sms4_cbc 1151
sms4_ofb128 1152
sms4_cfb128 1153
sms4_cfb1 1154
sms4_cfb8 1155
sms4_ctr 1156
sms4_gcm 1157
sms4_ccm 1158
sms4_xts 1159
sms4_wrap 1160
sms4_wrap_pad 1161
sms4_ocb 1162
sm5 1163
sm6_ecb 1164
sm6_cbc 1165
sm6_ofb128 1166
sm6_cfb128 1167
id_sm9PublicKey 1168
sm9sign 1169
sm9keyagreement 1170
sm9encrypt 1171
sm9hash1 1172
sm9kdf 1173
id_sm9MasterSecret 1174
sm9bn256v1 1175
sm9sign_with_sm3 1176
sm9sign_with_sha256 1177
sm9encrypt_with_sm3_xor 1178
sm9encrypt_with_sm3_sms4_cbc 1179
sm9encrypt_with_sm3_sms4_ctr 1180
sm9hash1_with_sm3 1181
sm9hash1_with_sha256 1182
sm9kdf_with_sm3 1183
sm9kdf_with_sha256 1184
zuc 1185
zuc_128eea3 1186
zuc_128eia3 1187
bwips 1188
wapi_crypto 1189
wapi_ec 1190
wapi_ecdsa192_sha256 1191
wapip192v1 1192
kx_sm2 1193
kx_sm2dhe 1194
kx_sm2_psk 1195
kx_sm9 1196
kx_sm9dhe 1197
auth_sm2 1198
auth_sm9 1199
GmSSL 1200
cpk 1201
cpk_map 1202
cpk_map_sha1 1203
cpk_map_sha256 1204
cpk_map_sm3 1205
cpk_map_sha384 1206
cpk_map_sha512 1207
paillier 1208

View File

@@ -1480,11 +1480,6 @@ id-pkinit 5 : pkInitKDC : Signing KDC Response
: KxPSK : kx-psk
: KxSRP : kx-srp
: KxGOST : kx-gost
: KxSM2 : kx-sm2
: KxSM2DHE : kx-sm2dhe
: KxSM2-PSK : kx-sm2-psk
: KxSM9 : kx-sm9
: KxSM9DHE : kx-sm9dhe
# NIDs for cipher authentication
: AuthRSA : auth-rsa
@@ -1495,10 +1490,8 @@ id-pkinit 5 : pkInitKDC : Signing KDC Response
: AuthGOST12 : auth-gost12
: AuthSRP : auth-srp
: AuthNULL : auth-null
: AuthSM2 : auth-sm2
: AuthSM9 : auth-sm9
# GmSSL SECG ECIES OID
# SECG ECIES OID
secg-scheme 7 : ecies-recommendedParameters
secg-scheme 8 : ecies-specifiedParameters
secg-scheme 17 0 : x9-63-kdf
@@ -1518,8 +1511,6 @@ secg-scheme 23 : hmac-half-ecies
secg-scheme 24 0 : cmac-aes128-ecies
secg-scheme 24 1 : cmac-aes192-ecies
secg-scheme 24 2 : cmac-aes256-ecies
ecies-specifiedParameters 1 : ecies-with-x9-63-sha1-xor-hmac
ecies-specifiedParameters 2 : ecies-with-x9-63-sha256-xor-hmac
ecies-specifiedParameters 3 : ecies-with-x9-63-sha512-xor-hmac
@@ -1538,18 +1529,27 @@ ecies-specifiedParameters 15 : ecies-with-x9-63-sha512-aes256-cbc-cmac
ecies-specifiedParameters 16 : ecies-with-x9-63-sha256-aes128-ctr-cmac
ecies-specifiedParameters 17 : ecies-with-x9-63-sha512-aes256-ctr-cmac
# RFC 5091 IBCS #1
!Alias ibcs ISO-US 1 114334 1
ibcs 1 : ibcs1
ibcs1 1 1 : type1curve
ibcs1 2 1 : bfibe
ibcs1 2 2 : bb1ibe
# GmSSL SM OID
member-body 156 : ISO-CN : ISO CN Member Body
# GM/T
member-body 156 : ISO-CN : ISO CN Member Body
ISO-CN 10197 : oscca
oscca 1 : sm-scheme
sm-scheme 101 1 : SM6-ECB : sm6-ecb
sm-scheme 101 2 : SM6-CBC : sm6-cbc
!Cname sm6-ofb128
sm-scheme 101 3 : SM6-OFB : sm6-ofb
!Cname sm6-cfb128
sm-scheme 101 4 : SM6-CFB : sm6-cfb
sm-scheme 103 1 : SSF33-ECB : ssf33-ecb
sm-scheme 103 2 : SSF33-CBC : ssf33-cbc
!Cname ssf33-ofb128
sm-scheme 103 3 : SSF33-OFB : ssf33-ofb
!Cname ssf33-cfb128
sm-scheme 103 4 : SSF33-CFB : ssf33-cfb
sm-scheme 103 5 : SSF33-CFB1 : ssf33-cfb1
sm-scheme 103 6 : SSF33-CFB8 : ssf33-cfb8
sm-scheme 103 7 : SSF33-CBC-MAC : ssf33-cbc-mac
sm-scheme 102 1 : SM1-ECB : sm1-ecb
sm-scheme 102 2 : SM1-CBC : sm1-cbc
@@ -1560,15 +1560,43 @@ sm-scheme 102 4 : SM1-CFB : sm1-cfb
sm-scheme 102 5 : SM1-CFB1 : sm1-cfb1
sm-scheme 102 6 : SM1-CFB8 : sm1-cfb8
sm-scheme 103 1 : SSF33-ECB : ssf33-ecb
sm-scheme 103 2 : SSF33-CBC : ssf33-cbc
!Cname ssf33-ofb128
sm-scheme 103 3 : SSF33-OFB : ssf33-ofb
!Cname ssf33-cfb128
sm-scheme 103 4 : SSF33-CFB : ssf33-cfb
sm-scheme 103 5 : SSF33-CFB1 : ssf33-cfb1
sm-scheme 103 6 : SSF33-CFB8 : ssf33-cfb8
# SM2 OIDs
sm-scheme 301 : sm2p256v1
sm-scheme 301 1 : sm2sign
sm-scheme 301 2 : sm2exchange
sm-scheme 301 3 : sm2encrypt
sm-scheme 501 : SM2Sign-with-SM3 : sm2sign-with-sm3
sm-scheme 502 : SM2Sign-with-SHA1 : sm2sign-with-sha1
sm-scheme 503 : SM2Sign-with-SHA256 : sm2sign-with-sha256
sm-scheme 504 : SM2Sign-with-SHA511 : sm2sign-with-sha512
sm-scheme 505 : SM2Sign-with-SHA224 : sm2sign-with-sha224
sm-scheme 506 : SM2Sign-with-SHA384 : sm2sign-with-sha384
sm-scheme 507 : SM2Sign-with-RMD160 : sm2sign-with-rmd160
sm-scheme 520 : SM2Sign-with-Whirlpool : sm2sign-with-whirlpool
sm-scheme 521 : SM2Sign-with-Blake2b512 : sm2sign-with-blake2b512
sm-scheme 522 : SM2Sign-with-Blake2s256 : sm2sign-with-blake2s256
sm2encrypt 1 : sm2encrypt-recommendedParameters
sm2encrypt 2 : sm2encrypt-specifiedParameters
sm2encrypt 2 1 : sm2encrypt-with-sm3
sm2encrypt 2 2 : sm2encrypt-with-sha1
sm2encrypt 2 3 : sm2encrypt-with-sha224
sm2encrypt 2 4 : sm2encrypt-with-sha256
sm2encrypt 2 5 : sm2encrypt-with-sha384
sm2encrypt 2 6 : sm2encrypt-with-sha512
sm2encrypt 2 7 : sm2encrypt-with-rmd160
sm2encrypt 2 8 : sm2encrypt-with-whirlpool
sm2encrypt 2 9 : sm2encrypt-with-blake2b512
sm2encrypt 2 10 : sm2encrypt-with-blake2s256
sm2encrypt 2 11 : sm2encrypt-with-md5
# SM3
sm-scheme 401 : SM3 : sm3
sm-scheme 401 2 : HMAC-SM3 : hmac-sm3
# SM4
sm-scheme 104 1 : SMS4-ECB : sms4-ecb
sm-scheme 104 2 : SMS4-CBC : sms4-cbc
!Cname sms4-ofb128
@@ -1585,89 +1613,65 @@ sm-scheme 104 11 : SMS4-WRAP : sms4-wrap
sm-scheme 104 12 : SMS4-WRAP-PAD : sms4-wrap-pad
sm-scheme 104 100 : SMS4-OCB : sms4-ocb
# SM5/6/7/8
sm-scheme 201 : SM5 : sm5
sm-scheme 101 1 : SM6-ECB : sm6-ecb
sm-scheme 101 2 : SM6-CBC : sm6-cbc
!Cname sm6-ofb128
sm-scheme 101 3 : SM6-OFB : sm6-ofb
!Cname sm6-cfb128
sm-scheme 101 4 : SM6-CFB : sm6-cfb
!Alias sm7 sm-scheme 105
!Alias sm8 sm-scheme 106
sm-scheme 201 : SM5 : sm5
sm-scheme 301 : sm2p256v1
sm-scheme 301 1 : sm2sign
sm-scheme 301 2 : sm2exchange
sm-scheme 301 3 : sm2encrypt
#sm-scheme 301 101 : wapip192v1
sm2encrypt 1 : sm2encrypt-recommendedParameters
sm2encrypt 2 : sm2encrypt-specifiedParameters
sm2encrypt 2 1 : sm2encrypt-with-sm3
sm2encrypt 2 2 : sm2encrypt-with-sha1
sm2encrypt 2 3 : sm2encrypt-with-sha224
sm2encrypt 2 4 : sm2encrypt-with-sha256
sm2encrypt 2 5 : sm2encrypt-with-sha384
sm2encrypt 2 6 : sm2encrypt-with-sha512
sm2encrypt 2 7 : sm2encrypt-with-rmd160
sm2encrypt 2 8 : sm2encrypt-with-whirlpool
sm2encrypt 2 9 : sm2encrypt-with-blake2b512
sm2encrypt 2 10 : sm2encrypt-with-blake2s256
sm2encrypt 2 11 : sm2encrypt-with-md5
# SM9
sm-scheme 302 : id-sm9PublicKey
sm-scheme 302 1 : sm9sign
sm9sign 1 : sm9sign-with-sm3
sm9sign 2 : sm9sign-with-sha256
sm-scheme 302 2 : sm9keyagreement
sm-scheme 302 3 : sm9encrypt
sm-scheme 302 4 : sm9hash1
sm-scheme 302 5 : sm9kdf
sm-scheme 302 6 : id-sm9MasterSecret
sm-scheme 302 6 1 : sm9bn256v1
sm9sign 1 : sm9sign-with-sm3
sm9sign 2 : sm9sign-with-sha256
sm9encrypt 1 : sm9encrypt-with-sm3-xor
sm9encrypt 2 : sm9encrypt-with-sm3-sms4-cbc
sm9encrypt 3 : sm9encrypt-with-sm3-sms4-ctr
sm-scheme 302 4 : sm9hash1
sm-scheme 302 5 : sm9kdf
sm9hash1 1 : sm9hash1-with-sm3
sm9hash1 2 : sm9hash1-with-sha256
sm9kdf 1 : sm9kdf-with-sm3
sm9kdf 2 : sm9kdf-with-sha256
sm-scheme 401 : SM3 : sm3
sm-scheme 401 2 : HMAC-SM3 : hmac-sm3
# ZUC
sm-scheme 800 : ZUC : zuc
zuc 1 : zuc-128eea3
zuc 2 : zuc-128eia3
sm-scheme 501 : SM2Sign-with-SM3 : sm2sign-with-sm3
sm-scheme 502 : SM2Sign-with-SHA1 : sm2sign-with-sha1
sm-scheme 503 : SM2Sign-with-SHA256 : sm2sign-with-sha256
sm-scheme 504 : SM2Sign-with-SHA511 : sm2sign-with-sha512
sm-scheme 505 : SM2Sign-with-SHA224 : sm2sign-with-sha224
sm-scheme 506 : SM2Sign-with-SHA384 : sm2sign-with-sha384
sm-scheme 507 : SM2Sign-with-RMD160 : sm2sign-with-rmd160
sm-scheme 520 : SM2Sign-with-Whirlpool : sm2sign-with-whirlpool
sm-scheme 521 : SM2Sign-with-Blake2b512 : sm2sign-with-blake2b512
sm-scheme 522 : SM2Sign-with-Blake2s256 : sm2sign-with-blake2s256
# WAPI (GB 15629.11-2003-XG1-2006)
ISO-CN 11235 : bwips
bwips 1 : wapi-crypto
wapi-crypto 1 : wapi-ec
wapi-ec 1 : wapi-ecdsa192-sha256
wapi-ec 2 1 : wapip192v1
# GmSSL ZUC OID
sm-scheme 800 : ZUC : zuc
zuc 1 : zuc-128eea3
zuc 2 : zuc-128eia3
# NIDs for cipher key exchange
: KxSM2 : kx-sm2
: KxSM2DHE : kx-sm2dhe
: KxSM2-PSK : kx-sm2-psk
: KxSM9 : kx-sm9
: KxSM9DHE : kx-sm9dhe
# IBCS1
!Alias ibcs1 ISO-US 1 114334 1
ibcs1 2 1 : bfibe
ibcs1 2 2 : bb1
# 1 tate, 2 weil, 3 ate, 4 r-ate
ibcs1 1 1 : type1curve
ibcs1 1 2 : type2curve
ibcs1 1 3 : type3curve
ibcs1 1 4 : type4curve
# NIDs for cipher authentication
: AuthSM2 : auth-sm2
: AuthSM9 : auth-sm9
ibcs1 3 1 : tate-pairing
ibcs1 3 2 : weil-pairing
ibcs1 3 3 : ate-pairing
ibcs1 3 4 : r-ate-pairing
# GmSSL
# gmssl.org
Enterprises 49549 : gmssl : GmSSL
# CPK
GmSSL 1 : CPK : cpk
# map algorithms
cpk 1 : cpk-map
cpk-map 1 : cpk-map-sha1
cpk-map 2 : cpk-map-sha256
@@ -1675,14 +1679,6 @@ cpk-map 3 : cpk-map-sm3
cpk-map 4 : cpk-map-sha384
cpk-map 5 : cpk-map-sha512
# paillier
GmSSL 21 : paillier
# WAPI (GB 15629.11-2003-XG1-2006)
ISO-CN 11235 : bwips
bwips 1 : wapi-crypto
wapi-crypto 1 : wapi-ec
wapi-ec 1 : wapi-ecdsa192-sha256
wapi-ec 2 1 : wapip192v1
# SM9 curve
GmSSL 9 1 : sm9bn256v1