From: hackbard Date: Mon, 29 Sep 2003 00:09:51 +0000 (+0000) Subject: - X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc3c48a5257347daf239f187babd2f38c96d7b81;p=my-code%2Fcrypto.git - --- diff --git a/des.c b/des.c index 29cfa94..04951d6 100644 --- 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>((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; }