Struct orion::aead::streaming::StreamOpener
source · pub struct StreamOpener { /* private fields */ }
Available on crate feature
safe_api
only.Expand description
Streaming authenticated decryption.
Implementations§
source§impl StreamOpener
impl StreamOpener
sourcepub fn new(
secret_key: &SecretKey,
nonce: &Nonce
) -> Result<Self, UnknownCryptoError>
pub fn new( secret_key: &SecretKey, nonce: &Nonce ) -> Result<Self, UnknownCryptoError>
Initialize a StreamOpener
struct with a given key and nonce.
sourcepub fn open_chunk(
&mut self,
ciphertext: &[u8]
) -> Result<(Vec<u8>, StreamTag), UnknownCryptoError>
pub fn open_chunk( &mut self, ciphertext: &[u8] ) -> Result<(Vec<u8>, StreamTag), UnknownCryptoError>
Decrypts ciphertext
. Returns the decrypted data and the StreamTag
indicating the type of message.