1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use crate;
use fmt;
use Display;
/// ## Version 4: Sodium Modern
///
/// See [the version 4 specification](https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Version4.md) for details. At a glance:
///
/// * **`v4.local`**: Symmetric Authenticated Encryption:
/// * `XChaCha20` + `BLAKE2b`-MAC (Encrypt-then-MAC)
/// * Key-splitting: `BLAKE2b`
/// * Info for encryption key: `paseto-encryption-key`
/// The encryption key and implicit counter nonce are both returned
/// from `BLAKE2b` in this version.
/// * Info for authentication key: `paseto-auth-key-for-aead`
/// * 32-byte nonce (no longer prehashed), passed entirely to `BLAKE2b`.
/// * The `BLAKE2b`-MAC covers the header, nonce, and ciphertext
/// * It also covers the footer, if provided
/// * It also covers the implicit assertions, if provided
/// * **`v4.public`**: Asymmetric Authentication (Public-Key Signatures):
/// * Ed25519 (`EdDSA` over Curve25519)
/// * Signing: `sodium_crypto_sign_detached()`
/// * Verifying: `sodium_crypto_sign_verify_detached()`
;