static internal string GetName(this ComputationGateType type) { switch (type) { case ComputationGateType.COMPARE_AND_SWAP: return("C&S"); default: Debug.Assert(false, "Should not reach here"); return(null); } }
static internal int GetOutputCount(this ComputationGateType type) { switch (type) { case ComputationGateType.COMPARE_AND_SWAP: return(2); default: Debug.Assert(false, "Should not reach here"); return(0); } }
public QuorumProtocol <Share <BigZp>[]> GetEvaluationProtocolFor(ComputationGateType type, Party me, Quorum quorum, Share <BigZp>[] inputs) { switch (type) { case ComputationGateType.COMPARE_AND_SWAP: Debug.Assert(inputs.Length == 2); return(new CompareAndSwapProtocol(me, quorum, inputs[0], inputs[1])); default: Debug.Assert(false, "should not get here"); return(null); } }
public ComputationGate(ComputationGateType type, int inputCount, int outputCount) : base(inputCount, outputCount) { Type = type; }
public ComputationGate(ComputationGateType type) : base(type.GetInputCount(), type.GetOutputCount()) { Type = type; }