seal_crypto_wrapper/
algorithms.rs

1//! Cryptographic algorithm definitions and builders.
2//!
3//! 密码算法定义和构建器。
4//!
5//! ## Overview | 概述
6//!
7//! This module contains all cryptographic algorithm definitions, builders, and enumerations
8//! used throughout the library. It provides a unified interface for selecting and configuring
9//! different cryptographic primitives.
10//!
11//! 此模块包含库中使用的所有密码算法定义、构建器和枚举。
12//! 它为选择和配置不同的密码原语提供统一接口。
13//!
14//! ## Algorithm Categories | 算法分类
15//!
16//! ### Aead Cryptography | 对称密码学
17//! - **AES-GCM**: Advanced Encryption Standard with Galois/Counter Mode
18//! - **ChaCha20-Poly1305**: ChaCha20 stream cipher with Poly1305 authenticator
19//! - **XChaCha20-Poly1305**: Extended nonce variant of ChaCha20-Poly1305
20//!
21//! ### Asymmetric Cryptography | 非对称密码学
22//! - **RSA**: Traditional public-key cryptosystem
23//! - **Elliptic Curve**: ECDSA signatures and ECDH key agreement
24//! - **Post-Quantum**: Kyber (KEM) and Dilithium (signatures)
25//!
26//! ### Key Derivation | 密钥派生
27//! - **HKDF**: HMAC-based Key Derivation Function
28//! - **PBKDF2**: Password-Based Key Derivation Function 2
29//! - **Argon2**: Memory-hard password hashing function
30//!
31//! ### Extendable Output Functions | 可扩展输出函数
32//! - **SHAKE**: SHA-3 derived functions with variable output length
33//!
34//! ## Security Levels | 安全级别
35//!
36//! All algorithms are categorized by their security strength:
37//! - **128-bit security**: Suitable for most applications
38//! - **192-bit security**: High security requirements
39//! - **256-bit security**: Maximum security for long-term protection
40//!
41//! 所有算法按其安全强度分类:
42//! - **128 位安全性**: 适用于大多数应用
43//! - **192 位安全性**: 高安全性要求
44//! - **256 位安全性**: 长期保护的最大安全性
45
46// Asymmetric cryptography algorithms | 非对称密码算法
47#[cfg(any(
48    feature = "asymmetric-kem",
49    feature = "asymmetric-signature",
50    feature = "asymmetric-key-agreement"
51))]
52pub mod asymmetric;
53
54// Key derivation functions | 密钥派生函数
55#[cfg(feature = "kdf")]
56pub mod kdf;
57
58// Aead encryption algorithms | 对称加密算法
59#[cfg(feature = "aead")]
60pub mod aead;
61
62// Extendable output functions | 可扩展输出函数
63#[cfg(feature = "xof")]
64pub mod xof;
65
66// Hash algorithms | 哈希算法
67pub mod hash;