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,fa32bfdf0265cf3e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,CP1252 Received: by 10.68.224.230 with SMTP id rf6mr1673988pbc.4.1330390347342; Mon, 27 Feb 2012 16:52:27 -0800 (PST) Path: h9ni17082pbe.0!nntp.google.com!news1.google.com!postnews.google.com!db5g2000vbb.googlegroups.com!not-for-mail From: adacrypt Newsgroups: comp.lang.ada Subject: Re: Constrained or Unconstrained Arrays or just my my Ignorance. Date: Mon, 27 Feb 2012 16:52:26 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <45dc4817-e418-4f2d-96cf-02eaa630064c@s7g2000vby.googlegroups.com> <73ed7d3b-3afe-4f9c-bf31-e18fe4578183@y17g2000yqg.googlegroups.com> NNTP-Posting-Host: 86.167.232.11 Mime-Version: 1.0 X-Trace: posting.google.com 1330390347 18237 127.0.0.1 (28 Feb 2012 00:52:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 28 Feb 2012 00:52:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: db5g2000vbb.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=windows-1252 Content-Transfer-Encoding: quoted-printable Date: 2012-02-27T16:52:26-08:00 List-Id: On Feb 27, 11:46=A0pm, Adam Beneschan wrote: > On Feb 27, 2:20=A0pm, adacrypt wrote: > > > > > > > In my Ada-95 driven crypto program I want to capture the frequency > > spread of the ciphertext. > > > I am not sure if I am right or not in what I am doing =96 a =91ploy=92 = I > > use =A0works under certain conditions and then not at all at other time= s > > in a different application. > > > This is my method and the source code of my method. > > > CipherText item :=3D 4675432 (say) > > > Q :=3D CipherText; > > I_Num(Q) :=3D I_Num(Q)+1; > > > SUBTYPE Index_32 IS Integer RANGE MinValue =A0.. MaxValue; > > TYPE I_CoefficientsNumArray IS ARRAY(Index_32) OF Integer; > > =A0I_Num : I_CoefficientsNumArray; > > -- counts the coefficients of the ciphertext. > > -- Max Value and MinValue are the expected values of any ciphertext as > > positive integers > > > *I use the value of the current ciphertext element to index the > > (subscript) corresponding numerically to the array =A0element where it > > will be stored and I later print out the contents of all the array > > elements to get the frequency spread of an entire encryption session.. > > > 1) Is this action legit in terms of Ada-95 Reference Manual? =A0I am no= t > > experienced enough to know myself. > > > I suspect it might not be quite proper but it works fine! =A0I fear it > > might just be bug that is working more by good luck than good design > > by me - I hope this is kosher because I want to go on using it in the > > future. =A0It works as a procedure in a much larger program ok but does > > not work at all in a second case 2) below.. > > > 2) When I try using this in a standalone program i.e. as the sole > > purpose of a dedicated program that is meant to find the frequency > > spread of any file that is read in experimentally, it definitely does > > not work. > > > Your advice would be greatly appreciated. > > Did you initialize I_Num? =A0The way you declared it, the initial values > of the elements of I_Num could be anything. > > I'm just guessing at what the problem might be. =A0The code looks fine > (I don't know what MinValue and MaxValue are, so if the difference > between them is very large, you could be creating a very large array. > If that's what you want, fine). =A0You don't give us any details about > what's going wrong except for "it definitely does not work". =A0So I'm > stabbing blindly here. > > If the problem is that the I_Num values don't get initialized, change > your declaration to something like > > =A0 I_Num : I_CoefficientsNumArray :=3D (others =3D> 0); > > which gives the array an initial value. > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Adam- Hide quoted text - > > - Show quoted text -