Struct AeadAlgorithmBuilder

Source
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

Source

pub fn aes128_gcm(self) -> AeadAlgorithm

Selects AES-128-GCM algorithm.

选择 AES-128-GCM 算法。

§Properties | 属性
  • Key size: 128 bits
  • Nonce size: 96 bits (12 bytes)
  • Tag size: 128 bits (16 bytes)
  • Security level: 128-bit
§Performance | 性能

Excellent with AES-NI hardware acceleration. 在 AES-NI 硬件加速下表现出色。

Source

pub fn aes256_gcm(self) -> AeadAlgorithm

Selects AES-256-GCM algorithm.

选择 AES-256-GCM 算法。

§Properties | 属性
  • Key size: 256 bits
  • Nonce size: 96 bits (12 bytes)
  • Tag size: 128 bits (16 bytes)
  • Security level: 256-bit
§Use Cases | 使用场景

Recommended for high-security applications and long-term data protection. 推荐用于高安全性应用和长期数据保护。

Source

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
  • 常数时间实现
  • 无时序侧信道
  • 出色的软件性能
Source

pub fn xchacha20_poly1305(self) -> AeadAlgorithm

Selects XChaCha20-Poly1305 algorithm.

选择 XChaCha20-Poly1305 算法。

§Properties | 属性
  • Key size: 256 bits
  • Nonce size: 192 bits (24 bytes)
  • Tag size: 128 bits (16 bytes)
  • Security level: 256-bit
§Key Feature | 关键特性

Extended 192-bit nonce eliminates nonce collision concerns. 扩展的 192 位 nonce 消除了 nonce 碰撞的担忧。

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V