Commit Graph

34 Commits

Author SHA1 Message Date
Joseph Birr-Pixton f8cd4e82ec ci-bench: separately bench use of P384 curve
This renames the P256 cases, so will introduce a
discontinuity in results tracking.
2024-01-04 09:21:59 +00:00
Joseph Birr-Pixton 271c637bd9 Split test-ca ecdsa by curve; add p521
This goes from being a single set of keys for ECDSA (with a
purposeful mix of curves) to a set of keys per curve.

That means we can avoid P521 chains in tests when it is not supported.

In those tests, reflect this as additional `KeyType` variants.
2024-01-04 09:21:59 +00:00
Adolfo Ochagavía 371463d812 ci-bench: explain motivation for wall-time measurements in readme 2023-12-19 14:40:39 +00:00
Adolfo Ochagavía b245ffa3d1 bench: remove cachegrind diff post-processing
This code was meant to strip unnecessary information from the start of a
cachegrind diff. However, for some versions of cachegrind it results in
a completely blank string. Instead of making it work for all cachegrind
versions, it is probably better to get rid of it altogether (it does not
make enough of a difference that the complexity of a proper solution
would be worth it).
2023-12-18 14:03:52 +00:00
Adolfo Ochagavía 8e8436578b bench: remove split between significant / negligible in comparison
When running the comparison locally, we do not have access to past
results and are unable to categorize them as significant or negligible.
Instead of hardcoding a 0.2% threshold, we remove the threshold
altogether and tell users to rely on the CI when they are interested in
the significance of the results.
2023-12-18 14:03:18 +00:00
Jacob Hoffman-Andrews 0963cca28d update examples to use pki_types re-export
We now re-export the rustls-pki-types crate. I think that means
our preferred way for crates to consume pki-types is through the
re-exports.
2023-12-08 09:31:35 +00:00
Joseph Birr-Pixton 381dcf99ee Update dependencies 2023-12-01 19:10:46 +00:00
Daniel McCarney b92fd839e3 crypto: rework CryptoProvider as struct
This commit replaces the existing `CryptoProvider` trait with
a `CryptoProvider` struct. This has several advantages:

* it consolidates all of the cryptography related settings into one API
  surface, the `CryptoProvider` struct members. Previously the provider
  had methods to suggest default ciphersuites, key exchanges etc, but
  the builder API methods could override them in confusing ways.
* it allows removing the `WantsCipherSuites` and `WantsKxGroups` builder
  states - the "safe defaults" are automatically supplied by the choice
  of a crypto provider. Customization is achieved by overriding the
  provider's struct fields. Having fewer builder states makes the API
  easier to understand and document.
* it makes customization easier: the end user can rely on "struct update
  syntax"[0] to only specify fields values for the required
  customization, and defer the rest to an existing `CryptoProvider`.

Achieving this requires a couple of additional changes:

* The cipher suite and key exchange groups are now expressed as `Vec`
  elements. This avoids imposing a `&'static` lifetime that would
  preclude runtime customization (e.g. the tls*-mio examples that
  build the list of ciphersuites at runtime based on command line
  flags).
* As a result of the `Vec` members we can no longer offer the concrete
  `CryptoProvider`s as `static` members of their respective modules.
  Instead we add `pub fn default_provider() -> CryptoProvider` methods
  to the `ring` and `aws-lc-rs` module that construct the `CryptoProvider`
  with the safe defaults, ready for further customization.

