MontMul
MontMul
Computes Montgomery modular multiplication for positive integer big numbers of Montgomery form.
Syntax
IppStatus ippsMontMul(const IppsBigNumState *
pA
, const IppsBigNumState *
pB
, IppsMontState *
m
, IppsBigNumState *
pR
);
Include Files
ippcp.h
Parameters
- 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.
Description
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
-1
mod m
.Return Values
- ippStsNoErr
- Indicates no error. Any other value indicates an error or warning.
- ippStsBadArgErr
- Indicates an error condition ifpAorpBis a negative integer.
- ippStsNullPtrErr
- Indicates an error condition if any of the specified pointers isNULL.
- ippStsScaleRangeErr
- Indicates an error condition ifpAorpBis more thanm.
- ippStsOutOfRangeErr
- Indicates an error condition ifIppsBigNumState*pRis larger thanIppsMontState*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
.