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

Modernize Key Derivation Functions #4455

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

reneme
Copy link
Collaborator

@reneme reneme commented Dec 2, 2024

Introduces a private customization point in the KDF base class. Passes the parameters from the abstract (user-facing) interface as std::span wrappers. And, uses the latest convenience tools in the implementations of the KDFs.

Also, this introduces KDF::derive_key<length>(secret, salt, label) to conveniently obtain the key material as a std::array. And deprecates methods that take raw pointers in favor of the std::span/std::string_view based overloads.

This is a first step towards #4449.

@reneme reneme added this to the Botan 3.7.0 milestone Dec 2, 2024
@reneme reneme self-assigned this Dec 2, 2024
src/lib/kdf/sp800_108/sp800_108.cpp Outdated Show resolved Hide resolved
src/lib/kdf/sp800_108/sp800_108.cpp Outdated Show resolved Hide resolved
src/lib/kdf/sp800_108/sp800_108.cpp Outdated Show resolved Hide resolved
@reneme reneme force-pushed the feature/kdf_output branch from 550256c to 5e6c547 Compare December 2, 2024 16:44
@coveralls
Copy link

coveralls commented Dec 2, 2024

Coverage Status

coverage: 91.263%. remained the same
when pulling f57796e on Rohde-Schwarz:feature/kdf_output
into 21f230d on randombit:master.

@reneme reneme force-pushed the feature/kdf_output branch 2 times, most recently from 2ef851b to 378a62f Compare December 3, 2024 08:00
Copy link
Collaborator

@FAlbertDev FAlbertDev left a comment

Choose a reason for hiding this comment

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

LGTM 👍

src/lib/kdf/prf_x942/prf_x942.cpp Outdated Show resolved Hide resolved
@reneme reneme force-pushed the feature/kdf_output branch from 149cd0d to 2f9a4a2 Compare December 3, 2024 08:23
Pass the parameters from the abstract (user-facing) interface as
std::span_s and use the latest convenience tools in the implementations
of the KDFs.
@reneme reneme force-pushed the feature/kdf_output branch 2 times, most recently from 97c0fb4 to fbd9a7b Compare December 3, 2024 08:35
@reneme reneme force-pushed the feature/kdf_output branch from fbd9a7b to f57796e Compare December 3, 2024 14:08
@reneme
Copy link
Collaborator Author

reneme commented Dec 6, 2024

@randombit Does that mean you're fine with this change? 😅

image

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