[][src]Struct ps_sig::signature::Signature

pub struct Signature {
    pub sigma_1: SignatureGroup,
    pub sigma_2: SignatureGroup,
}

Created by the signer when no blinded messages. Also the receiver of a blind signature can get this by unblinding the blind signature.

Fields

sigma_1: SignatureGroupsigma_2: SignatureGroup

Methods

impl Signature[src]

pub fn new(
    messages: &[FieldElement],
    sigkey: &Sigkey,
    params: &Params
) -> Result<Self, PSError>
[src]

Create a new signature. The signature generation involves generating a random value for sigma_1 so different calls to this method with same messages, signing key and params will give different value

pub fn new_deterministic(
    messages: &[FieldElement],
    sigkey: &Sigkey
) -> Result<Self, PSError>
[src]

Create a new signature. The signature generation doesn't involve generating a random value but the messages are hashed to get a pseudorandom value for sigma_1. Hence different calls to this method with same messages and signing key will give same value

pub fn sign_with_sigma_1_generated_from_given_exp(
    messages: &[FieldElement],
    sigkey: &Sigkey,
    u: &FieldElement,
    offset: usize,
    g: &SignatureGroup
) -> Result<(SignatureGroup, SignatureGroup), PSError>
[src]

Generate signature when first element of signature tuple is generated using given exponent Does only 1 scalar multiplication

pub fn sign_with_given_sigma_1(
    messages: &[FieldElement],
    sigkey: &Sigkey,
    offset: usize,
    h: &SignatureGroup
) -> Result<SignatureGroup, PSError>
[src]

Generate signature when first element of signature tuple is given

pub fn verify(
    &self,
    messages: Vec<FieldElement>,
    vk: &Verkey,
    params: &Params
) -> Result<bool, PSError>
[src]

Verify a signature. Can verify unblinded sig received from a signer and the aggregate sig as well.

pub fn to_bytes(&self) -> Vec<u8>[src]

Byte representation of the signature

pub fn check_verkey_and_messages_compat(
    messages: &[FieldElement],
    verkey: &Verkey
) -> Result<(), PSError>
[src]

pub fn check_sigkey_and_messages_compat(
    messages: &[FieldElement],
    sigkey: &Sigkey
) -> Result<(), PSError>
[src]

pub fn is_identity(&self) -> bool[src]

Checks if a signature has identity elements. A valid signature should not have identity elements.

Trait Implementations

impl Clone for Signature[src]

impl Debug for Signature[src]

impl<'de> Deserialize<'de> for Signature[src]

impl Serialize for Signature[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,