
The design was implemented as part of an undergraduate academic project.
This design implements the LEA-128 cryptographic algorithm according to the specifications presented in the original paper by its developers [1] and is based on the ideas and architectures proposed in [2] and [3] for an area-efficient implementation.
The design supports both encryption and decryption operations using a very simple handshake-based byte-oriented interface.
The module receives:
The bytes are loaded serially through ui_in using an input handshake protocol.
After all bytes are loaded:
uio_in[3] starts encryptionuio_in[4] starts decryptionThe processed output block is then transmitted byte-by-byte through uo_out using an output handshake protocol.
| Pin | Function |
|---|---|
ui_in[7:0] |
Input byte bus |
uo_out[7:0] |
Output byte bus |
uio_in[0] |
request (input handshake) |
uio_in[1] |
request (output handshake) |
uio_in[2] |
acknowledge (output handshake) |
uio_in[3] |
Start encryption |
uio_in[4] |
Start decryption |
uio_out[6] |
valid (output handshake) |
uio_out[7] |
acknowledge (input handshake) |
The remaining bidirectional pins are unused.
To send a byte into the design:
ui_in.uio_in[0] high.uio_out[7] becomes high.uio_in[0].uio_out[7] returns low.The first 16 transmitted bytes are interpreted as the encryption key. The next 16 transmitted bytes are interpreted as the input data block.
To receive the plaintext/ciphertext from the design:
uio_in[1] high.uio_out[6] becomes high.uo_out.uio_in[2] high .uio_in[1].The output block is transmitted one byte at a time.
The test vector was sourced from Wikipedia. [4]
rst_n low.0f 1e 2d 3c 4b 5a 69 78
87 96 a5 b4 c3 d2 e1 f0
10 11 12 13 14 15 16 17
18 19 1a 1b 1c 1d 1e 1f
uio_in[3] high to start encryption.Expected ciphertext:
9f c8 4e 35 28 c6 c6 18
55 32 c7 a7 04 64 8b fd
uio_in[4] high to start decryption.Expected plaintext:
10 11 12 13 14 15 16 17
18 19 1a 1b 1c 1d 1e 1f
[1] D. Hong, J.-K. Lee, D.-C. Kim, D. Kwon, K. H. Ryu, and D.-G. Lee, “LEA: A 128-Bit Block Cipher for Fast Encryption on Common Processors,” in Information Security and Cryptology – ICISC 2013, Springer, 2014.
[2] D. Lee, D.-C. Kim, D. Kwon, and H. Kim, “Efficient hardware implementation of the lightweight block encryption algorithm LEA,” Sensors, vol. 14, no. 1, pp. 975–994, Jan. 2014. doi: 10.3390/s140100975.
[3] M.-J. Sung, G.-C. Bae, and K.-W. Shin, “Implementation of Lightweight Encryption Algorithm LEA,” IDEC Journal of Integrated Circuits and Systems, vol. 2, no. 2, Jul. 2016.
[4] Wikipedia contributors, “LEA (cipher),” Wikipedia, The Free Encyclopedia. Available: https://en.wikipedia.org/wiki/LEA_(cipher). Licensed under CC BY-SA 4.0.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | data_in[0] | data_out[0] | req_rx |
| 1 | data_in[1] | data_out[1] | req_tx |
| 2 | data_in[2] | data_out[2] | ack_tx |
| 3 | data_in[3] | data_out[3] | enable_encryption |
| 4 | data_in[4] | data_out[4] | enable_decryption |
| 5 | data_in[5] | data_out[5] | |
| 6 | data_in[6] | data_out[6] | valid_tx |
| 7 | data_in[7] | data_out[7] | ack_rx |