mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Code layout.
This commit is contained in:
@@ -120,8 +120,9 @@ class IncomingEncryptionLayer implements FrameReader {
|
||||
if(payloadLength > plaintextLength - HEADER_LENGTH)
|
||||
throw new FormatException();
|
||||
// If there's any padding it must be all zeroes
|
||||
for(int i = HEADER_LENGTH + payloadLength; i < plaintextLength; i++)
|
||||
for(int i = HEADER_LENGTH + payloadLength; i < plaintextLength; i++) {
|
||||
if(frame[i] != 0) throw new FormatException();
|
||||
}
|
||||
frameNumber++;
|
||||
return payloadLength;
|
||||
}
|
||||
|
||||
@@ -97,8 +97,9 @@ class OutgoingEncryptionLayer implements FrameWriter {
|
||||
ciphertextLength = frameLength;
|
||||
}
|
||||
// If there's any padding it must all be zeroes
|
||||
for(int i = HEADER_LENGTH + payloadLength; i < plaintextLength; i++)
|
||||
for(int i = HEADER_LENGTH + payloadLength; i < plaintextLength; i++) {
|
||||
frame[i] = 0;
|
||||
}
|
||||
// Encrypt and authenticate the frame
|
||||
FrameEncoder.encodeIv(iv, frameNumber);
|
||||
FrameEncoder.encodeAad(aad, frameNumber, plaintextLength);
|
||||
|
||||
Reference in New Issue
Block a user