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 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!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Technical Question. Date: Mon, 16 Jun 2014 00:31:48 +0300 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: individual.net DbHSqaFR9EWj1e/vlWe7IAs7t/DdcyVoqs/LvLLJaw6KZ3T3w4 Cancel-Lock: sha1:bLDI+zeZVoFfZexX2v3bCrHCVx4= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:20335 Date: 2014-06-16T00:31:48+03:00 List-Id: On 14-06-09 15:15 , Austin Obyrne wrote: > This is an array below that loads the 'I' coefficients of a vector > (the J and K coefficients are elsewhere also in other arrays not > shown here). [snip] > The procedure below scrambles the elements of the array called 'E' by > positional reshuffling them from their original assigned position and > repositioning them by controlled means in another array called 'EE'. [snip] > Question. > > Is this ploy of scrambling key material by this means legit in Ada - > i.e. is it sanctioned by the Ada reference manual ? The ARM does not say anything about the 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, and 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 checks 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 orogramming > practice?. "Scrambling an array", whatever that means in general, does not seem counter to Ada practice. The choice of algorithms is not, IMO, a matter of Ada practice, but of general SW design. I could take issue with your Ada coding style and choice of variable names, etc., but I don't think that is what you are asking about. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .