Class BigIntUtils
java.lang.Object
org.bouncycastle.pqc.legacy.math.linearalgebra.BigIntUtils
FIXME: is this really necessary?!
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
equals
(BigInteger[] a, BigInteger[] b) Checks if two BigInteger arrays contain the same entriesstatic void
fill
(BigInteger[] array, BigInteger value) Fill the given BigInteger array with the given value.static BigInteger[]
subArray
(BigInteger[] input, int start, int end) Generates a subarray of a given BigInteger array.static int[]
toIntArray
(BigInteger[] input) Converts a BigInteger array into an integer arraystatic int[]
toIntArrayModQ
(int q, BigInteger[] input) Converts a BigInteger array into an integer array, reducing all BigIntegers mod q.static byte[]
toMinimalByteArray
(BigInteger value) Return the value of big as a byte array.
-
Method Details
-
equals
Checks if two BigInteger arrays contain the same entries- Parameters:
a
- first BigInteger arrayb
- second BigInteger array- Returns:
- true or false
-
fill
Fill the given BigInteger array with the given value.- Parameters:
array
- the arrayvalue
- the value
-
subArray
Generates a subarray of a given BigInteger array.- Parameters:
input
- - the input BigInteger arraystart
- - the start indexend
- - the end index- Returns:
- a subarray of input, ranging from start to end
-
toIntArray
Converts a BigInteger array into an integer array- Parameters:
input
- - the BigInteger array- Returns:
- the integer array
-
toIntArrayModQ
Converts a BigInteger array into an integer array, reducing all BigIntegers mod q.- Parameters:
q
- - the modulusinput
- - the BigInteger array- Returns:
- the integer array
-
toMinimalByteArray
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
- the BigInteger value to be converted to a byte array- Returns:
- the value big as byte array
-