2 * Copyright (c) 1999, 2000-2001 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
27 Contains: Public header file for Counterpane's Yarrow Pseudo-random
30 Written by: Counterpane, Inc.
32 Copyright: (c) 2000 by Apple Computer, Inc., all rights reserved.
34 Change History (most recent first):
36 02/10/99 dpm Created, based on Counterpane source.
42 Main header file for Counterpane's Yarrow Pseudo-random number generator.
48 #if defined(macintosh) || defined(__APPLE__)
49 #include "WindowsTypesForMac.h"
52 #if defined(__cplusplus)
57 typedef enum prng_error_status
{
60 PRNG_ERR_WRONG_CALLER
,
62 PRNG_ERR_NULL_POINTER
,
64 PRNG_ERR_OUT_OF_BOUNDS
,
66 PRNG_ERR_NOT_ENOUGH_ENTROPY
,
79 USER_SOURCES
/* Leave as last source */
83 /* Declare YARROWAPI as __declspec(dllexport) before
84 including this file in the actual DLL */
86 #if defined(macintosh) || defined(__APPLE__)
89 #define YARROWAPI __declspec(dllimport)
93 /* Public function forward declarations */
95 #if defined(macintosh) || defined(__APPLE__)
98 * 1. PrngRef context for all functions. Thus no global variables.
99 * 2. Strong enum typing (prng_error_status instead of int return).
102 typedef struct PRNG
*PrngRef
;
104 YARROWAPI prng_error_status
107 YARROWAPI prng_error_status
110 YARROWAPI prng_error_status
115 /* this one has no context */
116 YARROWAPI prng_error_status
122 YARROWAPI prng_error_status
129 YARROWAPI prng_error_status
133 YARROWAPI prng_error_status
137 YARROWAPI prng_error_status
138 prngProcessSeedBuffer(
142 YARROWAPI prng_error_status
147 /* original Counterpane API */
148 YARROWAPI
int prngOutput(BYTE
*outbuf
,UINT outbuflen
);
149 YARROWAPI
int prngStretch(BYTE
*inbuf
,UINT inbuflen
,BYTE
*outbuf
,UINT outbuflen
);
150 YARROWAPI
int prngInput(BYTE
*inbuf
,UINT inbuflen
,UINT poolnum
,UINT estbits
);
151 YARROWAPI
int prngForceReseed(LONGLONG ticks
);
152 YARROWAPI
int prngAllowReseed(LONGLONG ticks
);
153 YARROWAPI
int prngProcessSeedBuffer(BYTE
*buf
,LONGLONG ticks
);
154 YARROWAPI
int prngSlowPoll(UINT pollsize
);
157 #if defined(__cplusplus)