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

Function check_signed_hash

bitcoin/signature.c:174–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 5

check_tx_sigFunction · 0.85
check_announce_sigsFunction · 0.85
check_signed_hash_nodeidFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected