
Bug 1283585 – Fix Intel's AES-GCM code to not depend on AVX - yuhong
https://bugzilla.mozilla.org/show_bug.cgi?id=1283585
======
protomyth
Can someone give a bit of the why on this one? Is there something wrong with
AVX or is this a run on other chips thing? I'm at a bit of a loss on the
history.

~~~
yuhong
AVX is normally 256-bit, but it also allows 128-bit instructions with a VEX
prefix. Benefits of that include three operands and unaligned access, as well
as higher performance when mixed with 256-bit instructions. Of course, you
need a AVX-capable CPU and an OS that support AVX XSAVE to be able to use
them.

~~~
creshal
Sooo… why move away from AVX? What CPUs support AESNI, but not AVX, and
actually matter?

~~~
pdw
According to Wikipedia, most Celerons and Pentiums lack AVX but have the AES
instructions.

------
ngneer
Why is this on HN?

~~~
mkj
You get automatic upvotes if you mention crypto and performance?

~~~
afsina
And Firefox.

------
sbose78
The bug report has way too less information for folks of other disciplines (
inside CS ) to understand.

Could someone please provide a context?

~~~
pdw
The x86 architecture has a large number of optional instruction sets. One of
these, AES-NI, provides accelerated AES instructions. Another one, AVX, is a
collection of general-purpose vector instructions. These were announced at the
same time, but it seems like a large number of Intel's low-end CPUs (Celerons
& Pentiums) only implement AES-NI.

Firefox's current implementation of the AES-GCM encryption mode uses AVX
instructions. The bug report is a submission of a modified implementation that
avoids them.

------
yuhong
I really should also submit this to OpenSSL at some point.

~~~
honkhonkpants
Benchmarks?

~~~
yuhong
None that I know of, but performance penalty should be minimal. The main
difference is extra movdqu instructions to deal with unaligned access.

------
dewyatt
It seems weird that mozilla doesn't have something like phabricator so I can
view a pretty diff of this easily.

~~~
cbhl
Mozilla set its stuff up before Facebook (2004) even existed, let alone
Phabricator.

Bugzilla (1998) predates Phabricator (2010) by about 12 years. It was written
in Perl, which was the popular language at the time (similar to PHP around
when Facebook happened, or JavaScript now). The first versions of Firefox
(2002) predate Phabricator by about 8 years.

~~~
dboreham
And Bugzilla is still the best bug management system decades later.

Fwiw I was using Bugzilla in 1996. Perhaps it was open sourced in 1998?

~~~
riffraff
If you think bugzilla is better than everything that came after (e.g. trac,
jira, redline, phabricator etc) it would be interesting to know why.

I feel it's functional but not great.

~~~
mschuster91
JIRA is not free, and its main appeals are geared towards enterprise bean
counters. Not to mention it is written in Java and as a result has quite heavy
requirements on the CPU and RAM.

Upside: it is _extremely_ flexible in ticket workflow design.

(Source: maintaining a 300-user JIRA/Confluence instance at work)

------
dogma1138
AVX is a standardized x86 ISE proposed by both Intel and AMD. Intel
implemented AVX support with Ivy Bridge, AMD has implemented it with Bulldozer
these 2 platforms are nearly 6 years old, is there an actual reason to drop
support for AVX?

