public virtual JPakeRound1Payload CreateRound1PayloadToSend()
 {
     //IL_001d: Unknown result type (might be due to invalid IL or missing references)
     if (state >= STATE_ROUND_1_CREATED)
     {
         throw new InvalidOperationException("Round 1 payload already created for " + participantId);
     }
     x1  = JPakeUtilities.GenerateX1(q, random);
     x2  = JPakeUtilities.GenerateX2(q, random);
     gx1 = JPakeUtilities.CalculateGx(p, g, x1);
     gx2 = JPakeUtilities.CalculateGx(p, g, x2);
     BigInteger[] knowledgeProofForX  = JPakeUtilities.CalculateZeroKnowledgeProof(p, q, g, gx1, x1, participantId, digest, random);
     BigInteger[] knowledgeProofForX2 = JPakeUtilities.CalculateZeroKnowledgeProof(p, q, g, gx2, x2, participantId, digest, random);
     state = STATE_ROUND_1_CREATED;
     return(new JPakeRound1Payload(participantId, gx1, gx2, knowledgeProofForX, knowledgeProofForX2));
 }
Exemple #2
0
        /// <summary>
        /// Creates and returns the payload to send to the other participant during round 1.
        ///
        /// After execution, the State state} will be STATE_ROUND_1_CREATED}.
        /// </summary>
        public virtual JPakeRound1Payload CreateRound1PayloadToSend()
        {
            if (this.state >= STATE_ROUND_1_CREATED)
                throw new InvalidOperationException("Round 1 payload already created for " + this.participantId);

            this.x1 = JPakeUtilities.GenerateX1(q, random);
            this.x2 = JPakeUtilities.GenerateX2(q, random);

            this.gx1 = JPakeUtilities.CalculateGx(p, g, x1);
            this.gx2 = JPakeUtilities.CalculateGx(p, g, x2);
            BigInteger[] knowledgeProofForX1 = JPakeUtilities.CalculateZeroKnowledgeProof(p, q, g, gx1, x1, participantId, digest, random);
            BigInteger[] knowledgeProofForX2 = JPakeUtilities.CalculateZeroKnowledgeProof(p, q, g, gx2, x2, participantId, digest, random);

            this.state = STATE_ROUND_1_CREATED;

            return new JPakeRound1Payload(participantId, gx1, gx2, knowledgeProofForX1, knowledgeProofForX2);
        }