Skip to content

ttarvis/multiaes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multiaes

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.

API

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);

wasm

see JavaScript wrapper src/js/aes_wrapper.js. To compile to wasm use make wasm.

compiler flags

  • Intel/x86 (AES-NI): -maes
  • ARM (NEON crypto extensions): -march=armv8-a+crypto

Future Plans and Notes

This code provides single block encrypt and decrypt. Future releases may include AES-GCM and CMAC.

License

Licensed under AGPL-3.0-only

About

hardware optimized AES for multiple platforms

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages