[PATCH] lib/sha1: remove memsets and allocate workspace on the stack

2011-08-08 Thread Mandeep Singh Baines
The previous implementation required the workspace to be passed in as a parameter. This prevents the compiler from being able to store the workspace in registers. I've also removed the memset since that also prevents the compiler from storing the workspace in registers. There is no loss of securit

Re: [PATCH] lib/sha1: remove memsets and allocate workspace on the stack

2011-08-08 Thread Joe Perches
On Mon, 2011-08-08 at 16:07 -0700, Mandeep Singh Baines wrote: > The previous implementation required the workspace to be passed in as > a parameter. This prevents the compiler from being able to store the > workspace in registers. I've also removed the memset since that also > prevents the compile

Re: [PATCH] lib/sha1: remove memsets and allocate workspace on the stack

2011-08-08 Thread Linus Torvalds
On Mon, Aug 8, 2011 at 4:07 PM, Mandeep Singh Baines wrote: > > There is no loss of security due to removing the memset. It would be a > bug for the stack to leak to userspace. However, a defence-in-depth > argument could be made for keeping the clearing of the workspace. So I'm nervous about thi

Re: [PATCH] lib/sha1: remove memsets and allocate workspace on the stack

2011-08-08 Thread Mandeep Singh Baines
Joe Perches (j...@perches.com) wrote: > On Mon, 2011-08-08 at 16:07 -0700, Mandeep Singh Baines wrote: > > The previous implementation required the workspace to be passed in as > > a parameter. This prevents the compiler from being able to store the > > workspace in registers. I've also removed the