projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Expose `parse_onion_address` publicly in `no-std`
[rust-lightning]
/
lightning
/
src
/
offers
/
merkle.rs
diff --git
a/lightning/src/offers/merkle.rs
b/lightning/src/offers/merkle.rs
index b3867bf6f65a0d55d2b6969e32172f0919618249..7390b58fef8ef780a68f58aa50438dcbe1979d71 100644
(file)
--- a/
lightning/src/offers/merkle.rs
+++ b/
lightning/src/offers/merkle.rs
@@
-88,17
+88,15
@@
where
Ok(signature)
}
Ok(signature)
}
-/// Verifies the signature with a pubkey over the given
bytes
using a tagged hash as the message
+/// Verifies the signature with a pubkey over the given
message
using a tagged hash as the message
/// digest.
/// digest.
-///
-/// Panics if `bytes` is not a well-formed TLV stream containing at least one TLV record.
pub(super) fn verify_signature(
pub(super) fn verify_signature(
- signature: &Signature,
tag: &str, bytes: &[u8]
, pubkey: PublicKey,
+ signature: &Signature,
message: TaggedHash
, pubkey: PublicKey,
) -> Result<(), secp256k1::Error> {
) -> Result<(), secp256k1::Error> {
- let digest = message
_digest(tag, bytes
);
+ let digest = message
.as_digest(
);
let pubkey = pubkey.into();
let secp_ctx = Secp256k1::verification_only();
let pubkey = pubkey.into();
let secp_ctx = Secp256k1::verification_only();
- secp_ctx.verify_schnorr(signature,
&
digest, &pubkey)
+ secp_ctx.verify_schnorr(signature, digest, &pubkey)
}
pub(super) fn message_digest(tag: &str, bytes: &[u8]) -> Message {
}
pub(super) fn message_digest(tag: &str, bytes: &[u8]) -> Message {