blob: a861f2a908cedbbc7b23b7819c9cb5640281da6a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#ifndef DES_H
#define DES_H
#define rotl32(x,n) (((x) << ((uint32_t)(n))) | ((x) >> (32 - (uint32_t)(n))))
#define rotr32(x,n) (((x) >> ((uint32_t)(n))) | ((x) << (32 - (uint32_t)(n))))
#define byteswap32(x) ((rotl32(x, 8) & 0x00ff00ff) | (rotr32(x, 8) & 0xff00ff00))
#define Bzero(x, y) memset(x, 0, y)
typedef struct des_key {
char kn[16][8];
uint32_t sp[8][64];
char iperm[16][16][8];
char fperm[16][16][8];
} DES_KEY;
int _mcrypt_set_key(DES_KEY * dkey, char *user_key, int len);
void _mcrypt_encrypt(DES_KEY * key, char *block);
#endif
|