2002-07-14� Mark Wielaard� <mark@klomp.org>

* gnu/java/security/der/DEREncodingException.java,
    gnu/java/security/provider/DERReader.java,
    gnu/java/security/provider/DERWriter.java,
    gnu/java/security/provider/DSAKeyPairGenerator.java,
    gnu/java/security/provider/DSAParameterGenerator.java,
    gnu/java/security/provider/DSAParameters.java,
    gnu/java/security/provider/DSASignature.java,
    gnu/java/security/provider/GnuDSAPrivateKey.java,
    gnu/java/security/provider/GnuDSAPublicKey.java,
    gnu/java/security/provider/MD5.java,
    gnu/java/security/util/Prime.java: New files from Classpath.
    * Makefile.am (ordinary_java_source_files): Add new files.
    * Makefile.in: Regenerate.

2002-07-14� C. Brian Jones <cbj@gnu.org>

    * gnu/java/security/provider/DefaultPolicy.java
    (getPermissions): do not maintain static class variable of
    Permissions
    * gnu/java/security/provider/SHA.java
    (engineUpdate): algorithm change
    (engineDigest): algorithm change

From-SVN: r55444
This commit is contained in:
Mark Wielaard
2002-07-14 22:18:35 +00:00
parent 05d495014e
commit df815141ef
16 changed files with 1779 additions and 16 deletions
+7 -7
View File
@@ -63,15 +63,15 @@ public class SHA extends MessageDigest implements Cloneable
public void engineUpdate (byte b)
{
int i = (int)bytecount % 64;
int shift = (3 - i % 4) * 8;
int i = ((int)bytecount) & 0x3f; //wgs
int shift = (3 - i % 4) << 3;
int idx = i / 4;
// if you could index ints, this would be: W[idx][shift/8] = b
W[idx] = (W[idx] & ~(0xff << shift)) | ((b & 0xff) << shift);
i = (int)b;
W[idx] = (W[idx] & ~(0xff << shift)) | ((i & 0xff) << shift);
// if we've filled up a block, then process it
if ((++ bytecount) % 64 == 0)
if (((++bytecount) & 0x3f) == 0)
munch ();
}
@@ -99,12 +99,12 @@ public class SHA extends MessageDigest implements Cloneable
public byte[] engineDigest ()
{
long bitcount = bytecount * 8;
long bitcount = bytecount << 3;
engineUpdate ((byte)0x80); // 10000000 in binary; the start of the padding
// add the rest of the padding to fill this block out, but leave 8
// bytes to put in the original bytecount
while ((int)bytecount % 64 != 56)
while ((bytecount & 0x3f) != 56)
engineUpdate ((byte)0);
// add the length of the original, unpadded block to the end of