ddn.crypto.cipher.aes

AES (Rijndael) Block Cipher - Constant-Time Implementation.

This implementation uses a boolean circuit for the S-box computation instead of table lookups, providing resistance against cache-timing side-channel attacks.

Security

Note

This implementation executes in constant time

regardless of the key or plaintext values. There are no data-dependent branches or memory accesses that could leak information through timing.

class AES

Types 1

Implementation of the AES block cipher (FIPS 197).

Supports 128, 192, and 256-bit keys.

Constant-Time Implementation: This class uses a boolean circuit to compute the S-box, eliminating table lookups that are vulnerable to cache-timing attacks. All operations execute in constant time regardless of the data being processed.

Methods
void wipe() nothrow @nogc @trustedZeroizes the expanded key schedule.
size_t blockSize() @property constReturns the block size in bytes (always 16 for AES).
void encrypt(const(ubyte)[] input, ubyte[] output)Encrypts a single 16-byte block.
void decrypt(const(ubyte)[] input, ubyte[] output)Decrypts a single 16-byte block.
Constructors
this(const(ubyte)[] key)Constructs a new AES cipher with the given key.