From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.52.116.241 with SMTP id jz17mr14205052vdb.9.1408971246152; Mon, 25 Aug 2014 05:54:06 -0700 (PDT) X-Received: by 10.140.32.227 with SMTP id h90mr39qgh.26.1408971246125; Mon, 25 Aug 2014 05:54:06 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!au2pb.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!m5no2735810qaj.0!news-out.google.com!j6ni8038qas.0!nntp.google.com!m5no2735806qaj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 25 Aug 2014 05:54:06 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=5.81.69.184; posting-account=j15vhwoAAABH_eywb4s2_dWxAM2kkx7W NNTP-Posting-Host: 5.81.69.184 References: <9c5de333-276c-4e3a-be5a-4e5a98cdaa1d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5de897c7-fb62-4b0a-a568-8697317b778c@googlegroups.com> Subject: Re: Integer Overflow Question. From: austin.obyrne769@btinternet.com Injection-Date: Mon, 25 Aug 2014 12:54:06 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:21900 Date: 2014-08-25T05:54:06-07:00 List-Id: On Monday, August 25, 2014 1:20:02 PM UTC+1, gautier...@hotmail.com wrote: > Le lundi 25 ao=FBt 2014 13:21:33 UTC+2, austin.o...@btinternet.com a =E9c= rit=A0: >=20 > > I have written two Ada driven ciphers that are complete and have been t= weaked for the last time. >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > I have used an early Ada compiler - a Gnat311.p - of about 1995 vintage= <=3D Ada-95. >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > In order that the ciphers can run in 32-bit computers which are still g= oing to be around for some time despite the availability of the 64-bit oper= ating 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. >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > 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 in= teger size is greater than 2^31 when I thought I could go up to 2^63. >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > As it happens this is not a problem crypto wise because the cipher is i= ndependent of the integer size but I am intrigued that this overflow should= still happen. >=20 > >=20 >=20 > >=20 >=20 > >=20 >=20 > > I am coming to the conclusion that the max integer size than can be use= d without integer overflow occurring in any computer is a function of the A= da compiler being used and not the computer operating system??? >=20 >=20 >=20 > 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. >=20 > If you want to know metrics of your Ada numeric types, just display T'Las= t, T'Size. >=20 > Now, even on GNAT 32-bit, there are Integer_64 and Unsigned_64 in the Int= erfaces package. Use them! >=20 > HTH >=20 > _________________________=20 >=20 > Gautier's Ada programming=20 >=20 > 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 h= owever that I have unwittingly used a standard that I can promote with full= confidence to users. Austin O'Byrne