mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
Code cleanup: "static final" is unnecessary in interfaces.
This commit is contained in:
@@ -9,39 +9,39 @@ public interface ProtocolConstants {
|
||||
* changes in the protocol, this is smaller than the minimum connection
|
||||
* length minus the maximum encryption and authentication overhead.
|
||||
*/
|
||||
static final int MAX_PACKET_LENGTH = MIN_CONNECTION_LENGTH / 2;
|
||||
int MAX_PACKET_LENGTH = MIN_CONNECTION_LENGTH / 2;
|
||||
|
||||
/** The maximum number of transports a node may support. */
|
||||
static final int MAX_TRANSPORTS = 25;
|
||||
int MAX_TRANSPORTS = 25;
|
||||
|
||||
/** The maximum number of properties per transport. */
|
||||
static final int MAX_PROPERTIES_PER_TRANSPORT = 100;
|
||||
int MAX_PROPERTIES_PER_TRANSPORT = 100;
|
||||
|
||||
/** The maximum length of a property's key or value in UTF-8 bytes. */
|
||||
static final int MAX_PROPERTY_LENGTH = 100;
|
||||
int MAX_PROPERTY_LENGTH = 100;
|
||||
|
||||
/** The maximum length of a group's name in UTF-8 bytes. */
|
||||
static final int MAX_GROUP_NAME_LENGTH = 50;
|
||||
int MAX_GROUP_NAME_LENGTH = 50;
|
||||
|
||||
/** The maximum length of a public key in bytes. */
|
||||
static final int MAX_PUBLIC_KEY_LENGTH = 120;
|
||||
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;
|
||||
int MAX_AUTHOR_NAME_LENGTH = 50;
|
||||
|
||||
/**
|
||||
* The maximum length of a message body in bytes. To allow for future
|
||||
* changes in the protocol, this is smaller than the maximum packet length
|
||||
* even when all the message's other fields have their maximum lengths.
|
||||
*/
|
||||
static final int MAX_BODY_LENGTH = MAX_PACKET_LENGTH - 1024;
|
||||
int MAX_BODY_LENGTH = MAX_PACKET_LENGTH - 1024;
|
||||
|
||||
/** The maximum length of a message's subject line in UTF-8 bytes. */
|
||||
static final int MAX_SUBJECT_LENGTH = 100;
|
||||
int MAX_SUBJECT_LENGTH = 100;
|
||||
|
||||
/** The maximum length of a signature in bytes. */
|
||||
static final int MAX_SIGNATURE_LENGTH = 120;
|
||||
int MAX_SIGNATURE_LENGTH = 120;
|
||||
|
||||
/** The length of a message's random salt in bytes. */
|
||||
static final int SALT_LENGTH = 8;
|
||||
int SALT_LENGTH = 8;
|
||||
}
|
||||
|
||||
@@ -3,14 +3,14 @@ package net.sf.briar.api.protocol;
|
||||
/** Struct identifiers for encoding and decoding protocol objects. */
|
||||
public interface Types {
|
||||
|
||||
static final int ACK = 0;
|
||||
static final int AUTHOR = 1;
|
||||
static final int BATCH = 2;
|
||||
static final int GROUP = 3;
|
||||
static final int MESSAGE = 4;
|
||||
static final int OFFER = 5;
|
||||
static final int REQUEST = 6;
|
||||
static final int SUBSCRIPTION_UPDATE = 7;
|
||||
static final int TRANSPORT = 8;
|
||||
static final int TRANSPORT_UPDATE = 9;
|
||||
int ACK = 0;
|
||||
int AUTHOR = 1;
|
||||
int BATCH = 2;
|
||||
int GROUP = 3;
|
||||
int MESSAGE = 4;
|
||||
int OFFER = 5;
|
||||
int REQUEST = 6;
|
||||
int SUBSCRIPTION_UPDATE = 7;
|
||||
int TRANSPORT = 8;
|
||||
int TRANSPORT_UPDATE = 9;
|
||||
}
|
||||
|
||||
@@ -3,30 +3,30 @@ package net.sf.briar.api.transport;
|
||||
public interface TransportConstants {
|
||||
|
||||
/** The length of the connection tag in bytes. */
|
||||
static final int TAG_LENGTH = 16;
|
||||
int TAG_LENGTH = 16;
|
||||
|
||||
/** The maximum length of a frame in bytes, including the header and MAC. */
|
||||
static final int MAX_FRAME_LENGTH = 32768; // 2^15, 32 KiB
|
||||
int MAX_FRAME_LENGTH = 32768; // 2^15, 32 KiB
|
||||
|
||||
/** The length of the initalisation vector (IV) in bytes. */
|
||||
static final int IV_LENGTH = 12;
|
||||
int IV_LENGTH = 12;
|
||||
|
||||
/** The length of the additional authenticated data (AAD) in bytes. */
|
||||
static final int AAD_LENGTH = 6;
|
||||
int AAD_LENGTH = 6;
|
||||
|
||||
/** The length of the frame header in bytes. */
|
||||
static final int HEADER_LENGTH = 2;
|
||||
int HEADER_LENGTH = 2;
|
||||
|
||||
/** The length of the message authentication code (MAC) in bytes. */
|
||||
static final int MAC_LENGTH = 16;
|
||||
int MAC_LENGTH = 16;
|
||||
|
||||
/**
|
||||
* The minimum connection length in bytes that all transport plugins must
|
||||
* support. Connections may be shorter than this length, but all transport
|
||||
* plugins must support connections of at least this length.
|
||||
*/
|
||||
static final int MIN_CONNECTION_LENGTH = 1024 * 1024; // 2^20, 1 MiB
|
||||
int MIN_CONNECTION_LENGTH = 1024 * 1024; // 2^20, 1 MiB
|
||||
|
||||
/** The size of the connection reordering window. */
|
||||
static final int CONNECTION_WINDOW_SIZE = 32;
|
||||
int CONNECTION_WINDOW_SIZE = 32;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user