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

Developer

API Reference

IRSA_INIT()

Brew Release
Brew MP 1.0.2
See Also
Error Codes IRSA
Description
Initialize with key for RSA or modular exponentiation operation. Key consists of a modulus and an exponent input as byte arrays. The byte array is the binary representation of the modulus/exponent with most significant byte being the 0th byte.
Params
pIRSA
[]:
Pointer to IRSA interface object.
pchModulus
[]:
[in] Pointer to modulus.
cbModulus
[]:
[in] Modulus size in bytes.
pchExponent
[]:
[in] Pointer to public or private exponent.
chExponent
[]:
[in] Public or Private exponent size in bytes.
Interface
Prototype
  •    int IRSA_Init
       (
          IRSA* pIRSA, 
          const byte* pchModulus, 
          int cbModulus,
          const byte* pchExponent, 
          int cbExponent
       );
    
Return
  • AEE_SUCCESS: RSA key initialization was successful. AEE_CRYPT_INVALID_KEY: key NULL or zero length AEE_ENOMEMORY: storage for the key could not be allocated
Side Effect
  • None
Comments
Call this function before calling other functions that perform cryptographic operations. If the key size is too large for an operation, the error will be returned when the operation is attempted, not here. The arguments are copies and must only persist for the duration of the call to IRSA_Init. A chunk of memory is allocated to store the key and the anticipated result.