Subject: [Classpathx-crypto] latest checkins (long)

From: "Raif S. Naffah" <[email-masked]>
Date: Wed, 07 Aug 2002 21:03:39 +1000

hi guys,

i just checked in some bug-fixes, few additions and one new tool: Ent 
--a java port of John Walker's ENT program (see 
http://www.fourmilab.ch/).  its purpose is to compute some statistical 
indices for a given stream to assess its degree of randomness.

here is the output of:  ant ent

ent:

      [java] Total execution time (ms): 631
      [java] Computed indices for MD4PRNG:
      [java]                   Total bit count: 8388608
      [java]            Mean value of set bits: 0.4999542236328125
      [java]                  Mean % deviation: 0.0091552734375
      [java]           Chi-square distribution: 0.0703125
      [java]   Chi-square excess % probability: 50.0
      [java]                       Computed PI: 3.143475126171593
      [java]           Computed PI % deviation: 0.05992096332568889
      [java]    Serial Correlation Coefficient: -1.6697682580239272E-5

      [java] Total execution time (ms): 771
      [java] Computed indices for RIPEMD128PRNG:
      [java]                   Total bit count: 8388608
      [java]            Mean value of set bits: 0.5000506639480591
      [java]                  Mean % deviation: 0.010132789611816406
      [java]           Chi-square distribution: 0.08612871170043945
      [java]   Chi-square excess % probability: 50.0
      [java]                       Computed PI: 3.138668589281423
      [java]           Computed PI % deviation: 0.09307585771914455
      [java]    Serial Correlation Coefficient: 7.295505921987954E-4

      [java] Total execution time (ms): 1102
      [java] Computed indices for ICM:
      [java]                   Total bit count: 8388608
      [java]            Mean value of set bits: 0.49994516372680664
      [java]                  Mean % deviation: 0.010967254638671875
      [java]           Chi-square distribution: 0.10089874267578125
      [java]   Chi-square excess % probability: 50.0
      [java]                       Computed PI: 3.1437726736933658
      [java]           Computed PI % deviation: 0.06939219510465874
      [java]    Serial Correlation Coefficient: -3.490568320705976E-4

      [java] Total execution time (ms): 701
      [java] Computed indices for MD5PRNG:
      [java]                   Total bit count: 8388608
      [java]            Mean value of set bits: 0.5000228881835938
      [java]                  Mean % deviation: 0.00457763671875
      [java]           Chi-square distribution: 0.017578125
      [java]   Chi-square excess % probability: 75.0
      [java]                       Computed PI: 3.135807555418226
      [java]           Computed PI % deviation: 0.18414539405536265
      [java]    Serial Correlation Coefficient: -5.865306605768334E-5

      [java] Total execution time (ms): 961
      [java] Computed indices for WHIRLPOOLPRNG:
      [java]                   Total bit count: 8388608
      [java]            Mean value of set bits: 0.5002869367599487
      [java]                  Mean % deviation: 0.057387351989746094
      [java]           Chi-square distribution: 2.762627124786377
      [java]   Chi-square excess % probability: 10.0
      [java]                       Computed PI: 3.138668589281423
      [java]           Computed PI % deviation: 0.09307585771914455
      [java]    Serial Correlation Coefficient: 5.689114690354338E-5

      [java] Total execution time (ms): 781
      [java] Computed indices for RIPEMD160PRNG:
      [java]                   Total bit count: 8388608
      [java]            Mean value of set bits: 0.49994874000549316
      [java]                  Mean % deviation: 0.010251998901367188
      [java]           Chi-square distribution: 0.08816719055175781
      [java]   Chi-square excess % probability: 50.0
      [java]                       Computed PI: 3.1433149082752543
      [java]           Computed PI % deviation: 0.054821069290864416
      [java]    Serial Correlation Coefficient: -8.488752540050106E-5

      [java] Total execution time (ms): 731
      [java] Computed indices for SHA-160PRNG:
      [java]                   Total bit count: 8388608
      [java]            Mean value of set bits: 0.4998607635498047
      [java]                  Mean % deviation: 0.0278472900390625
      [java]           Chi-square distribution: 0.6505126953125
      [java]   Chi-square excess % probability: 50.0
      [java]                       Computed PI: 3.1392636843249675
      [java]           Computed PI % deviation: 0.07413339416121897
      [java]    Serial Correlation Coefficient: -4.4878134782710987E-4

      [java] Total execution time (ms): 411
      [java] Computed indices for UMAC-KDF:
      [java]                   Total bit count: 8388608
      [java]            Mean value of set bits: 0.5000001192092896
      [java]                  Mean % deviation: 2.384185791015625E-5
      [java]           Chi-square distribution: 4.76837158203125E-7
      [java]   Chi-square excess % probability: 75.0
      [java]                       Computed PI: 3.1365857566290156
      [java]           Computed PI % deviation: 0.15937448017190523
      [java]    Serial Correlation Coefficient: -1.4114379888497644E-4

BUILD SUCCESSFUL
Total time: 13 seconds

sorting the indices by:

* time: shows that UMacGenerator is the fastest, and ICMGenerator is the 
slowest;
* mean % deviation: shows that UMacGenerator is the closest to 0.5 and 
Whirlpool is the farthest;
* scc: shows that MD4-based PRNG is closest to 0.0, and RIPEMD-160-based 
PRNG is the farthest;

it would be nice, if someone goes through the code and make sure i didnt 
code the formulae incorrectly and, may be in the future, add more 
indices and/or a gui face to the tool.

i'll continue working on the build and make files for now.

cheers;
rsn