blsVerify method

  1. @override
Future<bool> blsVerify(
  1. Uint8List pk,
  2. Uint8List sig,
  3. Uint8List msg
)
override

Implementation

@override
Future<bool> blsVerify(
  Uint8List pk,
  Uint8List sig,
  Uint8List msg,
) async {
  try {
    // ignore: unnecessary_null_comparison
    if (dylib == null) throw "ERROR: The library is not initialized 🙁";
    // if (await blsInit() != true) {
    //   throw "ERROR: Cannot initialize BLS instance";
    // }
    final response = ReceivePort();
    await Isolate.spawn(
      _isolateBlsVerify,
      [
        response.sendPort,
        sig.toHex(include0x: false),
        msg.toHex(include0x: false),
        pk.toHex(include0x: false),
      ],
    );
    return (await response.first) as bool;
  } catch (e) {
    throw "Cannot verify bls_verify instance :$e";
  }
}