You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

78 rivejä
2.2 KiB

  1. /*
  2. * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the OpenSSL license (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #ifndef HEADER_RAND_H
  10. # define HEADER_RAND_H
  11. # include <stdlib.h>
  12. # include <openssl/ossl_typ.h>
  13. # include <openssl/e_os2.h>
  14. # include <openssl/randerr.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. struct rand_meth_st {
  19. int (*seed) (const void *buf, int num);
  20. int (*bytes) (unsigned char *buf, int num);
  21. void (*cleanup) (void);
  22. int (*add) (const void *buf, int num, double randomness);
  23. int (*pseudorand) (unsigned char *buf, int num);
  24. int (*status) (void);
  25. };
  26. int RAND_set_rand_method(const RAND_METHOD *meth);
  27. const RAND_METHOD *RAND_get_rand_method(void);
  28. # ifndef OPENSSL_NO_ENGINE
  29. int RAND_set_rand_engine(ENGINE *engine);
  30. # endif
  31. RAND_METHOD *RAND_OpenSSL(void);
  32. # if OPENSSL_API_COMPAT < 0x10100000L
  33. # define RAND_cleanup() while(0) continue
  34. # endif
  35. int RAND_bytes(unsigned char *buf, int num);
  36. int RAND_priv_bytes(unsigned char *buf, int num);
  37. DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
  38. void RAND_seed(const void *buf, int num);
  39. void RAND_keep_random_devices_open(int keep);
  40. # if defined(__ANDROID__) && defined(__NDK_FPABI__)
  41. __NDK_FPABI__ /* __attribute__((pcs("aapcs"))) on ARM */
  42. # endif
  43. void RAND_add(const void *buf, int num, double randomness);
  44. int RAND_load_file(const char *file, long max_bytes);
  45. int RAND_write_file(const char *file);
  46. const char *RAND_file_name(char *file, size_t num);
  47. int RAND_status(void);
  48. # ifndef OPENSSL_NO_EGD
  49. int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
  50. int RAND_egd(const char *path);
  51. int RAND_egd_bytes(const char *path, int bytes);
  52. # endif
  53. int RAND_poll(void);
  54. # if defined(_WIN32) && (defined(BASETYPES) || defined(_WINDEF_H))
  55. /* application has to include <windows.h> in order to use these */
  56. DEPRECATEDIN_1_1_0(void RAND_screen(void))
  57. DEPRECATEDIN_1_1_0(int RAND_event(UINT, WPARAM, LPARAM))
  58. # endif
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62. #endif