
This project is an ASIC implementation of TinyJAMBU-128, an encryption cipher that was selected as a finalist in NIST's Lightweight Cryptography competition.
The design is implemented in Clash (a Haskell HDL).
TinyJAMBU holds a 128-bit internal state that's split into four 32-bit register ($s_0, s_1, s_2, s_3$) and uses a 128-bit key split into four 32-bit words ($k_0, k_1, k_2, k_3$).
| Pin | Name | Direction | Description |
| ui_in[7:0] | data_in[7:0] | Input | input data byte |
| uo_out[7:0] | data_out[7:0] | Output | output byte |
| uio[0] | in_valid | Input | set HIGH for 1 cycle when the input command is valid |
| uio[1] | in_last | Input | set HIGH when feeding the final byte of an unaligned block ({{CONTENT}}lt;4b$) |
| uio[4:2] | cmd[2:0] | Input | command selector (see table) |
| uio[5] | is_ready | Output | HIGH when the core is idle and ready to receive commands |
| uio[6] | out_valid | Output | HIGH when valid output data is present on uo_out |
| uio[7] | out_last | Output | HIGH during the final byte of an output burst |
The bidirectional pin output enable uio_oe is managed with 0xE0, wich makes uio[7:5] outputs and uio[4:0] inputs.
| Cmd | Code (cmd[2:0]) | Description |
| KEY | 3'd1 | stream in 16 bytes of key |
| NONCE | 3'd2 | stream in 12 bytes of nonce (3x4b) |
| AD | 3'd3 | stream in Associated Data bytes |
| ENC | 3'd4 | stream in Plaintext bytes. Ciphertext is returned by uo_out |
| DEC | 3'd5 | stream in Ciphertext bytes. Plaintext is returned by uo_out |
| FIN | 3'd6 | finalize message and create an 8-byte auth tag over uo_out |
| RESET | 3'd7 | reset chip state to initial state |
Connect a microcontroller (e.g. ESP32) to the board header.
No specialized hardware is needed, but you do need a microcontroller or some other way to control GPIO pins.
A digital logic analyzer would probably also be helpful.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | data_in[0] | data_out[0] | in_valid |
| 1 | data_in[1] | data_out[1] | in_last |
| 2 | data_in[2] | data_out[2] | cmd[0] |
| 3 | data_in[3] | data_out[3] | cmd[1] |
| 4 | data_in[4] | data_out[4] | cmd[2] |
| 5 | data_in[5] | data_out[5] | is_ready |
| 6 | data_in[6] | data_out[6] | out_valid |
| 7 | data_in[7] | data_out[7] | out_last |