diff --git a/crypto_box/src/lib.rs b/crypto_box/src/lib.rs index 0e749db..e639ce2 100644 --- a/crypto_box/src/lib.rs +++ b/crypto_box/src/lib.rs @@ -233,6 +233,17 @@ pub struct CryptoBox { secretbox: SecretBox, } +impl CryptoBox { + /// Size of an XSalsa20Poly1305 key in bytes + pub const KEY_SIZE: usize = SecretBox::::KEY_SIZE; + + /// Size of an XSalsa20Poly1305 nonce in bytes + pub const NONCE_SIZE: usize = SecretBox::::NONCE_SIZE; + + /// Size of a Poly1305 tag in bytes + pub const TAG_SIZE: usize = SecretBox::::TAG_SIZE; +} + // Handwritten instead of derived to avoid `C: Clone` bound impl Clone for CryptoBox { fn clone(&self) -> Self {