BigInteger32ArithmeticInterface

Interface defining big integer operations

Created by Ugljesa Jovanovic ugljesa.jovanovic@ionspin.com on 10-Mar-2019

Properties

Link copied to clipboard
abstract val _emitIntArray: IntArray
Link copied to clipboard
abstract val basePowerOfTwo: Int
Link copied to clipboard
abstract val ONE: UIntArray
Link copied to clipboard
abstract val TEN: UIntArray
Link copied to clipboard
abstract val TWO: UIntArray
Link copied to clipboard
abstract val ZERO: UIntArray

Functions

Link copied to clipboard
abstract fun add(first: UIntArray, second: UIntArray): UIntArray

Adds two big integers

Link copied to clipboard
abstract fun and(operand: UIntArray, mask: UIntArray): UIntArray
Link copied to clipboard
abstract fun bitAt(operand: UIntArray, position: Long): Boolean
Link copied to clipboard
abstract fun bitLength(value: UIntArray): Int

Number of bits needed to represent this number

Link copied to clipboard
abstract fun compare(first: UIntArray, second: UIntArray): Int

Compares two numbers

Link copied to clipboard
abstract fun divide(first: UIntArray, second: UIntArray): Pair<UIntArray, UIntArray>

Divide two big integers

Link copied to clipboard
abstract fun fromByte(byte: Byte): UIntArray
Link copied to clipboard
abstract fun fromByteArray(source: ByteArray): Pair<UIntArray, Sign>
Link copied to clipboard
abstract fun fromInt(int: Int): UIntArray
Link copied to clipboard
abstract fun fromLong(long: Long): UIntArray
Link copied to clipboard
abstract fun fromShort(short: Short): UIntArray
Link copied to clipboard
abstract fun fromUByte(uByte: UByte): UIntArray
Link copied to clipboard
abstract fun fromUByteArray(source: UByteArray): Pair<UIntArray, Sign>
Link copied to clipboard
abstract fun fromUInt(uInt: UInt): UIntArray
Link copied to clipboard
abstract fun fromULong(uLong: ULong): UIntArray
Link copied to clipboard
abstract fun fromUShort(uShort: UShort): UIntArray
Link copied to clipboard
abstract fun gcd(first: UIntArray, second: UIntArray): UIntArray
Link copied to clipboard
abstract fun multiply(first: UIntArray, second: UIntArray): UIntArray

Multiplies two big integers

Link copied to clipboard
abstract fun not(operand: UIntArray): UIntArray
Link copied to clipboard
abstract fun numberOfDecimalDigits(operand: UIntArray): Long
Link copied to clipboard
abstract fun numberOfLeadingZerosInAWord(value: UInt): Int

Returns the number of leading zeros in a word

Link copied to clipboard
abstract fun or(operand: UIntArray, mask: UIntArray): UIntArray
Link copied to clipboard
abstract fun parseForBase(number: String, base: Int): UIntArray

Parse a string in a specific base into a big integer

Link copied to clipboard
abstract fun pow(base: UIntArray, exponent: Long): UIntArray

Exponentiation function

Link copied to clipboard
abstract fun reciprocal(operand: UIntArray): Pair<UIntArray, UIntArray>

Returns a integer reciprocal of this number such that 0 <= base ^ word - operand * reciprocal <= operand, and remainder such that 0 < reciprocal < operand

Link copied to clipboard
abstract fun setBitAt(operand: UIntArray, position: Long, bit: Boolean): UIntArray
Link copied to clipboard
abstract fun shiftLeft(operand: UIntArray, places: Int): UIntArray

Arithmetic shift left. Shifts the number to the left, by required places of bits, creating new words if necessary

Link copied to clipboard
abstract fun shiftRight(operand: UIntArray, places: Int): UIntArray

Arithmetic shift right. Shifts the number to the right, by required places of bits, removing words that no longer relevant

Link copied to clipboard
abstract fun sqrt(operand: UIntArray): Pair<UIntArray, UIntArray>
Link copied to clipboard
abstract fun subtract(first: UIntArray, second: UIntArray): UIntArray

Subtracts two big integers

Link copied to clipboard
abstract fun toByteArray(operand: UIntArray): ByteArray
Link copied to clipboard
abstract fun toString(operand: UIntArray, base: Int): String

return a string representation of big integer in a specific number base

Link copied to clipboard
abstract fun toUByteArray(operand: UIntArray): UByteArray
Link copied to clipboard
abstract fun toUIntArrayRepresentedAsTypedUByteArray(operand: UIntArray, endianness: Endianness = Endianness.BIG): Array<UByte>

Converts an UIntArray into a byte array representation, with consideration to requested endianness

Link copied to clipboard
abstract fun toUIntArrayRepresentedAsUByteArray(operand: UIntArray, endianness: Endianness = Endianness.BIG): UByteArray

Converts an UIntArray into a byte array representation, with consideration to requested endianness

Link copied to clipboard
abstract fun trailingZeroBits(value: UIntArray): Int

Number of consecutive zeros count from the right in binary representation

Link copied to clipboard
abstract fun xor(operand: UIntArray, mask: UIntArray): UIntArray