pub trait VerifyingKey: Sized {
// Required methods
fn decode(src: &[u8]) -> Option<Self>;
fn verify(
&self,
sig: &[u8],
ctx: &DomainContext<'_>,
id: &HashIdentifier<'_>,
hv: &[u8],
) -> bool;
}
Expand description
Verifying key handler.
Required Methods§
Sourcefn decode(src: &[u8]) -> Option<Self>
fn decode(src: &[u8]) -> Option<Self>
Create the instance by decoding the verifying key from its storage format.
If the source uses a degree not supported by this VerifyingKey
type, or does not have the exact length expected for the degree
it uses, or is otherwise invalidly encoded, then this function
returns None
; otherwise, it returns the new instance.
Sourcefn verify(
&self,
sig: &[u8],
ctx: &DomainContext<'_>,
id: &HashIdentifier<'_>,
hv: &[u8],
) -> bool
fn verify( &self, sig: &[u8], ctx: &DomainContext<'_>, id: &HashIdentifier<'_>, hv: &[u8], ) -> bool
Verify a signature.
Parameters:
sig
: the signature valuectx
: the domain separation contextid
: the identifier for the pre-hash functionhv
: the pre-hashed message (or the message itself, ifid
isHASH_ID_RAW
)
Return value is true
if the signature is valid, false
otherwise.
Signature decoding errors and degree mismatch with the verifying key
also lead to false
being returned.
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.