pub struct GcmMessageParams<'a> { /* private fields */ }Expand description
Parameters for message based AES-GCM operations.
Implementations§
Source§impl<'a> GcmMessageParams<'a>
impl<'a> GcmMessageParams<'a>
Sourcepub fn new(
iv: &'a mut [u8],
iv_fixed_bits: Ulong,
iv_generator: GeneratorFunction,
tag: &'a mut [u8],
) -> Result<Self, Error>
pub fn new( iv: &'a mut [u8], iv_fixed_bits: Ulong, iv_generator: GeneratorFunction, tag: &'a mut [u8], ) -> Result<Self, Error>
Construct GCM parameters for message based operations
§Arguments
iv - The initialization vector. This must be non-empty. In PKCS#11
3.0, the maximum length of the IV is 256 bytes. A 12-byte IV may be
processed more efficiently than other lengths.
iv_fixed_bits - number of bits of the original IV to preserve when
generating an new IV. These bits are counted from the Most significant
bits (to the right).
iv_generator - Function used to generate a new IV. Each IV must be
unique for a given session.
tag - The buffer to store the tag. Either to be passed in or returned if generated by
token.
§Errors
This function returns an error if the length of iv does not
fit into an Ulong.
Sourcepub fn iv_fixed_bits(&self) -> Ulong
pub fn iv_fixed_bits(&self) -> Ulong
The length, in bits, of fixed part of the IV.
Sourcepub fn iv_generator(&self) -> GeneratorFunction
pub fn iv_generator(&self) -> GeneratorFunction
The IV generator.
Trait Implementations§
Source§impl<'a> Clone for GcmMessageParams<'a>
impl<'a> Clone for GcmMessageParams<'a>
Source§fn clone(&self) -> GcmMessageParams<'a>
fn clone(&self) -> GcmMessageParams<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more