ARM Crypto Support

== Introduction ==

This is the second of three articles written as a how-to guide for enabling hardware accelerated cryptographic functions for OpenSSL version 1.0.0a. In the first article, the OCF-Linux module is created and test with the cryptotest application which comes with OCF-Linux This article describes how to build the Linux module that will access the cryptographic hardware accelerators. The module is loaded in Linux with the "insmod" or "modprobe" command. The module is available to OpenSSL through the Open Cryptograhic Framework (OCF). The third article describes how to build and use OpenSSL version 1.0.0a with OCF support.

== Assumptions ==

The module has been built successfully on a Ubuntu 10.04 Linux development system with CodeSourcery? cross-compiler tools.

== Build the Module==

*Copy omap3_crypto.tar.gz to the host development system and extract it in place. The tarball will create its own sub-directory "'''omap3_crypto'''".

*Edit the Makefile contained in the tarball. Modify the LINUXKERNEL_INSTALL_DIR parameter. The value for this parameter should be the path to the target kernel source code. In this case, the kernel source is from PSP 3.0.1.6.

*Run '''make'''. This will create the module ocf_omap3_cryptok.ko.
The module must now be copied into the root filesystem that will be mounted when the target board boots up. If development is done in a sub-directory of the NFS mount point then the module will automatically show up in the target filesystem. For the examples here the module was developed in the /home/root/omap3_crypto sub-directory of the NFS mount. So when the board boots up the module is located as shown below:

== Test the Module ==

The module is tested using the same cryptotest applications from the first article. The difference is that the ocf_omap3_cryptok.ko module is loaded with cryptodev.ko instead of cryptosoft.ko. The example run below shows that the number of cryptographic functions has changed. There is now support for DES, 3DES, AES128/192/256, MD5, SHA1, and SHA256. The speed performance is seen mostly for the larger data block sizes. The most dramatic improvement is seen in the CPU usage. For this entire test, the CPU usage has dropped from 99% in the pure software case to about 9% in the hardware accelerated case.