Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 8 Jun 2013 20:57:21 +0200
From: Lukas Odzioba <>
Subject: Re: sha3-opencl

2013/6/8 Dániel Bali <>:
> My guess is that x/4*4 makes sure the value is divisible by 4, which might be
> because of the 4 byte integers. I'm not sure.
You're right, this is used to align data in gpu memory.

> Claudio André pointed out the error that caused the segfaults/double free
> errors. It was this line:
> res_hashes = malloc(sizeof(cl_uint) * 3 * kpc);
> I changed the 3 to 7 and now the kernel runs on both devices with any
> MAX_KEYS_PER_CRYPT value, so I guess it works now.
> I'm not sure how could I miss this line because I was looking for constants
> like this that needed to be changed because of the hash size difference
> between keccak256 and md5. Maybe because I was focused on the value 4 much
> more.

That is a good reason to change magic values like 3 or 7 to
macros/constants. This way it would be hard to miss that.


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.