comp.lang.ada
 help / color / mirror / Atom feed
* Constrained or Unconstrained Arrays or just my my Ignorance.
@ 2012-02-27 22:20 adacrypt
  2012-02-27 23:46 ` Adam Beneschan
  2012-02-27 23:46 ` Adam Beneschan
  0 siblings, 2 replies; 6+ messages in thread
From: adacrypt @ 2012-02-27 22:20 UTC (permalink / raw)


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 – a ‘ploy’ I
use  works under certain conditions and then not at all at other times
in a different application.

This is my method and the source code of my method.

CipherText item := 4675432 (say)

Q := CipherText;
I_Num(Q) := I_Num(Q)+1;

SUBTYPE Index_32 IS Integer RANGE MinValue  .. MaxValue;
TYPE I_CoefficientsNumArray IS ARRAY(Index_32) OF Integer;
 I_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  element 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?  I am not
experienced enough to know myself.

I suspect it might not be quite proper but it works fine!  I 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.  It 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.

I do a lot of crypto work in Ada-95.

I use  agnat 311.p compiler in Windows XP.

- adacrypt



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

end of thread, other threads:[~2012-02-28  1:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-27 22:20 Constrained or Unconstrained Arrays or just my my Ignorance adacrypt
2012-02-27 23:46 ` Adam Beneschan
2012-02-28  0:52   ` adacrypt
2012-02-28  1:16   ` adacrypt
2012-02-27 23:46 ` Adam Beneschan
2012-02-28  1:36   ` adacrypt

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