[Cryptography] Is ASN.1 still the thing?

Nico Williams nico at cryptonector.com
Fri Nov 17 15:06:59 EST 2017

On Fri, Nov 17, 2017 at 11:07:10AM -0800, Watson Ladd wrote:
> On Nov 17, 2017 10:59 AM, "Nico Williams" <nico at cryptonector.com> wrote:
> > IEEE754 issues are encoding-agnostic.  This kind of thing comes up all
> > the time in JSON tooling, in ECMAScript, in RDBMSes, and many other
> > things besides.  S-expressions wouldn't be immune.  If you want floating
> > point numbers to interop and round-trip then all implementations must
> > use arbitrary precision floating point software implementations.
> This is not exactly  true. IEEE floats don't come with a wire format but
> you can serialize and deserialize the fields in the float and that is
> specified to work. Formats using other bases can work with the right high

"specified to work" -- specification vs. reality.

> precision print routine.

The moment you parse into an IEEE754 representation and use that as the
canonical form for subsequent output, you've failed to round-trip.

Serialization formats generally don't know anything about IEEE754, and
rightly so.  And not everyone uses IEEE754 for in-memory representation
of real numbers.  Numbers then might not round-trip real numbers because
the source uses an arbitrary precision library (or unums, or...) and the
other peer uses IEEE754.

If you'd like some examples with JSON, go look at issues tagged ieee754
on https://github.com/stedolan/jq .

More information about the cryptography mailing list