Home > Uncategorized > Day 9 — The Plan, and OpenCL Implementation into BLAKE2s

Day 9 — The Plan, and OpenCL Implementation into BLAKE2s

Hey all, welcome to CryptoCL.

After talking with Dr. Marmorstein, we both decided we will both use one version of BLAKE2 to implement using OpenCL. I am tasked to implement OpenCL with the BLAKE2s version of BLAKE2.

However, I was a bit confused about our last meeting — I mistook my work to be to implement the ROUND function as an OpenCL kernel. This was a mistake, as I needed to implement the G function as the OpenCL kernel. After a quick fix, I began to implement various OpenCL functions into the BLAKE2s implementation.

I had a choice to make in whether or not I should start creating OpenCL objects in the main function, or later on in the ROUND function. Doing the former means that the program will be quick to end if there is an issue with building the kernel, however these variables will have to be carried from the main all the way to wherever the ROUND function is declared. Doing the latter meant that, while everything was concisely packed into the ROUND function, the program would have travelled pretty far already, and be difficult to manage the memory safely. Weighing the options, I opted for the latter, and decided to create the OpenCL objects within the main function.

Memory objects that were to be used by the kernel, however, will be created within the ROUND function, and disposed of at the end of the ROUND function.

I decided to stop in the middle of my work after looking over it for a long while, and since I have other obligations to do, stopping at the point where the kernel arguments were being assigned to the function. I stopped at a good place, too — the G function takes in an unsigned int i, which is the numbers 0-7 within the ROUND function. I might need to understand more of how OpenCL works, because I am not quite sure how to implement this as a argument for the kernel. I’ll do some more research to find out, and continue next time.

Next time, I should be able to finish implementation of the OpenCL version of BLAKE2s, and then it will be time to fix errors or bugs (but in an ideal world, the program has no errors and bugs and I can move onto testing, but this is not the likely outcome!)

See you next time!

Kyle Jenkins.

Time spent today: 3 hours
Total Time: 12 hours

Categories: Uncategorized Tags: ,
  1. No comments yet.