Struct KemAlgorithmBuilder

Source
pub struct KemAlgorithmBuilder;
Expand description

Builder for constructing KEM algorithm instances.

用于构建 KEM 算法实例的构建器。

§Usage Pattern | 使用模式

use seal_crypto_wrapper::algorithms::asymmetric::kem::KemAlgorithm;

// Post-quantum algorithms (recommended)
let kyber512 = KemAlgorithm::build().kyber512();
let kyber768 = KemAlgorithm::build().kyber768();

// Traditional algorithms (for compatibility)
let rsa = KemAlgorithm::build().rsa2048().sha256();

Implementations§

Source§

impl KemAlgorithmBuilder

Source

pub fn rsa2048(self) -> RsaBuilder

Selects RSA-2048 for KEM operations.

选择 RSA-2048 进行 KEM 操作。

§Properties | 属性
  • Key size: 2048 bits
  • Security level: 112-bit (classical)
  • Performance: Medium
  • Quantum resistance: No
§Next Step | 下一步

Choose a hash function: .sha256(), .sha384(), or .sha512()

选择哈希函数:.sha256().sha384().sha512()

Source

pub fn rsa4096(self) -> RsaBuilder

Selects RSA-4096 for KEM operations.

选择 RSA-4096 进行 KEM 操作。

§Properties | 属性
  • Key size: 4096 bits
  • Security level: 128-bit (classical)
  • Performance: Slow
  • Quantum resistance: No
§Use Cases | 使用场景

High-security applications requiring larger RSA keys. 需要更大 RSA 密钥的高安全性应用。

Source

pub fn kyber512(self) -> KemAlgorithm

Selects Kyber-512 post-quantum KEM.

选择 Kyber-512 后量子 KEM。

§Properties | 属性
  • Security level: 128-bit (post-quantum)
  • Public key size: ~800 bytes
  • Ciphertext size: ~768 bytes
  • Performance: Fast
  • Quantum resistance: Yes
§Recommendation | 推荐

Best choice for most applications requiring post-quantum security. 大多数需要后量子安全的应用的最佳选择。

Source

pub fn kyber768(self) -> KemAlgorithm

Selects Kyber-768 post-quantum KEM.

选择 Kyber-768 后量子 KEM。

§Properties | 属性
  • Security level: 192-bit (post-quantum)
  • Public key size: ~1184 bytes
  • Ciphertext size: ~1088 bytes
  • Performance: Fast
  • Quantum resistance: Yes
§Use Cases | 使用场景

Applications requiring higher security than Kyber-512. 需要比 Kyber-512 更高安全性的应用。

Source

pub fn kyber1024(self) -> KemAlgorithm

Selects Kyber-1024 post-quantum KEM.

选择 Kyber-1024 后量子 KEM。

§Properties | 属性
  • Security level: 256-bit (post-quantum)
  • Public key size: ~1568 bytes
  • Ciphertext size: ~1568 bytes
  • Performance: Fast
  • Quantum resistance: Yes
§Use Cases | 使用场景

Maximum security for long-term data protection. 长期数据保护的最大安全性。

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