mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
crypto: add NUMS_H const
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <secp256k1_schnorrsig.h>
|
||||
#include <span.h>
|
||||
#include <uint256.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@@ -181,6 +182,17 @@ int ecdsa_signature_parse_der_lax(secp256k1_ecdsa_signature* sig, const unsigned
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** Nothing Up My Sleeve (NUMS) point
|
||||
*
|
||||
* NUMS_H is a point with an unknown discrete logarithm, constructed by taking the sha256 of 'g'
|
||||
* (uncompressed encoding), which happens to be a point on the curve.
|
||||
*
|
||||
* For an example script for calculating H, refer to the unit tests in
|
||||
* ./test/functional/test_framework/crypto/secp256k1.py
|
||||
*/
|
||||
static const std::vector<unsigned char> NUMS_H_DATA{ParseHex("50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0")};
|
||||
const XOnlyPubKey XOnlyPubKey::NUMS_H{NUMS_H_DATA};
|
||||
|
||||
XOnlyPubKey::XOnlyPubKey(Span<const unsigned char> bytes)
|
||||
{
|
||||
assert(bytes.size() == 32);
|
||||
|
Reference in New Issue
Block a user