public abstract class IntegerPolynomial extends java.lang.Object implements IntegerFieldModuloP
| Modifier and Type | Class and Description |
|---|---|
protected class |
IntegerPolynomial.MutableElement |
| Modifier and Type | Field and Description |
|---|---|
protected int |
bitsPerLimb |
protected int |
numLimbs |
protected static java.math.BigInteger |
TWO |
| 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 |
carry(long[] limbs) |
protected void |
carry(long[] limbs,
int start,
int end) |
protected long |
carryOut(long[] limbs,
int index)
Carry out of the specified position and return the carry value.
|
protected long |
carryValue(long x) |
protected static void |
conditionalAssign(int set,
long[] a,
long[] b)
Branch-free conditional assignment of b to a.
|
protected static void |
conditionalSwap(int swap,
long[] a,
long[] b)
Branch-free conditional swap of a and b.
|
protected void |
decode(long[] v,
byte[] dst,
int offset,
int length)
Decode the value in v and store it in dst.
|
protected void |
encode(byte[] v,
int offset,
int length,
byte highByte,
long[] result) |
protected void |
encode(java.nio.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.
|
protected void |
encodeSmall(java.nio.ByteBuffer buf,
int length,
byte highByte,
long[] result) |
protected java.math.BigInteger |
evaluate(long[] limbs) |
protected abstract void |
finalCarryReduceLast(long[] limbs)
Carry out of the last limb and reduce back in.
|
protected void |
finalReduce(long[] limbs)
Convert reduced limbs into a number between 0 and MODULUS-1.
|
com.tencent.kona.sun.security.util.math.intpoly.IntegerPolynomial.ImmutableElement |
get0()
Get the additive identity element 0
|
com.tencent.kona.sun.security.util.math.intpoly.IntegerPolynomial.ImmutableElement |
get1()
Get the multiplicative identity element 1
|
com.tencent.kona.sun.security.util.math.intpoly.IntegerPolynomial.ImmutableElement |
getElement(java.math.BigInteger v)
Get the field element equivalent to the supplied BigInteger value.
|
com.tencent.kona.sun.security.util.math.intpoly.IntegerPolynomial.ImmutableElement |
getElement(byte[] v,
int offset,
int length,
byte highByte)
Get a field element from a little-endian unsigned integer stored at the
specified position in an array.
|
int |
getMaxAdds() |
protected int |
getNumLimbs() |
java.math.BigInteger |
getSize()
Get the size of the field as a BigInteger.
|
SmallValue |
getSmallValue(int value)
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 |
postEncodeCarry(long[] v) |
protected abstract void |
reduce(long[] a)
Reduce an IntegerPolynomial representation (a) and store the result
in a.
|
protected abstract void |
reduceIn(long[] c,
long v,
int i) |
protected void |
setLimbsValuePositive(java.math.BigInteger v,
long[] limbs) |
protected abstract void |
square(long[] a,
long[] r)
Multiply an IntegerPolynomial representation (a) with itself and store
the result in an IntegerPolynomialRepresentation (r).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetElementprotected static final java.math.BigInteger TWO
protected final int numLimbs
protected final int bitsPerLimb
protected abstract void reduce(long[] a)
protected void multByInt(long[] a,
long b)
protected abstract void mult(long[] a,
long[] b,
long[] r)
protected abstract void square(long[] a,
long[] r)
protected int getNumLimbs()
public int getMaxAdds()
public java.math.BigInteger getSize()
IntegerFieldModuloPgetSize in interface IntegerFieldModuloPpublic com.tencent.kona.sun.security.util.math.intpoly.IntegerPolynomial.ImmutableElement get0()
IntegerFieldModuloPget0 in interface IntegerFieldModuloPpublic com.tencent.kona.sun.security.util.math.intpoly.IntegerPolynomial.ImmutableElement get1()
IntegerFieldModuloPget1 in interface IntegerFieldModuloPpublic com.tencent.kona.sun.security.util.math.intpoly.IntegerPolynomial.ImmutableElement getElement(java.math.BigInteger v)
IntegerFieldModuloPgetElement in interface IntegerFieldModuloPv - a BigInteger valuepublic SmallValue getSmallValue(int value)
IntegerFieldModuloPgetSmallValue in interface IntegerFieldModuloPvalue - the small integer valueprotected abstract void reduceIn(long[] c,
long v,
int i)
protected void encode(java.nio.ByteBuffer buf,
int length,
byte highByte,
long[] result)
protected void encodeSmall(java.nio.ByteBuffer buf,
int length,
byte highByte,
long[] result)
protected void encode(byte[] v,
int offset,
int length,
byte highByte,
long[] result)
protected void postEncodeCarry(long[] v)
public com.tencent.kona.sun.security.util.math.intpoly.IntegerPolynomial.ImmutableElement getElement(byte[] v,
int offset,
int length,
byte highByte)
IntegerFieldModuloPgetElement in interface IntegerFieldModuloPv - an array containing a little-endian unsigned integeroffset - the starting position of the integerlength - the number of bytes to readhighByte - the high-order byte of the numberprotected java.math.BigInteger evaluate(long[] limbs)
protected long carryValue(long x)
protected void carry(long[] limbs,
int start,
int end)
protected void carry(long[] limbs)
protected long carryOut(long[] limbs,
int index)
protected void setLimbsValuePositive(java.math.BigInteger v,
long[] limbs)
protected abstract void finalCarryReduceLast(long[] limbs)
protected void finalReduce(long[] limbs)
protected void decode(long[] v,
byte[] dst,
int offset,
int length)
protected void addLimbs(long[] a,
long[] b,
long[] dst)
protected static void conditionalAssign(int set,
long[] a,
long[] b)
protected static void conditionalSwap(int swap,
long[] a,
long[] b)
protected void limbsToByteArray(long[] limbs,
byte[] result)
protected void addLimbsModPowerTwo(long[] limbs,
long[] other,
byte[] result)