[][src]Struct nazgul::dlsag::DLSAG

pub struct DLSAG {
    pub challenge: Scalar,
    pub responses: Vec<Scalar>,
    pub ring: Vec<(RistrettoPoint, RistrettoPoint, Scalar)>,
    pub key_image: RistrettoPoint,
    pub b: bool,
}

Dual Linkable Spontaneous Anonymous Group Signature for Ad Hoc Groups

DLSAG: Non-Interactive Refund Transactions For Interoperable Payment Channels in Monero

This is a a novel linkable ring signature scheme that enables for the first time refund transactions natively in Monero

Read the paper on how to use it to implement payment channels.

Please read tests at the bottom of the source code for this module for examples on how to use it

Fields

challenge: Scalarresponses: Vec<Scalar>ring: Vec<(RistrettoPoint, RistrettoPoint, Scalar)>key_image: RistrettoPointb: bool

Trait Implementations

impl Clone for DLSAG[src]

impl KeyImageGen<(RistrettoPoint, Scalar, Scalar), RistrettoPoint> for DLSAG[src]

fn generate_key_image<Hash: Digest<OutputSize = U64> + Clone + Default>(
    k: (RistrettoPoint, Scalar, Scalar)
) -> RistrettoPoint
[src]

Some signature schemes require the key images to be signed as well. Use this method to generate them

impl KeyImageGen<(Scalar, RistrettoPoint, Scalar), RistrettoPoint> for DLSAG[src]

fn generate_key_image<Hash: Digest<OutputSize = U64> + Clone + Default>(
    k: (Scalar, RistrettoPoint, Scalar)
) -> RistrettoPoint
[src]

Some signature schemes require the key images to be signed as well. Use this method to generate them

This is for linking two signatures and checking if they are signed by the same person

impl Sign<(RistrettoPoint, Scalar, Scalar), Vec<(RistrettoPoint, RistrettoPoint, Scalar)>> for DLSAG[src]

fn sign<Hash: Digest<OutputSize = U64> + Clone + Default, CSPRNG: CryptoRng + RngCore + Default>(
    k: (RistrettoPoint, Scalar, Scalar),
    ring: Vec<(RistrettoPoint, RistrettoPoint, Scalar)>,
    secret_index: usize,
    message: &Vec<u8>
) -> DLSAG
[src]

To sign you need k your private key, and ring which is the public keys of everyone except you. You are signing the message

The private key k in this case is your private key, the public key of the other end of the channel and a random bitstring generated by hashing-to-scalar: the transaction ID, and output index.

The ring contains public key pairs from the blockchain together with their random bitstrings as mentioned above.

This implementation of sign(...) is for the user who has the private key for the right side of the channel

impl Sign<(Scalar, RistrettoPoint, Scalar), Vec<(RistrettoPoint, RistrettoPoint, Scalar)>> for DLSAG[src]

fn sign<Hash: Digest<OutputSize = U64> + Clone + Default, CSPRNG: CryptoRng + RngCore + Default>(
    k: (Scalar, RistrettoPoint, Scalar),
    ring: Vec<(RistrettoPoint, RistrettoPoint, Scalar)>,
    secret_index: usize,
    message: &Vec<u8>
) -> DLSAG
[src]

To sign you need k your private key, and ring which is the public keys of everyone except you. You are signing the message

The private key k in this case is your private key, the public key of the other end of the channel and a random bitstring generated by hashing-to-scalar: the transaction ID, and output index.

The ring contains public key pairs from the blockchain together with their random bitstrings as mentioned above.

This implementation of sign(...) is for the user who has the private key for the left side of the channel

impl Verify for DLSAG[src]

fn verify<Hash: Digest<OutputSize = U64> + Clone + Default>(
    signature: DLSAG,
    message: &Vec<u8>
) -> bool
[src]

To verify a signature you need the message too

Auto Trait Implementations

impl RefUnwindSafe for DLSAG

impl Send for DLSAG

impl Sync for DLSAG

impl Unpin for DLSAG

impl UnwindSafe for DLSAG

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