diff options
| author | Mark Wielaard <mark@gcc.gnu.org> | 2002-07-14 22:18:35 +0000 |
|---|---|---|
| committer | Mark Wielaard <mark@gcc.gnu.org> | 2002-07-14 22:18:35 +0000 |
| commit | df815141ef37cf0d1d6cdbc6cfd2812d14272f1b (patch) | |
| tree | 7cb57a36124c45a3ef3cec7310d2cd8c1f4a6928 /libjava/gnu/java/security/provider/SHA.java | |
| parent | 05d495014ecc0fe9951d1225af380f9a1f51058b (diff) | |
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
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 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 |
