sign method
Implementation
Uint8List sign(Uint8List data) {
if (_secret == null || _wots == null) {
throw StateError('Cannot sign without secret key or address');
}
if (_secret!.length != 32) {
throw StateError(
'Invalid sourceSeed length, expected 32, got ${_secret!.length}');
}
if (_wots!.length != 2208) {
throw StateError(
'Invalid sourceWots length, expected 2208, got ${_wots!.length}');
}
final pubSeed = _wots!.sublist(WOTS.WOTSSIGBYTES, WOTS.WOTSSIGBYTES + 32);
final rnd2 = _wots!.sublist(WOTS.WOTSSIGBYTES + 32, WOTS.WOTSSIGBYTES + 64);
final sig = Uint8List(WOTS.WOTSSIGBYTES);
WOTS.wotsSign(sig, data, _secret!, pubSeed, 0, rnd2);
return sig;
}