ModInv_BN
ModInv_BN
Computes multiplicative inverse of a positive integer big number with respect to specified modulus.
Syntax
IppStatus ippsModInv_BN(IppsBigNumState*
pA
, IppsBigNumState*
pM
, IppsBigNumState*
pInv
);
Include Files
ippcp.h
Parameters
- pA
- Pointer to the integer big number ofIppsBigNumState.
- pM
- Pointer to the modulus integer ofIppsBigNumState.
- pInv
- Pointer to the multiplicative inverse.
Description
The function uses the extended Euclidean algorithm to compute the multiplicative inverse of a given positive integer big number
pA
with respect to the modulus specified by another positive integer big number pM
, where gcd
(
pA
,
pM
) = 1
. The following pseudocode represents this function:
compute
pInv
such that pInv
*
pA
= 1
mod
pM
.Return Values
- ippStsNoErr
- Indicates no error. Any other value indicates an error or warning.
- ippStsBadArgErr
- Indicates an error condition ifpAis less than or equal to 0.
- ippStsNullPtrErr
- Indicates an error condition if any of the specified pointers isNULL.
- ippStsBadModulusErr
- Indicates an error condition if the moduluspAis greater thanpM, orgcd (pA,pM)is greater than 1, orpMis less than or equal to 0.
- ippStsOutOfRangeErr
- Indicates an error condition ifIppsBigNumState *pInvis smaller than the length ofIppsBigNumState *pM.
- ippStsContextMatchErr
- Indicates an error condition if any of the context parameters does not match the operation.
- ippStsScaleRangeErr
- Indicates an error condition ifpAis greater than or equal topM
The size of
IppsBigNumState *
pInv
should not be less than the length of IppsBigNumState *
pM
.