From: hackbard Date: Sun, 28 Sep 2003 20:52:33 +0000 (+0000) Subject: grr, bytes -> bits 1st part X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=324bac8319d6f902630b109a7ca50b3a28fa5330;p=my-code%2Fcrypto.git grr, bytes -> bits 1st part --- diff --git a/des.c b/des.c index a1cdbba..29cfa94 100644 --- a/des.c +++ b/des.c @@ -42,9 +42,10 @@ int rotate_left(u8 *obj,int len) { key_perm(u8 *key) { int i; - u8 *new[DES_SUBKEY_LEN]; + u8 *new[DES_SUBKEY_LEN/8]; + memset(new,0,DES_SUBKEY_LEN/8]; for(i=0;i>((8-key_perm_table[i]%8)%8); memcpy(key,new,DES_SUBKEY_LEN); return 1; } @@ -58,13 +59,22 @@ int subkey_trans(u8 *key,int round) { return 1; } +int fuckup_data(u8 *key,int round,u8 *plain,u8 *crypted) { + u8 permc[DES_PERMC_LEN]; + int i; + for(i=0;i