Skip to main content

Crate tc_serpent

Crate tc_serpent 

Source
Expand description

Serpent and Tnepres single-block encryption.

Constant time with respect to key and block contents: both engines use bitsliced S-boxes and fixed rotations. Tnepres uses a different byte representation, not an alias for Serpent. Key lengths are public. Stored schedules are wiped on drop, but caller buffers and every register or stack copy are not. No mode, padding or authentication is provided.

Structs§

SerpentEngine
Serpent with a 4- to 32-byte key in four-byte steps and a 16-byte block. Uses the conventional little-endian representation.
TnepresEngine
Tnepres with a 4- to 32-byte key in four-byte steps and a 16-byte block. Uses the byte- and word-reversed AES-submission representation, not a Serpent alias.

Constants§

BLOCK_BYTES
Block length in bytes.
KEY_STEP_BYTES
Accepted key lengths advance by this many bytes.
MAX_KEY_BYTES
Maximum key length in bytes.
MIN_KEY_BYTES
Minimum key length in bytes.
SERPENT_ALGO_NAME
Algorithm name of the conventional representation.
TNEPRES_ALGO_NAME
Algorithm name of the reversed representation.