Crate aes_wasm

source ·
Expand description

Docs.rs crates.io

§Fast(er) AES-based constructions for Rust and WebAssembly

  • AEGIS-128L
  • AEGIS-256
  • AES-128-CTR
  • AES-256-CTR
  • AES-128-OCB
  • AES-256-OCB
  • AES-128-GCM
  • AES-256-GCM
  • CMAC-AES-128

This is a set of AES-based constructions (AEAD, stream cipher, MAC) for WebAssembly applications written in Rust.

They are trivial to use and this crate has zero dependencies.

§Benchmarks

Benchmarks can be run with the cargo wasix bench command.

Performance results using Wasmtime 9.0.1 on Apple M1

algorithmcratethroughput
aes256-gcm(aes crate)49.63 M/s
aes256-gcmthis crate98.86 M/s
aes128-gcm(aes crate)59.87 M/s
aes128-gcmthis crate115.47 M/s
aes256-ocbthis crate168.43 M/s
aes128-ocbthis crate215.23 M/s
aegis-256this crate478.57 M/s
aegis-128l(aegis crate)533.85 M/s
aegis-128lthis crate695.85 M/s
aes128-ctr(ctr crate)104.63 M/s
aes128-ctrthis crate217.10 M/s
cmac-aes128(cmac crate)53.99 M/s
cmac-aes128this crate233.34 M/s

Performance results using Wasmtime 9.0.1 on Ryzen 7

algorithmcratethroughput
aes256-gcm(aes crate)63.79 M/s
aes256-gcmthis crate129.44 M/s
aes128-gcm(aes crate)75.09 M/s
aes128-gcmthis crate149.31 M/s
aes256-ocbthis crate205.39 M/s
aes128-ocbthis crate260.56 M/s
aegis-256this crate497.97 M/s
aegis-128l(aegis crate)537.49 M/s
aegis-128lthis crate696.61 M/s
aes128-ctr(ctr crate)151.26 M/s
aes128-ctrthis crate275.51 M/s
cmac-aes128(cmac crate)78.63 M/s
cmac-aes128this crate260.23 M/s

Modules§

Enums§