Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <774d2b2c.6f08952.51e082c1.2d669@o2.pl>
Date: Sat, 13 Jul 2013 00:27:13 +0200
From: marcus.desto <marcus.desto@...pl>
To: john-dev@...ts.openwall.com
Subject: Re:  Probably a third BUG in pbkdf2_hmac_sha1_unsplit_kernel.cl

Hi again,

well, I think this test shows, that the source of the problem is not pyopencl.

I set the parameters in the py program as mentioned before to create structs as needed:
keylen = 49 (errorous)
saltlen= 51
outlen = 13 (implies uint32[4] )

Next:
I remove all the source code from pbkdf2_hmac_sha1_unsplit_kernel.cl

so following just left in pbkdf2_hmac_sha1_unsplit_kernel.cl:

/*
 * This software is Copyright (c) 2012 Lukas Odzioba <ukasz@...nwall.net>
 * and Copyright (c) 2012 magnum
 * and it is hereby released to the general public under the following terms:
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted.
 *
 * Pass this kernel -DKEYLEN=x -DOUTLEN=y -DSALTLEN=z for generic use.
 *
 * KEYLEN  should be PLAINTEXT_LENGTH for passwords or 20 for hash
 * OUTLEN  should be sizeof(outbuffer->v)
 * SALTLEN should be sizeof(currentsalt.salt)
 */

#define KEYLEN 49
#define OUTLEN 13
#define SALTLEN 51



typedef struct {
	uint length;
	uchar v[KEYLEN];
} pbkdf2_password;

typedef struct {
	uint v[(OUTLEN+3)/4];
} pbkdf2_hash;

typedef struct {
	uchar length;
	uchar salt[SALTLEN];
	uint iterations;
	uint outlen;
} pbkdf2_salt;


inline void pbkdf2(__global const uchar * pass, uint passlen,
                   __global const uchar * salt, uint saltlen, uint iterations,
                   __global uint * out, uint outlen)
{
}


__kernel void derive_key(__global const pbkdf2_password *inbuffer,
    __global pbkdf2_hash *outbuffer, __global const pbkdf2_salt *salt)
{
	uint idx = get_global_id(0);
	pbkdf2(inbuffer[idx].v, inbuffer[idx].length,
	       salt->salt, salt->length,
	       salt->iterations, outbuffer[idx].v, salt->outlen);
}

I ran the py program and this time pyopencl DID NOT raise any errors. It just resultet the initiated result array, which has been initiated with zero.

So, the source of the error is in pbkdf2_hmac_sha1_unsplit_kernel.cl , for sure.

Regards
Marcus

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.