public static void validateMacTag(String participantId,String partnerParticipantId,BigInteger gx1,BigInteger gx2,BigInteger gx3,BigInteger gx4,BigInteger keyingMaterial,Digest digest,BigInteger partnerMacTag) throws CryptoException {
  BigInteger expectedMacTag=calculateMacTag(partnerParticipantId,participantId,gx3,gx4,gx1,gx2,keyingMaterial,digest);
  if (!expectedMacTag.equals(partnerMacTag)) {
    throw new CryptoException("Partner MacTag validation failed. " + "Therefore, the password, MAC, or digest algorithm of each participant does not match.");
  }
}

public static void validateMacTag ( String participantId , String partnerParticipantId , BigInteger gx1 , BigInteger gx2 , BigInteger gx3 , BigInteger gx4 , BigInteger keyingMaterial , Digest digest , BigInteger partnerMacTag ) throws CryptoException { BigInteger expectedMacTag = calculateMacTag ( partnerParticipantId , participantId , gx3 , gx4 , gx1 , gx2 , keyingMaterial , digest ) ; if ( ! expectedMacTag . equals ( partnerMacTag ) ) { throw new CryptoException ( "Partner MacTag validation failed. " + "Therefore, the password, MAC, or digest algorithm of each participant does not match." ) ; } }
validates the mactag received from the partner participant .
