Dear @ashwini2024 ,
I apologize for the delayed response.
I understand that you are aiming to integrate OpenSSL with the crypto driver to perform hashing. The good news is that bsp41 already supports this functionality, so manual integration is not necessary. However, prebuilt images do not come with HSE firmware.
To compile an image with HSE support using yocto, refer to the "S32G2/3_LinuxBSP_41.0_User_Manual.pdf". For G2, follow these steps:
- Open the terminal.
- Navigate to
~/BSP41/fsl-auto-yocto-bsp/build_s32g274ardb2 by typing:
cd ~/BSP41/fsl-auto-yocto-bsp/build_s32g274ardb2
- Edit the
conf/local.conf file by typing:
- Add
DISTRO_FEATURES:append = "hse" and set NXP_FIRMWARE_LOCAL_DIR = "/path/to/firmware/folder".
- Place the entire
HSE_FW_S32G2XX_0_2_51_0 in the specified folder.
- Compile to generate a *.sdcard. The boot-up print is as shown below.

Regarding how to use HSE to analyze sample data for HASH computation, you can use the OpenSSL PKCS11 engine to access the HSE based on NXP Linux BSP software. Here is a demo example:
- Modify the OpenSSL configuration file for the PKCS11 engine.
- Back up the
/etc/ssl/openssl.cnf file by typing:
cp /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf.default
- Edit the file by typing:
- In the
[openssl_init] section, append the line engines = engine_section.
- At the end of the file, add the following lines:
[engine_section]
pkcs11 = pkcs11_section
[pkcs11_section]
engine_id = pkcs11
dynamic_path = /usr/lib/engines-3/pkcs11.so
MODULE_PATH = /usr/lib/libpkcs-hse.so.1
init=0
- Test the PKCS11 engine. If everything is set up correctly, you should observe a similar log as provided.

- To use a hash algorithm:
- Generate a plain text file for testing by typing:
cd ~/workspace
echo "1111" > plain.txt
- Calculate the hash value by typing and You can see the following log::
openssl dgst -engine pkcs11 -keyform engine -sha512 plain.txt

This is only an example of S32GRDB2 + HSE + SHA512. If you want to know more about accessing the HSE via the PKCS11, refer to AN14072. Note that it is based on bsp38.
If this post answers your question, please click the "Mark Correct" button. Thank you!
Best regards,
Celeste