multiaes is a small, secure, constant-time, standalone AES library that is
hardware optimized for Intel and ARM meant to be a two file drop in with a
simple API. It has a software fallback if hardware not available.
It can be compiled to wasm and has a JavaScript wrapper.
The code should just work.
typedef struct {
uint8_t opaque[AES_CTX_SIZE];
} aes_ctx_t;
int aes_init(aes_ctx_t *ctx, const uint8_t *key, size_t key_len);
void aes_encrypt_block(const aes_ctx_t *ctx, uint8_t out[16], const uint8_t in[16]);
void aes_decrypt_block(const aes_ctx_t *ctx, uint8_t out[16], const uint8_t in[16]);
void aes_clear(aes_ctx_t *ctx);
see JavaScript wrapper src/js/aes_wrapper.js. To compile to wasm use make wasm.
- Intel/x86 (AES-NI):
-maes - ARM (NEON crypto extensions):
-march=armv8-a+crypto
This code provides single block encrypt and decrypt. Future releases may include AES-GCM and CMAC.
Licensed under AGPL-3.0-only