public virtual void ValidateRound1PayloadReceived(JPakeRound1Payload round1PayloadReceived) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (state >= STATE_ROUND_1_VALIDATED) { throw new InvalidOperationException("Validation already attempted for round 1 payload for " + participantId); } partnerParticipantId = round1PayloadReceived.ParticipantId; gx3 = round1PayloadReceived.Gx1; gx4 = round1PayloadReceived.Gx2; BigInteger[] knowledgeProofForX = round1PayloadReceived.KnowledgeProofForX1; BigInteger[] knowledgeProofForX2 = round1PayloadReceived.KnowledgeProofForX2; JPakeUtilities.ValidateParticipantIdsDiffer(participantId, round1PayloadReceived.ParticipantId); JPakeUtilities.ValidateGx4(gx4); JPakeUtilities.ValidateZeroKnowledgeProof(p, q, g, gx3, knowledgeProofForX, round1PayloadReceived.ParticipantId, digest); JPakeUtilities.ValidateZeroKnowledgeProof(p, q, g, gx4, knowledgeProofForX2, round1PayloadReceived.ParticipantId, digest); state = STATE_ROUND_1_VALIDATED; }
/// <summary> /// Validates the payload received from the other participant during round 1. /// /// Must be called prior to CreateRound2PayloadToSend(). /// /// After execution, the State state will be STATE_ROUND_1_VALIDATED. /// /// Throws CryptoException if validation fails. Throws InvalidOperationException /// if called multiple times. /// </summary> public virtual void ValidateRound1PayloadReceived(JPakeRound1Payload round1PayloadReceived) { if (this.state >= STATE_ROUND_1_VALIDATED) throw new InvalidOperationException("Validation already attempted for round 1 payload for " + this.participantId); this.partnerParticipantId = round1PayloadReceived.ParticipantId; this.gx3 = round1PayloadReceived.Gx1; this.gx4 = round1PayloadReceived.Gx2; BigInteger[] knowledgeProofForX3 = round1PayloadReceived.KnowledgeProofForX1; BigInteger[] knowledgeProofForX4 = round1PayloadReceived.KnowledgeProofForX2; JPakeUtilities.ValidateParticipantIdsDiffer(participantId, round1PayloadReceived.ParticipantId); JPakeUtilities.ValidateGx4(gx4); JPakeUtilities.ValidateZeroKnowledgeProof(p, q, g, gx3, knowledgeProofForX3, round1PayloadReceived.ParticipantId, digest); JPakeUtilities.ValidateZeroKnowledgeProof(p, q, g, gx4, knowledgeProofForX4, round1PayloadReceived.ParticipantId, digest); this.state = STATE_ROUND_1_VALIDATED; }