Do not use lazy evaluation n parameters checking
MODIFY
WalletWasabi/Crypto/CryptoGuards.cs
WalletWasabi/Crypto/CryptoGuards.cs
@@ -18,12 +18,13 @@ namespace WalletWasabi.Crypto
false => groupElement
};
- [DebuggerStepThrough]
+ //[DebuggerStepThrough]
public static IEnumerable<GroupElement> NotNullOrInfinity(string parameterName, IEnumerable<GroupElement> groupElements)
=> groupElements switch
{
null => throw new ArgumentNullException(parameterName),
- _ => groupElements.Select((ge, i) => NotNullOrInfinity($"{parameterName}[{i}]", ge))
+ _ when !groupElements.Any() => throw new ArgumentException(parameterName),
+ _ => groupElements.Select((ge, i) => NotNullOrInfinity($"{parameterName}[{i}]", ge)).ToList()
};
[DebuggerStepThrough]

MODIFY
WalletWasabi/Crypto/ZeroKnowledge/LinearRelation/Equation.cs
WalletWasabi/Crypto/ZeroKnowledge/LinearRelation/Equation.cs
@@ -16,7 +16,7 @@ namespace WalletWasabi.Crypto.ZeroKnowledge.LinearRelation
{
public Equation(GroupElement publicPoint, GroupElementVector generators)
{
- CryptoGuard.NotNullOrInfinity(nameof(generators), generators);
+ Guard.NotNullOrEmpty(nameof(generators), generators); // generators can be null
PublicPoint = CryptoGuard.NotNullOrInfinity(nameof(publicPoint), publicPoint);
Generators = generators;
}

Do not use lazy evaluation n parameters checking