fn decrypt(&self, bytes: &[u8]) -> String {
        if bytes.get(12).is_none() {
            return String::from("")
        }

        let (nonce_bytes, cipher_bytes) = bytes.split_at(12);
        let nonce = GenericArray::from_slice(nonce_bytes);
        let decrypt_vec = self.cipher.decrypt(nonce, cipher_bytes).unwrap();
        String::from_utf8(decrypt_vec).unwrap_or_default()
    }
/// The lowest level method to decrypt data
///
/// # Arguments
///
/// `bytes` - byte data to decrypt.  The first 12 bytes must be a Nonce value
///
/// # Example
/// ```rust
/// use data_vault::encryption::traits::Encryption;
/// use data_vault::encryption::AesGcmSivEncryption;
///
/// let enc = AesGcmSivEncryption::new();
/// let nonce = "unique nonce".as_bytes();
/// let test_data = vec![85, 117, 109, 67, 71, 109, 74, 66, 55, 100, 119, 70, 208, 88, 64, 198, 33, 160, 61, 101, 8, 179, 140, 90, 139, 124, 195, 110, 120, 216, 244, 143, 128, 208, 90, 61, 127, 37, 35, 235];
/// let encrypted_data = enc.decrypt_vec(test_data);
/// ```
The lowest level method to decrypt data
The lowest level method to decrypt data
fn decrypt(&self, bytes: &[u8]) -> String {
        if bytes.get(12).is_none() {
            return String::from("")
        }
        let (nonce_bytes, cipher_bytes) = bytes.split_at(12);
        let nonce = GenericArray::from_slice(nonce_bytes);
        let decrypt_vec = self.cipher.decrypt(nonce, cipher_bytes).unwrap();
        String::from_utf8(decrypt_vec).unwrap_or_default()
    }
fn decrypt ( & self , bytes : & [ u8 ] ) -> String { if bytes . get ( 12 ) . is_none ( ) { return String :: from ( " " ) } let ( nonce_bytes , cipher_bytes ) = bytes . split_at ( 12 ) ; let nonce = GenericArray :: from_slice ( nonce_bytes ) ; let decrypt_vec = self . cipher . decrypt ( nonce , cipher_bytes ) . unwrap ( ) ; String :: from_utf8 ( decrypt_vec ) . unwrap_or_default ( ) }
The lowest level method to decrypt data
The lowest level method to decrypt data
&self
bytes
&[u8]
&self
bytes
&[u8]
example
```rust
use data_vault::encryption::traits::Encryption;
use data_vault::encryption::AesGcmSivEncryption.


` ` ` rust use data_vault :: encryption :: traits :: Encryption ; use data_vault :: encryption :: AesGcmSivEncryption .