Exemplo n.º 1
0
        public void TestGetValidBlockModesForRc4NoPbe()
        {
            var config = new CryptoConfig
            {
                CipherAlgorithm = CipherAlgorithm.RC4
            };
            var result = config.GetValidBlockModes();

            Assert.Collection(result,
                              blockmode => Assert.Equal(BlockMode.None, blockmode));
        }
Exemplo n.º 2
0
        public void TestGetValidBlockModesForAesPbkdf2()
        {
            var config = new CryptoConfig
            {
                CipherAlgorithm = CipherAlgorithm.AES,
                IsPbeActive     = true,
                PbeAlgorithm    = PbeAlgorithm.PBKDF2
            };
            var result = config.GetValidBlockModes();

            Assert.Collection(result,
                              blockmode => Assert.Equal(BlockMode.CBC, blockmode));
        }
Exemplo n.º 3
0
        public void TestGetValidBlockModesForRc4Pbkdf2()
        {
            var config = new CryptoConfig
            {
                CipherAlgorithm = CipherAlgorithm.RC4,
                IsPbeActive     = true,
                PbeAlgorithm    = PbeAlgorithm.SCRYPT
            };
            var result = config.GetValidBlockModes();

            Assert.Collection(result,
                              blockmode => Assert.Equal(BlockMode.None, blockmode));
        }
Exemplo n.º 4
0
        public void TestGetValidBlockModesForAesNoPbe()
        {
            var config = new CryptoConfig
            {
                CipherAlgorithm = CipherAlgorithm.AES
            };
            var result = config.GetValidBlockModes();

            Assert.Collection(result,
                              blockmode => Assert.Equal(BlockMode.ECB, blockmode),
                              blockmode => Assert.Equal(BlockMode.CBC, blockmode),
                              blockmode => Assert.Equal(BlockMode.GCM, blockmode),
                              blockmode => Assert.Equal(BlockMode.OFB, blockmode),
                              blockmode => Assert.Equal(BlockMode.CTS, blockmode));
        }