open_len method
Implementation
Uint8List open_len(
Uint8List signedMessage, final int smoff, final int smlen) {
// check sm length
if (!(signedMessage != null &&
signedMessage.length >= (smoff + smlen) &&
smlen >= signatureLength)) return null;
// temp buffer
Uint8List tmp = Uint8List(smlen);
if (0 !=
TweetNaclFast.crypto_sign_open(
tmp, -1, signedMessage, smoff, smlen, _theirPublicKey)) return null;
// message
Uint8List msg = Uint8List(smlen - signatureLength);
for (int i = 0; i < msg.length; i++)
msg[i] = signedMessage[smoff + i + signatureLength];
return msg;
}