diff options
author | Daiki Ueno <ueno@gnu.org> | 2023-04-24 15:14:29 +0000 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2023-04-24 15:14:29 +0000 |
commit | 643342325a15e652fedac27b7bcb4614a242ab0d (patch) | |
tree | ad363fb38e8b65c942876641cda9c76caa13b498 /lib/accelerated/x86/aes-cbc-x86-aesni.c | |
parent | 075111577a169aa9be9dabdb6d167ddfc280b9e6 (diff) | |
parent | aa5950abab56b011331ad4331409b6ff8efb8aeb (diff) | |
download | gnutls-643342325a15e652fedac27b7bcb4614a242ab0d.tar.gz |
Merge branch 'wip/dueno/clang-format' into 'master'
build: switch to using clang-format instead of GNU indent
See merge request gnutls/gnutls!1727
Diffstat (limited to 'lib/accelerated/x86/aes-cbc-x86-aesni.c')
-rw-r--r-- | lib/accelerated/x86/aes-cbc-x86-aesni.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/lib/accelerated/x86/aes-cbc-x86-aesni.c b/lib/accelerated/x86/aes-cbc-x86-aesni.c index 3029701b8d..cf3c81df1a 100644 --- a/lib/accelerated/x86/aes-cbc-x86-aesni.c +++ b/lib/accelerated/x86/aes-cbc-x86-aesni.c @@ -40,13 +40,13 @@ struct aes_ctx { int enc; }; -static int -aes_cipher_init(gnutls_cipher_algorithm_t algorithm, void **_ctx, int enc) +static int aes_cipher_init(gnutls_cipher_algorithm_t algorithm, void **_ctx, + int enc) { /* we use key size to distinguish */ - if (algorithm != GNUTLS_CIPHER_AES_128_CBC - && algorithm != GNUTLS_CIPHER_AES_192_CBC - && algorithm != GNUTLS_CIPHER_AES_256_CBC) + if (algorithm != GNUTLS_CIPHER_AES_128_CBC && + algorithm != GNUTLS_CIPHER_AES_192_CBC && + algorithm != GNUTLS_CIPHER_AES_256_CBC) return GNUTLS_E_INVALID_REQUEST; *_ctx = gnutls_calloc(1, sizeof(struct aes_ctx)); @@ -68,13 +68,11 @@ static int aes_cipher_setkey(void *_ctx, const void *userkey, size_t keysize) CHECK_AES_KEYSIZE(keysize); if (ctx->enc) - ret = - aesni_set_encrypt_key(userkey, keysize * 8, - ALIGN16(&ctx->expanded_key)); + ret = aesni_set_encrypt_key(userkey, keysize * 8, + ALIGN16(&ctx->expanded_key)); else - ret = - aesni_set_decrypt_key(userkey, keysize * 8, - ALIGN16(&ctx->expanded_key)); + ret = aesni_set_decrypt_key(userkey, keysize * 8, + ALIGN16(&ctx->expanded_key)); if (ret != 0) return gnutls_assert_val(GNUTLS_E_ENCRYPTION_FAILED); @@ -93,9 +91,8 @@ static int aes_setiv(void *_ctx, const void *iv, size_t iv_size) return 0; } -static int -aes_encrypt(void *_ctx, const void *src, size_t src_size, - void *dst, size_t dst_size) +static int aes_encrypt(void *_ctx, const void *src, size_t src_size, void *dst, + size_t dst_size) { struct aes_ctx *ctx = _ctx; @@ -110,9 +107,8 @@ aes_encrypt(void *_ctx, const void *src, size_t src_size, return 0; } -static int -aes_decrypt(void *_ctx, const void *src, size_t src_size, - void *dst, size_t dst_size) +static int aes_decrypt(void *_ctx, const void *src, size_t src_size, void *dst, + size_t dst_size) { struct aes_ctx *ctx = _ctx; |