Skip to content

Commit 62d453c

Browse files
Add ShangMi (SM2/SM3/SM4/SM9) algorithm families (#812)
Fixes #811 Adds SM2/SM3/SM4/SM9 algorithm families to the CycloneDX cryptography registry and updates algorithmFamiliesEnum accordingly. Note: some official ShangMi specification mirrors appear region-blocked or unreliable from multiple locations. To avoid fragile links in the registry, this PR relies on globally accessible references (RFC Editor + ISO)
2 parents 51a9246 + 78910fb commit 62d453c

File tree

2 files changed

+89
-1
lines changed

2 files changed

+89
-1
lines changed

schema/cryptography-defs.json

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,90 @@
862862
}
863863
]
864864
},
865+
{
866+
"family": "SM2",
867+
"standard": [
868+
{
869+
"name": "RFC8998",
870+
"url": "https://www.rfc-editor.org/rfc/rfc8998.html"
871+
}
872+
],
873+
"variant": [
874+
{
875+
"pattern": "SM2[-256]",
876+
"primitive": "signature"
877+
},
878+
{
879+
"pattern": "SM2-(ENC|ENCRYPTION)[-256]",
880+
"primitive": "pke"
881+
},
882+
{
883+
"pattern": "SM2-(KEX|KEYEXCHANGE|KEY-EXCHANGE|KEYAGREE|KEY-AGREE|KEYAGREEMENT|KEY-AGREEMENT)[-256]",
884+
"primitive": "key-agree"
885+
}
886+
]
887+
},
888+
{
889+
"family": "SM3",
890+
"standard": [
891+
{
892+
"name": "RFC8998",
893+
"url": "https://www.rfc-editor.org/rfc/rfc8998.html"
894+
}
895+
],
896+
"variant": [
897+
{
898+
"pattern": "SM3",
899+
"primitive": "hash"
900+
}
901+
]
902+
},
903+
{
904+
"family": "SM4",
905+
"standard": [
906+
{
907+
"name": "ISO/IEC18033-3:2010/Amd1:2021",
908+
"url": "https://www.iso.org/standard/81564.html"
909+
}
910+
],
911+
"variant": [
912+
{
913+
"pattern": "SM4[-(ECB|CBC|CFB|OFB|CTR|XTS)][-{padding}][-{ivlen}]",
914+
"primitive": "block-cipher"
915+
},
916+
{
917+
"pattern": "SM4-(GCM|CCM)[-{tagLength}][-{ivLength}]",
918+
"primitive": "ae"
919+
}
920+
]
921+
},
922+
{
923+
"family": "SM9",
924+
"standard": [
925+
{
926+
"name": "GM/T0044.1-2016",
927+
"url": "https://www.gmbz.org.cn/upload/2025-01-23/1737625691994053970.pdf"
928+
}
929+
],
930+
"variant": [
931+
{
932+
"pattern": "SM9-(SIG|SIGNATURE)",
933+
"primitive": "signature"
934+
},
935+
{
936+
"pattern": "SM9-(KEX|KEYEXCHANGE|KEY-EXCHANGE|KEYAGREE|KEYAGREEMENT|KEY-AGREE|KEY-AGREEMENT)",
937+
"primitive": "key-agree"
938+
},
939+
{
940+
"pattern": "SM9-(KEM|KEYENCAPSULATION|KEY-ENCAPSULATION)",
941+
"primitive": "kem"
942+
},
943+
{
944+
"pattern": "SM9-(ENC|ENCRYPTION|PKE|PUBLICKEY-ENCRYPTION|PUBLIC-KEY-ENCRYPTION)",
945+
"primitive": "pke"
946+
}
947+
]
948+
},
865949
{
866950
"family": "SEED",
867951
"standard": [

schema/cryptography-defs.schema.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@
312312
"SHA-2",
313313
"SHA-3",
314314
"SLH-DSA",
315+
"SM2",
316+
"SM3",
317+
"SM4",
318+
"SM9",
315319
"SNOW3G",
316320
"SP800-108",
317321
"Salsa20",
@@ -581,4 +585,4 @@
581585
]
582586
}
583587
}
584-
}
588+
}

0 commit comments

Comments
 (0)