]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: sha512 - Avoid stack bloat on i386
authorHerbert Xu <herbert@gondor.apana.org.au>
Sun, 5 Feb 2012 04:09:28 +0000 (15:09 +1100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 5 Feb 2012 04:09:28 +0000 (15:09 +1100)
commitcb666b907f0299caae054d3f1cf5488edb987f65
tree9f133af75426149336883da050848c4024ef2928
parent08e6b6c6f70bc48f173499c583ba8e0028508b6d
crypto: sha512 - Avoid stack bloat on i386

Unfortunately in reducing W from 80 to 16 we ended up unrolling
the loop twice.  As gcc has issues dealing with 64-bit ops on
i386 this means that we end up using even more stack space (>1K).

This patch solves the W reduction by moving LOAD_OP/BLEND_OP
into the loop itself, thus avoiding the need to duplicate it.

While the stack space still isn't great (>0.5K) it is at least
in the same ball park as the amount of stack used for our C sha1
implementation.

Note that this patch basically reverts to the original code so
the diff looks bigger than it really is.

Cc: stable@vger.kernel.org
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/sha512_generic.c