|
74 | 74 | * @since 1.16 |
75 | 75 | */ |
76 | 76 | public final class Blake3 { |
77 | | - // TODO: migrate to Integer.BYTES after upgrading to Java 8 |
78 | | - private static final int INT_BYTES = Integer.SIZE / Byte.SIZE; |
79 | | - |
80 | 77 | private static final int BLOCK_LEN = 64; |
81 | | - private static final int BLOCK_INTS = BLOCK_LEN / INT_BYTES; |
| 78 | + private static final int BLOCK_INTS = BLOCK_LEN / Integer.BYTES; |
82 | 79 | private static final int KEY_LEN = 32; |
83 | | - private static final int KEY_INTS = KEY_LEN / INT_BYTES; |
| 80 | + private static final int KEY_INTS = KEY_LEN / Integer.BYTES; |
84 | 81 | private static final int OUT_LEN = 32; |
85 | 82 | private static final int CHUNK_LEN = 1024; |
86 | 83 | private static final int CHAINING_VALUE_INTS = 8; |
@@ -277,7 +274,7 @@ private static int unpackInt(final byte[] buf, final int off) { |
277 | 274 |
|
278 | 275 | private static int[] unpackInts(final byte[] buf, final int nrInts) { |
279 | 276 | final int[] values = new int[nrInts]; |
280 | | - for (int i = 0, off = 0; i < nrInts; i++, off += INT_BYTES) { |
| 277 | + for (int i = 0, off = 0; i < nrInts; i++, off += Integer.BYTES) { |
281 | 278 | values[i] = unpackInt(buf, off); |
282 | 279 | } |
283 | 280 | return values; |
@@ -388,7 +385,7 @@ void rootOutputBytes(final byte[] out, int offset, int length) { |
388 | 385 | compress(inputChainingValue, blockWords, blockLength, outputBlockCounter++, flags | ROOT); |
389 | 386 | int wordCounter = 0; |
390 | 387 | while (chunkLength > 0) { |
391 | | - final int wordLength = Math.min(INT_BYTES, chunkLength); |
| 388 | + final int wordLength = Math.min(Integer.BYTES, chunkLength); |
392 | 389 | packInt(words[wordCounter++], out, offset, wordLength); |
393 | 390 | offset += wordLength; |
394 | 391 | chunkLength -= wordLength; |
|
0 commit comments