public long doFinal() throws DataLengthException, IllegalStateException { // NOTE: 2 distinct shifts to avoid "64-bit shift" when wordPos == 0 m >>>= ((7 - wordPos) << 3); m >>>= 8; m |= (((wordCount << 3) + wordPos) & 0xffL) << 56; processMessageWord(); v2 ^= 0xffL; applySipRounds(d); long result = v0 ^ v1 ^ v2 ^ v3; reset(); return result; }
public void init(CipherParameters params) throws IllegalArgumentException { if (!(params instanceof KeyParameter)) { throw new IllegalArgumentException("'params' must be an instance of KeyParameter"); } KeyParameter keyParameter = (KeyParameter)params; byte[] key = keyParameter.getKey(); if (key.length != 16) { throw new IllegalArgumentException("'params' must be a 128-bit key"); } this.k0 = Pack.littleEndianToLong(key, 0); this.k1 = Pack.littleEndianToLong(key, 8); reset(); }
public long doFinal() throws DataLengthException, IllegalStateException { // NOTE: 2 distinct shifts to avoid "64-bit shift" when wordPos == 0 m >>>= ((7 - wordPos) << 3); m >>>= 8; m |= (((wordCount << 3) + wordPos) & 0xffL) << 56; processMessageWord(); v2 ^= 0xffL; applySipRounds(d); long result = v0 ^ v1 ^ v2 ^ v3; reset(); return result; }
public void init(CipherParameters params) throws IllegalArgumentException { if (!(params instanceof KeyParameter)) { throw new IllegalArgumentException("'params' must be an instance of KeyParameter"); } KeyParameter keyParameter = (KeyParameter)params; byte[] key = keyParameter.getKey(); if (key.length != 16) { throw new IllegalArgumentException("'params' must be a 128-bit key"); } this.k0 = Pack.littleEndianToLong(key, 0); this.k1 = Pack.littleEndianToLong(key, 8); reset(); }