summaryrefslogtreecommitdiff
path: root/src/ref/multiplications.h
diff options
context:
space:
mode:
authorGaetan Leplus <gaetan.leplus@airbus.com>2019-07-05 16:16:19 +0200
committerGaetan Leplus <gaetan.leplus@airbus.com>2019-07-05 16:16:19 +0200
commita432c19745907a96303b3a25111e0fd622202e0c (patch)
tree3ac352a3598fa444d45695dbb2b4cee63698ac57 /src/ref/multiplications.h
parent92893d79b36c9fb5a90644b82d16d9fa2563feb1 (diff)
parent4f58d99e11e1c412a600f39f32a8d181765f0246 (diff)
downloadlilliput-ae-implem-a432c19745907a96303b3a25111e0fd622202e0c.tar.xz
Merge remote-tracking branch 'origin/master' into fix-vhdltbc
Diffstat (limited to 'src/ref/multiplications.h')
-rw-r--r--src/ref/multiplications.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ref/multiplications.h b/src/ref/multiplications.h
index 4de1848..c0645b9 100644
--- a/src/ref/multiplications.h
+++ b/src/ref/multiplications.h
@@ -71,6 +71,26 @@ static void _multiply_M3(const uint8_t x[LANE_BYTES], uint8_t y[LANE_BYTES])
y[0] = x[5];
}
+static void _multiply_M4(const uint8_t x[LANE_BYTES], uint8_t y[LANE_BYTES])
+{
+ uint8_t a_5 = x[5]<<3 ^ x[4];
+ uint8_t a_4 = x[4]>>3 ^ x[3];
+ uint8_t b_5 = a_5<<3 ^ a_4;
+ uint8_t b_4 = a_4>>3 ^ x[2];
+
+ uint8_t c_4 = b_4>>3 ^ x[6]<<2 ^ x[1];
+ uint8_t c_5 = b_5<<3 ^ b_4;
+
+ y[7] = b_5;
+ y[6] = c_5;
+ y[5] = c_5<<3 ^ c_4;
+ y[4] = c_4>>3 ^ x[5]<<2 ^ x[0];
+ y[3] = a_5<<2 ^ x[7];
+ y[2] = b_5<<2 ^ x[6];
+ y[1] = x[5];
+ y[0] = a_5;
+}
+
static void _multiply_MR(const uint8_t x[LANE_BYTES], uint8_t y[LANE_BYTES])
{
y[0] = x[1];