[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.1 Quality of random numbers | Libgcrypt uses different quality levels. | |
9.2 Retrieving random numbers | How to retrieve random numbers. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Libgcypt offers random numbers of different quality levels:
The constants for the random quality levels are of this type.
GCRY_WEAK_RANDOM
This should not anymore be used. It has recently been changed to an
alias of GCRY_STRONG_RANDOM. Use gcry_create_nonce
instead.
GCRY_STRONG_RANDOM
Use this level for e.g. session keys and similar purposes.
GCRY_VERY_STRONG_RANDOM
Use this level for e.g. key material.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Fill buffer with length random bytes using a random quality as defined by level.
Allocate a memory block consisting of nbytes fresh random bytes using a random quality as defined by level.
Allocate a memory block consisting of nbytes fresh random bytes
using a random quality as defined by level. This function
differs from gcry_random_bytes
in that the returned buffer is
allocated in a "secure" area of the memory.
Fill buffer with length unpredictable bytes. This is commonly called a nonce and may also be used for initialization vectors and padding. This is an extra function nearly independent of the other random function for 3 reasons: It better protects the regular random generator's internal state, provides better performance and does not drain the precious entropy pool.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by root on April, 18 2008 using texi2html 1.76.