fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao/*
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * CDDL HEADER START
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao *
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * The contents of this file are subject to the terms of the
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * Common Development and Distribution License (the "License").
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * You may not use this file except in compliance with the License.
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao *
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * or http://www.opensolaris.org/os/licensing.
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * See the License for the specific language governing permissions
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * and limitations under the License.
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao *
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * When distributing Covered Code, include this CDDL HEADER in each
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * If applicable, add the following below this CDDL HEADER, with the
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * fields enclosed by brackets "[]" replaced with your own identifying
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * information: Portions Copyright [yyyy] [name of copyright owner]
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao *
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * CDDL HEADER END
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao */
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao/*
b5a2d8455dfa3190fc977c4bec53e91c99012767Hai-May Chao * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao * Use is subject to license terms.
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao */
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao#ifndef _COMMON_CRYPTO_FIPS_RANDOM_H
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao#define _COMMON_CRYPTO_FIPS_RANDOM_H
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao#ifdef __cplusplus
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chaoextern "C" {
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao#endif
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao#include <sys/types.h>
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao#define SHA1BLOCKBITS 512
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao#define SHA1BLOCKBYTES (SHA1BLOCKBITS >> 3)
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao#define SHA1WORDS 5
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao#define BYTES_IN_WORD 4
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao#define SHA1BYTES (BYTES_IN_WORD * SHA1WORDS)
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao
b5a2d8455dfa3190fc977c4bec53e91c99012767Hai-May Chao#ifdef _KERNEL
b5a2d8455dfa3190fc977c4bec53e91c99012767Hai-May Chao#define SHA1_HASH_SIZE 20
b5a2d8455dfa3190fc977c4bec53e91c99012767Hai-May Chao#define CK_RV int
b5a2d8455dfa3190fc977c4bec53e91c99012767Hai-May Chao#define CKR_OK CRYPTO_SUCCESS
b5a2d8455dfa3190fc977c4bec53e91c99012767Hai-May Chao#define CKR_DEVICE_ERROR CRYPTO_DEVICE_ERROR
b5a2d8455dfa3190fc977c4bec53e91c99012767Hai-May Chao#endif
b5a2d8455dfa3190fc977c4bec53e91c99012767Hai-May Chao
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chaoextern void fips_random_inner(uint32_t *, uint32_t *, uint32_t *);
b5a2d8455dfa3190fc977c4bec53e91c99012767Hai-May Chaoextern int fips_rng_post(void);
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao#ifdef __cplusplus
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao}
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao#endif
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao
fe54a78e1aacf39261ad56e9903bce02e3fb6d21Hai-May Chao#endif /* _COMMON_CRYPTO_FIPS_RANDOM_H */