comp.lang.ada
 help / color / mirror / Atom feed
* Large Integer Overflow - Causing a Bottleneck - Any solution.
@ 2017-05-02 14:48 Austin Obyrne
  2017-05-02 20:13 ` Rich
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Austin Obyrne @ 2017-05-02 14:48 UTC (permalink / raw)


I am using a very old Ada compiler (gnat 311.p) in the Windows_7 operating system that has 64-bit architecture to write cryptography.

Everything has gone well thus far but now I find I am being stymied from expanding my cipher by the upper bound placed by my Ada compiler on positive integers to 2^31 -1 or 2147483647 for positive integers.

Is there any solution to this that won't want me to leave the main program in order to do it.

Your usual help would be greatly appreciated.

adacrypt


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Large Integer Overflow - Causing a Bottleneck - Any solution.
  2017-05-02 14:48 Large Integer Overflow - Causing a Bottleneck - Any solution Austin Obyrne
@ 2017-05-02 20:13 ` Rich
  2017-05-03 15:05   ` Luke A. Guest
  2017-05-03 16:18 ` Simon Wright
  2017-05-04 21:49 ` Dennis Lee Bieber
  2 siblings, 1 reply; 10+ messages in thread
From: Rich @ 2017-05-02 20:13 UTC (permalink / raw)


Austin Obyrne <austin.obyrne@hotmail.com> wrote:
> I am using a very old Ada compiler (gnat 311.p) ...
> Your usual help would be greatly appreciated.

Note that the OP is a crank [1] who inhabits sci.crypt, so beyond
simply stating the obvious of "upgrade your compiler" it is best to
otherwise ignore him here.




[1] https://en.wikipedia.org/wiki/Crank_%28person%29


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Large Integer Overflow - Causing a Bottleneck - Any solution.
  2017-05-02 20:13 ` Rich
@ 2017-05-03 15:05   ` Luke A. Guest
  2017-05-03 16:29     ` Rich
  0 siblings, 1 reply; 10+ messages in thread
From: Luke A. Guest @ 2017-05-03 15:05 UTC (permalink / raw)


Rich <rich@example.invalid> wrote:
> Austin Obyrne <austin.obyrne@hotmail.com> wrote:
>> I am using a very old Ada compiler (gnat 311.p) ...
>> Your usual help would be greatly appreciated.
> 
> Note that the OP is a crank [1] who inhabits sci.crypt, so beyond
> simply stating the obvious of "upgrade your compiler" it is best to
> otherwise ignore him here.

I always envisioned him as sitting in a room clad with tin foil with a
colander strapped to his head to ward off the aliens.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Large Integer Overflow - Causing a Bottleneck - Any solution.
  2017-05-02 14:48 Large Integer Overflow - Causing a Bottleneck - Any solution Austin Obyrne
  2017-05-02 20:13 ` Rich
@ 2017-05-03 16:18 ` Simon Wright
  2017-05-04 15:49   ` Stephen Davies
  2017-05-05  8:28   ` Austin Obyrne
  2017-05-04 21:49 ` Dennis Lee Bieber
  2 siblings, 2 replies; 10+ messages in thread
From: Simon Wright @ 2017-05-03 16:18 UTC (permalink / raw)


Austin Obyrne <austin.obyrne@hotmail.com> writes:

> I am using a very old Ada compiler (gnat 311.p) in the Windows_7
> operating system that has 64-bit architecture to write cryptography.
>
> Everything has gone well thus far but now I find I am being stymied
> from expanding my cipher by the upper bound placed by my Ada compiler
> on positive integers to 2^31 -1 or 2147483647 for positive integers.
>
> Is there any solution to this that won't want me to leave the main
> program in order to do it.

Even where a GNAT is built for a machine with 64-bit addresses, it uses
32-bit integers as you have seen.

You could try, near the top of your program (assuming it's just one
compilation unit),

   subtype Integer is Long_Integer;


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Large Integer Overflow - Causing a Bottleneck - Any solution.
  2017-05-03 15:05   ` Luke A. Guest
