Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 7 Mar 2011 17:31:02 -0600
From: "jfoug" <jfoug@....net>
To: <john-dev@...ts.openwall.com>
Subject: RE: --utf8 option, proof of concept

>-----Original Message-----
>From: magnum   Sent - Monday, March 07, 2011 4:03 PM
>* In a couple of formats (eg. NT) I have doubled the set_salt function
>and call it via a pointer, in order to mitigate the performance hit for
>non-utf8. I'm not sure how to do it better, but I'm not particularly
>satisfied. It's a hack.

Here is an example for the changes in rawmd5.

extern struct fmt_main fmt_rawMD5unicode

static void rawmd5_init(void)
{
	if (options.flags & FLG_UTF8)
		rawMD5unicode.set_key = set_key_utf8;
	else
		rawMD5unicode.set_key = set_key_ansi;
}


Simply sets the function pointer to the proper set_key into the format's
function pointer for set_key.  The only reason for the extern, is since the
declaration/definition of the actual object is at the end of the source
file. 

Jim.

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.