18029SHai-May.Chao@Sun.COM /* 28029SHai-May.Chao@Sun.COM * CDDL HEADER START 38029SHai-May.Chao@Sun.COM * 48029SHai-May.Chao@Sun.COM * The contents of this file are subject to the terms of the 58029SHai-May.Chao@Sun.COM * Common Development and Distribution License (the "License"). 68029SHai-May.Chao@Sun.COM * You may not use this file except in compliance with the License. 78029SHai-May.Chao@Sun.COM * 88029SHai-May.Chao@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 98029SHai-May.Chao@Sun.COM * or http://www.opensolaris.org/os/licensing. 108029SHai-May.Chao@Sun.COM * See the License for the specific language governing permissions 118029SHai-May.Chao@Sun.COM * and limitations under the License. 128029SHai-May.Chao@Sun.COM * 138029SHai-May.Chao@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 148029SHai-May.Chao@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 158029SHai-May.Chao@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 168029SHai-May.Chao@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 178029SHai-May.Chao@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 188029SHai-May.Chao@Sun.COM * 198029SHai-May.Chao@Sun.COM * CDDL HEADER END 208029SHai-May.Chao@Sun.COM */ 218029SHai-May.Chao@Sun.COM /* 22*10500SHai-May.Chao@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 238029SHai-May.Chao@Sun.COM * Use is subject to license terms. 248029SHai-May.Chao@Sun.COM */ 258029SHai-May.Chao@Sun.COM 268029SHai-May.Chao@Sun.COM #ifndef _COMMON_CRYPTO_FIPS_RANDOM_H 278029SHai-May.Chao@Sun.COM #define _COMMON_CRYPTO_FIPS_RANDOM_H 288029SHai-May.Chao@Sun.COM 298029SHai-May.Chao@Sun.COM #ifdef __cplusplus 308029SHai-May.Chao@Sun.COM extern "C" { 318029SHai-May.Chao@Sun.COM #endif 328029SHai-May.Chao@Sun.COM 338029SHai-May.Chao@Sun.COM #include <sys/types.h> 348029SHai-May.Chao@Sun.COM 358029SHai-May.Chao@Sun.COM #define SHA1BLOCKBITS 512 368029SHai-May.Chao@Sun.COM #define SHA1BLOCKBYTES (SHA1BLOCKBITS >> 3) 378029SHai-May.Chao@Sun.COM #define SHA1WORDS 5 388029SHai-May.Chao@Sun.COM #define BYTES_IN_WORD 4 398029SHai-May.Chao@Sun.COM #define SHA1BYTES (BYTES_IN_WORD * SHA1WORDS) 408029SHai-May.Chao@Sun.COM 41*10500SHai-May.Chao@Sun.COM #ifdef _KERNEL 42*10500SHai-May.Chao@Sun.COM #define SHA1_HASH_SIZE 20 43*10500SHai-May.Chao@Sun.COM #define CK_RV int 44*10500SHai-May.Chao@Sun.COM #define CKR_OK CRYPTO_SUCCESS 45*10500SHai-May.Chao@Sun.COM #define CKR_DEVICE_ERROR CRYPTO_DEVICE_ERROR 46*10500SHai-May.Chao@Sun.COM #endif 47*10500SHai-May.Chao@Sun.COM 488029SHai-May.Chao@Sun.COM extern void fips_random_inner(uint32_t *, uint32_t *, uint32_t *); 49*10500SHai-May.Chao@Sun.COM extern int fips_rng_post(void); 508029SHai-May.Chao@Sun.COM 518029SHai-May.Chao@Sun.COM #ifdef __cplusplus 528029SHai-May.Chao@Sun.COM } 538029SHai-May.Chao@Sun.COM #endif 548029SHai-May.Chao@Sun.COM 558029SHai-May.Chao@Sun.COM #endif /* _COMMON_CRYPTO_FIPS_RANDOM_H */ 56