From: Alexey Dobriyan Subject: Re: [PATCH 2/3] sha512: reduce stack usage to safe number Date: Mon, 16 Jan 2012 12:20:47 +0200 Message-ID: References: <20120114204127.GA4100@p183.telecom.by> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: Linus Torvalds , Herbert Xu , linux-crypto@vger.kernel.org, netdev@vger.kernel.org, ken@codelabs.ch, Steffen Klassert , Eric Dumazet , security@kernel.org To: David Laight Return-path: Received: from mail-tul01m020-f174.google.com ([209.85.214.174]:55441 "EHLO mail-tul01m020-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753805Ab2APKUr (ORCPT ); Mon, 16 Jan 2012 05:20:47 -0500 In-Reply-To: Sender: linux-crypto-owner@vger.kernel.org List-ID: On 1/16/12, David Laight wrote: > Doesn't this badly overflow W[] .. > >> +#define SHA512_0_15(i, a, b, c, d, e, f, g, h) \ >> + t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[i]; \ > ... >> + for (i = 0; i < 16; i += 8) { > ... >> + SHA512_0_15(i + 7, b, c, d, e, f, g, h, a); >> + } No, why should it? i can be only 0 and 8.