@Override protected void engineUpdate(byte[] input, int offset, int len) { Assert.checkMinimumParameter("offset", 0, offset); Assert.checkMinimumParameter("len", 0, len); Assert.checkMaximumParameter("offset + len", input.length, offset + len); if (len == 0) return; messageLength += len; while (len > 0) { int loadingBytes = Math.min(len, BLOCK_SIZE - bytesLoaded); // amount of bytes from input into current block System.arraycopy(input, offset, block, bytesLoaded, loadingBytes); bytesLoaded += loadingBytes; offset += loadingBytes; len -= loadingBytes; if (bytesLoaded == BLOCK_SIZE) { ByteIterator bi = ByteIterator.ofBytes(block); // prepare the message schedule for (int i = 0; i < 16; i++) { W[i] = bi.getBE64(); } for(int i = 16; i < 80; i++) { long s0 = rotr(W[i - 15], 1) ^ rotr(W[i - 15], 8) ^ (W[i - 15] >>> 7); long s1 = rotr(W[i - 2], 19) ^ rotr(W[i - 2], 61) ^ (W[i - 2] >>> 6); W[i] = W[i - 16] + s0 + W[i - 7] + s1; } processBlock(); bytesLoaded = 0; } } }
@Override protected void engineUpdate(byte[] input, int offset, int len) { Assert.checkMinimumParameter("offset", 0, offset); Assert.checkMinimumParameter("len", 0, len); Assert.checkMaximumParameter("offset + len", input.length, offset + len); if (len == 0) return; messageLength += len; while (len > 0) { int loadingBytes = Math.min(len, BLOCK_SIZE - bytesLoaded); // amount of bytes from input into current block System.arraycopy(input, offset, block, bytesLoaded, loadingBytes); bytesLoaded += loadingBytes; offset += loadingBytes; len -= loadingBytes; if (bytesLoaded == BLOCK_SIZE) { ByteIterator bi = ByteIterator.ofBytes(block); // prepare the message schedule for (int i = 0; i < 16; i++) { W[i] = bi.getBE64(); } for(int i = 16; i < 80; i++) { long s0 = rotr(W[i - 15], 1) ^ rotr(W[i - 15], 8) ^ (W[i - 15] >>> 7); long s1 = rotr(W[i - 2], 19) ^ rotr(W[i - 2], 61) ^ (W[i - 2] >>> 6); W[i] = W[i - 16] + s0 + W[i - 7] + s1; } processBlock(); bytesLoaded = 0; } } }
@Override protected void engineUpdate(byte[] input, int offset, int len) { Assert.checkMinimumParameter("offset", 0, offset); Assert.checkMinimumParameter("len", 0, len); Assert.checkMaximumParameter("offset + len", input.length, offset + len); if (len == 0) return; messageLength += len; while (len > 0) { int loadingBytes = Math.min(len, BLOCK_SIZE - bytesLoaded); // amount of bytes from input into current block System.arraycopy(input, offset, block, bytesLoaded, loadingBytes); bytesLoaded += loadingBytes; offset += loadingBytes; len -= loadingBytes; if (bytesLoaded == BLOCK_SIZE) { ByteIterator bi = ByteIterator.ofBytes(block); // prepare the message schedule for (int i = 0; i < 16; i++) { W[i] = bi.getBE64(); } for(int i = 16; i < 80; i++) { long s0 = rotr(W[i - 15], 1) ^ rotr(W[i - 15], 8) ^ (W[i - 15] >>> 7); long s1 = rotr(W[i - 2], 19) ^ rotr(W[i - 2], 61) ^ (W[i - 2] >>> 6); W[i] = W[i - 16] + s0 + W[i - 7] + s1; } processBlock(); bytesLoaded = 0; } } }
@Override protected void engineUpdate(byte[] input, int offset, int len) { Assert.checkMinimumParameter("offset", 0, offset); Assert.checkMinimumParameter("len", 0, len); Assert.checkMaximumParameter("offset + len", input.length, offset + len); if (len == 0) return; messageLength += len; while (len > 0) { int loadingBytes = Math.min(len, BLOCK_SIZE - bytesLoaded); // amount of bytes from input into current block System.arraycopy(input, offset, block, bytesLoaded, loadingBytes); bytesLoaded += loadingBytes; offset += loadingBytes; len -= loadingBytes; if (bytesLoaded == BLOCK_SIZE) { ByteIterator bi = ByteIterator.ofBytes(block); // prepare the message schedule for (int i = 0; i < 16; i++) { W[i] = bi.getBE64(); } for(int i = 16; i < 80; i++) { long s0 = rotr(W[i - 15], 1) ^ rotr(W[i - 15], 8) ^ (W[i - 15] >>> 7); long s1 = rotr(W[i - 2], 19) ^ rotr(W[i - 2], 61) ^ (W[i - 2] >>> 6); W[i] = W[i - 16] + s0 + W[i - 7] + s1; } processBlock(); bytesLoaded = 0; } } }