xref: /freebsd/contrib/wpa/src/crypto/des_i.h (revision 0bfd163f522701b486e066fa2e56624c02f5081a)
1e28a4053SRui Paulo /*
2e28a4053SRui Paulo  * DES and 3DES-EDE ciphers
3e28a4053SRui Paulo  * Copyright (c) 2006-2009, Jouni Malinen <j@w1.fi>
4e28a4053SRui Paulo  *
5*f05cddf9SRui Paulo  * This software may be distributed under the terms of the BSD license.
6*f05cddf9SRui Paulo  * See README for more details.
7e28a4053SRui Paulo  */
8e28a4053SRui Paulo 
9e28a4053SRui Paulo #ifndef DES_I_H
10e28a4053SRui Paulo #define DES_I_H
11e28a4053SRui Paulo 
12e28a4053SRui Paulo struct des3_key_s {
13e28a4053SRui Paulo 	u32 ek[3][32];
14e28a4053SRui Paulo 	u32 dk[3][32];
15e28a4053SRui Paulo };
16e28a4053SRui Paulo 
17e28a4053SRui Paulo void des_key_setup(const u8 *key, u32 *ek, u32 *dk);
18e28a4053SRui Paulo void des_block_encrypt(const u8 *plain, const u32 *ek, u8 *crypt);
19e28a4053SRui Paulo void des_block_decrypt(const u8 *crypt, const u32 *dk, u8 *plain);
20e28a4053SRui Paulo 
21e28a4053SRui Paulo void des3_key_setup(const u8 *key, struct des3_key_s *dkey);
22e28a4053SRui Paulo void des3_encrypt(const u8 *plain, const struct des3_key_s *key, u8 *crypt);
23e28a4053SRui Paulo void des3_decrypt(const u8 *crypt, const struct des3_key_s *key, u8 *plain);
24e28a4053SRui Paulo 
25e28a4053SRui Paulo #endif /* DES_I_H */
26