[Ignore] // placeholder for actual test
        public void TwofishCipherConstructorTest()
        {
            byte[]        key     = null; // TODO: Initialize to an appropriate value
            CipherMode    mode    = null; // TODO: Initialize to an appropriate value
            CipherPadding padding = null; // TODO: Initialize to an appropriate value
            TwofishCipher target  = new TwofishCipher(key, mode, padding);

            Assert.Inconclusive("TODO: Implement code to verify target");
        }
        [Ignore] // placeholder for actual test
        public void EncryptBlockTest()
        {
            byte[]        key     = null;                                  // TODO: Initialize to an appropriate value
            CipherMode    mode    = null;                                  // TODO: Initialize to an appropriate value
            CipherPadding padding = null;                                  // TODO: Initialize to an appropriate value
            TwofishCipher target  = new TwofishCipher(key, mode, padding); // TODO: Initialize to an appropriate value

            byte[] inputBuffer = null;                                     // TODO: Initialize to an appropriate value
            int    inputOffset = 0;                                        // TODO: Initialize to an appropriate value
            int    inputCount  = 0;                                        // TODO: Initialize to an appropriate value

            byte[] outputBuffer = null;                                    // TODO: Initialize to an appropriate value
            int    outputOffset = 0;                                       // TODO: Initialize to an appropriate value
            int    expected     = 0;                                       // TODO: Initialize to an appropriate value
            int    actual;

            actual = target.EncryptBlock(inputBuffer, inputOffset, inputCount, outputBuffer, outputOffset);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Beispiel #3
0
        private ICryptoTransform CreateCryptoTransform(byte[] rgbKey, byte[] rgbIV, bool encrypt)
        {
            if (rgbKey == null)
            {
                rgbKey = this.Key;
            }
            else if (!ValidKeySize(rgbKey.Length * 8))
            {
                throw new ArgumentException("Invalid key size");
            }

            if (rgbIV != null && rgbIV.Length * 8 > BlockSize)
            {
                throw new ArgumentException("Invalid IV size");
            }

            TwofishCipher cipher = new TwofishCipher(rgbKey, Helper.ShouldEncrypt(this, encrypt), _preComputations);

            return(Helper.CreateCryptoTransform(this, cipher, encrypt, rgbIV));
        }