Skip to content

Add HPKE benchmarks#434

Merged
bwesterb merged 1 commit intomainfrom
caw/hpke-benchmarks
May 1, 2023
Merged

Add HPKE benchmarks#434
bwesterb merged 1 commit intomainfrom
caw/hpke-benchmarks

Conversation

@chris-wood
Copy link
Contributor

@chris-wood chris-wood commented May 1, 2023

These benchmarks let one quickly compare the cost difference between two different HPKE ciphersuites (KEM, KDF, AEAD).

Here's a sample of the output when running the benchmarks (go test -bench=.) in the HPKE directory:

✗ go test -bench=.
goos: darwin
goarch: arm64
pkg: github.com/cloudflare/circl/hpke
BenchmarkHpkeRoundTrip/SetupSender-0020-0001-0001-10         	   18325	     65444 ns/op
BenchmarkHpkeRoundTrip/SetupReceiver-0020-0001-0001-10       	   28868	     41394 ns/op
BenchmarkHpkeRoundTrip/Encrypt-0020-0001-0001-10             	14436075	        84.96 ns/op
BenchmarkHpkeRoundTrip/Decrypt-0020-0001-0001-10             	14667714	        83.58 ns/op
BenchmarkHpkeRoundTrip/SetupSender-0030-0001-0001-10         	   13032	     91840 ns/op
BenchmarkHpkeRoundTrip/SetupReceiver-0030-0001-0001-10       	   15948	     75430 ns/op
BenchmarkHpkeRoundTrip/Encrypt-0030-0001-0001-10             	14285422	        83.86 ns/op
BenchmarkHpkeRoundTrip/Decrypt-0030-0001-0001-10             	14927398	        83.00 ns/op
PASS
ok  	github.com/cloudflare/circl/hpke	16.127s

@chris-wood chris-wood requested review from armfazh and bwesterb May 1, 2023 15:55
These benchmarks let one quickly compare the cost difference between two different
HPKE ciphersuites (KEM, KDF, AEAD).
@chris-wood chris-wood force-pushed the caw/hpke-benchmarks branch from da7d9b5 to 2a1ecfe Compare May 1, 2023 16:00
Copy link
Member

@bwesterb bwesterb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit ad hoc, but fine by me.

@chris-wood
Copy link
Contributor Author

Bit ad hoc, but fine by me.

Is there a better approach we should take?

@bwesterb bwesterb merged commit 4002baf into main May 1, 2023
@bwesterb bwesterb deleted the caw/hpke-benchmarks branch May 1, 2023 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants