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 BC1F9C433EF for ; Mon, 11 Apr 2022 20:14:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CA38883E9E; Mon, 11 Apr 2022 22:14:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="OzNkolmR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B0ED383E99; Mon, 11 Apr 2022 22:14:23 +0200 (CEST) Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (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 7D80E83E82 for ; Mon, 11 Apr 2022 22:14:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x834.google.com with SMTP id ay4so1660141qtb.11 for ; Mon, 11 Apr 2022 13:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=yYfRaA9SddOC8tYbfiAdLiftH3ZRMj1rTZI1PxZA+wk=; b=OzNkolmR0U2NM2h0+gQu7OA2ZCQazb777EQOB6VZ9rAkI+7TTcwnIFucFU0D7FkxhC g0l5j3CvmmfRopfGBWND44vMNp+t6Q/VAC++GLtHGFfs1+8fIOwl2fMH5zKBjizj6M1f 2gTA6inAYlnFjG+MDF/jF9Th1Q/NP04IpOucg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yYfRaA9SddOC8tYbfiAdLiftH3ZRMj1rTZI1PxZA+wk=; b=iZtxXtkn7n3P4PY9jDJRe1AYaFrzm+OY4sEAgPMRWPPtr8R6l06ZUn9Gvn7j7lebIR xUSfPYQ1I6E5pI7rAppC4gEgQvdY2QIbstRqGSFJeAN+IfOjmQ0hvbUK1KCNQn4KaQ/t FPHDYxHngaD+au9WSk8B9tFTYk2ROHjbIaxdCSw5r2fpeRTZpOAAqk72G3iddPOdOaA4 QGMHyXOZH7ciN+TCFEtN66oryCTY2KtDX0bw+kTTUQ/5SgF/8WtQu7T2wu02T6++kMq2 Pd40PGg7q5fNzcsGcesw3dky1ulN1WaA07ZjEXSa7GGKz2DnL1i7Mun8ShlcmMTEZX9Z Lv0g== X-Gm-Message-State: AOAM530EJl6m/QZxwYNm7OFF7ed2vyZxoTA4lhzFmOAyc1NzGjVL6Mfi rJVxf0sMxMXv//f/YUkuPSQx9w== X-Google-Smtp-Source: ABdhPJw1w3nWOf9HQd75o5QBccdMuQEQxi1xDo6aj1YOAnt3okxGGlObJ41kDaLk5z+FBpS2Z+5AsQ== X-Received: by 2002:a05:622a:201:b0:2e1:f108:7782 with SMTP id b1-20020a05622a020100b002e1f1087782mr854507qtx.165.1649708058267; Mon, 11 Apr 2022 13:14:18 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-2ef0-5dff-fedb-a8ba.res6.spectrum.com. [2603:6081:7b01:cbda:2ef0:5dff:fedb:a8ba]) by smtp.gmail.com with ESMTPSA id m2-20020ae9e002000000b0069bfccd8f5esm4514817qkk.67.2022.04.11.13.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 13:14:17 -0700 (PDT) Date: Mon, 11 Apr 2022 16:14:15 -0400 From: Tom Rini To: SESA644425 Cc: sjg@chromium.org, gioja.hermann@non.se.com, mr.nuke.me@gmail.com, jamin_lin@aspeedtech.com, xypron.glpk@gmx.de, philippe.reynes@softathome.com, thomas.perrot@bootlin.com, u-boot@lists.denx.de Subject: Re: [PATCH 2/3] lib: rsa: Leverage existing data buffer instead of systematic copy Message-ID: <20220411201415.GQ14282@bill-the-cat> References: <20220309092717.4203-1-gioja.hermann@non.se.com> <20220309092717.4203-3-gioja.hermann@non.se.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5DrZbUHLOtSW14Wr" Content-Disposition: inline In-Reply-To: <20220309092717.4203-3-gioja.hermann@non.se.com> X-Clacks-Overhead: GNU Terry Pratchett 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 --5DrZbUHLOtSW14Wr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 09, 2022 at 01:27:16AM -0800, SESA644425 wrote: > Prior to introduction of modifications in rsassa_pss functions > related to padding verification, doing a pass to reduce memory > consumption of function by replacing memory copies of parts of > const buffer by pointers to the original buffer (masked_db and > h are subparts of msg buffer which is declared const, salt is a > subpart of db which is a working buffer, unmodified after being > filled). New pointers scope is limited to the function where > they are declared (not returned to caller by any mean), zeroing > risk of memory fault related to the change. >=20 > Signed-off-by: SESA644425 > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! --=20 Tom --5DrZbUHLOtSW14Wr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmJUjBcACgkQFHw5/5Y0 tyxnnwv8DRW8KbmAQlocTEmB3+oI9I9rUSaSCzBptjdHTu1kAmdwurBMwXZMIUsD 410+h+04LEZ1cQUyz5yksePGqhrWtD+HqvdDdy5xhwr3LO/V6vNx9J58jHQF8N7j RdYyhJxwRaeXM/xtIIUro31NxcoMVKEWSLibZgqzhcfaJ+JRG9zM9KqzUpH3w4/E usmbMznkD7JYc990rvpY+2N2J/eyAJvxsg23pCj2n/xd+YZEqwAzi11RzwSm8UY/ 4Er6aaLsT2JgwYi0JpNCgGOw5F695oepaco3kPl1qk5qT0iKtnWCoy342tyKLjR4 Fu4pIYKlhj+9DINh9jA7c7rZjU0VLekf9ZFgjsP1gordpaLxvzCvkQgzpfVdzVKG mXU4m5dEzADjJ24bjtdPS+OvqwwgzOde/6BDLG5OeQD4hBqoYOZFJhzyrgFTNy3j OPk65tdyYGo969khkZqIf2Qg3WTTDp8U5nrZ1AVSE4fwjZGeAVpQSOjIjZMoS7HA UGSiaQzA =w9mQ -----END PGP SIGNATURE----- --5DrZbUHLOtSW14Wr--