コード例 #1
0
    //sprawdzone obliczeniami
    public void q0Test()
    {
        TwoFish tf       = new TwoFish();
        var     bitArray = TwoFish.ConvertHexToBitArray("52");

        tf.q0(bitArray);
    }
コード例 #2
0
    //Kilka prowizorycznych testów automatycznych
    public bool Q0_tests()
    {
        TwoFish tf   = new TwoFish();
        bool    done = true;

        if (tf.ConvertToHex(tf.q0(TwoFish.ConvertHexToBitArray("00"))) != "a9")
        {
            done = false;
        }
        if (tf.ConvertToHex(tf.q0(TwoFish.ConvertHexToBitArray("a1"))) != "f1")
        {
            done = false;
        }
        if (tf.ConvertToHex(tf.q0(TwoFish.ConvertHexToBitArray("1c"))) != "fa")
        {
            done = false;
        }
        if (tf.ConvertToHex(tf.q0(TwoFish.ConvertHexToBitArray("fb"))) != "42")
        {
            done = false;
        }
        if (tf.ConvertToHex(tf.q0(TwoFish.ConvertHexToBitArray("05"))) != "12")
        {
            done = false;
        }
        if (tf.ConvertToHex(tf.q0(TwoFish.ConvertHexToBitArray("01"))) != "a4")
        {
            done = false;
        }

        return(done);
    }