Clone() public method

public Clone ( ) : object
return object
Exemplo n.º 1
0
 public static void SetupRandomGenProtocol(Quorum quorum)
 {
     int n = quorum.Size;
     for (int i = 0; i < n; i++)
     {
         TestParty<Share<BigZp>> party = new TestParty<Share<BigZp>>();
         party.UnderTest = new RandGenProtocol(party, quorum.Clone() as Quorum, new BigZp(prime, i), prime);
         NetSimulator.RegisterParty(party);
     }
 }
Exemplo n.º 2
0
        public static void SetupShareMultiplicationProtocol(Quorum quorum)
        {
            int n = quorum.Size;
            var polyDeg = (int)Math.Ceiling(n / 3.0) - 1;

            var sharesA = BigShamirSharing.Share(new BigZp(prime, 20), n, polyDeg);
            var sharesB = BigShamirSharing.Share(new BigZp(prime, 3), n, polyDeg);

            for (int i = 0; i < n; i++)
            {
                TestParty<Share<BigZp>> party = new TestParty<Share<BigZp>>();
                party.UnderTest = new ShareMultiplicationProtocol(party, quorum.Clone() as Quorum, new Share<BigZp>(sharesA[i]), new Share<BigZp>(sharesB[i]));
                NetSimulator.RegisterParty(party);
            }
        }
Exemplo n.º 3
0
        public static void SetupBitwiseAndProtocol(Quorum quorum)
        {
            int n = quorum.Size;

            var polyDeg = (int)Math.Ceiling(n / 3.0) - 1;

            var sharesA = BigShamirSharing.Share(new BigZp(prime, 0), n, polyDeg);
            var sharesB = BigShamirSharing.Share(new BigZp(prime, 1), n, polyDeg);
            var sharesC = BigShamirSharing.Share(new BigZp(prime, 0), n, polyDeg);

            var sharesD = BigShamirSharing.Share(new BigZp(prime, 0), n, polyDeg);
            var sharesE = BigShamirSharing.Share(new BigZp(prime, 1), n, polyDeg);
            var sharesF = BigShamirSharing.Share(new BigZp(prime, 1), n, polyDeg);

            for (int i = 0; i < n; i++)
            {
                Quorum q = quorum.Clone() as Quorum;
                TestParty<List<Share<BigZp>>> party = new TestParty<List<Share<BigZp>>>();
                party.UnderTest = new BitwiseOperationProtocol(party, q,
                    MakeList(sharesA[i], sharesB[i], sharesC[i]),
                    MakeList(sharesD[i], sharesE[i], sharesF[i]),
                    new SharedBitAnd.ProtocolFactory(party, q));
                NetSimulator.RegisterParty(party);
            }
        }