Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mbedtls based hkdf #17

Merged
merged 12 commits into from
Dec 13, 2023

Conversation

Taowyoo
Copy link
Collaborator

@Taowyoo Taowyoo commented Dec 8, 2023

Description

This PR adds HKDF implementation by using mbedtls functions.

From benchmarks, there is ~7% performance improvement:

$ RUSTFLAGS="--cfg=bench" cargo +nightly bench hkdf

running 2 tests
test tls13::benchmarks::bench_mbedtls_hkdf              ... bench:       3,275 ns/iter (+/- 43)
test tls13::benchmarks::bench_rustls_hkdf_mbedtls_hmac  ... bench:       3,050 ns/iter (+/- 44)

This PR also:

  • Upgrades mbedtls to 0.12.1
  • Bumps all crates version to 0.0.1

Note

This PR will fix #7

@Taowyoo Taowyoo added enhancement New feature or request dependencies Pull requests that update a dependency file labels Dec 8, 2023
@Taowyoo Taowyoo requested a review from s-arash December 8, 2023 00:57
@Taowyoo Taowyoo self-assigned this Dec 8, 2023
@Taowyoo Taowyoo linked an issue Dec 8, 2023 that may be closed by this pull request
Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (1efc8f6) 92.37% compared to head (92e89ca) 93.40%.

Files Patch % Lines
rustls-mbedcrypto-provider/src/tls13.rs 98.09% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #17      +/-   ##
==========================================
+ Coverage   92.37%   93.40%   +1.03%     
==========================================
  Files          16       16              
  Lines        1796     1956     +160     
==========================================
+ Hits         1659     1827     +168     
+ Misses        137      129       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Taowyoo Taowyoo marked this pull request as ready for review December 8, 2023 21:18
rustls-mbedcrypto-provider/src/hmac.rs Outdated Show resolved Hide resolved
rustls-mbedcrypto-provider/src/hmac.rs Show resolved Hide resolved
rustls-mbedcrypto-provider/src/tls13.rs Outdated Show resolved Hide resolved
rustls-mbedcrypto-provider/src/hmac.rs Outdated Show resolved Hide resolved
@Taowyoo Taowyoo requested a review from s-arash December 12, 2023 19:00
@Taowyoo
Copy link
Collaborator Author

Taowyoo commented Dec 12, 2023

The windows fix for rust-mbedtls seems actually not work. I am working on it at rust-mbedtls repo.

@Taowyoo
Copy link
Collaborator Author

Taowyoo commented Dec 12, 2023

Hi @s-arash , could you help approve this PR: fortanix/rust-mbedtls#337, so I could publish patch release of rust-mbedtls and use it in this branch.

@Taowyoo Taowyoo enabled auto-merge December 13, 2023 00:44
@Taowyoo Taowyoo added this pull request to the merge queue Dec 13, 2023
Merged via the queue into master with commit f9aed56 Dec 13, 2023
14 checks passed
@Taowyoo Taowyoo deleted the 7-improve-current-rustlscryptotls13hkdf-implementation branch December 13, 2023 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve current rustls::crypto::tls13::Hkdf implementation
2 participants