Expand description
Fixsliced implementations of AES-128, AES-192 and AES-256 (64-bit) adapted from the C implementation.
All implementations are fully bitsliced and do not rely on any Look-Up Table (LUT).
See the paper at https://eprint.iacr.org/2020/1123.pdf for more details.
Β§Author (original C code)
Alexandre Adomnicai, Nanyang Technological University, Singapore [email protected]
Originally licensed MIT. Relicensed as Apache 2.0+MIT with permission.
Macros§
- define_
mix_ πcolumns Computation of the MixColumns transformation in the fixsliced representation, with different rotations used according to the round number mod 4.
Functions§
- add_
round_ πkey XOR the round key to the internal state. The round keys are expected to be pre-computed and to be packed in the fixsliced representation. - aes128_
decrypt πFully-fixsliced AES-128 decryption (the InvShiftRows is completely omitted). - aes128_
encrypt πFully-fixsliced AES-128 encryption (the ShiftRows is completely omitted). - aes128_
key_ πschedule Fully bitsliced AES-128 key schedule to match the fully-fixsliced representation. - aes192_
decrypt πFully-fixsliced AES-192 decryption (the InvShiftRows is completely omitted). - aes192_
encrypt πFully-fixsliced AES-192 encryption (the ShiftRows is completely omitted). - aes192_
key_ πschedule Fully bitsliced AES-192 key schedule to match the fully-fixsliced representation. - aes256_
decrypt πFully-fixsliced AES-256 decryption (the InvShiftRows is completely omitted). - aes256_
encrypt πFully-fixsliced AES-256 encryption (the ShiftRows is completely omitted). - aes256_
key_ πschedule Fully bitsliced AES-256 key schedule to match the fully-fixsliced representation. - bitslice πBitslice four 128-bit input blocks input0, input1, input2, input3 into a 512-bit internal state.
- delta_
swap_ π1 - delta_
swap_ π2 - inv_
bitslice πUn-bitslice a 512-bit internal state into four 128-bit blocks of output. - inv_
mix_ πcolumns_ 0 - inv_
mix_ πcolumns_ 1 - inv_
mix_ πcolumns_ 2 - inv_
mix_ πcolumns_ 3 - inv_
shift_ πrows_ 1 - inv_
shift_ πrows_ 2 - inv_
shift_ πrows_ 3 - inv_
sub_ πbytes Note that the 4 bitwise NOT (^= 0xffffffffffffffff) are accounted for here so that it is a true inverse of βsub_bytesβ. - memshift32 πCopy 32-bytes within the provided slice to an 8-byte offset
- mix_
columns_ π0 - mix_
columns_ π1 - mix_
columns_ π2 - mix_
columns_ π3 - ror π
- ror_
distance π - rotate_
rows_ π1 - rotate_
rows_ π2 - shift_
rows_ π1 Applies ShiftRows once on an AES state (or key). - shift_
rows_ π2 Applies ShiftRows twice on an AES state (or key). - shift_
rows_ π3 Applies ShiftRows three times on an AES state (or key). - sub_
bytes πBitsliced implementation of the AES Sbox based on Boyar, Peralta and Calik. - sub_
bytes_ πnots NOT operations that are omitted in S-box - xor_
columns πXOR the columns after the S-box during the key schedule round function.
Type Aliases§
- Batch
Blocks π - Fixslice
Blocks πAES block batch size for this implementation - Fixslice
Keys128 πAES-128 round keys - Fixslice
Keys192 πAES-192 round keys - Fixslice
Keys256 πAES-256 round keys - State π512-bit internal state