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
sourceimpl 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 market bit we could not do batch verification in systems that support precisely ed25519 and schnorrkel.
We cannot distinguish amongst different SigningTranscript
types using these markey 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>
Depricated construction of a Signature
from a slice of bytes
without checking the bit distinguishing from ed25519. Deprecated.
Trait Implementations
sourceimpl<'d> Deserialize<'d> for Signature
impl<'d> Deserialize<'d> for Signature
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'d>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'d>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Signature
impl Eq for Signature
impl StructuralEq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more