N900 AES and SHA1/MD5 hw acceleration drivers

N900 AES and SHA1/MD5 hw acceleration drivers

Tobias Karnat
Karma: 18
2010-09-03 11:44 UTC
Hi,

Some might already know that Nokia has recently released a driver for
AES and SHA1+MD5 hardware acceleration on the linux-crypto mailing list,
however these drivers where based against 2.6.35 and needed the kernel
to be rebuild in order to use them, because the platform device driver
was to be build in the kernel.

I have modified the driver in order to compile with the stock Nokia
kernel on the N900 and without requiring the kernel to be changed, they
do load...

However the omap-aes driver has problems if used in 256-Bit Cbc-Essiv
mode and if used in 128-Bit mode it causes the N900 to not wake up from
powersaving. The omap-sha1-md5 driver seems to be so far fine, but the
digest size in /proc/crypto looks somehow suspicious.

It would be very helpful, if someone could bug test the drivers as well,
since I don't have much experience with kernel modules. You will need to
update NOLO, since the M-Shield the N900 has, needs to be configured
differently, please make sure your N900 has hardware revision 2101 at
least.

I attached the NOLO update and the hw crypto modules, the source and the
patches are also included. Cryptsetup can be found in extra-devel, the
required dm-crypt and hash modules are also attached.

Tobias

Edit:
Since the files are to big for the mailing list, you can find them here:
http://www.mediafire.com/?cc1vbsnwnho31vb

  •  Reply

Re: N900 AES and SHA1/MD5 hw acceleration drivers

Tobias Karnat
Karma: 18
2010-09-03 23:21 UTC
Am Freitag, den 03.09.2010, 13:44 +0200 schrieb Tobias Karnat:
> Edit:
> Since the files are to big for the mailing list, you can find them here:
> http://www.mediafire.com/?cc1vbsnwnho31vb

If this doesn't work, use the following link as an alternative:
http://rapidshare.com/files/416924813/n900-crypto.tar.gz

Tobias

  •  Reply

Re: N900 AES and SHA1/MD5 hw acceleration drivers

Tobias Karnat
Karma: 18
2010-11-09 13:41 UTC
Hi,

Good news!!

The omap-aes driver has been fixed, it does now work without crashing.

The diff can be found here:
http://pastebin.com/PMt2j1Hs

omap-hw modules (incl. src.) compiled against PR1.3 can be found here:
http://www.mediafire.com/?0krkujb0vevvkva

But you will still need to update Nolo, load the required modules
(dm-mod, dm-crypt, hash-algorithm) and use cryptsetup to work with it.

The src of the modules including Nolo can still be found here:
http://www.mediafire.com/?cc1vbsnwnho31vb

But you will need to compile the src again. Since the modules were
compiled against PR1.2.

Tobias

Am Freitag, den 03.09.2010, 13:44 +0200 schrieb Tobias Karnat:
> Hi,
>
> Some might already know that Nokia has recently released a driver for
> AES and SHA1+MD5 hardware acceleration on the linux-crypto mailing list,
> however these drivers where based against 2.6.35 and needed the kernel
> to be rebuild in order to use them, because the platform device driver
> was to be build in the kernel.
>
> I have modified the driver in order to compile with the stock Nokia
> kernel on the N900 and without requiring the kernel to be changed, they
> do load...
>
> However the omap-aes driver has problems if used in 256-Bit Cbc-Essiv
> mode and if used in 128-Bit mode it causes the N900 to not wake up from
> powersaving. The omap-sha1-md5 driver seems to be so far fine, but the
> digest size in /proc/crypto looks somehow suspicious.
>
> It would be very helpful, if someone could bug test the drivers as well,
> since I don't have much experience with kernel modules. You will need to
> update NOLO, since the M-Shield the N900 has, needs to be configured
> differently, please make sure your N900 has hardware revision 2101 at
> least.
>
> I attached the NOLO update and the hw crypto modules, the source and the
> patches are also included. Cryptsetup can be found in extra-devel, the
> required dm-crypt and hash modules are also attached.
>
> Tobias
>
> Edit:
> Since the files are to big for the mailing list, you can find them here:
> http://www.mediafire.com/?cc1vbsnwnho31vb

  •  Reply

Re: N900 AES and SHA1/MD5 hw acceleration drivers

Eric Wheeler
Karma: 21
2011-03-28 05:46 UTC
> Good news!!
>
> The omap-aes driver has been fixed, it does now work without crashing.

Hey guys, I have omap-aes compiled for my kernel and appears to be working.

I do not understand why non-accelerated software-crypto is faster than the omap-aes hardware acceleration:

mmcblk0 onboard 32GB: read=21.76MB/s write=12.97MB/s
aes_generic crypto: read= 8.47 write= 5.54
omap-aes hw crypto: read= 6.31 write= 5.45

mmcblk1 uSD 16GB Class 10: read=16.05MB/s write=16.47MB/s
aes_generic crypto: read= 7.96 write= 7.43
omap-aes hw crypto: read= 6.67 write= 7.18

I have run these numbers over-and-over; each time I see omap-aes with slightly slower throughput than software-crypto on the n900.

Any idea what might be going on here?

These numbers are throughput tests using dd:
dd if=/dev/mapper/crypto of=/dev/null bs=1M count=256
dd if=/dev/zero of=/dev/mapper/crypto bs=1M count=256

-Eric
  •  Reply