
Iterative AES-256 encryption: a 256-bit key and 128-bit plaintext produce a 128-bit ciphertext. The core processes one AES round per clock using a shared round datapath and composite-field GF S-boxes. Initial AddRoundKey occurs when the core accepts start. Rounds 1..13 apply SubBytes, ShiftRows, MixColumns and AddRoundKey. Round 14 omits MixColumns. A shared key-schedule step prepares the next 128-bit round key in parallel, using the previous two round keys.
The core accepts inputs only when idle, pulses done after 14 clock periods, and holds its result until reset or another completion. Its minimum initiation interval is 15 periods. The wrapper uses done rather than a fixed delay counter.
This is the AES block primitive with public preset keys, for architectural validation. It does not implement padding, authentication, nonce/IV handling, or a complete message encryption mode.
| Pins | Direction | Function |
|---|---|---|
| ui[7:0] | Input | Key selector or plaintext byte |
| uo[7:0] | Output | Ciphertext byte, zero when not valid or not enabled |
| uio[0] | Input | LOAD: accept one byte per rising edge |
| uio[1] | Input | START: launch the complete loaded request |
| uio[2] | Input | NEXT: consume the currently visible output byte |
| uio[3] | Input | ABORT: synchronously clear transaction and status |
| uio[4] | Output | BUSY |
| uio[5] | Output | READY: 17 bytes loaded and not busy |
| uio[6] | Output | VALID: output byte available |
| uio[7] | Output | ERROR: sticky protocol error |
uio_oe=0xf0 while enabled; zero when deselected. Only the low four uio input
bits are commands. LOAD=0x01, START=0x02, NEXT=0x04, ABORT=0x08. Status masks:
BUSY=0x10, READY=0x20, VALID=0x40, ERROR=0x80; combinations are possible.
Commands and data are sampled on rising clock edges. Hold LOAD/NEXT for one operation per edge; pulse START for one edge. The host must satisfy setup and hold requirements. There are no asynchronous synchronizers or UART.
rst_n is synchronous active low. ABORT overrides other commands. ena=0
disables bidirectional drivers immediately and clears the transaction on the
next clock edge. Supply a reset edge after selection if no deselected clock
edge occurred.
Byte 0 selects key 0..7. Bytes 1..16 are plaintext in conventional byte order: first byte becomes bits [127:120], last byte [7:0]. Ciphertext is emitted in the same order. No per-word byte reversal is performed.
| Selector | Key bytes, in order |
|---|---|
| 0 | 00 through 1f |
| 1 | 20 through 3f |
| 2 | 40 through 5f |
| 3 | 60 through 7f |
| 4 | 80 through 9f |
| 5 | a0 through bf |
| 6 | c0 through df |
| 7 | e0 through ff |
Test vector: selector 00, plaintext 00112233445566778899aabbccddeeff. Expected ciphertext: 8ea2b7ca516745bfeafc49904b496089. At 10 MHz, core latency is 1.4 us and START-to-VALID is 1.6 us, excluding I/O.
Invalid selectors do not advance the byte count. Extra input bytes, incomplete START, commands while BUSY, NEXT without VALID, and simultaneous LOAD/START/NEXT set ERROR and ignore the offending command. ERROR stays set until reset, abort or deselection; it does not prevent later valid commands. Loading a new frame while a previous result remains valid is permitted. Starting that frame discards any unread old result. ABORT discards both input and output.
A microcontroller or FPGA supplying a synchronous clock, byte data, and command signals. The 100 ns synthesis constraint is a target, not a measured maximum frequency. Physical fit, timing and gate-level checks must be evaluated after running the GDS workflow for this AES implementation.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | data_in[0] | data_out[0] | load |
| 1 | data_in[1] | data_out[1] | start |
| 2 | data_in[2] | data_out[2] | next |
| 3 | data_in[3] | data_out[3] | abort |
| 4 | data_in[4] | data_out[4] | busy |
| 5 | data_in[5] | data_out[5] | ready |
| 6 | data_in[6] | data_out[6] | valid |
| 7 | data_in[7] | data_out[7] | error |