From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C097BC433EF for ; Wed, 1 Jun 2022 18:27:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 617D484308; Wed, 1 Jun 2022 20:26:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="m2ZlL5Mr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 55245842FA; Wed, 1 Jun 2022 20:26:43 +0200 (CEST) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 42888842EA for ; Wed, 1 Jun 2022 20:26:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=loic.poulain@linaro.org Received: by mail-wr1-x435.google.com with SMTP id k16so3486478wrg.7 for ; Wed, 01 Jun 2022 11:26:37 -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; bh=gMyVf0z8ELy4OJBY+5pNJ/DtFVWLyBR7Gr3yxzzebhc=; b=m2ZlL5MrrA1qKHPAKuvZEso6+Mf5e3ZmMlBP12uvP+1xiw8f8ZzVxEMvxwYo72etPS d9d5VM4oqpAd/u1OtIYuTux+CCT+TGlSvBEg4aLFi+ImEHwcG6uwK2G/DhYLa7dtuX9l lRYYcdNGeIJkVPOsaoPPtxw4Ggw/Kb5lIRwv7xbKUijBbn6Rta2R9WqL4TdnLHn6cVey UohAcZujrzdCx78k7IPxo6tlCBRpwH3L1I0DedNloF/5F4+CLux9YEo5HTq/ups58tUm DiaI0sfm5Dcc9nrMbOqkxj+GFdgC/9X08XsOP2mYi5kaCMfJplNwvRNG55HLou3EsGtZ MWKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gMyVf0z8ELy4OJBY+5pNJ/DtFVWLyBR7Gr3yxzzebhc=; b=yKsNxCjovntnUyqvJAkdSEZloi2egv0VTsXqEruC38fDKPrINoN1UwYHM+V1l+AcuJ 2Jr+ZiO+G+Q9p6RmBMR1qj1pM3cTKN337U0Y7Gzh5IuHdst5OID+T6cK0weMUnqmM2S9 UbOU6dsRjJux2tL4oLHPO8ZqdUwL8lNEfKnxBPsmJi/iw+UHgt/1Ao1lG6RgAj2KDNDc PwXE7UE+mCtO2QM+Y1nFp/xFy/YRM6ECFrUhAeKg/mtM6Z+wrPBFFDT1wiFGXjJs5FLl LmEonqqTFZ+ytbH8v+/guW+Z2gHbRLypOvZ1KyAFedZOuVMmqM6aTLlrcb1SSpb+Q8Hg mXyA== X-Gm-Message-State: AOAM532tW9fN7DO9V/Js8l1o6MxyNFVpyD1IEtiA6X83a94JYrfDE7Bb gEI66+e5Lr8X8jXo8reBAg4zEw== X-Google-Smtp-Source: ABdhPJyyQpUS8oZ7VccaXEwWQS1zJ19dV49Kk0m///zm4SsTJkFCdTxmSmEJKzEn8F0uK9Bob+bIdQ== X-Received: by 2002:adf:ea51:0:b0:212:49af:a519 with SMTP id j17-20020adfea51000000b0021249afa519mr588926wrn.95.1654107996735; Wed, 01 Jun 2022 11:26:36 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:58:ccc3:729d:30c2]) by smtp.gmail.com with ESMTPSA id m30-20020a05600c3b1e00b00395f15d993fsm6672837wms.5.2022.06.01.11.26.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jun 2022 11:26:36 -0700 (PDT) From: Loic Poulain To: trini@konsulko.com Cc: u-boot@lists.denx.de, michal.simek@xilinx.com, kettenis@openbsd.org, Loic Poulain Subject: [PATCH v2 2/5] sha1: Fix digest state size/type Date: Wed, 1 Jun 2022 20:26:28 +0200 Message-Id: <1654107991-598-3-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1654107991-598-1-git-send-email-loic.poulain@linaro.org> References: <1654107991-598-1-git-send-email-loic.poulain@linaro.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean sha1 digest size is 5*32-bit => 160-bit. Using 64-bit unsigned long does not cause issue with the current sha1 implementation, but could be problematic for vectorized access. Signed-off-by: Loic Poulain --- include/u-boot/sha1.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/u-boot/sha1.h b/include/u-boot/sha1.h index 283f103..09fee59 100644 --- a/include/u-boot/sha1.h +++ b/include/u-boot/sha1.h @@ -30,7 +30,7 @@ extern const uint8_t sha1_der_prefix[]; typedef struct { unsigned long total[2]; /*!< number of bytes processed */ - unsigned long state[5]; /*!< intermediate digest state */ + uint32_t state[5]; /*!< intermediate digest state */ unsigned char buffer[64]; /*!< data block being processed */ } sha1_context; -- 2.7.4