Remove building with NOCRYPTO option
[minix.git] / crypto / external / bsd / heimdal / dist / lib / hcrypto / des.h
bloba3e10815d7622aceb4e49e89f8ec47e5fac757e2
1 /* $NetBSD: des.h,v 1.1.1.3 2014/04/24 12:45:30 pettai Exp $ */
3 /*
4 * Copyright (c) 2005 Kungliga Tekniska Högskolan
5 * (Royal Institute of Technology, Stockholm, Sweden).
6 * All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * 3. Neither the name of the Institute nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
36 /* Id */
38 #ifndef _DESperate_H
39 #define _DESperate_H 1
41 /* symbol renaming */
42 #define _DES_ipfp_test _hc_DES_ipfp_test
43 #define DES_cbc_cksum hc_DES_cbc_cksum
44 #define DES_cbc_encrypt hc_DES_cbc_encrypt
45 #define DES_cfb64_encrypt hc_DES_cfb64_encrypt
46 #define DES_check_key_parity hc_DES_check_key_parity
47 #define DES_ecb3_encrypt hc_DES_ecb3_encrypt
48 #define DES_ecb_encrypt hc_DES_ecb_encrypt
49 #define DES_ede3_cbc_encrypt hc_DES_ede3_cbc_encrypt
50 #define DES_encrypt hc_DES_encrypt
51 #define DES_generate_random_block hc_DES_generate_random_block
52 #define DES_init_random_number_generator hc_DES_init_random_number_generator
53 #define DES_is_weak_key hc_DES_is_weak_key
54 #define DES_key_sched hc_DES_key_sched
55 #define DES_new_random_key hc_DES_new_random_key
56 #define DES_pcbc_encrypt hc_DES_pcbc_encrypt
57 #define DES_rand_data hc_DES_rand_data
58 #define DES_random_key hc_DES_random_key
59 #define DES_read_password hc_DES_read_password
60 #define DES_set_key hc_DES_set_key
61 #define DES_set_key_checked hc_DES_set_key_checked
62 #define DES_set_key_unchecked hc_DES_set_key_unchecked
63 #define DES_set_key_sched hc_DES_set_key_sched
64 #define DES_set_odd_parity hc_DES_set_odd_parity
65 #define DES_set_random_generator_seed hc_DES_set_random_generator_seed
66 #define DES_set_sequence_number hc_DES_set_sequence_number
67 #define DES_string_to_key hc_DES_string_to_key
73 #define DES_CBLOCK_LEN 8
74 #define DES_KEY_SZ 8
76 #define DES_ENCRYPT 1
77 #define DES_DECRYPT 0
79 typedef unsigned char DES_cblock[DES_CBLOCK_LEN];
80 typedef struct DES_key_schedule
82 uint32_t ks[32];
83 } DES_key_schedule;
89 #ifndef HC_DEPRECATED
90 #if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1 )))
91 #define HC_DEPRECATED __attribute__((deprecated))
92 #elif defined(_MSC_VER) && (_MSC_VER>1200)
93 #define HC_DEPRECATED __declspec(deprecated)
94 #else
95 #define HC_DEPRECATED
96 #endif
97 #endif
99 #ifdef __cplusplus
100 extern "C" {
101 #endif
103 void DES_set_odd_parity(DES_cblock *);
104 int DES_check_key_parity(DES_cblock *);
105 int DES_is_weak_key(DES_cblock *);
106 int HC_DEPRECATED DES_set_key(DES_cblock *, DES_key_schedule *);
107 int DES_set_key_checked(DES_cblock *, DES_key_schedule *);
108 int DES_set_key_unchecked(DES_cblock *, DES_key_schedule *);
109 int DES_key_sched(DES_cblock *, DES_key_schedule *);
110 void DES_string_to_key(const char *, DES_cblock *);
111 int DES_read_password(DES_cblock *, char *, int);
113 void HC_DEPRECATED DES_rand_data(void *, int);
114 void HC_DEPRECATED DES_set_random_generator_seed(DES_cblock *);
115 void HC_DEPRECATED DES_generate_random_block(DES_cblock *);
116 void HC_DEPRECATED DES_set_sequence_number(void *);
117 void HC_DEPRECATED DES_init_random_number_generator(DES_cblock *);
118 void HC_DEPRECATED DES_random_key(DES_cblock *);
119 int HC_DEPRECATED DES_new_random_key(DES_cblock *);
122 void DES_encrypt(uint32_t [2], DES_key_schedule *, int);
123 void DES_ecb_encrypt(DES_cblock *, DES_cblock *, DES_key_schedule *, int);
124 void DES_ecb3_encrypt(DES_cblock *,DES_cblock *, DES_key_schedule *,
125 DES_key_schedule *, DES_key_schedule *, int);
126 void DES_pcbc_encrypt(const void *, void *, long,
127 DES_key_schedule *, DES_cblock *, int);
128 void DES_cbc_encrypt(const void *, void *, long,
129 DES_key_schedule *, DES_cblock *, int);
130 void DES_ede3_cbc_encrypt(const void *, void *, long,
131 DES_key_schedule *, DES_key_schedule *,
132 DES_key_schedule *, DES_cblock *, int);
133 void DES_cfb64_encrypt(const void *, void *, long,
134 DES_key_schedule *, DES_cblock *, int *, int);
137 uint32_t DES_cbc_cksum(const void *, DES_cblock *,
138 long, DES_key_schedule *, DES_cblock *);
141 void _DES_ipfp_test(void);
143 #ifdef __cplusplus
145 #endif
148 #endif /* _DESperate_H */