path: root/doc/man3/RAND_DRBG_new.pod
diff options
authorJung-uk Kim <jkim@FreeBSD.org>2018-09-13 19:18:07 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2018-09-13 19:18:07 +0000
commita43ce912fc025d11e1395506111f75fc194d7ba5 (patch)
tree9794cf7720d75938ed0ea4f499c0dcd4b6eacdda /doc/man3/RAND_DRBG_new.pod
parent02be298e504b8554caca6dc85af450e1ea44d19d (diff)
Import OpenSSL 1.1.1.vendor/openssl/1.1.1
Notes: svn path=/vendor-crypto/openssl/dist/; revision=338658 svn path=/vendor-crypto/openssl/1.1.1/; revision=338659; tag=vendor/openssl/1.1.1
Diffstat (limited to 'doc/man3/RAND_DRBG_new.pod')
1 files changed, 127 insertions, 0 deletions
diff --git a/doc/man3/RAND_DRBG_new.pod b/doc/man3/RAND_DRBG_new.pod
new file mode 100644
index 000000000000..dcd7a944190f
--- /dev/null
+++ b/doc/man3/RAND_DRBG_new.pod
@@ -0,0 +1,127 @@
+=head1 NAME
+- initialize and cleanup a RAND_DRBG instance
+=head1 SYNOPSIS
+ #include <openssl/rand_drbg.h>
+ RAND_DRBG *RAND_DRBG_new(int type,
+ unsigned int flags,
+ RAND_DRBG *parent);
+ RAND_DRBG *RAND_DRBG_secure_new(int type,
+ unsigned int flags,
+ RAND_DRBG *parent);
+ int RAND_DRBG_set(RAND_DRBG *drbg,
+ int type, unsigned int flags);
+ int RAND_DRBG_set_defaults(int type, unsigned int flags);
+ int RAND_DRBG_instantiate(RAND_DRBG *drbg,
+ const unsigned char *pers, size_t perslen);
+ int RAND_DRBG_uninstantiate(RAND_DRBG *drbg);
+ void RAND_DRBG_free(RAND_DRBG *drbg);
+RAND_DRBG_new() and RAND_DRBG_secure_new()
+create a new DRBG instance of the given B<type>, allocated from the heap resp.
+the secure heap
+(using OPENSSL_zalloc() resp. OPENSSL_secure_zalloc()).
+RAND_DRBG_set() initializes the B<drbg> with the given B<type> and B<flags>.
+RAND_DRBG_set_defaults() sets the default B<type> and B<flags> for new DRBG
+Currently, all DRBG types are based on AES-CTR, so B<type> can be one of the
+following values: NID_aes_128_ctr, NID_aes_192_ctr, NID_aes_256_ctr.
+Before the DRBG can be used to generate random bits, it is necessary to set
+its type and to instantiate it.
+The optional B<flags> argument specifies a set of bit flags which can be
+joined using the | operator. Currently, the only flag is
+RAND_DRBG_FLAG_CTR_NO_DF, which disables the use of a the derivation function
+ctr_df. For an explanation, see [NIST SP 800-90A Rev. 1].
+If a B<parent> instance is specified then this will be used instead of
+the default entropy source for reseeding the B<drbg>. It is said that the
+B<drbg> is I<chained> to its B<parent>.
+For more information, see the NOTES section.
+seeds the B<drbg> instance using random input from trusted entropy sources.
+Optionally, a personalization string B<pers> of length B<perslen> can be
+To omit the personalization string, set B<pers>=NULL and B<perslen>=0;
+clears the internal state of the B<drbg> and puts it back in the
+uninstantiated state.
+RAND_DRBG_new() and RAND_DRBG_secure_new() return a pointer to a DRBG
+instance allocated on the heap, resp. secure heap.
+RAND_DRBG_instantiate(), and
+return 1 on success, and 0 on failure.
+RAND_DRBG_free() does not return a value.
+=head1 NOTES
+The DRBG design supports I<chaining>, which means that a DRBG instance can
+use another B<parent> DRBG instance instead of the default entropy source
+to obtain fresh random input for reseeding, provided that B<parent> DRBG
+instance was properly instantiated, either from a trusted entropy source,
+or from yet another parent DRBG instance.
+For a detailed description of the reseeding process, see L<RAND_DRBG(7)>.
+The default DRBG type and flags are applied only during creation of a DRBG
+To ensure that they are applied to the global and thread-local DRBG instances
+(<master>, resp. <public> and <private>), it is necessary to call
+RAND_DRBG_set_defaults() before creating any thread and before calling any
+cryptographic routines that obtain random data directly or indirectly.
+=head1 HISTORY
+The RAND_DRBG functions were added in OpenSSL 1.1.1.
+=head1 SEE ALSO
+Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
+Licensed under the OpenSSL license (the "License"). You may not use
+this file except in compliance with the License. You can obtain a copy
+in the file LICENSE in the source distribution or at