Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 3 Apr 2015 20:03:48 +0200
From: Agnieszka Bielec <bielecagnieszka8@...il.com>
To: john-dev@...ts.openwall.com
Subject: Re: [GSoC] John the Ripper support for PHC finalists

I'll try to explain


first of all
./john --test --format=pomelo/pomelo_opencl
doesn't make any sense.
only
./john --test --format=pomelo/pomelo_opencl --m_cost=..  --t_cost=...
or
M_COST=... T_COST=... ./john ....

on my computer I have:

none@...e:~/Desktop$ time ./pomelo plain salt 100 5 5

real    0m0.028s
user    0m0.024s
sys    0m0.004s

none@...e:~/Desktop$ time ./pomelo plain salt 100 6 6

real    0m0.110s
user    0m0.110s
sys    0m0.000s



2015-04-03 12:27 GMT+02:00 Frank Dittrich <frank.dittrich@...lbox.org>:
>Why do you need to access the the tunable cost parameters specified on
>the command line from within the format's init() function?

2015-04-03 11:59 GMT+02:00 Solar Designer <solar@...nwall.com>:
>What memory usage (per hash) does it correspond to?

The kernel is compiled inside the init function.
The memory needed per one unit is parametrized by M_COST.

it is 1<<(13+M_COST) bytes so I need to declare the array of
different sizes. in __private memory it is possible by
passing builds opts to the kernel:

sprintf(build_opts,
        "-DBINARY_SIZE=%d -DSALT_SIZE=%d -DMEM_SIZE=%d -DM_COST=%d
-DT_COST=%d",
        BINARY_SIZE, SALT_SIZE, MEM_SIZE, M_COST, T_COST);

-DMEM_SIZE=%d is a size of the array

so I need to have MEM_SIZE in the init function()
M_COST and T_COST are included in salts

http://stackoverflow.com/questions/17995991/variable-length-array-declaration-not-allowed-in-opencl-why

"
Not sure why people are saying you can't do this as it is something
many people do with OpenCL (Yes I understand its not exactly the same
but works well enough for many cases). Since OpenCL kernels are
compiled at runtime and just text you can just simply the size with
what ever size you want then recompile your kernel. This obviously
won't be perfect in cases where you have huge variability in sizes
but usually I compile several different sizes at startup and then
just call the correct one as needed (in your case based on the kernel
argument). If I get a new size I don't have a kernel for I will compile
it right then and cache the kernel in case it comes up again.
"

2015-04-03 12:27 GMT+02:00 Frank Dittrich <frank.dittrich@...lbox.org>:
>Calling the format's init() function inside set_salt() doesn't look like
>a good idea.

I know but I was experimenting


2015-04-03 18:17 GMT+02:00 magnum <john.magnum@...hmail.com>:
>I still think you should set things up in reset(db != NULL) at which
>point costs will be known. Did you miss my mail
>http://www.openwall.com/lists/john-dev/2015/03/30/17 ?

I see but it's only auto tuning, I don't want to compile the kernel
many times.
I think that I must to generate fmt_test automatically because
there's many of combinations of (m_cost,t_cost) values
and we want to see the --test with the concrete values
of t_cost and m_cost


2015-04-03 12:27 GMT+02:00 Frank Dittrich <frank.dittrich@...lbox.org>:
>Maybe you can use the format's reset() function? Some other opencl
>formats do have a reset() implementation instead of using
fmt_default_reset.

>/* Called whenever the set of password hashes being cracked changes, such
as
> * after self-test, but before actual cracking starts.  When called before
a
> * self-test or benchmark rather than before actual cracking, db may be
>NULL.
> * Normally, this is a no-op since a format implementation shouldn't
>mess with
> * the database unnecessarily.  However, when there is a good reason to
>do so
> * this may e.g. transfer the salts and hashes onto a GPU card. */

and you also want to compile the kernel again for other parametes
inside the reset function? if yes the kernel will be compiled two
or more times


all the time I'm thinking about adding parametres to john,
maybe it's possible to bypass this

the most important is part:

"
2015-04-03 12:27 GMT+02:00 Frank Dittrich <frank.dittrich@...lbox.org>:
>Why do you need to access the the tunable cost parameters specified on
>the command line from within the format's init() function?

2015-04-03 11:59 GMT+02:00 Solar Designer <solar@...nwall.com>:
>What memory usage (per hash) does it correspond to?

The kernel is compiled inside the init function.
The memory needed per one unit is parametrized by M_COST.

it is 1<<(13+M_COST) bytes so I need to declare the array of
different sizes. in __private memory it is possible by
passing builds opts to the kernel:

sprintf(build_opts,
        "-DBINARY_SIZE=%d -DSALT_SIZE=%d -DMEM_SIZE=%d -DM_COST=%d
-DT_COST=%d",
        BINARY_SIZE, SALT_SIZE, MEM_SIZE, M_COST, T_COST);

-DMEM_SIZE=%d is a size of the array

so I need to have MEM_SIZE in the init function()
M_COST and T_COST are included in salts
"

You can see my code on my repository where I have:
"
M_COST = 2;
T_COST = 2;
MEM_SIZE = 1ULL << (10 + M_COST);
"

hardcoded


Thanks for answers and I hope it is more understandable

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.