Add the key length to the key context
This commit is contained in:
parent
434b3b8bd6
commit
f1660e212e
5 changed files with 29 additions and 17 deletions
|
@ -3,6 +3,7 @@ use crate::error::{Error, Result};
|
|||
use aes_gcm::aead::{Aead, KeyInit, Payload};
|
||||
use aes_gcm::{Aes128Gcm, Key, Nonce};
|
||||
|
||||
pub(crate) const AES128_KEY_SIZE: usize = 128;
|
||||
// 96 bits (12 bytes)
|
||||
// Reason: NIST Special Publication 800-38D
|
||||
// https://doi.org/10.6028/NIST.SP.800-38D
|
||||
|
|
|
@ -3,6 +3,7 @@ use crate::error::{Error, Result};
|
|||
use chacha20poly1305::aead::{Aead, KeyInit, Payload};
|
||||
use chacha20poly1305::{Key, XChaCha20Poly1305, XNonce};
|
||||
|
||||
pub(crate) const KEY_SIZE: usize = 256;
|
||||
// X-variant: the nonce's size is 192 bits (24 bytes)
|
||||
const NONCE_SIZE: usize = 24;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue