[−][src]Struct starsig::Signature
A Schnorr signature.
Fields
s: Scalar
Signature using nonce, message, and private key
R: CompressedRistretto
Nonce commitment
Methods
impl Signature
[src]
pub fn from_bytes(sig: impl AsRefExt) -> Result<Self, StarsigError>
[src]
Decodes a signature from a 64-byte slice.
pub fn to_bytes(&self) -> [u8; 64]
[src]
Encodes the signature as a 64-byte array.
impl Signature
[src]
pub fn sign(transcript: &mut Transcript, privkey: Scalar) -> Signature
[src]
Creates a signature for a single private key and single message
pub fn verify(
&self,
transcript: &mut Transcript,
pubkey: VerificationKey
) -> Result<(), StarsigError>
[src]
&self,
transcript: &mut Transcript,
pubkey: VerificationKey
) -> Result<(), StarsigError>
Verifies the signature over a transcript using the provided verification key.
Transcript should be in the same state as it was during the sign
call
that created the signature.
pub fn verify_batched(
&self,
transcript: &mut Transcript,
pubkey: VerificationKey,
batch: &mut impl BatchVerification
)
[src]
&self,
transcript: &mut Transcript,
pubkey: VerificationKey,
batch: &mut impl BatchVerification
)
Verifies the signature against a given verification key in a batch.
Transcript should be in the same state as it was during the sign
call
that created the signature.
impl Signature
[src]
pub fn sign_message(
label: &'static [u8],
message: &[u8],
privkey: Scalar
) -> Signature
[src]
label: &'static [u8],
message: &[u8],
privkey: Scalar
) -> Signature
Signs a message with a given domain-separation label.
This is a simpler byte-oriented API over more flexible Transcript-based API.
Internally it creates a Transcript instance labelled "Starsig.sign_message",
and appends to it message bytes labelled with a user-provided label
.
pub fn verify_message(
&self,
label: &'static [u8],
message: &[u8],
pubkey: VerificationKey
) -> Result<(), StarsigError>
[src]
&self,
label: &'static [u8],
message: &[u8],
pubkey: VerificationKey
) -> Result<(), StarsigError>
Verifies the signature over a message using the provided verification key.
Internally it creates a Transcript instance labelled "Starsig.sign_message",
and appends to it message bytes labelled with a user-provided label
.
pub fn verify_message_batched(
&self,
label: &'static [u8],
message: &[u8],
pubkey: VerificationKey,
batch: &mut impl BatchVerification
)
[src]
&self,
label: &'static [u8],
message: &[u8],
pubkey: VerificationKey,
batch: &mut impl BatchVerification
)
Verifies the signature over a message using the provided verification key.
Transcript should be in the same state as it was during the sign
call
that created the signature.
Trait Implementations
impl Clone for Signature
[src]
impl Debug for Signature
[src]
impl Serialize for Signature
[src]
impl<'de> Deserialize<'de> for Signature
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
impl RefUnwindSafe for Signature
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Same<T> for T
type Output = T
Should always be Self