Struct k256::schnorr::Signature

source ·
pub struct Signature { /* private fields */ }
Available on crate feature schnorr only.
Expand description

Taproot Schnorr signature as defined in BIP340.

Implementations§

source§

impl Signature

source

pub const BYTE_SIZE: usize = 64usize

Size of a Taproot Schnorr signature in bytes.

source

pub fn to_bytes(&self) -> SignatureBytes

Serialize this signature as bytes.

Trait Implementations§

source§

impl Clone for Signature

source§

fn clone(&self) -> Signature

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Signature

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<D> DigestSigner<D, Signature> for SigningKey
where D: Digest + FixedOutput<OutputSize = U32>,

source§

fn try_sign_digest(&self, digest: D) -> Result<Signature>

Attempt to sign the given prehashed message [Digest], returning a digital signature on success, or an error if something went wrong.
source§

fn sign_digest(&self, digest: D) -> S

Sign the given prehashed message [Digest], returning a signature. Read more
source§

impl<D> DigestVerifier<D, Signature> for VerifyingKey
where D: Digest + FixedOutput<OutputSize = U32>,

source§

fn verify_digest(&self, digest: D, signature: &Signature) -> Result<()>

Verify the signature against the given [Digest] output.
source§

impl From<&Signature> for SignatureBytes

source§

fn from(signature: &Signature) -> SignatureBytes

Converts to this type from the input type.
source§

impl From<Signature> for SignatureBytes

source§

fn from(signature: Signature) -> SignatureBytes

Converts to this type from the input type.
source§

impl PartialEq for Signature

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PrehashSignature for Signature

§

type Digest = CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, OidSha256>>

Preferred Digest algorithm to use when computing this signature type.
source§

impl PrehashSigner<Signature> for SigningKey

source§

fn sign_prehash(&self, prehash: &[u8]) -> Result<Signature>

Attempt to sign the given message digest, returning a digital signature on success, or an error if something went wrong. Read more
source§

impl PrehashVerifier<Signature> for VerifyingKey

source§

fn verify_prehash( &self, prehash: &[u8], signature: &Signature ) -> Result<(), Error>

Use Self to verify that the provided signature for a given message prehash is authentic. Read more
source§

impl<D> RandomizedDigestSigner<D, Signature> for SigningKey
where D: Digest + FixedOutput<OutputSize = U32>,

source§

fn try_sign_digest_with_rng( &self, rng: &mut impl CryptoRngCore, digest: D ) -> Result<Signature>

Attempt to sign the given prehashed message Digest, returning a digital signature on success, or an error if something went wrong.
source§

fn sign_digest_with_rng(&self, rng: &mut impl CryptoRngCore, digest: D) -> S

Sign the given prehashed message Digest, returning a signature. Read more
source§

impl RandomizedPrehashSigner<Signature> for SigningKey

source§

fn sign_prehash_with_rng( &self, rng: &mut impl CryptoRngCore, prehash: &[u8] ) -> Result<Signature>

Attempt to sign the given message digest, returning a digital signature on success, or an error if something went wrong. Read more
source§

impl RandomizedSigner<Signature> for SigningKey

source§

fn try_sign_with_rng( &self, rng: &mut impl CryptoRngCore, msg: &[u8] ) -> Result<Signature>

Attempt to sign the given message, returning a digital signature on success, or an error if something went wrong. Read more
source§

fn sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S

Sign the given message and return a digital signature
source§

impl SignatureEncoding for Signature

§

type Repr = [u8; 64]

Byte representation of a signature.
source§

fn to_bytes(&self) -> Self::Repr

Encode signature as its byte representation.
source§

fn to_vec(&self) -> Vec<u8>

Available on crate feature alloc only.
Encode signature as a byte vector.
source§

fn encoded_len(&self) -> usize

Get the length of this signature when encoded.
source§

impl Signer<Signature> for SigningKey

source§

fn try_sign(&self, msg: &[u8]) -> Result<Signature>

Attempt to sign the given message, returning a digital signature on success, or an error if something went wrong. Read more
source§

fn sign(&self, msg: &[u8]) -> S

Sign the given message and return a digital signature
source§

impl TryFrom<&[u8]> for Signature

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(bytes: &[u8]) -> Result<Signature>

Performs the conversion.
source§

impl Verifier<Signature> for VerifyingKey

source§

fn verify(&self, msg: &[u8], signature: &Signature) -> Result<()>

Use Self to verify that the provided signature for a given message bytestring is authentic. Read more
source§

impl Copy for Signature

source§

impl Eq for Signature

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.