deriveSecretScalars static method
Implementation
static List<BigInt> deriveSecretScalars(
Uint8List rand,
Uint8List secretKey,
Uint8List compressedPubKey,
Uint8List aggXOnly,
Uint8List message,
) {
final auxInput = concatBytes([
rand,
secretKey,
compressedPubKey,
aggXOnly,
message,
]);
final randPrime = taggedHash('MuSig/nonce', auxInput);
final k1Hash = taggedHash('MuSig/aux', randPrime);
final k1 = bytesToBigInt(k1Hash) % secp256k1N;
final k2Input = concatBytes([randPrime, Uint8List.fromList([0x01])]);
final k2Hash = taggedHash('MuSig/aux', k2Input);
final k2 = bytesToBigInt(k2Hash) % secp256k1N;
return [k1, k2];
}