Skip to content

Commit

Permalink
Count generateKeyPair in benchmark time in serverSharedSecretDerivati…
Browse files Browse the repository at this point in the history
…onBench

Summary: In `serverSharedSecretDerivationBench`, move generateKeyPair out of `BENCHMARK_SUSPEND` block  so that it is also counted in the server operation time.

Reviewed By: AjanthanAsogamoorthy

Differential Revision: D49969436

fbshipit-source-id: a6b5dbf6416cb9caf18ce172afe4e6fbad296d0a
  • Loading branch information
Jolene Tan authored and facebook-github-bot committed Oct 6, 2023
1 parent fff6d9d commit f4aa9d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fizz/experimental/protocol/test/HybridKeyExchangeBench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ void serverSharedSecretDerivationBench(uint64_t n, NamedGroup namedGroup) {
BENCHMARK_SUSPEND {
auto f = std::make_unique<HybridKeyExFactory>();
kex = f->makeKeyExchange(namedGroup, Factory::KeyExchangeMode::Server);
kex->generateKeyPair();
for (uint64_t i = 0; i < n; i++) {
auto fakeClientKex =
f->makeKeyExchange(namedGroup, Factory::KeyExchangeMode::Client);
Expand All @@ -53,6 +52,7 @@ void serverSharedSecretDerivationBench(uint64_t n, NamedGroup namedGroup) {
};
std::unique_ptr<folly::IOBuf> keyShare;
for (uint64_t i = 0; i < n; i++) {
kex->generateKeyPair();
keyShare = kex->generateSharedSecret(clientKeyShare[i]);
}
folly::doNotOptimizeAway(keyShare);
Expand Down

0 comments on commit f4aa9d3

Please sign in to comment.