コード例 #1
0
ファイル: Statement.cs プロジェクト: zero77/WalletWasabi
        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))));
        }
コード例 #2
0
ファイル: Statement.cs プロジェクト: zero77/WalletWasabi
        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));
        }