java.lang.Object
net.i2p.crypto.eddsa.math.bigint.BigIntegerScalarOps
All Implemented Interfaces:
Serializable, ScalarOps

public class BigIntegerScalarOpsextends Object implements 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:
  • Constructor Details

    • BigIntegerScalarOps

      public BigIntegerScalarOps(Field f, BigInteger l)
      Create a BigIntegerScalarOps.
      Parameters:
      f - the finite field
      l - the group order (subgroup size)
  • Method Details

    • reduce

      public byte[] reduce(byte[] s)
      Reduce the given scalar modulo the group order.
      Specified by:
      reduce in interface ScalarOps
      Parameters:
      s - The scalar to reduce.
      Returns:
      The reduced scalar.
    • multiplyAndAdd

      public byte[] multiplyAndAdd(byte[] a, byte[] b, byte[] c)
      Multiply a by b, add c, and reduce modulo the group order.
      Specified by:
      multiplyAndAdd in interface ScalarOps
      Parameters:
      a - The first scalar.
      b - The second scalar.
      c - The third scalar.
      Returns:
      the reduced product-plus-sum, encoded