mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Require a label for hashing
* Add a string label argument to CryptoComponent#hash() * Convert DoubleDigest from implementing MessageDigest to implementing org.spongycastle.crypto.Digest (we need to keep DoubleDigest for FortunaGenerator) * Convert all other uses of MessageDigest to CryptoComponent#hash() * Remove CryptoComponent#getMessageDigest(), MessageDigest and DigestWrapper
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package org.briarproject.bramble.crypto;
|
||||
|
||||
import org.briarproject.BriarTestCase;
|
||||
import org.briarproject.bramble.api.crypto.MessageDigest;
|
||||
import org.junit.Test;
|
||||
import org.spongycastle.crypto.BlockCipher;
|
||||
import org.spongycastle.crypto.digests.SHA256Digest;
|
||||
@@ -27,7 +26,7 @@ public class FortunaSecureRandomTest extends BriarTestCase {
|
||||
byte[] counter = new byte[16], output = new byte[16];
|
||||
byte[] newKey = new byte[32];
|
||||
// Calculate the initial key
|
||||
MessageDigest digest = new DoubleDigest(new SHA256Digest());
|
||||
DoubleDigest digest = new DoubleDigest(new SHA256Digest());
|
||||
digest.update(key);
|
||||
digest.update(seed);
|
||||
digest.digest(key, 0, 32);
|
||||
|
||||
Reference in New Issue
Block a user