asScalarInt static method

BigInt asScalarInt(
  1. List<int> scalar
)

check and convert scalar bytes to BigInteger

Implementation

static BigInt asScalarInt(List<int> scalar) {
  if (CryptoOps.scCheck(scalar) == 0) {
    return BigintUtils.fromBytes(scalar, byteOrder: Endian.little);
  }
  throw const CryptoException(
      "The provided scalar exceeds the allowed range.");
}