Parcourir la source

Fix reduce.c's overflowing multiplication

undefined
Thom Wiggers il y a 4 ans
Parent
révision
39fa1ccfc7
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: 1BB0A7CE26E363
6 fichiers modifiés avec 6 ajouts et 6 suppressions
  1. +1
    -1
      crypto_kem/kyber1024-90s/clean/reduce.c
  2. +1
    -1
      crypto_kem/kyber1024/clean/reduce.c
  3. +1
    -1
      crypto_kem/kyber512-90s/clean/reduce.c
  4. +1
    -1
      crypto_kem/kyber512/clean/reduce.c
  5. +1
    -1
      crypto_kem/kyber768-90s/clean/reduce.c
  6. +1
    -1
      crypto_kem/kyber768/clean/reduce.c

+ 1
- 1
crypto_kem/kyber1024-90s/clean/reduce.c Voir le fichier

@@ -18,7 +18,7 @@ int16_t PQCLEAN_KYBER102490S_CLEAN_montgomery_reduce(int32_t a) {
int32_t t;
int16_t u;

u = (int16_t)(a * QINV);
u = (int16_t)(a * (int64_t)QINV);
t = (int32_t)u * KYBER_Q;
t = a - t;
t >>= 16;


+ 1
- 1
crypto_kem/kyber1024/clean/reduce.c Voir le fichier

@@ -18,7 +18,7 @@ int16_t PQCLEAN_KYBER1024_CLEAN_montgomery_reduce(int32_t a) {
int32_t t;
int16_t u;

u = (int16_t)(a * QINV);
u = (int16_t)(a * (int64_t)QINV);
t = (int32_t)u * KYBER_Q;
t = a - t;
t >>= 16;


+ 1
- 1
crypto_kem/kyber512-90s/clean/reduce.c Voir le fichier

@@ -18,7 +18,7 @@ int16_t PQCLEAN_KYBER51290S_CLEAN_montgomery_reduce(int32_t a) {
int32_t t;
int16_t u;

u = (int16_t)(a * QINV);
u = (int16_t)(a * (int64_t)QINV);
t = (int32_t)u * KYBER_Q;
t = a - t;
t >>= 16;


+ 1
- 1
crypto_kem/kyber512/clean/reduce.c Voir le fichier

@@ -18,7 +18,7 @@ int16_t PQCLEAN_KYBER512_CLEAN_montgomery_reduce(int32_t a) {
int32_t t;
int16_t u;

u = (int16_t)(a * QINV);
u = (int16_t)(a * (int64_t)QINV);
t = (int32_t)u * KYBER_Q;
t = a - t;
t >>= 16;


+ 1
- 1
crypto_kem/kyber768-90s/clean/reduce.c Voir le fichier

@@ -18,7 +18,7 @@ int16_t PQCLEAN_KYBER76890S_CLEAN_montgomery_reduce(int32_t a) {
int32_t t;
int16_t u;

u = (int16_t)(a * QINV);
u = (int16_t)(a * (int64_t)QINV);
t = (int32_t)u * KYBER_Q;
t = a - t;
t >>= 16;


+ 1
- 1
crypto_kem/kyber768/clean/reduce.c Voir le fichier

@@ -18,7 +18,7 @@ int16_t PQCLEAN_KYBER768_CLEAN_montgomery_reduce(int32_t a) {
int32_t t;
int16_t u;

u = (int16_t)(a * QINV);
u = (int16_t)(a * (int64_t)QINV);
t = (int32_t)u * KYBER_Q;
t = a - t;
t >>= 16;


Chargement…
Annuler
Enregistrer