LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-26-2018, 02:30 AM   #1
drbrains
LQ Newbie
 
Registered: Feb 2018
Posts: 11

Rep: Reputation: Disabled
Rewriting old blkcipher aes hw driver to kernel v4.x using crypto-engine "how-to"


I am trying to rewrite a AES HW crypto driver based on old code from the kernel v2.6 era. The old code was using the blkcipher API, but I feel that it would make more sense to have a HW engine using at least Async (ablkciper). Going this route, the choice would be to use the skcipher API which should make my code conform with the "latest" standards.

I would like to use the crypt-engine to handle queue requests etc. What is not clear to me is how to get a new request to process before I return the result from the previous request. My hardware is not completely autonomous, but can use PDMA to process the input and output. Using interrupts to notify process complete, but also input buffer empty. I would like to use the last one to start a new request even before the previous request is completely processed.

What would be the best practice to implement such a driver? I have already looked over the code for atmel-aes, omap-aes and the marvel and mediatek solutions. All have different approaches to this problem.

The resulting "frame-work" would be the basis for my next project, so I would like to be as generic as possible. Any advice will be appreciated.
 
Old 02-28-2018, 12:27 AM   #2
drbrains
LQ Newbie
 
Registered: Feb 2018
Posts: 11

Original Poster
Rep: Reputation: Disabled
Angry

Okay, so I will start writing my own replies.

After spending a lot of time on research for this little project I found the following:

* ablkcipher is depreciated over the skcipher

* crypto_engine is only available since kernel v4.6

* crypto_engine does NOT! allow the use of skcipher_request (even there was a patch in June 2017)

Rewriting the code to use ablkcipher now...or I may end up writing the queue-handling from the crypto-engine in my own driver!!

How do developers even keep up with all the API changes and which patches for merged and not??
 
Old 03-06-2018, 02:34 PM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Crypto is one area where the programmer requires a lot of experience specifically in cryptography. To keep track of changes, you have to read all the changelogs.
 
  


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
Shutdown hangs at "Stopping remaining crypto disks (busy)" fornax Debian 15 07-04-2017 05:03 AM
How to disable rewriting "Envelope From address" in postfix? intrajp Linux - Server 1 07-28-2015 07:36 PM
Would Strongswan make use of the "AES NI" instruction set on Intel i-series CPUs? psycroptic Linux - Server 5 02-01-2015 11:58 PM
[SOLVED] X: "loading extension glx" "no screens found" "fatal server error" (w/ nvidia driver) Geremia Slackware 7 12-29-2014 11:00 AM
Rewriting "Set-cookie:" http header field J_Szucs Linux - Networking 3 08-06-2007 04:10 AM

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

All times are GMT -5. The time now is 01:27 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