Tongsuo-Project / Tongsuo

铜锁/Tongsuo is a Modern Cryptographic Primitives and Protocols Library
https://www.tongsuo.net
Apache License 2.0
1.16k stars 186 forks source link

arm架构开启neon指令集加速aes算法似乎不生效 #654

Closed linju123455 closed 2 months ago

linju123455 commented 2 months ago

使用openssl speed测试aes-128-ctr: image 这是开启-march=armv8-a+simd的效果 image 这是不开启-march=armv8-a+simd的效果 可从compiler中看出确实是减少了-march=armv8-a+simd的选项,但是速率还是差不多的 image 由此可以见得,cpu是支持aes算法加速的 这是我开启硬件加速选项时的编译命令:./config --prefix=/home/linju/linju_workspace/third_party/Tongsuo-8.3.3-711C/install enable-ntls no-shared no-asm enable-sm4 -march=armv8-a+simd CC=/home/linju/host/bin/aarch64-buildroot-linux-gnu-gcc CXX=/home/linju/host/bin/aarch64-buildroot-linux-gnu-g++,Tongsuo版本是8.3.3

zzl360 commented 2 months ago

去掉no-asm 这个编译参数再看看

linju123455 commented 2 months ago

去掉no-asm 这个编译参数再看看

去掉这个选项就会收到类似于下图的报错,说是引用了x86_64架构的汇编代码 image

我是在x86架构下交叉编译armV8的程序,很奇怪为什么会把当前识别为x86架构

zzl360 commented 2 months ago

configure的时候加上./Configure linux-aarch64

linju123455 commented 2 months ago

configure的时候加上./Configure linux-aarch64

感谢老哥指导,已解决