rand_bytes_ex.pod 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. =pod
  2. =head1 NAME
  3. rand_bytes_ex, rand_priv_bytes_ex
  4. - internal random number routines
  5. =head1 SYNOPSIS
  6. #include "crypto/rand.h"
  7. int rand_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
  8. int rand_priv_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
  9. =head1 DESCRIPTION
  10. rand_bytes_ex() and rand_priv_bytes_ex() are the equivalent of RAND_bytes() and
  11. RAND_priv_bytes() in the public API except that they both take an additional
  12. I<ctx> parameter.
  13. The DRBG used for the operation is the public or private DRBG associated with
  14. the specified I<ctx>. The parameter can be NULL, in which case
  15. the default library ctx is used.
  16. If the default RAND_METHOD has been changed then for compatibility reasons the
  17. RAND_METHOD will be used in preference and the DRBG of the library context
  18. ignored.
  19. =head1 RETURN VALUES
  20. rand_bytes_ex() and rand_bytes_priv_ex() return 0 or less on error or 1 on
  21. success.
  22. =head1 COPYRIGHT
  23. Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
  24. Licensed under the Apache License 2.0 (the "License"). You may not use
  25. this file except in compliance with the License. You can obtain a copy
  26. in the file LICENSE in the source distribution or at
  27. L<https://www.openssl.org/source/license.html>.
  28. =cut