1 /*********************************************************************
3 * Author: Brad Conte (brad AT bradconte.com)
5 * Disclaimer: This code is presented "as is" without any guarantees.
6 * Details: Defines the API for the corresponding DES implementation.
7 Note that encryption and decryption are defined by how
8 the key setup is performed, the actual en/de-cryption is
9 performed by the same function.
10 *********************************************************************/
15 /*************************** HEADER FILES ***************************/
18 /****************************** MACROS ******************************/
19 #define DES_BLOCK_SIZE 8 // DES operates on 8 bytes at a time
21 /**************************** DATA TYPES ****************************/
22 typedef unsigned char BYTE; // 8-bit byte
23 typedef unsigned int WORD; // 32-bit word, change to "long" for 16-bit machines
30 /*********************** FUNCTION DECLARATIONS **********************/
31 void des_key_setup(const BYTE key[], BYTE schedule[][6], DES_MODE mode);
32 void des_crypt(const BYTE in[], BYTE out[], const BYTE key[][6]);
34 void three_des_key_setup(const BYTE key[], BYTE schedule[][16][6], DES_MODE mode);
35 void three_des_crypt(const BYTE in[], BYTE out[], const BYTE key[][16][6]);