Struct schnorrkel::sign::Signature
source · pub struct Signature { /* private fields */ }
Expand description
A Ristretto Schnorr signature “detached” from the signed message.
These cannot be converted to any Ed25519 signature because they hash curve points in the Ristretto encoding.
Implementations§
source§impl Signature
impl Signature
sourcepub fn from_bytes(bytes: &[u8]) -> SignatureResult<Signature>
pub fn from_bytes(bytes: &[u8]) -> SignatureResult<Signature>
Construct a Signature
from a slice of bytes.
We distinguish schnorrkell signatures from ed25519 signatures by setting the high bit of byte 31. We return an error if this marker remains unset because otherwise schnorrkel signatures would be indistinguishable from ed25519 signatures. We cannot always distinguish between schnorrkel and ed25519 public keys either, so without this marker bit we could not do batch verification in systems that support precisely ed25519 and schnorrkel.
We cannot distinguish amongst different SigningTranscript
types using these marker bits, but protocol should not need
two different transcript types.
sourcepub fn from_bytes_not_distinguished_from_ed25519(
bytes: &[u8],
) -> SignatureResult<Signature>
pub fn from_bytes_not_distinguished_from_ed25519( bytes: &[u8], ) -> SignatureResult<Signature>
Deprecated construction of a Signature
from a slice of bytes
without checking the bit distinguishing from ed25519. Deprecated.
Trait Implementations§
source§impl PartialEq for Signature
impl PartialEq for Signature
impl Copy for Signature
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin 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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)