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

public Interface MutableIntegerModuloP

extends IntegerModuloP
Known Direct Implementers
sun.security.util.math.intpoly.IntegerPolynomial.MutableElement
Imports
java.nio.ByteBuffer

An interface for mutable integers modulo a prime value. This interface should be used to improve performance and avoid the allocation of a large number of temporary objects. Methods in this interface that modify the value also return the modified element. This structure enables fluent expressions like: a.setSum(b).setProduct(c).setDifference(d).setSquare()

Method Summary

Modifier and TypeMethod and Description
public void
conditionalSet(IntegerModuloP
the element to conditionally swap with
b
,
int
an int that determines whether to set
set
)

Set this value to the value of b when set has the value 1.

public void
conditionalSwapWith(MutableIntegerModuloP
the element to conditionally swap with
b
,
int
an int that determines whether to swap
swap
)

Swap the value of this with the value of b when swap has the value 1.

public MutableIntegerModuloP

Returns:

this
setAdditiveInverse
()

Set the value of this element equal to 0 - this.

public MutableIntegerModuloP

Returns:

this
setDifference
(IntegerModuloP
the subtrahend
b
)

Set the value of this element equal to this - b.

public MutableIntegerModuloP

Returns:

this
setProduct
(IntegerModuloP
the multiplicand
b
)

Set the value of this element equal to this * b.

public MutableIntegerModuloP

Returns:

this
setProduct
(SmallValue
the small multiplicand
v
)

Set the value of this element equal to this * v. The argument is not modified.

public MutableIntegerModuloP

Returns:

this
setSquare
()

Set the value of this element equal to this * this.

public MutableIntegerModuloP

Returns:

this
setSum
(IntegerModuloP
the sumand
b
)

Set the value of this element equal to this + b.

public MutableIntegerModuloP

Returns:

this
setValue
(IntegerModuloP
the element whose value should be copied to this
v
)

Set the value of this element equal to the value of the supplied element.

public MutableIntegerModuloP

Returns:

this
setValue
(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
)

Set the value equal to the little-endian unsigned integer stored at the specified position in an array.

public MutableIntegerModuloP

Returns:

this
setValue
(ByteBuffer
a buffer containing a little-endian unsigned integer
buf
,
int
the number of bytes to read
length
,
byte
the high-order byte of the number
highByte
)

Set the value equal to the little-endian unsigned integer stored in a buffer.

Inherited from sun.security.util.math.IntegerModuloP:
addadditiveInverseaddModPowerTwoaddModPowerTwoasBigIntegerasByteArrayasByteArrayfixedgetFieldgetLimbsmultiplicativeInversemultiplymutablepowsquaresubtract

Method Detail

conditionalSetback to summary
public void conditionalSet(IntegerModuloP b, int set)

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.

Parameters
b:IntegerModuloP

the element to conditionally swap with

set:int

an int that determines whether to set

conditionalSwapWithback to summary
public void conditionalSwapWith(MutableIntegerModuloP b, int swap)

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.

Parameters
b:MutableIntegerModuloP

the element to conditionally swap with

swap:int

an int that determines whether to swap

setAdditiveInverseback to summary
public MutableIntegerModuloP setAdditiveInverse()

Set the value of this element equal to 0 - this.

Returns:MutableIntegerModuloP

this

setDifferenceback to summary
public MutableIntegerModuloP setDifference(IntegerModuloP b)

Set the value of this element equal to this - b. The argument is not modified.

Parameters
b:IntegerModuloP

the subtrahend

Returns:MutableIntegerModuloP

this

setProductback to summary
public MutableIntegerModuloP setProduct(IntegerModuloP b)

Set the value of this element equal to this * b. The argument is not modified.

Parameters
b:IntegerModuloP

the multiplicand

Returns:MutableIntegerModuloP

this

setProductback to summary
public MutableIntegerModuloP setProduct(SmallValue v)

Set the value of this element equal to this * v. The argument is not modified.

Parameters
v:SmallValue

the small multiplicand

Returns:MutableIntegerModuloP

this

setSquareback to summary
public MutableIntegerModuloP setSquare()

Set the value of this element equal to this * this.

Returns:MutableIntegerModuloP

this

setSumback to summary
public MutableIntegerModuloP setSum(IntegerModuloP b)

Set the value of this element equal to this + b. The argument is not modified.

Parameters
b:IntegerModuloP

the sumand

Returns:MutableIntegerModuloP

this

setValueback to summary
public MutableIntegerModuloP setValue(IntegerModuloP v)

Set the value of this element equal to the value of the supplied element. The argument is not modified.

Parameters
v:IntegerModuloP

the element whose value should be copied to this

Returns:MutableIntegerModuloP

this

setValueback to summary
public MutableIntegerModuloP setValue(byte[] v, int offset, int length, byte highByte)

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.

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:MutableIntegerModuloP

this

setValueback to summary
public MutableIntegerModuloP setValue(ByteBuffer buf, int length, byte highByte)

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.

Parameters
buf:ByteBuffer

a buffer containing a little-endian unsigned integer

length:int

the number of bytes to read

highByte:byte

the high-order byte of the number

Returns:MutableIntegerModuloP

this