@ 2017-05-03 16:29     ` Rich
  0 siblings, 0 replies; 10+ messages in thread
From: Rich @ 2017-05-03 16:29 UTC (permalink / raw)


Luke A. Guest <laguest@archeia.com> wrote:
> Rich <rich@example.invalid> wrote:
>> Austin Obyrne <austin.obyrne@hotmail.com> wrote:
>>> I am using a very old Ada compiler (gnat 311.p) ...
>>> Your usual help would be greatly appreciated.
>> 
>> Note that the OP is a crank [1] who inhabits sci.crypt, so beyond
>> simply stating the obvious of "upgrade your compiler" it is best to
>> otherwise ignore him here.
> 
> I always envisioned him as sitting in a room clad with tin foil with a
> colander strapped to his head to ward off the aliens.

While that is a very apt. description, and very well may be the case,
he also *very* much fits the definition of a crank.  He holds
"unshakable beliefs" regarding cryptography and his created "ciphers" that
are all his own, and no amount of evidence to the contrary will disuade
him from those beliefs.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Large Integer Overflow - Causing a Bottleneck - Any solution.
  2017-05-03 16:18 ` Simon Wright
@ 2017-05-04 15:49   ` Stephen Davies
  2017-05-04 16:53     ` Simon Wright
  2017-05-05  8:28   ` Austin Obyrne
  1 sibling, 1 reply; 10+ messages in thread
From: Stephen Davies @ 2017-05-04 15:49 UTC (permalink / raw)


On Wednesday, 3 May 2017 17:18:00 UTC+1, Simon Wright  wrote:
> Even where a GNAT is built for a machine with 64-bit addresses, it uses
> 32-bit integers as you have seen.
> 
> You could try, near the top of your program (assuming it's just one
> compilation unit),
> 
>    subtype Integer is Long_Integer;

With Gnat, I believe that Long_Integer is still 32-bit and for 64-bit you
need Long_Long_Integer. Or use "type Int64 is range -(2**63) .. 2**63-1". 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Large Integer Overflow - Causing a Bottleneck - Any solution.
  2017-05-04 15:49   ` Stephen Davies
@ 2017-05-04 16:53     ` Simon Wright
  2017-05-04 21:56       ` Dennis Lee Bieber
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Wright @ 2017-05-04 16:53 UTC (permalink / raw)


Stephen Davies <joviangm@gmail.com> writes:

> On Wednesday, 3 May 2017 17:18:00 UTC+1, Simon Wright  wrote:
>> Even where a GNAT is built for a machine with 64-bit addresses, it uses
>> 32-bit integers as you have seen.
>> 
>> You could try, near the top of your program (assuming it's just one
>> compilation unit),
>> 
>>    subtype Integer is Long_Integer;
>
> With Gnat, I believe that Long_Integer is still 32-bit and for 64-bit you
> need Long_Long_Integer. Or use "type Int64 is range -(2**63) .. 2**63-1". 

macOS Sierra, GNAT GPL 2016, this:

   package Obyrne is
      subtype Integer is Long_Integer;
      type R is record
         C : Integer;
      end record;
   end Obyrne;

gives

   $ gnatmake -c -u -f -gnatR obyrne.ads
   gcc -c -gnatR obyrne.ads

   Representation information for unit Obyrne (spec)
   -------------------------------------------------

   for R'Size use 64;
   for R'Alignment use 8;
   for R use record
      C at 0 range  0 .. 63;
   end record;

so on that platform I stand by Long_Integer. Might be different on a
32-bit platform, I guess, but I don't have one.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Large Integer Overflow - Causing a Bottleneck - Any solution.
  2017-05-02 14:48 Large Integer Overflow - Causing a Bottleneck - Any solution Austin Obyrne
  2017-05-02 20:13 ` Rich
  2017-05-03 16:18 ` Simon Wright
