|
static grpc_status_code | aes_gcm_derive_aead_key (uint8_t *dst, const uint8_t *kdf_key, const uint8_t *kdf_counter) |
|
static void | aes_gcm_format_errors (const char *error_msg, char **error_details) |
|
static char * | aes_gcm_get_openssl_errors () |
|
static void | aes_gcm_mask_nonce (uint8_t *dst, const uint8_t *nonce, const uint8_t *mask) |
|
static grpc_status_code | aes_gcm_new_evp_cipher_ctx (gsec_aes_gcm_aead_crypter *aes_gcm_crypter, char **error_details) |
|
static grpc_status_code | aes_gcm_rekey_if_required (gsec_aes_gcm_aead_crypter *aes_gcm_crypter, const uint8_t *nonce, char **error_details) |
|
grpc_status_code | gsec_aes_gcm_aead_crypter_create (const uint8_t *key, size_t key_length, size_t nonce_length, size_t tag_length, bool rekey, gsec_aead_crypter **crypter, char **error_details) |
|
static grpc_status_code | gsec_aes_gcm_aead_crypter_decrypt_iovec (gsec_aead_crypter *crypter, const uint8_t *nonce, size_t nonce_length, const struct iovec *aad_vec, size_t aad_vec_length, const struct iovec *ciphertext_vec, size_t ciphertext_vec_length, struct iovec plaintext_vec, size_t *plaintext_bytes_written, char **error_details) |
|
static void | gsec_aes_gcm_aead_crypter_destroy (gsec_aead_crypter *crypter) |
|
static grpc_status_code | gsec_aes_gcm_aead_crypter_encrypt_iovec (gsec_aead_crypter *crypter, const uint8_t *nonce, size_t nonce_length, const struct iovec *aad_vec, size_t aad_vec_length, const struct iovec *plaintext_vec, size_t plaintext_vec_length, struct iovec ciphertext_vec, size_t *ciphertext_bytes_written, char **error_details) |
|
static grpc_status_code | gsec_aes_gcm_aead_crypter_key_length (const gsec_aead_crypter *crypter, size_t *key_length, char **error_details) |
|
static grpc_status_code | gsec_aes_gcm_aead_crypter_max_ciphertext_and_tag_length (const gsec_aead_crypter *crypter, size_t plaintext_length, size_t *max_ciphertext_and_tag_length, char **error_details) |
|
static grpc_status_code | gsec_aes_gcm_aead_crypter_max_plaintext_length (const gsec_aead_crypter *crypter, size_t ciphertext_and_tag_length, size_t *max_plaintext_length, char **error_details) |
|
static grpc_status_code | gsec_aes_gcm_aead_crypter_nonce_length (const gsec_aead_crypter *crypter, size_t *nonce_length, char **error_details) |
|
static grpc_status_code | gsec_aes_gcm_aead_crypter_tag_length (const gsec_aead_crypter *crypter, size_t *tag_length, char **error_details) |
|
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.
Definition at line 633 of file aes_gcm.cc.