APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.util.math.intpoly

public final Class IntegerPolynomial1305

extends IntegerPolynomial
Class Inheritance
Imports
java.lang.invoke.MethodHandles, .VarHandle, java.math.BigInteger, java.nio.*

An IntegerFieldModuloP designed for use with the Poly1305 authenticator. The representation uses 5 signed long values.

Field Summary

Modifier and TypeField and Description
private static final VarHandle
private static final int
private static final BigInteger
protected static final int
public static final IntegerPolynomial1305
private static final int
protected static final int
Inherited from sun.security.util.math.intpoly.IntegerPolynomial:
bitsPerLimbnumLimbsTWO

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
carryReduce(long[] r, long c0, long c1, long c2, long c3, long c4, long c5, long c6, long c7, long c8)

protected long
protected void
encode(ByteBuffer buf, int length, byte highByte, long[] result)

Overrides sun.security.util.math.intpoly.IntegerPolynomial.encode.

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
encode(long high, long low, byte highByte, long[] result)

protected void
encode(byte[] v, int offset, int length, byte highByte, long[] result)

Overrides sun.security.util.math.intpoly.IntegerPolynomial.encode.

protected void
finalCarryReduceLast(long[] limbs)

Implements abstract sun.security.util.math.intpoly.IntegerPolynomial.finalCarryReduceLast.

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 final void
modReduce(long[] limbs, int start, int end)

protected void
modReduce(long[] limbs)

protected void
mult(long[] a, long[] b, long[] r)

Implements abstract sun.security.util.math.intpoly.IntegerPolynomial.mult.

Multiply two IntegerPolynomial representations (a and b) and store the result in an IntegerPolynomial representation (r).

protected void
protected void
reduce(long[] limbs)

Implements abstract sun.security.util.math.intpoly.IntegerPolynomial.reduce.

Reduce an IntegerPolynomial representation (a) and store the result in a.

protected void
reduceIn(long[] limbs, long x, int index)

Implements abstract sun.security.util.math.intpoly.IntegerPolynomial.reduceIn.

protected void
square(long[] a, long[] r)

Implements abstract sun.security.util.math.intpoly.IntegerPolynomial.square.

Multiply an IntegerPolynomial representation (a) with itself and store the result in an IntegerPolynomialRepresentation (r).

Inherited from sun.security.util.math.intpoly.IntegerPolynomial:
addLimbsaddLimbsModPowerTwocarrycarrycarryOutconditionalAssignconditionalSwapdecodeencodeSmallevaluatefinalReduceget0get1getElementgetElementgetMaxAddsgetNumLimbsgetSizegetSmallValuelimbsToByteArraymultByIntsetLimbsValuePositive

Field Detail

AS_LONG_LEback to summary
private static final VarHandle AS_LONG_LE
BITS_PER_LIMBback to summary
private static final int BITS_PER_LIMB
MODULUSback to summary
private static final BigInteger MODULUS
NUM_LIMBSback to summary
protected static final int NUM_LIMBS
ONEback to summary
public static final IntegerPolynomial1305 ONE
POWERback to summary
private static final int POWER
SUBTRAHENDback to summary
protected static final int SUBTRAHEND

Constructor Detail

IntegerPolynomial1305back to summary
private IntegerPolynomial1305()

Method Detail

carryReduceback to summary
private void carryReduce(long[] r, long c0, long c1, long c2, long c3, long c4, long c5, long c6, long c7, long c8)
carryValueback to summary
protected long carryValue(long x)

Overrides sun.security.util.math.intpoly.IntegerPolynomial.carryValue.

Annotations
@Override
encodeback to summary
protected void encode(ByteBuffer buf, int length, byte highByte, long[] result)

Overrides sun.security.util.math.intpoly.IntegerPolynomial.encode.

Doc from sun.security.util.math.intpoly.IntegerPolynomial.encode.

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.

Annotations
@Override
encodeback to summary
protected void encode(long high, long low, byte highByte, long[] result)
encodeback to summary
protected void encode(byte[] v, int offset, int length, byte highByte, long[] result)

Overrides sun.security.util.math.intpoly.IntegerPolynomial.encode.

finalCarryReduceLastback to summary
protected void finalCarryReduceLast(long[] limbs)

Implements abstract sun.security.util.math.intpoly.IntegerPolynomial.finalCarryReduceLast.

Doc from sun.security.util.math.intpoly.IntegerPolynomial.finalCarryReduceLast.

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.

Annotations
@Override
modReduceback to summary
protected final void modReduce(long[] limbs, int start, int end)
modReduceback to summary
protected void modReduce(long[] limbs)
multback to summary
protected void mult(long[] a, long[] b, long[] r)

Implements abstract sun.security.util.math.intpoly.IntegerPolynomial.mult.

Doc from sun.security.util.math.intpoly.IntegerPolynomial.mult.

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.

postEncodeCarryback to summary
protected void postEncodeCarry(long[] v)

Overrides sun.security.util.math.intpoly.IntegerPolynomial.postEncodeCarry.

Annotations
@Override
reduceback to summary
protected void reduce(long[] limbs)

Implements abstract sun.security.util.math.intpoly.IntegerPolynomial.reduce.

Doc from sun.security.util.math.intpoly.IntegerPolynomial.reduce.

Reduce an IntegerPolynomial representation (a) and store the result in a. Requires that a.length == numLimbs.

Annotations
@Override
reduceInback to summary
protected void reduceIn(long[] limbs, long x, int index)

Implements abstract sun.security.util.math.intpoly.IntegerPolynomial.reduceIn.

Annotations
@Override
squareback to summary
protected void square(long[] a, long[] r)

Implements abstract sun.security.util.math.intpoly.IntegerPolynomial.square.

Doc from sun.security.util.math.intpoly.IntegerPolynomial.square.

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.

Annotations
@Override