Skip to content

Commit f6e45c2

Browse files
smuellerDDherbertx
authored andcommitted
crypto: doc - AEAD API conversion
The AEAD API changes are now reflected in the crypto API doc book. Signed-off-by: Stephan Mueller <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 327cbba commit f6e45c2

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

Documentation/DocBook/crypto-API.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ kernel crypto API | IPSEC Layer
585585
+-----------+ |
586586
| | (1)
587587
| aead | <----------------------------------- esp_output
588-
| (seqniv) | ---+
588+
| (seqiv) | ---+
589589
+-----------+ |
590590
| (2)
591591
+-----------+ |
@@ -1687,7 +1687,7 @@ read(opfd, out, outlen);
16871687
!Pinclude/linux/crypto.h Block Cipher Algorithm Definitions
16881688
!Finclude/linux/crypto.h crypto_alg
16891689
!Finclude/linux/crypto.h ablkcipher_alg
1690-
!Finclude/linux/crypto.h aead_alg
1690+
!Finclude/crypto/aead.h aead_alg
16911691
!Finclude/linux/crypto.h blkcipher_alg
16921692
!Finclude/linux/crypto.h cipher_alg
16931693
!Finclude/crypto/rng.h rng_alg

include/crypto/aead.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,30 @@
4545
* a breach in the integrity of the message. In essence, that -EBADMSG error
4646
* code is the key bonus an AEAD cipher has over "standard" block chaining
4747
* modes.
48+
*
49+
* Memory Structure:
50+
*
51+
* To support the needs of the most prominent user of AEAD ciphers, namely
52+
* IPSEC, the AEAD ciphers have a special memory layout the caller must adhere
53+
* to.
54+
*
55+
* The scatter list pointing to the input data must contain:
56+
*
57+
* * for RFC4106 ciphers, the concatenation of
58+
* associated authentication data || IV || plaintext or ciphertext. Note, the
59+
* same IV (buffer) is also set with the aead_request_set_crypt call. Note,
60+
* the API call of aead_request_set_ad must provide the length of the AAD and
61+
* the IV. The API call of aead_request_set_crypt only points to the size of
62+
* the input plaintext or ciphertext.
63+
*
64+
* * for "normal" AEAD ciphers, the concatenation of
65+
* associated authentication data || plaintext or ciphertext.
66+
*
67+
* It is important to note that if multiple scatter gather list entries form
68+
* the input data mentioned above, the first entry must not point to a NULL
69+
* buffer. If there is any potential where the AAD buffer can be NULL, the
70+
* calling code must contain a precaution to ensure that this does not result
71+
* in the first scatter gather list entry pointing to a NULL buffer.
4872
*/
4973

5074
/**

0 commit comments

Comments
 (0)