implement Zeroize where needed or skip where not needed (#301)

This commit is contained in:
Conrado Gouvea 2023-04-13 12:26:35 -03:00 committed by GitHub
parent 8f9b3e54c0
commit 850381fe24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -261,9 +261,11 @@ pub struct VerifiableSecretSharingCommitment<C: Ciphersuite>(
#[derive(Clone, Zeroize)]
pub struct SecretShare<C: Ciphersuite> {
/// The participant identifier of this [`SecretShare`].
#[zeroize(skip)]
pub identifier: Identifier<C>,
/// Secret Key.
pub value: SigningShare<C>,
#[zeroize(skip)]
/// The commitments to be distributed among signers.
pub commitment: VerifiableSecretSharingCommitment<C>,
}

View File

@ -13,7 +13,7 @@ use crate::{frost, Ciphersuite, Element, Error, Field, Group, Scalar};
use super::{keys::SigningShare, Identifier};
/// A scalar that is a signing nonce.
#[derive(Clone, PartialEq, Eq, Zeroize)]
#[derive(Clone, PartialEq, Eq)]
pub struct Nonce<C: Ciphersuite>(pub(super) Scalar<C>);
impl<C> Nonce<C>
@ -71,6 +71,15 @@ where
}
}
impl<C> Zeroize for Nonce<C>
where
C: Ciphersuite,
{
fn zeroize(&mut self) {
*self = Nonce(<<C::Group as Group>::Field>::zero());
}
}
// impl<C> Drop for Nonce<C>
// where
// C: Ciphersuite,