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 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.