API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

IBN_MODEXP()

Brew Release
Brew MP 1.0.2
See Also
Error Codes IBN
Description
Computes the modular exponentiation of the IBN and updates itself with the result. I.e. pif = pif^Exp mod Modulus
Modulus must be odd (which is the case for most security related moduli). If the callback is null, the function is executed synchronously. The result is always provided in the pdwResult pointer.
This function SHOULD be used asynchronously because it can take a lot of time to complete depending on key size and if it is used synchronously then the application that uses this can get stuck for a while before it can respond.
Params
pif
[]:
The interface pointer.
cpiExp
[]:
Exponent IBN.
cpiModulus
[]:
Modulus IBN. int *
pCB
[]:
Callback to be called on completion.
Interface
Prototype
  • void IBN_ModExp(IBN *pif, const IBN *cpiExp, const IBN *cpiModulus,
                    int *pnResult, AEECallback *pCB);
    
Return
  • None

    When pCB is called at completion, *pnResult is

    AEE_SUCCESS: Success.
    AEE_ENOMEMORY: on lack of memory. AEE_EBADPARM: if modulus is not a odd number.
Side Effect
  • None
Comments
None