Esempio n. 1
0
        public void TestZero()
        {
            byte[] p_first   = { 0x01, 0x01 };
            byte[] p_second  = { 0x01, 0x01 };
            byte[] p_NSquare = { 0x01 };
            byte[] expected  = { 0x00 };

            var res = PaillierHomomorphism.Addition(p_first, p_second, p_NSquare);

            Assert.Equal(expected[0], res[0]);
        }
Esempio n. 2
0
 public static SqlBinary PaillierAddition(SqlBinary left, SqlBinary right, SqlBinary N)
 {
     return(new SqlBinary(PaillierHomomorphism.Addition(left.Value, right.Value, N.Value)));
 }