Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions silentpayments/src/receive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,26 @@
derivation_order: u32,
maybe_label_point: Option<&PublicKey>,
) -> ScriptBuf {
let p_k = get_silentpayment_pubkey(
spend_pk,
ecdh_shared_secret,
derivation_order,
maybe_label_point,
);

let (x_only_key, _) = p_k.x_only_public_key();

let assumed_tweaked_pk = TweakedPublicKey::dangerous_assume_tweaked(x_only_key);

ScriptBuf::new_p2tr_tweaked(assumed_tweaked_pk)

Check warning on line 227 in silentpayments/src/receive/mod.rs

View workflow job for this annotation

GitHub Actions / Incremental mutants test

Missed mutant

replace get_silentpayment_script_pubkey -> ScriptBuf with Default::default()
}

pub fn get_silentpayment_pubkey(
spend_pk: &PublicKey,
ecdh_shared_secret: &PublicKey,
derivation_order: u32,
maybe_label_point: Option<&PublicKey>,
) -> PublicKey {
let secp = Secp256k1::new();

let t_k = get_shared_secret(*ecdh_shared_secret, derivation_order);
Expand All @@ -231,11 +251,7 @@
P_k
};

let (x_only_key, _) = P_k.x_only_public_key();

let assumed_tweaked_pk = TweakedPublicKey::dangerous_assume_tweaked(x_only_key);

ScriptBuf::new_p2tr_tweaked(assumed_tweaked_pk)
P_k
}

pub fn compute_tweak_data(
Expand Down
Loading