aegis

High-performance Rust implementation of the AEGIS family of authenticated ciphers

Library
Cargo
v0.9.15
48stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
58/100Fair
Development Activity72
Maintenance76
Community16
Maturity56
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture82
Code Quality80
Innovation82
Learning Curve64

aegis is a Rust implementation of AEGIS, a family of authenticated encryption with associated data (AEAD) algorithms that offer high security together with exceptional performance on modern desktop, server, and mobile CPUs. It covers the full AEGIS family, AEGIS-128L, AEGIS-256, AEGIS-128X, and AEGIS-256X, each in its own module and parameterized by a 16- or 32-byte authentication tag.

By default the crate links the optimized C implementation from libaegis to reach peak throughput on hardware with AES instructions, while an optional pure-Rust backend keeps it portable to targets without a C toolchain. It supports one-shot and incremental encryption, WebAssembly targets, optional RustCrypto aead traits, and encrypted random-access file I/O.

What You Get

  • All four AEGIS variants: AEGIS-128L, AEGIS-256, AEGIS-128X, and AEGIS-256X
  • One-shot encryption with a detached authentication tag (16 or 32 bytes)
  • Incremental encryption and decryption for streaming data
  • An optional C backend (libaegis) plus a pure-Rust fallback via feature flags
  • Optional RustCrypto aead 0.6 trait implementations and encrypted random-access file I/O

Common Use Cases

  • High-throughput authenticated encryption on servers and modern CPUs with AES support
  • Encrypting network traffic or storage where AEGIS’ speed beats AES-GCM
  • Running AEAD in WebAssembly browser and WASI environments
  • Encrypted random-access file I/O via the raf feature

Under The Hood

Architecture - Each AEGIS variant lives in its own module and is parameterized by tag length. A build.rs plus the cc crate compiles the bundled libaegis C sources (under src/c/) when the C backend is active, selecting SIMD builds per target; a pure_rust/ module provides the fallback implementation, and compat/ holds the RustCrypto trait adapters. Incremental encryption is implemented in incremental.rs, and encrypted random-access file support sits behind the raf feature.

Tech Stack - Rust edition 2018 with a C backend built via cc 1.2, softaes as a pure-Rust AES fallback on targets without hardware AES, and prebuilt WebAssembly static libraries (portable and relaxed-SIMD) shipped in wasm-libs. Feature flags gate std, pure-rust, rustcrypto-traits-06, raf/raf-core, js, and WASM SIMD selection.

Code Quality - The crate carries JSON test vectors under src/test-vectors/, unit tests in tests.rs and incremental_tests.rs, and integration tests in tests/raf_tests.rs, giving strong known-answer coverage. It also includes benchmarks and explicit memory-wiping logic in wipe.rs.

API Design - The per-variant module layout with tag-length parameters keeps the surface predictable, and one-shot usage is a few lines producing ciphertext plus a detached tag. Optional RustCrypto trait adapters mean it can also be consumed through the familiar aead interface, and the extensive README documents the many feature flags.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search