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
impl KemAlgorithmBuilder
Sourcepub fn rsa2048(self) -> RsaBuilder
pub fn rsa2048(self) -> RsaBuilder
Sourcepub fn rsa4096(self) -> RsaBuilder
pub fn rsa4096(self) -> RsaBuilder
Sourcepub fn kyber512(self) -> KemAlgorithm
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. 大多数需要后量子安全的应用的最佳选择。
Sourcepub fn kyber768(self) -> KemAlgorithm
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 更高安全性的应用。
Sourcepub fn kyber1024(self) -> KemAlgorithm
pub fn kyber1024(self) -> KemAlgorithm
Auto Trait Implementations§
impl Freeze for KemAlgorithmBuilder
impl RefUnwindSafe for KemAlgorithmBuilder
impl Send for KemAlgorithmBuilder
impl Sync for KemAlgorithmBuilder
impl Unpin for KemAlgorithmBuilder
impl UnwindSafe for KemAlgorithmBuilder
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