Home | History | Annotate | Download | only in encodings

Lines Matching refs:block

152         byte[]  block = new byte[getInputBlockSize() + 1 + 2 * defHash.length];
157 System.arraycopy(in, inOff, block, block.length - inLen, inLen);
162 block[block.length - inLen - 1] = 0x01;
165 // as the block is already zeroed - there's no need to add PS (the >= 0 pad of 0)
171 System.arraycopy(defHash, 0, block, defHash.length, defHash.length);
181 // mask the message block.
183 byte[] mask = maskGeneratorFunction1(seed, 0, seed.length, block.length - defHash.length);
185 for (int i = defHash.length; i != block.length; i++)
187 block[i] ^= mask[i - defHash.length];
193 System.arraycopy(seed, 0, block, 0, defHash.length);
199 block, defHash.length, block.length - defHash.length, defHash.length);
203 block[i] ^= mask[i];
206 return engine.processBlock(block, 0, block.length);
210 * @exception InvalidCipherTextException if the decrypted block turns out to
220 byte[] block = new byte[engine.getOutputBlockSize()];
223 // as we may have zeros in our leading bytes for the block we produced
224 // on encryption, we need to make sure our decrypted block comes back
228 System.arraycopy(data, 0, block, block.length - data.length, data.length);
230 boolean shortData = (block.length < (2 * defHash.length) + 1);
236 block, defHash.length, block.length - defHash.length, defHash.length);
240 block[i] ^= mask[i];
244 // unmask the message block.
246 mask = maskGeneratorFunction1(block, 0, defHash.length, block.length - defHash.length);
248 for (int i = defHash.length; i != block.length; i++)
250 block[i] ^= mask[i - defHash.length];
261 if (defHash[i] != block[defHash.length + i])
268 // find the data block
270 int start = block.length;
272 for (int index = 2 * defHash.length; index != block.length; index++)
274 if (block[index] != 0 & start == block.length)
280 boolean dataStartWrong = (start > (block.length - 1) | block[start] != 1);
286 Arrays.fill(block, (byte)0);
291 // extract the data block
293 byte[] output = new byte[block.length - start];
295 System.arraycopy(block, start, output, 0, output.length);