in UProveCrypto/CollaborativeIssuance.cs [58:120]
public virtual void Validate()
{
if (Attributes == null)
{
throw new ArgumentException("Attributes array is null");
}
if (C != null || Corig != null)
{
if (C == null || Corig == null)
{
throw new ArgumentException("Both C and Corig must be null, or both must be non-null");
}
}
if (C != null && (C.Length != Corig.Length))
{
throw new ArgumentException("C and Corig must have the same length");
}
if (C == null && U == null && K != null)
{
throw new ArgumentException("If all attributes are known, then the standard issuance protocol should be used, not collaborative issuance");
}
// Make any of the integer arrays that are null have length zero
if (C == null)
{
C = new int[] { };
}
if (Corig == null)
{
Corig = new int[] { };
}
if (K == null)
{
K = new int[] { };
}
if (U == null)
{
U = new int[] { };
}
// Check that C, U, K are pairwise disjoint
if (C.Intersect(U).Count() != 0)
{
throw new ArgumentException("C and U not disjoint: " + C.Intersect(U));
}
if (U.Intersect(K).Count() != 0)
{
throw new ArgumentException("U and K are not disjoint: " + U.Intersect(K));
}
if (C.Intersect(K).Count() != 0)
{
throw new ArgumentException("C and K are not disjoint: " + C.Intersect(K));
}
// Check that C, U, K contain all attributes
if ((U.Union(C)).Union(K).Count() != (IP.G.Length - 2))
{
throw new ArgumentException("C, U and K do not jointly contain all attributes");
}
}