Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 30 May 2013 11:29:28 +0530
From: Sayantan Datta <std2048@...il.com>
To: john-dev@...ts.openwall.com
Subject: Re: Unify internal form of mscash2 hashes?

Hi,

On Thu, May 30, 2013 at 8:08 AM, <jfoug@....net> wrote:

> Should be easy, as long as the CPU one gets built for opencl (I think it
> does).
>
> Do this
>
> in the opencl, drop valid, prepare, split (etc).
>
> in the cpu, rename them to something unique, and remove the static.  So
> valid would be MSCASH2_valid.
>
> Then in opencl, simply do a declaration:
>
> extern int MSCASH2_valid(proper_signature_for_valid);
>
> Then in the format structure for opencl, use MSCAH2_valid.
>
> Done, and one 1 function that ALL of them can use.  Now, if the CPU code
> is not built/linked on the opencl version, then yes, there would need to be
> some common file.
>
> This (IMHO) is why over zealousness on static-ness (for functions), is not
> always the best thing.  Instances where code sharing SHOULD happen, are
> often overlooked.  Many of the non inner loop format methods could easily
> be shared, on formats of the same type hashes.  Write them correct one
> time, and then use them.
>
> Jim.
>
> ---- magnum <john.magnum@...hmail.com> wrote:
> > On 30 May, 2013, at 2:47 , "jfoug" <jfoug@....net> wrote:
> >
> > > Why replace?  can we simply not make them non-static, and simply use
> them?
> >
> > It's a bit complicated as the CPU one is a plugin and the OpenCL one is
> not compiled for CPU-only builds. It could be moved out to some separate
> shared file though, like mscash2-shared_plug.c
>
> We need to change the format label and max salt length. So I guess I will
share a more generic function and wrap them in static function particular
to the format.

Regards,
Sayantan

Content of type "text/html" skipped

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.