LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Hash hardware cant do “only” final. How to implement? (https://www.linuxquestions.org/questions/linux-kernel-70/hash-hardware-cant-do-%93only%94-final-how-to-implement-4175643061/)

drbrains 11-25-2018 07:40 PM

Hash hardware cant do “only” final. How to implement?
 
I'm writing a device driver for a hardware-crypto engine. This engine has a limitation so that I need to implement the ".finup" part of the hash api because it can't "just" finalise with a "0" length request.

Should I implement only ".finup" and register "NULL" for ".final" or should I return some kind of error ?

Solved: (its clearly written in the /include/hash.h that .final is Mandatory!)

Solution is to "leave" the final block during an "update" request out of the engine. This last block will be used together with the "final" bit set in the hardware registers. In cause there would be consecutive "update" request, this block will be processed together with the request except that last block again. Since I need a buffer anyway for this, I am not even passing the request to the hardware until I have at least 1 page worth off data the be processed. For the ".export" call I will process this buffer except the last block so I don't need to export a bigger block of data.

MensaWater 11-26-2018 09:13 AM

Rather than asking for the question to be removed, please repost the question and how you solved it. Although you think it was stupid it may be something someone else in future will encounter and finding your question and resolution may help them on a web search.


All times are GMT -5. The time now is 06:05 AM.