There are three arbitrary consants of sufficient length (46 bytes) used as fixed salts.
One of them is a “public const” named “TUR”, while the other two are
a private constants used within this module named “MAH” and “DEP”.
Generate key material with three rounds of Argon2id.
The first round is based on the password and supplied salt.
The second round is the output of the first round and the “MAH” salt.
The third round is the output of the second round and the “DEP” salt.
This “checks” function is a string comparison function to ensure that the ciphertext hasn’t been
tampered with and that the key material is correct. Supply the function with two hashes
generated from the ciphertext_hash function.
This function generates a SHA3 XOF with SHAKE 256.
The XOF (hash) has input of the password and the ciphertext so
that if either the password is incorrect or the ciphertext has been
modified, the value will change.
Encrypt a file with XChaCha20Poly1305. The function takes an input file, and output, and key to use for
the encryption. A nonce is generated using 8 bytes of time data and 16 random bytes.