Exemplo n.º 1
0
        public static void Test(string s)
        {
            MD4 md4 = new MD4();

            md4.EngineUpdate(s.GetBytes(), 0, s.Length);
            System.Diagnostics.Debug.WriteLine("\\\"" + s + "\\\"");
            System.out_renamed.Print(Lib.HexDump(md4.EngineDigest(), 16, false));
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            Test("");
            Test("a");
            Test("abc");
            Test("abcdefghijklmnopqrstuvwxyz");
            Test("hi");
            MD4 md4 = new MD4();

            byte[] data = new[] { (byte)0x71, (byte)0xa9, (byte)0x05, (byte)0xce, (byte)0x8d, (byte)0x75, (byte)0x28, (byte)0xc8, (byte)0xba, (byte)0x97, (byte)0x45, (byte)0xe9, (byte)0x8a, (byte)0xe0, (byte)0x37, (byte)0xbd, (byte)0x6c, (byte)0x6d, (byte)0x67, (byte)0x4a, (byte)0x21 };
            System.Diagnostics.Debug.WriteLine("checksum=" + MD4.Com_BlockChecksum(data, 21));
        }
Exemplo n.º 3
0
        public static int Com_BlockChecksum(byte[] buffer, int length)
        {
            int val;
            MD4 md4 = new MD4();

            md4.EngineUpdate(buffer, 0, length);
            byte[]     data = md4.EngineDigest();
            ByteBuffer bb   = ByteBuffer.Wrap(data);

            bb.Order = ByteOrder.LittleEndian;
            val      = bb.GetInt32() ^ bb.GetInt32() ^ bb.GetInt32() ^ bb.GetInt32();
            return(val);
        }
Exemplo n.º 4
0
 public static Int32 BlockChecksum(Byte[] buf, Int32 length)
 {
     return(MD4.Com_BlockChecksum(buf, length));
 }
Exemplo n.º 5
0
 private MD4(MD4 md) : this()
 {
     context = ( UInt32[])md.context.Clone();
     buffer  = (byte[])md.buffer.Clone();
     count   = md.count;
 }