2 * Copyright (c) 1999, 2000-2001 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
26 Contains: Public header file for Counterpane's Yarrow Pseudo-random
29 Written by: Counterpane, Inc.
31 Copyright: (c) 2000 by Apple Computer, Inc., all rights reserved.
33 Change History (most recent first):
35 02/10/99 dpm Created, based on Counterpane source.
41 Main header file for Counterpane's Yarrow Pseudo-random number generator.
47 #if defined(macintosh) || defined(__APPLE__)
48 #include "WindowsTypesForMac.h"
51 #if defined(__cplusplus)
56 typedef enum prng_error_status
{
59 PRNG_ERR_WRONG_CALLER
,
61 PRNG_ERR_NULL_POINTER
,
63 PRNG_ERR_OUT_OF_BOUNDS
,
65 PRNG_ERR_NOT_ENOUGH_ENTROPY
,
78 USER_SOURCES
/* Leave as last source */
82 /* Declare YARROWAPI as __declspec(dllexport) before
83 including this file in the actual DLL */
85 #if defined(macintosh) || defined(__APPLE__)
88 #define YARROWAPI __declspec(dllimport)
92 /* Public function forward declarations */
94 #if defined(macintosh) || defined(__APPLE__)
97 * 1. PrngRef context for all functions. Thus no global variables.
98 * 2. Strong enum typing (prng_error_status instead of int return).
101 typedef struct PRNG
*PrngRef
;
103 YARROWAPI prng_error_status
106 YARROWAPI prng_error_status
109 YARROWAPI prng_error_status
114 /* this one has no context */
115 YARROWAPI prng_error_status
121 YARROWAPI prng_error_status
128 YARROWAPI prng_error_status
132 YARROWAPI prng_error_status
136 YARROWAPI prng_error_status
137 prngProcessSeedBuffer(
141 YARROWAPI prng_error_status
146 /* original Counterpane API */
147 YARROWAPI
int prngOutput(BYTE
*outbuf
,UINT outbuflen
);
148 YARROWAPI
int prngStretch(BYTE
*inbuf
,UINT inbuflen
,BYTE
*outbuf
,UINT outbuflen
);
149 YARROWAPI
int prngInput(BYTE
*inbuf
,UINT inbuflen
,UINT poolnum
,UINT estbits
);
150 YARROWAPI
int prngForceReseed(LONGLONG ticks
);
151 YARROWAPI
int prngAllowReseed(LONGLONG ticks
);
152 YARROWAPI
int prngProcessSeedBuffer(BYTE
*buf
,LONGLONG ticks
);
153 YARROWAPI
int prngSlowPoll(UINT pollsize
);
156 #if defined(__cplusplus)