36 #if defined(LWS_WITH_MBEDTLS)
37 #include <mbedtls/aes.h>
38 #include <mbedtls/gcm.h>
53 enum enum_aes_operation {
58 enum enum_aes_padding {
60 LWS_GAESP_WITH_PADDING
65 #define LWS_AES_BLOCKSIZE 128
66 #define LWS_AES_CBC_BLOCKLEN 16
69 #if defined(LWS_WITH_MBEDTLS)
71 mbedtls_aes_context ctx;
72 #if defined(MBEDTLS_CIPHER_MODE_XTS)
73 mbedtls_aes_xts_context ctx_xts;
75 mbedtls_gcm_context ctx_gcm;
79 const EVP_CIPHER *cipher;
83 unsigned char tag[16];
85 enum enum_aes_operation op;
86 enum enum_aes_modes mode;
87 enum enum_aes_padding padding;
108 LWS_VISIBLE LWS_EXTERN
int
111 enum enum_aes_padding padding,
void *engine);
125 LWS_VISIBLE LWS_EXTERN
int
163 LWS_VISIBLE LWS_EXTERN
int
166 uint8_t *iv_or_nonce_ctr_or_data_unit_16,
167 uint8_t *stream_block_16,
168 size_t *nc_or_iv_off,
int taglen);
LWS_VISIBLE LWS_EXTERN int lws_genaes_crypt(struct lws_genaes_ctx *ctx, const uint8_t *in, size_t len, uint8_t *out, uint8_t *iv_or_nonce_ctr_or_data_unit_16, uint8_t *stream_block_16, size_t *nc_or_iv_off, int taglen)
LWS_VISIBLE LWS_EXTERN int lws_genaes_destroy(struct lws_genaes_ctx *ctx, unsigned char *tag, size_t tlen)
LWS_VISIBLE LWS_EXTERN int lws_genaes_create(struct lws_genaes_ctx *ctx, enum enum_aes_operation op, enum enum_aes_modes mode, struct lws_gencrypto_keyelem *el, enum enum_aes_padding padding, void *engine)
Definition: lws-genaes.h:68
Definition: lws-gencrypto.h:92