4 个版本
| 0.1.3 | 2021年10月29日 |
|---|---|
| 0.1.2 | 2021年10月28日 |
| 0.1.1 | 2021年10月28日 |
| 0.1.0 | 2021年10月28日 |
2552 在 加密学 中
22KB
466 行
MORUS for Rust
这是 MORUS (MORUS-1280-128) 的 Rust 实现
MORUS 是一个针对没有硬件 AES 加速的平台的快速认证加密。
它在 WebAssembly 上的表现比替代方案要好。
Cargo 标志
std: 允许动态分配
std 是默认值。
可以这样运行基准测试
export RUSTFLAGS="-C target-cpu=native"
cargo bench
基准测试
基准测试使用 16384 字节输入块。结果以每秒字节为单位。
Rust 实现
软件包
aes-gcmchacha20poly1305morus
Macbook Pro - 2.4 GHz Intel Core i9。
| 加密 | 速度 |
|---|---|
| aes128-gcm | 1.91 G/s |
| chacha20-poly1305 | 1.48 G/s |
| morus | 3.76 G/s |
WebAssembly (Wasmtime)
| 加密 | 速度 |
|---|---|
| aes128-gcm | 44.13 M/s |
| chacha20-poly1305 | 193.05 M/s |
| chacha20-poly1305 (+simd128) | 196.54 M/s |
| morus | 1.07 G/s |
| morus (+simd128) | 1.38 G/s |
WebAssembly (WAVM)
| 加密 | 速度 |
|---|---|
| aes128-gcm | 57.01 M/s |
| chacha20-poly1305 | 335.82 M/s |
| morus | 1.95 G/s |
其他实现(macOS 本机)
| 加密(实现,运行时) | 速度 |
|---|---|
| zig-morus (Zig) | 5.89 G/s |
其他实现(WebAssembly)
| 加密(实现,运行时) | 速度 |
|---|---|
| zig-morus (Zig, wasmtime+simd128) | 1.77 G/s |
| zig-morus (Zig, WAVM) | 3.50 G/s |