[][src]Struct xaynet::crypto::PublicEncryptKey

pub struct PublicEncryptKey(_);

A C25519 public key for asymmetric authenticated encryption.

Implementations

impl PublicEncryptKey[src]

pub fn encrypt(&self, m: &[u8]) -> Vec<u8>[src]

Encrypts a message m with this public key.

The resulting ciphertext length is SEALBYTES + m.len().

The function creates a new ephemeral key pair for the message and attaches the ephemeral public key to the ciphertext. The ephemeral secret key is zeroed out and is not accessible after this function returns.

Trait Implementations

impl AsMut<PublicKey> for PublicEncryptKey[src]

impl AsRef<PublicKey> for PublicEncryptKey[src]

impl ByteObject for PublicEncryptKey[src]

impl Clone for PublicEncryptKey[src]

impl Copy for PublicEncryptKey[src]

impl Debug for PublicEncryptKey[src]

impl<'de> Deserialize<'de> for PublicEncryptKey[src]

impl Eq for PublicEncryptKey[src]

impl From<PublicKey> for PublicEncryptKey[src]

impl Hash for PublicEncryptKey[src]

impl Ord for PublicEncryptKey[src]

impl PartialEq<PublicEncryptKey> for PublicEncryptKey[src]

impl PartialOrd<PublicEncryptKey> for PublicEncryptKey[src]

impl Serialize for PublicEncryptKey[src]

impl StructuralEq for PublicEncryptKey[src]

impl StructuralPartialEq for PublicEncryptKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]