pub struct EcdsaAdaptorSignature(/* private fields */);Expand description
Represents an adaptor signature and dleq proof.
Implementations§
Source§impl EcdsaAdaptorSignature
impl EcdsaAdaptorSignature
Sourcepub fn from_slice(data: &[u8]) -> Result<EcdsaAdaptorSignature, Error>
pub fn from_slice(data: &[u8]) -> Result<EcdsaAdaptorSignature, Error>
Creates an EcdsaAdaptorSignature directly from a slice
Sourcepub fn as_ptr(&self) -> *const EcdsaAdaptorSignature
pub fn as_ptr(&self) -> *const EcdsaAdaptorSignature
Obtains a raw const pointer suitable for use with FFI functions
Sourcepub fn as_mut_ptr(&mut self) -> *mut EcdsaAdaptorSignature
pub fn as_mut_ptr(&mut self) -> *mut EcdsaAdaptorSignature
Obtains a raw mutable pointer suitable for use with FFI functions
Source§impl EcdsaAdaptorSignature
impl EcdsaAdaptorSignature
Sourcepub fn encrypt<C: Signing>(
secp: &Secp256k1<C>,
msg: &Message,
sk: &SecretKey,
enckey: &PublicKey,
) -> EcdsaAdaptorSignature
Available on crate feature rand-std only.
pub fn encrypt<C: Signing>( secp: &Secp256k1<C>, msg: &Message, sk: &SecretKey, enckey: &PublicKey, ) -> EcdsaAdaptorSignature
rand-std only.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.
Sourcepub fn encrypt_with_rng<C: Signing, R: Rng + CryptoRng>(
secp: &Secp256k1<C>,
msg: &Message,
sk: &SecretKey,
enckey: &PublicKey,
rng: &mut R,
) -> EcdsaAdaptorSignature
Available on crate feature actual-rand only.
pub fn encrypt_with_rng<C: Signing, R: Rng + CryptoRng>( secp: &Secp256k1<C>, msg: &Message, sk: &SecretKey, enckey: &PublicKey, rng: &mut R, ) -> EcdsaAdaptorSignature
actual-rand only.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.
Sourcepub fn encrypt_no_aux_rand<C: Signing>(
secp: &Secp256k1<C>,
msg: &Message,
sk: &SecretKey,
enckey: &PublicKey,
) -> EcdsaAdaptorSignature
pub fn encrypt_no_aux_rand<C: Signing>( secp: &Secp256k1<C>, msg: &Message, sk: &SecretKey, enckey: &PublicKey, ) -> EcdsaAdaptorSignature
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.
Sourcepub fn encrypt_with_aux_rand<C: Signing>(
secp: &Secp256k1<C>,
msg: &Message,
sk: &SecretKey,
enckey: &PublicKey,
aux_rand: &[u8; 32],
) -> EcdsaAdaptorSignature
pub fn encrypt_with_aux_rand<C: Signing>( secp: &Secp256k1<C>, msg: &Message, sk: &SecretKey, enckey: &PublicKey, aux_rand: &[u8; 32], ) -> EcdsaAdaptorSignature
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.
Sourcepub fn decrypt(&self, decryption_key: &SecretKey) -> Result<Signature, Error>
pub fn decrypt(&self, decryption_key: &SecretKey) -> Result<Signature, Error>
Creates an ECDSA signature from an adaptor signature and an adaptor secret.
Trait Implementations§
Source§impl AsRef<[u8]> for EcdsaAdaptorSignature
impl AsRef<[u8]> for EcdsaAdaptorSignature
Source§impl CPtr for EcdsaAdaptorSignature
impl CPtr for EcdsaAdaptorSignature
Source§impl Clone for EcdsaAdaptorSignature
impl Clone for EcdsaAdaptorSignature
Source§fn clone(&self) -> EcdsaAdaptorSignature
fn clone(&self) -> EcdsaAdaptorSignature
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EcdsaAdaptorSignature
impl Debug for EcdsaAdaptorSignature
Source§impl<'de> Deserialize<'de> for EcdsaAdaptorSignature
Available on crate feature serde only.
impl<'de> Deserialize<'de> for EcdsaAdaptorSignature
serde only.Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl Display for EcdsaAdaptorSignature
impl Display for EcdsaAdaptorSignature
Source§impl FromStr for EcdsaAdaptorSignature
impl FromStr for EcdsaAdaptorSignature
Source§impl LowerHex for EcdsaAdaptorSignature
impl LowerHex for EcdsaAdaptorSignature
Source§impl PartialEq for EcdsaAdaptorSignature
impl PartialEq for EcdsaAdaptorSignature
Source§impl Serialize for EcdsaAdaptorSignature
Available on crate feature serde only.
impl Serialize for EcdsaAdaptorSignature
serde only.