Skip to content

Commit

Permalink
Fix the "zeroise" spelling error, and use the feature directly
Browse files Browse the repository at this point in the history
Skip creating an extra feature "zero" and instead just use the one
called "zeroize" by having the dependency optional
  • Loading branch information
faern committed Sep 29, 2022
1 parent 3ec919a commit 854aa8d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ avx2 = []
# For compiling to wasm targets
wasm = ["wasm-bindgen", "getrandom", "rand"]

zero = ["zeroize"]

# For benchmarking
benchmarking = ["criterion"]

Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pqc_kyber = {version = "0.2.0", features = ["kyber512", "90s", "avx2"]}
| 90s | Uses SHA2 and AES in counter mode as a replacement for SHAKE. This can provide hardware speedups in some cases. |
| avx2 | On x86_64 platforms enable the optimized version. This flag is will cause a compile error on other architectures. |
| wasm | For compiling to WASM targets. |
| zero | This will zero out the key exchange structs on drop using the [zeroize](https://docs.rs/zeroize/latest/zeroize/) crate |
| zeroize | This will zero out the key exchange structs on drop using the [zeroize](https://docs.rs/zeroize/latest/zeroize/) crate |
| benchmarking | Enables the criterion benchmarking suite |
---

Expand Down
6 changes: 3 additions & 3 deletions src/kex.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rand_core::{RngCore, CryptoRng};
#[cfg(feature = "zeroise")]
#[cfg(feature = "zeroize")]
use zeroize::{Zeroize, ZeroizeOnDrop};
use crate::{
kem::*,
Expand Down Expand Up @@ -58,7 +58,7 @@ type Eska = [u8; KYBER_SECRETKEYBYTES];
/// assert_eq!(alice.shared_secret, bob.shared_secret);
/// # Ok(()) }
#[cfg_attr(feature = "zeroise", derive(Zeroize, ZeroizeOnDrop))]
#[cfg_attr(feature = "zeroize", derive(Zeroize, ZeroizeOnDrop))]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Uake {
/// The resulting shared secret from a key exchange
Expand Down Expand Up @@ -186,7 +186,7 @@ impl Uake {
/// # Ok(()) }
/// ```
#[derive(Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "zeroise", derive(Zeroize, ZeroizeOnDrop))]
#[cfg_attr(feature = "zeroize", derive(Zeroize, ZeroizeOnDrop))]
pub struct Ake {
/// The resulting shared secret from a key exchange
pub shared_secret: SharedSecret,
Expand Down

0 comments on commit 854aa8d

Please sign in to comment.