2 * Copyright (c) 2006 Apple Computer, Inc. All Rights Reserved.
4 * @APPLE_LICENSE_OSREFERENCE_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. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
34 Contains: Public header file for Counterpane's Yarrow Pseudo-random
37 Written by: Counterpane, Inc.
39 Copyright: (c) 2000 by Apple Computer, Inc., all rights reserved.
41 Change History (most recent first):
43 02/10/99 dpm Created, based on Counterpane source.
49 Main header file for Counterpane's Yarrow Pseudo-random number generator.
55 #if defined(macintosh) || defined(__APPLE__)
56 #include "WindowsTypesForMac.h"
59 #if defined(__cplusplus)
64 typedef enum prng_error_status
{
67 PRNG_ERR_WRONG_CALLER
,
69 PRNG_ERR_NULL_POINTER
,
71 PRNG_ERR_OUT_OF_BOUNDS
,
73 PRNG_ERR_NOT_ENOUGH_ENTROPY
,
86 USER_SOURCES
/* Leave as last source */
90 /* Declare YARROWAPI as __declspec(dllexport) before
91 including this file in the actual DLL */
93 #if defined(macintosh) || defined(__APPLE__)
96 #define YARROWAPI __declspec(dllimport)
100 /* Public function forward declarations */
102 #if defined(macintosh) || defined(__APPLE__)
105 * 1. PrngRef context for all functions. Thus no global variables.
106 * 2. Strong enum typing (prng_error_status instead of int return).
109 typedef struct PRNG
*PrngRef
;
111 YARROWAPI prng_error_status
114 YARROWAPI prng_error_status
117 YARROWAPI prng_error_status
122 /* this one has no context */
123 YARROWAPI prng_error_status
129 YARROWAPI prng_error_status
136 YARROWAPI prng_error_status
140 YARROWAPI prng_error_status
144 YARROWAPI prng_error_status
145 prngProcessSeedBuffer(
149 YARROWAPI prng_error_status
154 /* original Counterpane API */
155 YARROWAPI
int prngOutput(BYTE
*outbuf
,UINT outbuflen
);
156 YARROWAPI
int prngStretch(BYTE
*inbuf
,UINT inbuflen
,BYTE
*outbuf
,UINT outbuflen
);
157 YARROWAPI
int prngInput(BYTE
*inbuf
,UINT inbuflen
,UINT poolnum
,UINT estbits
);
158 YARROWAPI
int prngForceReseed(LONGLONG ticks
);
159 YARROWAPI
int prngAllowReseed(LONGLONG ticks
);
160 YARROWAPI
int prngProcessSeedBuffer(BYTE
*buf
,LONGLONG ticks
);
161 YARROWAPI
int prngSlowPoll(UINT pollsize
);
164 #if defined(__cplusplus)