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

            GaloisKeys keys = keygen.GaloisKeys();

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

            GaloisKeys keys2 = new GaloisKeys();

            Assert.IsNotNull(keys2);
            Assert.AreEqual(0ul, keys2.Size);

            keys2.Set(keys);

            Assert.AreNotSame(keys, keys2);
            Assert.AreEqual(24ul, keys2.Size);
        }
Exemplo n.º 2
0
        public void SetTest()
        {
            SEALContext  context = GlobalContext.Context;
            KeyGenerator keygen  = new KeyGenerator(context);

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

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

            GaloisKeys keys2 = new GaloisKeys();

            Assert.IsNotNull(keys2);
            Assert.AreEqual(0, keys2.DecompositionBitCount);
            Assert.AreEqual(0ul, keys2.Size);

            keys2.Set(keys);

            Assert.AreNotSame(keys, keys2);
            Assert.AreEqual(30, keys2.DecompositionBitCount);
            Assert.AreEqual(22ul, keys2.Size);
        }