Big Number Arithmetic

This section describes primitives for performing arithmetic operations with integer big numbers of variable length.

The full list of functions for big number arithmetic is given in Table “Intel IPP Big Number Arithmetic Functions”.

Intel IPP Big Number Arithmetic Functions 
Function Base Name Operation
Unsigned Big Number Arithmetic Functions
Add_BNU Adds two unsigned integer big numbers of the same length.
Sub_BNU Subtracts one integer big number from another integer big number of the same length.
MulOne_BNU Multiplies unsigned integer big number by 32-bit unsigned integer.
MACOne_BNU_I Computes multiplication of unsigned integer big number by 32-bit integer and accumulates the result with another integer big number.
Mul_BNU4 Multiplies two unsigned integers of 4*32 bits.
Mul_BNU8 Multiplies two unsigned integers of 8*32 bits.
Div_64u32u Divides unsigned 64-bit integer by unsigned 32-bit integer.
Sqr_32u64u Computes the square of 32-bit words in the input array.
Sqr_BNU4 Computes the square of an unsigned integer big number of 4*32 bits.
Sqr_BNU8 Computes the square of an unsigned integer big number of 8*32 bits.
SetOctString_BNU Converts octet string into unsigned integer big number.
GetOctString_BNU Converts unsigned integer big number into octet string.
Signed Big Number Arithmetic Functions
BigNumGetSize Gets the size of the IppsBigNumState context.
BigNumInit Initializes context and partitions allocated buffer.
Set_BN Defines the sign and value of the context.
SetOctString_BN Converts octet string into a positive Big Number.
GetSize_BN Returns the maximum length of the integer big number the structure can store.
Get_BN Extracts the sign and value of the integer big number from the input structure.
ExtGet_BN Extracts the specified combination of the sign, data length, and value characteristics of the integer big number from the input structure.
Ref_BN Extracts the main characteristics of the integer big number from the input structure.
GetOctString_BN Converts a positive Big Number into octet String.
Cmp_BN Compares two Big Numbers.
CmpZero_BN Checks the value of the input data field.
Add_BN Adds two integer big numbers.
Sub_BN Subtracts one integer big number from another.
Mul_BN Multiplies two integer big numbers.
MAC_BN_I Multiplies two integer big numbers and accumulates the result with the third integer big number.
Div_BN Divides one integer big number by another.
Mod_BN Computes modular reduction for input integer big number with respect to specified modulus.
Gcd_BN Computes the greatest common divisor.
ModInv_BN Computes multiplicative inverse of a positive integer big number with respect to specified modulus.

The magnitude of an integer big number is specified by an array of unsigned integer data type Ipp32u rp [length] and corresponds to the mathematical value

This section uses the following definition for the sign of an integer big number:

typedef enum {
IppsBigNumNEG=0,
IppsBigNumPOS=1
} IppsBigNumSGN;

The functions described in this section use the context IppsBigNumState to serve as an operational vehicle that carries not only the sign and value of the data, but also a sufficient working buffer reserved for various arithmetic operations. The length of the context IppsBigNumState is defined as the length of the data carried by the structure and the size of the context IppsBigNumState is therefore defined as the maximal length of the data that this operational vehicle can carry.

Note iconNote

In all unsigned big number arithmetic functions described below, integers pointed to by a, b, and r are all of (n*32) bits.


Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.