MessageAuthCode authcode = new MessageAuthCode(type.macType, headerMacKey);
return authcode.verifyData(mac, headerEncIV, unencryptedBaseKey.getEncoded(), ver);
}
private void setupKeys() {
ParametersWithIV tempPram = null;
try{
KeyParameter cipherKey = new KeyParameter(KeyGenUtils.deriveSecretKey(unencryptedBaseKey,
EncryptedRandomAccessBuffer.class, kdfInput.underlyingKey.input,
type.encryptKey).getEncoded());
tempPram = new ParametersWithIV(cipherKey,
KeyGenUtils.deriveIvParameterSpec(unencryptedBaseKey, EncryptedRandomAccessBuffer.class,
kdfInput.underlyingIV.input, type.encryptKey).getIV());
} catch(InvalidKeyException e) {
throw new IllegalStateException(e); // Must be a bug.
}