Open LSantos06 opened 5 years ago
- Let k' = int(hash(bytes(d) || m)) mod n.
- Fail if k' = 0.
- Let R = k'G.
[1] https://github.com/sipa/bips/blob/bip-schnorr/bip-schnorr.mediawiki#cite_note-8 [2] https://github.com/bitcoin-core/secp256k1/blob/aa15154a4882a40227a238edef830b85a4942d4f/src/scalar_4x64.h#L12 [3] https://github.com/bitcoin-core/secp256k1/blob/master/src/scalar.h#L35 [4] https://github.com/bitcoin-core/secp256k1/blob/1e6f1f5ad5e7f1e3ef79313ec02023902bf8175c/src/ecmult_gen.h#L39 [5] https://github.com/bitcoin-core/secp256k1/blob/e34ceb333b1c0e6f4115ecbb80c632ac1042fa49/src/ecmult_gen_impl.h#L124 [6] https://github.com/bitcoin-core/secp256k1/blob/e34ceb333b1c0e6f4115ecbb80c632ac1042fa49/src/group.h#L13 [7] https://github.com/bitcoin-core/secp256k1/blob/ba698f883b7de4f89be073aa8713ae736f5e770d/src/field_5x52.h#L12 [8] https://github.com/bitcoin-core/secp256k1/blob/1e6f1f5ad5e7f1e3ef79313ec02023902bf8175c/src/field.h#L10
- Let k = k' if jacobi(y(R)) = 1, otherwise let k = n - k'.
- Let e = int(hash(bytes(x(R)) || bytes(dG) || m)) mod n.
- The signature is bytes(x(R)) || bytes(k + ed mod n).
[1] https://github.com/bitcoin-core/secp256k1/blob/master/src/field.h#L76 [2] https://github.com/bitcoin-core/secp256k1/blob/1e6f1f5ad5e7f1e3ef79313ec02023902bf8175c/src/num_gmp.h#L14 [3] https://github.com/bitcoin-core/secp256k1/blob/master/src/scalar.h#L89 [4] https://github.com/bitcoin-core/secp256k1/blob/1e6f1f5ad5e7f1e3ef79313ec02023902bf8175c/src/num.h#L25 [5] https://github.com/bitcoin-core/secp256k1/blob/master/src/scalar.h#L35 [6] https://github.com/bitcoin-core/secp256k1/blob/1e6f1f5ad5e7f1e3ef79313ec02023902bf8175c/src/num.h#L35 [7] https://github.com/bitcoin-core/secp256k1/blob/master/src/scalar.h#L66 [8] https://github.com/bitcoin-core/secp256k1/blob/master/src/scalar.h#L50 [9] https://github.com/bitcoin-core/secp256k1/blob/master/src/scalar.h#L44 [10] https://github.com/bitcoin-core/secp256k1/blob/master/src/scalar.h#L41
[1] https://en.bitcoin.it/wiki/Schnorr
[2] https://github.com/bitcoin-core/secp256k1/blob/04c8ef36ad35e846ac27157021a78f79465f2a22/src/modules/schnorr/schnorr_impl.h
[3] https://github.com/sipa/bips/blob/bip-schnorr/bip-schnorr.mediawiki