scalarReduceVar static method

List<int> scalarReduceVar(
  1. List<int> scalar
)

reduce scalar

Implementation

static List<int> scalarReduceVar(List<int> scalar) {
  final toint = BigintUtils.fromBytes(scalar, byteOrder: Endian.little);
  final reduce = toint % Curves.generatorED25519.order!;
  final tobytes = BigintUtils.toBytes(reduce,
      order: Endian.little,
      length: BigintUtils.orderLen(Curves.generatorED25519.order!));
  return tobytes;
}