Problem with Int::ModInv function
bojlahg opened this issue · comments
Dmitriy Prikhodko commented
If rewrite this function as Int::ModInvK1order() to use _O instead of _P.
It works correct mod inv for 2:
7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A1
But it produces wrong result for 3:
82BF7F39A4D8106748D1A88032817BE8BD439FCAF491B982B7AC082B9D33ABF6
Correct result:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9D1C9E899CA306AD27FE1945DE0242B81
In case of switch to XCD instead of DSR62 it works fine.
Dmitriy Prikhodko commented
ok found: MM32 & MM64 constants should be initialized accordingly...
DSR62 works fine.
Jean-Luc PONS commented
Cool.
You have in Int::Check() the test with prime=curve order (you have to comment in/out) the follwinfglines.
Line 1550 in 1bc508a