Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
DEMO
Loading...
Searching...
No Matches
signet::forge::crypto::Aes256 Class Reference

AES-256 block cipher (FIPS-197). More...

#include <aes_core.hpp>

Public Member Functions

 Aes256 (const uint8_t key[KEY_SIZE])
 Initialize with a 32-byte key. Performs key expansion immediately.
 
 Aes256 (const Aes256 &)=delete
 
Aes256operator= (const Aes256 &)=delete
 
 Aes256 (Aes256 &&other) noexcept
 
Aes256operator= (Aes256 &&other) noexcept
 
 ~Aes256 ()
 Destructor: securely zero round keys to prevent key material leakage.
 
void encrypt_block (uint8_t block[BLOCK_SIZE]) const
 Encrypt a single 16-byte block in-place (FIPS-197 Section 5.1).
 
void decrypt_block (uint8_t block[BLOCK_SIZE]) const
 Decrypt a single 16-byte block in-place (FIPS-197 Section 5.3).
 

Static Public Attributes

static constexpr size_t KEY_SIZE = 32
 Key size in bytes (256 bits).
 
static constexpr size_t BLOCK_SIZE = 16
 Block size in bytes (128 bits).
 
static constexpr int NUM_ROUNDS = 14
 Number of AES-256 rounds.
 

Detailed Description

AES-256 block cipher (FIPS-197).

Clean-room, table-based implementation providing correct AES-256 encrypt and decrypt for a single 128-bit block. Higher-level modes (GCM, CTR) are built on top in separate headers.

Note
The destructor securely zeroes all round key material using volatile writes to prevent optimiser elimination.
See also
AesGcm, AesCtr for higher-level modes

Definition at line 253 of file aes_core.hpp.

Constructor & Destructor Documentation

◆ Aes256() [1/3]

signet::forge::crypto::Aes256::Aes256 ( const uint8_t  key[KEY_SIZE])
inlineexplicit

Initialize with a 32-byte key. Performs key expansion immediately.

Definition at line 260 of file aes_core.hpp.

◆ Aes256() [2/3]

signet::forge::crypto::Aes256::Aes256 ( const Aes256 )
delete

◆ Aes256() [3/3]

signet::forge::crypto::Aes256::Aes256 ( Aes256 &&  other)
inlinenoexcept

Definition at line 266 of file aes_core.hpp.

◆ ~Aes256()

signet::forge::crypto::Aes256::~Aes256 ( )
inline

Destructor: securely zero round keys to prevent key material leakage.

Definition at line 270 of file aes_core.hpp.

Member Function Documentation

◆ decrypt_block()

void signet::forge::crypto::Aes256::decrypt_block ( uint8_t  block[BLOCK_SIZE]) const
inline

Decrypt a single 16-byte block in-place (FIPS-197 Section 5.3).

Uses the "direct" inverse cipher: AddRoundKey(14), then 13 rounds of InvShiftRows/InvSubBytes/AddRoundKey/InvMixColumns, followed by a final round without InvMixColumns.

Parameters
block16-byte ciphertext block; overwritten with plaintext.

Definition at line 328 of file aes_core.hpp.

◆ encrypt_block()

void signet::forge::crypto::Aes256::encrypt_block ( uint8_t  block[BLOCK_SIZE]) const
inline

Encrypt a single 16-byte block in-place (FIPS-197 Section 5.1).

Applies AddRoundKey(0), then 13 rounds of SubBytes/ShiftRows/MixColumns/ AddRoundKey, followed by a final round without MixColumns.

Parameters
block16-byte plaintext block; overwritten with ciphertext.

Definition at line 280 of file aes_core.hpp.

◆ operator=() [1/2]

Aes256 & signet::forge::crypto::Aes256::operator= ( Aes256 &&  other)
inlinenoexcept

Definition at line 267 of file aes_core.hpp.

◆ operator=() [2/2]

Aes256 & signet::forge::crypto::Aes256::operator= ( const Aes256 )
delete

Member Data Documentation

◆ BLOCK_SIZE

constexpr size_t signet::forge::crypto::Aes256::BLOCK_SIZE = 16
staticconstexpr

Block size in bytes (128 bits).

Definition at line 256 of file aes_core.hpp.

◆ KEY_SIZE

constexpr size_t signet::forge::crypto::Aes256::KEY_SIZE = 32
staticconstexpr

Key size in bytes (256 bits).

Definition at line 255 of file aes_core.hpp.

◆ NUM_ROUNDS

constexpr int signet::forge::crypto::Aes256::NUM_ROUNDS = 14
staticconstexpr

Number of AES-256 rounds.

Definition at line 257 of file aes_core.hpp.


The documentation for this class was generated from the following file: