Skip to main content

Crate tc_sm4

Crate tc_sm4 

Source
Expand description

SM4 single-block encryption with 128-bit keys and blocks.

Variable time: key expansion and block processing use secret-dependent S-box lookups. Use only where cache-timing leakage is outside the threat model; this crate provides no constant-time alternative.

Stored round keys are wiped on drop, but caller buffers and every register or stack copy are not. No mode, padding or authentication is provided.

Structs§

Sm4Engine
SM4 with a 16-byte key and a 16-byte block.

Constants§

ALGO_NAME
Algorithm name written by the engine.
BLOCK_BYTES
SM4 block length in bytes.
KEY_BYTES
SM4 key length in bytes.