Code clarity, more unit tests for ByteUtils.

Addresses comments for !48.
This commit is contained in:
akwizgran
2016-01-12 11:10:22 +00:00
parent 99f8d21eea
commit 3c6ead0603
11 changed files with 242 additions and 106 deletions

View File

@@ -18,16 +18,19 @@ public interface TransportConstants {
int STREAM_HEADER_LENGTH = STREAM_HEADER_IV_LENGTH + SecretKey.LENGTH
+ MAC_LENGTH;
/** The length of the frame initalisation vector (IV) in bytes. */
int FRAME_IV_LENGTH = 24;
/** The length of the frame nonce in bytes. */
int FRAME_NONCE_LENGTH = 24;
/** The length of the frame header payload in bytes. */
int FRAME_HEADER_PAYLOAD_LENGTH = 4;
/** The length of the plaintext frame header in bytes. */
int FRAME_HEADER_PLAINTEXT_LENGTH = 4;
/** The length of the frame header in bytes. */
int FRAME_HEADER_LENGTH = FRAME_HEADER_PAYLOAD_LENGTH + MAC_LENGTH;
/** The length of the encrypted and authenticated frame header in bytes. */
int FRAME_HEADER_LENGTH = FRAME_HEADER_PLAINTEXT_LENGTH + MAC_LENGTH;
/** The maximum length of a frame in bytes, including the header and MAC. */
/**
* The maximum length of an encrypted and authenticated frame in bytes,
* including the header.
*/
int MAX_FRAME_LENGTH = 1024;
/** The maximum total length of the frame payload and padding in bytes. */