[][src]Struct ffsend_api::pipe::crypto::gcm::GcmCrypt

pub struct GcmCrypt { /* fields omitted */ }

Something that can encrypt or decrypt given data using AES-GCM.

Methods

impl GcmCrypt[src]

pub fn new(mode: CryptMode, len: usize, key: &[u8], iv: &[u8]) -> Self[src]

Construct a new AES-GCM crypter.

It is highly recommended to use the encrypt() and decrypt() methods instead for constructing a new crypter.

The mode parameter defines whether this encrypts or decrypts. The length of the payload to encrypt or decrypt must be given to len, this excludes the appended verification tag on the encrypted payload.

The crypto key and input vector iv must also be given.

pub fn encrypt(len: usize, key: &[u8], iv: &[u8]) -> Self[src]

Create an AES-GCM encryptor.

The size in bytes of the data to encrypt must be given as len.

The encryption key and input vector iv must also be given.

pub fn decrypt(len: usize, key: &[u8], iv: &[u8]) -> Self[src]

Create an AES-GCM decryptor.

The size in bytes of the data to decrypt must be given as len, including the size of the suffixed tag.

The decryption key and input vector iv must also be given.

pub fn has_tag(&self) -> bool[src]

Check if the AES-GCM cryptographic tag is known.

When decrypting, this means all data has been processed and the suffixed tag was obtained.

Trait Implementations

impl Crypt for GcmCrypt[src]

impl Pipe for GcmCrypt[src]

type Reader = GcmReader

The wrapping reader type used for this pipe.

type Writer = GcmWriter

The wrapping writer type used for this pipe.

impl PipeRead<GcmCrypt> for GcmReader[src]

impl PipeWrite<GcmCrypt> for GcmWriter[src]

impl PipeLen for GcmCrypt[src]

impl Send for GcmCrypt[src]

Auto Trait Implementations

Blanket Implementations

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T

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

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

impl<T> Typeable for T where
    T: Any

impl<T> Same<T> for T

type Output = T

Should always be Self