rsa_msg_packets/
consts.rs

1use lazy_static::lazy_static;
2use openssl::{hash::MessageDigest, symm::Cipher, rsa::Padding};
3
4pub const UUID_SIZE: usize = 16;
5pub const U64_SIZE: usize = 8;
6pub const CHUNK_SIZE: u64 = 10 * 1000 * 1000 ; // 10 MB
7pub const CHUNK_SIZE_I64: i64 = CHUNK_SIZE as i64 ; // 10 MB
8
9pub const ONE_MB_SIZE: u64 = 1000 * 1000 ; // 1 MB
10pub const AES_KEYSIZE_BITS: usize = 256;
11pub const AES_KEYSIZE_BYTES: usize = AES_KEYSIZE_BITS / 8;
12
13pub const RSA_KEY_BITS: u32 = 2048;
14pub const RSA_PUBKEY_BYTES: usize = 451;
15pub const RSA_PADDING: Padding = Padding::PKCS1_OAEP;
16
17pub const AES_IVSIZE_BITS: usize = 128;
18pub const AES_IVSIZE_BYTES: usize = AES_IVSIZE_BITS / 8;
19
20
21lazy_static! {
22    pub static ref AES_DIGEST: Cipher = Cipher::aes_256_cbc();
23    pub static ref MSG_DIGEST: MessageDigest = MessageDigest:: sha256();
24}