java.lang.Object
net.i2p.crypto.eddsa.math.bigint.BigIntegerScalarOps
- All Implemented Interfaces:
Serializable, ScalarOps
BigInteger-based implementation of scalar operations for EdDSA cryptography.
This class provides fundamental scalar arithmetic operations required for EdDSA signature schemes, including modular reduction and scalar multiplication with addition. All operations are performed modulo the subgroup order l, ensuring results remain within the valid scalar range for EdDSA operations.
- See Also:
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BigIntegerLittleEndianEncodingThe little-endian encoding for field elements.private final BigIntegerThe group order (subgroup size) l.Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionbyte[]multiplyAndAdd(byte[] a, byte[] b, byte[] c) Multiply a by b, add c, and reduce modulo the group order.byte[]reduce(byte[] s) Reduce the given scalar modulo the group order.
Field Details
l
The group order (subgroup size) l.enc
The little-endian encoding for field elements.
Constructor Details
BigIntegerScalarOps
Create a BigIntegerScalarOps.- Parameters:
f- the finite fieldl- the group order (subgroup size)
Method Details
reduce
multiplyAndAdd
public byte[] multiplyAndAdd(byte[] a, byte[] b, byte[] c) Multiply a by b, add c, and reduce modulo the group order.- Specified by:
multiplyAndAddin interfaceScalarOps- Parameters:
a- The first scalar.b- The second scalar.c- The third scalar.- Returns:
- the reduced product-plus-sum, encoded