bcgit / pc-dart

Pointy Castle - Dart Derived Bouncy Castle APIs
MIT License
237 stars 122 forks source link

ECCurve_secp256k1 constructor fails with nullsafety violation #88

Closed morrica closed 1 year ago

morrica commented 3 years ago

Using version 3.0.0-nullsafety.2

The following fails with a nullsafety violation: ECDomainParameters _domainParameters = ECCurve_secp256k1();

Relevant error:

dart:core                                                          _TypeError._throwNew
package:pointycastle/src/ec_standard_curve_constructor.dart 20:21  constructFpStandardCurve
package:pointycastle/ecc/curves/secp256k1.dart 15:34               new ECCurve_secp256k1
package:my_package/src/crypto.dart 9:46                           _domainParameters

type 'Null' is not a subtype of type 'List<int>' of 'seed'

It looks like null is specifically being passed into the non-nullable List<int> seed parameter of the ECCurve_secp256k1._make() method in the secp256k1.dart file.

Pointycastle is holding up the migration to null-safety for my library so I'm eager to see a release version. Appreciate all the effort. :-)

morrica commented 3 years ago

Looks like this was probably already fixed in the latest github code. The fix just hasn't been published to pub.dev yet. Will await that new version on pub.dev.

AKushWarrior commented 3 years ago

The new version was published yesterday (so you should be good to go).