diff options
author | Adriaan de Jong | 2011-06-23 17:44:35 +0200 |
---|---|---|
committer | David Sommerseth | 2011-10-19 22:13:26 +0200 |
commit | 279a308eed40d756cf6644c5a1a82f2aecda8dd8 (patch) | |
tree | 574a6b684638aa63273c9d3a1ede6ea4af3559a9 | |
parent | 485c5f76a15e7f9950a3ee3126dbf50f66f9ef82 (diff) | |
download | openvpn-279a308eed40d756cf6644c5a1a82f2aecda8dd8.zip openvpn-279a308eed40d756cf6644c5a1a82f2aecda8dd8.tar.gz |
Added PRNG doxygen
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>
-rw-r--r-- | crypto.h | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -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); |