OKlibrary  0.2.1.6

Plans on the AES implementation. More...

Go to the source code of this file.

## Detailed Description

Plans on the AES implementation.

Todo:
Docus
• Add docus on small-scale implementation, discussing the parameters, design decisions etc.
• Included in the design decisions should be mention of the fact we choose to stick to a byte-matrix representation of the MixColumn rather than generalising this to a large bit-matrix to avoid generalising too far from the original AES and overcomplicating the code, which should be very easy to read.
Todo:
Generating test vectors
• We need to see side-by-side, for all the variations, our computation and the corresponding computation in the Sage system.
• And this for several inputs.
• And not only w.r.t. encryption and decryption, but also regarding the basic building blocks.
• An implementation of the small-scale variants presented in [Algebraic Aspects of the Advanced Encryption Standard] and in more detail in [Small Scale Variants of the AES] is available in SAGE.
• To run the encryption for AES given a plaintext and key, one does the following in the Sage system:
```import sage.crypto
sr = mq.SR(10,4,4,8, star=true, allow_zero_inversions=true)
AES_e = sr(sr.state_array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]), sr.state_array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]))
AES_e
```
with
```[                        a^7 + a^5 + 1                 a^7 + a^6 + a^5 + a^2                         a^7 + a^2 + a                 a^6 + a^5 + a^4 + a^3]
[      a^6 + a^5 + a^4 + a^3 + a^2 + a             a^7 + a^6 + a^5 + a^4 + a                                   a^5       a^7 + a^6 + a^5 + a^3 + a^2 + a]
[        a^7 + a^4 + a^3 + a^2 + a + 1                   a^6 + a^4 + a^3 + a                 a^7 + a^5 + a^4 + a^2 a^7 + a^6 + a^5 + a^4 + a^3 + a^2 + 1]
[                  a^6 + a^5 + a^3 + 1                     a^7 + a^3 + a + 1         a^7 + a^5 + a^3 + a^2 + a + 1         a^6 + a^5 + a^3 + a^2 + a + 1]
```
as the result, and this can be converted to the hexidecimal format, like so
```sr.hex_str(AES_e, typ="vector")
```
resulting in
```'66E94BD4EF8A2C3B884CFA59CA342B2E'
```
• Note above that the first four parameters to the "sr" constructor are r,n_R,n_C,e as specified above, and then
1. the "star" parameter specifies that the small-scale AES variant should include a different final round (as occurs with the standard AES),
2. "allow_zero_inversions" specifies that the field inversion should be extended such that 0^(-1) = 0 (as in the AES).
• There also appears to be an "aes_mode" parameter which suggests that the key schedule implemented is somehow different to the AES, but this does not seem to be the case in either the definition or in any basic tests so far. This needs to be further considered, or the authors should be e-mailed.
• This information should be moved to the docus.
Todo:
DONE (Handled in "Notions and notations" in ComputerAlgebra/Cryptology/Lisp/CryptoSystems/Rijndael/plans/general.hpp) Datatypes and naming conventions
• A naming scheme for each of the datatypes used, as well as for the whole class of small-scale AES functions must be devised.
• DONE For now, functions are prefixed with "ss_" for "small-scale".
Bug:
DONE (Added missing final "true" in test) Test failure with level "full"
• ```okltest_ss_inv_sbox_gen(ss_inv_sbox_gen)
Evaluation took 2.1840 seconds (2.9790 elapsed)
true
okltest_ss_sbox_bf(ss_sbox_bf)
ASSERT: Expression " done " does not evaluate to true.