1fe54a78Hai-May Chao/*
2fe54a78Hai-May Chao * CDDL HEADER START
3fe54a78Hai-May Chao *
4fe54a78Hai-May Chao * The contents of this file are subject to the terms of the
5fe54a78Hai-May Chao * Common Development and Distribution License (the "License").
6fe54a78Hai-May Chao * You may not use this file except in compliance with the License.
7fe54a78Hai-May Chao *
8fe54a78Hai-May Chao * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9fe54a78Hai-May Chao * or http://www.opensolaris.org/os/licensing.
10fe54a78Hai-May Chao * See the License for the specific language governing permissions
11fe54a78Hai-May Chao * and limitations under the License.
12fe54a78Hai-May Chao *
13fe54a78Hai-May Chao * When distributing Covered Code, include this CDDL HEADER in each
14fe54a78Hai-May Chao * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15fe54a78Hai-May Chao * If applicable, add the following below this CDDL HEADER, with the
16fe54a78Hai-May Chao * fields enclosed by brackets "[]" replaced with your own identifying
17fe54a78Hai-May Chao * information: Portions Copyright [yyyy] [name of copyright owner]
18fe54a78Hai-May Chao *
19fe54a78Hai-May Chao * CDDL HEADER END
20fe54a78Hai-May Chao */
21fe54a78Hai-May Chao/*
22b5a2d84Hai-May Chao * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23fe54a78Hai-May Chao * Use is subject to license terms.
24fe54a78Hai-May Chao */
25fe54a78Hai-May Chao
26fe54a78Hai-May Chao#ifndef	_COMMON_CRYPTO_FIPS_RANDOM_H
27fe54a78Hai-May Chao#define	_COMMON_CRYPTO_FIPS_RANDOM_H
28fe54a78Hai-May Chao
29fe54a78Hai-May Chao#ifdef	__cplusplus
30fe54a78Hai-May Chaoextern "C" {
31fe54a78Hai-May Chao#endif
32fe54a78Hai-May Chao
33fe54a78Hai-May Chao#include <sys/types.h>
34fe54a78Hai-May Chao
35fe54a78Hai-May Chao#define	SHA1BLOCKBITS		512
36fe54a78Hai-May Chao#define	SHA1BLOCKBYTES		(SHA1BLOCKBITS >> 3)
37fe54a78Hai-May Chao#define	SHA1WORDS		5
38fe54a78Hai-May Chao#define	BYTES_IN_WORD		4
39fe54a78Hai-May Chao#define	SHA1BYTES		(BYTES_IN_WORD * SHA1WORDS)
40fe54a78Hai-May Chao
41b5a2d84Hai-May Chao#ifdef _KERNEL
42b5a2d84Hai-May Chao#define	SHA1_HASH_SIZE		20
43b5a2d84Hai-May Chao#define	CK_RV			int
44b5a2d84Hai-May Chao#define	CKR_OK			CRYPTO_SUCCESS
46b5a2d84Hai-May Chao#endif
47b5a2d84Hai-May Chao
48fe54a78Hai-May Chaoextern void fips_random_inner(uint32_t *, uint32_t *, uint32_t *);
49b5a2d84Hai-May Chaoextern int fips_rng_post(void);
50fe54a78Hai-May Chao
51fe54a78Hai-May Chao#ifdef	__cplusplus
52fe54a78Hai-May Chao}
53fe54a78Hai-May Chao#endif
54fe54a78Hai-May Chao
55fe54a78Hai-May Chao#endif	/* _COMMON_CRYPTO_FIPS_RANDOM_H */