Does exist OpenACC code of SHA-224, SHA-256 ?

Hi,
Does exist open source code of fast software implementation in C/OpenACC of the FIPS 180-2 hash algorithms SHA-224, SHA-256 ?

Christian.

Hi Christian,

While it doesn’t mean that one doesn’t exist, I’m not aware of anyone implementing SHA-224 or SHA-256 in OpenACC. You may need to write on yourself or integrate a CUDA version into your code.

I’ll also put out a note on the OpenACC User Group’s Slack channel to see if anyone there knows of an implementation. https://www.openacc.org/community#slack

-Mat

Hi Mat,

Thank you for your help.

I did some Google searches and found nothing on the subject. I’m surprised, I didn’t find any implementation of hash functions with OpenACC.

Do you think it is possible to adapt C code from a Hash function on CPU to OpenACC for GPU?

-Christian

Mat,

Do you think it’s a good idea to port hash224 functions (sha224_init, sha224_update, sha224_final) from C code to OpenACC (with #pragma acc routine)?

Hi Christian,

Having no experience with these routines, I can’t offer a recommendation. My guess is that you can offload them to a device given that there are CUDA implementations of these routines.

Do you have a C implementation you can post someplace? If so, it shouldn’t be too difficult to give it a try. It’s just a matter of how parallelizable the algorithm is.

-Mat

Hi Mat,

I put on WeTransfer a C implementation : https://we.tl/4h3qtTGizV

Rem : ZIP file will only be available one week on WeTransfer.

Thanks again for your help.

-Christian.

Hi Christian,

I was able to offload the code to the GPU. The sha code didn’t have much opportunity for parallelism, so I just made all the device routines “seq” and then parallelized the main.c loop over the “j” (table) loop. While it works, it’s slow since there’s so little parallelism.

I sent you the code via Slack. Let me know if you have questions.

-Mat

Thank you.