/// Authenticate the given plaintext and associated data using GHASH
Authenticate the given plaintext and associated data using GHASH
Authenticate the given plaintext and associated data using GHASH
fn compute_tag(&self, associated_data: &[u8], buffer: &[u8]) -> Tag {
        let mut ghash = self.ghash.clone();
        ghash.update_padded(associated_data);
        ghash.update_padded(buffer);
        let associated_data_bits = (associated_data.len() as u64) * 8;
        let buffer_bits = (buffer.len() as u64) * 8;
        let mut block = ghash::Block::default();
        block[..8].copy_from_slice(&associated_data_bits.to_be_bytes());
        block[8..].copy_from_slice(&buffer_bits.to_be_bytes());
        ghash.update(&block);
        ghash.finalize().into_bytes()
    }
fn compute_tag ( & self , associated_data : & [ u8 ] , buffer : & [ u8 ] ) -> Tag { let mut ghash = self . ghash . clone ( ) ; ghash . update_padded ( associated_data ) ; ghash . update_padded ( buffer ) ; let associated_data_bits = ( associated_data . len ( ) as u64 ) * 8 ; let buffer_bits = ( buffer . len ( ) as u64 ) * 8 ; let mut block = ghash :: Block :: default ( ) ; block [ .. 8 ] . copy_from_slice ( & associated_data_bits . to_be_bytes ( ) ) ; block [ 8 .. ] . copy_from_slice ( & buffer_bits . to_be_bytes ( ) ) ; ghash . update ( & block ) ; ghash . finalize ( ) . into_bytes ( ) }
Authenticate the given plaintext and associated data using GHASH
Authenticate the given plaintext and associated data using GHASH
&self
associated_data
&[u8]
buffer
&[u8]