1 README - ocf-linux-20100325
2 ---------------------------
4 This README provides instructions for getting ocf-linux compiled and
5 operating in a generic linux environment. For other information you
6 might like to visit the home page for this project:
8 http://ocf-linux.sourceforge.net/
13 Not much in this file for now, just some notes. I usually build
14 the ocf support as modules but it can be built into the kernel as
17 * mknod /dev/crypto c 10 70
19 * to add OCF to your kernel source, you have two options. Apply
20 the kernel specific patch:
22 cd linux-2.4*; gunzip < ocf-linux-24-XXXXXXXX.patch.gz | patch -p1
23 cd linux-2.6*; gunzip < ocf-linux-26-XXXXXXXX.patch.gz | patch -p1
25 if you do one of the above, then you can proceed to the next step,
26 or you can do the above process by hand with using the patches against
27 linux-2.4.35 and 2.6.33 to include the ocf code under crypto/ocf.
30 for 2.4.35 (and later)
32 cd linux-2.4.35/crypto
33 tar xvzf ocf-linux.tar.gz
35 patch -p1 < crypto/ocf/patches/linux-2.4.35-ocf.patch
37 for 2.6.23 (and later), find the kernel patch specific (or nearest)
38 to your kernel versions and then:
40 cd linux-2.6.NN/crypto
41 tar xvzf ocf-linux.tar.gz
43 patch -p1 < crypto/ocf/patches/linux-2.6.NN-ocf.patch
45 It should be easy to take this patch and apply it to other more
46 recent versions of the kernels. The same patches should also work
47 relatively easily on kernels as old as 2.6.11 and 2.4.18.
49 * under 2.4 if you are on a non-x86 platform, you may need to:
51 cp linux-2.X.x/include/asm-i386/kmap_types.h linux-2.X.x/include/asm-YYY
53 so that you can build the kernel crypto support needed for the cryptosoft
56 * For simplicity you should enable all the crypto support in your kernel
57 except for the test driver. Likewise for the OCF options. Do not
58 enable OCF crypto drivers for HW that you do not have (for example
59 ixp4xx will not compile on non-Xscale systems).
61 * make sure that cryptodev.h (from ocf-linux.tar.gz) is installed as
62 crypto/cryptodev.h in an include directory that is used for building
63 applications for your platform. For example on a host system that
66 /usr/include/crypto/cryptodev.h
68 * patch your openssl-0.9.8n code with the openssl-0.9.8n.patch.
69 (NOTE: there is no longer a need to patch ssh). The patch is against:
72 If you need a patch for an older version of openssl, you should look
73 to older OCF releases. This patch is unlikely to work on older
77 - enables --with-cryptodev for non BSD systems
78 - adds -cpu option to openssl speed for calculating CPU load
80 - fixes null pointer in openssl speed multi thread output.
81 - fixes test keys to work with linux crypto's more stringent
83 - adds MD5/SHA acceleration (Ronen Shitrit), only enabled
84 with the --with-cryptodev-digests option
85 - fixes bug in engine code caching.
87 * build crypto-tools-XXXXXXXX.tar.gz if you want to try some of the BSD
88 tools for testing OCF (ie., cryptotest).
90 How to load the OCF drivers
91 ---------------------------
93 First insert the base modules:
98 You can then install the software OCF driver with:
102 and one or more of the OCF HW drivers with:
109 all the drivers take a debug option to enable verbose debug so that
110 you can see what is going on. For debug you load them as:
112 insmod ocf crypto_debug=1
113 insmod cryptodev cryptodev_debug=1
114 insmod cryptosoft swcr_debug=1
116 You may load more than one OCF crypto driver but then there is no guarantee
117 as to which will be used.
119 You can also enable debug at run time on 2.6 systems with the following:
121 echo 1 > /sys/module/ocf/parameters/crypto_debug
122 echo 1 > /sys/module/cryptodev/parameters/cryptodev_debug
123 echo 1 > /sys/module/cryptosoft/parameters/swcr_debug
124 echo 1 > /sys/module/hifn7751/parameters/hifn_debug
125 echo 1 > /sys/module/safe/parameters/safe_debug
126 echo 1 > /sys/module/ixp4xx/parameters/ixp_debug
129 Testing the OCF support
130 -----------------------
132 run "cryptotest", it should do a short test for a couple of
133 des packets. If it does everything is working.
135 If this works, then ssh will use the driver when invoked as:
137 ssh -c 3des username@host
139 to see for sure that it is operating, enable debug as defined above.
141 To get a better idea of performance run:
145 There are more options to cryptotest, see the help.
147 It is also possible to use openssl to test the speed of the crypto
150 openssl speed -evp des -engine cryptodev -elapsed
151 openssl speed -evp des3 -engine cryptodev -elapsed
152 openssl speed -evp aes128 -engine cryptodev -elapsed
154 and multiple threads (10) with:
156 openssl speed -evp des -engine cryptodev -elapsed -multi 10
157 openssl speed -evp des3 -engine cryptodev -elapsed -multi 10
158 openssl speed -evp aes128 -engine cryptodev -elapsed -multi 10
160 for public key testing you can try:
163 openssl speed -engine cryptodev rsa -elapsed
164 openssl speed -engine cryptodev dsa -elapsed
167 david_mccullough@mcafee.com