Initializes the AEGIS-128x2 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[16] key = [0x01, 0x02, ..., 0x10]; ubyte[16] nonce = [0x00, 0x01, ..., 0x0F]; ubyte[] ad = [0x41, 0x42, 0x43]; // Associated data ubyte[] message = [0x48, 0x65, 0x6C, 0x6C, 0x6F]; // "Hello" ubyte[128] ciphertext; ubyte[16] mac; size_t written; auto state = Aegis128x2State(key, nonce, ad); state.encryptUpdate(ciphertext[], &written, message); state.encryptDetachedFinal(ciphertext[written .. $], &written, mac[], 16);
AEGIS-128x2 encryption/decryption state.
Manages the lifecycle of an aegis128x2_state object in a @nogc and @trusted context.