[Ocf-linux-users] question about a custom HW crypto driver
Brought to you by:
david-m
From: Amir T. <ami...@pe...> - 2009-08-04 22:30:11
|
Hello, I finished writing a Linux device driver for a custom crypto accelerator and after testing it am now in the process of adapting it to work with OCF Linux. I would greatly appreciate some pointers on some problems I encountered. 1. The driver uses DMA to fetch the input and then write the output after the crypto operation has completed. In my test version I put the call to sleep on a wait queue which then gets woken up by the DMA done ISR. I tried a similar approach with my OCF version but get scheduling panic messages from the kernel. What is the proper way to suspend the call until the DMA transfer has completed? 2. As a temporary hack until I figure out #1 I am currently polling to see when the operation has completed. Using openssl (with an OCF patch) I ran the following commands: openssl aes-128-cbc -a -salt -in test.txt -out test.txt.enc -pass pass:amir123 openssl aes-128-cbc -d -a -in test.txt.enc -out test.txt.dec -k amir123 where test.txt is: This is a test 123456789 line 1 This is a test 123456789 line 2 This is a test 123456789 line 3 …. This is a test 123456789 line 18 This is a test 123456789 line 19 This is a test 123456789 line 20 I get the following error: bad decrypt 1023:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:461: And the contents of the resulting test.txt.dec are: &£f64˜ uyVֳue23456789 line 1 This is a test 123456789 line 2 This is a test 123456789 line 3 ... This is a test 123456789 line 18 This is a test 123456789 line 19 This is a test 123456 So for some reason I am getting garbage in the beginning of the decrypted message and missing other data at the end of it? Thanks Amir |