diff --git a/crypto_kem/newhope1024cca/clean/poly.c b/crypto_kem/newhope1024cca/clean/poly.c index e368a6b3..94422dcf 100644 --- a/crypto_kem/newhope1024cca/clean/poly.c +++ b/crypto_kem/newhope1024cca/clean/poly.c @@ -256,7 +256,6 @@ static unsigned char hw(unsigned char a) { **************************************************/ void PQCLEAN_NEWHOPE1024CCA_CLEAN_poly_sample(poly *r, const unsigned char *seed, unsigned char nonce) { unsigned char buf[128], a, b; -// uint32_t t, d, a, b, c; int i, j; unsigned char extseed[NEWHOPE_SYMBYTES + 2]; @@ -273,18 +272,6 @@ void PQCLEAN_NEWHOPE1024CCA_CLEAN_poly_sample(poly *r, const unsigned char *seed a = buf[2 * j]; b = buf[2 * j + 1]; r->coeffs[64 * i + j] = hw(a) + NEWHOPE_Q - hw(b); - /* - t = buf[j] | ((uint32_t)buf[j+1] << 8) | ((uint32_t)buf[j+2] << 16) | ((uint32_t)buf[j+3] << 24); - d = 0; - for(k=0;k<8;k++) - d += (t >> k) & 0x01010101; - a = d & 0xff; - b = ((d >> 8) & 0xff); - c = ((d >> 16) & 0xff); - d >>= 24; - r->coeffs[64*i+j/2] = a + NEWHOPE_Q - b; - r->coeffs[64*i+j/2+1] = c + NEWHOPE_Q - d; - */ } } } diff --git a/crypto_kem/newhope1024cpa/clean/poly.c b/crypto_kem/newhope1024cpa/clean/poly.c index 360e07d7..772fa5a7 100644 --- a/crypto_kem/newhope1024cpa/clean/poly.c +++ b/crypto_kem/newhope1024cpa/clean/poly.c @@ -256,7 +256,6 @@ static unsigned char hw(unsigned char a) { **************************************************/ void PQCLEAN_NEWHOPE1024CPA_CLEAN_poly_sample(poly *r, const unsigned char *seed, unsigned char nonce) { unsigned char buf[128], a, b; -// uint32_t t, d, a, b, c; int i, j; unsigned char extseed[NEWHOPE_SYMBYTES + 2]; @@ -273,18 +272,6 @@ void PQCLEAN_NEWHOPE1024CPA_CLEAN_poly_sample(poly *r, const unsigned char *seed a = buf[2 * j]; b = buf[2 * j + 1]; r->coeffs[64 * i + j] = hw(a) + NEWHOPE_Q - hw(b); - /* - t = buf[j] | ((uint32_t)buf[j+1] << 8) | ((uint32_t)buf[j+2] << 16) | ((uint32_t)buf[j+3] << 24); - d = 0; - for(k=0;k<8;k++) - d += (t >> k) & 0x01010101; - a = d & 0xff; - b = ((d >> 8) & 0xff); - c = ((d >> 16) & 0xff); - d >>= 24; - r->coeffs[64*i+j/2] = a + NEWHOPE_Q - b; - r->coeffs[64*i+j/2+1] = c + NEWHOPE_Q - d; - */ } } } diff --git a/crypto_kem/newhope512cca/clean/poly.c b/crypto_kem/newhope512cca/clean/poly.c index 53c54083..7998c417 100644 --- a/crypto_kem/newhope512cca/clean/poly.c +++ b/crypto_kem/newhope512cca/clean/poly.c @@ -252,7 +252,6 @@ static unsigned char hw(unsigned char a) { **************************************************/ void PQCLEAN_NEWHOPE512CCA_CLEAN_poly_sample(poly *r, const unsigned char *seed, unsigned char nonce) { unsigned char buf[128], a, b; -// uint32_t t, d, a, b, c; int i, j; unsigned char extseed[NEWHOPE_SYMBYTES + 2]; @@ -269,18 +268,6 @@ void PQCLEAN_NEWHOPE512CCA_CLEAN_poly_sample(poly *r, const unsigned char *seed, a = buf[2 * j]; b = buf[2 * j + 1]; r->coeffs[64 * i + j] = hw(a) + NEWHOPE_Q - hw(b); - /* - t = buf[j] | ((uint32_t)buf[j+1] << 8) | ((uint32_t)buf[j+2] << 16) | ((uint32_t)buf[j+3] << 24); - d = 0; - for(k=0;k<8;k++) - d += (t >> k) & 0x01010101; - a = d & 0xff; - b = ((d >> 8) & 0xff); - c = ((d >> 16) & 0xff); - d >>= 24; - r->coeffs[64*i+j/2] = a + NEWHOPE_Q - b; - r->coeffs[64*i+j/2+1] = c + NEWHOPE_Q - d; - */ } } } diff --git a/crypto_kem/newhope512cpa/clean/poly.c b/crypto_kem/newhope512cpa/clean/poly.c index cd6cac24..720d8e4f 100644 --- a/crypto_kem/newhope512cpa/clean/poly.c +++ b/crypto_kem/newhope512cpa/clean/poly.c @@ -252,7 +252,6 @@ static unsigned char hw(unsigned char a) { **************************************************/ void PQCLEAN_NEWHOPE512CPA_CLEAN_poly_sample(poly *r, const unsigned char *seed, unsigned char nonce) { unsigned char buf[128], a, b; -// uint32_t t, d, a, b, c; int i, j; unsigned char extseed[NEWHOPE_SYMBYTES + 2]; @@ -269,18 +268,6 @@ void PQCLEAN_NEWHOPE512CPA_CLEAN_poly_sample(poly *r, const unsigned char *seed, a = buf[2 * j]; b = buf[2 * j + 1]; r->coeffs[64 * i + j] = hw(a) + NEWHOPE_Q - hw(b); - /* - t = buf[j] | ((uint32_t)buf[j+1] << 8) | ((uint32_t)buf[j+2] << 16) | ((uint32_t)buf[j+3] << 24); - d = 0; - for(k=0;k<8;k++) - d += (t >> k) & 0x01010101; - a = d & 0xff; - b = ((d >> 8) & 0xff); - c = ((d >> 16) & 0xff); - d >>= 24; - r->coeffs[64*i+j/2] = a + NEWHOPE_Q - b; - r->coeffs[64*i+j/2+1] = c + NEWHOPE_Q - d; - */ } } } diff --git a/test/duplicate_consistency/newhope1024cca_clean.yml b/test/duplicate_consistency/newhope1024cca_clean.yml new file mode 100644 index 00000000..21764ea3 --- /dev/null +++ b/test/duplicate_consistency/newhope1024cca_clean.yml @@ -0,0 +1,43 @@ +consistency_checks: +- source: + scheme: newhope1024cpa + implementation: clean + files: + - ntt.c + - poly.c + - precomp.c + - cpapke.c + - reduce.c + - verify.c + - params.h + - cpapke.h + - ntt.h + - poly.h + - reduce.h + - verify.h +- source: + scheme: newhope512cca + implementation: clean + files: + - kem.c + - cpapke.c + - reduce.c + - verify.c + - cpapke.h + - ntt.h + - poly.h + - reduce.h + - verify.h +- source: + scheme: newhope512cpa + implementation: clean + files: + - cpapke.c + - reduce.c + - verify.c + - cpapke.h + - ntt.h + - poly.h + - reduce.h + - verify.h + diff --git a/test/duplicate_consistency/newhope1024cpa_clean.yml b/test/duplicate_consistency/newhope1024cpa_clean.yml new file mode 100644 index 00000000..ecf8b874 --- /dev/null +++ b/test/duplicate_consistency/newhope1024cpa_clean.yml @@ -0,0 +1,42 @@ +consistency_checks: +- source: + scheme: newhope1024cca + implementation: clean + files: + - ntt.c + - poly.c + - precomp.c + - cpapke.c + - reduce.c + - verify.c + - params.h + - cpapke.h + - ntt.h + - poly.h + - reduce.h + - verify.h +- source: + scheme: newhope512cca + implementation: clean + files: + - cpapke.c + - reduce.c + - verify.c + - cpapke.h + - ntt.h + - poly.h + - reduce.h + - verify.h +- source: + scheme: newhope512cpa + implementation: clean + files: + - kem.c + - cpapke.c + - reduce.c + - verify.c + - cpapke.h + - ntt.h + - poly.h + - reduce.h + - verify.h diff --git a/test/duplicate_consistency/newhope512cca_clean.yml b/test/duplicate_consistency/newhope512cca_clean.yml new file mode 100644 index 00000000..ff0c6036 --- /dev/null +++ b/test/duplicate_consistency/newhope512cca_clean.yml @@ -0,0 +1,44 @@ +consistency_checks: +- source: + scheme: newhope1024cpa + implementation: clean + files: + - cpapke.c + - reduce.c + - verify.c + - cpapke.h + - ntt.h + - poly.h + - reduce.h + - verify.h +- source: + scheme: newhope1024cca + implementation: clean + files: + - kem.c + - cpapke.c + - reduce.c + - verify.c + - cpapke.h + - ntt.h + - poly.h + - reduce.h + - verify.h +- source: + scheme: newhope512cpa + implementation: clean + files: + - ntt.c + - poly.c + - precomp.c + - cpapke.c + - reduce.c + - verify.c + - params.h + - cpapke.h + - ntt.h + - poly.h + - reduce.h + - verify.h + + diff --git a/test/duplicate_consistency/newhope512cpa_clean.yml b/test/duplicate_consistency/newhope512cpa_clean.yml new file mode 100644 index 00000000..e18fab3b --- /dev/null +++ b/test/duplicate_consistency/newhope512cpa_clean.yml @@ -0,0 +1,42 @@ +consistency_checks: +- source: + scheme: newhope1024cpa + implementation: clean + files: + - kem.c + - cpapke.c + - reduce.c + - verify.c + - cpapke.h + - ntt.h + - poly.h + - reduce.h + - verify.h +- source: + scheme: newhope1024cca + implementation: clean + files: + - cpapke.c + - reduce.c + - verify.c + - cpapke.h + - ntt.h + - poly.h + - reduce.h + - verify.h +- source: + scheme: newhope512cca + implementation: clean + files: + - ntt.c + - poly.c + - precomp.c + - cpapke.c + - reduce.c + - verify.c + - params.h + - cpapke.h + - ntt.h + - poly.h + - reduce.h + - verify.h