2 * Copyright (c) 1999, 2000-2013 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
32 Contains: Public header file for Counterpane's Yarrow Pseudo-random
35 Written by: Counterpane, Inc.
37 Copyright: (c) 2000 by Apple Computer, Inc., all rights reserved.
39 Change History (most recent first):
41 02/10/99 dpm Created, based on Counterpane source.
47 Main header file for Counterpane's Yarrow Pseudo-random number generator.
53 #if defined(macintosh) || defined(__APPLE__)
54 #include "WindowsTypesForMac.h"
57 #if defined(__cplusplus)
62 typedef enum prng_error_status
{
65 PRNG_ERR_WRONG_CALLER
,
67 PRNG_ERR_NULL_POINTER
,
69 PRNG_ERR_OUT_OF_BOUNDS
,
71 PRNG_ERR_NOT_ENOUGH_ENTROPY
,
84 USER_SOURCES
/* Leave as last source */
88 /* Declare YARROWAPI as __declspec(dllexport) before
89 including this file in the actual DLL */
91 #if defined(macintosh) || defined(__APPLE__)
94 #define YARROWAPI __declspec(dllimport)
98 /* Public function forward declarations */
100 #if defined(macintosh) || defined(__APPLE__)
103 * 1. PrngRef context for all functions. Thus no global variables.
104 * 2. Strong enum typing (prng_error_status instead of int return).
107 typedef struct PRNG
*PrngRef
;
109 YARROWAPI prng_error_status
112 YARROWAPI prng_error_status
115 YARROWAPI prng_error_status
120 /* this one has no context */
121 YARROWAPI prng_error_status
127 YARROWAPI prng_error_status
134 YARROWAPI prng_error_status
138 YARROWAPI prng_error_status
142 YARROWAPI prng_error_status
143 prngProcessSeedBuffer(
147 YARROWAPI prng_error_status
152 /* original Counterpane API */
153 YARROWAPI
int prngOutput(BYTE
*outbuf
,UINT outbuflen
);
154 YARROWAPI
int prngStretch(BYTE
*inbuf
,UINT inbuflen
,BYTE
*outbuf
,UINT outbuflen
);
155 YARROWAPI
int prngInput(BYTE
*inbuf
,UINT inbuflen
,UINT poolnum
,UINT estbits
);
156 YARROWAPI
int prngForceReseed(LONGLONG ticks
);
157 YARROWAPI
int prngAllowReseed(LONGLONG ticks
);
158 YARROWAPI
int prngProcessSeedBuffer(BYTE
*buf
,LONGLONG ticks
);
159 YARROWAPI
int prngSlowPoll(UINT pollsize
);
162 #if defined(__cplusplus)