mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-01 14:34:31 +00:00
wpa_supplicant: Replace internal RSA APIs by mbedtls APIs
Curretly wpa_supplicant uses internal APIs for RSA operations which internally uses lots of big num operations. Big num operations are CPU expensive and can take a lot of time which can cause watchdog timer to tigger. This can be optimize by using mbedtls APIs which uses hardware blocks for big num operations. To fix this, write new crypto_mbedtls-rsa.c which has APIs similar to crypto_internal-rsa.c but uses mbedtls APIs.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "tls/pkcs1.h"
|
||||
#include "tls/pkcs8.h"
|
||||
|
||||
#ifndef USE_MBEDTLS_CRYPTO
|
||||
/* Dummy structures; these are just typecast to struct crypto_rsa_key */
|
||||
struct crypto_public_key;
|
||||
struct crypto_private_key;
|
||||
@@ -28,7 +29,6 @@ struct crypto_public_key * crypto_public_key_import(const u8 *key, size_t len)
|
||||
crypto_rsa_import_public_key(key, len);
|
||||
}
|
||||
|
||||
|
||||
struct crypto_private_key * crypto_private_key_import(const u8 *key,
|
||||
size_t len,
|
||||
const char *passwd)
|
||||
@@ -109,3 +109,4 @@ int crypto_public_key_decrypt_pkcs1(struct crypto_public_key *key,
|
||||
return pkcs1_decrypt_public_key((struct crypto_rsa_key *) key,
|
||||
crypt, crypt_len, plain, plain_len);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user