hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/Documentation/crypto/userspace-if.rst
....@@ -23,7 +23,7 @@
2323 and asynchronous invocations. The user space API call is fully
2424 synchronous.
2525
26
-[1] http://www.chronox.de/libkcapi.html
26
+[1] https://www.chronox.de/libkcapi.html
2727
2828 User Space API General Remarks
2929 ------------------------------
....@@ -296,15 +296,16 @@
296296
297297 struct sockaddr_alg sa = {
298298 .salg_family = AF_ALG,
299
- .salg_type = "rng", /* this selects the symmetric cipher */
300
- .salg_name = "drbg_nopr_sha256" /* this is the cipher name */
299
+ .salg_type = "rng", /* this selects the random number generator */
300
+ .salg_name = "drbg_nopr_sha256" /* this is the RNG name */
301301 };
302302
303303
304304 Depending on the RNG type, the RNG must be seeded. The seed is provided
305305 using the setsockopt interface to set the key. For example, the
306306 ansi_cprng requires a seed. The DRBGs do not require a seed, but may be
307
-seeded.
307
+seeded. The seed is also known as a *Personalization String* in NIST SP 800-90A
308
+standard.
308309
309310 Using the read()/recvmsg() system calls, random numbers can be obtained.
310311 The kernel generates at most 128 bytes in one call. If user space
....@@ -313,6 +314,16 @@
313314 WARNING: The user space caller may invoke the initially mentioned accept
314315 system call multiple times. In this case, the returned file descriptors
315316 have the same state.
317
+
318
+Following CAVP testing interfaces are enabled when kernel is built with
319
+CRYPTO_USER_API_RNG_CAVP option:
320
+
321
+- the concatenation of *Entropy* and *Nonce* can be provided to the RNG via
322
+ ALG_SET_DRBG_ENTROPY setsockopt interface. Setting the entropy requires
323
+ CAP_SYS_ADMIN permission.
324
+
325
+- *Additional Data* can be provided using the send()/sendmsg() system calls,
326
+ but only after the entropy has been set.
316327
317328 Zero-Copy Interface
318329 -------------------
....@@ -377,6 +388,9 @@
377388 provided ciphertext is assumed to contain an authentication tag of
378389 the given size (see section about AEAD memory layout below).
379390
391
+- ALG_SET_DRBG_ENTROPY -- Setting the entropy of the random number generator.
392
+ This option is applicable to RNG cipher type only.
393
+
380394 User space API example
381395 ----------------------
382396
....@@ -384,4 +398,4 @@
384398 the aforementioned Netlink kernel interface. [1] also contains a test
385399 application that invokes all libkcapi API calls.
386400
387
-[1] http://www.chronox.de/libkcapi.html
401
+[1] https://www.chronox.de/libkcapi.html