2N/A/* This file was automatically imported with 2N/A import_gcry.py. Please don't modify it */ 2N/A * Copyright (C) 1998, 1999, 2001, 2002, 2003, 2N/A * 2008 Free Software Foundation, Inc. 2N/A * This file is part of Libgcrypt. 2N/A * Libgcrypt is free software; you can redistribute it and/or modify 2N/A * it under the terms of the GNU Lesser general Public License as 2N/A * published by the Free Software Foundation; either version 2.1 of 2N/A * the License, or (at your option) any later version. 2N/A * Libgcrypt is distributed in the hope that it will be useful, 2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A * GNU Lesser General Public License for more details. 2N/A * You should have received a copy of the GNU Lesser General Public 2N/A * License along with this program; if not, write to the Free Software 2N/A * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 2N/A * For a description of triple encryption, see: 2N/A * Bruce Schneier: Applied Cryptography. Second Edition. 2N/A * John Wiley & Sons, 1996. ISBN 0-471-12845-7. Pages 358 ff. 2N/A * This implementation is according to the definition of DES in FIPS 2N/A * PUB 46-2 from December 1993. 2N/A * Written by Michael Roth <mroth@nessie.de>, September 1998 2N/A * encryption context with a key. 2N/A * A DES key is 64bit wide but only 56bits of the key are used. The remaining 2N/A * bits are parity bits and they will _not_ checked in this implementation, but 2N/A * For Triple-DES you could use either two 64bit keys or three 64bit keys. 2N/A * The parity bits will _not_ checked, too. 2N/A * After initializing a context with a key you could use this context to 2N/A * encrypt or decrypt data in 64bit blocks in Electronic Codebook Mode. 2N/A * (In the examples below the slashes at the beginning and ending of comments 2N/A * unsigned char key[8]; 2N/A * unsigned char plaintext[8]; 2N/A * unsigned char ciphertext[8]; 2N/A * unsigned char recoverd[8]; 2N/A * * Fill 'key' and 'plaintext' with some data * 2N/A * * Set up the DES encryption context * 2N/A * des_setkey(context, key); 2N/A * * Encrypt the plaintext * 2N/A * des_ecb_encrypt(context, plaintext, ciphertext); 2N/A * * To recover the orginal plaintext from ciphertext use: * 2N/A * des_ecb_decrypt(context, ciphertext, recoverd); 2N/A * Triple-DES Example 2N/A * ------------------ 2N/A * unsigned char key1[8]; 2N/A * unsigned char key2[8]; 2N/A * unsigned char key3[8]; 2N/A * unsigned char plaintext[8]; 2N/A * unsigned char ciphertext[8]; 2N/A * unsigned char recoverd[8]; 2N/A * tripledes_ctx context; 2N/A * * If you would like to use two 64bit keys, fill 'key1' and'key2' 2N/A * then setup the encryption context: * 2N/A * tripledes_set2keys(context, key1, key2); 2N/A * * To use three 64bit keys with Triple-DES use: * 2N/A * tripledes_set3keys(context, key1, key2, key3); 2N/A * * Encrypting plaintext with Triple-DES * 2N/A * tripledes_ecb_encrypt(context, plaintext, ciphertext); 2N/A * * Decrypting ciphertext to recover the plaintext with Triple-DES * 2N/A * tripledes_ecb_decrypt(context, ciphertext, recoverd); 2N/A * function selftest(). It will return an error string if there are 2N/A * some problems with this library. * 2N/A * if ( (error_msg = selftest()) ) 2N/A * fprintf(stderr, "An error in the DES/Tripple-DES implementation occured: %s\n", error_msg); 2N/A * According to the SunOS man page, memcmp returns indeterminate sign 2N/A * depending on whether characters are signed or not. 2N/A for( ; n; n--, a++, b++ )
2N/A * The s-box values are permuted according to the 'primitive function P' 2N/A * and are rotated one bit to the left. 2N/A 0x01010400,
0x00000000,
0x00010000,
0x01010404,
0x01010004,
0x00010404,
0x00000004,
0x00010000,
2N/A 0x00000400,
0x01010400,
0x01010404,
0x00000400,
0x01000404,
0x01010004,
0x01000000,
0x00000004,
2N/A 0x00000404,
0x01000400,
0x01000400,
0x00010400,
0x00010400,
0x01010000,
0x01010000,
0x01000404,
2N/A 0x00010004,
0x01000004,
0x01000004,
0x00010004,
0x00000000,
0x00000404,
0x00010404,
0x01000000,
2N/A 0x00010000,
0x01010404,
0x00000004,
0x01010000,
0x01010400,
0x01000000,
0x01000000,
0x00000400,
2N/A 0x01010004,
0x00010000,
0x00010400,
0x01000004,
0x00000400,
0x00000004,
0x01000404,
0x00010404,
2N/A 0x01010404,
0x00010004,
0x01010000,
0x01000404,
0x01000004,
0x00000404,
0x00010404,
0x01010400,
2N/A 0x00000404,
0x01000400,
0x01000400,
0x00000000,
0x00010004,
0x00010400,
0x00000000,
0x01010004 2N/A 0x80108020,
0x80008000,
0x00008000,
0x00108020,
0x00100000,
0x00000020,
0x80100020,
0x80008020,
2N/A 0x80000020,
0x80108020,
0x80108000,
0x80000000,
0x80008000,
0x00100000,
0x00000020,
0x80100020,
2N/A 0x00108000,
0x00100020,
0x80008020,
0x00000000,
0x80000000,
0x00008000,
0x00108020,
0x80100000,
2N/A 0x00100020,
0x80000020,
0x00000000,
0x00108000,
0x00008020,
0x80108000,
0x80100000,
0x00008020,
2N/A 0x00000000,
0x00108020,
0x80100020,
0x00100000,
0x80008020,
0x80100000,
0x80108000,
0x00008000,
2N/A 0x80100000,
0x80008000,
0x00000020,
0x80108020,
0x00108020,
0x00000020,
0x00008000,
0x80000000,
2N/A 0x00008020,
0x80108000,
0x00100000,
0x80000020,
0x00100020,
0x80008020,
0x80000020,
0x00100020,
2N/A 0x00108000,
0x00000000,
0x80008000,
0x00008020,
0x80000000,
0x80100020,
0x80108020,
0x00108000 2N/A 0x00000208,
0x08020200,
0x00000000,
0x08020008,
0x08000200,
0x00000000,
0x00020208,
0x08000200,
2N/A 0x00020008,
0x08000008,
0x08000008,
0x00020000,
0x08020208,
0x00020008,
0x08020000,
0x00000208,
2N/A 0x08000000,
0x00000008,
0x08020200,
0x00000200,
0x00020200,
0x08020000,
0x08020008,
0x00020208,
2N/A 0x08000208,
0x00020200,
0x00020000,
0x08000208,
0x00000008,
0x08020208,
0x00000200,
0x08000000,
2N/A 0x08020200,
0x08000000,
0x00020008,
0x00000208,
0x00020000,
0x08020200,
0x08000200,
0x00000000,
2N/A 0x00000200,
0x00020008,
0x08020208,
0x08000200,
0x08000008,
0x00000200,
0x00000000,
0x08020008,
2N/A 0x08000208,
0x00020000,
0x08000000,
0x08020208,
0x00000008,
0x00020208,
0x00020200,
0x08000008,
2N/A 0x08020000,
0x08000208,
0x00000208,
0x08020000,
0x00020208,
0x00000008,
0x08020008,
0x00020200 2N/A 0x00802001,
0x00002081,
0x00002081,
0x00000080,
0x00802080,
0x00800081,
0x00800001,
0x00002001,
2N/A 0x00000000,
0x00802000,
0x00802000,
0x00802081,
0x00000081,
0x00000000,
0x00800080,
0x00800001,
2N/A 0x00000001,
0x00002000,
0x00800000,
0x00802001,
0x00000080,
0x00800000,
0x00002001,
0x00002080,
2N/A 0x00800081,
0x00000001,
0x00002080,
0x00800080,
0x00002000,
0x00802080,
0x00802081,
0x00000081,
2N/A 0x00800080,
0x00800001,
0x00802000,
0x00802081,
0x00000081,
0x00000000,
0x00000000,
0x00802000,
2N/A 0x00002080,
0x00800080,
0x00800081,
0x00000001,
0x00802001,
0x00002081,
0x00002081,
0x00000080,
2N/A 0x00802081,
0x00000081,
0x00000001,
0x00002000,
0x00800001,
0x00002001,
0x00802080,
0x00800081,
2N/A 0x00002001,
0x00002080,
0x00800000,
0x00802001,
0x00000080,
0x00800000,
0x00002000,
0x00802080 2N/A 0x00000100,
0x02080100,
0x02080000,
0x42000100,
0x00080000,
0x00000100,
0x40000000,
0x02080000,
2N/A 0x40080100,
0x00080000,
0x02000100,
0x40080100,
0x42000100,
0x42080000,
0x00080100,
0x40000000,
2N/A 0x02000000,
0x40080000,
0x40080000,
0x00000000,
0x40000100,
0x42080100,
0x42080100,
0x02000100,
2N/A 0x42080000,
0x40000100,
0x00000000,
0x42000000,
0x02080100,
0x02000000,
0x42000000,
0x00080100,
2N/A 0x00080000,
0x42000100,
0x00000100,
0x02000000,
0x40000000,
0x02080000,
0x42000100,
0x40080100,
2N/A 0x02000100,
0x40000000,
0x42080000,
0x02080100,
0x40080100,
0x00000100,
0x02000000,
0x42080000,
2N/A 0x42080100,
0x00080100,
0x42000000,
0x42080100,
0x02080000,
0x00000000,
0x40080000,
0x42000000,
2N/A 0x00080100,
0x02000100,
0x40000100,
0x00080000,
0x00000000,
0x40080000,
0x02080100,
0x40000100 2N/A 0x20000010,
0x20400000,
0x00004000,
0x20404010,
0x20400000,
0x00000010,
0x20404010,
0x00400000,
2N/A 0x20004000,
0x00404010,
0x00400000,
0x20000010,
0x00400010,
0x20004000,
0x20000000,
0x00004010,
2N/A 0x00000000,
0x00400010,
0x20004010,
0x00004000,
0x00404000,
0x20004010,
0x00000010,
0x20400010,
2N/A 0x20400010,
0x00000000,
0x00404010,
0x20404000,
0x00004010,
0x00404000,
0x20404000,
0x20000000,
2N/A 0x20004000,
0x00000010,
0x20400010,
0x00404000,
0x20404010,
0x00400000,
0x00004010,
0x20000010,
2N/A 0x00400000,
0x20004000,
0x20000000,
0x00004010,
0x20000010,
0x20404010,
0x00404000,
0x20400000,
2N/A 0x00404010,
0x20404000,
0x00000000,
0x20400010,
0x00000010,
0x00004000,
0x20400000,
0x00404010,
2N/A 0x00004000,
0x00400010,
0x20004010,
0x00000000,
0x20404000,
0x20000000,
0x00400010,
0x20004010 2N/A 0x00200000,
0x04200002,
0x04000802,
0x00000000,
0x00000800,
0x04000802,
0x00200802,
0x04200800,
2N/A 0x04200802,
0x00200000,
0x00000000,
0x04000002,
0x00000002,
0x04000000,
0x04200002,
0x00000802,
2N/A 0x04000800,
0x00200802,
0x00200002,
0x04000800,
0x04000002,
0x04200000,
0x04200800,
0x00200002,
2N/A 0x04200000,
0x00000800,
0x00000802,
0x04200802,
0x00200800,
0x00000002,
0x04000000,
0x00200800,
2N/A 0x04000000,
0x00200800,
0x00200000,
0x04000802,
0x04000802,
0x04200002,
0x04200002,
0x00000002,
2N/A 0x00200002,
0x04000000,
0x04000800,
0x00200000,
0x04200800,
0x00000802,
0x00200802,
0x04200800,
2N/A 0x00000802,
0x04000002,
0x04200802,
0x04200000,
0x00200800,
0x00000000,
0x00000002,
0x04200802,
2N/A 0x00000000,
0x00200802,
0x04200000,
0x00000800,
0x04000002,
0x04000800,
0x00000800,
0x00200002 2N/A 0x10001040,
0x00001000,
0x00040000,
0x10041040,
0x10000000,
0x10001040,
0x00000040,
0x10000000,
2N/A 0x00040040,
0x10040000,
0x10041040,
0x00041000,
0x10041000,
0x00041040,
0x00001000,
0x00000040,
2N/A 0x10040000,
0x10000040,
0x10001000,
0x00001040,
0x00041000,
0x00040040,
0x10040040,
0x10041000,
2N/A 0x00001040,
0x00000000,
0x00000000,
0x10040040,
0x10000040,
0x10001000,
0x00041040,
0x00040000,
2N/A 0x00041040,
0x00040000,
0x10041000,
0x00001000,
0x00000040,
0x10040040,
0x00001000,
0x00041040,
2N/A 0x10001000,
0x00000040,
0x10000040,
0x10040000,
0x10040040,
0x10000000,
0x00040000,
0x10001040,
2N/A 0x00000000,
0x10041040,
0x00040040,
0x10000040,
0x10040000,
0x10001000,
0x10001040,
0x00000000,
2N/A 0x10041040,
0x00041000,
0x00041000,
0x00001040,
0x00001040,
0x00040040,
0x10000000,
0x10041000 2N/A * These two tables are part of the 'permuted choice 1' function. 2N/A * In this implementation several speed improvements are done. 2N/A 0x00000000,
0x00000001,
0x00000100,
0x00000101,
2N/A 0x00010000,
0x00010001,
0x00010100,
0x00010101,
2N/A 0x01000000,
0x01000001,
0x01000100,
0x01000101,
2N/A 0x01010000,
0x01010001,
0x01010100,
0x01010101 2N/A 0x00000000,
0x01000000,
0x00010000,
0x01010000,
2N/A 0x00000100,
0x01000100,
0x00010100,
0x01010100,
2N/A 0x00000001,
0x01000001,
0x00010001,
0x01010001,
2N/A 0x00000101,
0x01000101,
0x00010101,
0x01010101,
2N/A * Numbers of left shifts per round for encryption subkeys. 2N/A * To calculate the decryption subkeys we just reverse the 2N/A * ordering of the calculated encryption subkeys. So their 2N/A * is no need for a decryption rotate tab. 2N/A 1,
1,
2,
2,
2,
2,
2,
2,
1,
2,
2,
2,
2,
2,
2,
1 2N/A * Table with weak DES keys sorted in ascending order. 2N/A * In DES their are 64 known keys which are weak. They are weak 2N/A * because they produce only one, two or four different 2N/A * subkeys in the subkey scheduling process. 2N/A * The keys in this table have all their parity bits cleared. 2N/A {
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00 },
/*w*/ 2N/A {
0x00,
0x00,
0x1e,
0x1e,
0x00,
0x00,
0x0e,
0x0e },
2N/A {
0x00,
0x00,
0xe0,
0xe0,
0x00,
0x00,
0xf0,
0xf0 },
2N/A {
0x00,
0x00,
0xfe,
0xfe,
0x00,
0x00,
0xfe,
0xfe },
2N/A {
0x00,
0x1e,
0x00,
0x1e,
0x00,
0x0e,
0x00,
0x0e },
/*sw*/ 2N/A {
0x00,
0x1e,
0x1e,
0x00,
0x00,
0x0e,
0x0e,
0x00 },
2N/A {
0x00,
0x1e,
0xe0,
0xfe,
0x00,
0x0e,
0xf0,
0xfe },
2N/A {
0x00,
0x1e,
0xfe,
0xe0,
0x00,
0x0e,
0xfe,
0xf0 },
2N/A {
0x00,
0xe0,
0x00,
0xe0,
0x00,
0xf0,
0x00,
0xf0 },
/*sw*/ 2N/A {
0x00,
0xe0,
0x1e,
0xfe,
0x00,
0xf0,
0x0e,
0xfe },
2N/A {
0x00,
0xe0,
0xe0,
0x00,
0x00,
0xf0,
0xf0,
0x00 },
2N/A {
0x00,
0xe0,
0xfe,
0x1e,
0x00,
0xf0,
0xfe,
0x0e },
2N/A {
0x00,
0xfe,
0x00,
0xfe,
0x00,
0xfe,
0x00,
0xfe },
/*sw*/ 2N/A {
0x00,
0xfe,
0x1e,
0xe0,
0x00,
0xfe,
0x0e,
0xf0 },
2N/A {
0x00,
0xfe,
0xe0,
0x1e,
0x00,
0xfe,
0xf0,
0x0e },
2N/A {
0x00,
0xfe,
0xfe,
0x00,
0x00,
0xfe,
0xfe,
0x00 },
2N/A {
0x1e,
0x00,
0x00,
0x1e,
0x0e,
0x00,
0x00,
0x0e },
2N/A {
0x1e,
0x00,
0x1e,
0x00,
0x0e,
0x00,
0x0e,
0x00 },
/*sw*/ 2N/A {
0x1e,
0x00,
0xe0,
0xfe,
0x0e,
0x00,
0xf0,
0xfe },
2N/A {
0x1e,
0x00,
0xfe,
0xe0,
0x0e,
0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
2N/A {
0xfe,
0xe0,
0x1e,
0x00,
0xfe,
0xf0,
0x0e,
0x00 },
2N/A {
0xfe,
0xe0,
0xe0,
0xfe,
0xfe,
0xf0,
0xf0,
0xfe },
2N/A {
0xfe,
0xe0,
0xfe,
0xe0,
0xfe,
0xf0,
0xfe,
0xf0 },
/*sw*/ 2N/A {
0xfe,
0xfe,
0x00,
0x00,
0xfe,
0xfe,
0x00,
0x00 },
2N/A {
0xfe,
0xfe,
0x1e,
0x1e,
0xfe,
0xfe,
0x0e,
0x0e },
2N/A {
0xfe,
0xfe,
0xe0,
0xe0,
0xfe,
0xfe,
0xf0,
0xf0 },
2N/A {
0xfe,
0xfe,
0xfe,
0xfe,
0xfe,
0xfe,
0xfe,
0xfe }
/*w*/ 2N/A * Macro to swap bits across two words. 2N/A * This performs the 'initial permutation' of the data to be encrypted 2N/A * or decrypted. Additionally the resulting two words are rotated one bit 2N/A * The 'inverse initial permutation'. 2N/A * A full DES round including 'expansion function', 'sbox substitution' 2N/A * and 'primitive function P' but without swapping the left and right word. 2N/A * Please note: The data in 'from' and 'to' is already rotated one bit to 2N/A * the left, done in the initial permutation. 2N/A * Macros to convert 8 bytes from/to 32bit words. 2N/A * Handy macros for encryption and decryption of data 2N/A * des_key_schedule(): Calculate 16 subkeys pairs (even/odd) for 2N/A * 16 encryption rounds. 2N/A * To calculate subkeys for decryption the caller 2N/A * have to reorder the generated subkeys. 2N/A * rawkey: 8 Bytes of key data 2N/A * subkey: Array of at least 32 u32s. Will be filled 2N/A * with calculated subkeys. 2N/A * Fill a DES context with subkeys calculated from a 64bit key. 2N/A * Does not check parity bits, but simply ignore them. 2N/A * Does not check for weak keys. 2N/A for(i=0; i<
32; i+=
2)
2N/A * Fill a Triple-DES context with subkeys calculated from two 64bit keys. 2N/A * Does not check the parity bits of the keys, but simply ignore them. 2N/A * Does not check for weak keys. 2N/A * Fill a Triple-DES context with subkeys calculated from three 64bit keys. 2N/A * Does not check the parity bits of the keys, but simply ignore them. 2N/A * Does not check for weak keys. 2N/A for(i=0; i<
32; i+=
2)
2N/A * according to 'mode'. Sometimes this mode is named 'EDE' mode 2N/A * (Encryption-Decryption-Encryption). 2N/A * Check whether the 8 byte key is weak. 2N/A * Does not check the parity bits of the key but simple ignore them. 2N/A /* clear parity bits */ 2N/A /* binary search in the weak key table */ 2N/A * Returns an string with the error text on failure. 2N/A * Returns NULL if all is ok. 2N/A ;
/* Detection has been disabled. */ 2N/A/* Selftest for TripleDES. */ 2N/A/* Run a full self-test for ALGO and return 0 on success. */ 2N/A /* Teletrust specific OID for 3DES. */ 2N/A /* pbeWithSHAAnd3_KeyTripleDES_CBC */