projects
/
my-code
/
crypto.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
-
[my-code/crypto.git]
/
des.h
diff --git
a/des.h
b/des.h
index
ed1750c
..
12da455
100644
(file)
--- a/
des.h
+++ b/
des.h
@@
-8,13
+8,22
@@
#ifndef DES_H
#define DES_H
#ifndef DES_H
#define DES_H
-#define DES_ROUNDS 16
-#define DES_SUBKEY_LEN 56
-#define DES_PERMC_LEN 48
+#define DES_SUBKEYS 16
+#define DES_INITIAL_KEY_LEN 56
+#define DES_SUBKEY_LEN 48
+#define DES_DATA_BLOCK_LEN 64
+#define DES_SBOXES 8
+#define DES_SBOX_LEN 64
+#define DES_PBOX_LEN 32
+
+#define MODE_CRYPT 1
+#define MODE_DECRYPT 2
+#define MODE_ECB 4
+#define MODE_CBC 8
typedef unsigned char u8;
typedef unsigned char u8;
-int des_encrypt(u8 *plain,u8 *crypted,u8 *key);
-int des_decrypt(u8 *crypted,u8 *plain,u8 *key);
+int des_encrypt(u8 *plain,u8 *crypted,u8 *key
,int len,u8 mode
);
+int des_decrypt(u8 *crypted,u8 *plain,u8 *key
,int len,u8 mode
);
#endif /* DES_H */
#endif /* DES_H */