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.0 required=5.0 tests=BAYES_00,FORGED_HOTMAIL_RCVD2, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f93747e1bf7a65bb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.129.169 with SMTP id nx9mr9241266pbb.2.1330429580163; Tue, 28 Feb 2012 03:46:20 -0800 (PST) Path: h9ni18798pbe.0!nntp.google.com!news2.google.com!postnews.google.com!l7g2000vbw.googlegroups.com!not-for-mail From: adacrypt Newsgroups: comp.lang.ada Subject: Re: Banging the Ada Drum. Date: Tue, 28 Feb 2012 03:30:43 -0800 (PST) Organization: http://groups.google.com Message-ID: <8893fdc4-ea96-4abc-bc01-cefdeec48e2e@l7g2000vbw.googlegroups.com> References: <967bd137-f854-47e1-9d31-e9236c1c0d00@z31g2000vbt.googlegroups.com> <83178b55-da15-421a-9747-451db4e495c0@cj6g2000vbb.googlegroups.com> NNTP-Posting-Host: 86.167.232.11 Mime-Version: 1.0 X-Trace: posting.google.com 1330429580 27916 127.0.0.1 (28 Feb 2012 11:46:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 28 Feb 2012 11:46:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l7g2000vbw.googlegroups.com; posting-host=86.167.232.11; posting-account=pmkN8QoAAAAtIhXRUfydb0SCISnwaeyg User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: ARLUEHNKC X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB7.3; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729),gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-02-28T03:30:43-08:00 List-Id: On Feb 28, 10:49=A0am, Martin wrote: > On Feb 28, 9:39=A0am, adacrypt wrote: > [snip] > > =A0 FOR I in 30 ..1030 LOOP > =A0 =A0 A(I) :=3D Alices_Digital_Signature.GetUnits(Numin =3D> I); > =A0 =A0 B(I) :=3D Alices_Digital_Signature.GetUnits(Numin =3D> I); > =A0 END LOOP; > > Don't explicitly re-use the array limits in loops, prefer: > > =A0 =A0for I in A'Range loop > =A0 =A0 =A0 A (I) :=3D ... > > Now the compiler may not inject checks on "A (I)" as it knows that the > range of "I" is derived directly from "A". > > Why have different types for A and B - they are both just arrays of > Integer with the same index. If you really want to make them > different, you could do: > > =A0 =A0type Index is range 30 .. 1_030; > =A0 =A0type A_Array_Type is array (Index) of Integer; > =A0 =A0type B_Array_Type is new A_Array_Type; > > =A0 =A0A : A_Array_Type; > =A0 =A0B : B_Array_Type; > > BTW, are you assuming Integer is 32-bits? Because it doesn't have to > be...it could be as small as 16 bits or larger than 32. > > -- Martin Your'e missing the point - this is not a fine piece of programming in Ada - I hold my hands up in that respect - this work has been wrested with blood sweat and tears from a world of resistance and intransigence in the crypto scene - writing great Ada is another and quite different playing field - I am not averse to that but I say keeping one's eye on the ball of simplicity is paramount. There are millions of people out there who can write great Ada - nobody apart from me can write great cryptography. Thanks for your well meant comments. I appreciate your reply. - adacrypt