Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sntrup-kem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ serde = ["dep:serdect", "dep:serde"]
js = ["getrandom/wasm_js"]

[dependencies]
ctutils = "0.4"
hex = "0.4"
rand = "0.10.0"
rand_chacha = "0.10.0"
subtle = "2"
getrandom = { version = "0.4", optional = true }
hybrid-array = { version = "0.4.14", features = ["extra-sizes"], optional = true }
kem = { version = "0.3", optional = true }
Expand Down
14 changes: 7 additions & 7 deletions sntrup-kem/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::error::Error;
use crate::params::SntrupParams;
use core::marker::PhantomData;
use subtle::ConstantTimeEq;
use ctutils::{Choice, CtEq};
use zeroize::Zeroize;

/// Streamlined NTRU Prime encapsulation key (public key).
Expand Down Expand Up @@ -215,11 +215,11 @@ impl<P: SntrupParams> PartialEq for Ciphertext<P> {
impl<P: SntrupParams> Eq for Ciphertext<P> {}

// ---------------------------------------------------------------------------
// ConstantTimeEq / PartialEq / Eq (DecapsulationKey)
// CtEq / PartialEq / Eq (DecapsulationKey)
// ---------------------------------------------------------------------------

impl<P: SntrupParams> ConstantTimeEq for DecapsulationKey<P> {
fn ct_eq(&self, other: &Self) -> subtle::Choice {
impl<P: SntrupParams> CtEq for DecapsulationKey<P> {
fn ct_eq(&self, other: &Self) -> Choice {
self.bytes.as_slice().ct_eq(other.bytes.as_slice())
}
}
Expand All @@ -233,11 +233,11 @@ impl<P: SntrupParams> PartialEq for DecapsulationKey<P> {
impl<P: SntrupParams> Eq for DecapsulationKey<P> {}

// ---------------------------------------------------------------------------
// ConstantTimeEq / PartialEq / Eq (SharedSecret)
// CtEq / PartialEq / Eq (SharedSecret)
// ---------------------------------------------------------------------------

impl<P: SntrupParams> ConstantTimeEq for SharedSecret<P> {
fn ct_eq(&self, other: &Self) -> subtle::Choice {
impl<P: SntrupParams> CtEq for SharedSecret<P> {
fn ct_eq(&self, other: &Self) -> Choice {
self.bytes.as_slice().ct_eq(other.bytes.as_slice())
}
}
Expand Down
Loading