Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sun, 20 May 2012 18:46:24 +0400
From: Solar Designer <>
Subject: Re: Blowfish OpenCL

Hi Sayantan,

On Sun, May 20, 2012 at 07:48:58PM +0530, SAYANTAN DATTA wrote:
> Can you please explain these #define in bf_std.h / bf_std.c
> 1. BF_mt
> 2. BF_cpt

These two are for OpenMP-enabled builds.  BF_mt is the maximum thread
slot count.  BF_cpt is "crypts per thread"; it increases the amount of
work every thread does before the threads are forced to sync.

> 3. BF_X2

BF_X2 = 1 enables the computation of two hashes at once with mixed
instructions, thereby increasing the instruction-level parallelism.
At high level, it is similar to but independent from BF_cpt, and it may
be set in non-OpenMP builds as well.  For example, when BF_X2 is enabled
and BF_cpt is 3 and OpenMP is enabled (BF_mt > 1), a total of 6 hashes
are computed per thread before the threads are sync'ed.

For your OpenCL work, you may start by modifying this simplified

john-1.7.8-fpga-hooks.diff.gz available near the bottom of this wiki page:

I originally prepared it for interfacing to an FPGA implementation of
Eksblowfish (multiple Eksblowfish cores in an FPGA chip), but it should
work equally well for OpenCL (multiple instances of Eksblowfish computed
by an OpenCL kernel).

If you're curious, some further FPGA implementation stuff is here:

The john-1.7.8-fpga-hooks.diff.gz patch removes BF_X2 and unties BF_N
from the BF_cpt and BF_mt settings, which it also removes.  However, it
keeps BF_N, because you'll need it to compute multiple instances of
Eksblowfish in parallel.

If you use this, we'll need to port it to 1.7.9's revision of the code
at some point, but that's easy.



Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