Skip to content
New issue

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

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

Already on GitHub? # to your account

Inclusion of OSSL_LIB_CTX* in hybrid generation procedures #557

Open
RodriM11 opened this issue Oct 29, 2024 · 2 comments
Open

Inclusion of OSSL_LIB_CTX* in hybrid generation procedures #557

RodriM11 opened this issue Oct 29, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@RodriM11
Copy link

RodriM11 commented Oct 29, 2024

Hi! I wanted to propose a minor (but I think interesting) feature for the key generation, encapsulation and signature procedures, to ensure that the OSSL_LIB_CTX* context in which the provider is loaded is used within these three procedures. This would help ensure, for example, that whatever DRBG construction loaded into it is also used in these three probabilistic procedures (for the classical parts).

I am aware that an equivalent solution would be to ensure that the default NULL OSSL_LIB_CTX* context is established with the same DRBG as the libctx in which the provider is loaded, but this can be somewhat undesirable depending upon use, situation, etc... Meanwhile, I believe that this solution is fairly simple:

  • For Key Generation, the OSSL_LIB_CTX *libctx context received as parameter to the procedure ''oqsx_key_new'' would need to be propagated to the procedures oqsx_hybsig_init and oqshybkem_init_ecp/oqshybkem_init_ecx, for this context to then be used in the associated EVP_PKEY_CTX_new (to be modified to EVP_PKEY_CTX_new_from_pkey).
  • For Encapsulation, oqs_evp_kem_encaps_keyslot should be modified, to employ the OSSL_LIB_CTX* context inside pkemctx in the procedure EVP_PKEY_CTX_new_from_pkey (instead of EVP_PKEY_CTX_new).
  • For Sign, the procedure oqs_sig_sign should be expanded in a similar way to include the same libctx where appropiate.

Thanks in advance.

@RodriM11 RodriM11 added the question No code change required label Oct 29, 2024
@baentsch
Copy link
Member

Thanks for the proposal @RodriM11 ! This sounds like a sensible enhancement. Would you like to take a swing at contributing this via PR?

@baentsch baentsch added enhancement New feature or request good first issue Good for newcomers and removed question No code change required labels Oct 31, 2024
@RodriM11
Copy link
Author

Yes, sure. I will write it and PR it in the following days. Thanks in advance!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants