Exemple #1
0
 public void SMPEnd()
 {
     ResetData();
     _smp_first_message_data  = null;
     _smp_second_message_data = null;
     _smp_third_message_data  = null;
     _session_object          = null;
     _smp_secret = null;
 }
Exemple #2
0
        private void SetFirstMessageData()
        {
            BigInteger _g_2a = null;
            BigInteger _c_2  = null;
            BigInteger _d_2  = null;

            BigInteger _g_3a = null;
            BigInteger _c_3  = null;
            BigInteger _d_3  = null;


            _smp_first_message_data = new BigInteger[MESSAGE_1_MPI_COUNT];

            _session_object = new SMPSessionObject();


            BigInteger _exp_1 = GetRandomBigInt();
            BigInteger _exp_2 = GetRandomBigInt();

            _session_object.EXP_1 = _exp_1;
            _session_object.EXP_2 = _exp_2;



            _g_2a = GENERATOR.ModPow(_exp_1, PRIME_MODULO);
            _g_3a = GENERATOR.ModPow(_exp_2, PRIME_MODULO);



            GetZKProof(1, _exp_1, ref _c_2, ref _d_2);
            GetZKProof(2, _exp_2, ref _c_3, ref _d_3);



            _smp_first_message_data[0] = _g_2a;
            _smp_first_message_data[1] = _c_2;
            _smp_first_message_data[2] = _d_2;

            _smp_first_message_data[3] = _g_3a;
            _smp_first_message_data[4] = _c_3;
            _smp_first_message_data[5] = _d_3;
        }
Exemple #3
0
        private void SetSecondMessageData()
        {
            BigInteger _g_2b = null;
            BigInteger _c_2  = null;
            BigInteger _d_2  = null;

            BigInteger _g_3b = null;
            BigInteger _c_3  = null;
            BigInteger _d_3  = null;


            BigInteger _p = null;
            BigInteger _q = null;

            BigInteger _c_p = null;
            BigInteger _d_5 = null;
            BigInteger _d_6 = null;



            BigInteger _exp_1 = GetRandomBigInt();
            BigInteger _exp_2 = GetRandomBigInt();

            _session_object = new SMPSessionObject();


            _session_object.EXP_1 = _exp_1;
            _session_object.EXP_2 = _exp_2;

            _session_object.G_3x = _smp_first_message_data[3];


            _g_2b = GENERATOR.ModPow(_exp_1, PRIME_MODULO);
            _g_3b = GENERATOR.ModPow(_exp_2, PRIME_MODULO);


            _session_object.G_2 = _smp_first_message_data[0].ModPow(_session_object.EXP_1, PRIME_MODULO);
            _session_object.G_3 = _smp_first_message_data[3].ModPow(_session_object.EXP_2, PRIME_MODULO);


            GetZKProof(3, _exp_1, ref _c_2, ref _d_2);
            GetZKProof(4, _exp_2, ref _c_3, ref _d_3);


            _smp_second_message_data = new BigInteger[MESSAGE_2_MPI_COUNT];

            _smp_second_message_data[0] = _g_2b;
            _smp_second_message_data[1] = _c_2;
            _smp_second_message_data[2] = _d_2;

            _smp_second_message_data[3] = _g_3b;
            _smp_second_message_data[4] = _c_3;
            _smp_second_message_data[5] = _d_3;


            BigInteger _r_4 = GetRandomBigInt();



            _p = _session_object.G_3.ModPow(_r_4, PRIME_MODULO);


            BigInteger _g_1_r4 = GENERATOR.ModPow(_r_4, PRIME_MODULO);
            BigInteger _g_2_y  = _session_object.G_2.ModPow(_smp_secret, PRIME_MODULO);

            _q = _g_1_r4.Multiply(_g_2_y).Mod(PRIME_MODULO);


            _session_object.P = _p;
            _session_object.Q = _q;



            _smp_second_message_data[6] = _p;
            _smp_second_message_data[7] = _q;


            GetZKProof(5, _r_4, ref _c_p, ref _d_5, ref _d_6);

            _smp_second_message_data[8]  = _c_p;
            _smp_second_message_data[9]  = _d_5;
            _smp_second_message_data[10] = _d_6;
        }
