Hi Rashmi,
Hello All,
Thank you for the link. I followed it. The only difference is when I replace the original openssl.cnf with the one of the af_alg as mentioned in the link above, I get the error that Rashmi had:
Error configuring OpenSSL
716629200:error:260BC066:engine routines:INT_ENGINE_CONFIGURE:engine configuration error:eng_cnf.c:204:
716629200:error:0E07606D:configuration file routines:MODULE_RUN:module initialization error:conf_mod.c:235:module=engines, value=openssl_engines, retcode=-1
But when I retained the original openssl.cnf but already changed the kernel config with all the flags mentioned and after copying the libaf_alg.so in the correct openssl engine directory, I see that the engine af_alg gets set. I did a quick speed test but surprisingly saw that the speed was the same as before(without af_alg). So now I am puzzled whether my CAAM is being used at all by the af_alg :smileysad:
Anyone can throw some light? How can I check if my CAAM is being called by the af_alg? I had set "caam" in my bootargs. I also see it if I type /proc/crypto:
| name | : sha1 |
| driver | : sha1-caam |
| module | : kernel |
| priority | : 3000 |
| refcnt | : 1 |
| selftest | : passed |
| type | : ahash |
| async | : yes |
| blocksize | : 64 |
digestsize : 20
| name | : ecb(aes) |
| driver | : ecb-aes-caam |
| module | : kernel |
| priority | : 3000 |
| refcnt | : 1 |
| selftest | : passed |
| type | : ablkcipher |
| async | : yes |
| blocksize | : 16 |
min keysize : 16
max keysize : 32
| ivsize | : 16 |
| geniv | : eseqiv |
| name | : cbc(aes) |
| driver | : cbc-aes-caam |
| module | : kernel |
| priority | : 3000 |
| refcnt | : 1 |
| selftest | : passed |
| type | : ablkcipher |
| async | : yes |
| blocksize | : 16 |
min keysize : 16
max keysize : 32
| ivsize | : 16 |
| geniv | : eseqiv |
Speed test:
openssl speed -evp aes-128-cbc
Doing aes-128-cbc for 3s on 16 size blocks: 3004381 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 64 size blocks: 849813 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 256 size blocks: 220358 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 1024 size blocks: 55605 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 8192 size blocks: 6969 aes-128-cbc's in 3.00s
OpenSSL 1.0.0e 6 Sep 2011
built on: Tue Feb 19 00:08:00 UTC 2013
options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) blowfish(ptr)
compiler: cc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
aes-128-cbc 16023.37k 18129.34k 18803.88k 18979.84k 19030.02k
With af_alg:
openssl speed -evp aes-128-cbc -e
engine "af_alg" set.
Doing aes-128-cbc for 3s on 16 size blocks: 2998763 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 64 size blocks: 849813 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 256 size blocks: 220357 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 1024 size blocks: 55605 aes-128-cbc's in 3.00s
Doing aes-128-cbc for 3s on 8192 size blocks: 6970 aes-128-cbc's in 3.00s
OpenSSL 1.0.0e 6 Sep 2011
built on: Tue Feb 19 00:08:00 UTC 2013
options:bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) aes(partial) blowfish(ptr)
compiler: cc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -O2 -Wa,--noexecstack -g -Wall
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
aes-128-cbc 15993.40k 18129.34k 18803.80k 18979.84k 19032.75k
Thanks in advance.
Tera