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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.68.230.193 with SMTP id ta1mr2879702pbc.6.1402922945684; Mon, 16 Jun 2014 05:49:05 -0700 (PDT) X-Received: by 10.182.137.129 with SMTP id qi1mr1134obb.37.1402922945286; Mon, 16 Jun 2014 05:49:05 -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!news.glorb.com!a13no4106457igq.0!news-out.google.com!gf2ni0igb.0!nntp.google.com!h3no4414853igd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 16 Jun 2014 05:49:05 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=109.149.12.101; posting-account=pmkN8QoAAAAtIhXRUfydb0SCISnwaeyg NNTP-Posting-Host: 109.149.12.101 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <31ae3045-4b9f-4cd4-b803-723f18047c72@googlegroups.com> Subject: Re: Technical Question. From: Austin Obyrne Injection-Date: Mon, 16 Jun 2014 12:49:05 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:20359 Date: 2014-06-16T05:49:05-07:00 List-Id: On Sunday, June 15, 2014 10:31:48 PM UTC+1, Niklas Holsti wrote: > On 14-06-09 15:15 , Austin Obyrne wrote: > This is an array below that lo= ads the 'I' coefficients of a vector > (the J and K coefficients are elsewh= ere also in other arrays not > shown here). [snip] > The procedure below sc= rambles the elements of the array called 'E' by > positional reshuffling th= em from their original assigned position and > repositioning them by contro= lled means in another array called 'EE'. [snip] > Question. > > Is this plo= y of scrambling key material by this means legit in Ada - > i.e. is it sanc= tioned by the Ada reference manual ? The ARM does not say anything about th= e legitimacy of a particular algorithm. If your Ada algorithm - is written = in legal Ada syntax (which it probably is, if an Ada compiler compiles it),= and - never uses a variable which has not been first given a value, and - = never indexes an array with a value outside the bounds of the array, and - = never does any thing which the ARM defines as a bounded error or erroneous = execution, then your Ada program works as its source-code says it should, a= nd is "legit". I haven't analysed your algorithm to see if it might do any = of those bad things. Some of the bad things will be caught by run-time chec= ks and exceptions, but some may not; in particular the use of uninitialized= variables is such a risk. Consider using pragma Normalize_Scalars to help = detect such errors. > i.e. is it acceptable to you guys as *proper Ada orog= ramming > practice?. "Scrambling an array", whatever that means in general,= does not seem counter to Ada practice. The choice of algorithms is not, IM= O, a matter of Ada practice, but of general SW design. I could take issue w= ith your Ada coding style and choice of variable names, etc., but I don't t= hink that is what you are asking about. -- Niklas Holsti Tidorum Ltd niklas= holsti tidorum fi . @ . Many , many thanks - I suspected as much. Scrambling means transpositional changing of elements of an array so that t= hat they are not consecutively placed any more according to an obvious inde= xing system. In cryptography it confounds things abit for an illegal adversary who can t= hen only guess at the key information. Thanks again - Austin