commit | 0f55bd8a601f548facdaecbe0bbf1847c4070b59 | [log] [tgz] |
---|---|---|
author | Kenny Root <kroot@google.com> | Thu Sep 05 20:51:28 2013 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Thu Sep 05 20:51:28 2013 +0000 |
tree | 4cc4cf52327a3959d02b97d9f5a088d4b80f6564 | |
parent | 89c50e8b8cbefbf8c150e56cf5f71ce440ac0781 [diff] | |
parent | 341cfb18f9ef761eddbc87859583e19f09fbbfdd [diff] |
Merge "Make sure seed values use full range" into jb-dev
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java b/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java index 2420fbe..4d99d62 100644 --- a/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java +++ b/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java
@@ -288,6 +288,11 @@ updateSeed(RandomBitsSupplier.getRandomBits(DIGEST_LENGTH)); nextBIndex = HASHBYTES_TO_USE; + // updateSeed(...) updates where the last word of the seed is, so we + // have to read it again. + lastWord = seed[BYTES_OFFSET] == 0 ? 0 + : (seed[BYTES_OFFSET] + extrabytes) >> 3 - 1; + } else if (state == SET_SEED) { System.arraycopy(seed, HASH_OFFSET, copies, HASHCOPY_OFFSET,