public class Ed25519ScalarOps extends Object implements ScalarOps
| Constructor and Description |
|---|
Ed25519ScalarOps() |
| Modifier and Type | Method and Description |
|---|---|
byte[] | multiplyAndAdd(byte[] a,
byte[] b,
byte[] c)$(ab+c) \bmod q$ |
byte[] | reduce(byte[] s)Reduction modulo the group order $q$. |
public byte[] multiplyAndAdd(byte[] a,
byte[] b,
byte[] c)Input:
Output: $result[0]+256*result[1]+\dots+256^{31}*result[31] = (ab+c) \bmod q$ where $q = 2^{252} + 27742317777372353535851937790883648493$.
See the comments in reduce(byte[]) for an explanation of the algorithm.
multiplyAndAdd in interface ScalarOpsa - a scalarb - a scalarc - a scalarpublic byte[] reduce(byte[] s)
Input: $s[0]+256*s[1]+\dots+256^{63}*s[63] = s$
Output: $s[0]+256*s[1]+\dots+256^{31}*s[31] = s \bmod q$ where $q = 2^{252} + 27742317777372353535851937790883648493$.