add static method

List<int> add(
  1. List<int> scalar1,
  2. List<int> scalar2
)

Adds two scalar values represented as List<int> and returns the result as a List<int>.

This method adds two scalar values, scalar1 and scalar2, and stores the result in the out List<int>. The addition is performed according to Ristretto255 scalar operations.

Parameters:

  • scalar1: The first scalar value to add.
  • scalar2: The second scalar value to add.

Returns: A List<int> representing the result of the addition.

Implementation

static List<int> add(List<int> scalar1, List<int> scalar2) {
  final out = List<int>.filled(32, 0);
  CryptoOps.scMulAdd(out, CryptoOpsConst.infinity, scalar1, scalar2);
  return BytesUtils.toBytes(out);
}