Initializes the AEGIS-256 state with the provided key, nonce, and associated data.
Destructor to clean up the state.
Disabled copy constructor to prevent state duplication.
Finalizes decryption in detached mode, verifying the MAC and producing final plaintext.
Decrypts a ciphertext chunk, producing plaintext.
Finalizes encryption in detached mode, producing the final ciphertext and MAC.
Encrypts a message chunk, producing ciphertext.
ubyte[32] key = [0x01, 0x02, ..., 0x20]; ubyte[32] nonce = [0x00, 0x01, ..., 0x1F]; ubyte[] ad = [0x41, 0x42, 0x43]; // "ABC" ubyte[] message = [0x48, 0x65, 0x6C, 0x6C, 0x6F]; // "Hello" ubyte[128] ciphertext; ubyte[16] mac; size_t written; auto state = Aegis256State(key, nonce, ad); state.encryptUpdate(ciphertext[], &written, message); state.encryptDetachedFinal(ciphertext[written .. $], &written, mac[], 16);
AEGIS-256 encryption/decryption state.
Manages the lifecycle of an aegis256_state object, ensuring proper initialization and cleanup in a @nogc and @trusted context.