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)))); }
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)); }