modules: Port bitcoin-core/secp256k1#1825 to zkp-specific code

This commit is contained in:
mllwchrry
2026-03-03 15:42:49 +02:00
parent 126501f58b
commit 48cbd78dfc
5 changed files with 35 additions and 77 deletions

View File

@@ -14,17 +14,11 @@
* SHA256 to SHA256("Bulletproofs_pp/v0/commitment")||SHA256("Bulletproofs_pp/v0/commitment").
*/
static void secp256k1_bppp_sha256_tagged_commitment_init(secp256k1_sha256 *sha) {
secp256k1_sha256_initialize(sha);
sha->s[0] = 0x52fc8185ul;
sha->s[1] = 0x0e7debf0ul;
sha->s[2] = 0xb0967270ul;
sha->s[3] = 0x6f5abfe1ul;
sha->s[4] = 0x822bdec0ul;
sha->s[5] = 0x36db8beful;
sha->s[6] = 0x03d9e1f1ul;
sha->s[7] = 0x8a5cef6ful;
sha->bytes = 64;
static const uint32_t midstate[8] = {
0x52fc8185ul, 0x0e7debf0ul, 0xb0967270ul, 0x6f5abfe1ul,
0x822bdec0ul, 0x36db8beful, 0x03d9e1f1ul, 0x8a5cef6ful
};
secp256k1_sha256_initialize_midstate(sha, 64, midstate);
}
/* Obtain a challenge scalar from the current transcript.*/