get rid of now empty #if
[openssl.git] / include / openssl / rand.h
1 /*
2  * Copyright 1995-2016 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
10 #ifndef HEADER_RAND_H
11 # define HEADER_RAND_H
12
13 # include <stdlib.h>
14 # include <openssl/ossl_typ.h>
15 # include <openssl/e_os2.h>
16
17 # if defined(OPENSSL_SYS_WINDOWS)
18 #  include <windows.h>
19 # endif
20
21 #ifdef  __cplusplus
22 extern "C" {
23 #endif
24
25 /* Already defined in ossl_typ.h */
26 /* typedef struct rand_meth_st RAND_METHOD; */
27
28 struct rand_meth_st {
29     int (*seed) (const void *buf, int num);
30     int (*bytes) (unsigned char *buf, int num);
31     void (*cleanup) (void);
32     int (*add) (const void *buf, int num, double entropy);
33     int (*pseudorand) (unsigned char *buf, int num);
34     int (*status) (void);
35 };
36
37 # ifdef BN_DEBUG
38 extern int rand_predictable;
39 # endif
40
41 int RAND_set_rand_method(const RAND_METHOD *meth);
42 const RAND_METHOD *RAND_get_rand_method(void);
43 # ifndef OPENSSL_NO_ENGINE
44 int RAND_set_rand_engine(ENGINE *engine);
45 # endif
46 RAND_METHOD *RAND_OpenSSL(void);
47 #if OPENSSL_API_COMPAT < 0x10100000L
48 # define RAND_cleanup() while(0) continue
49 #endif
50 int RAND_bytes(unsigned char *buf, int num);
51 DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
52 void RAND_seed(const void *buf, int num);
53 #if defined(__ANDROID__) && defined(__NDK_FPABI__)
54 __NDK_FPABI__   /* __attribute__((pcs("aapcs"))) on ARM */
55 #endif
56 void RAND_add(const void *buf, int num, double entropy);
57 int RAND_load_file(const char *file, long max_bytes);
58 int RAND_write_file(const char *file);
59 const char *RAND_file_name(char *file, size_t num);
60 int RAND_status(void);
61 # ifndef OPENSSL_NO_EGD
62 int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
63 int RAND_egd(const char *path);
64 int RAND_egd_bytes(const char *path, int bytes);
65 # endif
66 int RAND_poll(void);
67
68 /* BEGIN ERROR CODES */
69 /*
70  * The following lines are auto generated by the script mkerr.pl. Any changes
71  * made after this point may be overwritten when the script is next run.
72  */
73
74 void ERR_load_RAND_strings(void);
75
76 /* Error codes for the RAND functions. */
77
78 /* Function codes. */
79 # define RAND_F_RAND_BYTES                                100
80
81 /* Reason codes. */
82 # define RAND_R_PRNG_NOT_SEEDED                           100
83
84 # ifdef  __cplusplus
85 }
86 # endif
87 #endif