bn.h 811 B

12345678910111213141516171819202122232425262728
  1. /*!
  2. \ingroup openSSL
  3. \brief This function performs the following math “r = (a^p) % m”.
  4. \return SSL_SUCCESS On successfully performing math operation.
  5. \return SSL_FAILURE If an error case was encountered.
  6. \param r structure to hold result.
  7. \param a value to be raised by a power.
  8. \param p power to raise a by.
  9. \param m modulus to use.
  10. \param ctx currently not used with wolfSSL can be NULL.
  11. _Example_
  12. \code
  13. WOLFSSL_BIGNUM r,a,p,m;
  14. int ret;
  15. // set big number values
  16. ret = wolfSSL_BN_mod_exp(r, a, p, m, NULL);
  17. // check ret value
  18. \endcode
  19. \sa wolfSSL_BN_new
  20. \sa wolfSSL_BN_free
  21. */
  22. int wolfSSL_BN_mod_exp(WOLFSSL_BIGNUM *r, const WOLFSSL_BIGNUM *a,
  23. const WOLFSSL_BIGNUM *p, const WOLFSSL_BIGNUM *m, WOLFSSL_BN_CTX *ctx);