Beispiel #1
0
        public GroupElementVector SimulatePublicNonces(Scalar challenge, IEnumerable <ScalarVector> allGivenResponses)
        {
            // The responses matrix should match the generators in the equations and
            Equations.CheckDimensions(allGivenResponses);

            return(new GroupElementVector(Enumerable.Zip(Equations, allGivenResponses, (e, r) => e.Simulate(challenge, r))));
        }
Beispiel #2
0
        public bool CheckVerificationEquation(GroupElementVector publicNonces, Scalar challenge, IEnumerable <ScalarVector> allResponses)
        {
            // The responses matrix should match the generators in the equations and
            // there should be once nonce per equation.
            Guard.True(nameof(publicNonces), Equations.Count() == publicNonces.Count());
            Equations.CheckDimensions(allResponses);

            return(Equations.Zip(publicNonces, allResponses, (equation, r, s) => equation.Verify(r, challenge, s)).All(x => x));
        }