List of usage examples for java.util BitSet xor
public void xor(BitSet set)
From source file:uk.co.infinityapps.rehpic.round.RoundFunctionImpl.java
public byte[] decrypt(byte[] blockData, final byte[][] subKeys) { final byte[][] reversedSubKeys = reverseSubKeysForDecryption(subKeys); for (byte[] subKey : reversedSubKeys) { blockData = substitutionBox.subtitute(blockData, subKey); BitSet xorBlockBitSet = BitSet.valueOf(blockData); xorBlockBitSet.xor(BitSet.valueOf(subKey)); blockData = permutator.shiftRight(BitUtils.bitSetToByteArray(xorBlockBitSet, blockData.length), subKey); blockData = mixingPermutator.unmix(blockData); }//from w w w . j av a 2 s. c o m return blockData; }