mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
crypto: geniv - use memcpy_sglist() instead of null skcipher
For copying data between two scatterlists, just use memcpy_sglist() instead of the so-called "null skcipher". This is much simpler. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -64,20 +64,9 @@ static int seqiv_aead_encrypt(struct aead_request *req)
|
||||
data = req->base.data;
|
||||
info = req->iv;
|
||||
|
||||
if (req->src != req->dst) {
|
||||
SYNC_SKCIPHER_REQUEST_ON_STACK(nreq, ctx->sknull);
|
||||
|
||||
skcipher_request_set_sync_tfm(nreq, ctx->sknull);
|
||||
skcipher_request_set_callback(nreq, req->base.flags,
|
||||
NULL, NULL);
|
||||
skcipher_request_set_crypt(nreq, req->src, req->dst,
|
||||
req->assoclen + req->cryptlen,
|
||||
NULL);
|
||||
|
||||
err = crypto_skcipher_encrypt(nreq);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
if (req->src != req->dst)
|
||||
memcpy_sglist(req->dst, req->src,
|
||||
req->assoclen + req->cryptlen);
|
||||
|
||||
if (unlikely(!IS_ALIGNED((unsigned long)info,
|
||||
crypto_aead_alignmask(geniv) + 1))) {
|
||||
|
||||
Reference in New Issue
Block a user