[0]: https://doc.rust-lang.org/book/ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax
2023-11-30 15:53:39 +00:00
Joseph Birr-Pixton 0861d5fcd1 ci-bench: ignore-list aws-lc-rs RSA key validation 2023-11-30 15:03:11 +00:00
Dirkjan Ochtman ab5e2a917b Upgrade to latest rustls-pemfile 2023-11-23 21:57:10 +00:00
Adolfo Ochagavía c06979e2a8 ci-bench: remove unnecessary `black_box`
The usage of black box was originally introduced to to ensure the optimizer didn't take advantage of
knowing both the client and the server side of the configuration. However, in this case, the server
and the client run in different processes, so each side of the connection has no compile-time
information about the other side.
2023-11-23 17:09:09 +00:00
Adolfo Ochagavía c514132367 ci-bench: replace magic number with constant 2023-11-23 17:09:09 +00:00
Adolfo Ochagavía 34c6e205b6 ci-bench: simplify clap command 2023-11-23 17:09:09 +00:00
Adolfo Ochagavía 06f3dcf28c ci-bench: transfer more bytes to reduce noise 2023-11-23 17:09:09 +00:00
Adolfo Ochagavía c005236270 ci-bench: add wall-time mode 2023-11-23 17:09:09 +00:00
Adolfo Ochagavía 2463f99155 ci-bench: rewrite benchmarks in async style
This is a necessary step towards sharing code between icount and
wall-time benchmarks
2023-11-23 17:09:09 +00:00
Jorge Aparicio 0c556c03ab fix clippy warnings in ci-bench 2023-11-22 15:06:37 +00:00
Dirkjan Ochtman 765cfd214b ci-bench: update itertools to 0.12 2023-11-20 09:02:07 +00:00
Joseph Birr-Pixton 1379f12657 Enable testing and benchmarking with aws-lc-rs 2023-11-09 16:18:11 +00:00
Joseph Birr-Pixton 0e296980fd Move `rustls::cipher_suite` members into provider module
Naming cipher suites individually seems like a "detail" feature, and
therefore having to name the provider too is not a large imposition.

Naturally this is a breaking change.
2023-11-09 16:18:11 +00:00
Daniel McCarney e006e4ec23 ci-bench: StepperIO -> StepperIo
This commit renames the ci-bench `StepperIO` struct to be named
`StepperIo` to match Rust naming conventions.
2023-10-18 08:25:00 +00:00
Daniel McCarney 6b57e65f45 ci-bench: SessionID -> SessionId
Renames the `ResumptionKind::SessionID` variant to be `SessionId` to
match Rust naming conventions.
2023-10-18 08:25:00 +00:00
Adolfo Ochagavía 2dbae4995c ci-bench: save cachegrind logs 2023-10-10 09:57:49 +00:00
Daniel McCarney 76db9fb00f lib: remove crypto:💍:Ticketer re-export 2023-09-19 13:39:44 +00:00
Joseph Birr-Pixton 048ff10740 Use dynamic dispatch for `CryptoProvider`
Instead of the type `rustls::crypto:💍:Ring`, the value
`rustls::crypto:💍:RING` implements this, and is more
entertaining to write.

`ServerConfig::builder()` references this by default, and
is equivalent to `ServerConfig::builder_with_provider(crypto:💍:RING)`.
2023-09-19 11:09:38 +00:00
Joseph Birr-Pixton 237ba876bc ci-bench: reduce noise in cg_diff output
The diffs produced tend to be noisy here because two separate
compilations have different per-type and per-compilation uniqueness. eg:

```
 29,792 (124.8%)  ???:_ZN5alloc7raw_vec11finish_grow17h463b2c6f0ba30854E.llvm.2614985587368234107
-29,792 (-124.8%)  ???:_ZN5alloc7raw_vec11finish_grow17h463b2c6f0ba30854E.llvm.3375118279659775674
```

This diff line is here because some per-compilation unique value (after the '.llvm.') changed, not
because the instruction count changed.

We can chop these out by giving a regular expression to cg_diff.
2023-09-11 08:21:28 +00:00
Joseph Birr-Pixton c21eca793b Take latest webpki, pki-types, pemfile, webpki-roots 2023-09-07 15:46:48 +00:00
Adolfo Ochagavía 5b98394a61 Fix: create cg_diff tmp file at the cwd 2023-09-06 08:40:39 +00:00
Adolfo Ochagavía 8c914559f8 Show detailed icount diff for scenarios with noteworthy diffs 2023-09-05 13:34:27 +00:00
Dirkjan Ochtman c9a3974462 Switch to using pki-types crate 2023-09-05 13:20:21 +00:00
Adolfo Ochagavía e35a1bc22d Make ci-bench more deterministic
* Switch to unbuffered stdio
* Use FxHasher where possible
2023-09-05 09:40:50 +00:00
Adolfo Ochagavía 95cffd6d44 Run resumed handshakes 30x to filter out noise 2023-08-30 15:09:26 +00:00
Adolfo Ochagavía 5ed68a9293 Hook up icount benchmarks to CI 2023-08-30 15:09:26 +00:00
Adolfo Ochagavía 676df24f53 Implement CPU instruction benchmarks 2023-08-30 08:04:00 +00:00