sync method
Signs message using the seckey and returns the signature.
Implementation
// Future<Uint8List> call(final Uint8List message, final Uint8List seckey) =>
// compute((_) => sync(message, seckey), null);
/// Signs [message] using the [seckey] and returns the `signature`.
Uint8List sync(final Uint8List message, final Uint8List seckey) {
final Uint8List signedMessage = Uint8List(message.length + signatureLength);
final int result = TweetNaCl.crypto_sign(
signedMessage,
-1,
message,
0,
message.length,
seckey,
);
if (result != 0) throw Exception('Failed to sign message.');
return signedMessage.sublist(0, signatureLength);
}