struct optimization for mbedtls_ssl_transform

This commit is contained in:
Teppo Järvelin 2019-08-30 08:45:37 +03:00
parent d689a67af2
commit 22854511bb

View file

@ -705,6 +705,10 @@ typedef struct mbedtls_ssl_hs_buffer mbedtls_ssl_hs_buffer;
*/ */
struct mbedtls_ssl_transform struct mbedtls_ssl_transform
{ {
#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
uint8_t in_cid_len;
uint8_t out_cid_len;
#endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */
/* /*
* Session specific crypto layer * Session specific crypto layer
*/ */
@ -733,16 +737,11 @@ struct mbedtls_ssl_transform
#endif /* MBEDTLS_SSL_SOME_MODES_USE_MAC */ #endif /* MBEDTLS_SSL_SOME_MODES_USE_MAC */
mbedtls_cipher_context_t cipher_ctx_enc; /*!< encryption context */
mbedtls_cipher_context_t cipher_ctx_dec; /*!< decryption context */
#if !defined(MBEDTLS_SSL_CONF_FIXED_MINOR_VER) #if !defined(MBEDTLS_SSL_CONF_FIXED_MINOR_VER)
int minor_ver; int minor_ver;
#endif #endif
#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
uint8_t in_cid_len;
uint8_t out_cid_len;
unsigned char in_cid [ MBEDTLS_SSL_CID_OUT_LEN_MAX ]; unsigned char in_cid [ MBEDTLS_SSL_CID_OUT_LEN_MAX ];
unsigned char out_cid[ MBEDTLS_SSL_CID_OUT_LEN_MAX ]; unsigned char out_cid[ MBEDTLS_SSL_CID_OUT_LEN_MAX ];
#endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */ #endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */
@ -755,6 +754,9 @@ struct mbedtls_ssl_transform
z_stream ctx_inflate; /*!< decompression context */ z_stream ctx_inflate; /*!< decompression context */
#endif #endif
mbedtls_cipher_context_t cipher_ctx_enc; /*!< encryption context */
mbedtls_cipher_context_t cipher_ctx_dec; /*!< decryption context */
#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION) #if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION)
/* We need the Hello random bytes in order to re-derive keys from the /* We need the Hello random bytes in order to re-derive keys from the
* Master Secret and other session info, see ssl_populate_transform() */ * Master Secret and other session info, see ssl_populate_transform() */