Skip to main content

ExportOnly

Struct ExportOnly 

Source
pub struct ExportOnly;
Expand description

Export-Only pseudo-AEAD (AEAD id 0xffff).

Ciphersuites using this “AEAD” can only derive secrets through SenderContext::export and RecipientContext::export; Aead::seal and Aead::open return HpkeError::NotSupported.

The [crypto::Aead] implementation below only exists to satisfy the Aead supertrait bound and must not be called directly: HPKE never invokes it, and it does not perform any encryption.

Trait Implementations§

Source§

impl Aead for ExportOnly

Source§

const KEY_SIZE: usize = 0

Source§

const TAG_SIZE: usize = 0

Source§

const NONCE_SIZE: usize = 0

Source§

fn encrypt_in_place( &self, _in_out: &mut [u8], _nonce: &[u8], _associated_data: &[u8], ) -> Hash

Source§

fn decrypt_in_place( &self, _in_out: &mut [u8], _nonce: &[u8], _associated_data: &[u8], _tag: &[u8], ) -> Result<(), AeadError>

§

fn encrypt(&self, plaintext: &[u8], nonce: &[u8], aad: &[u8]) -> Vec<u8> ⓘ

§

fn decrypt( &self, ciphertext: &[u8], nonce: &[u8], aad: &[u8], ) -> Result<Vec<u8>, AeadError>

Source§

impl Aead for ExportOnly

Source§

const HPKE_AEAD_ID: u16 = 0xffff

The HPKE AEAD identifier (draft-ietf-hpke-hpke-05 Section 7.3, IANA “HPKE AEAD Identifiers”), used to build the ciphersuite suite_id.
Source§

const MAX_PLAINTEXT_SIZE: u64 = 0

Maximum length, in bytes, of a plaintext passed to Aead::seal, i.e. P_MAX ([RFC 5116]). Read more
Source§

const MAX_CIPHERTEXT_SIZE: u64 = 0

Maximum length, in bytes, of a ciphertext passed to Aead::open, i.e. C_MAX ([RFC 5116]). Read more
Source§

fn new(key: &[u8]) -> Result<Self, HpkeError>

Instantiates the cipher from KEY_SIZE raw key bytes, as produced by the HPKE key schedule. Read more
Source§

fn seal( &self, _in_out: &mut [u8], _nonce: &[u8], _associated_data: &[u8], ) -> Result<Hash, HpkeError>

Encrypts in_out in place and returns the detached authentication tag, forwarding to [crypto::Aead::encrypt_in_place]. Read more
Source§

fn open( &self, _in_out: &mut [u8], _nonce: &[u8], _associated_data: &[u8], _tag: &[u8], ) -> Result<(), HpkeError>

Decrypts in_out in place using the detached authentication tag, forwarding to [crypto::Aead::decrypt_in_place]. Read more
Source§

impl Clone for ExportOnly

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ExportOnly

Source§

impl Debug for ExportOnly

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ExportOnly

Source§

impl PartialEq for ExportOnly

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ExportOnly

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.