blsVerify method
Implementation
@override
Future<bool> blsVerify(Uint8List pk, Uint8List sig, Uint8List msg) async {
await initInstance();
if (!await blsInit()) {
throw StateError('cannot initialize BLS on Web.');
}
final blsVerifyFunc = instance!.functions['bls_verify']! as int Function(
int,
int,
int,
int,
int,
int,
);
final set0 = passArray8ToWasm0(sig, _malloc);
final set1 = passArray8ToWasm0(msg, _malloc);
final set2 = passArray8ToWasm0(pk, _malloc);
return blsVerifyFunc(
set0.first,
set0.last,
set1.first,
set1.last,
set2.first,
set2.last,
) ==
0;
}