Skip to content

Commit 238ffd0

Browse files
committed
move Declassify implementation to impl_hacl.rs
1 parent 25fdb1c commit 238ffd0

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

rsa/src/impl_hacl.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ fn hacl_hash_alg(alg: crate::DigestAlgorithm) -> libcrux_hacl_rs::streaming_type
112112
}
113113
}
114114

115+
#[cfg(feature = "check-secret-independence")]
116+
impl<'a> libcrux_secrets::Declassify for VarLenPrivateKey<'a, U8> {
117+
type Declassified = VarLenPrivateKey<'a, u8>;
118+
fn declassify(self) -> Self::Declassified {
119+
use libcrux_secrets::DeclassifyRef;
120+
VarLenPrivateKey {
121+
pk: self.pk,
122+
d: self.d.declassify_ref(),
123+
}
124+
}
125+
}
126+
115127
#[cfg(feature = "check-secret-independence")]
116128
impl<'a, const LEN: usize> libcrux_secrets::DeclassifyRef
117129
for &'a PrivateKey<LEN, libcrux_secrets::U8>

rsa/src/impl_signature_trait.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,6 @@ use super::impl_hacl::*;
33
use libcrux_secrets::U8;
44
use libcrux_traits::signature::{arrayref, owned, secrets, slice};
55

6-
#[cfg(feature = "check-secret-independence")]
7-
impl<'a> libcrux_secrets::Declassify for VarLenPrivateKey<'a, U8> {
8-
type Declassified = VarLenPrivateKey<'a, u8>;
9-
fn declassify(self) -> Self::Declassified {
10-
use libcrux_secrets::DeclassifyRef;
11-
VarLenPrivateKey {
12-
pk: self.pk,
13-
d: self.d.declassify_ref(),
14-
}
15-
}
16-
}
17-
186
// $bytes is vk_len, sk_len and sig_len
197
macro_rules! impl_signature_trait {
208
($bits:literal, $bytes:literal, $digest_alg:ident, $alias:ident) => {

0 commit comments

Comments
 (0)