Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 1 Apr 2012 23:51:47 +0400
From: Solar Designer <>
Subject: Re: JtR: GPU for slow hashes

Hi Sayantan,

On Sun, Apr 01, 2012 at 08:57:00PM +0530, SAYANTAN DATTA wrote:
> I was looking at the code but was unable to understand
> the use of int binary_hash_x(void *binary) and the int get_hash_x(int
> index) functions properly.
> More specifically why are there so many functions for each of the above
> type in the cuda code.

This is not specific to the CUDA code, it is part of the formats
interface.  First, binary_hash*() functions return hash values (suitable
as indices into hash tables) for the provided binary ciphertexts (full
hashes loaded for cracking and already converted to binary).  Then,
during cracking get_hash*() functions return compatible hash values
(suitable as indices into the same hash tables) for computed hashes
(that correspond to candidate passwords being tested).  There are many
functions of each kind because there are many hash table sizes that we
can use (depending on the number of hashes loaded for cracking).

binary_hash*() are not performance-critical (they may affect startup
time only).  In fact, in the next revision of the formats interface I am
likely to combine them into one function that will accept the desired
size as an extra argument.

get_hash*() are performance-critical (they're used during cracking if a
hash count threshold for hash table use is reached).  The use of many
separate functions provides a little bit of speedup (specialized code).

>   It would be very helpful if you could give an example use of the above
> two functions.

You don't need to use them - you provide them for the rest of JtR to
use.  That said, you may see binary_hash*() called from loader.c:
ldr_init_hash_for_salt().  This function also sets salt->index to point
to the right get_hash*() function.  The latter is called from cracker.c:


P.S. On your replies, please try to quote relevant context only (but do
quote some).

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.