projects
/
my-code
/
crypto.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
324bac8
)
-
author
hackbard
<hackbard>
Mon, 29 Sep 2003 00:09:51 +0000
(
00:09
+0000)
committer
hackbard
<hackbard>
Mon, 29 Sep 2003 00:09:51 +0000
(
00:09
+0000)
des.c
patch
|
blob
|
history
diff --git
a/des.c
b/des.c
index
29cfa94
..
04951d6
100644
(file)
--- a/
des.c
+++ b/
des.c
@@
-45,7
+45,7
@@
key_perm(u8 *key) {
u8 *new[DES_SUBKEY_LEN/8];
memset(new,0,DES_SUBKEY_LEN/8];
for(i=0;i<DES_SUBKEY_LEN;i++)
- new[i/8]|=(
key[key_perm_table[i]/8]>>((8-key_perm_table[i]%8)%8
);
+ new[i/8]|=(
((key[(key_perm_table[i]-1)/8)]>>((8-key_perm_table[i]%8)&7))&1)<<(7-i%8)
);
memcpy(key,new,DES_SUBKEY_LEN);
return 1;
}