crypto: salsa20-generic - cleanup and convert to skcipher API
authorEric Biggers <ebiggers@google.com>
Fri, 5 Jan 2018 19:09:57 +0000 (11:09 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 12 Jan 2018 12:03:41 +0000 (23:03 +1100)
commitb62b3db76f73c5a8cc132f78e7174bf57d582182
tree3884b118e59d0d5793a14ba891af62c130163409
parent148b974deea927f5dbb6c468af2707b488bfa2de
crypto: salsa20-generic - cleanup and convert to skcipher API

Convert salsa20-generic from the deprecated "blkcipher" API to the
"skcipher" API, in the process fixing it up to be thread-safe (as the
crypto API expects) by maintaining each request's state separately from
the transform context.

Also remove the unnecessary cra_alignmask and tighten validation of the
key size by accepting only 16 or 32 bytes, not anything in between.

These changes bring the code close to the way chacha20-generic does
things, so hopefully it will be easier to maintain in the future.

However, the way Salsa20 interprets the IV is still slightly different;
that was not changed.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/salsa20_generic.c