public class BigIntegerScalarOps extends Object implements ScalarOps
| Constructor and Description |
|---|
BigIntegerScalarOps(Field f,
BigInteger l)Create a BigIntegerScalarOps. |
| Modifier and Type | Method and Description |
|---|---|
byte[] | multiplyAndAdd(byte[] a,
byte[] b,
byte[] c)$r = (a * b + c) \bmod l$ |
byte[] | reduce(byte[] s)Reduce the given scalar mod $l$. |
public BigIntegerScalarOps(Field f, BigInteger l)
f - the finite fieldl - the group order (subgroup size)public byte[] multiplyAndAdd(byte[] a,
byte[] b,
byte[] c)ScalarOpsmultiplyAndAdd in interface ScalarOpsa - the first scalar @param b the second scalar @param c the third scalar @return the resultb - a scalarc - a scalarpublic byte[] reduce(byte[] s)
ScalarOpsFrom the Ed25519 paper:
Here we interpret $2b$-bit strings in little-endian form as integers in
$\{0, 1,..., 2^{(2b)}-1\}$.