From 7ec6a47c8966c99f51412bc0648c3d58f5376e73 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Thu, 18 May 2023 15:55:11 +0200 Subject: [PATCH] added code that might be faster on smaller CPUs --- galois_field.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/galois_field.hh b/galois_field.hh index 1db8d6f..be3a32f 100644 --- a/galois_field.hh +++ b/galois_field.hh @@ -376,7 +376,13 @@ template GaloisFieldReference operator * (GaloisFieldReference a, GaloisFieldReference b) { GaloisFieldReference p(0); +#if 0 + if (a.v < b.v) + std::swap(a, b); + while (a.v && b.v) { +#else for (int i = 0; i < M; ++i) { +#endif if (b.v & 1) p.v ^= a.v; if (a.v & (TYPE(1) << (M - 1)))