[−][src]Struct tink_streaming_aead::subtle::AesGcmHkdf
AesGcmHkdf
implements streaming AEAD encryption using AES-GCM.
Each ciphertext uses a new AES-GCM key. These keys are derived using HKDF and are derived from the key derivation key, a randomly chosen salt of the same size as the key and a nonce prefix.
Fields
main_key: Vec<u8>
Implementations
impl AesGcmHkdf
[src]
pub fn new(
main_key: &[u8],
hkdf_alg: HashType,
key_size_in_bytes: usize,
ciphertext_segment_size: usize,
first_segment_offset: usize
) -> Result<AesGcmHkdf, TinkError>
[src]
main_key: &[u8],
hkdf_alg: HashType,
key_size_in_bytes: usize,
ciphertext_segment_size: usize,
first_segment_offset: usize
) -> Result<AesGcmHkdf, TinkError>
Initialize a streaming primitive with a key derivation key and encryption parameters.
main_key
is input keying material used to derive sub keys. This must be
longer than the size of the sub keys (key_size_in_bytes
).
hkdf_alg
is a MAC algorithm hash type, used for the HKDF key derivation.
key_size_in_bytes
argument is a key size of the sub keys.
ciphertext_segment_size
argument is the size of ciphertext segments.
first_segment_offset
argument is the offset of the first ciphertext segment.
pub fn header_length(&self) -> usize
[src]
Return the length of the encryption header.
Trait Implementations
impl Clone for AesGcmHkdf
[src]
fn clone(&self) -> AesGcmHkdf
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl StreamingAead for AesGcmHkdf
[src]
fn new_encrypting_writer(
&self,
w: Box<dyn Write>,
aad: &[u8]
) -> Result<Box<dyn EncryptingWrite>, TinkError>
[src]
&self,
w: Box<dyn Write>,
aad: &[u8]
) -> Result<Box<dyn EncryptingWrite>, TinkError>
Return a wrapper around an underlying std::io::Write
, such that
any write-operation via the wrapper results in AEAD-encryption of the
written data, using aad as associated authenticated data. The associated
data is not included in the ciphertext and has to be passed in as parameter
for decryption.
fn new_decrypting_reader(
&self,
r: Box<dyn Read>,
aad: &[u8]
) -> Result<Box<dyn Read>, TinkError>
[src]
&self,
r: Box<dyn Read>,
aad: &[u8]
) -> Result<Box<dyn Read>, TinkError>
Return a wrapper around an underlying std::io::Read
, such that
any read-operation via the wrapper results in AEAD-decryption of the
underlying ciphertext, using aad as associated authenticated data.
Auto Trait Implementations
impl RefUnwindSafe for AesGcmHkdf
impl Send for AesGcmHkdf
impl Sync for AesGcmHkdf
impl Unpin for AesGcmHkdf
impl UnwindSafe for AesGcmHkdf
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> StreamingAeadBoxClone for T where
T: 'static + StreamingAead + Clone,
[src]
T: 'static + StreamingAead + Clone,
fn box_clone(&self) -> Box<dyn StreamingAead + 'static>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,