Twitter 上看到這篇,講 Intel 推出新的指令集,對 AES 的加速效果:
#ePrint Making AES great again: the forthcoming vectorized AES instruction: N Drucker, S Gueron https://t.co/kM0u6XHv3e
— IACR (@IACR_News) May 1, 2018
進去看以後發現是講四月推出的 Ice Lake,在上面新增的 VPCLMULQDQ
指令對效能的幫助:
The introduction of the processor instructions AES-NI and VPCLMULQDQ, that are designed for speeding up encryption, and their continual performance improvements through processor generations, has significantly reduced the costs of encryption overheads.
而他們發表出來的數據說 AES-GCM 的效率直接從 ~23 cycles/byte 降到 0.64 cycles/byte,大約是 35 倍的改進?
More and more applications and platforms encrypt all of their data and traffic. As an example, we note the world wide proliferation of the use of AES-GCM, with performance dropping down to 0.64 cycles per byte (from ~23 before the instructions), on the latest Intel processors.
就算不是 AES-GCM,而是其他的 AES 相關演算法,也是三倍以上的改善:

這效能差異...
~23 cycles / byte 降到 0.64 cycles / byte 這指的是 pre-AES-NI 到目前有 AES-NI 跟 PCLMULQDQ,以及大概到 2015 年之間處理器設計的進化,綜合達成的效益。這部分應該沒什麼好意外的吧? 光是指令集就差很多了。
然後 AES-NI 跟 PCLMULQDQ 這兩個指令系列都是對 128bit value register 動作, VAES 跟 VPCLMULQDQ 就是把他丟到 AVX-512 的暫存器,一次對四筆資料作處理,理論值當然是 4x 的速度。但是不是所有指令都有向量化,加上可能其他像是 pipeline, cache, 運算元數量等等,實務上不會到 4x。
另外他們是用模擬器做的實驗,應該還有一些其他限制,我猜處理器真得出來之後,實際應用上的數據也不會這麼漂亮。