1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-26 09:21:28 +00:00

remove unnecessary if in kyber768

clang-tidy9.0.0 added a new check: bugprone-branch-clone
(https://releases.llvm.org/9.0.0/tools/clang/tools/extra/docs/ReleaseNotes.html)
This doesn't like both branches of an if are the same.
In this case I don't think there is any reason to do this, so I've removed it.
This commit is contained in:
Matthias J. Kannwischer 2019-10-15 14:37:00 +02:00 committed by Kris Kwiatkowski
parent 873d176652
commit 6c98832774

View File

@ -199,11 +199,7 @@ static void gen_matrix(polyvec *a, const uint8_t *seed, int transposed) {
PQCLEAN_KYBER768_AVX2_poly_nttunpack(&a[2].vec[0]); PQCLEAN_KYBER768_AVX2_poly_nttunpack(&a[2].vec[0]);
PQCLEAN_KYBER768_AVX2_poly_nttunpack(&a[2].vec[1]); PQCLEAN_KYBER768_AVX2_poly_nttunpack(&a[2].vec[1]);
if (transposed) {
PQCLEAN_KYBER768_AVX2_kyber_shake128_absorb(&state1x, seed, 2, 2); PQCLEAN_KYBER768_AVX2_kyber_shake128_absorb(&state1x, seed, 2, 2);
} else {
PQCLEAN_KYBER768_AVX2_kyber_shake128_absorb(&state1x, seed, 2, 2);
}
PQCLEAN_KYBER768_AVX2_kyber_shake128_squeezeblocks(buf.x[0], GEN_MATRIX_MAXNBLOCKS, &state1x); PQCLEAN_KYBER768_AVX2_kyber_shake128_squeezeblocks(buf.x[0], GEN_MATRIX_MAXNBLOCKS, &state1x);
bufbytes = GEN_MATRIX_MAXNBLOCKS * XOF_BLOCKBYTES; bufbytes = GEN_MATRIX_MAXNBLOCKS * XOF_BLOCKBYTES;