Re: [PATCH v2] crypto: x86/chacha20 - Manually align stack buffer

2017-01-11 Thread Ard Biesheuvel
On 11 January 2017 at 12:28, Herbert Xu wrote: > On Wed, Jan 11, 2017 at 12:14:24PM +, Ard Biesheuvel wrote: >> >> I think the old code was fine, actually: >> >> u32 *state, state_buf[16 + (CHACHA20_STATE_ALIGN / sizeof(u32)) - 1]; >> >> ends up allocating 16 + 3 *words* == 64 + 12 bytes , whi

[PATCH v2] crypto: x86/chacha20 - Manually align stack buffer

2017-01-11 Thread Herbert Xu
On Wed, Jan 11, 2017 at 12:14:24PM +, Ard Biesheuvel wrote: > > I think the old code was fine, actually: > > u32 *state, state_buf[16 + (CHACHA20_STATE_ALIGN / sizeof(u32)) - 1]; > > ends up allocating 16 + 3 *words* == 64 + 12 bytes , which given the > guaranteed 4 byte alignment is suffici