bool Test_GenerateGroupParams() { uint32_t pLen = 1024, qLen = 256, count; IntegerGroupParams group; for (count = 0; count < 1; count++) { try { group = deriveIntegerGroupParams(calculateSeed(GetTestModulus(), "test", ZEROCOIN_DEFAULT_SECURITYLEVEL, "TEST GROUP"), pLen, qLen); } catch (std::runtime_error e) { cout << "Caught exception " << e.what() << endl; return false; } // Now perform some simple tests on the resulting parameters if (group.groupOrder.bitSize() < qLen || group.modulus.bitSize() < pLen) { return false; } Bignum c = group.g.pow_mod(group.groupOrder, group.modulus); //cout << "g^q mod p = " << c << endl; if (!(c.isOne())) return false; // Try at multiple parameter sizes pLen = pLen * 1.5; qLen = qLen * 1.5; } return true; }