AES and SHA new instructions in PuTTY
This project is maintained by pavelkryukov
Demonstration suites for encryption using Intel AES instruction set and ARM Cryptography Extension in PuTTY SSH client and derived tools.
Details:
599bab8
Condition out AES-NI support if using a too-old clanga27f55e
Use correct way to detect new instructions in Clangd6338c2
Fix mishandling of IV in AES-NI CBC decryption7babe66
Make lots of generic data parameters into ‘void *‘.f4ca28a
Add a missing const91a624f
sshaes.c: add some missing clang target attributes3347bd8
Fix AES-NI SDCTR to pass the new tests.dfdb73e
Complete rewrite of the AES code.ced0f19
Ensure our aes_ni_context is 16-byte aligned.fca13a1
Break up crypto modules containing HW acceleration.Details:
Details:
Code Coverage Chart!
Get sure that your CPU supports AES-NI by running make aescpuid && ./aescpuid
.
You may use Intel Product Specification Advanced Search to check if your CPU supports AES-NI and SHA-NI.
To observe boost of AES-NI algorithm, one may create standalone AES-256 encryptor and decryptor tools using PuTTY source code. After cloning repository and PuTTY submodule, binaries are buildable with CMake:
Type | SW AES | AES NI |
---|---|---|
Encrypt | aes-demo-sw-encode | aes-demo-hw-encode |
Decrypt | aes-demo-sw-decode | aes-demo-hw-decode |
Syntax is the same as ‘cp’ command. Please note that file size must be a multiple of 16 bytes.
<sshdemo> src dst
To run performance test, use make perf-geomean-aes.txt
. The output is geometric mean of speedups per encryption/decryption of different data sets with memory range from 16 bytes to 16 Mbytes.
Raw performance data is stored to perf-original.txt and perf-output.txt, the first one is for standard version, second is for AES-NI version. Format of output files is following: code keylen blocklen time
, where code 0 is encryption, code 1 is decryption, and code 2 is for encryption in sdctr mode.
Since 2019, all cryptography functional tests are included to the PuTTY repository. To run the tests in Bash, simply execute following commands in a configured PuTTY workspace:
make testcrypt
export PUTTY_TESTCRYPT=/path/to/the/testcrypt
./test/cryptsuite.py
The same works for Windows environment if you use appropriate CMD or PowerShell commands.