pub struct Signature { /* private fields */ }Expand description
Taproot Schnorr signature as defined in BIP340.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn to_bytes(&self) -> SignatureBytes
pub fn to_bytes(&self) -> SignatureBytes
Serialize this signature as bytes.
Sourcepub fn from_bytes(bytes: &SignatureBytes) -> Result<Self>
pub fn from_bytes(bytes: &SignatureBytes) -> Result<Self>
Sourcepub fn from_slice(bytes: &[u8]) -> Result<Self>
pub fn from_slice(bytes: &[u8]) -> Result<Self>
Parse a Taproot Schnorr from a byte slice.
§Errors
Returns Error if bytes is not 64-bytes (i.e. Signature::BYTE_SIZE) long or if it
otherwise failed to parse successfully.
Trait Implementations§
impl Copy for Signature
Source§impl<D> DigestSigner<D, Signature> for SigningKey
impl<D> DigestSigner<D, Signature> for SigningKey
Source§impl<D> DigestVerifier<D, Signature> for VerifyingKey
impl<D> DigestVerifier<D, Signature> for VerifyingKey
impl Eq for Signature
Source§impl From<&Signature> for SignatureBytes
impl From<&Signature> for SignatureBytes
Source§fn from(signature: &Signature) -> SignatureBytes
fn from(signature: &Signature) -> SignatureBytes
Converts to this type from the input type.
Source§impl From<Signature> for SignatureBytes
impl From<Signature> for SignatureBytes
Source§fn from(signature: Signature) -> SignatureBytes
fn from(signature: Signature) -> SignatureBytes
Converts to this type from the input type.
Source§impl MultipartSigner<Signature> for SigningKey
impl MultipartSigner<Signature> for SigningKey
Source§fn try_multipart_sign(&self, msg: &[&[u8]]) -> Result<Signature>
fn try_multipart_sign(&self, msg: &[&[u8]]) -> Result<Signature>
Equivalent of
Signer::try_sign() but the message is provided in non-contiguous byte
slices. Read moreSource§fn multipart_sign(&self, msg: &[&[u8]]) -> S
fn multipart_sign(&self, msg: &[&[u8]]) -> S
Equivalent of
Signer::sign() but the message is provided in non-contiguous byte slices.Source§impl MultipartVerifier<Signature> for VerifyingKey
impl MultipartVerifier<Signature> for VerifyingKey
Source§fn multipart_verify(&self, msg: &[&[u8]], signature: &Signature) -> Result<()>
fn multipart_verify(&self, msg: &[&[u8]], signature: &Signature) -> Result<()>
Equivalent of
Verifier::verify() but the message is provided in non-contiguous byte
slices. Read moreSource§impl PrehashSigner<Signature> for SigningKey
impl PrehashSigner<Signature> for SigningKey
Source§impl PrehashVerifier<Signature> for VerifyingKey
impl PrehashVerifier<Signature> for VerifyingKey
Source§impl<D> RandomizedDigestSigner<D, Signature> for SigningKey
impl<D> RandomizedDigestSigner<D, Signature> for SigningKey
Source§impl RandomizedMultipartSigner<Signature> for SigningKey
impl RandomizedMultipartSigner<Signature> for SigningKey
Source§fn try_multipart_sign_with_rng<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
msg: &[&[u8]],
) -> Result<Signature>
fn try_multipart_sign_with_rng<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, msg: &[&[u8]], ) -> Result<Signature>
Equivalent of
RandomizedSigner::try_sign_with_rng() but the message is provided in
non-contiguous byte slices. Read moreSource§fn multipart_sign_with_rng<R>(&self, rng: &mut R, msg: &[&[u8]]) -> S
fn multipart_sign_with_rng<R>(&self, rng: &mut R, msg: &[&[u8]]) -> S
Equivalent of
RandomizedSigner::sign_with_rng() but the message is provided in
non-contiguous byte slices.Source§impl RandomizedPrehashSigner<Signature> for SigningKey
impl RandomizedPrehashSigner<Signature> for SigningKey
Source§fn sign_prehash_with_rng<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
prehash: &[u8],
) -> Result<Signature>
fn sign_prehash_with_rng<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, 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
impl RandomizedSigner<Signature> for SigningKey
Source§fn try_sign_with_rng<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
msg: &[u8],
) -> Result<Signature>
fn try_sign_with_rng<R: TryCryptoRng + ?Sized>( &self, rng: &mut R, 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§impl SignatureEncoding for Signature
impl SignatureEncoding for Signature
Source§impl Signer<Signature> for SigningKey
impl Signer<Signature> for SigningKey
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnsafeUnpin for Signature
impl UnwindSafe for Signature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more