pub struct AeadAlgorithmBuilder;
Expand description
Builder for constructing aead algorithm instances.
用于构建对称算法实例的构建器。
§Usage Pattern | 使用模式
The builder provides a fluent interface for algorithm selection:
构建器为算法选择提供流畅的接口:
use seal_crypto_wrapper::algorithms::aead::AeadAlgorithm;
// High performance with hardware acceleration
let aes = AeadAlgorithm::build().aes256_gcm();
// Software-optimized
let chacha = AeadAlgorithm::build().chacha20_poly1305();
// Extended nonce support
let xchacha = AeadAlgorithm::build().xchacha20_poly1305();
Implementations§
Source§impl AeadAlgorithmBuilder
impl AeadAlgorithmBuilder
Sourcepub fn aes128_gcm(self) -> AeadAlgorithm
pub fn aes128_gcm(self) -> AeadAlgorithm
Sourcepub fn aes256_gcm(self) -> AeadAlgorithm
pub fn aes256_gcm(self) -> AeadAlgorithm
Sourcepub fn chacha20_poly1305(self) -> AeadAlgorithm
pub fn chacha20_poly1305(self) -> AeadAlgorithm
Selects ChaCha20-Poly1305 algorithm.
选择 ChaCha20-Poly1305 算法。
§Properties | 属性
- Key size: 256 bits
- Nonce size: 96 bits (12 bytes)
- Tag size: 128 bits (16 bytes)
- Security level: 256-bit
§Advantages | 优势
- Constant-time implementation
- No timing side-channels
- Excellent software performance
- 常数时间实现
- 无时序侧信道
- 出色的软件性能
Sourcepub fn xchacha20_poly1305(self) -> AeadAlgorithm
pub fn xchacha20_poly1305(self) -> AeadAlgorithm
Auto Trait Implementations§
impl Freeze for AeadAlgorithmBuilder
impl RefUnwindSafe for AeadAlgorithmBuilder
impl Send for AeadAlgorithmBuilder
impl Sync for AeadAlgorithmBuilder
impl Unpin for AeadAlgorithmBuilder
impl UnwindSafe for AeadAlgorithmBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more