[−][src]Struct ffsend_api::pipe::crypto::gcm::GcmCrypt
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]
fn crypt(&mut self, input: &[u8]) -> (usize, Option<Vec<u8>>)[src]
Encrypt/decrypt bytes from input, return the result. Read more
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.
fn pipe(&mut self, input: &[u8]) -> (usize, Option<Vec<u8>>)[src]
fn reader(self, inner: Box<dyn Read>) -> Self::Reader[src]
Wrap the inner reader, bytes that are read are transformed through this pipe.
fn writer(self, inner: Box<dyn Write>) -> Self::Writer[src]
Wrap the inner writer, bytes that are read are transformed through this pipe.
fn pipe_transparent(&self, input: &[u8]) -> (usize, Option<Vec<u8>>)[src]
Transparently pipe input by immediately returning it. Read more
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> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Erased for T
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> Same for T
type Output = T
Should always be Self