1
0
Fork 0

Merging upstream version 1.25~rc1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-21 11:33:25 +01:00
parent 1d67e88e3c
commit b8e73cb85f
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
39 changed files with 978 additions and 742 deletions

4
gf8.cc
View file

@ -57,7 +57,7 @@ struct Galois8_table // addition/subtraction is exclusive or
{
uint8_t * const mul_row = mul_table + i * size;
for( int j = 1; j < size; ++j )
mul_row[j] = ilog[(log[i] + log[j]) % (size - 1)];
mul_row[j] = ilog[(log[i] + log[j]) % (size-1)];
}
for( int i = 0; i < size; ++i )
mul_table[0 * size + i] = mul_table[i * size + 0] = 0;
@ -79,7 +79,7 @@ bool check_inverse( const uint8_t * const A, const uint8_t * const B,
uint8_t sum = 0;
for( unsigned i = 0; i < k; ++i, ++pa, pb += k )
sum ^= gf.mul_table[*pa * gf.size + *pb];
if( sum != ( row == col ) ) return false; // A * B != I
if( sum != ( row == col ) ) return false;
}
return true;
}