Hi,
i read the source of the latest openssl patch and found out, that there's a conversion bug from u_int to size_t.
Taking a closer look, reveals, that there's a one or probably more bugs in the (demo) patches.
BUG 1:
AES-CBC-128 when using a standard program which is linked to libcrypto.
when using openssl speed the aes-cbc key and blocklen ist 16
Using a linked standard software the iv-len gets 32 bytes.
Speed do.cipher:
Cipher 419 means AES_128_CBC which has a fixed key and blocklen of 16 bytes.
[qat_do_cipher_synch] --- do_cipher 0x7ffdf16e4f20 BEGIN, inl 16
qat_do_cipher_synch: Input
bb 4d 30 07 97 5c c6 03 - 47 5d 4f 1f ae e5 0f b7 (16 bytes !!!)
[qat_do_cipher_synch] --- cipher type: 419
qat_do_cipher_synch iv len is 16
qat_do_cipher_synch: ctx->iv
bb 4d 30 07 97 5c c6 03 - 47 5d 4f 1f ae e5 0f b7
[qat_do_cipher_synch] performing with 16 bytes (iv-len=16)
e_qat.qat_crypto_callbackFn: status 0 verifyResult 1
[qat_do_cipher_synch] --- do_cipher END
Buggy call when using standard software:
This software, like openssl uses u_int as block and key len. So, IMHO, the conversion from u_int to size_t is simply WRONG.
The buggy qat engine call when using a STANDARD Software linked to openssl:
[qat_do_cipher_synch] --- do_cipher 0x7f3260d28a20 BEGIN, inl 32 (WRONG, inl is 16 bytes on *ctx !!!)
qat_do_cipher_synch: Input
00 00 00 1c 0a 05 00 00 - 00 0c 73 73 68 2d 75 73 WRONG( should be 16 bytes !!!)
65 72 61 75 74 68 2c d5 - e5 35 7f 9a 25 ba 3e ec
[qat_do_cipher_synch] --- cipher type: 419 (AES-128-CBC)
qat_do_cipher_synch iv len is 16
qat_do_cipher_synch: ctx->iv
00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 (Wrong allocation, NULL)
[qat_do_cipher_synch] performing with 32 bytes (iv-len=16) (Wrong, inl must be 16 not 32 bytes)
e_qat.qat_crypto_callbackFn: status 0 verifyResult 1
[qat_do_cipher_synch] --- do_cipher END
Questions
1.) Is there a working version of the openssl patch with no demo prefix ?
2.) Does this mean, that the QAT engine is simply not working, or am i able to download a complete working software to evaluate and test ?
Right now, i try a workaround with AES-128-CBC (if AES-128-CBC then inl = 16), but i think that the bug can only be solved by rewriting the whole openssl-async code to get portable code (u_int etc.)
Rgds.
Franz