wasmium_securemem/
vault.rs1use secrecy::Secret;
2
3pub struct EncryptedVault {
4 pub(crate) secret: Secret<Vec<u8>>,
5 pub(crate) nonce: Secret<[u8; 24]>,
6}
7
8#[cfg(feature = "dangerous_debug")]
9use secrecy::ExposeSecret;
10#[cfg(feature = "dangerous_debug")]
11impl EncryptedVault {
12 pub fn dangerous_debug_hashed(&self) {
14 println!(
15 "EncryptedVault {{
16 secret: {:?},
17 nonce: {:?},
18 }}",
19 blake3::hash(self.secret.expose_secret()).to_hex(),
20 blake3::hash(self.nonce.expose_secret()).to_hex(),
21 );
22 }
23
24 pub fn dangerous_debug(&self) {
26 println!(
27 "EncryptedVault {{
28 secret: {:?},
29 nonce: {:?},
30 }}",
31 self.secret.expose_secret(),
32 self.nonce.expose_secret(),
33 );
34 }
35}