Esempio n. 1
0
        public static byte[] Compute_gost28147(byte[] paket, byte[] key)
        {
            Gost28147Mac gost  = new Gost28147Mac();
            KeyParameter param = new KeyParameter(key);

            gost.Init(param);

            byte[] output = new byte[gost.GetMacSize()];
            gost.DoFinal(output, 0);

            return(output);
        }
Esempio n. 2
0
        /// <summary>
        /// IMPLEMENTACIJA JE TAKVA DA VRATI 4 bajta
        /// </summary>
        /// <param name="paket"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        public static byte[] Compute_gost28147(byte[] paket, byte[] key)
        {
            Gost28147Mac gost  = new Gost28147Mac();
            KeyParameter param = new KeyParameter(key, 0, key.Length);

            gost.Init(param);

            gost.BlockUpdate(key, 0, key.Length);

            var macS = gost.GetMacSize();

            byte[] output = new byte[macS];
            int    b      = gost.DoFinal(output, 0);

            return(output);
        }