wpa_supplicant / hostapd
2.5
|
Crypto wrapper for internal crypto implementation - modexp. More...
Functions | |
int | 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) |
Modular exponentiation of large integers. More... | |
Crypto wrapper for internal crypto implementation - modexp.
int 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 | ||
) |
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) |
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.