Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            BigInteger p = new BigInteger("6277101735386680763835789423207666416083908700390324961279", 10);
            BigInteger a = new BigInteger("-3", 10);
            BigInteger b = new BigInteger("64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1", 16);

            byte[]     xG = FromHexStringToByte("03188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012");
            BigInteger n  = new BigInteger("ffffffffffffffffffffffff99def836146bc9b1b4d22831", 16);
            DSGost     DS = new DSGost(p, a, b, n, xG);

            d = DS.GenPrivateKey(192);
            Q = DS.GenPublicKey(d);
            GOST hash = new GOST(256);

            byte[] H      = hash.GetHash(Encoding.Default.GetBytes("Message"));
            string sign   = DS.SingGen(H, d);
            bool   result = DS.SingVer(H, sign, Q);
        }