Ejemplo n.º 1
0
        public void CreateNonEmptyRelinKeysTest()
        {
            {
                SEALContext  context = GlobalContext.BFVContext;
                KeyGenerator keygen  = new KeyGenerator(context);

                keygen.CreateRelinKeys(out RelinKeys keys);

                Assert.IsNotNull(keys);
                Assert.AreEqual(1ul, keys.Size);

                RelinKeys copy = new RelinKeys(keys);

                Assert.IsNotNull(copy);
                Assert.AreEqual(1ul, copy.Size);

                RelinKeys copy2 = new RelinKeys();

                copy2.Set(keys);
                Assert.IsNotNull(copy2);
                Assert.AreEqual(1ul, copy2.Size);
            }
            {
                SEALContext  context = GlobalContext.BGVContext;
                KeyGenerator keygen  = new KeyGenerator(context);

                keygen.CreateRelinKeys(out RelinKeys keys);

                Assert.IsNotNull(keys);
                Assert.AreEqual(1ul, keys.Size);

                RelinKeys copy = new RelinKeys(keys);

                Assert.IsNotNull(copy);
                Assert.AreEqual(1ul, copy.Size);

                RelinKeys copy2 = new RelinKeys();

                copy2.Set(keys);
                Assert.IsNotNull(copy2);
                Assert.AreEqual(1ul, copy2.Size);
            }
        }
Ejemplo n.º 2
0
        public void CreateNonEmptyRelinKeysTest()
        {
            SEALContext  context = GlobalContext.Context;
            KeyGenerator keygen  = new KeyGenerator(context);

            RelinKeys keys = keygen.RelinKeys(decompositionBitCount: 30);

            Assert.IsNotNull(keys);
            Assert.AreEqual(30, keys.DecompositionBitCount);
            Assert.AreEqual(1ul, keys.Size);

            RelinKeys copy = new RelinKeys(keys);

            Assert.IsNotNull(copy);
            Assert.AreEqual(30, copy.DecompositionBitCount);
            Assert.AreEqual(1ul, copy.Size);

            RelinKeys copy2 = new RelinKeys();

            copy2.Set(keys);
            Assert.IsNotNull(copy2);
            Assert.AreEqual(30, copy2.DecompositionBitCount);
            Assert.AreEqual(1ul, copy2.Size);
        }