pub trait KeyEncapsulation:
Identified
+ Send
+ Sync {
// Required methods
fn generate(&self) -> Result<(String, String)>;
fn encapsulate(&self, public_key_hex: &str) -> Result<(String, String)>;
fn decapsulate(
&self,
ciphertext_hex: &str,
private_key_hex: &str,
) -> Result<String>;
}Expand description
密钥封装(KEM,FIPS 203 ML-KEM):公钥封装 → (密文, 共享密钥);私钥解封装。 公钥、私钥、密文与共享密钥均为十六进制。
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".