-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump bincode
and secrecy
for no_std
builds
#140
Changes from 5 commits
8f345c7
c4fe49e
88f5fc0
4aa6870
9c161a1
a993172
f5a5f15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
use core::fmt::{self, Debug}; | ||
use core::fmt::Debug; | ||
|
||
use rand_core::CryptoRngCore; | ||
use secrecy::DebugSecret; | ||
use serde::{Deserialize, Serialize}; | ||
use zeroize::ZeroizeOnDrop; | ||
|
||
|
@@ -12,20 +11,12 @@ use crate::uint::{ | |
RandomPrimeWithRng, Retrieve, Signed, UintLike, UintModLike, | ||
}; | ||
|
||
#[derive(Clone, Serialize, Deserialize, ZeroizeOnDrop)] | ||
#[derive(Clone, Debug, Serialize, Deserialize, ZeroizeOnDrop)] | ||
pub(crate) struct SecretKeyPaillier<P: PaillierParams> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it somehow obscure the secret values in the output, the way the previous implementation did? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it doesn't log the inner value. See the implementation on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh sorry, you're right. I thought they were One other option here would be to |
||
p: P::HalfUint, | ||
q: P::HalfUint, | ||
} | ||
|
||
impl<P: PaillierParams> DebugSecret for SecretKeyPaillier<P> {} | ||
|
||
impl<P: PaillierParams> Debug for SecretKeyPaillier<P> { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { | ||
Self::debug_secret(f) | ||
} | ||
} | ||
|
||
impl<P: PaillierParams> SecretKeyPaillier<P> { | ||
pub fn random(rng: &mut impl CryptoRngCore) -> Self { | ||
let p = P::HalfUint::generate_safe_prime_with_rng(rng, Some(P::PRIME_BITS)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we don't need a manual implementation of
DebugSecret
anymore like forSecretKeyPaillier
since a) this already had a derivedDebug
implementation and b) anybody that's using for secret values these can wrap them in aSecretBox
and use thatDebug
implementation