MCPcopy Create free account
hub / github.com/ElementsProject/lightning / check_signed_hash

Function check_signed_hash

bitcoin/signature.c:182–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182bool check_signed_hash(const struct sha256_double *hash,
183 const secp256k1_ecdsa_signature *signature,
184 const struct pubkey *key)
185{
186 int ret;
187
188 /* BOLT #2:
189 *
190 * - if `signature` is incorrect OR non-compliant with
191 * LOW-S-standard rule
192 */
193 /* From the secp256k1_ecdsa_verify documentation: "To avoid
194 * accepting malleable signatures, only ECDSA signatures in
195 * lower-S form are accepted." */
196 ret = secp256k1_ecdsa_verify(secp256k1_ctx,
197 signature,
198 hash->sha.u.u8, &key->pubkey);
199 return ret == 1;
200}
201
202bool check_tx_sig(const struct bitcoin_tx *tx, size_t input_num,
203 const u8 *redeemscript,

Callers 4

check_signed_hash_nodeidFunction · 0.85
check_tx_sigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected