Skip to content

Commit

Permalink
Remove unnecessary cast
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBab committed Feb 16, 2025
1 parent 7800af1 commit 595f292
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/freenet/crypt/CryptByteBufferTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void testSuccessfulRoundTripInPlace() throws GeneralSecurityException {
byte[] buffer = Hex.decode(plainText[i]);
byte[] plaintextCopy = buffer.clone();
crypt.encrypt(buffer, 0, buffer.length);
assertThat((Object) buffer, not(equalTo(plaintextCopy)));
assertThat(buffer, not(equalTo(plaintextCopy)));
crypt.decrypt(buffer, 0, buffer.length);
assertThat("CryptByteBufferType: "+type.name(),
plaintextCopy, equalTo(buffer));
Expand Down Expand Up @@ -255,9 +255,9 @@ public void testSuccessfulRoundTripByteArrayReset() throws GeneralSecurityExcept
// Once we have initialised the cipher, it is treated as a stream.
// Repeated encryption of the same data will return different ciphertext,
// as it is treated as a later point in the stream.
assertThat((Object) ciphertext1, not(equalTo(ciphertext2)));
assertThat((Object) ciphertext1, not(equalTo(ciphertext3)));
assertThat((Object) ciphertext2, not(equalTo(ciphertext3)));
assertThat(ciphertext1, not(equalTo(ciphertext2)));
assertThat(ciphertext1, not(equalTo(ciphertext3)));
assertThat(ciphertext2, not(equalTo(ciphertext3)));
}

ByteBuffer decipheredtext1 = crypt.decryptCopy(ciphertext1);
Expand Down Expand Up @@ -330,9 +330,9 @@ public void testEncryptByteBufferToByteBuffer() throws GeneralSecurityException
assertThat(buf, equalTo(cloneBuf)); // Plaintext not modified.
plaintext.position(header);
ciphertext.position(header);
assertThat((Object) ciphertextBuf, not(equalTo(copyCiphertextBuf)));
assertThat(ciphertextBuf, not(equalTo(copyCiphertextBuf)));
Arrays.fill(buf, (byte)0);
assertThat((Object) buf, not(equalTo(cloneBuf)));
assertThat(buf, not(equalTo(cloneBuf)));
crypt.decrypt(ciphertext, plaintext);
assertThat(buf, equalTo(cloneBuf));
}
Expand Down

0 comments on commit 595f292

Please sign in to comment.