From patchwork Tue Jun 19 11:52:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Kanstrup X-Patchwork-Id: 931556 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sony.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QeoKdWwI"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4195vl3M2nz9s4n for ; Tue, 19 Jun 2018 21:53:39 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=GhSwb4GW2GMU4i1gZ0BXX7x/KD6xa0oFSO3fv5v+neI=; b=QeoKdWwITHEM6N YYeus3iIIfcdxSLp8WSdLW7SFM30dWJOtrNfyPSOCcj7FNhSE2aTzaigcR4sJfP+RfaW6X+MvZJwF s1WsRNBRG3H7JRFBQ5kV8raHYTfQ0/pP6JIZedYnluU/Oir8Pd5ium5plsBIZNQkmJAw4nEBOhQfP sa4VXMmXGRPHJRbDuLJyD9coJNyzz6f+jveWCwmaeDPCNM5sYCGZ7N565vXRccL1XK4lZb90VzZZ3 ZOQdFInpwHcHKRDOHurmaQFtpeWM0ayWtgMTqfCzAcQiVSSu/+ThMWisS/NOa2irog/t/wp0src/I 3EuCsx+vhp12RgbLMYwg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVFCL-0006hr-Ei; Tue, 19 Jun 2018 11:53:21 +0000 Received: from seldsegrel01.sonyericsson.com ([37.139.156.29]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVFC4-0006gz-7B for hostap@lists.infradead.org; Tue, 19 Jun 2018 11:53:06 +0000 From: Mikael Kanstrup To: Subject: [PATCH] Crypto internal: Make MD4 PADDING array const Date: Tue, 19 Jun 2018 13:52:29 +0200 Message-ID: <20180619115229.3654-1-mikael.kanstrup@sony.com> X-Mailer: git-send-email 2.10.1.502.g6598894 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180619_045304_422648_A4606694 X-CRM114-Status: UNSURE ( 7.77 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [37.139.156.29 listed in list.dnswl.org] 0.0 T_SPF_PERMERROR SPF: test of record failed (permerror) X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The PADDING array used when adding padding bits in MD4 never change so can be made const. Making it const puts the array in .rodata section and can save a few bytes of RAM for systems running without virtual memory. Signed-off-by: Mikael Kanstrup --- src/crypto/md4-internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/md4-internal.c b/src/crypto/md4-internal.c index d9c737a..cf408e8 100644 --- a/src/crypto/md4-internal.c +++ b/src/crypto/md4-internal.c @@ -85,7 +85,7 @@ MD4Transform(u32 state[4], const u8 block[MD4_BLOCK_LENGTH]); (cp)[1] = (value) >> 8; \ (cp)[0] = (value); } while (0) -static u8 PADDING[MD4_BLOCK_LENGTH] = { +static const u8 PADDING[MD4_BLOCK_LENGTH] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0