Skip to content

Instantly share code, notes, and snippets.

@balidani
Created September 18, 2013 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save balidani/13f8520b0bcbfdf2584b to your computer and use it in GitHub Desktop.
Save balidani/13f8520b0bcbfdf2584b to your computer and use it in GitHub Desktop.
/*
* Keccak-f[1600] 256bit OpenCL
* This software is Copyright (2013) Daniel Bali <balijanosdaniel at gmail.com>,
* 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.
* Code is based on:
* - public domain code by Matt Mahoney
*/
#include "opencl_device_info.h"
/*
* OpenCL kernel entry point. Copy key to be hashed from
* global to local (thread) memory. Keccak256 hash of a key is 256 bit.
*
*/
__kernel void crc32(__global const uint *keys, __global const uint *index, __global uint *hashes)
{
// Kernel variables
uint gid = get_global_id(0);
uint num_keys = get_global_size(0);
uint i;
// Set output buffers
for (i = 0; i < 2; ++i) {
hashes[i * num_keys + gid] = 0xaaaaaaaa;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment