Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABob6iqhrj0cZjUqn6RoaPqso4H-G5=xDZZ1wAB1sDaHCUaeOw@mail.gmail.com>
Date: Sun, 9 Jun 2013 23:50:57 +0200
From: Lukas Odzioba <lukas.odzioba@...il.com>
To: john-dev@...ts.openwall.com
Subject: popular binary_hash_*

magnum,all:
what do you think about moving this common piece of code to formats.c?

static int binary_hash_1(void * binary) { return *(ARCH_WORD_32 *)
binary & 0xFF; }
static int binary_hash_2(void * binary) { return *(ARCH_WORD_32 *)
binary & 0xFFF; }
static int binary_hash_3(void * binary) { return *(ARCH_WORD_32 *)
binary & 0xFFFF; }
static int binary_hash_4(void * binary) { return *(ARCH_WORD_32 *)
binary & 0xFFFFF; }
static int binary_hash_5(void * binary) { return *(ARCH_WORD_32 *)
binary & 0xFFFFFF; }
static int binary_hash_6(void * binary) { return *(ARCH_WORD_32 *)
binary & 0x7FFFFFF; }

We have near 100 occurences of that in bleeding = 6*100-6 = 594
duplicated lines.

Lukas

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.