I am playing with a minimal https server on an ESP01S, using
- With 2048bit RSA keys it takes ~5 seconds to serve a "hello" request.
- Using 256bit EC keys it takes ~2 seconds.
I wonder whether it is possible to make key exchange faster without giving up on reasonable security level.
I am struggling with trying to set
ec_all_m15 implementation (see Key Exchange) to make it faster without any luck - I have actually no idea how to do it properly .
I tried something like
... BearSSL::X509List *cert = new BearSSL::X509List(serverCert.c_str()); BearSSL::PrivateKey *key = new BearSSL::PrivateKey(serverKey.c_str()); server.setECCert(cert, BR_KEYTYPE_EC, key); server.begin(); br_ssl_server_context sc; br_ssl_server_init_full_ec(&sc, cert->getX509Certs(), 1, BR_KEYTYPE_EC, key->getEC()); br_ssl_engine_set_ec(&sc.eng, &br_ec_all_m15); br_ssl_server_reset(&sc);
Could someone help pls?