gimli_crypto/
lib.rs

1#![no_std]
2#![doc = include_str!("../README.md")]
3
4mod aead_impl;
5mod gimli;
6mod hash_impl;
7
8mod rustcrypto_aead;
9mod rustcrypto_hash;
10
11pub use aead_impl::{AuthenticationFailed, Tag, decrypt_in_place, encrypt_in_place};
12pub use hash_impl::{HASH_SIZE, Hasher, hash};
13pub use rustcrypto_aead::GimliAead;
14pub use rustcrypto_hash::GimliHash;
15
16pub use aead::{self, AeadInPlace, KeyInit}; // For `GimliAead` users
17pub use digest::{self, Digest, Update}; // For `GimpiHash` users
18
19/// Gimli state size in bytes (48 bytes = 12 u32 words).
20const STATE_SIZE: usize = 48;
21
22/// Gimli nonce size in bytes.
23pub const NONCE_SIZE: usize = 16;
24
25/// Gimli key size in bytes.
26pub const KEY_SIZE: usize = 32;
27
28/// Gimli tag size in bytes.
29pub const TAG_SIZE: usize = 16;
30
31/// Gimli rate in bytes.
32const RATE: usize = 16;
33
34/// Last byte index of state (used for domain separation).
35const STATE_LAST_BYTE: usize = STATE_SIZE - 1;