Skip to main content

Crate tc_blowfish

Crate tc_blowfish 

Source
Expand description

Blowfish single-block encryption with 4- to 56-byte keys and 8-byte blocks.

§Backend selection

With the rustcrypto feature, BlowfishEngine delegates to BlowfishRustCryptoEngine, backed by the RustCrypto blowfish crate. Without it, the engine delegates to BlowfishTableEngine. Both implementations are also available for direct use when enabled.

§Security

Variable time: key expansion and processing index key-dependent S-boxes with secret data in both backends. Use only where cache-timing leakage is outside the threat model; no constant-time alternative is provided. Stored P-arrays and S-boxes are wiped on drop, but caller buffers and every register or stack copy are not. No mode, padding or authentication is provided.

Structs§

BlowfishEngine
Blowfish with a 4- to 56-byte key and an 8-byte block, on the backend the build selects: BlowfishRustCryptoEngine with the rustcrypto feature, otherwise BlowfishTableEngine.
BlowfishTableEngine
Blowfish with a 4- to 56-byte key and an 8-byte block, using this crate’s own key schedule and S-box tables.

Constants§

ALGO_NAME
Algorithm name written by the engine.
BLOCK_BYTES
Blowfish block length in bytes.
MAX_KEY_BYTES
Maximum Blowfish key length in bytes.
MIN_KEY_BYTES
Minimum Blowfish key length in bytes.