Simplify validations
MODIFY
WalletWasabi/Crypto/ZeroKnowledge/LinearRelation/Equation.cs
WalletWasabi/Crypto/ZeroKnowledge/LinearRelation/Equation.cs
@@ -65,5 +65,10 @@ namespace WalletWasabi.Crypto.ZeroKnowledge.LinearRelation
// s = k + ex
return secretNonces + challenge * witness;
}
+
+ internal bool VerifySolution(ScalarVector witness)
+ {
+ return PublicPoint == witness * Generators;
+ }
}
}

MODIFY
WalletWasabi/Crypto/ZeroKnowledge/LinearRelation/Knowledge.cs
WalletWasabi/Crypto/ZeroKnowledge/LinearRelation/Knowledge.cs
@@ -16,7 +16,7 @@ namespace WalletWasabi.Crypto.ZeroKnowledge.LinearRelation
// don't try to prove something which isn't true
foreach (var equation in statement.Equations)
{
- Guard.True($"{nameof(witness)} is incorrect with respect to {nameof(equation)}.{nameof(equation.PublicPoint)}", equation.PublicPoint == witness * equation.Generators);
+ Guard.True($"{nameof(witness)} is not solution of the {nameof(equation)}", equation.VerifySolution(witness));
}
Statement = statement;

Simplify validations