pc-dart
pc-dart copied to clipboard
ECCurve_secp256k1 constructor fails with nullsafety violation
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. :-)
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.
The new version was published yesterday (so you should be good to go).