mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 07:09:56 +01:00
Key derivation function based on NIST SP 800-108.
This commit is contained in:
@@ -43,7 +43,7 @@ public class ConnectionRecogniserImplTest extends TestCase {
|
||||
Injector i = Guice.createInjector(new CryptoModule());
|
||||
crypto = i.getInstance(CryptoComponent.class);
|
||||
contactId = new ContactId(1);
|
||||
inSecret = new byte[123];
|
||||
inSecret = new byte[32];
|
||||
new Random().nextBytes(inSecret);
|
||||
transportId = new TransportId(TestUtils.getRandomId());
|
||||
localIndex = new TransportIndex(13);
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ConnectionWriterTest extends TestCase {
|
||||
new TestDatabaseModule(), new TransportBatchModule(),
|
||||
new TransportModule(), new TransportStreamModule());
|
||||
connectionWriterFactory = i.getInstance(ConnectionWriterFactory.class);
|
||||
outSecret = new byte[123];
|
||||
outSecret = new byte[32];
|
||||
new Random().nextBytes(outSecret);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class FrameReadWriteTest extends TestCase {
|
||||
frameCipher = crypto.getFrameCipher();
|
||||
random = new Random();
|
||||
// Since we're sending frames to ourselves, we only need outgoing keys
|
||||
outSecret = new byte[123];
|
||||
outSecret = new byte[32];
|
||||
random.nextBytes(outSecret);
|
||||
ivKey = crypto.deriveIvKey(outSecret, true);
|
||||
frameKey = crypto.deriveFrameKey(outSecret, true);
|
||||
|
||||
@@ -65,9 +65,9 @@ public class BatchConnectionReadWriteTest extends TestCase {
|
||||
transportIndex = new TransportIndex(1);
|
||||
// Create matching secrets for Alice and Bob
|
||||
Random r = new Random();
|
||||
aliceToBobSecret = new byte[123];
|
||||
aliceToBobSecret = new byte[32];
|
||||
r.nextBytes(aliceToBobSecret);
|
||||
bobToAliceSecret = new byte[123];
|
||||
bobToAliceSecret = new byte[32];
|
||||
r.nextBytes(bobToAliceSecret);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user