rustls_mbedcrypto_provider/
aead.rs1use mbedtls::cipher::raw::{CipherId, CipherMode, CipherType};
9
10pub(crate) const TAG_LEN: usize = 16;
12
13pub static AES128_GCM: Algorithm = Algorithm {
15 key_length: 128 / 8,
16 cipher_type: CipherType::Aes128Gcm,
17 cipher_id: CipherId::Aes,
18 cipher_mode: CipherMode::GCM,
19};
20
21pub static AES256_GCM: Algorithm = Algorithm {
23 key_length: 256 / 8,
24 cipher_type: CipherType::Aes256Gcm,
25 cipher_id: CipherId::Aes,
26 cipher_mode: CipherMode::GCM,
27};
28
29pub static CHACHA20_POLY1305: Algorithm = Algorithm {
35 key_length: 256 / 8,
36 cipher_type: CipherType::Chacha20Poly1305,
37 cipher_id: CipherId::Chacha20,
38 cipher_mode: CipherMode::CHACHAPOLY,
39};
40
41pub struct Algorithm {
43 pub(crate) key_length: usize,
44 pub(crate) cipher_type: CipherType,
45 pub(crate) cipher_id: CipherId,
46 pub(crate) cipher_mode: CipherMode,
47}