chiark
/
gitweb
/
~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
base/permute.h, utils/permute.lisp, symm/...: Formalize bit permutations.
[catacomb]
/
symm
/
des.c
diff --git
a/symm/des.c
b/symm/des.c
index 06400a15b1a549092e8bd62404c1ae9484213adc..e751cf0ef9f7370a8d4eb22139e1b24f6c648151 100644
(file)
--- a/
symm/des.c
+++ b/
symm/des.c
@@
-37,6
+37,7
@@
#include "blkc.h"
#include "des-base.h"
#include "des.h"
#include "blkc.h"
#include "des-base.h"
#include "des.h"
+#include "permute.h"
#include "gcipher.h"
/*----- Global variables --------------------------------------------------*/
#include "gcipher.h"
/*----- Global variables --------------------------------------------------*/
@@
-258,20
+259,30
@@
void des_init(des_ctx *k, const void *buf, size_t sz)
void des_eblk(const des_ctx *k, const uint32 *s, uint32 *d)
{
void des_eblk(const des_ctx *k, const uint32 *s, uint32 *d)
{
+#define REGWD 32
+ typedef uint32 regty;
+
uint32 x = s[0], y = s[1];
DES_IP(x, y);
DES_EBLK(k->k, x, y, x, y);
DES_IPINV(x, y);
d[0] = x, d[1] = y;
uint32 x = s[0], y = s[1];
DES_IP(x, y);
DES_EBLK(k->k, x, y, x, y);
DES_IPINV(x, y);
d[0] = x, d[1] = y;
+
+#undef REGWD
}
void des_dblk(const des_ctx *k, const uint32 *s, uint32 *d)
{
}
void des_dblk(const des_ctx *k, const uint32 *s, uint32 *d)
{
+#define REGWD 32
+ typedef uint32 regty;
+
uint32 x = s[0], y = s[1];
DES_IP(x, y);
DES_DBLK(k->k, x, y, x, y);
DES_IPINV(x, y);
d[0] = x, d[1] = y;
uint32 x = s[0], y = s[1];
DES_IP(x, y);
DES_DBLK(k->k, x, y, x, y);
DES_IPINV(x, y);
d[0] = x, d[1] = y;
+
+#undef REGWD
}
BLKC_TEST(DES, des)
}
BLKC_TEST(DES, des)