Re: [v2 PATCH 4/16] crypto: xts - Convert to skcipher

2016-11-15 Thread Herbert Xu
On Sun, Nov 13, 2016 at 06:10:29PM -0800, Eric Biggers wrote: > > There's duplicated code for encryption and decryption here. AFAICS, the only > difference between XTS encryption and decryption is whether the block cipher > is > used in encryption or decryption mode for the ECB step. So I sugges

Re: [v2 PATCH 4/16] crypto: xts - Convert to skcipher

2016-11-13 Thread Eric Biggers
On Sun, Nov 13, 2016 at 07:45:35PM +0800, Herbert Xu wrote: > +static int do_encrypt(struct skcipher_request *req, int err) > +{ > + struct rctx *rctx = skcipher_request_ctx(req); > + struct skcipher_request *subreq; > + > + subreq = &rctx->subreq; > + > + while (!err && rctx->left)

[v2 PATCH 4/16] crypto: xts - Convert to skcipher

2016-11-13 Thread Herbert Xu
This patch converts xts over to the skcipher interface. It also optimises the implementation to be based on ECB instead of the underlying cipher. For compatibility the existing naming scheme of xts(aes) is maintained as opposed to the more obvious one of xts(ecb(aes)). Signed-off-by: Herbert Xu