From caad61a13c6013ae6d45fd7b04ebb7a0e97cd8b4 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 11 Aug 2002 12:08:03 +0000 Subject: Reenable patch since shared library troubles on powerpc are solved: * gnu/java/security/provider/Gnu.java: Reference all implementation classes by using Class.getName(). * 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 classes * Makefile.am (ordinary_java_source_files): Add above files. * Makefile.in: Regenerate. * gnu/java/security/provider/DefaultPolicy.java (getPermissions): Don't maintain static class variable of Permissions. * gnu/java/security/provider/SHA.java (engineUpdate): algorithm change. (engineDigest): algorithm change. From-SVN: r56203 --- libjava/gnu/java/security/provider/SHA.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'libjava/gnu/java/security/provider/SHA.java') diff --git a/libjava/gnu/java/security/provider/SHA.java b/libjava/gnu/java/security/provider/SHA.java index ce1ba6c1d0d..90459466a89 100644 --- a/libjava/gnu/java/security/provider/SHA.java +++ b/libjava/gnu/java/security/provider/SHA.java @@ -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 -- cgit v1.2.3