Skip to content

Commit

Permalink
fix: vulnerability introduced by the use of a constant Kyber coin
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrezot committed Jul 19, 2023
1 parent 45c7f87 commit 201de64
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cosmian_cover_crypt"
version = "12.0.0"
version = "12.0.1"
authors = [
"Théophile Brezot <[email protected]>",
"Bruno Grieder <[email protected]>",
Expand Down
5 changes: 3 additions & 2 deletions src/core/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down

0 comments on commit 201de64

Please sign in to comment.