oqs_sys::kem

Function OQS_KEM_encaps

source
pub unsafe extern "C" fn OQS_KEM_encaps(
    kem: *const OQS_KEM,
    ciphertext: *mut u8,
    shared_secret: *mut u8,
    public_key: *const u8,
) -> OQS_STATUS
Expand description

Encapsulation algorithm.

Caller is responsible for allocating sufficient memory for ciphertext and shared_secret, based on the length_* members in this object or the per-scheme compile-time macros OQS_KEM_*_length_*.

@param[in] kem The OQS_KEM object representing the KEM. @param[out] ciphertext The ciphertext (encapsulation) represented as a byte string. @param[out] shared_secret The shared secret represented as a byte string. @param[in] public_key The public key represented as a byte string. @return OQS_SUCCESS or OQS_ERROR