wotsSign static method
void
wotsSign()
Signs a message using WOTS
Implementation
static void wotsSign(
Uint8List sig,
Uint8List msg,
Uint8List seed,
Uint8List pubSeed,
int offset,
Uint8List addr,
) {
final lengths = List<int>.filled(WOTSLEN, 0);
// Compute lengths
chainLengths(msg, lengths);
// Expand seed
expandSeed(sig, seed);
// Create WotsAddress instance from addr bytes
final wotsAddr = WotsAddress.wotsAddressFromBytes(addr);
final bbaddr = ByteBuffer.wrap(wotsAddr.bytes().sublist(0, PARAMSN));
bbaddr.order(ByteOrder.littleEndian);
// Generate signature
for (int i = 0; i < WOTSLEN; i++) {
WOTSHash.setChainAddr(bbaddr, i);
genChain(sig, i * PARAMSN, sig, i * PARAMSN, 0, lengths[i],
pubSeed.sublist(offset), bbaddr.array());
}
}