Removed a println.

This commit is contained in:
akwizgran
2012-01-19 18:51:55 +00:00
parent f53cc88b8f
commit 7eaa1f176f

View File

@@ -70,7 +70,6 @@ class IncomingEncryptionLayerImpl implements IncomingEncryptionLayer {
if(seg == -1) throw new FormatException(); if(seg == -1) throw new FormatException();
segmentNumber = seg; segmentNumber = seg;
} else { } else {
System.out.println("Buffered tag");
long seg = TagEncoder.decodeTag(bufferedTag, tagCipher, long seg = TagEncoder.decodeTag(bufferedTag, tagCipher,
tagKey); tagKey);
bufferedTag = null; bufferedTag = null;
@@ -78,7 +77,7 @@ class IncomingEncryptionLayerImpl implements IncomingEncryptionLayer {
segmentNumber = seg; segmentNumber = seg;
} }
} }
// Read the first block of the frame/segment // Read the first block of the frame
int offset = 0; int offset = 0;
while(offset < blockSize) { while(offset < blockSize) {
int read = in.read(ciphertext, offset, blockSize - offset); int read = in.read(ciphertext, offset, blockSize - offset);
@@ -88,7 +87,7 @@ class IncomingEncryptionLayerImpl implements IncomingEncryptionLayer {
} }
offset += read; offset += read;
} }
// Decrypt the first block of the frame/segment // Decrypt the first block of the frame
byte[] plaintext = s.getBuffer(); byte[] plaintext = s.getBuffer();
try { try {
IvEncoder.updateIv(iv, segmentNumber); IvEncoder.updateIv(iv, segmentNumber);
@@ -105,13 +104,13 @@ class IncomingEncryptionLayerImpl implements IncomingEncryptionLayer {
int padding = HeaderEncoder.getPaddingLength(plaintext); int padding = HeaderEncoder.getPaddingLength(plaintext);
int length = FRAME_HEADER_LENGTH + payload + padding + MAC_LENGTH; int length = FRAME_HEADER_LENGTH + payload + padding + MAC_LENGTH;
if(length > MAX_FRAME_LENGTH) throw new FormatException(); if(length > MAX_FRAME_LENGTH) throw new FormatException();
// Read the remainder of the frame/segment // Read the remainder of the frame
while(offset < length) { while(offset < length) {
int read = in.read(ciphertext, offset, length - offset); int read = in.read(ciphertext, offset, length - offset);
if(read == -1) throw new EOFException(); if(read == -1) throw new EOFException();
offset += read; offset += read;
} }
// Decrypt the remainder of the frame/segment // Decrypt the remainder of the frame
try { try {
int decrypted = segCipher.doFinal(ciphertext, blockSize, int decrypted = segCipher.doFinal(ciphertext, blockSize,
length - blockSize, plaintext, blockSize); length - blockSize, plaintext, blockSize);