public AnLibSM3(AnLibSM3 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); }
public static string SM3Encrypt(string content) { byte[] md = new byte[32]; byte[] msg = Encoding.UTF8.GetBytes(content); AnLibSM3 sm3 = new AnLibSM3(); sm3.BlockUpdate(msg, 0, msg.Length); sm3.DoFinal(md, 0); System.String s = new UTF8Encoding().GetString(Hex.Encode(md)); System.Console.Out.WriteLine(s.ToUpper()); Console.ReadLine(); return(s.ToUpper()); }