RISC-V ISA Explorer · Cryptography (Zk*)
Zks: ShangMi Suite (Scalar)
Ratified 2022-02 · version 1.0.1
Shorthand for the Chinese ShangMi scalar set: the SM4 block cipher, the SM3 hash, and crypto bitmanip.
Typical use: ShangMi algorithms required in China
Open Zks in the explorerDependencies
Requires
Members
Instructions (24)
| Mnemonic | Name | Encoding | Match | Mask |
|---|---|---|---|---|
ANDN | AND with inverted operand | 0100000----------111-----0110011 | 0x40007033 | 0xfe00707f |
BREV8 | Reverse bits in bytes | 011010000111-----101-----0010011 | 0x68705013 | 0xfff0707f |
CLMUL | Carry-less multiply (low-part) | 0000101----------001-----0110011 | 0xa001033 | 0xfe00707f |
CLMULH | Carry-less multiply (high-part) | 0000101----------011-----0110011 | 0xa003033 | 0xfe00707f |
ORN | OR with inverted operand | 0100000----------110-----0110011 | 0x40006033 | 0xfe00707f |
PACK | 0000100----------100-----0110011 | 0x8004033 | 0xfe00707f | |
PACKH | 0000100----------111-----0110011 | 0x8007033 | 0xfe00707f | |
PACKW | 0000100----------100-----0111011 | 0x800403b | 0xfe00707f | |
REV8.RV32 | 011010011000-----101-----0010011 | 0x69805013 | 0xfff0707f | |
ROL | Rotate left (Register) | 0110000----------001-----0110011 | 0x60001033 | 0xfe00707f |
ROLW | Rotate left word (Register) | 0110000----------001-----0111011 | 0x6000103b | 0xfe00707f |
ROR | Rotate right (Register) | 0110000----------101-----0110011 | 0x60005033 | 0xfe00707f |
RORI | Rotate right (Immediate) | 011000-----------101-----0010011 | 0x60005013 | 0xfc00707f |
RORIW | Rotate right word (Immediate) | 0110000----------101-----0011011 | 0x6000501b | 0xfe00707f |
RORW | Rotate right word (Register) | 0110000----------101-----0111011 | 0x6000503b | 0xfe00707f |
SM3P0 | 000100001000-----001-----0010011 | 0x10801013 | 0xfff0707f | |
SM3P1 | 000100001001-----001-----0010011 | 0x10901013 | 0xfff0707f | |
SM4ED | --11000----------000-----0110011 | 0x30000033 | 0x3e00707f | |
SM4KS | --11010----------000-----0110011 | 0x34000033 | 0x3e00707f | |
UNZIP | Bit deinterleave | 000010001111-----101-----0010011 | 0x08f05013 | 0xfff0707f |
XNOR | Exclusive NOR | 0100000----------100-----0110011 | 0x40004033 | 0xfe00707f |
XPERM4 | Crossbar permutation (nibbles) | 0010100----------010-----0110011 | 0x28002033 | 0xfe00707f |
XPERM8 | Crossbar permutation (bytes) | 0010100----------100-----0110011 | 0x28004033 | 0xfe00707f |
ZIP | Bit interleave | 000010001111-----001-----0010011 | 0x08f01013 | 0xfff0707f |