Skip to main content
Visitor II
March 25, 2020
Question

Cryptodev/af_alg engines in OpenSSL on STM32MP157C-DK2 do not provide hash algorithms for hardware acceleration

  • March 25, 2020
  • 14 replies
  • 5178 views

Hello,

I have successfully compiled and deployed the distribution package (trusted) onto the STM32MP1. I am using OpenSSL in a program for signing data, where SHA256 is used as a hash. I would like to take advantage of hardware acceleration by using either the cryptodev or af_alg engines. The distribution provides Yocto recipes for cryptodev-linux (header), cryptodev-module (kernel module) of version 1.9 and for OpenSSL version 1.1.1b, in which I modified the PACKAGECONFIG line by adding cryptodev-linux option in it, so OpenSSL compiles with the cryptodev support. The 3 aforementioned recipes were built and deployed using devtool. OpenSSL also provides a built-in AF_ALG engine by default. However, the supported algorithms of both engines are only ciphers, there are no hash algorithms whatsoever. I also tried to build OpenSSL with the -DUSE_CRYPTODEV_DIGESTS, but that didnt change anything. Version 1.0.2 of OpenSSL however, provides some hashing algorithms like MD5 and SHA1, but not SHA256. I have also posted an issue on OpenSSL github, but maybe there is a problem on STM side. The output of cat /proc/crypto lists

SHA256 among many other hashes, which means it should be supported.

I would appreciate any help regarding this issue.

    This topic has been closed for replies.

    14 replies

    Technical Moderator
    April 20, 2020

    You can see the results are really good. Then Dunfell is for the next delivery planned end of June (V2.0.0).

    My feeling is that the pb is pure openssl recipe in Thud but backporting openssl from Dunfell to thud is probably difficult (many dependencies).

    How do you see that ?

    ParadoxAuthor
    Visitor II
    April 20, 2020

    Hello,

    thanks a lot for all of the effort to everyone involved. If the results are correct, then this is a great performance improvement. If I understood correctly, this will be supported in the next software release sometime in June? If so, I will implement it as soon as it releases.

    Technical Moderator
    April 21, 2020

    Yes STM32MP15 ecosystem release V2.0.0 is planned for end of June. It will be based on first Yocto LTS (Long term support) named Dunfell and kernel 5.4.

    ParadoxAuthor
    Visitor II
    April 22, 2020

    Thanks very much again to you and everyone on the integration team. I will update this thread once I successfully implement this and then close it.