From patchwork Wed Jun 1 18:26:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 577822 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:8f0c:0:0:0:0 with SMTP id mq12csp856149mab; Wed, 1 Jun 2022 11:27:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9ignoUAhEVcYlRPX9igeql3gr96NFGANOc9KbVqDW6TKJlhG+URaeTS0UIchyP9htG7cA X-Received: by 2002:a5d:9d8b:0:b0:663:9916:da83 with SMTP id ay11-20020a5d9d8b000000b006639916da83mr631157iob.116.1654108051768; Wed, 01 Jun 2022 11:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654108051; cv=none; d=google.com; s=arc-20160816; b=AQvl6KMP+DcDWrKuCn45Acsv1+bPg4nUJVq6JR0TjhGs93syuExrd5d2nf9q9ZtV6H k0WCsdjd0XT16jpGmOxt3sYfUzaztz31AVRAmBYrJSEOsSThEx42TtRTlj1ubgX0M+xX 99iKg+fhxviuNgZWzj99hXHOjpJcP6o6GVVqUK6EyRRGsKFrXRd4Ypy/HlhGWaBEiOn8 1VZuABdt7q+X40rcXJCo0nRNHs96i+30cjz5H+GtoMwh5pKWC10Fy3FBY2U7CzwFjhZv qDVCN3VBEjAwBe9Rkly14xd2zX2hAu8SWZH11C4zB7RSPdfcB+l3uOljHs6D30Aqy6cz +X9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=gMyVf0z8ELy4OJBY+5pNJ/DtFVWLyBR7Gr3yxzzebhc=; b=lbb/2uVhnHZxYPX0zr6VC/+Zxx6tRaxJofnVIkdfNaJ9c2Be92ZzdWjbAF1etnDUNv fh5Q/xwBeVq8f6/RL6gGtN6YDKxf3zYF5Wl3zX2WUCc0sp19PTCfcKYpYOMEfQKeykd8 RTYDJEh+l2xKJtFyOJZ/cnM0v8QwmLHeJ6zJnz8c6OB7Jt1hPYFEyP9G9Nrr7Qiubjg+ whIK2RYchxsB/dmKKPOpyxJ041m3iJX5o4/fMUDOrUHphu264KJSYk/3O+rOg01rHQDG AXKwPHTtz9MHZJ8gaJwE6xtJZiGsCXFRqJ+xpup7jsA0hA1drIvJ53ilRfsjcOeC1kqo k2nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m2ZlL5Mr; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id i23-20020a023b57000000b00330a26a54e5si2435481jaf.94.2022.06.01.11.27.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 11:27:31 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m2ZlL5Mr; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 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-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;