The hash, authenticated-encryption, and ShangMi extensions, and the composite bundles that package them for real deployments.
| Contents | |
|---|---|
| Zvknha / Zvknhb — vector SHA-2 | vsha2ms (message schedule), vsha2ch/vsha2cl (compression). Zvknha = SHA-256 (128-bit groups, Zve32x); Zvknhb adds SHA-512 (256-bit groups, needs Zve64x). |
| Zvkg — GCM/GMAC | vghsh (GHASH multiply-accumulate over GF(2^128)), vgmul — the authentication half of AES-GCM in dedicated instructions. |
| Zvksed / Zvksh — ShangMi | SM4 block cipher (vsm4k key, vsm4r round) and SM3 hash (vsm3me expansion, vsm3c compression). |
| Zvkt — constant-time contract | Extends data-independent latency to the bitmanip/clmul instructions (the crypto-specific ones are already intrinsically constant-time). |
| Zvkn / Zvknc / Zvkng | NIST composites: Zvkn = AES + SHA-2 + bitmanip + Zvkt; Zvknc = Zvkn + Zvbc (GHASH via clmul); Zvkng = Zvkn + Zvkg (dedicated GCM). |
| Zvks / Zvksc / Zvksg | The ShangMi mirrors: SM4 + SM3 + bitmanip + Zvkt, with the same +clmul / +GCM variants. |
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