Skip to content

Add ShangMi (SM2/SM3/SM4/SM9) algorithm families#812

Open
Mehrn0ush wants to merge 1 commit intoCycloneDX:masterfrom
Mehrn0ush:feat/crypto-registry-shangmi-sm2-sm3-sm4-sm9
Open

Add ShangMi (SM2/SM3/SM4/SM9) algorithm families#812
Mehrn0ush wants to merge 1 commit intoCycloneDX:masterfrom
Mehrn0ush:feat/crypto-registry-shangmi-sm2-sm3-sm4-sm9

Conversation

@Mehrn0ush
Copy link
Contributor

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)

Signed-off-by: Mehrn0ush <mehrnoush.vaseghi@gmail.com>
@Mehrn0ush Mehrn0ush requested a review from a team as a code owner February 5, 2026 11:08
@Mehrn0ush
Copy link
Contributor Author

Hi @bhess — if you have time, would you mind taking a look at this one as well?

This adds ShangMi (SM2/SM3/SM4/SM9) families and updates the schema enum.
I used RFC/ISO references where the official mirrors weren’t reliably accessible.

Thanks a lot — always appreciate your feedback.

@stevespringett
Copy link
Member

cc: @bhess

@stevespringett stevespringett added cap: cryptography Capability: Cryptography (CBOM) cap: cryptography-registry Capability: Cryptography Registry labels Feb 5, 2026
Copy link
Contributor

@bhess bhess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Mehrn0ush for the additions! See the comments inline.

"variant": [
{
"pattern": "SM4[-(ECB|CBC|CFB|OFB|CTR|XTS)][-{padding}][-{ivlen}]",
"primitive": "block-cipher"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "ae" modes seem to be missing (e.g., CCM, GCM..)

"family": "SM9",
"standard": [
{
"name": "RFC8998",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SM9 seems to be not specified in RFC8998. See https://en.wikipedia.org/wiki/SM9_(cryptography_standard) for the references.

],
"variant": [
{
"pattern": "SM9",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than a single "other" primitive, it might be worth splitting this up to different variants.
I didn't look at the standard in the detail, but see https://en.wikipedia.org/wiki/SM9_(cryptography_standard), there are different primitives:

  • signature
  • keyagree/wrap
  • kem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cap: cryptography Capability: Cryptography (CBOM) cap: cryptography-registry Capability: Cryptography Registry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add ShangMi (SM2/SM3/SM4/SM9) algorithm families to cryptography definitions

3 participants