Trait HpkeContextS

Source
pub trait HpkeContextS {
    type Error: IntoAnyError;

    // Required methods
    fn seal(
        &mut self,
        aad: Option<&[u8]>,
        data: &[u8],
    ) -> Result<Vec<u8>, Self::Error>;
    fn export(
        &self,
        exporter_context: &[u8],
        len: usize,
    ) -> Result<Vec<u8>, Self::Error>;
}
Expand description

The HPKE context for sender outputted by hpke_setup_s. The context internally stores the secrets generated by hpke_setup_s.

This trait corresponds to ContextS from RFC 9180.

Required Associated Types§

Required Methods§

Source

fn seal( &mut self, aad: Option<&[u8]>, data: &[u8], ) -> Result<Vec<u8>, Self::Error>

Encrypt data using the cipher key of the context with optional aad. This function should internally increment the sequence number.

Source

fn export( &self, exporter_context: &[u8], len: usize, ) -> Result<Vec<u8>, Self::Error>

Export a secret from the context for the given exporter_context.

Implementors§