diff options
author | Stephan Mueller <smueller@chronox.de> | 2016-02-16 05:32:06 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-02-16 15:07:53 -0500 |
commit | e1eabc057ab6ac6d0d7f31649ba45f3d6e2be429 (patch) | |
tree | 5de3450358066b48e2224f592f9e8c50af6759c6 | |
parent | 029c053c447d6c3e7326f8dd4c2cc6fe43b369d3 (diff) |
crypto: doc - add akcipher API
Reference the new akcipher API calls in the kernel crypto API DocBook.
Also, fix the comments in the akcipher.h file: double dashes do not look
good in the DocBook; fix a typo.
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | Documentation/DocBook/crypto-API.tmpl | 23 | ||||
-rw-r--r-- | include/crypto/akcipher.h | 28 |
2 files changed, 37 insertions, 14 deletions
diff --git a/Documentation/DocBook/crypto-API.tmpl b/Documentation/DocBook/crypto-API.tmpl index 866ff082272b..297e280b7957 100644 --- a/Documentation/DocBook/crypto-API.tmpl +++ b/Documentation/DocBook/crypto-API.tmpl | |||
@@ -485,6 +485,9 @@ | |||
485 | <para>CRYPTO_ALG_TYPE_RNG Random Number Generation</para> | 485 | <para>CRYPTO_ALG_TYPE_RNG Random Number Generation</para> |
486 | </listitem> | 486 | </listitem> |
487 | <listitem> | 487 | <listitem> |
488 | <para>CRYPTO_ALG_TYPE_AKCIPHER Asymmetric cipher</para> | ||
489 | </listitem> | ||
490 | <listitem> | ||
488 | <para>CRYPTO_ALG_TYPE_PCOMPRESS Enhanced version of | 491 | <para>CRYPTO_ALG_TYPE_PCOMPRESS Enhanced version of |
489 | CRYPTO_ALG_TYPE_COMPRESS allowing for segmented compression / | 492 | CRYPTO_ALG_TYPE_COMPRESS allowing for segmented compression / |
490 | decompression instead of performing the operation on one | 493 | decompression instead of performing the operation on one |
@@ -1817,6 +1820,26 @@ read(opfd, out, outlen); | |||
1817 | !Finclude/crypto/rng.h crypto_rng_seedsize | 1820 | !Finclude/crypto/rng.h crypto_rng_seedsize |
1818 | !Cinclude/crypto/rng.h | 1821 | !Cinclude/crypto/rng.h |
1819 | </sect1> | 1822 | </sect1> |
1823 | <sect1><title>Asymmetric Cipher API</title> | ||
1824 | !Pinclude/crypto/akcipher.h Generic Public Key API | ||
1825 | !Finclude/crypto/akcipher.h akcipher_alg | ||
1826 | !Finclude/crypto/akcipher.h akcipher_request | ||
1827 | !Finclude/crypto/akcipher.h crypto_alloc_akcipher | ||
1828 | !Finclude/crypto/akcipher.h crypto_free_akcipher | ||
1829 | !Finclude/crypto/akcipher.h crypto_akcipher_set_pub_key | ||
1830 | !Finclude/crypto/akcipher.h crypto_akcipher_set_priv_key | ||
1831 | </sect1> | ||
1832 | <sect1><title>Asymmetric Cipher Request Handle</title> | ||
1833 | !Finclude/crypto/akcipher.h akcipher_request_alloc | ||
1834 | !Finclude/crypto/akcipher.h akcipher_request_free | ||
1835 | !Finclude/crypto/akcipher.h akcipher_request_set_callback | ||
1836 | !Finclude/crypto/akcipher.h akcipher_request_set_crypt | ||
1837 | !Finclude/crypto/akcipher.h crypto_akcipher_maxsize | ||
1838 | !Finclude/crypto/akcipher.h crypto_akcipher_encrypt | ||
1839 | !Finclude/crypto/akcipher.h crypto_akcipher_decrypt | ||
1840 | !Finclude/crypto/akcipher.h crypto_akcipher_sign | ||
1841 | !Finclude/crypto/akcipher.h crypto_akcipher_verify | ||
1842 | </sect1> | ||
1820 | </chapter> | 1843 | </chapter> |
1821 | 1844 | ||
1822 | <chapter id="Code"><title>Code Examples</title> | 1845 | <chapter id="Code"><title>Code Examples</title> |
diff --git a/include/crypto/akcipher.h b/include/crypto/akcipher.h index 354de15cea6b..c37cc59e9bf2 100644 --- a/include/crypto/akcipher.h +++ b/include/crypto/akcipher.h | |||
@@ -114,7 +114,7 @@ struct akcipher_alg { | |||
114 | */ | 114 | */ |
115 | 115 | ||
116 | /** | 116 | /** |
117 | * crypto_alloc_akcipher() -- allocate AKCIPHER tfm handle | 117 | * crypto_alloc_akcipher() - allocate AKCIPHER tfm handle |
118 | * @alg_name: is the cra_name / name or cra_driver_name / driver name of the | 118 | * @alg_name: is the cra_name / name or cra_driver_name / driver name of the |
119 | * public key algorithm e.g. "rsa" | 119 | * public key algorithm e.g. "rsa" |
120 | * @type: specifies the type of the algorithm | 120 | * @type: specifies the type of the algorithm |
@@ -171,7 +171,7 @@ static inline struct crypto_akcipher *crypto_akcipher_reqtfm( | |||
171 | } | 171 | } |
172 | 172 | ||
173 | /** | 173 | /** |
174 | * crypto_free_akcipher() -- free AKCIPHER tfm handle | 174 | * crypto_free_akcipher() - free AKCIPHER tfm handle |
175 | * | 175 | * |
176 | * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher() | 176 | * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher() |
177 | */ | 177 | */ |
@@ -181,7 +181,7 @@ static inline void crypto_free_akcipher(struct crypto_akcipher *tfm) | |||
181 | } | 181 | } |
182 | 182 | ||
183 | /** | 183 | /** |
184 | * akcipher_request_alloc() -- allocates public key request | 184 | * akcipher_request_alloc() - allocates public key request |
185 | * | 185 | * |
186 | * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher() | 186 | * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher() |
187 | * @gfp: allocation flags | 187 | * @gfp: allocation flags |
@@ -201,7 +201,7 @@ static inline struct akcipher_request *akcipher_request_alloc( | |||
201 | } | 201 | } |
202 | 202 | ||
203 | /** | 203 | /** |
204 | * akcipher_request_free() -- zeroize and free public key request | 204 | * akcipher_request_free() - zeroize and free public key request |
205 | * | 205 | * |
206 | * @req: request to free | 206 | * @req: request to free |
207 | */ | 207 | */ |
@@ -211,14 +211,14 @@ static inline void akcipher_request_free(struct akcipher_request *req) | |||
211 | } | 211 | } |
212 | 212 | ||
213 | /** | 213 | /** |
214 | * akcipher_request_set_callback() -- Sets an asynchronous callback. | 214 | * akcipher_request_set_callback() - Sets an asynchronous callback. |
215 | * | 215 | * |
216 | * Callback will be called when an asynchronous operation on a given | 216 | * Callback will be called when an asynchronous operation on a given |
217 | * request is finished. | 217 | * request is finished. |
218 | * | 218 | * |
219 | * @req: request that the callback will be set for | 219 | * @req: request that the callback will be set for |
220 | * @flgs: specify for instance if the operation may backlog | 220 | * @flgs: specify for instance if the operation may backlog |
221 | * @cmlp: callback which will be called | 221 | * @cmpl: callback which will be called |
222 | * @data: private data used by the caller | 222 | * @data: private data used by the caller |
223 | */ | 223 | */ |
224 | static inline void akcipher_request_set_callback(struct akcipher_request *req, | 224 | static inline void akcipher_request_set_callback(struct akcipher_request *req, |
@@ -232,7 +232,7 @@ static inline void akcipher_request_set_callback(struct akcipher_request *req, | |||
232 | } | 232 | } |
233 | 233 | ||
234 | /** | 234 | /** |
235 | * akcipher_request_set_crypt() -- Sets request parameters | 235 | * akcipher_request_set_crypt() - Sets request parameters |
236 | * | 236 | * |
237 | * Sets parameters required by crypto operation | 237 | * Sets parameters required by crypto operation |
238 | * | 238 | * |
@@ -255,7 +255,7 @@ static inline void akcipher_request_set_crypt(struct akcipher_request *req, | |||
255 | } | 255 | } |
256 | 256 | ||
257 | /** | 257 | /** |
258 | * crypto_akcipher_maxsize() -- Get len for output buffer | 258 | * crypto_akcipher_maxsize() - Get len for output buffer |
259 | * | 259 | * |
260 | * Function returns the dest buffer size required for a given key | 260 | * Function returns the dest buffer size required for a given key |
261 | * | 261 | * |
@@ -271,7 +271,7 @@ static inline int crypto_akcipher_maxsize(struct crypto_akcipher *tfm) | |||
271 | } | 271 | } |
272 | 272 | ||
273 | /** | 273 | /** |
274 | * crypto_akcipher_encrypt() -- Invoke public key encrypt operation | 274 | * crypto_akcipher_encrypt() - Invoke public key encrypt operation |
275 | * | 275 | * |
276 | * Function invokes the specific public key encrypt operation for a given | 276 | * Function invokes the specific public key encrypt operation for a given |
277 | * public key algorithm | 277 | * public key algorithm |
@@ -289,7 +289,7 @@ static inline int crypto_akcipher_encrypt(struct akcipher_request *req) | |||
289 | } | 289 | } |
290 | 290 | ||
291 | /** | 291 | /** |
292 | * crypto_akcipher_decrypt() -- Invoke public key decrypt operation | 292 | * crypto_akcipher_decrypt() - Invoke public key decrypt operation |
293 | * | 293 | * |
294 | * Function invokes the specific public key decrypt operation for a given | 294 | * Function invokes the specific public key decrypt operation for a given |
295 | * public key algorithm | 295 | * public key algorithm |
@@ -307,7 +307,7 @@ static inline int crypto_akcipher_decrypt(struct akcipher_request *req) | |||
307 | } | 307 | } |
308 | 308 | ||
309 | /** | 309 | /** |
310 | * crypto_akcipher_sign() -- Invoke public key sign operation | 310 | * crypto_akcipher_sign() - Invoke public key sign operation |
311 | * | 311 | * |
312 | * Function invokes the specific public key sign operation for a given | 312 | * Function invokes the specific public key sign operation for a given |
313 | * public key algorithm | 313 | * public key algorithm |
@@ -325,7 +325,7 @@ static inline int crypto_akcipher_sign(struct akcipher_request *req) | |||
325 | } | 325 | } |
326 | 326 | ||
327 | /** | 327 | /** |
328 | * crypto_akcipher_verify() -- Invoke public key verify operation | 328 | * crypto_akcipher_verify() - Invoke public key verify operation |
329 | * | 329 | * |
330 | * Function invokes the specific public key verify operation for a given | 330 | * Function invokes the specific public key verify operation for a given |
331 | * public key algorithm | 331 | * public key algorithm |
@@ -343,7 +343,7 @@ static inline int crypto_akcipher_verify(struct akcipher_request *req) | |||
343 | } | 343 | } |
344 | 344 | ||
345 | /** | 345 | /** |
346 | * crypto_akcipher_set_pub_key() -- Invoke set public key operation | 346 | * crypto_akcipher_set_pub_key() - Invoke set public key operation |
347 | * | 347 | * |
348 | * Function invokes the algorithm specific set key function, which knows | 348 | * Function invokes the algorithm specific set key function, which knows |
349 | * how to decode and interpret the encoded key | 349 | * how to decode and interpret the encoded key |
@@ -364,7 +364,7 @@ static inline int crypto_akcipher_set_pub_key(struct crypto_akcipher *tfm, | |||
364 | } | 364 | } |
365 | 365 | ||
366 | /** | 366 | /** |
367 | * crypto_akcipher_set_priv_key() -- Invoke set private key operation | 367 | * crypto_akcipher_set_priv_key() - Invoke set private key operation |
368 | * | 368 | * |
369 | * Function invokes the algorithm specific set key function, which knows | 369 | * Function invokes the algorithm specific set key function, which knows |
370 | * how to decode and interpret the encoded key | 370 | * how to decode and interpret the encoded key |