dartist / dart-bignum

Other
14 stars 11 forks source link

Pointy Castle tests broken in Dart 2.0 - does bignum work? #46

Open stevenroose opened 6 years ago

stevenroose commented 6 years ago

Pointy Castle relies on BigInteger everywhere. However, while starting to port it to Dart 2.0, a lot of the unit tests are broken. I'm having trouble figuring out what is the root cause, but it seems like bignum could be the cause.

F.e. BigIntegers instantiated using new BigInteger("<hex>", 16) print as 0 and comparisons fails. (Not sure if the actual value is 0 (constructor fails) or if the print function fails.)

azenla commented 6 years ago

Note, Dart has switched to int64 in 2.0

https://github.com/dart-lang/sdk/blob/master/docs/language/informal/int64.md

The BigInt class is now available in 2.0, however there are some bugs that must be worked around: https://github.com/dart-lang/sdk/issues/32626

stevenroose commented 6 years ago

I saw that. And yes, working on it :)

stevenroose commented 6 years ago

Damn. I should read this more carefully! I've been trying to debug that code for PointyCastle for over a week and I couldn't get my head around it. It's a blessing someone found that bug in modPow. Still not sure though if it's actually that!