mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Upgraded hash function to SHA-384 and MAC to HMAC-SHA-384.
This matches the security level of AES-256 according to NSA Suite B. To better comply with Suite B we should replace the combination of CTR mode and HMAC with GCM, which would reduce the MAC size from 48 to 16 bytes.
This commit is contained in:
@@ -22,13 +22,13 @@ public interface ProtocolConstants {
|
||||
static final int MAX_PROPERTY_LENGTH = 100;
|
||||
|
||||
/** The maximum number of groups a node may subscribe to. */
|
||||
static final int MAX_GROUPS = 6000;
|
||||
static final int MAX_GROUPS = 5000;
|
||||
|
||||
/** The maximum length of a group's name in UTF-8 bytes. */
|
||||
static final int MAX_GROUP_NAME_LENGTH = 50;
|
||||
|
||||
/** The maximum length of a public key in bytes. */
|
||||
static final int MAX_PUBLIC_KEY_LENGTH = 100;
|
||||
static final int MAX_PUBLIC_KEY_LENGTH = 120;
|
||||
|
||||
/** The maximum length of an author's name in UTF-8 bytes. */
|
||||
static final int MAX_AUTHOR_NAME_LENGTH = 50;
|
||||
@@ -44,7 +44,7 @@ public interface ProtocolConstants {
|
||||
static final int MAX_SUBJECT_LENGTH = 100;
|
||||
|
||||
/** The maximum length of a signature in bytes. */
|
||||
static final int MAX_SIGNATURE_LENGTH = 100;
|
||||
static final int MAX_SIGNATURE_LENGTH = 120;
|
||||
|
||||
/** The length of a message's random salt in bytes. */
|
||||
static final int SALT_LENGTH = 8;
|
||||
|
||||
@@ -5,14 +5,14 @@ import java.util.Arrays;
|
||||
public abstract class UniqueId {
|
||||
|
||||
/** The length of a unique identifier in bytes. */
|
||||
public static final int LENGTH = 32;
|
||||
public static final int LENGTH = 48;
|
||||
|
||||
protected final byte[] id;
|
||||
|
||||
private int hashCode = -1;
|
||||
|
||||
protected UniqueId(byte[] id) {
|
||||
assert id.length == LENGTH;
|
||||
if(id.length != LENGTH) throw new IllegalArgumentException();
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ public interface TransportConstants {
|
||||
static final int FRAME_HEADER_LENGTH = 9;
|
||||
|
||||
/** The length of the MAC in bytes. */
|
||||
static final int MAC_LENGTH = 32;
|
||||
static final int MAC_LENGTH = 48;
|
||||
|
||||
/**
|
||||
* The minimum connection length in bytes that all transport plugins must
|
||||
|
||||
Reference in New Issue
Block a user