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

Allow Flexible Padding Scheme Options #40

Open
HLRichardson-Git opened this issue Nov 13, 2024 · 0 comments
Open

Allow Flexible Padding Scheme Options #40

HLRichardson-Git opened this issue Nov 13, 2024 · 0 comments
Labels
good first issue Good for newcomers
Milestone

Comments

@HLRichardson-Git
Copy link
Owner

HLRichardson-Git commented Nov 13, 2024

Currently, the padding scheme parameters for RSA (such as OAEPParams and PSSParams) are fixed in the constructors. However, it would be useful to allow users to specify the padding scheme parameters (e.g., hash functions, MGF functions, optional labels, etc.) in a more flexible manner. This would make it easier to work with different padding configurations, similar to how the Botan library handles this.

Desired Solution:

We should implement a more flexible constructor for the OAEPParams and PSSParams classes, allowing users to specify the parameters in a way that is closer to how Botan handles padding schemes. Specifically, users should be able to pass parameters like:

<HashFunction>
<HashFunction>, MGF1
<HashFunction>, MGF1, <optional label>
<HashFunction>, MGF1, <optional label>, <optional seed>
<HashFunction>, MGF1(<HashFunction>)
<HashFunction>, MGF1(<HashFunction>), <optional label>
<HashFunction>, MGF1(<HashFunction>), <optional label>, <optional seed>
This would allow more granular control over the padding scheme configuration when constructing the parameters for OAEP and PSS.

Usage Example:

OAEPParams oaepParams(HashAlgorithm::SHA256, RSA_MGFFunctions::MGF1);  // Specify hash and MGF function
OAEPParams oaepParams(HashAlgorithm::SHA256, RSA_MGFFunctions::MGF1, "myLabel");  // Include optional label
OAEPParams oaepParams(HashAlgorithm::SHA256, RSA_MGFFunctions::MGF1, HashAlgorithm::SHA512);  // Custom MGF1 hash
@HLRichardson-Git HLRichardson-Git added the good first issue Good for newcomers label Nov 13, 2024
@HLRichardson-Git HLRichardson-Git added this to the Gestalt 0.7.1 milestone Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant