| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final long[] | |
| private static final long | |
| private static final int | |
| public static final BigInteger | |
| private static final long[] | |
| private static final int | |
| public static final MontgomeryIntegerPolynomialP256 | |
| private static final long[] | |
| private static final long[] | |
| private static final long[] |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected long | |
| private static BigInteger | |
| protected void | finalCarryReduceLast(long[] limbs)
Implements abstract sun. Carry out of the last limb and reduce back in. This method will be called as part of the "finalReduce" operation that puts the representation into a fully-reduced form. |
| public ImmutableIntegerModuloP | |
| public IntegerPolynomial. | get0()
Overrides sun. Implements sun. Get the additive identity element 0 |
| public IntegerPolynomial. | get1()
Overrides sun. Implements sun. Get the multiplicative identity element 1 |
| public IntegerPolynomial. | getElement(BigInteger v)
Overrides sun. Implements sun. Get the field element equivalent to the supplied BigInteger value. |
| public IntegerPolynomial. | getElement(byte[] v, int offset, int length, byte highByte)
Overrides sun. Implements sun. Get a field element from a little-endian unsigned integer stored at the specified position in an array. |
| public SmallValue | getSmallValue(int value)
Overrides sun. Implements sun. Get a "small" value according to this implementation. |
| private void | |
| protected void | mult(long[] a, long[] b, long[] r)
Implements abstract sun. Unrolled Word-by-Word Montgomery Multiplication r = a * b * 2^-260 (mod P) See [1] Figure 5. |
| protected void | postEncodeCarry(long[] v)
Overrides sun.
|
| protected void | reduce(long[] limbs)
Implements abstract sun. Reduce an IntegerPolynomial representation (a) and store the result in a. |
| protected void | reduceIn(long[] limbs, long v, int i)
Implements abstract sun.
|
| public IntegerFieldModuloP | |
| protected void | square(long[] a, long[] r)
Implements abstract sun. Multiply an IntegerPolynomial representation (a) with itself and store the result in an IntegerPolynomialRepresentation (r). |
| BITS_PER_LIMB | back to summary |
|---|---|
| private static final int BITS_PER_LIMB | |
| h | back to summary |
|---|---|
| private static final long[] h | |
| LIMB_MASK | back to summary |
|---|---|
| private static final long LIMB_MASK | |
| MAX_ADDS | back to summary |
|---|---|
| private static final int MAX_ADDS | |
| MODULUS | back to summary |
|---|---|
| public static final BigInteger MODULUS | |
| modulus | back to summary |
|---|---|
| private static final long[] modulus Hides sun. | |
| NUM_LIMBS | back to summary |
|---|---|
| private static final int NUM_LIMBS | |
| ONE | back to summary |
|---|---|
| public static final MontgomeryIntegerPolynomialP256 ONE | |
| oneActual | back to summary |
|---|---|
| private static final long[] oneActual | |
| oneMont | back to summary |
|---|---|
| private static final long[] oneMont | |
| zero | back to summary |
|---|---|
| private static final long[] zero | |
| MontgomeryIntegerPolynomialP256 | back to summary |
|---|---|
| private MontgomeryIntegerPolynomialP256() | |
| carryValue | back to summary |
|---|---|
| protected long carryValue(long x) Overrides sun.
| |
| evaluateModulus | back to summary |
|---|---|
| private static BigInteger evaluateModulus() | |
| finalCarryReduceLast | back to summary |
|---|---|
| protected void finalCarryReduceLast(long[] limbs) Implements abstract sun. Doc from sun. Carry out of the last limb and reduce back in. This method will be called as part of the "finalReduce" operation that puts the representation into a fully-reduced form. It is representation- specific, because representations have different amounts of empty space in the high-order limb. Requires that limbs.length=numLimbs.
| |
| fromMontgomery | back to summary |
|---|---|
| public ImmutableIntegerModuloP fromMontgomery(ImmutableIntegerModuloP n) Implements sun.
| |
| get0 | back to summary |
|---|---|
| public IntegerPolynomial. Overrides sun. Implements sun. Doc from sun. Get the additive identity element 0
| |
| get1 | back to summary |
|---|---|
| public IntegerPolynomial. Overrides sun. Implements sun. Doc from sun. Get the multiplicative identity element 1
| |
| getElement | back to summary |
|---|---|
| public IntegerPolynomial. Overrides sun. Implements sun. Doc from sun. Get the field element equivalent to the supplied BigInteger value. The supplied value may be negative or larger than the modulus that defines the field.
| |
| getElement | back to summary |
|---|---|
| public IntegerPolynomial. Overrides sun. Implements sun. Doc from sun. Get a field element from a little-endian unsigned integer stored at the specified position in an array. The supplied value may be larger than the modulus that defines the field. This method also takes a byte which is interpreted as an additional high-order byte of the number. The array will not be modified. | |
| getSmallValue | back to summary |
|---|---|
| public SmallValue getSmallValue(int value) Overrides sun. Implements sun. Doc from sun. Get a "small" value according to this implementation. This value may be used in optimized forms of some operations to avoid unnecessary calculations. For example, multiplication is much faster when it is known that one of the numbers fits within a single limb. The definition of "small", and the range of accepted values, is implementation-specific.
| |
| halfLimbs | back to summary |
|---|---|
| private void halfLimbs(long[] a, long[] r) | |
| mult | back to summary |
|---|---|
| protected void mult(long[] a, long[] b, long[] r) Implements abstract sun. Unrolled Word-by-Word Montgomery Multiplication r = a * b * 2^-260 (mod P) See [1] Figure 5. "Algorithm 2: Word-by-Word Montgomery Multiplication for a Montgomery Friendly modulus p". Note Step 6. Skipped; Instead use numAdds to reuse existing overflow logic.
| |
| postEncodeCarry | back to summary |
|---|---|
| protected void postEncodeCarry(long[] v) Overrides sun.
| |
| reduce | back to summary |
|---|---|
| protected void reduce(long[] limbs) Implements abstract sun. Doc from sun. Reduce an IntegerPolynomial representation (a) and store the result in a. Requires that a.length == numLimbs.
| |
| reduceIn | back to summary |
|---|---|
| protected void reduceIn(long[] limbs, long v, int i) Implements abstract sun.
| |
| residueField | back to summary |
|---|---|
| public IntegerFieldModuloP residueField() Implements sun. | |
| square | back to summary |
|---|---|
| protected void square(long[] a, long[] r) Implements abstract sun. Doc from sun. Multiply an IntegerPolynomial representation (a) with itself and store the result in an IntegerPolynomialRepresentation (r). Requires that a.length == r.length == numLimbs. It is allowed for a and r to be the same array.
| |