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

Fix FIPS202 API memory leaks in Dilithium

This commit is contained in:
Thom Wiggers 2020-02-19 14:46:48 -05:00 committed by Kris Kwiatkowski
parent a804c623de
commit 160030400d
6 changed files with 6 additions and 0 deletions

View File

@ -95,6 +95,7 @@ void PQCLEAN_DILITHIUM2_AVX2_challenge(poly *c,
c->coeffs[b] ^= -(signs & 1) & (1 ^ (Q - 1)); c->coeffs[b] ^= -(signs & 1) & (1 ^ (Q - 1));
signs >>= 1; signs >>= 1;
} }
shake256_ctx_release(&state);
} }
/************************************************* /*************************************************

View File

@ -85,6 +85,7 @@ void PQCLEAN_DILITHIUM2_CLEAN_challenge(poly *c,
c->coeffs[b] ^= -((int32_t)signs & 1) & (1 ^ (Q - 1)); c->coeffs[b] ^= -((int32_t)signs & 1) & (1 ^ (Q - 1));
signs >>= 1; signs >>= 1;
} }
shake256_ctx_release(&state);
} }
/************************************************* /*************************************************

View File

@ -107,6 +107,7 @@ void PQCLEAN_DILITHIUM3_AVX2_challenge(poly *c,
c->coeffs[b] ^= -(signs & 1) & (1 ^ (Q - 1)); c->coeffs[b] ^= -(signs & 1) & (1 ^ (Q - 1));
signs >>= 1; signs >>= 1;
} }
shake256_ctx_release(&state);
} }
/************************************************* /*************************************************

View File

@ -85,6 +85,7 @@ void PQCLEAN_DILITHIUM3_CLEAN_challenge(poly *c,
c->coeffs[b] ^= -((int32_t)signs & 1) & (1 ^ (Q - 1)); c->coeffs[b] ^= -((int32_t)signs & 1) & (1 ^ (Q - 1));
signs >>= 1; signs >>= 1;
} }
shake256_ctx_release(&state);
} }
/************************************************* /*************************************************

View File

@ -122,6 +122,7 @@ void PQCLEAN_DILITHIUM4_AVX2_challenge(poly *c,
c->coeffs[b] ^= -(signs & 1) & (1 ^ (Q - 1)); c->coeffs[b] ^= -(signs & 1) & (1 ^ (Q - 1));
signs >>= 1; signs >>= 1;
} }
shake256_ctx_release(&state);
} }
/************************************************* /*************************************************

View File

@ -85,6 +85,7 @@ void PQCLEAN_DILITHIUM4_CLEAN_challenge(poly *c,
c->coeffs[b] ^= -((int32_t)signs & 1) & (1 ^ (Q - 1)); c->coeffs[b] ^= -((int32_t)signs & 1) & (1 ^ (Q - 1));
signs >>= 1; signs >>= 1;
} }
shake256_ctx_release(&state);
} }
/************************************************* /*************************************************