Bug in key.cpp
3 messages, 6 May 2014. Started by Srintuar.
Srintuar, Odinn Cyberguerrilla, Pieter Wuille
I think i see a bug:
line 273 of key.cpp
if (rec<0 || rec>=3)
return false;
Afaict, 3 is a perfectly valid value, meaning 25% of sig-> key recoveries would fail erroneously...
You are right there is a bug in there.
But the value is not 25% I think. Tinker some more. :-)
Quoted text (20 lines)
> I think i see a bug: > > line 273 of key.cpp > > if (rec<0 || rec>=3) > return false; > > Afaict, 3 is a perfectly valid value, meaning 25% of sig-> key recoveries > would fail erroneously... > ------------------------------------------------------------------------------ > Is your legacy SCM system holding you back? Join Perforce May 7 to find > out: > • 3 signs your SCM is hindering your productivity > • Requirements for releasing software faster > • Expert tips and advice for migrating your SCM now > http://p.sf.net/sfu/perforce_______________________________________________ > Bitcoin-development mailing list > Bitcoin-development@lists•sourceforge•net > https://lists.sourceforge.net/lists/listinfo/bitcoin-development >
On Tue, May 6, 2014 at 5:12 AM, <odinn.cyberguerrilla@riseup•net> wrote:
Quoted text (7 lines)
> You are right there is a bug in there. > > But the value is not 25% I think. Tinker some more. :-) > >> >> Afaict, 3 is a perfectly valid value, meaning 25% of sig-> key recoveries >> would fail erroneously...
Values 2 and 3 are only needed in theory. They together shouldn't occur more than once in 2**127 (when the signature value is between the group size and the field size).
That said, this is indeed a bug.