Struct secp256k1_zkp::EcdsaAdaptorSignature[][src]

pub struct EcdsaAdaptorSignature(_);

Represents an adaptor signature and dleq proof.

Implementations

impl EcdsaAdaptorSignature[src]

pub fn from_slice(data: &[u8]) -> Result<EcdsaAdaptorSignature, Error>[src]

Creates an EcdsaAdaptorSignature directly from a slice

pub fn as_ptr(&self) -> *const EcdsaAdaptorSignature[src]

Obtains a raw const pointer suitable for use with FFI functions

pub fn as_mut_ptr(&mut self) -> *mut EcdsaAdaptorSignature[src]

Obtains a raw mutable pointer suitable for use with FFI functions

impl EcdsaAdaptorSignature[src]

pub fn encrypt<C: Signing>(
    secp: &Secp256k1<C>,
    msg: &Message,
    sk: &SecretKey,
    enckey: &PublicKey
) -> EcdsaAdaptorSignature
[src]

Creates an adaptor signature along with a proof to verify the adaptor signature. This function derives a nonce using a similar process as described in BIP-340. The nonce derivation process is strengthened against side channel attacks by providing auxiliary randomness using the ThreadRng random number generator. Requires compilation with “rand-std” feature.

pub fn encrypt_with_rng<C: Signing, R: Rng + CryptoRng>(
    secp: &Secp256k1<C>,
    msg: &Message,
    sk: &SecretKey,
    enckey: &PublicKey,
    rng: &mut R
) -> EcdsaAdaptorSignature
[src]

Creates an adaptor signature along with a proof to verify the adaptor signature, This function derives a nonce using a similar process as described in BIP-340. The nonce derivation process is strengthened against side channel attacks by providing auxiliary randomness using the provided random number generator. Requires compilation with “rand” feature.

pub fn encrypt_no_aux_rand<C: Signing>(
    secp: &Secp256k1<C>,
    msg: &Message,
    sk: &SecretKey,
    enckey: &PublicKey
) -> EcdsaAdaptorSignature
[src]

Creates an adaptor signature along with a proof to verify the adaptor signature, without using any auxiliary random data. Note that using this function is still considered safe.

pub fn encrypt_with_aux_rand<C: Signing>(
    secp: &Secp256k1<C>,
    msg: &Message,
    sk: &SecretKey,
    enckey: &PublicKey,
    aux_rand: &[u8; 32]
) -> EcdsaAdaptorSignature
[src]

Creates an adaptor signature along with a proof to verify the adaptor signature. This function derives a nonce using a similar process as described in BIP-340. The nonce derivation process is strengthened against side channel attacks by using the provided auxiliary random data.

pub fn decrypt(&self, decryption_key: &SecretKey) -> Result<Signature, Error>[src]

Creates an ECDSA signature from an adaptor signature and an adaptor secret.

pub fn recover<C: Signing>(
    &self,
    secp: &Secp256k1<C>,
    sig: &Signature,
    encryption_key: &PublicKey
) -> Result<SecretKey, Error>
[src]

Extracts the adaptor secret from the complete signature and the adaptor signature.

pub fn verify<C: Verification>(
    &self,
    secp: &Secp256k1<C>,
    msg: &Message,
    pubkey: &PublicKey,
    encryption_key: &PublicKey
) -> Result<(), Error>
[src]

Verifies that the adaptor secret can be extracted from the adaptor signature and the completed ECDSA signature.

Trait Implementations

impl CPtr for EcdsaAdaptorSignature[src]

impl Clone for EcdsaAdaptorSignature[src]

impl Copy for EcdsaAdaptorSignature[src]

impl Debug for EcdsaAdaptorSignature[src]

impl Display for EcdsaAdaptorSignature[src]

impl Eq for EcdsaAdaptorSignature[src]

impl FromStr for EcdsaAdaptorSignature[src]

type Err = Error

The associated error which can be returned from parsing.

impl LowerHex for EcdsaAdaptorSignature[src]

impl PartialEq<EcdsaAdaptorSignature> for EcdsaAdaptorSignature[src]

impl StructuralEq for EcdsaAdaptorSignature[src]

impl StructuralPartialEq for EcdsaAdaptorSignature[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> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.