The word "tag" was overloaded, so from now on use "tag" for the

predefined tags in the protocol and serial components, and "IV" for
the encrypted IVs used to identify connections in the transport
component.
This commit is contained in:
akwizgran
2011-08-19 11:15:35 +02:00
parent 2411e2008b
commit 9dea4d0299
19 changed files with 239 additions and 250 deletions

View File

@@ -10,31 +10,31 @@ import javax.crypto.SecretKey;
public interface CryptoComponent {
SecretKey deriveIncomingMacKey(byte[] secret);
SecretKey deriveIncomingFrameKey(byte[] secret);
SecretKey deriveIncomingTagKey(byte[] secret);
SecretKey deriveIncomingIvKey(byte[] secret);
SecretKey deriveOutgoingMacKey(byte[] secret);
SecretKey deriveIncomingMacKey(byte[] secret);
SecretKey deriveOutgoingFrameKey(byte[] secret);
SecretKey deriveOutgoingTagKey(byte[] secret);
SecretKey deriveOutgoingIvKey(byte[] secret);
SecretKey deriveOutgoingMacKey(byte[] secret);
KeyPair generateKeyPair();
SecretKey generateSecretKey();
Cipher getFrameCipher();
Cipher getIvCipher();
KeyParser getKeyParser();
Mac getMac();
MessageDigest getMessageDigest();
Cipher getFrameCipher();
Signature getSignature();
Cipher getTagCipher();
}

View File

@@ -10,8 +10,9 @@ import net.sf.briar.api.db.DbException;
public interface ConnectionRecogniser {
/**
* Returns the ID of the contact who created the tag if the connection
* should be accepted, or null if the connection should be rejected.
* Returns the ID of the contact who created the encrypted IV if the
* connection should be accepted, or null if the connection should be
* rejected.
*/
ContactId acceptConnection(byte[] tag) throws DbException;
ContactId acceptConnection(byte[] encryptedIv) throws DbException;
}

View File

@@ -7,6 +7,9 @@ public interface TransportConstants {
*/
static final int MAX_FRAME_LENGTH = 65536; // 2^16
/** The length in bytes of the tag that uniquely identifies a connection. */
static final int TAG_LENGTH = 16;
/**
* The length in bytes of the encrypted IV that uniquely identifies a
* connection.
*/
static final int IV_LENGTH = 16;
}