getSessionKeyAggCoeff static method

BigInt getSessionKeyAggCoeff({
  1. required MuSig2Session session,
  2. required ProjectiveECCPoint pk,
})

Implementation

static BigInt getSessionKeyAggCoeff({
  required MuSig2Session session,
  required ProjectiveECCPoint pk,
}) {
  final pkBytes = pk.toBytes();
  final signerPk = session.publicKeys.any(
    (e) => BytesUtils.bytesEqual(e, pkBytes),
  );
  if (!signerPk) {
    throw ArgumentException.invalidOperationArguments(
      "getSessionKeyAggCoeff",
      name: "pk",
      reason: "The signer pubkey does not exists in pubkey list.",
    );
  }
  return _keyAggCoeff(keys: session.publicKeys, key: pkBytes);
}