comp.lang.ada
 help / color / mirror / Atom feed
From: Markus Kuhn <Markus.Kuhn@cl.cam.ac.uk>
Subject: Re: Bignum modular types in Ada95
Date: 1998/01/28
Date: 1998-01-28T00:00:00+00:00	[thread overview]
Message-ID: <34CF3E78.F816DB5@cl.cam.ac.uk> (raw)
In-Reply-To: 34CE568C.55D7E23D@cl.cam.ac.uk


It seems that GNAT, Aonix, and Intermetrix do not support any
arithmetic that does not fit into 64-bit registers at the moment,
therefore Ada lines such as

  type Unsigned1024 is range 0..2**1024-1;

cannot be compiled. :-(

Suggestion:

Would any of the major compiler designers (especially the
GNAT team) be interested in add such bignum support to their
compiler? I think, this would be a very nice distinguishing
feature over the competition and over C/C++/Java compilers!

A question for the language lawyers:

Was the idea of having "range 0..2**1024-1" integer variables
even considered when Ada95 was drafted or are there any detail
problems in the language that would be an obstacle in such an
extention of a compiler?

It would also be nice to have some test code for bignum arithmetic
in the Ada95 validation test suite that can be used to check
quickly whether an Ada95 compiler handles >>64-bit arithmetic
correctly (both integer and modular).

Optimized assembler code for bignum arithmetic is already freely
available in the GNU MultiPrecision library on

  ftp://nic.funet.fi/pub/gnu/gnu/gmp-2.0.2.tar.gz

but this still would have to be integrated with the gcc backend.

Handling 1024-bit integer arithmetic in the Ada compiler and not in
some library package has the advantage that the compiler will later
be able to do much better optimization (e.g. automatic register
allocation), once we get CPUs with 1024-bit integer registers and
ALUs, which I expect to happen in the next three years. This way,
if we could already write now portable bignum code, all this code
could just be recompiled to be much more efficient without any
changes to the source on the next generation processors with
a Crypto-ALU.

Markus

-- 
Markus G. Kuhn, Security Group, Computer Lab, Cambridge University, UK
email: mkuhn at acm.org,  home page: <http://www.cl.cam.ac.uk/~mgk25/>




  reply	other threads:[~1998-01-28  0:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-27  0:00 Bignum modular types in Ada95 Markus Kuhn
1998-01-28  0:00 ` Markus Kuhn [this message]
1998-01-28  0:00   ` Brian Rogoff
1998-01-29  0:00     ` Markus Kuhn
1998-01-30  0:00       ` Brian Rogoff
     [not found]   ` <EnIIvn.3zr@world.std.com>
1998-01-29  0:00     ` Markus Kuhn
1998-01-31  0:00       ` Nick Roberts
1998-01-29  0:00     ` Mats Weber
     [not found]       ` <EnKEtu.KGp@world.std.com>
1998-01-30  0:00         ` Mats Weber
1998-02-01  0:00           ` Robert Dewar
1998-02-01  0:00           ` Robert Dewar
1998-01-30  0:00         ` Markus Kuhn
1998-01-30  0:00           ` Mats Weber
1998-01-30  0:00             ` Markus Kuhn
1998-01-31  0:00               ` Nick Roberts
1998-02-01  0:00           ` Robert Dewar
1998-01-31  0:00         ` Nick Roberts
1998-02-01  0:00         ` Robert Dewar
1998-02-01  0:00     ` Robert Dewar
1998-02-01  0:00   ` Robert Dewar
1998-02-02  0:00     ` Tarjei T. Jensen
1998-02-02  0:00       ` Robert Dewar
1998-02-03  0:00         ` Tarjei T. Jensen
1998-02-04  0:00           ` Keith Thompson
1998-01-28  0:00 ` Nick Roberts
1998-01-28  0:00   ` Larry Kilgallen
1998-01-28  0:00   ` Nick Roberts
1998-02-01  0:00     ` Robert Dewar
1998-02-07  0:00       ` Nick Roberts
1998-02-09  0:00         ` Robert Dewar
1998-01-28  0:00 ` Dmitriy Anisimkov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox