35 #if defined(LWS_WITH_MBEDTLS)
36 #include <mbedtls/aes.h>
37 #include <mbedtls/gcm.h>
52 enum enum_aes_operation {
57 enum enum_aes_padding {
59 LWS_GAESP_WITH_PADDING
64 #define LWS_AES_BLOCKSIZE 128
67 #if defined(LWS_WITH_MBEDTLS)
69 mbedtls_aes_context ctx;
70 #if defined(MBEDTLS_CIPHER_MODE_XTS)
71 mbedtls_aes_xts_context ctx_xts;
73 mbedtls_gcm_context ctx_gcm;
77 const EVP_CIPHER *cipher;
81 unsigned char tag[16];
83 enum enum_aes_operation op;
84 enum enum_aes_modes mode;
85 enum enum_aes_padding padding;
106 LWS_VISIBLE LWS_EXTERN
int
109 enum enum_aes_padding padding,
void *engine);
123 LWS_VISIBLE LWS_EXTERN
int
161 LWS_VISIBLE LWS_EXTERN
int
164 uint8_t *iv_or_nonce_ctr_or_data_unit_16,
165 uint8_t *stream_block_16,
166 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:66
Definition: lws-gencrypto.h:91