[][src]Struct starsig::Signature

pub struct Signature {
    pub s: Scalar,
    pub R: CompressedRistretto,
}

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]

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]

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]

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]

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]

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]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self