]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit428baeb4ed195483b33c599951ec23569f4d2fbb
tree3884b118e59d0d5793a14ba891af62c130163409
parent237cfa1f1c59bfb2ca17c7b36fb1f5e43a492c27
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