Developer Reference for Intel® Integrated Performance Primitives Cryptography 2018

MontSet

Sets the input integer big number to a value and computes the Montgomery reduction index.

Syntax

IppStatus ippsMontSet(const Ipp32u *n, int length, IppsMontState *m);

Include Files

ippcp.h

Parameters

n

Input big number modulus.

length

The length of the modulus in Ipp32u chunks.

m

Pointer to the context IppsMontState capturing the modulus and the least significant word of the multiplicative inverse Ni.

Description

The function sets the input positive integer big number n to be the modulus for the context IppsMontState *m, computes the Montgomery reduction index k with respect to the input big number modulus n and the least significant 32-bit word of the multiplicative inverse Ni with respect to the modulus R, that satisfies R*R-1- n *Ni = 1.

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.

ippStsBadModulusErr

Indicates an error condition if the modulus is not a positive odd integer.

ippStsLengthErr

Indicates an error condition if length is less than or equal to 0.

ippStsOutOfRangeErr

Indicates an error condition if length is larger than IppsMontState*m.