Explorar el Código

remove duplication

blog/frodo_constant_time_issue
Henry Case hace 3 años
padre
commit
e9249a2bee
Se han modificado 1 ficheros con 22 adiciones y 0 borrados
  1. +22
    -0
      src/kem/kyber/common/reduce.h

+ 22
- 0
src/kem/kyber/common/reduce.h Ver fichero

@@ -0,0 +1,22 @@
#ifndef KYBER_REDUCE_H
#define KYBER_REDUCE_H

#include <stdint.h>

// TODO: Remove those once not used
#define PQCLEAN_KYBER512_CLEAN_montgomery_reduce kyber_montgomery_reduce
#define PQCLEAN_KYBER768_CLEAN_montgomery_reduce kyber_montgomery_reduce
#define PQCLEAN_KYBER1024_CLEAN_montgomery_reduce kyber_montgomery_reduce

#define PQCLEAN_KYBER512_CLEAN_barrett_reduce kyber_barrett_reduce
#define PQCLEAN_KYBER768_CLEAN_barrett_reduce kyber_barrett_reduce
#define PQCLEAN_KYBER1024_CLEAN_barrett_reduce kyber_barrett_reduce

#define MONT 2285 // 2^16 mod q
#define QINV 62209 // q^-1 mod 2^16

int16_t kyber_montgomery_reduce(int32_t a);

int16_t kyber_barrett_reduce(int16_t a);

#endif

Cargando…
Cancelar
Guardar