Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: crypto: convert api-intro.txt to ReST format

- Change title markups;
- Mark literal blocks;
- Use list markups at authors/credits;
- Add blank lines when needed;
- Remove trailing whitespaces.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/c71e2c73a787ec7814db09bec3c1359779785bfa.1592203650.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
5846551b 0efaaa86

+100 -87
+99 -87
Documentation/crypto/api-intro.txt Documentation/crypto/api-intro.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0 1 2 2 - Scatterlist Cryptographic API 3 - 4 - INTRODUCTION 3 + ============================= 4 + Scatterlist Cryptographic API 5 + ============================= 6 + 7 + Introduction 8 + ============ 5 9 6 10 The Scatterlist Crypto API takes page vectors (scatterlists) as 7 11 arguments, and works directly on pages. In some cases (e.g. ECB ··· 17 13 for linearization. 18 14 19 15 20 - DETAILS 16 + Details 17 + ======= 21 18 22 19 At the lowest level are algorithms, which register dynamically with the 23 20 API. 24 21 25 22 'Transforms' are user-instantiated objects, which maintain state, handle all 26 - of the implementation logic (e.g. manipulating page vectors) and provide an 27 - abstraction to the underlying algorithms. However, at the user 23 + of the implementation logic (e.g. manipulating page vectors) and provide an 24 + abstraction to the underlying algorithms. However, at the user 28 25 level they are very simple. 29 26 30 - Conceptually, the API layering looks like this: 27 + Conceptually, the API layering looks like this:: 31 28 32 29 [transform api] (user interface) 33 30 [transform ops] (per-type logic glue e.g. cipher.c, compress.c) 34 31 [algorithm api] (for registering algorithms) 35 - 32 + 36 33 The idea is to make the user interface and algorithm registration API 37 34 very simple, while hiding the core logic from both. Many good ideas 38 35 from existing APIs such as Cryptoapi and Nettle have been adapted for this. ··· 49 44 subject to block size requirements (i.e., non-stream ciphers can only 50 45 process multiples of blocks). 51 46 52 - Here's an example of how to use the API: 47 + Here's an example of how to use the API:: 53 48 54 49 #include <crypto/hash.h> 55 50 #include <linux/err.h> 56 51 #include <linux/scatterlist.h> 57 - 52 + 58 53 struct scatterlist sg[2]; 59 54 char result[128]; 60 55 struct crypto_ahash *tfm; 61 56 struct ahash_request *req; 62 - 57 + 63 58 tfm = crypto_alloc_ahash("md5", 0, CRYPTO_ALG_ASYNC); 64 59 if (IS_ERR(tfm)) 65 60 fail(); 66 - 61 + 67 62 /* ... set up the scatterlists ... */ 68 63 69 64 req = ahash_request_alloc(tfm, GFP_ATOMIC); ··· 72 67 73 68 ahash_request_set_callback(req, 0, NULL, NULL); 74 69 ahash_request_set_crypt(req, sg, result, 2); 75 - 70 + 76 71 if (crypto_ahash_digest(req)) 77 72 fail(); 78 73 79 74 ahash_request_free(req); 80 75 crypto_free_ahash(tfm); 81 76 82 - 77 + 83 78 Many real examples are available in the regression test module (tcrypt.c). 84 79 85 80 86 - DEVELOPER NOTES 81 + Developer Notes 82 + =============== 87 83 88 84 Transforms may only be allocated in user context, and cryptographic 89 85 methods may only be called from softirq and user contexts. For ··· 97 91 across non-aligned page fragment boundaries. 98 92 99 93 100 - ADDING NEW ALGORITHMS 94 + Adding New Algorithms 95 + ===================== 101 96 102 97 When submitting a new algorithm for inclusion, a mandatory requirement 103 98 is that at least a few test vectors from known sources (preferably ··· 126 119 might already be working on. 127 120 128 121 129 - BUGS 122 + Bugs 123 + ==== 130 124 131 125 Send bug reports to: 132 - linux-crypto@vger.kernel.org 133 - Cc: Herbert Xu <herbert@gondor.apana.org.au>, 126 + linux-crypto@vger.kernel.org 127 + 128 + Cc: 129 + Herbert Xu <herbert@gondor.apana.org.au>, 134 130 David S. Miller <davem@redhat.com> 135 131 136 132 137 - FURTHER INFORMATION 133 + Further Information 134 + =================== 138 135 139 136 For further patches and various updates, including the current TODO 140 137 list, see: 141 138 http://gondor.apana.org.au/~herbert/crypto/ 142 139 143 140 144 - AUTHORS 141 + Authors 142 + ======= 145 143 146 - James Morris 147 - David S. Miller 148 - Herbert Xu 144 + - James Morris 145 + - David S. Miller 146 + - Herbert Xu 149 147 150 148 151 - CREDITS 149 + Credits 150 + ======= 152 151 153 152 The following people provided invaluable feedback during the development 154 153 of the API: 155 154 156 - Alexey Kuznetzov 157 - Rusty Russell 158 - Herbert Valerio Riedel 159 - Jeff Garzik 160 - Michael Richardson 161 - Andrew Morton 162 - Ingo Oeser 163 - Christoph Hellwig 155 + - Alexey Kuznetzov 156 + - Rusty Russell 157 + - Herbert Valerio Riedel 158 + - Jeff Garzik 159 + - Michael Richardson 160 + - Andrew Morton 161 + - Ingo Oeser 162 + - Christoph Hellwig 164 163 165 164 Portions of this API were derived from the following projects: 166 - 165 + 167 166 Kerneli Cryptoapi (http://www.kerneli.org/) 168 - Alexander Kjeldaas 169 - Herbert Valerio Riedel 170 - Kyle McMartin 171 - Jean-Luc Cooke 172 - David Bryson 173 - Clemens Fruhwirth 174 - Tobias Ringstrom 175 - Harald Welte 167 + - Alexander Kjeldaas 168 + - Herbert Valerio Riedel 169 + - Kyle McMartin 170 + - Jean-Luc Cooke 171 + - David Bryson 172 + - Clemens Fruhwirth 173 + - Tobias Ringstrom 174 + - Harald Welte 176 175 177 176 and; 178 - 177 + 179 178 Nettle (http://www.lysator.liu.se/~nisse/nettle/) 180 - Niels Möller 179 + - Niels Möller 181 180 182 181 Original developers of the crypto algorithms: 183 182 184 - Dana L. How (DES) 185 - Andrew Tridgell and Steve French (MD4) 186 - Colin Plumb (MD5) 187 - Steve Reid (SHA1) 188 - Jean-Luc Cooke (SHA256, SHA384, SHA512) 189 - Kazunori Miyazawa / USAGI (HMAC) 190 - Matthew Skala (Twofish) 191 - Dag Arne Osvik (Serpent) 192 - Brian Gladman (AES) 193 - Kartikey Mahendra Bhatt (CAST6) 194 - Jon Oberheide (ARC4) 195 - Jouni Malinen (Michael MIC) 196 - NTT(Nippon Telegraph and Telephone Corporation) (Camellia) 183 + - Dana L. How (DES) 184 + - Andrew Tridgell and Steve French (MD4) 185 + - Colin Plumb (MD5) 186 + - Steve Reid (SHA1) 187 + - Jean-Luc Cooke (SHA256, SHA384, SHA512) 188 + - Kazunori Miyazawa / USAGI (HMAC) 189 + - Matthew Skala (Twofish) 190 + - Dag Arne Osvik (Serpent) 191 + - Brian Gladman (AES) 192 + - Kartikey Mahendra Bhatt (CAST6) 193 + - Jon Oberheide (ARC4) 194 + - Jouni Malinen (Michael MIC) 195 + - NTT(Nippon Telegraph and Telephone Corporation) (Camellia) 197 196 198 197 SHA1 algorithm contributors: 199 - Jean-Francois Dive 200 - 198 + - Jean-Francois Dive 199 + 201 200 DES algorithm contributors: 202 - Raimar Falke 203 - Gisle Sælensminde 204 - Niels Möller 201 + - Raimar Falke 202 + - Gisle Sælensminde 203 + - Niels Möller 205 204 206 205 Blowfish algorithm contributors: 207 - Herbert Valerio Riedel 208 - Kyle McMartin 206 + - Herbert Valerio Riedel 207 + - Kyle McMartin 209 208 210 209 Twofish algorithm contributors: 211 - Werner Koch 212 - Marc Mutz 210 + - Werner Koch 211 + - Marc Mutz 213 212 214 213 SHA256/384/512 algorithm contributors: 215 - Andrew McDonald 216 - Kyle McMartin 217 - Herbert Valerio Riedel 218 - 214 + - Andrew McDonald 215 + - Kyle McMartin 216 + - Herbert Valerio Riedel 217 + 219 218 AES algorithm contributors: 220 - Alexander Kjeldaas 221 - Herbert Valerio Riedel 222 - Kyle McMartin 223 - Adam J. Richter 224 - Fruhwirth Clemens (i586) 225 - Linus Torvalds (i586) 219 + - Alexander Kjeldaas 220 + - Herbert Valerio Riedel 221 + - Kyle McMartin 222 + - Adam J. Richter 223 + - Fruhwirth Clemens (i586) 224 + - Linus Torvalds (i586) 226 225 227 226 CAST5 algorithm contributors: 228 - Kartikey Mahendra Bhatt (original developers unknown, FSF copyright). 227 + - Kartikey Mahendra Bhatt (original developers unknown, FSF copyright). 229 228 230 229 TEA/XTEA algorithm contributors: 231 - Aaron Grothe 232 - Michael Ringe 230 + - Aaron Grothe 231 + - Michael Ringe 233 232 234 233 Khazad algorithm contributors: 235 - Aaron Grothe 234 + - Aaron Grothe 236 235 237 236 Whirlpool algorithm contributors: 238 - Aaron Grothe 239 - Jean-Luc Cooke 237 + - Aaron Grothe 238 + - Jean-Luc Cooke 240 239 241 240 Anubis algorithm contributors: 242 - Aaron Grothe 241 + - Aaron Grothe 243 242 244 243 Tiger algorithm contributors: 245 - Aaron Grothe 244 + - Aaron Grothe 246 245 247 246 VIA PadLock contributors: 248 - Michal Ludvig 247 + - Michal Ludvig 249 248 250 249 Camellia algorithm contributors: 251 - NTT(Nippon Telegraph and Telephone Corporation) (Camellia) 250 + - NTT(Nippon Telegraph and Telephone Corporation) (Camellia) 252 251 253 252 Generic scatterwalk code by Adam J. Richter <adam@yggdrasil.com> 254 253 255 254 Please send any credits updates or corrections to: 256 255 Herbert Xu <herbert@gondor.apana.org.au> 257 -
+1
Documentation/crypto/index.rst
··· 17 17 :maxdepth: 2 18 18 19 19 intro 20 + api-intro 20 21 architecture 21 22 asymmetric-keys 22 23 devel-algos