Exemple #4
0
        private void SetFirstMessageData()
        {
            BigInteger _g_2a = null;
            BigInteger _c_2 =  null;
            BigInteger _d_2 =  null;

            BigInteger _g_3a = null;
            BigInteger _c_3 =  null;
            BigInteger _d_3 =  null;

            _smp_first_message_data = new BigInteger[MESSAGE_1_MPI_COUNT];

            _session_object = new SMPSessionObject();

            BigInteger _exp_1 = GetRandomBigInt();
            BigInteger _exp_2 = GetRandomBigInt();

            _session_object.EXP_1 = _exp_1;
            _session_object.EXP_2 = _exp_2;

            _g_2a = GENERATOR.ModPow(_exp_1, PRIME_MODULO);
            _g_3a = GENERATOR.ModPow(_exp_2, PRIME_MODULO);

            GetZKProof(1, _exp_1, ref _c_2, ref _d_2);
            GetZKProof(2, _exp_2, ref _c_3, ref _d_3);

            _smp_first_message_data[0] = _g_2a;
            _smp_first_message_data[1] = _c_2;
            _smp_first_message_data[2] = _d_2;

            _smp_first_message_data[3] = _g_3a;
            _smp_first_message_data[4] = _c_3;
            _smp_first_message_data[5] = _d_3;
        }
Exemple #5
0
 public void SMPEnd()
 {
     ResetData();
     _smp_first_message_data = null;
     _smp_second_message_data = null;
     _smp_third_message_data = null;
      _session_object = null;
     _smp_secret = null;
 }
Exemple #6
0
        private void SetSecondMessageData()
        {
            BigInteger _g_2b = null;
            BigInteger _c_2 = null;
            BigInteger _d_2 = null;

            BigInteger _g_3b = null;
            BigInteger _c_3 = null;
            BigInteger _d_3 = null;

            BigInteger _p = null;
            BigInteger _q = null;

            BigInteger _c_p = null;
            BigInteger _d_5 = null;
            BigInteger _d_6 = null;

            BigInteger _exp_1 = GetRandomBigInt();
            BigInteger _exp_2 = GetRandomBigInt();

            _session_object = new SMPSessionObject();

            _session_object.EXP_1 = _exp_1;
            _session_object.EXP_2 = _exp_2;

            _session_object.G_3x = _smp_first_message_data[3];

            _g_2b = GENERATOR.ModPow(_exp_1, PRIME_MODULO);
            _g_3b = GENERATOR.ModPow(_exp_2, PRIME_MODULO);

            _session_object.G_2 = _smp_first_message_data[0].ModPow(_session_object.EXP_1, PRIME_MODULO);
            _session_object.G_3 = _smp_first_message_data[3].ModPow(_session_object.EXP_2, PRIME_MODULO);

            GetZKProof(3, _exp_1, ref _c_2, ref _d_2);
            GetZKProof(4, _exp_2, ref _c_3, ref _d_3);

            _smp_second_message_data = new BigInteger[MESSAGE_2_MPI_COUNT];

            _smp_second_message_data[0] = _g_2b;
            _smp_second_message_data[1] = _c_2;
            _smp_second_message_data[2] = _d_2;

            _smp_second_message_data[3] = _g_3b;
            _smp_second_message_data[4] = _c_3;
            _smp_second_message_data[5] = _d_3;

            BigInteger _r_4  = GetRandomBigInt();

            _p = _session_object.G_3.ModPow(_r_4, PRIME_MODULO);

            BigInteger _g_1_r4 = GENERATOR.ModPow(_r_4, PRIME_MODULO);
            BigInteger _g_2_y = _session_object.G_2.ModPow(_smp_secret, PRIME_MODULO);

            _q = _g_1_r4.Multiply(_g_2_y).Mod(PRIME_MODULO);

            _session_object.P = _p;
            _session_object.Q = _q;

            _smp_second_message_data[6] = _p;
            _smp_second_message_data[7] = _q;

            GetZKProof(5, _r_4, ref _c_p, ref _d_5, ref _d_6);

            _smp_second_message_data[8] = _c_p;
            _smp_second_message_data[9] = _d_5;
            _smp_second_message_data[10] = _d_6;
        }