diff --git a/CHANGELOG.md b/CHANGELOG.md index 3689cc9e..b44889ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [12.0.1] - 2023-07-19 + +### Changed + +- patched kyber seed security issue + ## [12.0.0] - 2023-07-11 ### Changed diff --git a/Cargo.toml b/Cargo.toml index d5ee5822..74db76bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cosmian_cover_crypt" -version = "12.0.0" +version = "12.0.1" authors = [ "Théophile Brezot ", "Bruno Grieder ", diff --git a/src/core/primitives.rs b/src/core/primitives.rs index 264c4f4b..b12ff3f1 100644 --- a/src/core/primitives.rs +++ b/src/core/primitives.rs @@ -134,8 +134,9 @@ pub fn encaps( xor_in_place(&mut e_i, &seed); if let Some(pk_i) = pk_i { let mut epq_i = [0; KYBER_INDCPA_BYTES]; - // TODO TBZ: which coin to use ? - indcpa_enc(&mut epq_i, &e_i, pk_i, &[0; KYBER_SYMBYTES]); + let mut coin = Zeroizing::new([0; KYBER_SYMBYTES]); + rng.fill_bytes(&mut *coin); + indcpa_enc(&mut epq_i, &e_i, pk_i, &*coin); encs.insert(KeyEncapsulation::HybridEncapsulation(Box::new(epq_i))); } else { encs.insert(KeyEncapsulation::ClassicEncapsulation(Box::new(e_i)));