![]() |
Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
|
DEMO |
AES-256 in Counter Mode (CTR) as specified in NIST SP 800-38A. More...
#include <aes_ctr.hpp>
Public Member Functions | |
| AesCtr (const uint8_t key[KEY_SIZE]) | |
| Initialize with a 32-byte key. | |
| AesCtr (const AesCtr &)=delete | |
| AesCtr & | operator= (const AesCtr &)=delete |
| expected< std::vector< uint8_t > > | process (const uint8_t *data, size_t size, const uint8_t iv[IV_SIZE]) const |
| Encrypt or decrypt data using AES-CTR. | |
| expected< std::vector< uint8_t > > | encrypt (const uint8_t *data, size_t size, const uint8_t iv[IV_SIZE]) const |
| Convenience alias for process() – encrypt data with AES-CTR. | |
| expected< std::vector< uint8_t > > | decrypt (const uint8_t *data, size_t size, const uint8_t iv[IV_SIZE]) const |
| Convenience alias for process() – decrypt data with AES-CTR. | |
Static Public Attributes | |
| static constexpr size_t | KEY_SIZE = 32 |
| AES-256 key size in bytes. | |
| static constexpr size_t | IV_SIZE = 16 |
| Full 128-bit IV/counter size in bytes. | |
AES-256 in Counter Mode (CTR) as specified in NIST SP 800-38A.
CTR mode converts AES into a stream cipher by encrypting sequential counter blocks and XORing the resulting keystream with the data. Because XOR is its own inverse, encryption and decryption are the same operation.
This mode is used for Parquet column data encryption where authentication is not needed (column integrity is verified by page checksums).
Definition at line 68 of file aes_ctr.hpp.
|
inlineexplicit |
Initialize with a 32-byte key.
Definition at line 74 of file aes_ctr.hpp.
|
delete |
|
inline |
Convenience alias for process() – decrypt data with AES-CTR.
| data | Pointer to ciphertext bytes. |
| size | Number of bytes to decrypt. |
| iv | 16-byte initialization vector (must match encryption IV). |
Definition at line 173 of file aes_ctr.hpp.
|
inline |
Convenience alias for process() – encrypt data with AES-CTR.
| data | Pointer to plaintext bytes. |
| size | Number of bytes to encrypt. |
| iv | 16-byte initialization vector. |
Definition at line 162 of file aes_ctr.hpp.
|
inline |
Encrypt or decrypt data using AES-CTR.
CTR mode is symmetric: encrypt(plaintext) == decrypt(ciphertext), because the keystream is generated independently and simply XORed.
| data | Pointer to input bytes (plaintext or ciphertext). |
| size | Number of bytes to process. |
| iv | 16-byte initialization vector / initial counter value. |
Definition at line 108 of file aes_ctr.hpp.
|
staticconstexpr |
Full 128-bit IV/counter size in bytes.
Definition at line 71 of file aes_ctr.hpp.
|
staticconstexpr |
AES-256 key size in bytes.
Definition at line 70 of file aes_ctr.hpp.