No empty .Rs/.Re
[netbsd-mini2440.git] / crypto / dist / heimdal / lib / hcrypto / des.h
blob24ab872a7f8244aa73398cf730ce23326a1574fc
1 /*
2 * Copyright (c) 2005 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
34 /* $Heimdal: des.h 16480 2006-01-08 21:47:29Z lha $
35 $NetBSD$ */
37 #ifndef _DESperate_H
38 #define _DESperate_H 1
40 /* symbol renaming */
41 #define DES_set_odd_parity hc_DES_set_odd_parity
42 #define DES_is_weak_key hc_DES_is_weak_key
43 #define DES_key_sched hc_DES_key_sched
44 #define DES_set_key hc_DES_set_key
45 #define DES_set_key_checked hc_DES_set_key_checked
46 #define DES_set_key_sched hc_DES_set_key_sched
47 #define DES_new_random_key hc_DES_new_random_key
48 #define DES_string_to_key hc_DES_string_to_key
49 #define DES_read_password hc_DES_read_password
50 #define DES_rand_data hc_DES_rand_data
51 #define DES_set_random_generator_seed hc_DES_set_random_generator_seed
52 #define DES_generate_random_block hc_DES_generate_random_block
53 #define DES_set_sequence_number hc_DES_set_sequence_number
54 #define DES_init_random_number_generator hc_DES_init_random_number_generator
55 #define DES_random_key hc_DES_random_key
56 #define DES_encrypt hc_DES_encrypt
57 #define DES_ecb_encrypt hc_DES_ecb_encrypt
58 #define DES_ecb3_encrypt hc_DES_ecb3_encrypt
59 #define DES_pcbc_encrypt hc_DES_pcbc_encrypt
60 #define DES_cbc_encrypt hc_DES_cbc_encrypt
61 #define DES_cbc_cksum hc_DES_cbc_cksum
62 #define DES_ede3_cbc_encrypt hc_DES_ede3_cbc_encrypt
63 #define DES_cfb64_encrypt hc_DES_cfb64_encrypt
64 #define _DES_ipfp_test _hc_DES_ipfp_test
70 #define DES_CBLOCK_LEN 8
71 #define DES_KEY_SZ 8
73 #define DES_ENCRYPT 1
74 #define DES_DECRYPT 0
76 typedef unsigned char DES_cblock[DES_CBLOCK_LEN];
77 typedef struct DES_key_schedule
79 uint32_t ks[32];
80 } DES_key_schedule;
86 int DES_set_odd_parity(DES_cblock *);
87 int DES_is_weak_key(DES_cblock *);
88 int DES_set_key(DES_cblock *, DES_key_schedule *);
89 int DES_set_key_checked(DES_cblock *, DES_key_schedule *);
90 int DES_key_sched(DES_cblock *, DES_key_schedule *);
91 int DES_new_random_key(DES_cblock *);
92 void DES_string_to_key(const char *, DES_cblock *);
93 int DES_read_password(DES_cblock *, char *, int);
95 void DES_rand_data(void *, int);
96 void DES_set_random_generator_seed(DES_cblock *);
97 void DES_generate_random_block(DES_cblock *);
98 void DES_set_sequence_number(void *);
99 void DES_init_random_number_generator(DES_cblock *);
100 void DES_random_key(DES_cblock *);
103 void DES_encrypt(uint32_t [2], DES_key_schedule *, int);
104 void DES_ecb_encrypt(DES_cblock *, DES_cblock *, DES_key_schedule *, int);
105 void DES_ecb3_encrypt(DES_cblock *,DES_cblock *, DES_key_schedule *,
106 DES_key_schedule *, DES_key_schedule *, int);
107 void DES_pcbc_encrypt(const void *, void *, long,
108 DES_key_schedule *, DES_cblock *, int);
109 void DES_cbc_encrypt(const void *, void *, long,
110 DES_key_schedule *, DES_cblock *, int);
111 void DES_ede3_cbc_encrypt(const void *, void *, long,
112 DES_key_schedule *, DES_key_schedule *,
113 DES_key_schedule *, DES_cblock *, int);
114 void DES_cfb64_encrypt(const void *, void *, long,
115 DES_key_schedule *, DES_cblock *, int *, int);
118 uint32_t DES_cbc_cksum(const void *, DES_cblock *,
119 long, DES_key_schedule *, DES_cblock *);
122 void _DES_ipfp_test(void);
125 #endif /* _DESperate_H */