diff --git a/frost-core/src/keys.rs b/frost-core/src/keys.rs index ffcbc11..542d5c0 100644 --- a/frost-core/src/keys.rs +++ b/frost-core/src/keys.rs @@ -297,6 +297,12 @@ impl CoefficientCommitment where C: Ciphersuite, { + /// Create a new CoefficientCommitment. + #[cfg_attr(feature = "internals", visibility::make(pub))] + pub(crate) fn new(value: Element) -> Self { + Self(value) + } + /// returns serialized element pub fn serialize(&self) -> ::Serialization { ::serialize(&self.0) @@ -306,7 +312,7 @@ where pub fn deserialize( coefficient: ::Serialization, ) -> Result, Error> { - Ok(Self(::deserialize(&coefficient)?)) + Ok(Self::new(::deserialize(&coefficient)?)) } /// Returns inner element value @@ -371,6 +377,12 @@ impl VerifiableSecretSharingCommitment where C: Ciphersuite, { + /// Create a new VerifiableSecretSharingCommitment. + #[cfg_attr(feature = "internals", visibility::make(pub))] + pub(crate) fn new(coefficients: Vec>) -> Self { + Self(coefficients) + } + /// Returns serialized coefficent commitments pub fn serialize(&self) -> Vec<::Serialization> { self.0 @@ -388,7 +400,7 @@ where coefficient_commitments.push(CoefficientCommitment::::deserialize(cc)?); } - Ok(Self(coefficient_commitments)) + Ok(Self::new(coefficient_commitments)) } /// Get the VerifyingKey matching this commitment vector (which is the first