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

use only public part to test key encapsulation #571

Open
petrovr opened this issue Nov 19, 2024 · 3 comments
Open

use only public part to test key encapsulation #571

petrovr opened this issue Nov 19, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@petrovr
Copy link

petrovr commented Nov 19, 2024

Current oqs tests use one and the same context based on private key to test "encapsulate" and "decapsulate".

I would like to request encapsulate test to be based on key context based only on public part.

@petrovr petrovr added the question No code change required label Nov 19, 2024
@baentsch
Copy link
Member

Please point to the code/test locations you don't find right as well as the spec mandating different behaviour so we could treat this as a bug. Also welcome would be a PR fixing this suitably.

@petrovr
Copy link
Author

petrovr commented Nov 22, 2024

It is related to #572.

Goal is to test de-serialisation and serialisation of public key as well.


In brief oqs_test_kems.c to use something closed to real use.

/* public context */
EVP_PKEY_get_octet_string_param(key, OSSL_PKEY_PARAM_PUB_KEY, ...
...
pubk = EVP_PKEY_new_raw_public_key_ex(...., KEMALG_NAME, ....);
...
ctx = EVP_PKEY_CTX_new_from_pkey(..., pubk, ...);
...
EVP_PKEY_encapsulate...(ctx, ...
/* private context */
ctx = EVP_PKEY_CTX_new_from_pkey(..., key, ...)
...
EVP_PKEY_decapsulate...(ctx, ...

@baentsch
Copy link
Member

Understood. Would you be willing to contribute this via PR, @petrovr ?

@baentsch baentsch added enhancement New feature or request help wanted Extra attention is needed and removed question No code change required labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants