pub struct BluePallas<M>(pub(crate) PhantomData<M>);Expand description
The BluePallas ciphersuite, which uses the Pallas curve and Poseidon hash function.
Note that this ciphersuite is used for FROST signatures in the Mina protocol and has a lot of Mina-specific logic This library SHOULD not be treated as a general-purpose BluePallas ciphersuite, but rather as a Mina-specific implementation.
Tuple Fields§
§0: PhantomData<M>Trait Implementations§
Source§impl<M> Ciphersuite for BluePallas<M>where
M: ChallengeMessage,
impl<M> Ciphersuite for BluePallas<M>where
M: ChallengeMessage,
Source§fn pre_commitment_aggregate<'a>(
signing_package: &'a SigningPackage<Self>,
binding_factor_list: &'a BindingFactorList<Self>,
) -> Result<Cow<'a, SigningPackage<Self>>, Error<Self>>
fn pre_commitment_aggregate<'a>( signing_package: &'a SigningPackage<Self>, binding_factor_list: &'a BindingFactorList<Self>, ) -> Result<Cow<'a, SigningPackage<Self>>, Error<Self>>
This performs the same functionality as Self::pre_commitment_sign, but instead only
negates commitments because the coordinator is not able to receive any nonces.
Naturally, this is called by the coordinator in the crate::aggregate function.
Source§fn pre_commitment_sign<'a>(
signing_package: &'a SigningPackage<Self>,
signing_nonces: &'a SigningNonces<Self>,
binding_factor_list: &'a BindingFactorList<Self>,
) -> Result<(Cow<'a, SigningPackage<Self>>, Cow<'a, SigningNonces<Self>>), Error<Self>>
fn pre_commitment_sign<'a>( signing_package: &'a SigningPackage<Self>, signing_nonces: &'a SigningNonces<Self>, binding_factor_list: &'a BindingFactorList<Self>, ) -> Result<(Cow<'a, SigningPackage<Self>>, Cow<'a, SigningNonces<Self>>), Error<Self>>
This functions computes the group commitment and checks whether the y-coordinate of the
group commitment is even, as required by the Mina protocol.
If the group commitment is not even, it negates the nonces and commitments
This will be called by each individual signer during round2::sign
Source§const ID: &'static str = CONTEXT_STRING
const ID: &'static str = CONTEXT_STRING
Source§type Group = PallasGroup
type Group = PallasGroup
Source§type HashOutput = [u8; 32]
type HashOutput = [u8; 32]
Source§type SignatureSerialization = [u8; 32]
type SignatureSerialization = [u8; 32]
Group::ElementSerialization +
Group::ScalarSerializationSource§fn HDKG(m: &[u8]) -> Option<<<Self::Group as Group>::Field as Field>::Scalar>
fn HDKG(m: &[u8]) -> Option<<<Self::Group as Group>::Field as Field>::Scalar>
Source§fn HID(m: &[u8]) -> Option<<<Self::Group as Group>::Field as Field>::Scalar>
fn HID(m: &[u8]) -> Option<<<Self::Group as Group>::Field as Field>::Scalar>
Source§fn challenge(
r: &Element<Self>,
verifying_key: &VerifyingKey<Self>,
message: &[u8],
) -> Result<Challenge<Self>, Error<Self>>
fn challenge( r: &Element<Self>, verifying_key: &VerifyingKey<Self>, message: &[u8], ) -> Result<Challenge<Self>, Error<Self>>
round2::sign()] and [crate::aggregate()].§fn single_sign<R>(
signing_key: &SigningKey<Self>,
rng: R,
message: &[u8],
) -> Signature<Self>
fn single_sign<R>( signing_key: &SigningKey<Self>, rng: R, message: &[u8], ) -> Signature<Self>
SigningKey]. Called
by [SigningKey::sign()]. This is not used by FROST. Can be overridden
if required which is useful if FROST signing has been changed by the
other Ciphersuite trait methods and regular signing should be changed
accordingly to match.§fn verify_signature(
message: &[u8],
signature: &Signature<Self>,
public_key: &VerifyingKey<Self>,
) -> Result<(), Error<Self>>
fn verify_signature( message: &[u8], signature: &Signature<Self>, public_key: &VerifyingKey<Self>, ) -> Result<(), Error<Self>>
VerifyingKey::verify()]. The default implementation uses the
“cofactored” equation (it multiplies by the cofactor returned by
Group::cofactor()). Read more§fn pre_sign<'a>(
signing_package: &'a SigningPackage<Self>,
signer_nonces: &'a SigningNonces<Self>,
key_package: &'a KeyPackage<Self>,
) -> Result<(Cow<'a, SigningPackage<Self>>, Cow<'a, SigningNonces<Self>>, Cow<'a, KeyPackage<Self>>), Error<Self>>
fn pre_sign<'a>( signing_package: &'a SigningPackage<Self>, signer_nonces: &'a SigningNonces<Self>, key_package: &'a KeyPackage<Self>, ) -> Result<(Cow<'a, SigningPackage<Self>>, Cow<'a, SigningNonces<Self>>, Cow<'a, KeyPackage<Self>>), Error<Self>>
round2::sign()] inputs. The default
implementation returns them as-is. Cow is used so implementations
can choose to return the same passed reference or a modified clone.§fn pre_aggregate<'a>(
signing_package: &'a SigningPackage<Self>,
signature_shares: &'a BTreeMap<Identifier<Self>, SignatureShare<Self>>,
public_key_package: &'a PublicKeyPackage<Self>,
) -> Result<(Cow<'a, SigningPackage<Self>>, Cow<'a, BTreeMap<Identifier<Self>, SignatureShare<Self>>>, Cow<'a, PublicKeyPackage<Self>>), Error<Self>>
fn pre_aggregate<'a>( signing_package: &'a SigningPackage<Self>, signature_shares: &'a BTreeMap<Identifier<Self>, SignatureShare<Self>>, public_key_package: &'a PublicKeyPackage<Self>, ) -> Result<(Cow<'a, SigningPackage<Self>>, Cow<'a, BTreeMap<Identifier<Self>, SignatureShare<Self>>>, Cow<'a, PublicKeyPackage<Self>>), Error<Self>>
crate::aggregate()] and
[crate::verify_signature_share()] inputs. In the latter case, “dummy”
container BTreeMap and PublicKeyPackage are passed with the relevant
values (PublicKeyPackage.min_signers will be None). The default
implementation returns them as-is. Cow is used so implementations
can choose to return the same passed reference or a modified clone.§fn pre_verify<'a>(
msg: &'a [u8],
signature: &'a Signature<Self>,
public_key: &'a VerifyingKey<Self>,
) -> Result<(Cow<'a, [u8]>, Cow<'a, Signature<Self>>, Cow<'a, VerifyingKey<Self>>), Error<Self>>
fn pre_verify<'a>( msg: &'a [u8], signature: &'a Signature<Self>, public_key: &'a VerifyingKey<Self>, ) -> Result<(Cow<'a, [u8]>, Cow<'a, Signature<Self>>, Cow<'a, VerifyingKey<Self>>), Error<Self>>
VerifyingKey::verify()] inputs. The default
implementation returns them as-is. Cow is used so implementations
can choose to return the same passed reference or a modified clone.§fn generate_nonce<R>(
rng: &mut R,
) -> (<<Self::Group as Group>::Field as Field>::Scalar, <Self::Group as Group>::Element)
fn generate_nonce<R>( rng: &mut R, ) -> (<<Self::Group as Group>::Field as Field>::Scalar, <Self::Group as Group>::Element)
SigningKey] for regular (non-FROST) signing and internally by the DKG
to generate proof-of-knowledge signatures.round2::sign()].crate::aggregate()] if
cheater detection is enabled.§fn serialize_signature(
signature: &Signature<Self>,
) -> Result<Vec<u8>, Error<Self>>
fn serialize_signature( signature: &Signature<Self>, ) -> Result<Vec<u8>, Error<Self>>
Ciphersuite::SignatureSerialization in bytes. Read more§fn deserialize_signature(bytes: &[u8]) -> Result<Signature<Self>, Error<Self>>
fn deserialize_signature(bytes: &[u8]) -> Result<Signature<Self>, Error<Self>>
§fn post_dkg(
key_package: KeyPackage<Self>,
public_key_package: PublicKeyPackage<Self>,
) -> Result<(KeyPackage<Self>, PublicKeyPackage<Self>), Error<Self>>
fn post_dkg( key_package: KeyPackage<Self>, public_key_package: PublicKeyPackage<Self>, ) -> Result<(KeyPackage<Self>, PublicKeyPackage<Self>), Error<Self>>
§fn post_generate(
secret_shares: BTreeMap<Identifier<Self>, SecretShare<Self>>,
public_key_package: PublicKeyPackage<Self>,
) -> Result<(BTreeMap<Identifier<Self>, SecretShare<Self>>, PublicKeyPackage<Self>), Error<Self>>
fn post_generate( secret_shares: BTreeMap<Identifier<Self>, SecretShare<Self>>, public_key_package: PublicKeyPackage<Self>, ) -> Result<(BTreeMap<Identifier<Self>, SecretShare<Self>>, PublicKeyPackage<Self>), Error<Self>>
Source§impl<M> Clone for BluePallas<M>
impl<M> Clone for BluePallas<M>
Source§impl<M: Debug> Debug for BluePallas<M>
impl<M: Debug> Debug for BluePallas<M>
Source§impl<M: PartialEq> PartialEq for BluePallas<M>
impl<M: PartialEq> PartialEq for BluePallas<M>
impl<M> Copy for BluePallas<M>
impl<M: Eq> Eq for BluePallas<M>
impl<M> StructuralPartialEq for BluePallas<M>
Auto Trait Implementations§
impl<M> Freeze for BluePallas<M>
impl<M> RefUnwindSafe for BluePallas<M>where
M: RefUnwindSafe,
impl<M> Send for BluePallas<M>where
M: Send,
impl<M> Sync for BluePallas<M>where
M: Sync,
impl<M> Unpin for BluePallas<M>where
M: Unpin,
impl<M> UnsafeUnpin for BluePallas<M>
impl<M> UnwindSafe for BluePallas<M>where
M: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.