verify function
Implementation
bool verify(
Uint8List msg, Uint8List sig, Uint8List publicKey, String hashMode) {
if (sig.length != crypto_sign_BYTES) {
throw Exception('bad signature size');
}
if (publicKey.length != crypto_sign_PUBLICKEYBYTES) {
throw Exception('bad public key size');
}
var sm = Uint8List(crypto_sign_BYTES + msg.length);
var m = Uint8List(crypto_sign_BYTES + msg.length);
for (var i = 0; i < crypto_sign_BYTES; i++) {
sm[i] = sig[i];
}
for (var i = 0; i < msg.length; i++) {
sm[i + crypto_sign_BYTES] = msg[i];
}
return cryptoSignOpen(m, sm, sm.length, publicKey, hashMode) >= 0;
}