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);

Parameters

n

Input big number modulus.

length

The length of the modulus.

m

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

Description

This function is declared in the ippcp.h file. 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.

Submit feedback on this help topic

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