@ 2017-05-04 21:49 ` Dennis Lee Bieber
  2 siblings, 0 replies; 10+ messages in thread
From: Dennis Lee Bieber @ 2017-05-04 21:49 UTC (permalink / raw)


On Tue, 2 May 2017 07:48:17 -0700 (PDT), Austin Obyrne
<austin.obyrne@hotmail.com> declaimed the following:

>I am using a very old Ada compiler (gnat 311.p) in the Windows_7 operating system that has 64-bit architecture to write cryptography.
>
	Frith preserve us... The last unencumbered AdaCore release was GNAT
3.15p, and even that is 20+ years old by now.

>Everything has gone well thus far but now I find I am being stymied from expanding my cipher by the upper bound placed by my Ada compiler on positive integers to 2^31 -1 or 2147483647 for positive integers.
>
>Is there any solution to this that won't want me to leave the main program in order to do it.
>
	Write (implement) your own math package using a split record for 64-bit
integers...

	type Long_Int is record
		Upper : integer;
		Lower : integer;
	end record;

	function "+" (left : Long_Int, right : Long_int) return Long_Int; ...

Don't forget to provide methods to convert regular integers to your new
ones...
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Large Integer Overflow - Causing a Bottleneck - Any solution.
  2017-05-04 16:53     ` Simon Wright
@ 2017-05-04 21:56       ` Dennis Lee Bieber
  0 siblings, 0 replies; 10+ messages in thread
From: Dennis Lee Bieber @ 2017-05-04 21:56 UTC (permalink / raw)


On Thu, 04 May 2017 17:53:04 +0100, Simon Wright <simon@pushface.org>
declaimed the following:


>so on that platform I stand by Long_Integer. Might be different on a
>32-bit platform, I guess, but I don't have one.

	I believe the only build for Windows is designed to be 32-bit
compatible (heck, I think it relies on a 32-bit MINGW)...

Yes -- only 32-bit build is available for Windows... I suppose one /could/
install the 64-bit Linux build into the Win10 BASH shell environment, but
that won't build Windows native executables.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Large Integer Overflow - Causing a Bottleneck - Any solution.
  2017-05-03 16:18 ` Simon Wright
  2017-05-04 15:49   ` Stephen Davies
@ 2017-05-05  8:28   ` Austin Obyrne
  1 sibling, 0 replies; 10+ messages in thread
From: Austin Obyrne @ 2017-05-05  8:28 UTC (permalink / raw)


On Wednesday, May 3, 2017 at 5:18:00 PM UTC+1, Simon Wright wrote:
> Austin Obyrne <austin.obyrne@hotmail.com> writes:
> 
> > I am using a very old Ada compiler (gnat 311.p) in the Windows_7
> > operating system that has 64-bit architecture to write cryptography.
> >
> > Everything has gone well thus far but now I find I am being stymied
> > from expanding my cipher by the upper bound placed by my Ada compiler
> > on positive integers to 2^31 -1 or 2147483647 for positive integers.
> >
> > Is there any solution to this that won't want me to leave the main
> > program in order to do it.
> 
> Even where a GNAT is built for a machine with 64-bit addresses, it uses
> 32-bit integers as you have seen.
> 
> You could try, near the top of your program (assuming it's just one
> compilation unit),
> 
>    subtype Integer is Long_Integer;

Hi Simon,
I don't think I am going to have a problem after all.  I have developed new mathematics (vector factoring) that has given me a very powerful algorithm that will only need quite small integers on a typical home computer.

A snag if I can call it that is that the linitations of a home computer permit only one iteration of the core algotithm because of increasing integer size. Each iteration would give one alternative variant of the design cipher and that would be useful in serious main stream crytptography but there are many alternatives to increasing the scope of my cipher in other ways.

This cipher is lookin very good now and I'm pleased it is written in Ada.

I hesitate to go for long integer procedures considering the simple portability of the present version unless it becomes absolutely necessary and I don't think now that it will be necessaary today.

I am 'mollified' by the knowledge that the large integer a la 32 bit architecture seems to be here to stay and there is no easy way "there for the finding" that I am missing through laziness of pursuit.

As always I am hugely grateful to you and your group colleagues for your help - nearing the end of this project now.

My past career was running very large oil tankers at sea.

adacrypt


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-05-05  8:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-02 14:48 Large Integer Overflow - Causing a Bottleneck - Any solution Austin Obyrne
2017-05-02 20:13 ` Rich
2017-05-03 15:05   ` Luke A. Guest
2017-05-03 16:29     ` Rich
2017-05-03 16:18 ` Simon Wright
2017-05-04 15:49   ` Stephen Davies
2017-05-04 16:53     ` Simon Wright
2017-05-04 21:56       ` Dennis Lee Bieber
2017-05-05  8:28   ` Austin Obyrne
2017-05-04 21:49 ` Dennis Lee Bieber

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