Application Cases
- Install the KAE by referring to Installing the KAE Software.
- View the KAE library.
1ll /usr/local/lib/engines-1.1
- Configure OpenSSL to call the KAE library (that is, configure OpenSSL environment variables).
- Check the OpenSSL installation path (OPENSSLDIR).
openssl version -a
- Create an OpenSSL configuration file.
vim /home/openssl.cnf
- Press i to enter the insert mode and write the KAE content to the OpenSSL configuration file.
openssl_conf=openssl_def [openssl_def] engines=engine_section [engine_section] kae=kae_section [kae_section] engine_id=kae dynamic_path=/usr/local/lib/engines-1.1/kae.so default_algorithms=ALL init=1
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Check the OpenSSL configuration file.
cat /home/openssl.cnf
- Open profile.
vi /etc/profile
- Add the following content. Save the file and exit.
export OPENSSL_CONF=/home/openssl.cnf
- Make the environment variables take effect. If the system is restarted, you need to run the command again.
source /etc/profile
- Check the environment variables.
echo $OPENSSL_CONF
Restore the default library called by OpenSSL.
- Open profile.
vi /etc/profile
- Delete the following content. Save the file and exit.
export OPENSSL_CONF=/home/openssl.cnf
- Make the environment variables take effect.
source /etc/profile
unset OPENSSL_CONF
- Check the environment variables.
echo $OPENSSL_CONF
- Open profile.
- Check the OpenSSL installation path (OPENSSLDIR).
- Check that the KAE library has taken effect.
Method 1: Test the RSA2048 algorithm performance.
During the performance test of the RSA2048 algorithm, check the value of the KAE resource queue (256 by default). If the value decreases, the KAE library has taken effect.
There are two methods to test the RSA2048 algorithm performance: synchronous performance test and asynchronous performance test. Because OpenSSL environment variables have been configured, the KAE library can be called even though you do not specify the KAE in the performance test command.
- Test the synchronization performance.
openssl speed -elapsed rsa2048
- Test the asynchronous performance.
openssl speed -elapsed -async_jobs 36 rsa2048
- Check the KAE resource queue value (256 by default). If the value decreases, the KAE library has taken effect.
cat /sys/class/uacce/hisi_hpre-*/attrs/available_instances Or watch -d cat /sys/class/uacce/hisi_hpre-*/attrs/available_instances
Method 2: Test the HTTPS short connection performance.
During the HTTPS short connection performance test, check the value of the KAE resource queue (256 by default). If the value decreases, the KAE library has taken effect.
There are two methods to test the HTTPS short connection performance: synchronous performance test and asynchronous performance test.
- Test the synchronization performance.
Disable the asynchronous mode for Tengine and test the HTTPS short connection performance (use the httpress tool to test Tengine).
- Test the asynchronous performance.
Enable the asynchronous mode for Tengine and test the HTTPS short connection performance (use the httpress tool to test Tengine).
- Check the KAE resource queue value (256 by default). If the value decreases, the KAE library has taken effect.
cat /sys/class/uacce/hisi_hpre-*/attrs/available_instances Or watch -d cat /sys/class/uacce/hisi_hpre-*/attrs/available_instances
- Test the synchronization performance.

