#ifndef __YARROW_H__
#define __YARROW_H__
#if defined(macintosh) || defined(__APPLE__)
#include "WindowsTypesForMac.h"
#endif
#if defined(__cplusplus)
extern "C" {
#endif
typedef enum prng_error_status {
PRNG_SUCCESS = 0,
PRNG_ERR_REINIT,
PRNG_ERR_WRONG_CALLER,
PRNG_ERR_NOT_READY,
PRNG_ERR_NULL_POINTER,
PRNG_ERR_LOW_MEMORY,
PRNG_ERR_OUT_OF_BOUNDS,
PRNG_ERR_COMPRESSION,
PRNG_ERR_NOT_ENOUGH_ENTROPY,
PRNG_ERR_MUTEX,
PRNG_ERR_TIMEOUT,
PRNG_ERR_PROGRAM_FLOW
} prng_error_status;
enum user_sources {
CLIENT_SOURCE = 0,
ENTROPY_FILE_SOURCE,
SYSTEM_SOURCE,
USER_SOURCES
};
#ifndef YARROWAPI
#if defined(macintosh) || defined(__APPLE__)
#define YARROWAPI
#else
#define YARROWAPI __declspec(dllimport)
#endif
#endif
#if defined(macintosh) || defined(__APPLE__)
struct PRNG;
typedef struct PRNG *PrngRef;
YARROWAPI prng_error_status
prngInitialize(
PrngRef *prng);
YARROWAPI prng_error_status
prngDestroy(
PrngRef prng);
YARROWAPI prng_error_status
prngOutput(
PrngRef prng,
BYTE *outbuf,
UINT outbuflen);
YARROWAPI prng_error_status
prngStretch(
BYTE *inbuf,
UINT inbuflen,
BYTE *outbuf,
UINT outbuflen);
YARROWAPI prng_error_status
prngInput(
PrngRef prng,
BYTE *inbuf,
UINT inbuflen,
UINT poolnum,
UINT estbits);
YARROWAPI prng_error_status
prngForceReseed(
PrngRef prng,
LONGLONG ticks);
YARROWAPI prng_error_status
prngAllowReseed(
PrngRef prng,
LONGLONG ticks);
YARROWAPI prng_error_status
prngProcessSeedBuffer(
PrngRef prng,
BYTE *buf,
LONGLONG ticks);
YARROWAPI prng_error_status
prngSlowPoll(
PrngRef prng,
UINT pollsize);
#else
YARROWAPI int prngOutput(BYTE *outbuf,UINT outbuflen);
YARROWAPI int prngStretch(BYTE *inbuf,UINT inbuflen,BYTE *outbuf,UINT outbuflen);
YARROWAPI int prngInput(BYTE *inbuf,UINT inbuflen,UINT poolnum,UINT estbits);
YARROWAPI int prngForceReseed(LONGLONG ticks);
YARROWAPI int prngAllowReseed(LONGLONG ticks);
YARROWAPI int prngProcessSeedBuffer(BYTE *buf,LONGLONG ticks);
YARROWAPI int prngSlowPoll(UINT pollsize);
#endif
#if defined(__cplusplus)
}
#endif
#endif