neg function

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

Negates a scalar value and returns the result as a List

This method negates the given scalar and stores the result in the out List

Parameters:

  • scalar: The scalar value to negate.

Returns: A List

Implementation

List<int> neg(List<int> scalar) {
  final out = List<int>.filled(32, 0);
  _mulAdd(out, scMinusOne, scalar, scZero);
  return BytesUtils.toBytes(out);
}