[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/17] crypto: Constify cipher data tables
From: |
Richard Henderson |
Subject: |
[PATCH 10/17] crypto: Constify cipher data tables |
Date: |
Wed, 12 Aug 2020 20:25:30 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
crypto/cipher.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/cipher.c b/crypto/cipher.c
index 6e25f68f5c..2fe12a4fdc 100644
--- a/crypto/cipher.c
+++ b/crypto/cipher.c
@@ -25,7 +25,7 @@
#include "cipherpriv.h"
-static size_t alg_key_len[QCRYPTO_CIPHER_ALG__MAX] = {
+static const size_t alg_key_len[QCRYPTO_CIPHER_ALG__MAX] = {
[QCRYPTO_CIPHER_ALG_AES_128] = 16,
[QCRYPTO_CIPHER_ALG_AES_192] = 24,
[QCRYPTO_CIPHER_ALG_AES_256] = 32,
@@ -40,7 +40,7 @@ static size_t alg_key_len[QCRYPTO_CIPHER_ALG__MAX] = {
[QCRYPTO_CIPHER_ALG_TWOFISH_256] = 32,
};
-static size_t alg_block_len[QCRYPTO_CIPHER_ALG__MAX] = {
+static const size_t alg_block_len[QCRYPTO_CIPHER_ALG__MAX] = {
[QCRYPTO_CIPHER_ALG_AES_128] = 16,
[QCRYPTO_CIPHER_ALG_AES_192] = 16,
[QCRYPTO_CIPHER_ALG_AES_256] = 16,
@@ -55,7 +55,7 @@ static size_t alg_block_len[QCRYPTO_CIPHER_ALG__MAX] = {
[QCRYPTO_CIPHER_ALG_TWOFISH_256] = 16,
};
-static bool mode_need_iv[QCRYPTO_CIPHER_MODE__MAX] = {
+static const bool mode_need_iv[QCRYPTO_CIPHER_MODE__MAX] = {
[QCRYPTO_CIPHER_MODE_ECB] = false,
[QCRYPTO_CIPHER_MODE_CBC] = true,
[QCRYPTO_CIPHER_MODE_XTS] = true,
--
2.25.1
- Re: [PATCH 05/17] crypto: Remove redundant includes, (continued)
- [PATCH 06/17] crypto/nettle: Fix xts_encrypt arguments, Richard Henderson, 2020/08/12
- [PATCH 07/17] crypto: Use the correct const type for driver, Richard Henderson, 2020/08/12
- [PATCH 08/17] crypto: Allocate QCryptoCipher with the subclass, Richard Henderson, 2020/08/12
- [PATCH 09/17] crypto: Move cipher->driver init to qcrypto_*_cipher_ctx_new, Richard Henderson, 2020/08/12
- [PATCH 10/17] crypto: Constify cipher data tables,
Richard Henderson <=
- [PATCH 11/17] crypto/builtin: Remove odd-sized AES block handling, Richard Henderson, 2020/08/12
- [PATCH 12/17] crypto/builtin: Merge qcrypto_cipher_aes_{ecb, xts}_{en, de}crypt, Richard Henderson, 2020/08/12
- [PATCH 13/17] crypto/builtin: Move AES_cbc_encrypt into cipher-builtin.inc.c, Richard Henderson, 2020/08/12