AsUints() static private méthode

static private AsUints ( byte bs ) : uint[]
bs byte
Résultat uint[]
Exemple #1
0
 public void Init(byte[] x)
 {
     uint[] a = GcmUtilities.AsUints(x);
     if ((this.lookupPowX2 == null) || !Arrays.AreEqual(a, (uint[])this.lookupPowX2[0]))
     {
         this.lookupPowX2 = Platform.CreateArrayList(8);
         this.lookupPowX2.Add(a);
     }
 }
Exemple #2
0
        public void Init(byte[] H)
        {
            M[0]    = new uint[16][];
            M[1]    = new uint[16][];
            M[0][0] = new uint[4];
            M[1][0] = new uint[4];
            M[1][8] = GcmUtilities.AsUints(H);
            for (int num = 4; num >= 1; num >>= 1)
            {
                uint[] array = (uint[])M[1][num + num].Clone();
                GcmUtilities.MultiplyP(array);
                M[1][num] = array;
            }
            uint[] array2 = (uint[])M[1][1].Clone();
            GcmUtilities.MultiplyP(array2);
            M[0][8] = array2;
            for (int num2 = 4; num2 >= 1; num2 >>= 1)
            {
                uint[] array3 = (uint[])M[0][num2 + num2].Clone();
                GcmUtilities.MultiplyP(array3);
                M[0][num2] = array3;
            }
            int num3 = 0;

            while (true)
            {
                for (int i = 2; i < 16; i += i)
                {
                    for (int j = 1; j < i; j++)
                    {
                        uint[] array4 = (uint[])M[num3][i].Clone();
                        GcmUtilities.Xor(array4, M[num3][j]);
                        M[num3][i + j] = array4;
                    }
                }
                if (++num3 == 32)
                {
                    break;
                }
                if (num3 > 1)
                {
                    M[num3]    = new uint[16][];
                    M[num3][0] = new uint[4];
                    for (int num4 = 8; num4 > 0; num4 >>= 1)
                    {
                        uint[] array5 = (uint[])M[num3 - 2][num4].Clone();
                        GcmUtilities.MultiplyP8(array5);
                        M[num3][num4] = array5;
                    }
                }
            }
        }
Exemple #3
0
        public void Init(byte[] H)
        {
            if (this.M == null)
            {
                this.M = new uint[16][][];
            }
            else if (Arrays.AreEqual(this.H, H))
            {
                return;
            }
            this.H         = Arrays.Clone(H);
            this.M[0]      = new uint[256][];
            this.M[0][0]   = new uint[4];
            this.M[0][128] = GcmUtilities.AsUints(H);
            for (int i = 64; i >= 1; i >>= 1)
            {
                uint[] array = (uint[])this.M[0][i + i].Clone();
                GcmUtilities.MultiplyP(array);
                this.M[0][i] = array;
            }
            int num = 0;

            while (true)
            {
                for (int j = 2; j < 256; j += j)
                {
                    for (int k = 1; k < j; k++)
                    {
                        uint[] array2 = (uint[])this.M[num][j].Clone();
                        GcmUtilities.Xor(array2, this.M[num][k]);
                        this.M[num][j + k] = array2;
                    }
                }
                if (++num == 16)
                {
                    break;
                }
                this.M[num]    = new uint[256][];
                this.M[num][0] = new uint[4];
                for (int l = 128; l > 0; l >>= 1)
                {
                    uint[] array3 = (uint[])this.M[num - 1][l].Clone();
                    GcmUtilities.MultiplyP8(array3);
                    this.M[num][l] = array3;
                }
            }
        }
        public void Init(byte[] H)
        {
            if (M == null)
            {
                M = new uint[32][][];
            }
            else if (Arrays.AreEqual(this.H, H))
            {
                return;
            }
            this.H  = Arrays.Clone(H);
            M[0]    = new uint[16][];
            M[1]    = new uint[16][];
            M[0][0] = new uint[4];
            M[1][0] = new uint[4];
            M[1][8] = GcmUtilities.AsUints(H);
            for (int num = 4; num >= 1; num >>= 1)
            {
                uint[] array = (uint[])((global::System.Array)M[1][num + num]).Clone();
                GcmUtilities.MultiplyP(array);
                M[1][num] = array;
            }
            uint[] array2 = (uint[])((global::System.Array)M[1][1]).Clone();
            GcmUtilities.MultiplyP(array2);
            M[0][8] = array2;
            for (int num2 = 4; num2 >= 1; num2 >>= 1)
            {
                uint[] array3 = (uint[])((global::System.Array)M[0][num2 + num2]).Clone();
                GcmUtilities.MultiplyP(array3);
                M[0][num2] = array3;
            }
            int num3 = 0;

            while (true)
            {
                for (int i = 2; i < 16; i += i)
                {
                    for (int j = 1; j < i; j++)
                    {
                        uint[] array4 = (uint[])((global::System.Array)M[num3][i]).Clone();
                        GcmUtilities.Xor(array4, M[num3][j]);
                        M[num3][i + j] = array4;
                    }
                }
                if (++num3 == 32)
                {
                    break;
                }
                if (num3 > 1)
                {
                    M[num3]    = new uint[16][];
                    M[num3][0] = new uint[4];
                    for (int num4 = 8; num4 > 0; num4 >>= 1)
                    {
                        uint[] array5 = (uint[])((global::System.Array)M[num3 - 2][num4]).Clone();
                        GcmUtilities.MultiplyP8(array5);
                        M[num3][num4] = array5;
                    }
                }
            }
        }