trojan-gfw / igniter

A trojan client for Android (UNDER CONSTRUCTION).
GNU General Public License v3.0
3.3k stars 736 forks source link

Igniter没有调用ARM AES指令集? #229

Closed okudayukiko closed 4 years ago

okudayukiko commented 4 years ago

没有调用AES指令集会导致在手机上执行AES加解密速度缓慢和很耗电,以及不稳定。

okudayukiko commented 4 years ago

在我的三星手机(Exynos处理器)执行cat /proc/cpuinfo显示 Features: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid 没有neon指令集。 执行AES计算很耗电且速度慢。

Chigusa0w0 commented 4 years ago

AES is not a must-have instruction set on mobile platforms. Enabling AES instrin requires special routine to check support and two versions of code to support either situation. Contribution is welcomed.

wongsyrone commented 4 years ago

OpenSSL should already handle it. If you have any questions, please check the OpenSSL source code.

okudayukiko commented 4 years ago

AES is not a must-have instruction set on mobile platforms. Enabling AES instrin requires special routine to check support and two versions of code to support either situation. Contribution is welcomed.

通過cat /proc/cpuinfo決定CPU是否支援AES指令集,然後執行不同的代碼。或者提供一個開關,打開這個開關就優先使用ChaCha20演算法。比如Chrome for Android,如果CPU支援AES,就優先使用AES-128-GCM;如果CPU不支援AES,就優先使用CHACHA20-POLY1305。AES計算確實需要AES指令集的輔助,尤其是AES-GCM。