[][src]Struct tari_crypto::musig::JointKey

pub struct JointKey<P, K> where
    K: SecretKey,
    P: PublicKey<K = K>, 
{ /* fields omitted */ }

The JointKey is a modified public key used in Signature aggregation schemes like MuSig which is not susceptible to Rogue Key attacks.

A joint key is calculated from n participants by having each of them calculate: $$ L = H(P_1 || P_2 || \dots || P_n) X = \sum H(L || P_i)P_i X_i = k_i H(L || P_i).G $$ Concrete implementations of JointKey will also need to implement the MultiScalarMul trait, which allows them to provide implementation-specific optimisations for dot-product operations.

Implementations

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

pub fn index_of(&self, pubkey: &P) -> Result<usize, MuSigError>[src]

Return the index of the given key in the joint key participants list. If the key isn't in the list, returns Err(ParticipantNotFound)

pub fn size(&self) -> usize[src]

pub fn get_pub_keys(&self, index: usize) -> &P[src]

pub fn get_musig_scalar(&self, index: usize) -> &K[src]

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

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

Auto Trait Implementations

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

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

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

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

impl<P, K> UnwindSafe for JointKey<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> From<T> for T[src]

impl<T> FromBits<T> for T

impl<T> FromCast<T> for T

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> Same<T> for T

type Output = T

Should always be Self

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