Skip to content
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

merge queue: embarking main (4406e01) and #580 together #583

Closed
wants to merge 2 commits into from
Closed
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
16 changes: 14 additions & 2 deletions frost-core/src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ impl<C> CoefficientCommitment<C>
where
C: Ciphersuite,
{
/// Create a new CoefficientCommitment.
#[cfg_attr(feature = "internals", visibility::make(pub))]
pub(crate) fn new(value: Element<C>) -> Self {
Self(value)
}

/// returns serialized element
pub fn serialize(&self) -> <C::Group as Group>::Serialization {
<C::Group>::serialize(&self.0)
Expand All @@ -306,7 +312,7 @@ where
pub fn deserialize(
coefficient: <C::Group as Group>::Serialization,
) -> Result<CoefficientCommitment<C>, Error<C>> {
Ok(Self(<C::Group as Group>::deserialize(&coefficient)?))
Ok(Self::new(<C::Group as Group>::deserialize(&coefficient)?))
}

/// Returns inner element value
Expand Down Expand Up @@ -371,6 +377,12 @@ impl<C> VerifiableSecretSharingCommitment<C>
where
C: Ciphersuite,
{
/// Create a new VerifiableSecretSharingCommitment.
#[cfg_attr(feature = "internals", visibility::make(pub))]
pub(crate) fn new(coefficients: Vec<CoefficientCommitment<C>>) -> Self {
Self(coefficients)
}

/// Returns serialized coefficent commitments
pub fn serialize(&self) -> Vec<<C::Group as Group>::Serialization> {
self.0
Expand All @@ -388,7 +400,7 @@ where
coefficient_commitments.push(CoefficientCommitment::<C>::deserialize(cc)?);
}

Ok(Self(coefficient_commitments))
Ok(Self::new(coefficient_commitments))
}

/// Get the VerifyingKey matching this commitment vector (which is the first
Expand Down
Loading