Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1391105

Summary: aesni_intel support seems glitchy.
Product: Red Hat Enterprise Linux 7 Reporter: Steven Haigh <netwiz>
Component: opensslAssignee: Tomas Mraz <tmraz>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-02 18:34:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Steven Haigh 2016-11-02 15:02:24 UTC
# rpm -qa | grep openssl | sort
openssl-1.0.1e-51.el7_2.7.x86_64
openssl-libs-1.0.1e-51.el7_2.7.x86_64

When running some benchmarks on a PC Engines APU2 (https://pcengines.ch/apu2c4.htm), I am getting strange results depending on what options I use.

eg:
# openssl speed -evp aes-256-cbc
....
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
aes-256-cbc     101025.07k   130968.21k   151159.89k   157963.82k   158736.38k

When running two benchmarks at once, the performance of aes-256-cbc tanks:
# openssl speed -evp aes-128-cbc aes-256-cbc
....
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
aes-256 cbc      10813.46k    11304.28k    11498.41k    31695.19k    31970.65k
aes-128-cbc     123505.79k   170275.01k   205196.76k   216287.57k   219275.26k

When running without the -evp option, I get the 'tanked' speed:
# openssl speed aes-256-cbc
....
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
aes-256 cbc      10798.20k    11277.01k    11475.63k    31700.65k    31989.76k

This doesn't seem to be the expected behaviour for how I understand this should work.

Is there a way to verify that the EVP instruction set is being used by default with applications such as apache / openvpn etc?

Comment 1 Tomas Mraz 2016-11-02 18:34:04 UTC
If the applications use the high level - EVP_Encrypt... API, they'll use AES-NI if available. THe openssl speed without the -evp option uses the low level AES_encrypt API which does not use AES-NI.

This is expected behaviour.

Your second example uses EVP interface for the algorithm after the -evp option and the low-level interface for the second one.

The speed command manual page could be more comprehensive though.