OSDN Git Service

crypto: x86/salsa20 - cleanup and convert to skcipher API
authorEric Biggers <ebiggers@google.com>
Fri, 5 Jan 2018 19:09:59 +0000 (11:09 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 12 Jan 2018 12:03:43 +0000 (23:03 +1100)
commitc9a3ff8f22a2df5ec6de18ba616a863392269a10
tree09cce6d09bcdfd0b84aff74058b38bdf8346fc3f
parenteb772f37ae8163a89e28a435f6a18742ae06653b
crypto: x86/salsa20 - cleanup and convert to skcipher API

Convert salsa20-asm from the deprecated "blkcipher" API to the
"skcipher" API, in the process fixing it up to use the generic helpers.
This allows removing the salsa20_keysetup() and salsa20_ivsetup()
assembly functions, which aren't performance critical; the C versions do
just fine.

This also fixes the same bug that salsa20-generic had, where the state
array was being maintained directly in the transform context rather than
on the stack or in the request context.  Thus, if multiple threads used
the same Salsa20 transform concurrently they produced the wrong results.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/salsa20-i586-asm_32.S
arch/x86/crypto/salsa20-x86_64-asm_64.S
arch/x86/crypto/salsa20_glue.c
crypto/Kconfig