[][src]Trait sio::Algorithm

pub trait Algorithm {
    const KEY_LEN: usize;
    const NONCE_LEN: usize;
    const TAG_LEN: usize;

    fn new(key: &[u8; 32]) -> Self;
fn seal_in_place<'a>(
        &self,
        nonce: &[u8; 12],
        aad: &[u8],
        in_out: &'a mut [u8]
    ) -> Result<&'a [u8], Invalid>;
fn open_in_place<'a>(
        &self,
        nonce: &[u8; 12],
        aad: &[u8],
        in_out: &'a mut [u8]
    ) -> Result<&'a [u8], NotAuthentic>; }

Associated Constants

Loading content...

Required methods

fn new(key: &[u8; 32]) -> Self

fn seal_in_place<'a>(
    &self,
    nonce: &[u8; 12],
    aad: &[u8],
    in_out: &'a mut [u8]
) -> Result<&'a [u8], Invalid>

fn open_in_place<'a>(
    &self,
    nonce: &[u8; 12],
    aad: &[u8],
    in_out: &'a mut [u8]
) -> Result<&'a [u8], NotAuthentic>

Loading content...

Implementors

impl Algorithm for AES_256_GCM[src]

impl Algorithm for CHACHA20_POLY1305[src]

Loading content...