StreamToWord() private static method

Cycically extract a word of key material.
private static StreamToWord ( byte data, int &offset ) : uint
data byte The string to extract the data /// from.
offset int The current offset into data.
return uint
示例#1
0
    private void EKSKey(byte[] saltBytes, byte[] inputBytes)
    {
        int num  = 0;
        int num2 = 0;

        uint[] array  = new uint[2];
        uint[] array2 = array;
        int    num3   = this._P.Length;
        int    num4   = this._S.Length;

        for (int i = 0; i < num3; i++)
        {
            this._P[i] = (this._P[i] ^ BCrypt.StreamToWord(inputBytes, ref num));
        }
        for (int i = 0; i < num3; i += 2)
        {
            array2[0] ^= BCrypt.StreamToWord(saltBytes, ref num2);
            array2[1] ^= BCrypt.StreamToWord(saltBytes, ref num2);
            this.Encipher(array2, 0);
            this._P[i]     = array2[0];
            this._P[i + 1] = array2[1];
        }
        for (int i = 0; i < num4; i += 2)
        {
            array2[0] ^= BCrypt.StreamToWord(saltBytes, ref num2);
            array2[1] ^= BCrypt.StreamToWord(saltBytes, ref num2);
            this.Encipher(array2, 0);
            this._S[i]     = array2[0];
            this._S[i + 1] = array2[1];
        }
    }
示例#2
0
    private void Key(byte[] keyBytes)
    {
        int num = 0;

        uint[] array  = new uint[2];
        uint[] array2 = array;
        int    num2   = this._P.Length;
        int    num3   = this._S.Length;

        for (int i = 0; i < num2; i++)
        {
            this._P[i] = (this._P[i] ^ BCrypt.StreamToWord(keyBytes, ref num));
        }
        for (int i = 0; i < num2; i += 2)
        {
            this.Encipher(array2, 0);
            this._P[i]     = array2[0];
            this._P[i + 1] = array2[1];
        }
        for (int i = 0; i < num3; i += 2)
        {
            this.Encipher(array2, 0);
            this._S[i]     = array2[0];
            this._S[i + 1] = array2[1];
        }
    }