void init_random() { x = secure_rand(); while (!(y = secure_rand())); /* y must not be zero! */ z = secure_rand(); /* We don’t really need to set c as well but let's anyway… */ /* NOTE: offset c by 1 to avoid z=c=0 */ c = secure_rand() % 698769068 + 1; /* Should be less than 698769069 */ }
PointRef create_key(CurveRef curve, mpz_t& outA) { gmp_printf("%Zd\n", curve->n); secure_rand(outA, curve->n); return PointCreateMultiple(curve->g, outA, curve); }