[go: up one dir, main page]

Crate aead_stream

Source
Expand description

§RustCrypto: AEAD-STREAM

crate Docs Apache2/MIT licensed Rust Version Project Chat Build Status

Generic pure-Rust implementation of the STREAM online authenticated encryption construction as described in the paper Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance.

§About

The STREAM construction supports encrypting/decrypting sequences of AEAD message segments, which is useful in cases where the overall message is too large to fit in a single buffer and needs to be processed incrementally.

STREAM defends against reordering and truncation attacks which are common in naive schemes which attempt to provide these properties, and is proven to meet the security definition of “nonce-based online authenticated encryption” (nOAE) as given in the aforementioned paper.

§Diagram

STREAM Diagram

Legend:

  • 𝐄k: AEAD encryption under key k
  • 𝐌: message
  • 𝐍: nonce
  • 𝐀: additional associated data
  • 𝐂: ciphertext
  • 𝜏: MAC tag

§License

Licensed under either of:

at your option.

§Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Re-exports§

pub use aead;

Structs§

Decryptor
Stateful STREAM object which can decrypt AEAD messages one-at-a-time.
Encryptor
Stateful STREAM object which can encrypt AEAD messages one-at-a-time.
StreamBE32
The original “Rogaway-flavored” STREAM as described in the paper Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance.
StreamLE31
STREAM as instantiated with a 31-bit little endian counter and 1-bit “last block” flag stored as the most significant bit of the counter when interpreted as a 32-bit integer.

Traits§

KeyInit
Types which can be initialized from key.
NewStream
Create a new STREAM from the provided AEAD.
StreamPrimitive
Low-level STREAM implementation.

Type Aliases§

DecryptorBE32
STREAM decryptor instantiated with StreamBE32 as the underlying STREAM primitive.
DecryptorLE31
STREAM decryptor instantiated with StreamLE31 as the underlying STREAM primitive.
EncryptorBE32
STREAM encryptor instantiated with StreamBE32 as the underlying STREAM primitive.
EncryptorLE31
STREAM encryptor instantiated with StreamLE31 as the underlying STREAM primitive.
Key
Key used by KeySizeUser implementors.
Nonce
Nonce as used by a given AEAD construction and STREAM primitive.
NonceSize
Size of a nonce as used by a STREAM construction, sans the overhead of the STREAM protocol itself.