Comments to indicate which locks guard which variables.

This commit is contained in:
akwizgran
2015-01-29 11:05:46 +00:00
parent 47bd84122e
commit 0dbfd7073f
21 changed files with 235 additions and 1092 deletions

View File

@@ -19,6 +19,9 @@ class FortunaGenerator {
private static final int KEY_BYTES = 32;
private static final int BLOCK_BYTES = 16;
private final Lock synchLock = new ReentrantLock();
// The following are locking: synchLock
private final MessageDigest digest = new DoubleDigest(new SHA256Digest());
private final BlockCipher cipher = new AESLightEngine();
private final byte[] key = new byte[KEY_BYTES];
@@ -26,8 +29,6 @@ class FortunaGenerator {
private final byte[] buffer = new byte[BLOCK_BYTES];
private final byte[] newKey = new byte[KEY_BYTES];
private final Lock synchLock = new ReentrantLock();
FortunaGenerator(byte[] seed) {
reseed(seed);
}