APIdia Launch Partner
Top Description Methods
sun.security.util.math

public Interface IntegerFieldModuloP

Known Direct Subinterfaces
sun.security.util.math.IntegerMontgomeryFieldModuloP
Known Direct Implementers
sun.security.util.math.intpoly.IntegerPolynomial
Imports
java.math.BigInteger

An interface for the field of integers modulo a prime number. An implementation of this interface can be used to get properties of the field and to produce field elements of type ImmutableIntegerModuloP from other objects and representations of field elements.

Method Summary

Modifier and TypeMethod and Description
public ImmutableIntegerModuloP

Returns:

the additive identity element
get0
()

Get the additive identity element 0

public ImmutableIntegerModuloP

Returns:

the multiplicative identity element
get1
()

Get the multiplicative identity element 1

public ImmutableIntegerModuloP

Returns:

the field element corresponding to v
getElement
(BigInteger
a BigInteger value
v
)

Get the field element equivalent to the supplied BigInteger value.

public default ImmutableIntegerModuloP

Returns:

the field element corresponding to v
getElement
(byte[]
an array containing a little-endian unsigned integer
v
)

Get a field element from a little-endian unsigned integer stored in an array.

public ImmutableIntegerModuloP

Returns:

the field element corresponding to the bytes at the specified position
getElement
(byte[]
an array containing a little-endian unsigned integer
v
,
int
the starting position of the integer
offset
,
int
the number of bytes to read
length
,
byte
the high-order byte of the number
highByte
)

Get a field element from a little-endian unsigned integer stored at the specified position in an array.

public BigInteger

Returns:

the size of the field.
getSize
()

Get the size of the field as a BigInteger.

public SmallValue
getSmallValue(int
the small integer value
v
)

Get a "small" value according to this implementation.

Method Detail

get0back to summary
public ImmutableIntegerModuloP get0()

Get the additive identity element 0

Returns:ImmutableIntegerModuloP

the additive identity element

get1back to summary
public ImmutableIntegerModuloP get1()

Get the multiplicative identity element 1

Returns:ImmutableIntegerModuloP

the multiplicative identity element

getElementback to summary
public ImmutableIntegerModuloP getElement(BigInteger v)

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.

Parameters
v:BigInteger

a BigInteger value

Returns:ImmutableIntegerModuloP

the field element corresponding to v

getElementback to summary
public default ImmutableIntegerModuloP getElement(byte[] v)

Get a field element from a little-endian unsigned integer stored in an array. The entire array will be used, and the supplied value may be larger than the modulus that defines the field. The array will not be modified.

Parameters
v:byte[]

an array containing a little-endian unsigned integer

Returns:ImmutableIntegerModuloP

the field element corresponding to v

getElementback to summary
public ImmutableIntegerModuloP 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. 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.

Parameters
v:byte[]

an array containing a little-endian unsigned integer

offset:int

the starting position of the integer

length:int

the number of bytes to read

highByte:byte

the high-order byte of the number

Returns:ImmutableIntegerModuloP

the field element corresponding to the bytes at the specified position

getSizeback to summary
public BigInteger getSize()

Get the size of the field as a BigInteger. This size is equal to the prime modulus used to construct the field.

Returns:BigInteger

the size of the field.

getSmallValueback to summary
public SmallValue getSmallValue(int v)

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.

Parameters
v:int

the small integer value

Exceptions
IllegalArgumentException:
when the value is not small