Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BLU0-SMTP26293F2EBE6962FA00204FEFD200@phx.gbl>
Date: Fri, 4 Jan 2013 14:18:27 +0100
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: Re: Supporting different hash algorithms with a single
 format?

On 01/04/2013 01:34 PM, Dhiru Kholia wrote:
> On Fri, Jan 4, 2013 at 5:38 PM, Frank Dittrich
> <frank_dittrich@...mail.com> wrote:
>> I don't know how many cases of a single format supporting completely
>> different hash algorithms exist.
>>
>> I think mixing support of different hash algorithms in the same file is
>> OK, if there are enough similarities.
>> But it certainly would have been better to make this two separate
>> formats, e.g.:
>> -odf-sha1-bf "ODF SHA-1 Blowfish"
>> -odf-sha256-aes "ODF SHA-256 AES"
> 
> I like the idea for multiple reasons but it will increase maintenance burden.

You can still implement both formats in the same file.
More or less, you just need
#define FORMAT_LABEL_0	"odf-sha1-bf"
#define FORMAT_LABEL_1	"odf-sha256-aes"
#define FORMAT_NAME_0	"ODF SHA-1 Blowfish"
#define FORMAT_NAME_1	"ODF SHA-256 AES"
...
static struct fmt_tests odf_tests_0[] = ...
static struct fmt_tests odf_tests_1[] = ...

valid_0() and valie_1(), which call the common valid() with an
additional parameter, separate crypt_all_0() and crypt_all_1(),

And finally, separate
struct fmt_main odf_fmt_0 = { ...
struct fmt_main odf_fmt_1 = { ...

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.