schnorrsig: Add test vectors for variable-length messages #1133
pull real-or-random wants to merge 3 commits into bitcoin-core:master from real-or-random:202208-schnorrsig-varlen-vectors changing 2 files +181 −28-
real-or-random commented at 3:16 PM on August 11, 2022: contributor
- real-or-random force-pushed on Aug 22, 2022
-
real-or-random commented at 5:13 PM on August 22, 2022: contributor
Updated after one vector was removed from my draft at https://github.com/sipa/bips/pull/221.
I think this is ready for reviewm/merge, independently of whether https://github.com/sipa/bips/pull/221 has been merged or merged in the official BIPs repo.
-
in include/secp256k1_schnorrsig.h:144 in 67dd87eb55 outdated
140 | @@ -141,8 +141,12 @@ SECP256K1_API int secp256k1_schnorrsig_sign( 141 | * variable length messages and accepts a pointer to an extraparams object that 142 | * allows customizing signing by passing additional arguments. 143 | * 144 | - * Creates the same signatures as schnorrsig_sign if msglen is 32 and the 145 | - * extraparams.ndata is the same as aux_rand32. 146 | + * Equivalent to secp256k1_schnorrsig_sign32(..., auxrand32) if msglen is 32
jonasnick commented at 12:30 PM on August 23, 2022:auxrand32 -> aux_rand32
real-or-random commented at 3:10 PM on August 23, 2022:fixed
real-or-random force-pushed on Aug 23, 2022in src/modules/schnorrsig/tests_impl.h:250 in 618253e69a outdated
249 | 250 | + secp256k1_schnorrsig_extraparams extraparams = SECP256K1_SCHNORRSIG_EXTRAPARAMS_INIT; 251 | + extraparams.ndata = (unsigned char*)aux_rand; 252 | + 253 | CHECK(secp256k1_keypair_create(ctx, &keypair, sk)); 254 | - CHECK(secp256k1_schnorrsig_sign32(ctx, sig, msg32, &keypair, aux_rand));
jonasnick commented at 4:18 PM on May 11, 2023:Wouldn't it be better if we continued running
secp256k1_schnorrsig_sign32if the msglen is 32?
sipa commented at 4:26 PM on May 11, 2023:Or run both in that case.
real-or-random commented at 4:37 PM on May 11, 2023:Or run both in that case.
done
schnorrsig: Refactor test vector code to allow varlen messages 97a98bed1eschnorrsig: Add BIP340 varlen test vectors 28687b0312schnorrsig: Improve docs of schnorrsig_sign_custom cd54ac7c1creal-or-random force-pushed on May 11, 2023jonasnick commented at 4:40 PM on May 11, 2023: contributorACK cd54ac7c1cca509404b62e626a6291f434af88e8
sipa commented at 4:41 PM on May 11, 2023: contributorACK cd54ac7c1cca509404b62e626a6291f434af88e8. I didn't verify the included test vectors match the BIP.
jonasnick merged this on May 11, 2023jonasnick closed this on May 11, 2023sipa referenced this in commit b4eb644b6c on May 12, 2023hebasto referenced this in commit 49c52ea2b1 on May 13, 2023vmta referenced this in commit e1120c94a1 on Jun 4, 2023sipa referenced this in commit 901336eee7 on Jun 21, 2023vmta referenced this in commit 8f03457eed on Jul 1, 2023delta1 referenced this in commit 3f32c20932 on Aug 8, 2023delta1 referenced this in commit 31ac0c1081 on Aug 31, 2023janus referenced this in commit c4348d88db on Sep 11, 2023div72 referenced this in commit af627d47c3 on Apr 12, 2025str4d referenced this in commit 5a6bf5f178 on Jun 4, 2025Contributors
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:52 UTC
This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:52 UTC