jpayne@69: /* jpayne@69: * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. jpayne@69: * jpayne@69: * Licensed under the OpenSSL license (the "License"). You may not use jpayne@69: * this file except in compliance with the License. You can obtain a copy jpayne@69: * in the file LICENSE in the source distribution or at jpayne@69: * https://www.openssl.org/source/license.html jpayne@69: */ jpayne@69: jpayne@69: #ifndef HEADER_RAND_H jpayne@69: # define HEADER_RAND_H jpayne@69: jpayne@69: # include jpayne@69: # include jpayne@69: # include jpayne@69: # include jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: struct rand_meth_st { jpayne@69: int (*seed) (const void *buf, int num); jpayne@69: int (*bytes) (unsigned char *buf, int num); jpayne@69: void (*cleanup) (void); jpayne@69: int (*add) (const void *buf, int num, double randomness); jpayne@69: int (*pseudorand) (unsigned char *buf, int num); jpayne@69: int (*status) (void); jpayne@69: }; jpayne@69: jpayne@69: int RAND_set_rand_method(const RAND_METHOD *meth); jpayne@69: const RAND_METHOD *RAND_get_rand_method(void); jpayne@69: # ifndef OPENSSL_NO_ENGINE jpayne@69: int RAND_set_rand_engine(ENGINE *engine); jpayne@69: # endif jpayne@69: jpayne@69: RAND_METHOD *RAND_OpenSSL(void); jpayne@69: jpayne@69: # if OPENSSL_API_COMPAT < 0x10100000L jpayne@69: # define RAND_cleanup() while(0) continue jpayne@69: # endif jpayne@69: int RAND_bytes(unsigned char *buf, int num); jpayne@69: int RAND_priv_bytes(unsigned char *buf, int num); jpayne@69: DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num)) jpayne@69: jpayne@69: void RAND_seed(const void *buf, int num); jpayne@69: void RAND_keep_random_devices_open(int keep); jpayne@69: jpayne@69: # if defined(__ANDROID__) && defined(__NDK_FPABI__) jpayne@69: __NDK_FPABI__ /* __attribute__((pcs("aapcs"))) on ARM */ jpayne@69: # endif jpayne@69: void RAND_add(const void *buf, int num, double randomness); jpayne@69: int RAND_load_file(const char *file, long max_bytes); jpayne@69: int RAND_write_file(const char *file); jpayne@69: const char *RAND_file_name(char *file, size_t num); jpayne@69: int RAND_status(void); jpayne@69: jpayne@69: # ifndef OPENSSL_NO_EGD jpayne@69: int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); jpayne@69: int RAND_egd(const char *path); jpayne@69: int RAND_egd_bytes(const char *path, int bytes); jpayne@69: # endif jpayne@69: jpayne@69: int RAND_poll(void); jpayne@69: jpayne@69: # if defined(_WIN32) && (defined(BASETYPES) || defined(_WINDEF_H)) jpayne@69: /* application has to include in order to use these */ jpayne@69: DEPRECATEDIN_1_1_0(void RAND_screen(void)) jpayne@69: DEPRECATEDIN_1_1_0(int RAND_event(UINT, WPARAM, LPARAM)) jpayne@69: # endif jpayne@69: jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: #endif