15AH, San Francisco

California, United States.

Send Your Mail At:

tianyingkejishe@sina.cn

Working Hours

Mon-Sat: 9.30am To 7.00pm

【LX2160】加密引擎开启

由于NXP为LX2160增加了硬件加密引擎与openssl接口,我们可以直接编译使用openssl API接口。

1、编译:

$ cd flexbuild
$ source setup.env
Build cryptodev-linux:
$ flex-builder -c cryptodev_linux -a arm64 # automatically setup cross-toolchain and fetch 
cryptodev-linux repository to build
Build OpenSSL:
$ flex-builder -c openssl -a arm64
Merge OpenSSL and cryptodev-linux components into target rootfs:
$ flex-builder -i merge-component -a arm64
Generate bootpartition tarball:
$ flex-builder -i mkbootpartition -a arm64
   flex-builder -i mkbootpartition -a arm64 -m lx2160ardb_rev2 -b sd

2、配置:

cat /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf
修改为:
#include /etc/ld.so.conf.d/*.conf
# libc default configuration
/usr/local/lib
# Multiarch support
/usr/local/lib/aarch64-linux-gnu
/lib/aarch64-linux-gnu
/usr/lib/aarch64-linux-gnu
/usr/lib/aarch64-linux-gnu/libfakeroot

3、加载模块

user@localhost:~$ sudo modprobe cryptodev
[sudo] password for user:

user@localhost:~$ ls /dev/crypto
/dev/crypto

user@localhost:~$ openssl engine
(devcrypto) /dev/crypto engine
(dynamic) Dynamic engine loading support

4、Verify the CAAM offloading

Hardware operations can be monitored with the interrupt counters for CAAM JR and QI (DPAA1 and DPAA2) interfaces.

user@localhost:~$ cat /proc/interrupts | grep jr
78: 20 0 0 0 GICv2 103 Level 1710000.jr
79: 0 0 0 0 GICv2 104 Level 1720000.jr
80: 0 0 0 0 GICv2 105 Level fsl-jr0

user@localhost:~$ openssl enc -aes-256-cfb -k secret -P -md sha1
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
salt=233157F098D1B0E8
key=D2B0C0C088AA7DAA6CF37CC856E283E3B0C3DD2BE155688DE18593EB3F997776
iv =A4E2C86E0DBA1211B5A4B02EBEFF6DC4

user@localhost:~$ cat /proc/interrupts | grep jr
78: 54 0 0 0 GICv2 103 Level 1710000.jr
79: 69 0 0 0 GICv2 104 Level 1720000.jr
80: 0 0 0 0 GICv2 105 Level fsl-jr0

5、DPDK加解密接口测试

anyShare分享到:
本站的文章和资源来自互联网或者站长的原创,按照 CC BY -NC -SA 3.0 CN协议发布和共享,转载或引用本站文章应遵循相同协议。如果有侵犯版权的资源请尽快联系站长,我们会在24h内删除有争议的资源。欢迎大家多多交流,期待共同学习进步。
stormwind