toScalarBigInt static method

BigInt toScalarBigInt(
  1. List<int> scalarBytes
)

Implementation

static BigInt toScalarBigInt(List<int> scalarBytes) {
  if (scalarBytes.length == MuSig2Constants.baselen) {
    final toBig = BigintUtils.fromBytes(scalarBytes) % MuSig2Constants.order;
    if (toBig != BigInt.zero) return toBig;
  }
  throw ArgumentException.invalidOperationArguments(
    "toScalarBigInt",
    name: "scalarBytes",
    reason: "Invalid scalar bytes",
  );
}