pub trait EcSig: Clone + Eq + Sized + Send + AsRef<[u8]> + Debug + MultiDisplay<Encoding> {
type Pk: EcPk;
type Compressed: Copy + Sized + Send + AsRef<[u8]>;
const COMPRESSED_LEN: usize;
// Required methods
fn to_sig_compressed(&self) -> Self::Compressed;
fn from_sig_compressed(sig: Self::Compressed) -> Result<Self, EcSigInvalid>;
fn from_sig_compressed_slice(slice: &[u8]) -> Result<Self, EcSigInvalid>;
fn verify(
&self,
pk: &Self::Pk,
msg: impl AsRef<[u8]>
) -> Result<(), EcVerifyError>;
}
Expand description
Marker trait for elliptic-curve based signatures
Required Associated Types§
Required Associated Constants§
const COMPRESSED_LEN: usize
Required Methods§
fn to_sig_compressed(&self) -> Self::Compressed
fn from_sig_compressed(sig: Self::Compressed) -> Result<Self, EcSigInvalid>
fn from_sig_compressed_slice(slice: &[u8]) -> Result<Self, EcSigInvalid>
fn verify( &self, pk: &Self::Pk, msg: impl AsRef<[u8]> ) -> Result<(), EcVerifyError>
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl EcSig for Signature
Available on crate feature ed25519
only.
impl EcSig for Signature
Available on crate feature
ed25519
only.