deterministicSign method

  1. @override
MuSig2DeterministicSignature deterministicSign({
  1. required List<int> sk,
  2. required List<int> aggotherNonce,
  3. required List<List<int>> publicKeys,
  4. List<MuSig2Tweak> tweaks = const [],
  5. required List<int> msg,
  6. List<int>? rand,
})
override

Generates a deterministic MuSig2 signature Derives a nonce deterministically from 32-byte sk, 66-byte aggotherNonce and msg, aggregates it with publicKeys/tweaks into a session and partial-signs it. Optional rand overrides the nonce randomness. Returns the partial signature with its 66-byte pubnonce. Throws on invalid input.

Implementation

@override
MuSig2DeterministicSignature deterministicSign({
  required List<int> sk,
  required List<int> aggotherNonce,
  required List<List<int>> publicKeys,
  List<MuSig2Tweak> tweaks = const [],
  required List<int> msg,
  List<int>? rand,
}) {
  ApiValidate.length(
    sk,
    32,
    operation: '$_tag.deterministicSign',
    name: 'sk',
  );
  if (publicKeys.isEmpty) {
    throw CoreErrors.invalidOperationArguments(
      '$_tag.deterministicSign',
      name: 'publicKeys',
      reason: 'must not be empty',
    );
  }
  return ApiValidate.call(
    '$_tag.deterministicSign',
    () => inner.deterministicSign(
      sk: sk,
      aggotherNonce: aggotherNonce,
      publicKeys: publicKeys,
      tweaks: tweaks,
      msg: msg,
      rand: rand,
    ),
  );
}