/// <summary> /// Performs macing with KeyConfirmation logic /// </summary> /// <param name="otherPartyInformation">The other party's public information</param> /// <param name="derivedKeyingMaterial">The DKM from the KDF</param> /// <returns></returns> protected ComputeKeyMacResult KeyConfirmation(TOtherPartySharedInfo otherPartyInformation, BitString derivedKeyingMaterial) { var keyConfirmationParameters = GetKeyConfirmationParameters(otherPartyInformation, derivedKeyingMaterial); var keyConfirmationInstance = KeyConfirmationFactory.GetInstance(keyConfirmationParameters); return(keyConfirmationInstance.ComputeMac()); }
/// <summary> /// Performs key confirmation using both parties contributions to the key establishment. /// </summary> /// <param name="otherPartyKeyingMaterial">The other parties contributions to the scheme.</param> /// <param name="keyToTransport">The key that was derived in the KAS or KTS scheme.</param> /// <returns></returns> private ComputeKeyMacResult KeyConfirmation(ISecretKeyingMaterial otherPartyKeyingMaterial, BitString keyToTransport) { var keyConfParam = GetKeyConfirmationParameters(otherPartyKeyingMaterial, keyToTransport); var keyConfirmation = _keyConfirmationFactory.GetInstance(keyConfParam); return(keyConfirmation.ComputeMac()); }