Class BigIntegerScalarOps

    • Constructor Detail

      • BigIntegerScalarOps

        public BigIntegerScalarOps​(Field f,
                                   BigInteger l)
    • Method Detail

      • 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$
      • 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$