Mega Search
23.2 Million


Sign Up

Make a donation  
Integer Overflow Question.  
News Group: comp.lang.ada

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???

Could anybody throw some light on this conjecture?

Thanking you in anticipation of your usual help,

adacrypt


Vote for best question.
Score: 0  # Vote:  0
Date Posted: 25-Aug-2014, at 4:21 AM EST
From: m