pub trait Pubkey: Sized {
type This;
type ThisCompressed;
type Other;
// Required methods
fn msg_to_curve(msg: &[u8]) -> Self::Other;
fn from_fixed(data: Self::ThisCompressed) -> Result<Self, InvalidPoint>;
fn from_fixed_unchecked(
data: Self::ThisCompressed,
) -> Result<Self, InvalidPoint>;
fn from_variable(data: &[u8]) -> Result<Self, InvalidPoint>;
fn verify_step2(
&self,
signature: &[u8],
msg_on_curve: &Self::Other,
) -> Result<bool, VerificationError>;
// Provided method
fn verify(
&self,
round: u64,
previous_signature: &[u8],
signature: &[u8],
) -> Result<bool, VerificationError> { ... }
}
Required Associated Types§
Sourcetype ThisCompressed
type ThisCompressed
The type in which this point is expressed in binary data (either [u8; 48]
or [u8; 96]
)
Required Methods§
fn msg_to_curve(msg: &[u8]) -> Self::Other
fn from_fixed(data: Self::ThisCompressed) -> Result<Self, InvalidPoint>
fn from_fixed_unchecked( data: Self::ThisCompressed, ) -> Result<Self, InvalidPoint>
fn from_variable(data: &[u8]) -> Result<Self, InvalidPoint>
Sourcefn verify_step2(
&self,
signature: &[u8],
msg_on_curve: &Self::Other,
) -> Result<bool, VerificationError>
fn verify_step2( &self, signature: &[u8], msg_on_curve: &Self::Other, ) -> Result<bool, VerificationError>
This is part of verify
but you can call it explicitely in case you already
have a message hashed to the curve.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.