[−][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]
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]
fn writer(self, inner: Box<dyn Write>) -> Self::Writer
[src]
fn pipe_transparent(&self, input: &[u8]) -> (usize, Option<Vec<u8>>)
[src]
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
impl Sync for GcmCrypt
impl Unpin for GcmCrypt
impl UnwindSafe for GcmCrypt
impl RefUnwindSafe for GcmCrypt
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> Same<T> for T
type Output = T
Should always be Self