This method creates an AEAD crypter instance of AES-GCM encryption scheme which supports 16 and 32 bytes long keys, 12 and 16 bytes long nonces, and 16 bytes long tags.
It should be noted that once the lengths of key, nonce, and tag are determined at construction time, they cannot be modified later.
- key: buffer containing a key which is binded with AEAD crypter instance.
- key_length: length of a key in bytes, which should be 44 if rekeying is enabled and 16 or 32 otherwise.
- nonce_length: length of a nonce in bytes, which should be either 12 or 16.
- tag_length: length of a tag in bytes, which should be always 16.
- rekey: enable nonce-based rekeying and nonce-masking.
- crypter: address of AES_GCM crypter instance returned from the method.
- error_details: a buffer containing an error message if the method does not function correctly. It is legal to pass nullptr into error_details, and otherwise, the parameter should be freed with gpr_free.
On success of instance creation, it stores the address of instance at crypter. Otherwise, it returns an error status code together with its details specified in error_details.