Derive separate keys for each direction.

This commit is contained in:
akwizgran
2011-08-14 12:18:16 +02:00
parent 254da2da27
commit 4497774311
10 changed files with 115 additions and 23 deletions

View File

@@ -60,7 +60,7 @@ public class ConnectionRecogniserImplTest extends TestCase {
@Test
public void testExpectedTag() throws Exception {
// Calculate the expected tag for connection number 3
SecretKey tagKey = crypto.deriveTagKey(secret);
SecretKey tagKey = crypto.deriveIncomingTagKey(secret);
Cipher tagCipher = crypto.getTagCipher();
tagCipher.init(Cipher.ENCRYPT_MODE, tagKey);
byte[] tag = TagEncoder.encodeTag(transportId, 3L, 0);