Skip to content

Commit e9e064f

Browse files
committed
f: Use public method for HMAC creation and verification
1 parent 9513673 commit e9e064f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ use crate::offers::nonce::Nonce;
7070
use crate::offers::offer::{Offer, OfferBuilder};
7171
use crate::offers::parse::Bolt12SemanticError;
7272
use crate::offers::refund::{Refund, RefundBuilder};
73-
use crate::offers::signer::{self, hmac_for_payment_hash};
73+
use crate::offers::signer;
7474
use crate::onion_message::async_payments::{AsyncPaymentsMessage, HeldHtlcAvailable, ReleaseHeldHtlc, AsyncPaymentsMessageHandler};
7575
use crate::onion_message::messenger::{Destination, MessageRouter, Responder, ResponseInstruction, MessageSendInstructions};
7676
use crate::onion_message::offers::{OffersMessage, OffersMessageHandler};
@@ -9227,7 +9227,7 @@ where
92279227
let invoice = builder.allow_mpp().build_and_sign(secp_ctx)?;
92289228

92299229
let nonce = Nonce::from_entropy_source(entropy);
9230-
let hmac = hmac_for_payment_hash(invoice.payment_hash(), nonce, expanded_key);
9230+
let hmac = payment_hash.hmac_for_offer_payment(nonce, expanded_key);
92319231
let context = OffersContext::InboundPayment {
92329232
payment_hash: invoice.payment_hash(), nonce, hmac
92339233
};
@@ -10990,7 +10990,7 @@ where
1099010990
OffersMessage::InvoiceError(invoice_error) => {
1099110991
let payment_hash = match context {
1099210992
Some(OffersContext::InboundPayment { payment_hash, nonce, hmac }) => {
10993-
match signer::verify_payment_hash(payment_hash, hmac, nonce, expanded_key) {
10993+
match payment_hash.verify(hmac, nonce, expanded_key) {
1099410994
Ok(_) => Some(payment_hash),
1099510995
Err(_) => None,
1099610996
}

0 commit comments

Comments
 (0)