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