hmac.init(new SecretKeySpec(encKey, "HmacSHA256"));
byte[] tmpLen = new byte[] {
(byte)(dataLength >> 8), (byte)(dataLength & 0xff)
};
hmac.update(data);
hmac.update(tmpLen);
byte[] hash = hmac.doFinal();
byte[] header = new byte[hash.length+2+2];
if(blockHashAlgorithm == 0) cryptoAlgorithm = KeyBlock.HASH_SHA256;
if(blockHashAlgorithm != KeyBlock.HASH_SHA256)
throw new IllegalArgumentException("Unsupported block hash algorithm "+cryptoAlgorithm);