fn decrypt_expiry(
        &self,
        payload: &mut [u8; PAYLOAD_LEN],
        tag: &[u8],
        iv: &[u8],
    ) -> Result<u64, Error> {
        // Create Nonce object from initialization vector.
        let nonce = Nonce::from_slice(iv);
        // Decrypt expiry as vector of bytes from ciphertext.
        self.cipher
            .decrypt_in_place_detached(
                nonce,
                self.aad.as_bytes(),
                payload,
                aes_gcm::Tag::from_slice(tag),
            )
            .map_err(|_| Error::ExpiryExtraction)?;
        let expiry_as_bytes = payload[..]
            .try_into()
            .map_err(|_| Error::ExpiryExtraction)?;

        // Return expiry value in seconds.
        Ok(u64::from_le_bytes(expiry_as_bytes))
    }
/// Decrypt ciphertext composed of payload and tag to obtain the expiry value.
Decrypt ciphertext composed of payload and tag to obtain the expiry value.
Decrypt ciphertext composed of payload and tag to obtain the expiry value .
fn decrypt_expiry(
        &self,
        payload: &mut [u8; PAYLOAD_LEN],
        tag: &[u8],
        iv: &[u8],
    ) -> Result<u64, Error> {
        // Create Nonce object from initialization vector.
        let nonce = Nonce::from_slice(iv);
        // Decrypt expiry as vector of bytes from ciphertext.
        self.cipher
            .decrypt_in_place_detached(
                nonce,
                self.aad.as_bytes(),
                payload,
                aes_gcm::Tag::from_slice(tag),
            )
            .map_err(|_| Error::ExpiryExtraction)?;
        let expiry_as_bytes = payload[..]
            .try_into()
            .map_err(|_| Error::ExpiryExtraction)?;
        // Return expiry value in seconds.
        Ok(u64::from_le_bytes(expiry_as_bytes))
    }
fn decrypt_expiry ( & self , payload : & mut [ u8 ; PAYLOAD_LEN ] , tag : & [ u8 ] , iv : & [ u8 ] , ) -> Result < u64 , Error > { // Create Nonce object from initialization vector. let nonce = Nonce :: from_slice ( iv ) ; // Decrypt expiry as vector of bytes from ciphertext. self . cipher . decrypt_in_place_detached ( nonce , self . aad . as_bytes ( ) , payload , aes_gcm :: Tag :: from_slice ( tag ) , ) . map_err ( | _ | Error :: ExpiryExtraction ) ? ; let expiry_as_bytes = payload [ .. ] . try_into ( ) . map_err ( | _ | Error :: ExpiryExtraction ) ? ; // Return expiry value in seconds. Ok ( u64 :: from_le_bytes ( expiry_as_bytes ) ) }
Decrypt ciphertext composed of payload and tag to obtain the expiry value.
Decrypt ciphertext composed of payload and tag to obtain the expiry value .
&self
payload
&mut [u8; PAYLOAD_LEN]
tag
&[u8]
iv
&[u8]
&self
payload
&mut [u8; PAYLOAD_LEN]
tag
&[u8]
iv
&[u8]