hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/Documentation/crypto/devel-algos.rst
....@@ -31,33 +31,23 @@
3131
3232 ::
3333
34
- int crypto_unregister_alg(struct crypto_alg *alg);
35
- int crypto_unregister_algs(struct crypto_alg *algs, int count);
34
+ void crypto_unregister_alg(struct crypto_alg *alg);
35
+ void crypto_unregister_algs(struct crypto_alg *algs, int count);
3636
3737
38
-Notice that both registration and unregistration functions do return a
39
-value, so make sure to handle errors. A return code of zero implies
40
-success. Any return code < 0 implies an error.
38
+The registration functions return 0 on success, or a negative errno
39
+value on failure. crypto_register_algs() succeeds only if it
40
+successfully registered all the given algorithms; if it fails partway
41
+through, then any changes are rolled back.
4142
42
-The bulk registration/unregistration functions register/unregister each
43
-transformation in the given array of length count. They handle errors as
44
-follows:
45
-
46
-- crypto_register_algs() succeeds if and only if it successfully
47
- registers all the given transformations. If an error occurs partway
48
- through, then it rolls back successful registrations before returning
49
- the error code. Note that if a driver needs to handle registration
50
- errors for individual transformations, then it will need to use the
51
- non-bulk function crypto_register_alg() instead.
52
-
53
-- crypto_unregister_algs() tries to unregister all the given
54
- transformations, continuing on error. It logs errors and always
55
- returns zero.
43
+The unregistration functions always succeed, so they don't have a
44
+return value. Don't try to unregister algorithms that aren't
45
+currently registered.
5646
5747 Single-Block Symmetric Ciphers [CIPHER]
5848 ---------------------------------------
5949
60
-Example of transformations: aes, arc4, ...
50
+Example of transformations: aes, serpent, ...
6151
6252 This section describes the simplest of all transformation
6353 implementations, that being the CIPHER type used for symmetric ciphers.
....@@ -108,7 +98,7 @@
10898 Multi-Block Ciphers
10999 -------------------
110100
111
-Example of transformations: cbc(aes), ecb(arc4), ...
101
+Example of transformations: cbc(aes), chacha20, ...
112102
113103 This section describes the multi-block cipher transformation
114104 implementations. The multi-block ciphers are used for transformations
....@@ -128,25 +118,20 @@
128118 overhead as the kernel crypto API needs to perform the realignment of
129119 the data which may imply moving of data.
130120
131
-Cipher Definition With struct blkcipher_alg and ablkcipher_alg
132
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
121
+Cipher Definition With struct skcipher_alg
122
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133123
134
-Struct blkcipher_alg defines a synchronous block cipher whereas struct
135
-ablkcipher_alg defines an asynchronous block cipher.
124
+Struct skcipher_alg defines a multi-block cipher, or more generally, a
125
+length-preserving symmetric cipher algorithm.
136126
137
-Please refer to the single block cipher description for schematics of
138
-the block cipher usage.
127
+Scatterlist handling
128
+~~~~~~~~~~~~~~~~~~~~
139129
140
-Specifics Of Asynchronous Multi-Block Cipher
141
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142
-
143
-There are a couple of specifics to the asynchronous interface.
144
-
145
-First of all, some of the drivers will want to use the Generic
146
-ScatterWalk in case the hardware needs to be fed separate chunks of the
147
-scatterlist which contains the plaintext and will contain the
148
-ciphertext. Please refer to the ScatterWalk interface offered by the
149
-Linux kernel scatter / gather list implementation.
130
+Some drivers will want to use the Generic ScatterWalk in case the
131
+hardware needs to be fed separate chunks of the scatterlist which
132
+contains the plaintext and will contain the ciphertext. Please refer
133
+to the ScatterWalk interface offered by the Linux kernel scatter /
134
+gather list implementation.
150135
151136 Hashing [HASH]
152137 --------------
....@@ -174,10 +159,10 @@
174159
175160 ::
176161
177
- int crypto_unregister_ahash(struct ahash_alg *alg);
162
+ void crypto_unregister_ahash(struct ahash_alg *alg);
178163
179
- int crypto_unregister_shash(struct shash_alg *alg);
180
- int crypto_unregister_shashes(struct shash_alg *algs, int count);
164
+ void crypto_unregister_shash(struct shash_alg *alg);
165
+ void crypto_unregister_shashes(struct shash_alg *algs, int count);
181166
182167
183168 Cipher Definition With struct shash_alg and ahash_alg