This implement Schnorr signatures on secp256k1 as per https://github.com/sipa/bips/blob/bip-schnorr/bip-schnorr.mediawiki
This implement a variation of Schnorr similar to edDSA by Daniel J. Bernstein.
Differential D2169
[secp256k1] Implement Schnorr signatures deadalnix on Dec 2 2018, 19:48. Authored by
Details
This implement Schnorr signatures on secp256k1 as per https://github.com/sipa/bips/blob/bip-schnorr/bip-schnorr.mediawiki This implement a variation of Schnorr similar to edDSA by Daniel J. Bernstein. Added test cases for the signature scheme.
Diff Detail
Event TimelineThere are a very large number of changes, so older changes are hidden. Show Older Changes
Comment Actions A few comments. Most notably the computation of e should not be failing on overflow.
Comment Actions I'm not convinced that the mod approach is a good idea. In general this is known to be a problem. BIPSCHNORR argues that this is not a problem because the range of number that are twice as probable is small, but I'm not convinced this is desirable.
Comment Actions A few replies. I have to still review some other parts of code so some more comments may be coming.
Comment Actions Seems good then. A couple more remarks added. I am not really able to review the test data but the tests themselves seem to have the right idea. It looks like there are a few more test vectors at https://github.com/sipa/bips/blob/bip-schnorr/bip-schnorr/test-vectors.csv , for example there are two tests for the case R=0 not just one.
Comment Actions Hmm, I have been looking around some more and I can't find any other discrete log signature algos that constrain e in this way: at least DSA, ECDSA, basic Schnorr, EdDSA, ElGamal, all do a modulo wraparound on the hash rather than having extra fail conditions during verification/signing. Seems cryptographers are generally ok with it. The BIPSCHNORR only makes this biasing comment (footnote 8) about k generation, where biases are generally concern. No such comment about bias in e. From what I understand, small biases in the e hash function are not a problem since e just has to be second-preimage resistant for security, and its preimage is fully public; unlike with k where preimage is private and the hash function has to act as a 'randomizer'. Comment Actions Note to observers: Much discussion about e selection was had in other avenues... interesting cryptography behind this. Regarding the e=0 case in particular, I posted a question on stackexchange https://crypto.stackexchange.com/questions/66334/why-is-e-0-allowed-in-schnorr-signatures and got back an insightful answer. Comment Actions Update the signature algorithm to accept any value for e. It ensures there are less hard ot test special codepath. It is not a problem because:
Comment Actions
Comment Actions Went over this in fine detail all over again. Still good. 👍
Comment Actions Please don't care about the last comment, this has already been discussed offline. |