Skip to content

Commit b71233b

Browse files
committed
Fix checkstyle nits
1 parent 921e2cd commit b71233b

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

src/main/java/org/apache/commons/codec/digest/Blake3.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
* implementation by Jack O'Connor.
3030
* </p>
3131
*
32-
* @since 1.16
3332
* @see <a href="https://github.com/BLAKE3-team/BLAKE3">BLAKE3 hash function</a>
33+
* @since 1.16
3434
*/
3535
public final class Blake3 {
3636
// TODO: migrate to Integer.BYTES after upgrading to Java 8
@@ -208,7 +208,8 @@ private static int[] unpackInts(final byte[] buf, final int nrInts) {
208208
}
209209

210210
// The mixing function, G, which mixes either a column or a diagonal.
211-
private static void g(final int[] state, final int a, final int b, final int c, final int d, final int mx, final int my) {
211+
private static void g(
212+
final int[] state, final int a, final int b, final int c, final int d, final int mx, final int my) {
212213
state[a] += state[b] + mx;
213214
state[d] = Integer.rotateRight(state[d] ^ state[a], 16);
214215
state[c] += state[d];
@@ -245,7 +246,8 @@ private static void round(final int[] state, final int[] msg, final byte[] sched
245246
};
246247

247248
private static int[] compress(
248-
final int[] chainingValue, final int[] blockWords, final int blockLength, final long counter, final int flags) {
249+
final int[] chainingValue, final int[] blockWords, final int blockLength, final long counter,
250+
final int flags) {
249251
final int[] state = Arrays.copyOf(chainingValue, 16);
250252
System.arraycopy(IV, 0, state, 8, 4);
251253
state[12] = (int) counter;
@@ -263,7 +265,8 @@ private static int[] compress(
263265
return state;
264266
}
265267

266-
private static Output parentOutput(final int[] leftChildCV, final int[] rightChildCV, final int[] key, final int flags) {
268+
private static Output parentOutput(
269+
final int[] leftChildCV, final int[] rightChildCV, final int[] key, final int flags) {
267270
final int[] blockWords = Arrays.copyOf(leftChildCV, 16);
268271
System.arraycopy(rightChildCV, 0, blockWords, 8, 8);
269272
return new Output(key.clone(), blockWords, 0, BLOCK_LEN, flags | PARENT);
@@ -304,7 +307,8 @@ void rootOutputBytes(final byte[] out, int offset, int length) {
304307
while (length > 0) {
305308
int chunkLength = Math.min(OUT_LEN * 2, length);
306309
length -= chunkLength;
307-
final int[] words = compress(inputChainingValue, blockWords, blockLength, outputBlockCounter++, flags | ROOT);
310+
final int[] words =
311+
compress(inputChainingValue, blockWords, blockLength, outputBlockCounter++, flags | ROOT);
308312
int wordCounter = 0;
309313
while (chunkLength > 0) {
310314
final int wordLength = Math.min(INT_BYTES, chunkLength);

src/test/java/org/apache/commons/codec/digest/Blake3TestVectorsTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
@RunWith(Parameterized.class)
3737
public class Blake3TestVectorsTest {
3838
private static final byte[] KEY = "whats the Elvish word for friend".getBytes(StandardCharsets.UTF_8);
39-
private static final byte[] CTX = "BLAKE3 2019-12-27 16:29:52 test vectors context".getBytes(StandardCharsets.UTF_8);
39+
private static final byte[] CTX =
40+
"BLAKE3 2019-12-27 16:29:52 test vectors context".getBytes(StandardCharsets.UTF_8);
4041

4142
@Parameterized.Parameters
4243
public static Object[][] testCases() {
@@ -263,7 +264,8 @@ public static Object[][] testCases() {
263264
private final byte[] keyedHash;
264265
private final byte[] deriveKey;
265266

266-
public Blake3TestVectorsTest(int inputLength, String hash, String keyedHash, String deriveKey) throws DecoderException {
267+
public Blake3TestVectorsTest(int inputLength, String hash, String keyedHash, String deriveKey)
268+
throws DecoderException {
267269
input = new byte[inputLength];
268270
for (int i = 0; i < input.length; i++) {
269271
input[i] = (byte) (i % 251);

0 commit comments

Comments
 (0)