comp.lang.ada
 help / color / mirror / Atom feed
From: austin.obyrne769@btinternet.com
Subject: Re: Integer Overflow Question.
Date: Mon, 25 Aug 2014 05:54:06 -0700 (PDT)
Date: 2014-08-25T05:54:06-07:00	[thread overview]
Message-ID: <5de897c7-fb62-4b0a-a568-8697317b778c@googlegroups.com> (raw)
In-Reply-To: <f766e778-a24a-4f3a-9cda-50b366f7d9ce@googlegroups.com>

On Monday, August 25, 2014 1:20:02 PM UTC+1, gautier...@hotmail.com wrote:
> Le lundi 25 août 2014 13:21:33 UTC+2, austin.o...@btinternet.com a écrit :
> 
> > I have written two Ada driven ciphers that are complete and have been tweaked for the last time.
> 
> > 
> 
> > 
> 
> > 
> 
> > I have used an early Ada compiler - a Gnat311.p - of about 1995 vintage  <= Ada-95.
> 
> > 
> 
> > 
> 
> > 
> 
> > In order that the ciphers can run in 32-bit computers which are still going to be around for some time despite the availability of the 64-bit operating system in Windows 8.1 which I also use, I have had to put a bound on the maximum integer size output of computations at 2^31 which of course is the maximum positive integer that 32-bit computers can handle.
> 
> > 
> 
> > 
> 
> > 
> 
> > Running the same software that was written for 32-bit computers in the  64-bit environment of 8.1 and raising the bar on integer size I thought I should be able to do this ok but no - the cipher will still crash if the integer size is greater than 2^31 when I thought I could go up to 2^63.
> 
> > 
> 
> > 
> 
> > 
> 
> > As it happens this is not a problem crypto wise because the cipher is independent of the integer size but I am intrigued that this overflow should still happen.
> 
> > 
> 
> > 
> 
> > 
> 
> > I am coming to the conclusion that the max integer size than can be used without integer overflow occurring in any computer is a function of the Ada compiler being used and not the computer operating system???
> 
> 
> 
> This is the case. This is also the case for most software installed (Word, Excel,...) which appear in a "C:\Program Files x86" folder. They all run in a 32-bit subsystem of your 64-bit system.
> 
> If you want to know metrics of your Ada numeric types, just display T'Last, T'Size.
> 
> Now, even on GNAT 32-bit, there are Integer_64 and Unsigned_64 in the Interfaces package. Use them!
> 
> HTH
> 
> _________________________ 
> 
> Gautier's Ada programming 
> 
> http://sf.net/users/gdemont

Many,many thanks.  That is very educational to know.  It suits me fine not to go any further. My crypto doesn't need it.  It is useful to me to know however that I have unwittingly used a standard that I can promote with full confidence to users.

Austin O'Byrne

      reply	other threads:[~2014-08-25 12:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-25 11:21 Integer Overflow Question austin.obyrne769
2014-08-25 11:46 ` G.B.
2014-08-25 12:58   ` austin.obyrne769
2014-08-25 13:09     ` Simon Clubley
2014-08-25 13:29       ` austin.obyrne769
2014-08-25 13:44         ` Simon Clubley
2014-08-25 13:34     ` Aay Jay Chan
2014-08-25 15:09       ` austin.obyrne769
2014-08-25 17:02       ` austin.obyrne769
2014-08-25 17:21         ` Simon Wright
2014-08-25 17:56           ` austin.obyrne769
2014-08-25 19:38           ` austin.obyrne769
2014-08-25 17:40         ` Simon Clubley
2014-08-25 18:09           ` austin.obyrne769
2014-08-25 12:20 ` gautier_niouzes
2014-08-25 12:54   ` austin.obyrne769 [this message]
replies disabled

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