| Modifier and Type | Class and Description |
|---|---|
| private abstract class | |
| pack-priv class | |
| pack-priv static class | |
| protected class |
| Modifier and Type | Field and Description |
|---|---|
| protected final int | |
| private final int | |
| private final int | |
| private final BigInteger | |
| protected final int | |
| private final long[] | |
| protected static final BigInteger |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addLimbs(long[] a, long[] b, long[] dst)
Add two IntegerPolynomial representations (a and b) and store the result in an IntegerPolynomialRepresentation (dst). |
| protected void | addLimbsModPowerTwo(long[] limbs, long[] other, byte[] result)
Add the reduced number corresponding to limbs and other, and store the low-order bytes of the sum in result. |
| protected void | |
| protected void | |
| protected long | |
| protected long | |
| protected static void | |
| protected static void | |
| protected void | |
| protected void | encode(ByteBuffer buf, int length, byte highByte, long[] result)
This version of encode takes a ByteBuffer that is properly ordered, and may extract larger values (e.g. long) from the ByteBuffer for better performance. |
| protected void | |
| protected void | |
| protected BigInteger | |
| protected abstract void | finalCarryReduceLast(long[] limbs)
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. |
| protected void | |
| public IntegerPolynomial. | get0()
Implements sun. Get the additive identity element 0 |
| public IntegerPolynomial. | get1()
Implements sun. Get the multiplicative identity element 1 |
| public IntegerPolynomial. | getElement(BigInteger v)
Implements sun. Get the field element equivalent to the supplied BigInteger value. |
| public IntegerPolynomial. | getElement(byte[] v, int offset, int length, byte highByte)
Implements sun. Get a field element from a little-endian unsigned integer stored at the specified position in an array. |
| public int | |
| protected int | |
| public BigInteger | getSize()
Implements sun. Get the size of the field as a BigInteger. |
| public SmallValue | getSmallValue(int value)
Implements sun. Get a "small" value according to this implementation. |
| protected void | limbsToByteArray(long[] limbs, byte[] result)
Stores the reduced, little-endian value of limbs in result. |
| protected abstract void | mult(long[] a, long[] b, long[] r)
Multiply two IntegerPolynomial representations (a and b) and store the result in an IntegerPolynomial representation (r). |
| protected void | multByInt(long[] a, long b)
Multiply an IntegerPolynomial representation (a) with a long (b) and store the result in an IntegerPolynomial representation in a. |
| protected void | |
| protected abstract void | |
| private void | |
| protected abstract void | |
| private void | |
| protected void | |
| private long[] | |
| protected abstract void | square(long[] a, long[] r)
Multiply an IntegerPolynomial representation (a) with itself and store the result in an IntegerPolynomialRepresentation (r). |
| bitsPerLimb | back to summary |
|---|---|
| protected final int bitsPerLimb | |
| maxAddsAdd | back to summary |
|---|---|
| private final int maxAddsAdd | |
| maxAddsMul | back to summary |
|---|---|
| private final int maxAddsMul | |
| modulus | back to summary |
|---|---|
| private final BigInteger modulus | |
| numLimbs | back to summary |
|---|---|
| protected final int numLimbs | |
| posModLimbs | back to summary |
|---|---|
| private final long[] posModLimbs | |
| TWO | back to summary |
|---|---|
| protected static final BigInteger TWO | |
| IntegerPolynomial | back to summary |
|---|---|
| pack-priv IntegerPolynomial(int bitsPerLimb, int numLimbs, int maxAddsMul, BigInteger modulus) | |
| addLimbs | back to summary |
|---|---|
| protected void addLimbs(long[] a, long[] b, long[] dst) Add two IntegerPolynomial representations (a and b) and store the result in an IntegerPolynomialRepresentation (dst). Requires that a.length == b.length == dst.length. It is allowed for a and dst to be the same array. | |
| addLimbsModPowerTwo | back to summary |
|---|---|
| protected void addLimbsModPowerTwo(long[] limbs, long[] other, byte[] result) Add the reduced number corresponding to limbs and other, and store the low-order bytes of the sum in result. Requires that limbs.length==other.length. The result array may have any length. | |
| carry | back to summary |
|---|---|
| protected void carry(long[] limbs, int start, int end) | |
| carry | back to summary |
|---|---|
| protected void carry(long[] limbs) | |
| carryOut | back to summary |
|---|---|
| protected long carryOut(long[] limbs, int index) Carry out of the specified position and return the carry value. | |
| carryValue | back to summary |
|---|---|
| protected long carryValue(long x) | |
| conditionalAssign | back to summary |
|---|---|
| protected static void conditionalAssign(int set, long[] a, long[] b) Branch-free conditional assignment of b to a. Requires that set is 0 or 1, and that a.length == b.length. If set==0, then the values of a and b will be unchanged. If set==1, then the values of b will be assigned to a. The behavior is undefined if swap has any value other than 0 or 1.
| |
| conditionalSwap | back to summary |
|---|---|
| protected static void conditionalSwap(int swap, long[] a, long[] b) Branch-free conditional swap of a and b. Requires that swap is 0 or 1, and that a.length == b.length. If swap==0, then the values of a and b will be unchanged. If swap==1, then the values of a and b will be swapped. The behavior is undefined if swap has any value other than 0 or 1. | |
| decode | back to summary |
|---|---|
| protected void decode(long[] v, byte[] dst, int offset, int length) Decode the value in v and store it in dst. Requires that v is final reduced. I.e. all limbs in [0, 2^bitsPerLimb) and value in [0, modulus). | |
| encode | back to summary |
|---|---|
| protected void encode(ByteBuffer buf, int length, byte highByte, long[] result) This version of encode takes a ByteBuffer that is properly ordered, and may extract larger values (e.g. long) from the ByteBuffer for better performance. The implementation below only extracts bytes from the buffer, but this method may be overridden in field-specific implementations. | |
| encode | back to summary |
|---|---|
| protected void encode(byte[] v, int offset, int length, byte highByte, long[] result) | |
| encodeSmall | back to summary |
|---|---|
| protected void encodeSmall(ByteBuffer buf, int length, byte highByte, long[] result) | |
| evaluate | back to summary |
|---|---|
| protected BigInteger evaluate(long[] limbs) | |
| finalCarryReduceLast | back to summary |
|---|---|
| protected abstract void finalCarryReduceLast(long[] limbs) 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. | |
| finalReduce | back to summary |
|---|---|
| protected void finalReduce(long[] limbs) Convert reduced limbs into a number between 0 and MODULUS-1. Requires that limbs.length == numLimbs. This method only works if the modulus has at most three terms. | |
| get0 | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Get the additive identity element 0
| |
| get1 | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Get the multiplicative identity element 1
| |
| getElement | back to summary |
|---|---|
| public IntegerPolynomial. 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. 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. | |
| getMaxAdds | back to summary |
|---|---|
| public int getMaxAdds() | |
| getNumLimbs | back to summary |
|---|---|
| protected int getNumLimbs() | |
| getSize | back to summary |
|---|---|
| public BigInteger getSize() Implements sun. Doc from sun. Get the size of the field as a BigInteger. This size is equal to the prime modulus used to construct the field.
| |
| getSmallValue | back to summary |
|---|---|
| public SmallValue getSmallValue(int value) 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.
| |
| limbsToByteArray | back to summary |
|---|---|
| protected void limbsToByteArray(long[] limbs, byte[] result) Stores the reduced, little-endian value of limbs in result. | |
| mult | back to summary |
|---|---|
| protected abstract void mult(long[] a, long[] b, long[] r) Multiply two IntegerPolynomial representations (a and b) and store the result in an IntegerPolynomial representation (r). Requires that a.length == b.length == r.length == numLimbs. It is allowed for a and r to be the same array. | |
| multByInt | back to summary |
|---|---|
| protected void multByInt(long[] a, long b) Multiply an IntegerPolynomial representation (a) with a long (b) and store the result in an IntegerPolynomial representation in a. Requires that a.length == numLimbs. | |
| postEncodeCarry | back to summary |
|---|---|
| protected void postEncodeCarry(long[] v) | |
| reduce | back to summary |
|---|---|
| protected abstract void reduce(long[] a) Reduce an IntegerPolynomial representation (a) and store the result in a. Requires that a.length == numLimbs. | |
| reduceHigh | back to summary |
|---|---|
| private void reduceHigh(long[] limbs) | |
| reduceIn | back to summary |
|---|---|
| protected abstract void reduceIn(long[] c, long v, int i) | |
| setLimbsValue | back to summary |
|---|---|
| private void setLimbsValue(BigInteger v, long[] limbs) | |
| setLimbsValuePositive | back to summary |
|---|---|
| protected void setLimbsValuePositive(BigInteger v, long[] limbs) | |
| setPosModLimbs | back to summary |
|---|---|
| private long[] setPosModLimbs() | |
| square | back to summary |
|---|---|
| protected abstract void square(long[] a, long[] r) 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. | |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public IntegerPolynomial. | add(IntegerModuloP genB)
Implements sun. Add this field element with the supplied element and return the result. |
| public IntegerPolynomial. | additiveInverse()
Implements sun. Compute the additive inverse of the field element |
| public void | addModPowerTwo(IntegerModuloP arg, byte[] result)
Implements sun. Perform an addition modulo a power of two and store the little-endian encoding of the result in the supplied array. |
| public BigInteger | asBigInteger()
Implements sun. Get the canonical value of this element as a BigInteger. |
| public void | asByteArray(byte[] result)
Implements sun. Places the little-endian encoding of this' % 2^(8 * result.length) into the supplied array, where this' is the canonical integer value equivalent to this. |
| protected long[] | |
| protected void | |
| public IntegerFieldModuloP | getField()
Implements sun. Get the field associated with this element. |
| public long[] | getLimbs()
Implements sun. Break encapsulation, used for IntrinsicCandidate functions |
| public IntegerPolynomial. | multiply(IntegerModuloP genB)
Implements sun. Multiply this field element with the supplied element and return the result. |
| public IntegerPolynomial. | mutable()
Implements sun. Return this value as a mutable element. |
| private void | |
| public IntegerPolynomial. | square()
Overrides default sun. Calculate the square of this element and return the result. |
| limbs | back to summary |
|---|---|
| protected long[] limbs | |
| numAdds | back to summary |
|---|---|
| protected int numAdds | |
| Element | back to summary |
|---|---|
| public Element(BigInteger v) | |
| Element | back to summary |
|---|---|
| public Element(boolean v) | |
| Element | back to summary |
|---|---|
| private Element(long[] limbs, int numAdds) | |
| add | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Add this field element with the supplied element and return the result.
| |
| additiveInverse | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Compute the additive inverse of the field element
| |
| addModPowerTwo | back to summary |
|---|---|
| public void addModPowerTwo(IntegerModuloP arg, byte[] result) Implements sun. Doc from sun. Perform an addition modulo a power of two and store the little-endian encoding of the result in the supplied array. The value is (this' + b') % 2^(8 * result.length), where this' and b' are the canonical integer values equivalent to this and b. | |
| asBigInteger | back to summary |
|---|---|
| public BigInteger asBigInteger() Implements sun. Doc from sun. Get the canonical value of this element as a BigInteger. This value will always be in the range [0, p), where p is the prime that defines the field. This method performs reduction and other computation to produce the result.
| |
| asByteArray | back to summary |
|---|---|
| public void asByteArray(byte[] result) Implements sun. Doc from sun. Places the little-endian encoding of this' % 2^(8 * result.length) into the supplied array, where this' is the canonical integer value equivalent to this. | |
| cloneLow | back to summary |
|---|---|
| protected long[] cloneLow(long[] limbs) | |
| copyLow | back to summary |
|---|---|
| protected void copyLow(long[] limbs, long[] out) | |
| getField | back to summary |
|---|---|
| public IntegerFieldModuloP getField() Implements sun. Doc from sun. Get the field associated with this element.
| |
| getLimbs | back to summary |
|---|---|
| public long[] getLimbs() Implements sun. Doc from sun. Break encapsulation, used for IntrinsicCandidate functions | |
| multiply | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Multiply this field element with the supplied element and return the result.
| |
| mutable | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Return this value as a mutable element. This method will always copy the underlying representation.
| |
| setValue | back to summary |
|---|---|
| private void setValue(BigInteger v) | |
| square | back to summary |
|---|---|
| public IntegerPolynomial. Overrides default sun. Doc from sun. Calculate the square of this element and return the result. This method should be used instead of a.multiply(a) because implementations may include optimizations that only apply to squaring.
| |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public IntegerPolynomial. | fixed()
Implements sun. Return this value as a fixed (immutable) element. |
| ImmutableElement | back to summary |
|---|---|
| protected ImmutableElement(BigInteger v) | |
| ImmutableElement | back to summary |
|---|---|
| protected ImmutableElement(boolean v) | |
| ImmutableElement | back to summary |
|---|---|
| protected ImmutableElement(long[] limbs, int numAdds) | |
| fixed | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Return this value as a fixed (immutable) element. This method will copy the underlying representation if the object is mutable.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| value | back to summary |
|---|---|
| pack-priv int value | |
| Limb | back to summary |
|---|---|
| pack-priv Limb(int value) | |
| Access | Constructor and Description |
|---|---|
| protected |
| MutableElement | back to summary |
|---|---|
| protected MutableElement(long[] limbs, int numAdds) | |
| conditionalSet | back to summary |
|---|---|
| public void conditionalSet(IntegerModuloP b, int set) Implements sun. Doc from sun. Set this value to the value of b when set has the value 1. No change is made to this element when set has the value 0. The result is undefined when set has a value other than 0 or 1. The set parameter is an int (rather than boolean) to allow the implementation to perform the assignment using branch-free integer arithmetic.
| |
| conditionalSwapWith | back to summary |
|---|---|
| public void conditionalSwapWith(MutableIntegerModuloP b, int swap) Implements sun. Doc from sun. Swap the value of this with the value of b when swap has the value 1. No change is made to either element when swap has the value 0. The result is undefined when swap has a value other than 0 or 1. The swap parameter is an int (rather than boolean) to allow the implementation to perform the swap using branch-free integer arithmetic.
| |
| fixed | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Return this value as a fixed (immutable) element. This method will copy the underlying representation if the object is mutable.
| |
| setAdditiveInverse | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Set the value of this element equal to 0 - this.
| |
| setDifference | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Set the value of this element equal to this - b. The argument is not modified.
| |
| setProduct | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Set the value of this element equal to this * b. The argument is not modified.
| |
| setProduct | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Set the value of this element equal to this * v. The argument is not modified.
| |
| setSquare | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Set the value of this element equal to this * this.
| |
| setSum | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Set the value of this element equal to this + b. The argument is not modified.
| |
| setValue | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Set the value of this element equal to the value of the supplied element. The argument is not modified.
| |
| setValue | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Set the value equal to the little-endian unsigned integer stored at the specified position in an array. The range of accepted values is implementation-specific. This method also takes a byte which is interpreted as an additional high-order byte of the number.
| |
| setValue | back to summary |
|---|---|
| public IntegerPolynomial. Implements sun. Doc from sun. Set the value equal to the little-endian unsigned integer stored in a buffer. The range of accepted values is implementation-specific. This method also takes a byte which is interpreted as an additional high-order byte of the number.
| |