Trait crypt_guard::KyberKeyFunctions

source ·
pub trait KyberKeyFunctions {
    // Required methods
    fn keypair() -> Result<(Vec<u8>, Vec<u8>), CryptError>;
    fn encap(public_key: &[u8]) -> Result<(Vec<u8>, Vec<u8>), CryptError>;
    fn decap(
        secret_key: &[u8],
        ciphertext: &[u8]
    ) -> Result<Vec<u8>, CryptError>;
}
Expand description

Trait for implementing key management functions. This trait provides an interface for key pair generation, encapsulation/decapsulation of secrets, and key manipulation (such as setting and getting key values).

Required Methods§

source

fn keypair() -> Result<(Vec<u8>, Vec<u8>), CryptError>

Generates a new key pair.

source

fn encap(public_key: &[u8]) -> Result<(Vec<u8>, Vec<u8>), CryptError>

Encapsulates a secret using a public key.

source

fn decap(secret_key: &[u8], ciphertext: &[u8]) -> Result<Vec<u8>, CryptError>

Decapsulates a secret using a secret key and a ciphertext.

Object Safety§

This trait is not object safe.

Implementors§