--- src/parallella_bf_fmt.c.orig 2013-07-16 11:04:39.417335815 +0000 +++ src/parallella_bf_fmt.c 2013-07-16 14:18:24.645126404 +0000 @@ -29,7 +29,7 @@ #define PLAINTEXT_LENGTH 72 #define CIPHERTEXT_LENGTH 60 -#define BINARY_SIZE 4 +#define BINARY_SIZE 8 #define BINARY_ALIGN 4 #define SALT_SIZE 22+7 #define SALT_ALIGN 4 @@ -52,7 +52,7 @@ typedef ARCH_WORD_32 BF_word; /* * Binary ciphertext type. */ -typedef BF_word BF_binary[6]; +typedef BF_word BF_binary[2]; typedef struct { @@ -369,7 +369,9 @@ static int cmp_all(void *binary, int cou static int cmp_one(void *binary, int index) { - return *(BF_word *)binary == parallella_BF_out[index][0]; + return + ((BF_word *)binary)[0] == parallella_BF_out[index][0] && + ((BF_word *)binary)[1] == parallella_BF_out[index][1]; } static int cmp_exact(char *source, int index) @@ -381,10 +383,8 @@ void *parallella_BF_std_get_binary(char { static BF_binary binary; - binary[5] = 0; - BF_decode(binary, &ciphertext[29], 23); - BF_swap(binary, 6); - binary[5] &= ~(BF_word)0xFF; + BF_decode(binary, &ciphertext[29], 8); + BF_swap(binary, 2); return &binary; } --- src/parallella_e_bcrypt.c.orig 2013-07-16 11:04:39.097056025 +0000 +++ src/parallella_e_bcrypt.c 2013-07-16 14:11:43.692166292 +0000 @@ -61,7 +61,7 @@ typedef uint32_t BF_word; typedef int32_t BF_word_signed; -typedef BF_word BF_binary[6]; +typedef BF_word BF_binary[2]; typedef struct { @@ -712,11 +712,11 @@ static void *BF_crypt(const char *key, c } while (1); } while (--count); - for (i = 0; i < 6; i += 2) { + { BF_word L, LR[2]; - L = BF_magic_w[i]; - LR[1] = BF_magic_w[i + 1]; + L = BF_magic_w[0]; + LR[1] = BF_magic_w[1]; count = 64; do { @@ -724,12 +724,12 @@ static void *BF_crypt(const char *key, c &LR[0], &LR[0]); } while (--count); - data.binary.output[i] = L; - data.binary.output[i + 1] = LR[1]; + data.binary.output[0] = L; + data.binary.output[1] = LR[1]; } memcpy(BF_out, data.binary.output, sizeof(BF_binary)); - BF_out[5] &= ~(BF_word)0xFF; +// BF_out[5] &= ~(BF_word)0xFF; }