aws / aws-lc

AWS-LC is a general-purpose cryptographic library maintained by the AWS Cryptography team for AWS and their customers. It іs based on code from the Google BoringSSL project and the OpenSSL project.
Other
354 stars 111 forks source link

[PQ] Add experimental support for HPKE backed by AWS-LC KEMs #1777

Closed sgmenda-aws closed 1 month ago

sgmenda-aws commented 1 month ago

Description of changes:

Add experimental support for using AWS-LC KEMs from the hpke.h interface:

Call-outs:

I tried to unify the EVP_HPKE_KEM API and the existing KEM API, but they are incomparable. EVP_HPKE_KEM does length-checking and supports authentication (auth_encaps and auth_decaps methods), while KEM does not. One approach to unify would be to combine EVP_HPKE_KEM with the KEM portion of EVP_PKEY_METHOD (in p_kem.c), but that would have required a lot of refactoring and introduce lots of merge conflicts between this experimental branch and main. And even if we did all that refactoring, it would only be slightly cleaner to look at, not significantly improve performance or maintainability.

Testing:

HPKETest is updated to test correctness with the new added KEMs and to test the newly added single-shot and find_by_id APIs.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 75.58685% with 52 lines in your changes missing coverage. Please review.

Project coverage is 78.33%. Comparing base (1d0fb39) to head (e4d7872).

Files Patch % Lines
crypto/hpke/hpke.c 65.75% 50 Missing :warning:
crypto/hpke/hpke_test.cc 97.01% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## experimental-pq-hybrid #1777 +/- ## ======================================================== Coverage 78.32% 78.33% ======================================================== Files 581 581 Lines 96833 97002 +169 Branches 13850 13875 +25 ======================================================== + Hits 75847 75987 +140 - Misses 20372 20402 +30 + Partials 614 613 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.