| 130 | } |
| 131 | |
| 132 | void BenchMarkKeyGen(const char *name, SimpleKeyAgreementDomain &d, double timeTotal, bool pc=false) |
| 133 | { |
| 134 | SecByteBlock priv(d.PrivateKeyLength()), pub(d.PublicKeyLength()); |
| 135 | |
| 136 | const clock_t start = clock(); |
| 137 | unsigned int i; |
| 138 | double timeTaken; |
| 139 | for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++) |
| 140 | d.GenerateKeyPair(GlobalRNG(), priv, pub); |
| 141 | |
| 142 | OutputResultOperations(name, "Key-Pair Generation", pc, i, timeTaken); |
| 143 | |
| 144 | if (!pc && d.GetMaterial().SupportsPrecomputation()) |
| 145 | { |
| 146 | d.AccessMaterial().Precompute(16); |
| 147 | BenchMarkKeyGen(name, d, timeTotal, true); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | void BenchMarkKeyGen(const char *name, AuthenticatedKeyAgreementDomain &d, double timeTotal, bool pc=false) |
| 152 | { |
no test coverage detected