Skip to content
Crypto2026-09-266 min read

GB/T 32907, GM/T 0004, RFC 8998: Decoding the Standard Numbers Behind SM2/SM3/SM4

The wall of numbers

The first time an integration requirement says "encrypt the payload with SM4 per GB/T 32907, sign with SM2, digest with SM3 per GM/T 0004, and support ShangMi TLS per RFC 8998", it reads like four unrelated documents. They are not — they are several vintages of the same three algorithms, plus a second protocol track. Once you see the pattern, the wall collapses:

GM/T numbers are industry standards from 2012, GB/T numbers are their 2016 national-standard elevations, ISO/IEC adoption came in 2017-2018, RFC 8998 is the TLS 1.3 profile that binds all three algorithms together, and assessment fieldwork more often recognizes TLCP anchored on documents such as GB/T 38636.

For the algorithm-family overview see Chinese cryptography introduction; for HTTPS / dual-certificate deployment see Guomi TLS / nginx.

The decoder table

AlgorithmRoleIndustry standard (2012)National standard (2016)InternationalTools
SM2Public-key: signatures, key exchange, encryptionGM/T 0003-2012GB/T 32918-2016ISO/IEC 14888-3 (signatures)SM2 tool
SM3Hash / digest, 256-bitGM/T 0004-2012GB/T 32905-2016ISO/IEC 10118-3:2018SM3 tool
SM4Block cipher, 128-bitGM/T 0002-2012GB/T 32907-2016ISO/IEC 18033-3:2017SM4 tool

Two habits worth forming when you read a Chinese crypto requirement:

  1. Check the year suffix. A document citing "GM/T 0004-2012" and one citing "GB/T 32905-2016" are pointing at the same algorithm (SM3) through different vintages. If a vendor insists the two are different things, that is a red flag about the vendor, not about the standards.
  2. Match the role to the family. "Digest" requirements always land on SM3, "signature or key exchange" on SM2, "data encryption" on SM4. If a requirement asks for SM2 encryption of bulk data, something got garbled in translation — SM2 is for short payloads and key transport, and bulk encryption belongs to SM4.

The elevation path, and why it matters commercially

Every SM algorithm followed the same route: published by the Chinese cryptographic authority in the mid-2000s (SM4 was declassified in 2006), formalized as an industry standard (GM/T, "密码行业标准") in 2012, elevated to a national standard (GB/T, "推荐性国家标准") in 2016, and then submitted into the corresponding ISO/IEC parts in 2017-2018.

The elevation is not paperwork — it changes which tenders can cite it. Procurement documents that once said "per GM/T 0002" were rewritten to "per GB/T 32907", and compliance checklists (MLPS grading, commercial cryptography application assessments) updated to the GB/T numbers. If you are building for the China market today, cite the GB/T numbers in your own documentation; the GM/T names still circulate in older specs and vendor datasheets, which is exactly why both appear in the wild.

RFC 8998: where the three meet TLS 1.3

In March 2021 the IETF published RFC 8998, defining the ShangMi (SM) cipher suites for TLS 1.3: TLS_SM4_GCM_SM3 and TLS_SM4_CCM_SM3. One suite line packs the whole family into its familiar TLS roles:

  • Handshake signatures: SM2 (over the SM2 curve, with SM3 as its hash)
  • Key schedule / transcript hashing: SM3
  • Record encryption: SM4 in GCM or CCM mode (note: GCM/CCM, not the CBC mode most SM4 integrations start with)

This is often the document behind "国密 HTTPS" gateway marketing: a TLS 1.3 stack where every primitive is swapped for its SM counterpart. If a Chinese vendor asks whether your client "supports GM TLS" or "ShangMi suites", they are frequently asking about RFC 8998 — and if you need to inspect what such a gateway actually negotiates, a HAR capture of the handshake viewed in a HAR viewer shows the negotiated suite verbatim.

Boundary versus this site's SM4 tool: the online SM4 page verifies ECB/CBC + PKCS#7 so you can align keys, IVs and encodings. It is not proof that ShangMi record-layer GCM works. Primitive vectors can pass while the protocol suite still fails.

TLCP: the other track assessments more often recognize

TLCP (transport-layer cryptographic protocol, commonly anchored on GB/T 38636) is not "TLS with a few suites swapped" — it is a separate protocol line in domestic compliance contexts, roughly analogous in role to TLS 1.2-era thinking. It runs in parallel with RFC 8998 (TLS 1.3 ShangMi):

TLCPRFC 8998 ShangMi
Generation feelCloser to domestic assessment / MLPS fieldworkTLS 1.3 international profile
CertificatesOften dual certs (signature + encryption)Depends on gateway / implementation
StackTongsuo / GmSSL and peersTLS 1.3 stacks claiming ShangMi

Do not pen "supports RFC 8998" and "passes TLCP assessment items" as the same sentence — reviewers may only credit one track. Hands-on deployment: Guomi HTTPS: TLCP / dual certificates / Tongsuo.

What each number will look like in your project

  • Architecture doc: cites the GB/T numbers (32918 / 32905 / 32907) — cite them back.
  • Vendor SDK datasheet: often still cites GM/T 0003/0004/0002 — same algorithms, older vintage.
  • Compliance report: MLPS or 密评 paperwork — GB/T numbers plus the assessment framework itself (GM/T 0115 family and peers for process).
  • Gateway / TLS requirement: either RFC 8998 ("GM SSL", "ShangMi") or TLCP / GB/T 38636 — ask which track the audit recognizes.

Common citation mistakes (check before the review minutes)

  1. Treating GM/T and GB/T as two algorithms — industry vs national vintages of the same one.
  2. Writing "encrypt large files with SM2" into requirements — role mismatch; bulk data is SM4, SM2 wraps keys or short payloads.
  3. Using "browser SM4 encrypt succeeded" as proof Guomi HTTPS is done — missing protocol layer (certs, handshake, suites).
  4. Calling a CBC interop win "RFC 8998 compliant" — RFC 8998 record encryption is GCM/CCM.
  5. Mixing C1C2C3 with C1C3C2 while only citing "GB/T 32918" — ciphertext order must be spelled out; this site's SM2 tool is fixed to C1C3C2.

Verify before you build

All three algorithms can be exercised locally — no account, no upload — with the SM2 encrypt/decrypt/sign tool, the SM3 hash generator and the SM4 ECB/CBC tool. Before writing integration code, run one known test vector through each: it converts every format disagreement (hex vs base64, C1C3C2 ordering, PKCS#7 padding) from a two-day debugging session into a two-minute conversation with the counterparty.

For the deeper integration workflow — choosing between the algorithms, the debug order when ciphertexts mismatch, and the key-handling boundary — see SM2/SM3/SM4 in Practice. For the family overview see Chinese cryptography introduction.

Triage notes

The whole article teaches exactly one pattern: GM/T is the 2012 industry standard, GB/T the 2016 national standard, ISO/IEC adopted them in 2017-2018, and RFC 8998 is the protocol layer — read that timeline and the entire wall of standard numbers opens up. The first table-reading habit is blunt: citing GM/T 0004-2012 and citing GB/T 32905-2016 name the same algorithm, so when a vendor insists they are different things, the red flag points at the vendor, not the standards. The elevation path gets the commercial reading to itself because it changes which tenders can cite what — your own documents cite GB/T numbers today while GM/T still circulates in old specs and vendor datasheets, which is exactly why both numbers show up in the wild.