RAND_set_DRBG_type.pod 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. =pod
  2. =head1 NAME
  3. RAND_set_DRBG_type,
  4. RAND_set_seed_source_type
  5. - specify the global random number generator types
  6. =head1 SYNOPSIS
  7. #include <openssl/rand.h>
  8. int RAND_set_DRBG_type(OSSL_LIB_CTX *ctx, const char *drbg, const char *propq,
  9. const char *cipher, const char *digest);
  10. int RAND_set_seed_source_type(OSSL_LIB_CTX *ctx, const char *seed,
  11. const char *propq);
  12. =head1 DESCRIPTION
  13. RAND_set_DRBG_type() specifies the random bit generator that will be
  14. used within the library context I<ctx>. A generator of name I<drbg>
  15. with properties I<propq> will be fetched. It will be instantiated with
  16. either I<cipher> or I<digest> as its underlying cryptographic algorithm.
  17. This specifies the type that will be used for the primary, public and
  18. private random instances.
  19. RAND_set_seed_source_type() specifies the seed source that will be used
  20. within the library context I<ctx>. The seed source of name I<seed>
  21. with properties I<propq> will be fetched and used to seed the primary
  22. random big generator.
  23. =head1 RETURN VALUES
  24. These function return 1 on success and 0 on failure.
  25. =head1 NOTES
  26. These functions must be called before the random bit generators are first
  27. created in the library context. They will return an error if the call
  28. is made too late.
  29. The default DRBG is "CTR-DRBG" using the "AES-256-CTR" cipher.
  30. The default seed source is "SEED-SRC".
  31. =head1 SEE ALSO
  32. L<EVP_RAND(3)>,
  33. L<RAND_get0_primary(3)>
  34. =head1 HISTORY
  35. These functions were added in OpenSSL 3.0.
  36. =head1 COPYRIGHT
  37. Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
  38. Licensed under the Apache License 2.0 (the "License"). You may not use
  39. this file except in compliance with the License. You can obtain a copy
  40. in the file LICENSE in the source distribution or at
  41. L<https://www.openssl.org/source/license.html>.
  42. =cut