I have a need for implementing an algorithm to validate that a given message is not altered after some operations (for instance after transmission over a medium).

A typical way of doing this kind of task is to pre-calculate a hash on the content (CRC for instance), then transmit both the content and the hash. On the reception side, recalculate the hash on the received content and verify it is identical to the received hash. If so, then the content is not altered.

The problem I'm facing is that I need to implement this hash function on a GPU compatible with the shader model 3.0. Essentially, this means that it is a processor that does not support bitwise operations. It only works with floating point numbers, supporting operations like multiply, add, substract, dot product and so.

Anyone knowing a hash function I could use for that purpose and implementable with the processor instruction limitations I mention ?


  • $\begingroup$ Any particular reason for using a GPU? Shipping data to/from that is expensive, for one simple round of operations it won't be worth the effort. And it's not that there will be lots to be paralellized either here... $\endgroup$
    – vonbrand
    May 23, 2014 at 17:44

1 Answer 1


cannot comment (rep issues), so i add this as a (possible) answer

  1. All bitwise operations can be simulated with standard arithmetic operations (+,-,modulo etc..)

  2. You can use alternative data structures (eg arrays) to simulate shifts etc..

  3. You can use other hashing functions or algorithms tha do not rely on bitwise operations


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.