]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Added PRNG doxygen
authorAdriaan de Jong <dejong@fox-it.com>
Thu, 23 Jun 2011 15:44:35 +0000 (17:44 +0200)
committerDavid Sommerseth <davids@redhat.com>
Wed, 19 Oct 2011 20:13:26 +0000 (22:13 +0200)
Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
crypto.h

index 0a6d7e05379d234d29962f8408ac0b55425b5930..1d19d2a67b640c5315b4380696418187b51c9bcc 100644 (file)
--- a/crypto.h
+++ b/crypto.h
@@ -407,10 +407,39 @@ void crypto_adjust_frame_parameters(struct frame *frame,
                                    bool packet_id,
                                    bool packet_id_long_form);
 
+
+/* Minimum length of the nonce used by the PRNG */
 #define NONCE_SECRET_LEN_MIN 16
+
+/* Maximum length of the nonce used by the PRNG */
 #define NONCE_SECRET_LEN_MAX 64
+
+/**
+ * Pseudo-random number generator initialisation.
+ * (see \c prng_rand_bytes())
+ *
+ * @param md_name                      Name of the message digest to use
+ * @param nonce_secret_len_param       Length of the nonce to use
+ */
 void prng_init (const char *md_name, const int nonce_secret_len_parm);
+
+/*
+ * Message digest-based pseudo random number generator.
+ *
+ * If the PRNG was initialised with a certain message digest, uses the digest
+ * to calculate the next random number, and prevent depletion of the entropy
+ * pool.
+ *
+ * This PRNG is aimed at IV generation and similar miscellaneous tasks. Use
+ * \c rand_bytes() for higher-assurance functionality.
+ *
+ * Retrieves len bytes of pseudo random data, and places it in output.
+ *
+ * @param output       Output buffer
+ * @param len          Length of the output buffer
+ */
 void prng_bytes (uint8_t *output, int len);
+
 void prng_uninit ();
 
 void test_crypto (const struct crypto_options *co, struct frame* f);