Skip to main content

Try it Live

Run AES-GCM examples in the interactive playground

Overview

Test vectors from NIST SP 800-38D validate AES-GCM implementation correctness. These tests cover various scenarios including different key sizes, plaintext lengths, and AAD configurations.

NIST SP 800-38D Test Vectors

AES-128-GCM Test Case 1

Empty plaintext, no AAD:

AES-128-GCM Test Case 2

16-byte plaintext, no AAD:

AES-128-GCM Test Case 3

With AAD (from NIST vectors):

AES-256-GCM Test Case 1

Empty plaintext, 32-byte key:

AES-256-GCM Test Case 2

16-byte plaintext, 32-byte key:

Edge Case Test Vectors

Maximum Length Nonce (96 bits)

All-Ones Key and Nonce

Large Plaintext

Negative Test Vectors

Wrong Key

Wrong Nonce

Modified Ciphertext

Modified Authentication Tag

Wrong AAD

Invalid Nonce Length

Ciphertext Too Short

Running All Tests

Helper Functions

References