protected void setKey(byte[] keyBytes, byte[] ivBytes) { if (keyBytes != null) { if ((keyBytes.length != 16) && (keyBytes.length != 32)) { throw new IllegalArgumentException(getAlgorithmName() + " requires 128 bit or 256 bit key"); } int tsOff = (keyBytes.length - 16) / 4; engineState[0 ] = TAU_SIGMA[tsOff ]; engineState[5 ] = TAU_SIGMA[tsOff + 1]; engineState[10] = TAU_SIGMA[tsOff + 2]; engineState[15] = TAU_SIGMA[tsOff + 3]; // Key Pack.littleEndianToInt(keyBytes, 0, engineState, 1, 4); Pack.littleEndianToInt(keyBytes, keyBytes.length - 16, engineState, 11, 4); } // IV Pack.littleEndianToInt(ivBytes, 0, engineState, 6, 2); }
throw new IllegalArgumentException(getAlgorithmName() + " Init parameters must include an IV"); if (iv == null || iv.length != getNonceSize()) throw new IllegalArgumentException(getAlgorithmName() + " requires exactly " + getNonceSize() + " bytes of IV"); throw new IllegalStateException(getAlgorithmName() + " KeyParameter can not be null for first initialisation"); throw new IllegalArgumentException(getAlgorithmName() + " Init parameters must contain a KeyParameter (or null for re-init)");
throw new IllegalStateException(getAlgorithmName()+" not initialised");
throw new IllegalStateException(getAlgorithmName() + " not initialised");