[][src]Module disco::symmetric

Symmetric crypto primitives built with strobe.

Structs

AuthCiphertext

A ciphertext object with an associated MAC and nonce.

AuthError

An empty struct that just indicates that an error occurred in verifying a MAC

AuthPlaintext

Represents plaintext with an associated MAC.

DiscoHash

An object for facilitating continuous hashing. General use is to call the write method a bunch of times, and then call a final sum.

Functions

decrypt

Decrypts and checks the MAC of an AuthCiphertext object, given a key of any size greater than 128 bits (16 bytes).

derive_keys

Derives longer keys given an input key.

encrypt

Encrypts and MACs a plaintext message with a key of any size greater than 128 bits (16 bytes).

hash

Hashes an input of any length and obtain an output of length greater or equal to 256 bits (32 bytes).

protect_integrity

Returns an authenticated message in cleartext (not encrypted). You can later verify via the verify_integrity function that the message has not been modified.

verify_integrity

Unwraps an AuthPlaintext object and checks the MAC. On success, returns the underlying plaintext. On error, returns AuthError.