From patchwork Thu Aug 13 03:25:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247653 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp925518ilo; Wed, 12 Aug 2020 20:27:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwysmyN2EfuftRjOR3Cy+5r6fGDekLun1DU/2BV6v2ITwN6Xit/xJ0p9nFIOfbTQNY2EZmF X-Received: by 2002:a5b:f4e:: with SMTP id y14mr3986906ybr.71.1597289256200; Wed, 12 Aug 2020 20:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597289256; cv=none; d=google.com; s=arc-20160816; b=avqQmX6oWoGT2I2U3fyUpUifKHMFCuF2PZDgX92aoMN0OtN6znrTx4G+fkJi32jrnw IP4waYKmvVoAI0menIaa/sl7gHNlAfe5PzxBiVc4dXfqHAl3yqHf/uUkSGO3YbbrZSZl J/WDxTo8tl16JnaNFU12NUNJSkf7Z2IpYvqyE/XEA0We/JrdengEvRCaVxDVhPyk7HfC d+sWANjQOZRGVFDRnLhl8NvDlo2yPVg3UyL2gRlFozPviJQr13+Jlt+e93gF1eG6kYX4 01hjNSyspTq+aK4Jkpq0otr8hNX3VeYwJO+x/9xu6P9E0oZQkGHup99KrjAqU7ZrwTU8 lbMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=3RRutFcQg2BpL8FgLWbZKREr0UCat+CTMLpox4B8wnA=; b=U0YEjGFmO3UDtABSvBP2Q59G1AYLmGOP8nIhyeYKte9KKJiwCwSc01fBEb8aEJo8qJ 9bHjY30X6ajPX4017D5UVpG4S1seFfx58zAFQtEhT2CW3zchHLFP1O5EyWRpVB4MGxb5 xlre2BIU4I7MjLxA7qr843dHPgcuxkQrOpe3T8xy3zw2DwXw0rXKY4COH2zczPbs7Xry RaESV9KhRYt7CZ34F/B+qRIRM0b9123Uqg6HQU6e1EbNGSHZqi6nnY2TuohQev33yRJh SSrV/TEr6fY4e9rxGVE4IxTi4SA6EQlxpQj7Y+5/5TtiNw9n3cjvtpujkZuFEI1ZoK4j uzAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YGRkdWv5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n134si3939765yba.4.2020.08.12.20.27.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Aug 2020 20:27:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YGRkdWv5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k63tv-0008FB-La for patch@linaro.org; Wed, 12 Aug 2020 23:27:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k63sM-00058N-1p for qemu-devel@nongnu.org; Wed, 12 Aug 2020 23:25:58 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:33245) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k63sJ-00009b-1B for qemu-devel@nongnu.org; Wed, 12 Aug 2020 23:25:57 -0400 Received: by mail-pj1-x1033.google.com with SMTP id i92so3676272pje.0 for ; Wed, 12 Aug 2020 20:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3RRutFcQg2BpL8FgLWbZKREr0UCat+CTMLpox4B8wnA=; b=YGRkdWv567UbOlcuN8Ax0gBxX7z6zG292NL68TSsoraHI94SqhfCnsszj58cBoKDYi 4QpYQl9kQ/GCnhrmAXY3MacmhRxN3oJI/vfdKtaasjFLwFDuKdvHM4+3+11Q2J+SwrJH +wYla47O8pzTG76aBQ2ODdEWKRVuJxKDv1MG675CMFan+E8IjP3IgCBjNoiya8W4yUa1 sAfgLltyN/ezDmiHuJ7zyJccSgAS1uAwd5WIBvOSqYR8ipsNwDjjG8ELmT//0efeORka bc+L8jO3xg3z8/UEIbfnIeUPILnLrQ9vosOSYoyaPbHjDzrRl/C2sNDEHqXVPs1w2+lx Aqwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3RRutFcQg2BpL8FgLWbZKREr0UCat+CTMLpox4B8wnA=; b=dnq9uGJJE9gHoqwpXIgPhmvIRL0OJFwSZ2iyp4chJzuLmqWsSqV7PfJlpv3AOT1N2C 7QOjMzi17WYxgmPS1ykcGos/KqxoI71Qh4hcTrtqTsF9vTZ70JRGSRPsYE0yTPQNwTbO 7lXiG7gILH9kO4Z7/1GI6g3z1YcZhhWnczFLtLaa+hqz6T0HgQa8SFwYos01Y/b6stPr Q6n5AHANArwyqg1cAo8D7HDl7+F37fXN1dT9Tou1sqxDHvV1NNDTsO+AlOHo1lVnAq96 NAKchxghQHwh79tgWraK1Bl1GDUK1jg7bB8t3Y/lY6TNOHhPuYFBNQHHaaV6xIaZD1Hv 3I3g== X-Gm-Message-State: AOAM533NdpTgPGMuWIkrUBiJ9tk3tvDRtQPkhc5mos4Vy+5ZQhf8tvtL tsWC74zk2qDGAnskulqRAdw0ftp1fEc= X-Received: by 2002:a17:90b:384b:: with SMTP id nl11mr3029362pjb.91.1597289153374; Wed, 12 Aug 2020 20:25:53 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id m19sm3633164pgd.21.2020.08.12.20.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2020 20:25:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 10/17] crypto: Constify cipher data tables Date: Wed, 12 Aug 2020 20:25:30 -0700 Message-Id: <20200813032537.2888593-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200813032537.2888593-1-richard.henderson@linaro.org> References: <20200813032537.2888593-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- crypto/cipher.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé 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,