[PATCH] Add AES-ECB modes to eng_cryptodev.c

2013-11-01 Thread Joshua Datko
Attached is a patch to added AES-ECB modes (128, 192, 256) to
eng_cryptodev.c (and some whitespace cleanup).  I also have a backported
1.0.1e if you guys want that as well.  The attached patch is from git
master.

I started adding other modes (CTR), but the tests were failing, so I
decided to submit what I believe to be working.

Thanks,

Josh


eng_cryptodev.patch
Description: Binary data


Enhancing eng_cryptodev.c

2013-10-30 Thread Joshua Datko
The cryptodev engine is working great for me, but eng_cryptodev.c does not
make available many of the ciphers that the cryptodev module
(linux-cryptodev) uses.

Mainly, I'd like to add AES in ECB, CTR, and GCM modes.  I'm attaching a
patch, for review purposes only, just to see if I'm on the right track
and/or missing something.  I'll submit a proper patch once I've added the
rest of the ciphers.

However, initial testing seems like everything is in order.  I've pasted
output of AES-128-ECB with this patch running on BeagleBone Black (TI
AM335x using linux-cryptodev).

Does anybody see any issues with my approach?

Josh

debian@arm:~/debian-packages$ time openssl speed -evp aes-128-ecb -engine
cryptodev
engine cryptodev set.
Doing aes-128-ecb for 3s on 16 size blocks: 10749 aes-128-ecb's in 0.01s
Doing aes-128-ecb for 3s on 64 size blocks: 21660 aes-128-ecb's in 0.02s
Doing aes-128-ecb for 3s on 256 size blocks: 8 aes-128-ecb's in 0.01s
Doing aes-128-ecb for 3s on 1024 size blocks: 8 aes-128-ecb's in 0.00s
Doing aes-128-ecb for 3s on 8192 size blocks: 8 aes-128-ecb's in 0.01s
OpenSSL 1.0.1e 11 Feb 2013
built on: Mon Oct 28 00:28:43 UTC 2013
options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial)
idea(int) blowfish(ptr)
compiler: gcc -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT
-DDSO_DLFCN -DHAVE_DLFCN_H -DHAVE_CRYPTODEV -DUSE_CRYPTDEV_DIGESTS
-march=armv7-a -Wa,--noexecstack -DTERMIO -O3 -Wall -DOPENSSL_BN_ASM_MONT
-DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM
-DGHASH_ASM
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes256 bytes   1024 bytes   8192
bytes
aes-128-ecb  17198.40k69312.00k  204.80k infk
6553.60k

real 0m15.698s
user 0m0.057s
sys 0m2.746s


cryptodev.patch
Description: Binary data