Skip to main content

encapsulate

Function encapsulate 

Source
pub fn encapsulate<Ciphertext: NewByteArray<{ CRYPTO_KEM_XWING_CIPHERTEXTBYTES }>, SharedSecret: NewByteArray<{ CRYPTO_KEM_XWING_SHAREDSECRETBYTES }>, PublicKey: ByteArray<{ CRYPTO_KEM_XWING_PUBLICKEYBYTES }>>(
    public_key: &PublicKey,
) -> Result<(Ciphertext, SharedSecret), Error>
Expand description

Creates a random shared secret for public_key, returning the X-Wing ciphertext to send to its owner and the shared secret.

ยงErrors

Returns Error::InvalidKey if public_key is not a valid public key.