Trait cypher::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 Types§

Required Associated Constants§

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>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl EcSig for Signature

Available on crate feature ed25519 only.
source§

const COMPRESSED_LEN: usize = 64usize

§

type Pk = PublicKey

§

type Compressed = [u8; 64]

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>

Implementors§

source§

impl EcSig for cypher::ed25519::Signature

Available on crate feature ed25519 only.
source§

const COMPRESSED_LEN: usize = 64usize

§

type Pk = PublicKey

§

type Compressed = [u8; 64]