diff options
Diffstat (limited to 'module/icp/io/aes.c')
-rw-r--r-- | module/icp/io/aes.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/module/icp/io/aes.c b/module/icp/io/aes.c index 788bcef7d..96fb6bb1a 100644 --- a/module/icp/io/aes.c +++ b/module/icp/io/aes.c @@ -92,11 +92,6 @@ static crypto_mech_info_t aes_mech_info_tab[] = { AES_MIN_KEY_BYTES, AES_MAX_KEY_BYTES, CRYPTO_KEYSIZE_UNIT_IN_BYTES} }; -/* operations are in-place if the output buffer is NULL */ -#define AES_ARG_INPLACE(input, output) \ - if ((output) == NULL) \ - (output) = (input); - static void aes_provider_status(crypto_provider_handle_t, uint_t *); static crypto_control_ops_t aes_control_ops = { @@ -413,7 +408,7 @@ aes_encrypt(crypto_ctx_t *ctx, crypto_data_t *plaintext, == 0) && (plaintext->cd_length & (AES_BLOCK_LEN - 1)) != 0) return (CRYPTO_DATA_LEN_RANGE); - AES_ARG_INPLACE(plaintext, ciphertext); + ASSERT(ciphertext != NULL); /* * We need to just return the length needed to store the output. @@ -530,7 +525,7 @@ aes_decrypt(crypto_ctx_t *ctx, crypto_data_t *ciphertext, return (CRYPTO_ENCRYPTED_DATA_LEN_RANGE); } - AES_ARG_INPLACE(ciphertext, plaintext); + ASSERT(plaintext != NULL); /* * Return length needed to store the output. @@ -635,7 +630,7 @@ aes_encrypt_update(crypto_ctx_t *ctx, crypto_data_t *plaintext, ASSERT(ctx->cc_provider_private != NULL); aes_ctx = ctx->cc_provider_private; - AES_ARG_INPLACE(plaintext, ciphertext); + ASSERT(ciphertext != NULL); /* compute number of bytes that will hold the ciphertext */ out_len = aes_ctx->ac_remainder_len; @@ -705,7 +700,7 @@ aes_decrypt_update(crypto_ctx_t *ctx, crypto_data_t *ciphertext, ASSERT(ctx->cc_provider_private != NULL); aes_ctx = ctx->cc_provider_private; - AES_ARG_INPLACE(ciphertext, plaintext); + ASSERT(plaintext != NULL); /* * Compute number of bytes that will hold the plaintext. @@ -947,7 +942,7 @@ aes_encrypt_atomic(crypto_provider_handle_t provider, size_t length_needed; int ret; - AES_ARG_INPLACE(plaintext, ciphertext); + ASSERT(ciphertext != NULL); /* * CTR, CCM, GCM, and GMAC modes do not require that plaintext @@ -1073,7 +1068,7 @@ aes_decrypt_atomic(crypto_provider_handle_t provider, size_t length_needed; int ret; - AES_ARG_INPLACE(ciphertext, plaintext); + ASSERT(plaintext != NULL); /* * CCM, GCM, CTR, and GMAC modes do not require that ciphertext |