Developer Reference for Intel® Integrated Performance Primitives Cryptography 2018

Div_BN

Divides one integer big number by another.

Syntax

IppStatus ippsDiv_BN(IppsBigNumState *a, IppsBigNumState *b, IppsBigNumState * q, IppsBigNumState *r);

Include Files

ippcp.h

Parameters

a

Dividend of IppsBigNumState.

b

Divisor of IppsBigNumState.

q

Quotient of IppsBigNumState.

r

Remainder of IppsBigNumState.

Description

The function divides an integer big number dividend by another integer big number regardless of their signs and sizes and returns the quotient of the division and the respective remainder.

The following pseudocode represents this function:

qa/b

ra - b*q .

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or warning.

ippStsNullPtrErr

Indicates an error condition if any of the specified pointers is NULL.

ippStsOutOfRangeErr

Indicates an error condition if IppsBigNumState*r is smaller than the length of IppsBigNumState*b or when the size of IppsBigNumState *q is smaller than the quotient result data length.

ippStsDivByZeroErr

Indicates an error condition if the zero divisor is attempted.

Note

The size of IppsBigNumState *q should not be less than (lengthof *a) - (length of *b) + 1, and the size of IppsBigNumState *rshould be no less than the length of IppsBigNumState *b.