|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.crypto.eddsa.math.ed25519.Ed25519ScalarOps
public class Ed25519ScalarOps
Class for reducing a huge integer modulo the group order q and doing a combined multiply plus add plus reduce operation.
q = 2^252 + 27742317777372353535851937790883648493.
Reviewed/commented by Bloody Rookie (nemproject@gmx.de)
Constructor Summary | |
---|---|
Ed25519ScalarOps()
|
Method Summary | |
---|---|
byte[] |
multiplyAndAdd(byte[] a,
byte[] b,
byte[] c)
Input: |
byte[] |
reduce(byte[] s)
Reduction modulo the group order q. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Ed25519ScalarOps()
Method Detail |
---|
public byte[] reduce(byte[] s)
Input: s[0]+256*s[1]+...+256^63*s[63] = s
Output: s[0]+256*s[1]+...+256^31*s[31] = s mod q where q = 2^252 + 27742317777372353535851937790883648493.
reduce
in interface ScalarOps
public byte[] multiplyAndAdd(byte[] a, byte[] b, byte[] c)
Output: result[0]+256*result[1]+...+256^31*result[31] = (ab+c) mod q where q = 2^252 + 27742317777372353535851937790883648493.
See the comments in reduce(byte[])
for an explanation of the algorithm.
multiplyAndAdd
in interface ScalarOps
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |