]> www.infradead.org Git - users/jedix/linux-maple.git/commit
crypto: aead - Add new interface with single SG list
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 21 May 2015 07:11:01 +0000 (15:11 +0800)
committerDhaval Giani <dhaval.giani@oracle.com>
Mon, 16 Jan 2017 19:43:18 +0000 (14:43 -0500)
commit10b7e301331eaf963b628025075ca4af756b9868
tree20d1605dc8330019f9093d8540053381b85975a2
parent0abc5a20b0c427aa52a9a48fb34165a2f090d09d
crypto: aead - Add new interface with single SG list

The primary user of AEAD, IPsec includes the IV in the AD in
most cases, except where it is implicitly authenticated by the
underlying algorithm.

The way it is currently implemented is a hack because we pass
the data in piecemeal and the underlying algorithms try to stitch
them back up into one piece.

This is why this patch is adding a new interface that allows a
single SG list to be passed in that contains everything so the
algorithm implementors do not have to stitch.

The new interface accepts a single source SG list and a single
destination SG list.  Both must be laid out as follows:

AD, skipped data, plain/cipher text, ICV

The ICV is not present from the source during encryption and from
the destination during decryption.

For the top-level IPsec AEAD algorithm the plain/cipher text will
contain the generated (or received) IV.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 996d98d85ccc27d9c592ad7dc1371c60cd6585cc)

Orabug: 24614549

Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
crypto/aead.c
include/crypto/aead.h