1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-12-03 12:54:05 +00:00
pqcrypto/crypto_sign/dilithium3aes/clean/reduce.h
John Schanck 32c613e8ec Round 3 update for Dilithium (from github source) (#369)
* Update Dilithium

* Alternative montgomery reduce to avoid i386 functest errors

* Explicit casts for msvc

* More casts; bump upstream version; fix metadata

* another cast
2021-03-24 21:02:50 +00:00

18 lines
452 B
C

#ifndef PQCLEAN_DILITHIUM3AES_CLEAN_REDUCE_H
#define PQCLEAN_DILITHIUM3AES_CLEAN_REDUCE_H
#include "params.h"
#include <stdint.h>
#define MONT (-4186625) // 2^32 % Q
#define QINV 58728449 // q^(-1) mod 2^32
int32_t PQCLEAN_DILITHIUM3AES_CLEAN_montgomery_reduce(int64_t a);
int32_t PQCLEAN_DILITHIUM3AES_CLEAN_reduce32(int32_t a);
int32_t PQCLEAN_DILITHIUM3AES_CLEAN_caddq(int32_t a);
int32_t PQCLEAN_DILITHIUM3AES_CLEAN_freeze(int32_t a);
#endif