1
1
kopie van https://github.com/henrydcase/pqc.git synced 2024-11-22 07:35:38 +00:00

Fix overflow in multiplication in Saber

This commit is contained in:
Sofía Celi 2020-08-11 10:47:34 -05:00 gecommit door Kris Kwiatkowski
bovenliggende 3d05000b2c
commit c59580a355
3 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen

Bestand weergeven

@ -47,7 +47,7 @@ static void karatsuba_simple(const uint16_t *a_1, const uint16_t *b_1, uint16_t
acc7 = acc5 + acc6; //b01
acc8 = acc1 + acc2; //a01
d01[i + j] = d01[i + j] + acc7 * acc8;
d01[i + j] = d01[i + j] + (uint16_t)(acc7 * (uint64_t)acc8);
//--------------------------------------------------------
acc7 = b_1[j + 2 * KARATSUBA_N / 4]; //b2

Bestand weergeven

@ -47,7 +47,7 @@ static void karatsuba_simple(const uint16_t *a_1, const uint16_t *b_1, uint16_t
acc7 = acc5 + acc6; //b01
acc8 = acc1 + acc2; //a01
d01[i + j] = d01[i + j] + acc7 * acc8;
d01[i + j] = d01[i + j] + (uint16_t)(acc7 * (uint64_t)acc8);
//--------------------------------------------------------
acc7 = b_1[j + 2 * KARATSUBA_N / 4]; //b2

Bestand weergeven

@ -47,7 +47,7 @@ static void karatsuba_simple(const uint16_t *a_1, const uint16_t *b_1, uint16_t
acc7 = acc5 + acc6; //b01
acc8 = acc1 + acc2; //a01
d01[i + j] = d01[i + j] + acc7 * acc8;
d01[i + j] = d01[i + j] + (uint16_t)(acc7 * (uint64_t)acc8);
//--------------------------------------------------------
acc7 = b_1[j + 2 * KARATSUBA_N / 4]; //b2