[−][src]Struct tink_streaming_aead::subtle::AesCtrHmac
AesCtrHmac
implements streaming AEAD encryption using AES-CTR and HMAC.
Each ciphertext uses new AES-CTR and HMAC keys. 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 AesCtrHmac
[src][−]
pub fn new(
main_key: &[u8],
hkdf_alg: HashType,
key_size_in_bytes: usize,
tag_alg: HashType,
tag_size_in_bytes: usize,
ciphertext_segment_size: usize,
first_segment_offset: usize
) -> Result<AesCtrHmac, TinkError>
[src][−]
main_key: &[u8],
hkdf_alg: HashType,
key_size_in_bytes: usize,
tag_alg: HashType,
tag_size_in_bytes: usize,
ciphertext_segment_size: usize,
first_segment_offset: usize
) -> Result<AesCtrHmac, TinkError>
Initialize an AES_CTR_HMAC 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
is the key size of the sub keys.
tag_alg
is the MAC algorithm hash type, used for generating per segment tags.
tag_size_in_bytes
is the size of the per segment tags.
ciphertext_segment_size
is the size of ciphertext segments.
first_segment_offset
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 AesCtrHmac
[src][+]
impl StreamingAead for AesCtrHmac
[src][+]
Auto Trait Implementations
impl RefUnwindSafe for AesCtrHmac
impl Send for AesCtrHmac
impl Sync for AesCtrHmac
impl Unpin for AesCtrHmac
impl UnwindSafe for AesCtrHmac
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,
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,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[+]
V: MultiLane<T>,