[Cryptography] Exotic Operations in Primitive Construction

Florian Weimer fw at deneb.enyo.de
Tue Sep 29 15:10:29 EDT 2020


* Phillip Hallam-Baker:

> One somewhat strange fact is that pretty much every CPU in use today
> supports 80 bit floating point arithmetic but no commonly used programming
> language I am aware of makes that accessible to the user except through
> specialized libraries.

That's a very x86 and Windows-specific viewpoint.  (Windows switches
the FPU to a 53 bit mantissa.)  long double uses the Intel extended
precision format on x86 Linux.  Anything on that platform that
involves long double uses this format, so there is quite a bit of
library support out there.

However, that's really specific to i386/amd64/x86-64.  On other
architectures in current use, long double is just double (presumably
that's true for Windows as well?), or full IEEE binary128.  The other
outlier is IBM POWER, but we are fixing that, switching from the
double-double hack for long double to IEEE binary128.  Hardware
support for binary128 is still rare, I think.

Curiously, the 80 bit extended precision format with its explicit
leading one bit causes issues because implementations rely on the fact
that values without the leading one bit (and all computations with
them) are undefined.  We fixed to crasher bugs in glibc just this
year, but it's somewhat debatable if those are even glibc bugs: With
this floating point format, you just can't take an arbitrary bit
pattern and start computations with it.


More information about the cryptography mailing list