Developer Reference for Intel® Integrated Performance Primitives Cryptography
Computes Montgomery modular multiplication for positive integer big numbers of Montgomery form.
IppStatus ippsMontMul(const IppsBigNumState *pA, const IppsBigNumState *pB, IppsMontState *m, IppsBigNumState *pR);
ippcp.h
pA |
Pointer to the multiplicand within the range [0, m- 1]. |
pB |
Pointer to the multiplier within the range [0, m- 1]. |
m |
Modulus. |
pR |
Pointer to the montgomery multiplication result. |
The function computes the Montgomery modular multiplication for positive integer big numbers of Montgomery form with respect to the modulus IppsMontState *m. As a result, IppsBigNumState *pR holds the product.
The following pseudocode represents this function:
pR←pA*pB*R-1mod m.
ippStsNoErr |
Indicates no error. Any other value indicates an error or warning. |
ippStsBadArgErr |
Indicates an error condition if pA or pB is a negative integer. |
ippStsNullPtrErr |
Indicates an error condition if any of the specified pointers is NULL. |
ippStsScaleRangeErr |
Indicates an error condition if pA or pB is more than m. |
ippStsOutOfRangeErr |
Indicates an error condition if IppsBigNumState *pRis larger than IppsMontState *m. |
ippStsContextMatchErr |
Indicates an error condition if any of the context parameters does not match the operation. |
The size of IppsBigNumState *pR should not be less than the data length of the modulus m.