Does SAB support AES-NI?

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
User avatar
88keyz
Newbie
Newbie
Posts: 26
Joined: December 5th, 2012, 11:59 am

Does SAB support AES-NI?

Post by 88keyz »

Does the current version of SABnzbd (v.2.3.1 at the moment) support AES hardware acceleration? If not, why not? This has been supported by almost all x86 and x86-64 based processors for almost a decade and it seems like hardware acceleration for the AES cipher type would be a big win in terms of CPU utilization.
User avatar
sander
Release Testers
Release Testers
Posts: 8847
Joined: January 22nd, 2008, 2:22 pm

Re: Does SAB support AES-NI?

Post by sander »

SABnzbd uses python module "ssl" for encryption stuff, which uses OpenSSL. So I think your question can be refined to "Does OpenSSL support AES-NI?" ... which seems to be true: see https://github.com/openssl/openssl/sear ... %22+&type=
User avatar
88keyz
Newbie
Newbie
Posts: 26
Joined: December 5th, 2012, 11:59 am

Re: Does SAB support AES-NI?

Post by 88keyz »

From what I’ve read it is my understanding that in order to make use of the AES-NI acceleration in OpenSSL the application has to call the EVP API. For some commands this must be explicitly defined or EVP, and hence AES-NI, is not used. And in the case of Python all OpenSSL calls may need to define EVP usage.

From a StackExchange thread: “EVP_* is the official/supported way to ensure AES-NI is used (if available). In fact, EVP is the only way to access hardware acceleration in general.”
User avatar
sander
Release Testers
Release Testers
Posts: 8847
Joined: January 22nd, 2008, 2:22 pm

Re: Does SAB support AES-NI?

Post by sander »

So ... did you check the source code to see how it is used?

More in general: from python code, how can you specify to use AES-NI? I doubt that is possible, and I think it is up to the lower libraries.
User avatar
88keyz
Newbie
Newbie
Posts: 26
Joined: December 5th, 2012, 11:59 am

Re: Does SAB support AES-NI?

Post by 88keyz »

With further reading it appears it is possible via the cryptography module which is already in use in SABnzbd. Main reference I can find in the SAB source code is in rarfile.py. Not sure that has anything to do with the NNTP connection to the provider though. There doesn't seem to be any cryptography code in newswrapper.py which from what I can tell is what is responsible for NNTP.

So guess the question is, if the cryptography module (already in use elsewhere in SABnzbd) isn't already being used for SSL via NNTP is it possible to implement it in order to accelerate SSL NNTP connections? Its use for NNTP could accelerate more than just AES as EVP includes many OpenSSL speed improvements over and above implementing AES-NI. AES acceleration could be the quick win though if adding the cryptography module to SAB's NNTP implementation isn't too demanding.

SAB has made great improvements in speed lately and this could be another one.
User avatar
safihre
Administrator
Administrator
Posts: 5387
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Does SAB support AES-NI?

Post by safihre »

So far I only found modules like that which speed up the decoding and encoding of local data, like files or strings. Non of the python solutions, including cryptography, deal with SSL connections.
Like sander said, we are dependent on the ssl module of python. I would assume they enabled it inside there.
But there is nothing available really on Google. Also the information about possible support for it in pyOpenSsl is not really available, only outdated info.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply