diff options
| author | Mark Wielaard <mark@klomp.org> | 2002-08-01 16:06:00 +0000 |
|---|---|---|
| committer | Mark Wielaard <mark@gcc.gnu.org> | 2002-08-01 16:06:00 +0000 |
| commit | fd0ba965b24a9d1bd9bdf49aee9003d89b8bce86 (patch) | |
| tree | b613920091592f4aab99f34311bba2598faf4ea6 /libjava/gnu/java/security/provider/SHA.java | |
| parent | ad0f17651d492e6e7bf53c8f479eb698b9095fb4 (diff) | |
Revert patch that breaks libgcj shared library on powerpc:
* gnu/java/security/provider/Gnu.java: Reverse referencing all
implementation classes by using Class.getName(). Uses Strings again.
* 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: Removed.
* Makefile.am (ordinary_java_source_files): Remove above files.
* Makefile.in: Regenerate.
* gnu/java/security/provider/DefaultPolicy.java
(getPermissions): Revert to maintaining static class variable of
Permissions.
* gnu/java/security/provider/SHA.java
(engineUpdate): Revert algorithm change.
(engineDigest): Revert algorithm change.
From-SVN: r55935
Diffstat (limited to 'libjava/gnu/java/security/provider/SHA.java')
| -rw-r--r-- | libjava/gnu/java/security/provider/SHA.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libjava/gnu/java/security/provider/SHA.java b/libjava/gnu/java/security/provider/SHA.java index 90459466a89..ce1ba6c1d0d 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) & 0x3f; //wgs - int shift = (3 - i % 4) << 3; + int i = (int)bytecount % 64; + int shift = (3 - i % 4) * 8; int idx = i / 4; - i = (int)b; - W[idx] = (W[idx] & ~(0xff << shift)) | ((i & 0xff) << shift); + // if you could index ints, this would be: W[idx][shift/8] = b + W[idx] = (W[idx] & ~(0xff << shift)) | ((b & 0xff) << shift); // if we've filled up a block, then process it - if (((++bytecount) & 0x3f) == 0) + if ((++ bytecount) % 64 == 0) munch (); } @@ -99,12 +99,12 @@ public class SHA extends MessageDigest implements Cloneable public byte[] engineDigest () { - long bitcount = bytecount << 3; + long bitcount = bytecount * 8; 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 ((bytecount & 0x3f) != 56) + while ((int)bytecount % 64 != 56) engineUpdate ((byte)0); // add the length of the original, unpadded block to the end of |
