1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-26 17:31:38 +00:00

Merge pull request #310 from claucece/master

Fix overflow in multiplication in Saber
This commit is contained in:
Thom Wiggers 2020-08-11 22:28:13 +02:00 committed by GitHub
commit d38002f5c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ static void karatsuba_simple(const uint16_t *a_1, const uint16_t *b_1, uint16_t
acc7 = acc5 + acc6; //b01 acc7 = acc5 + acc6; //b01
acc8 = acc1 + acc2; //a01 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 acc7 = b_1[j + 2 * KARATSUBA_N / 4]; //b2

View File

@ -47,7 +47,7 @@ static void karatsuba_simple(const uint16_t *a_1, const uint16_t *b_1, uint16_t
acc7 = acc5 + acc6; //b01 acc7 = acc5 + acc6; //b01
acc8 = acc1 + acc2; //a01 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 acc7 = b_1[j + 2 * KARATSUBA_N / 4]; //b2

View File

@ -47,7 +47,7 @@ static void karatsuba_simple(const uint16_t *a_1, const uint16_t *b_1, uint16_t
acc7 = acc5 + acc6; //b01 acc7 = acc5 + acc6; //b01
acc8 = acc1 + acc2; //a01 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 acc7 = b_1[j + 2 * KARATSUBA_N / 4]; //b2