public HashMac512() { super(new DSTU7564Mac(512)); } }
public int doFinal(byte[] out, int outOff) throws DataLengthException, IllegalStateException { if (paddedKey == null) { throw new IllegalStateException(getAlgorithmName() + " not initialised"); } if (out.length - outOff < macSize) { throw new OutputLengthException("Output buffer too short"); } pad(); engine.update(invertedKey, 0, invertedKey.length); inputLength = 0; return engine.doFinal(out, outOff); }
public void update(byte[] in, int inOff, int len) throws DataLengthException, IllegalStateException { if (in.length - inOff < len) { throw new DataLengthException("Input buffer too short"); } if (paddedKey == null) { throw new IllegalStateException(getAlgorithmName() + " not initialised"); } engine.update(in, inOff, len); inputLength += len; }
public void init(CipherParameters params) throws IllegalArgumentException { if (params instanceof KeyParameter) { byte[] key = ((KeyParameter)params).getKey(); invertedKey = new byte[key.length]; paddedKey = padKey(key); for (int byteIndex = 0; byteIndex < invertedKey.length; byteIndex++) { invertedKey[byteIndex] = (byte)(key[byteIndex] ^ (byte)0xFF); } } else { throw new IllegalArgumentException("Bad parameter passed"); } engine.update(paddedKey, 0, paddedKey.length); }
public HashMac256() { super(new DSTU7564Mac(256)); } }
public HashMac384() { super(new DSTU7564Mac(384)); } }