- All Superinterfaces:
Serializable
- All Known Implementing Classes:
BigIntegerScalarOps, Ed25519ScalarOps
Interface for scalar operations in EdDSA.
Method Summary
All MethodsModifier and TypeMethodDescriptionbyte[]multiplyAndAdd(byte[] a, byte[] b, byte[] c) $r = (a * b + c) \bmod l$.byte[]reduce(byte[] s) Reduce the given scalar mod $l$.
Method Details
reduce
byte[] reduce(byte[] s) Reduce the given scalar mod $l$.From the Ed25519 paper:
Here we interpret $2b$-bit strings in little-endian form as integers in $\{0, 1,..., 2^{(2b)}-1\}$.- Parameters:
s- the scalar to reduce- Returns:
- $s \bmod l$
multiplyAndAdd
byte[] multiplyAndAdd(byte[] a, byte[] b, byte[] c) $r = (a * b + c) \bmod l$.- Parameters:
a- the first multiplicand, a scalar in little-endian formb- the second multiplicand, a scalar in little-endian formc- the addend, a scalar in little-endian form- Returns:
- $(a*b + c) \bmod l$