Skip to main content

Module des

Module des 

Source
Expand description

DES and Triple-DES (TDEA) implemented from FIPS PUB 46-3.

All tables are transcribed verbatim from the FIPS 46-3 document (https://csrc.nist.gov/files/pubs/fips/46-3/final/docs/fips46-3.pdf). Tests use the official NIST CAVP Known Answer Test vectors downloaded directly from csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm- Validation-Program/documents/des/KAT_TDES.zip.

Des keeps the original fast byte-table and fused SP_TABLE software path. DesCt is a separate software-only path that replaces the secret indexed round function with loop-based permutations and packed ANF bitset evaluation of the DES S-boxes.

Structs§

Des
A DES cipher keyed with a single 64-bit key (including parity bits).
DesCt
A software-only constant-time DES path.
TripleDes
A Triple-DES (TDEA) cipher.

Enums§

DesKeyError
Error returned when a DES/TDEA constructor rejects key material.
TDesMode
Keying option for Triple-DES.

Functions§

is_weak_or_semi_weak_key
Return true when key is weak or semi-weak under DES.
key_schedule
Generate the key schedule from a 64-bit key (including parity bits). Returns 16 subkeys, each 48 bits (stored in the low 48 bits of u64).

Type Aliases§

KeySchedule
A 16-round DES key schedule: 16 × 48-bit subkeys.