Struct tari_crypto::signatures::SchnorrSignature[][src]

pub struct SchnorrSignature<P, K> { /* fields omitted */ }

Implementations

impl<P, K> SchnorrSignature<P, K> where
    P: PublicKey<K = K>,
    K: SecretKey
[src]

pub fn new(public_nonce: P, signature: K) -> Self[src]

pub fn calc_signature_verifier(&self) -> P[src]

pub fn sign(
    secret: K,
    nonce: K,
    challenge: &[u8]
) -> Result<Self, SchnorrSignatureError> where
    K: Add<Output = K> + Mul<P, Output = P> + Mul<Output = K>, 
[src]

pub fn verify_challenge<'a>(&self, public_key: &'a P, challenge: &[u8]) -> bool where
    &'b K: Mul<&'a P, Output = P>,
    &'b P: Add<P, Output = P>, 
[src]

pub fn verify<'a>(&self, public_key: &'a P, challenge: &K) -> bool where
    &'b K: Mul<&'a P, Output = P>,
    &'b P: Add<P, Output = P>, 
[src]

pub fn get_signature(&self) -> &K[src]

pub fn get_public_nonce(&self) -> &P[src]

Trait Implementations

impl<'a, 'b, P, K> Add<&'b SchnorrSignature<P, K>> for &'a SchnorrSignature<P, K> where
    P: PublicKey<K = K>,
    &'a P: Add<&'b P, Output = P>,
    K: SecretKey,
    &'a K: Add<&'b K, Output = K>, 
[src]

type Output = SchnorrSignature<P, K>

The resulting type after applying the + operator.

impl<'a, P, K> Add<SchnorrSignature<P, K>> for &'a SchnorrSignature<P, K> where
    P: PublicKey<K = K>,
    &'a P: Add<&'b P, Output = P>,
    K: SecretKey,
    &'a K: Add<&'b K, Output = K>, 
[src]

type Output = SchnorrSignature<P, K>

The resulting type after applying the + operator.

impl<P: Clone, K: Clone> Clone for SchnorrSignature<P, K>[src]

impl<P: Copy, K: Copy> Copy for SchnorrSignature<P, K>[src]

impl<P: Debug, K: Debug> Debug for SchnorrSignature<P, K>[src]

impl<P, K> Default for SchnorrSignature<P, K> where
    P: PublicKey<K = K>,
    K: SecretKey
[src]

impl<'de, P, K> Deserialize<'de> for SchnorrSignature<P, K> where
    P: Deserialize<'de>,
    K: Deserialize<'de>, 
[src]

impl<P: Eq, K: Eq> Eq for SchnorrSignature<P, K>[src]

impl From<SchnorrSignature<RistrettoPublicKey, RistrettoSecretKey>> for StackItem[src]

impl<P: Hash, K: Hash> Hash for SchnorrSignature<P, K>[src]

impl<P, K> Ord for SchnorrSignature<P, K> where
    P: Eq + Ord,
    K: Eq + ByteArray
[src]

Provide an efficient ordering algorithm for Schnorr signatures. It’s probably not a good idea to implement Ord for secret keys, but in this instance, the signature is publicly known and is simply a scalar, so we use the hex representation of the scalar as the canonical ordering metric. This conversion is done if and only if the public nonces are already equal, otherwise the public nonce ordering determines the SchnorrSignature order.

impl<P: PartialEq, K: PartialEq> PartialEq<SchnorrSignature<P, K>> for SchnorrSignature<P, K>[src]

impl<P, K> PartialOrd<SchnorrSignature<P, K>> for SchnorrSignature<P, K> where
    P: Eq + Ord,
    K: Eq + ByteArray
[src]

impl<P, K> Serialize for SchnorrSignature<P, K> where
    P: Serialize,
    K: Serialize
[src]

impl<P, K> StructuralEq for SchnorrSignature<P, K>[src]

impl<P, K> StructuralPartialEq for SchnorrSignature<P, K>[src]

Auto Trait Implementations

impl<P, K> RefUnwindSafe for SchnorrSignature<P, K> where
    K: RefUnwindSafe,
    P: RefUnwindSafe

impl<P, K> Send for SchnorrSignature<P, K> where
    K: Send,
    P: Send

impl<P, K> Sync for SchnorrSignature<P, K> where
    K: Sync,
    P: Sync

impl<P, K> Unpin for SchnorrSignature<P, K> where
    K: Unpin,
    P: Unpin

impl<P, K> UnwindSafe for SchnorrSignature<P, K> where
    K: UnwindSafe,
    P: UnwindSafe

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, U> Cast<U> for T where
    U: FromCast<T>, 

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized
[src]

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

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

impl<T> FromBits<T> for T

impl<T> FromCast<T> for T

impl<T> InitializableFromZeroed for T where
    T: Default
[src]

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

impl<T, U> IntoBits<U> for T where
    U: FromBits<T>, 

impl<T> MessageFormat for T where
    T: DeserializeOwned + Serialize
[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>,