crypto_mod_exp() function
crypto_mod_exp - Modular exponentiation of large integers @base: Base integer (big endian byte array) @base_len: Length of base integer in bytes @power: Power integer (big endian byte array) @power_len: Length of power integer in bytes @modulus: Modulus integer (big endian byte array) @modulus_len: Length of modulus integer in bytes @result: Buffer for the result @result_len: Result length (max buffer size on input, real len on output) Returns: 0 on success, -1 on failure This function calculates result = base ^ power mod modulus. modules_len is used as the maximum size of modulus buffer. It is set to the used size on success. This function is only used with internal TLSv1 implementation (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need to implement this.
Syntax
int __must_check crypto_mod_exp(const u8 *base,
size_t base_len,
const u8 *power,
size_t power_len,
const u8 *modulus,
size_t modulus_len,
u8 *result,
size_t *result_len);
![]()
int crypto_mod_exp(const uint8_t *base, size_t base_len,
crypto_mod_exp() is called by 4 functions and calls 5 functions:
![]()
crypto_mod_exp()