DES and 3DES-EDE ciphers. More...
#include "includes.h"
#include "common.h"
#include "crypto.h"
#include "des_i.h"
Go to the source code of this file.
Defines | |
#define | ROLc(x, y) |
#define | RORc(x, y) |
Functions | |
void | des_encrypt (const u8 *clear, const u8 *key, u8 *cypher) |
Encrypt one block with DES. | |
void | des_key_setup (const u8 *key, u32 *ek, u32 *dk) |
void | des_block_encrypt (const u8 *plain, const u32 *ek, u8 *crypt) |
void | des_block_decrypt (const u8 *crypt, const u32 *dk, u8 *plain) |
void | des3_key_setup (const u8 *key, struct des3_key_s *dkey) |
void | des3_encrypt (const u8 *plain, const struct des3_key_s *key, u8 *crypt) |
void | des3_decrypt (const u8 *crypt, const struct des3_key_s *key, u8 *plain) |
DES and 3DES-EDE ciphers.
Modifications to LibTomCrypt implementation:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
Definition in file des-internal.c.
#define ROLc | ( | x, | |||
y | ) |
((((unsigned long) (x) << (unsigned long) ((y) & 31)) | \ (((unsigned long) (x) & 0xFFFFFFFFUL) >> \ (unsigned long) (32 - ((y) & 31)))) & 0xFFFFFFFFUL)
DES code submitted by Dobes Vandermeer
Definition at line 45 of file des-internal.c.
#define RORc | ( | x, | |||
y | ) |
(((((unsigned long) (x) & 0xFFFFFFFFUL) >> \ (unsigned long) ((y) & 31)) | \ ((unsigned long) (x) << (unsigned long) (32 - ((y) & 31)))) & \ 0xFFFFFFFFUL)
Definition at line 49 of file des-internal.c.
void des_encrypt | ( | const u8 * | clear, | |
const u8 * | key, | |||
u8 * | cypher | |||
) |
Encrypt one block with DES.
clear | 8 octets (in) | |
key | 7 octets (in) (no parity bits included) | |
cypher | 8 octets (out) |
Definition at line 406 of file des-internal.c.