Hi I am a research student working on securing the communications in Controlled Area Networks (CANs), and I am using Arduinos to simulate one of these CANs.
My goal is to use HMAC to implement message authentication of packets, and the algorithm must be very fast (I was originally thinking of using FNV1a). However, there are no Arduino libraries for this (I found one, but it uses SHA which will most likely be too slow for CAN). I don't have a lot of practice with cryptography and hash algorithms, only usage of them.
So basically, I need help writing a FNV or FNV1a function in C. The message for input will be a key (obviously) concatenated with a string (char array). Also, I need the hash to be between 128 and 256 bits for sufficient security.
Just as a side note: A CAN message/packet looks like 7df#02010d and the actual data part, 010d (two bytes) is the char array I will be using. For example, as integers, the array for 010d would be {1, 13}.
--
I also know this message applies more to cryptography than Arduino, but I figured someone from this community might have more experience with my particular task, or even have/know of a library I can use that I hadn't found.
-Thanks
EDIT: I found this FNV1a implementation in C/C++ that might work. But I have not tested it yet.