Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BLU0-SMTP114A1C96C3C06D56D2F4AAEFD100@phx.gbl>
Date: Sun, 20 Jan 2013 20:16:13 +0100
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: Re: binary_hash_[0-6] and get_hash_[0-6]

On 01/20/2013 01:25 AM, magnum wrote:
> On 20 Jan, 2013, at 0:09 , Frank Dittrich <frank_dittrich@...mail.com> wrote:
>> The formats currently implemented implement different numbers of hash
>> functions.
>>
>> The following grep commands are not perfect, but I think they provide an
>> overview which is good enough:
>>
>> (unstable-jumbo)src $ grep "binary_hash_[0-6]$" *_fmt*.c|sed
>> 's#^.*\(.\)$#\1#'|sort|uniq -c
>>     16 4
>>    103 6
>> (unstable-jumbo)src $ grep "get_hash_[0-6]$" *_fmt*.c|sed
>> 's#^.*\(.\)$#\1#'|sort|uniq -c
>>      3 0
>>      3 1
>>      3 2
>>      3 3
>>     19 4
>>      3 5
>>    106 6
>>
>> While certain formats most likely will never be run with a number of
>> hashes warranting a get_hash_6 implementation, those which currently
>> implement 5 or 6 hash functions might implement the 7th as well.
>> Or am I missing something?
> 
> You are right. Patches are welcome!

OK, I'll look into it.

> BTW I have no idea what happens if the available sizes of get_hash does not match the ones of binary_hash. Your greps seem to indicate we have such cases.

Looks like I got false positives here.

I also found these in DES_fmt.c, BSDI_fmt.c and opencl_DES_fmt.c.
#define get_hash_0 DES_bs_get_hash_0
#define get_hash_1 DES_bs_get_hash_1
#define get_hash_2 DES_bs_get_hash_2
#define get_hash_3 DES_bs_get_hash_3
#define get_hash_4 DES_bs_get_hash_4
#define get_hash_5 DES_bs_get_hash_5
#define get_hash_6 DES_bs_get_hash_6

$ grep "^\s*binary_hash_[0-6]\s*$" *_fmt*.c|sed
's#^.*\(.\)$#\1#'|sort|uniq -c
     16 4
    102 6

$ grep "^\s*get_hash_[0-6]\s*$" *_fmt*.c|sed 's#^.*\(.\)$#\1#'|sort|uniq -c
     16 4
    101 6

I'll look at the 16 formats implementing only *_hash_[0-4], and check
where the one difference for *_hash_6 comes from.

Frank

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.