33.2.11-15Vector Crypto III: SHA-2, GCM, SM Suites & Composites

Part III Linux boot: optional Vol. I (Unprivileged) pp. 486–493 · ~2 min read

The hash, authenticated-encryption, and ShangMi extensions, and the composite bundles that package them for real deployments.

The remaining Zvk* extensions and composites
Contents
Zvknha / Zvknhb — vector SHA-2vsha2ms (message schedule), vsha2ch/vsha2cl (compression). Zvknha = SHA-256 (128-bit groups, Zve32x); Zvknhb adds SHA-512 (256-bit groups, needs Zve64x).
Zvkg — GCM/GMACvghsh (GHASH multiply-accumulate over GF(2^128)), vgmul — the authentication half of AES-GCM in dedicated instructions.
Zvksed / Zvksh — ShangMiSM4 block cipher (vsm4k key, vsm4r round) and SM3 hash (vsm3me expansion, vsm3c compression).
Zvkt — constant-time contractExtends data-independent latency to the bitmanip/clmul instructions (the crypto-specific ones are already intrinsically constant-time).
Zvkn / Zvknc / ZvkngNIST composites: Zvkn = AES + SHA-2 + bitmanip + Zvkt; Zvknc = Zvkn + Zvbc (GHASH via clmul); Zvkng = Zvkn + Zvkg (dedicated GCM).
Zvks / Zvksc / ZvksgThe ShangMi mirrors: SM4 + SM3 + bitmanip + Zvkt, with the same +clmul / +GCM variants.
Dotted-underlined cells have explanations — click one.

Hardware Designer Notes

The composites are the acquisition unit: a datasheet says “Zvkng” and you know it does full vectorized AES-GCM + SHA-2. For a Linux server targeting kTLS, Zvkng is the line item; the individual extensions are how you build it. Instruction-level detail follows on the reference pages.

Minimal Linux-boot hart MUST

  • SHA-256 on 128-bit groups (Zve32x ok); SHA-512 on 256-bit groups requires Zve64x — size the element-group datapath accordingly
  • Implement vghsh/vgmul over GF(2^128) with data-independent latency for Zvkg
  • Enforce the composite-extension membership (implementing Zvkn means all its components)

MAY simplify / trap-and-emulate

  • Choose Zvknc (clmul-based GCM) for a general core or Zvkng (dedicated) for a crypto-throughput target
  • Implement Zvknha only (SHA-256) on a 32-bit-element core; add Zvknhb with Zve64x

Check yourself — SM extensions & composites

1.Why does vector SHA-512 (Zvknhb) require Zve64x while vector SHA-256 works on Zve32x?

2.What does the composite extension Zvkng bundle, and who is it for?

2 questions