Top Description Constructors Methods
org.bouncycastle.pqc.legacy.math.linearalgebra

public final Class BigIntUtils

extends Object
Class Inheritance
Imports
java.math.BigInteger

FIXME: is this really necessary?!

Constructor Summary

AccessConstructor and Description
private
BigIntUtils()

Default constructor (private).

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true or false
equals
(BigInteger[]
first BigInteger array
a
,
BigInteger[]
second BigInteger array
b
)

Checks if two BigInteger arrays contain the same entries

public static void
fill(BigInteger[]
the array
array
,
BigInteger
the value
value
)

Fill the given BigInteger array with the given value.

public static BigInteger[]

Returns:

a subarray of input, ranging from start to end
subArray
(BigInteger[]
- the input BigInteger array
input
,
int
- the start index
start
,
int
- the end index
end
)

Generates a subarray of a given BigInteger array.

public static int[]

Returns:

the integer array
toIntArray
(BigInteger[]
- the BigInteger array
input
)

Converts a BigInteger array into an integer array

public static int[]

Returns:

the integer array
toIntArrayModQ
(int
- the modulus
q
,
BigInteger[]
- the BigInteger array
input
)

Converts a BigInteger array into an integer array, reducing all BigIntegers mod q.

public static byte[]

Returns:

the value big as byte array
toMinimalByteArray
(BigInteger
the BigInteger value to be converted to a byte array
value
)

Return the value of big as a byte array.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BigIntUtilsback to summary
private BigIntUtils()

Default constructor (private).

Method Detail

equalsback to summary
public static boolean equals(BigInteger[] a, BigInteger[] b)

Checks if two BigInteger arrays contain the same entries

Parameters
a:BigInteger[]

first BigInteger array

b:BigInteger[]

second BigInteger array

Returns:boolean

true or false

fillback to summary
public static void fill(BigInteger[] array, BigInteger value)

Fill the given BigInteger array with the given value.

Parameters
array:BigInteger[]

the array

value:BigInteger

the value

subArrayback to summary
public static BigInteger[] subArray(BigInteger[] input, int start, int end)

Generates a subarray of a given BigInteger array.

Parameters
input:BigInteger[]

- the input BigInteger array

start:int

- the start index

end:int

- the end index

Returns:BigInteger[]

a subarray of input, ranging from start to end

toIntArrayback to summary
public static int[] toIntArray(BigInteger[] input)

Converts a BigInteger array into an integer array

Parameters
input:BigInteger[]

- the BigInteger array

Returns:int[]

the integer array

toIntArrayModQback to summary
public static int[] toIntArrayModQ(int q, BigInteger[] input)

Converts a BigInteger array into an integer array, reducing all BigIntegers mod q.

Parameters
q:int

- the modulus

input:BigInteger[]

- the BigInteger array

Returns:int[]

the integer array

toMinimalByteArrayback to summary
public static byte[] toMinimalByteArray(BigInteger value)

Return the value of big as a byte array. Although BigInteger has such a method, it uses an extra bit to indicate the sign of the number. For elliptic curve cryptography, the numbers usually are positive. Thus, this helper method returns a byte array of minimal length, ignoring the sign of the number.

Parameters
value:BigInteger

the BigInteger value to be converted to a byte array

Returns:byte[]

the value big as byte array