LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-25-2018, 07:40 PM   #1
drbrains
LQ Newbie
 
Registered: Feb 2018
Posts: 11

Rep: Reputation: Disabled
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.

Last edited by drbrains; 11-26-2018 at 09:25 AM. Reason: as requested by @MensaWater
 
Old 11-26-2018, 09:13 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is the hash in "rootpw --iscrypted HASH" in Kickstart encrypted with md5? Rogue45 Linux - Newbie 1 08-01-2012 12:46 AM
Perl Hashes -- Updating a hash ref via hash value 0.o Programming 5 06-05-2012 12:45 PM
Perl Hash of Hash reference query kdelover Programming 1 02-19-2011 04:47 AM
need help unpacking hmac-md5 hash into md5 hash lynx5 Programming 3 02-02-2008 04:06 PM
Using hash value as key for other hash in Perl scuzzman Programming 6 02-14-2006 05:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration