Add extension method to check eq mat dimensions
MODIFY
WalletWasabi/Crypto/Extensions.cs
WalletWasabi/Crypto/Extensions.cs
using System.Collections.Generic;
using WalletWasabi.Helpers;
using WalletWasabi.Crypto.Groups;
+using WalletWasabi.Crypto.ZeroKnowledge.LinearRelation;
+using WalletWasabi.Crypto;
namespace System.Linq
{
@@ -23,5 +25,14 @@ namespace System.Linq
yield return resultSelector(e1.Current, e2.Current, e3.Current);
}
}
+
+ public static void CheckDimesions(this IEnumerable<Equation> equations, IEnumerable<ScalarVector> allResponses)
+ {
+ if (equations.Count() != allResponses.Count() ||
+ Enumerable.Zip(equations, allResponses).Any(x => x.First.Generators.Count() != x.Second.Count()))
+ {
+ throw new ArgumentException("The number of responses and the number of generators in the equations do not match.");
+ }
+ }
}
}

Add extension method to check eq mat dimensions