xref: /titanic_44/usr/src/common/crypto/blowfish/blowfish_impl.h (revision 18c2aff776a775d34a4c9893a4c72e0434d68e36)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_BLOWFISH_IMPL_H
28 #define	_BLOWFISH_IMPL_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * Common definitions used by Blowfish.
34  */
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 #define	BLOWFISH_MINBITS	32
41 #define	BLOWFISH_MINBYTES	(BLOWFISH_MINBITS >> 3)
42 #ifdef	CRYPTO_UNLIMITED
43 #define	BLOWFISH_MAXBITS	448
44 #else /* !CRYPTO_UNLIMITED */
45 #define	BLOWFISH_MAXBITS	128
46 #endif /* CRYPTO_UNLIMITED */
47 #define	BLOWFISH_MAXBYTES	(BLOWFISH_MAXBITS >> 3)
48 
49 #define	BLOWFISH_IV_LEN		8
50 #define	BLOWFISH_BLOCK_LEN	8
51 #define	BLOWFISH_KEY_INCREMENT	8
52 #define	BLOWFISH_DEFAULT	128
53 
54 extern void blowfish_encrypt_block(void *, uint8_t *, uint8_t *);
55 extern void blowfish_decrypt_block(void *, uint8_t *, uint8_t *);
56 extern void blowfish_init_keysched(uint8_t *, uint_t, void *);
57 extern void *blowfish_alloc_keysched(size_t *, int);
58 
59 #ifdef	__cplusplus
60 }
61 #endif
62 
63 #endif	/* _BLOWFISH_IMPL_H */
64