diff --git a/src/network/crypto_mbedtls.hpp b/src/network/crypto_mbedtls.hpp index 2166282e0..774471190 100644 --- a/src/network/crypto_mbedtls.hpp +++ b/src/network/crypto_mbedtls.hpp @@ -114,6 +114,8 @@ public: assert(iv.size() == 12); std::copy_n(iv.begin(), 12, m_iv.begin()); m_packet_counter = 0; + mbedtls_gcm_init(&m_aes_encrypt_context); + mbedtls_gcm_init(&m_aes_decrypt_context); mbedtls_gcm_setkey(&m_aes_encrypt_context, MBEDTLS_CIPHER_ID_AES, key.data(), key.size() * 8); mbedtls_gcm_setkey(&m_aes_decrypt_context, MBEDTLS_CIPHER_ID_AES,