neg static method
Negates a scalar value and returns the result as a List<int>
.
This method negates the given scalar
and stores the result in the out
List<int>
.
The negation is performed according to Ristretto255 scalar operations.
Parameters:
- scalar: The scalar value to negate.
Returns:
A List<int>
representing the negated scalar.
Implementation
static List<int> neg(List<int> scalar) {
final out = List<int>.filled(32, 0);
CryptoOps.scMulAdd(
out, CryptoOpsConst.scMinusOne, scalar, CryptoOpsConst.zero);
return BytesUtils.toBytes(out);
}