embhorn wrote:

Hi abdulwazeed1,

We do not currently support any optimizations for ARMv7. Would you like to open a feature request? Please send an email to support@wolfssl.com

Thanks,
Eric @ wolfSSL Support



Hi,
Thank you for responding, does that mean its not possible to get hardware level acceleration in armv7 devices for aes cbc decryption using wolfcrypt.

Also can you suggest any tips, best practices or parallelization techniques to improve decryption performance with the current wolfcrypt release (5.2.0). is there any way I can improve performance, at software level.

Currently my application is showing 25-30% cpu usage without decryption and with decryption it shows 60-70% cpu usage, is this normal?

Hello,

I am working with aes cbc decryption on armv7 device and I want high performance decryption. I am currently using a particular configuration which is working on armv7 devices but I want best decryption performance possible using wolfcrypt on armv7 devices. What build configurations to be used while building wolfcrypt.

Currently I am using android ndk tool chain for building my wolfcrypt library.

  export NDK=/home/android-ndk-r23b
  export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64
  export TARGET=armv7a-linux-androideabi
  export API=31
  export AR=$TOOLCHAIN/bin/llvm-ar
  export CC=$TOOLCHAIN/bin/$TARGET$API-clang
  export AS=$CC
  export CXX=$TOOLCHAIN/bin/$TARGET$API-clang++
  export LD=$TOOLCHAIN/bin/ld
  export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
  export STRIP=$TOOLCHAIN/bin/llvm-strip

./configure --host $TARGET \
                --enable-keygen \
                --disable-crypttests --enable-fast-rsa \
                --disable-aesgcm --disable-dh --disable-des3 \
                --enable-cryptonly \
                --disable-examples --enable-debug

3

(3 replies, posted in wolfCrypt)

kareem_wolfssl wrote:

Hi abdulwazeed1,

What version of wolfSSL are you using?  If you are not using the latest stable (5.2.0), please upgrade and let me know if it helps.
Are wc_AesCbcEncrypt and/or wc_AesCbcDecrypt returning an error code for the invalid packets?  If so, what error code are you seeing?
If neither of the above help, please enable debug logging by building with DEBUG_WOLFSSL or --enable-debug, and running wolfSSL_Debugging_ON().  Then attach your debug logs here.  Please also share your build settings.
Lastly, please clarify whether you are using a multi-threaded application on either side.  Note that for multi-threading we require separate Aes objects for each thread.

Thanks,
Kareem

Hello kareem,
->  I am using version 5.1.1
-> wc_AesCbcDecrypt returns 0 for the invalid packets
-> I will try building with debug mode on, and let you know
-> I have used the following configuration,
    --enable-keygen --disable-crypttests --enable-fast-rsa --disable-aesgcm --disable-dh --disable-des3
    --enable-cryptonly --enable-keygen --disable-examples
-> Yes my android app is a multithreaded application. but i am working with a specific thread which does the task of pushing a packet into a queue. so before i push into the queue, I am calling my decryption function which runs the following

Aes aes_decrypt;
and
wc_AesSetKey()
wc_AesCbcDecrypt()
both of these functions have return value 0

Updates:--------------------------
->  I have build wolfcrypt library using version 5.2.0
-> I have enabled --enable-debug, but as i am not getting error return value after calling wc_AesCbcDecrypt, I dont know how to log.
-> I have tried a hack which is whenever i am getting invalid packet after decryption, i am running again the decryption function call on the same encrypted packet and in second time I am getting a correct decryption output, But this is not expected behavior and we want correct decryption output at the first time. Any idea why this is happening?

4

(3 replies, posted in wolfCrypt)

Hello,

I am using wolfcrypt aes cbc function. My usecase is I am sending 1316 bytes of mpeg-2 ts data encrypted using wc_AesCbcEncrypt() function, from udp server in linux and I am receiving the 1316 bytes in an android based receiver and decrypting it using wc_AesCbcDecrypt().

My receiver is an android app which uses c++ for receiving and decrypting data, so I have built wolfcrypt library using ndk-tool chain for arm7 devices.

My key size is 16 bytes.

My issue is some of the packets after decryption are not same as the packet sent by the sender before encryption.
I am sending 1000 packets out of which 10-20 packets are not decrypted properly.

I have tested wc_AesCbcDecrypt() function at the sender side itself and in that case decryption seems to be working properly. but issue is happening at android side.

How can I make sure all packets are decrypted properly at the android receiver side.

Please let me know if you need any more information.