diff options
| author | Gaetan Leplus <gaetan.leplus@airbus.com> | 2019-07-05 16:16:19 +0200 |
|---|---|---|
| committer | Gaetan Leplus <gaetan.leplus@airbus.com> | 2019-07-05 16:16:19 +0200 |
| commit | 62433c71e25f157dd79ba10d81631ee4c67f8eb1 (patch) | |
| tree | 3ac352a3598fa444d45695dbb2b4cee63698ac57 /src/ref/tweakey.c | |
| parent | de5f3445b5d382237afc39869907957e65c8a91e (diff) | |
| parent | 75d7f59658539c699cdf9c7a3abdbead15aac199 (diff) | |
| download | lilliput-ae-implem-62433c71e25f157dd79ba10d81631ee4c67f8eb1.tar.xz | |
Merge remote-tracking branch 'origin/master' into fix-vhdltbc
Diffstat (limited to 'src/ref/tweakey.c')
| -rw-r--r-- | src/ref/tweakey.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ref/tweakey.c b/src/ref/tweakey.c index 2f357ca..510f35a 100644 --- a/src/ref/tweakey.c +++ b/src/ref/tweakey.c @@ -63,10 +63,11 @@ void tweakey_state_extract( typedef void (*matrix_multiplication)(const uint8_t x[LANE_BYTES], uint8_t y[LANE_BYTES]); -static const matrix_multiplication ALPHAS[6] = { +static const matrix_multiplication ALPHAS[7] = { _multiply_M, _multiply_M2, _multiply_M3, + _multiply_M4, _multiply_MR, _multiply_MR2, _multiply_MR3 @@ -75,15 +76,13 @@ static const matrix_multiplication ALPHAS[6] = { void tweakey_state_update(uint8_t TK[TWEAKEY_BYTES]) { - /* Skip lane 0, as it is multiplied by the identity matrix. */ - - for (size_t j=1; j<LANES_NB; j++) + for (size_t j=0; j<LANES_NB; j++) { uint8_t *TKj = TK + j*LANE_BYTES; uint8_t TKj_old[LANE_BYTES]; memcpy(TKj_old, TKj, LANE_BYTES); - ALPHAS[j-1](TKj_old, TKj); + ALPHAS[j](TKj_old, TKj); } } |
