pqc/crypto_kem/sntrup857/clean/crypto_verify_1184.c
John M. Schanck 70543bba37 Add sntrup{653,761,857} and ntrulpr{653,761,857}
Exported from SUPERCOP-20200826 using the scripts at:
https://github.com/jschanck/pqclean-package-ntruprime
2020-08-28 20:22:56 -04:00

14 lines
358 B
C

#include "crypto_verify_1184.h"
int PQCLEAN_SNTRUP857_CLEAN_crypto_verify_1184(const unsigned char *x, const unsigned char *y) {
unsigned int differentbits = 0;
int i;
for (i = 0; i < PQCLEAN_SNTRUP857_CLEAN_crypto_verify_1184_BYTES; ++i) {
differentbits |= x[i] ^ y[i];
}
return (int) (1 & ((differentbits - 1) >> 8)) - 1;
}