Example #1
0
        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);
            }
        }
Example #2
0
        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);
            }
        }
Example #3
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);
            }
        }
Example #4
0
 public ComputationGate(ComputationGateType type, int inputCount, int outputCount)
     : base(inputCount, outputCount)
 {
     Type = type;
 }
Example #5
0
 public ComputationGate(ComputationGateType type)
     : base(type.GetInputCount(), type.GetOutputCount())
 {
     Type = type;
 }
Example #6
0
 public ComputationGate(ComputationGateType type, int inputCount, int outputCount)
     : base(inputCount, outputCount)
 {
     Type = type;
 }
Example #7
0
 public ComputationGate(ComputationGateType type)
     : base(type.GetInputCount(), type.GetOutputCount())
 {
     Type = type;
 }