Skip to main content

Module hctr2

Module hctr2 

Source
Expand description

HCTR2 (Hash-CTR-Hash) length-preserving wide-block tweakable cipher.

HCTR2 provides full-block diffusion: any change to plaintext affects the entire ciphertext. It requires no nonce or authentication tag, making it suitable for constrained environments.

Construction uses:

  • Single encryption key
  • Polyval universal hash function
  • XCTR mode for wide-block encryption (counter-based)

Security properties:

  • Ciphertext length equals plaintext length (no expansion)
  • Requires unique (key, tweak) pairs for security
  • No authentication - consider AEAD if integrity protection is needed
  • Minimum message length: 16 bytes (one AES block)

Structs§

Hctr2
Generic HCTR2 cipher parameterized by AES key size.

Traits§

AesCipher
Trait for AES ciphers used in HCTR2.

Type Aliases§

Hctr2ErrorDeprecated
Hctr2_128
HCTR2 with AES-128 encryption.
Hctr2_256
HCTR2 with AES-256 encryption.