Exemple #1
0
        public SM3(SM3 t) : base(t)
        {
            Array.Copy(t.X, 0, X, 0, t.X.Length);
            xOff = t.xOff;

            Array.Copy(t.v, 0, v, 0, t.v.Length);
        }
Exemple #2
0
        public static string GetSM3(string value)
        {
            byte[] md   = new byte[32];
            byte[] msg1 = Encoding.Default.GetBytes(value);
            SM3    sm3  = new SM3();

            sm3.BlockUpdate(msg1, 0, msg1.Length);
            sm3.DoFinal(md, 0);
            return(new UTF8Encoding().GetString(Hex.Encode(md)));
        }