openvpn/openssl compiled with AES-NI assembler code?

Got a problem with Viscosity or need help? Ask here!

Andy22

Posts: 3
Joined: Wed Jan 27, 2016 12:17 am

Post by Andy22 » Mon Jul 12, 2021 7:43 am
Just wondering is the openvpn/openssl lib that ships with Viscosity compiled with all the AES-Ni/asm defines? So openvpn can utilize AES-Ni acceleration automatically via the EVP interface if available?

There is no openssl.exe so i cant check the compile defines. Just wondering since on my J3455 i get 420MB vs 90MB using EVP.

As a example it should look like this:
Code: Select all
.\openssl speed -evp aes-256-cbc
Code: Select all
OpenSSL 1.1.1k  25 Mar 2021
built on: Thu Mar 25 21:38:18 2021 UTC
options:bn(64,64) rc4(16x,int) des(long) aes(partial) idea(int) blowfish(ptr)
compiler: cl /Zi /Fdossl_static.pdb /Gs0 /GF /Gy /MT /W3 /wd4090 /nologo /O2 -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2
m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
aes-256-cbc     205544.60k   312846.92k   392351.72k   418774.70k   426191.81k   426786.73k
While without the extra defines it would look like this:
Code: Select all
.\openssl speed -evp aes-256-cbc
Code: Select all
OpenSSL 1.1.1k  25 Mar 2021
built on: Sat Apr 17 19:41:56 2021 UTC
options:bn(64,64) rc4(int) des(long) aes(partial) idea(int) blowfish(ptr)
compiler: cl /Zi /Fdossl_static.pdb /Gs0 /GF /Gy /MD /W3 /wd4090 /nologo /O2 -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_NO_DEPRECATED
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
aes-256-cbc      65858.48k    82508.98k    88073.25k    89426.08k    90354.11k    89840.69k

Eric

User avatar
Posts: 1146
Joined: Sun Jan 03, 2010 3:27 am

Post by Eric » Mon Jul 12, 2021 12:41 pm
Hi Andy,

OpenSSL is built with hardware acceleration enabled. While we don't ship an openssl.exe file, you can grab a copy of the libraries from the Viscosity install, put them next to an openssl.exe you have built yourself, and it will use those libraries if you'd like to validate this yourself.
Code: Select all
.\openssl.exe speed -evp aes-256-cbc
...
OpenSSL 1.1.1k  25 Mar 2021
built on: Fri Mar 26 01:09:18 2021 UTC
options:bn(64,64) rc4(8x,int) des(long) aes(partial) idea(int) blowfish(ptr)
compiler: cl /Zi /Fdossl_static.pdb /Gs0 /GF /Gy /MD /W3 /wd4090 /nologo /O2 -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -D"ENGINESDIR=\"C:\\\\Windows\\\\System32\\\\Viscosity\\\\engines\""
 
Regards,
Eric
Eric Thorpe
Viscosity Developer

Web: http://www.sparklabs.com
Support: http://www.sparklabs.com/support
Twitter: http://twitter.com/sparklabs

Andy22

Posts: 3
Joined: Wed Jan 27, 2016 12:17 am

Post by Andy22 » Tue Jul 13, 2021 8:48 am
Ah ok thanks thats good to know and yes i tried this but had some issues using my local openssl.exe, i guess it depends what compiler/env you used to build the libs (VC version, MinGW, gcc vs ICC ...).
3 posts Page 1 of 1