diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-07-04 17:13:57 +0200 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-07-04 17:13:57 +0200 |
| commit | 3d1334d6a9eb091b457f068033071f97d8758941 (patch) | |
| tree | ce7a28187e7c407f6fa56bf4ff4ed29245f8b484 /src/ref/tweakey.c | |
| parent | 6589f3ef20f8f93168be49135764764cd0c02a23 (diff) | |
| parent | c670bbe78ea9bc18c9772ba5804f610937560d5f (diff) | |
| download | lilliput-ae-implem-3d1334d6a9eb091b457f068033071f97d8758941.tar.xz | |
Merge branch 'fix-tweakey-m4'
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); } } |
