Trait EcSig

Source
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 Constants§

Required Associated Types§

Required Methods§

Source

fn to_sig_compressed(&self) -> Self::Compressed

Source

fn from_sig_compressed(sig: Self::Compressed) -> Result<Self, EcSigInvalid>

Source

fn from_sig_compressed_slice(slice: &[u8]) -> Result<Self, EcSigInvalid>

Source

fn verify( &self, pk: &Self::Pk, msg: impl AsRef<[u8]>, ) -> Result<(), EcVerifyError>

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.

Implementations on Foreign Types§

Source§

impl EcSig for Signature

Available on crate feature ed25519 only.

Implementors§

Source§

impl EcSig for cypher::ed25519::Signature

Available on crate feature ed25519 only.