Esempio n. 1
0
    public bool InputWhiteningTest()
    {
        bool     done = true;
        TwoFish  tf   = new TwoFish();
        BitArray wt   = tf.InputWhitening(TwoFish.ConvertHexToBitArray("57656c636f6d52054776f46669736820"), TwoFish.ConvertHexToBitArray("54776f46697368206973206e69636520"));

        //Debug.Log(tf.ConvertToHex(wt));
        if (tf.ConvertToHex(wt) != "03120325061e3a252e05d40800100d00")
        {
            done = false;
        }
        return(done);
    }
Esempio n. 2
0
    public void SingleLoopTest()
    {
        TwoFish tf = new TwoFish();

        tf.GenerateKeys(TwoFish.ConvertHexToBitArray("00000000000000000000000000000000"));
        BitArray[] wt = tf.InputWhitening(TwoFish.ConvertHexToBitArray("00000000000000000000000000000000"));
        BitArray[] wn = tf.SingleRound(wt[0], wt[1], wt[2], wt[3], 0);

        tf.DebugBits(wn[0]);
        tf.DebugBits(wn[1]);
        tf.DebugBits(wn[2]);
        tf.DebugBits(wn[3]);
    }