コード例 #1
0
        public void TripleRotorSet_EncryptDecrypt_Overloaded_Test()
        {
            var rotorSet     = new RotorSet(new[] { 3, 4, 5 });
            var encryptIndex = rotorSet.GetEncryptedIndexAndRotate(2);
            var decryptIndex = rotorSet.GetDecryptedIndexAndRotate(encryptIndex);

            decryptIndex.Should().Be(2);
        }
コード例 #2
0
        public void DoubleRotorSet_EncryptDecrypt_Test()
        {
            var rotorSet     = new RotorSet(2);
            var encryptIndex = rotorSet.GetEncryptedIndexAndRotate(2);
            var decryptIndex = rotorSet.GetDecryptedIndexAndRotate(encryptIndex);

            decryptIndex.Should().Be(2);
        }