EXTRA_SPACE in scrypt
#1
Wink 
Hello everyone.

I want to try to implement the yescrypt module in Hashcat, at least the fixed mode YESCRYPT_RW with t = 0 and without ROM. I planned to use the 8900 module (also known as scrypt) as a basis. However, for yescrypt I will need to use the LOOP and LOOP2 options, that's clear.

Now I have a question about calculating the allocated memory size in the function module_extra_buffer_size. The most voluminous element is EXTRA_SPACE. What specifically does such a large buffer use for?

EXTRA_SPACE calculated as follow:

Code:
// sometimes device_available_mem and device_maxmem_alloc reported back from the opencl runtime are a bit inaccurate.
// let's add some extra space just to be sure.
// now depends on the kernel-accel value (where scrypt and similar benefits), but also hard minimum 64mb and maximum 1024mb limit

u64 EXTRA_SPACE = (1024ULL * 1024ULL) * device_param->kernel_accel_max;

EXTRA_SPACE = MAX (EXTRA_SPACE, ( 64ULL * 1024ULL * 1024ULL));
EXTRA_SPACE = MIN (EXTRA_SPACE, (1024ULL * 1024ULL * 1024ULL));

And one more question. What is the purpose of using theĀ kernel-accel?

I hope the Hashcat developers will lift the veil of mystery Smile.
Thanks.
Reply