net.i2p.crypto.eddsa.math.bigint

## Class BigIntegerScalarOps

- java.lang.Object
- - net.i2p.crypto.eddsa.math.bigint.BigIntegerScalarOps

- All Implemented Interfaces:
    Serializable, ScalarOps

      public class BigIntegerScalarOps
      extends 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:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BigIntegerScalarOps(Field f, BigInteger l)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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$.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BigIntegerScalarOps

          public BigIntegerScalarOps(Field f,
                                     BigInteger l)

  - ### Method Detail

    - #### multiplyAndAdd

          public byte[] multiplyAndAdd(byte[] a,
                                       byte[] b,
                                       byte[] c)

      Description copied from interface: `ScalarOps`
      $r = (a * b + c) \bmod l$
      Specified by:
        `multiplyAndAdd` in interface `ScalarOps`
      Parameters:
        `a` - a scalar
        `b` - a scalar
        `c` - a scalar
      Returns:
        $(a*b + c) \bmod l$

    - #### reduce

          public byte[] reduce(byte[] s)

      Description copied from interface: `ScalarOps`
      Reduce the given scalar mod $l$.

      From the Ed25519 paper:
      Here we interpret $2b$-bit strings in little-endian form as integers in $\{0, 1,..., 2^{(2b)}-1\}$.

      Specified by:
        `reduce` in interface `ScalarOps`
      Parameters:
        `s` - the scalar to reduce
      Returns:
        $s \bmod l$