Added support for supplying an iterable to AND/OR/XOR mask derivation function