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

Add function for pub key extraction #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wusto
Copy link

@wusto wusto commented Dec 16, 2022

There was no function to retreive the public key from the private key.

This change adds this functionality and a test for it.

There was no function to retreive the public key from the private key.

This change adds this functionality and a test for it.
wusto added a commit to bmwcarit/MoCOCrW that referenced this pull request Jan 11, 2023
This commit adds dilithium as algorithm for signing and verification.

As openssl is not supporting dilithium at the moment, the reference
implementation from the NIST PQC is used (see
https://github.com/pq-crystals/dilithium/).

The crystalls dilithium libraries without avx support are used.

The current version of MoCOCrW uses a EVP_PKEY centric implementation
for asymmetric cryptographic operations. To avoid changes on the
existing classes the relevant classes are cloned for dilithium.

Functionality is added or removed wherever necessary. But the changes
were done with the plan in mind, to be able to change back to the
EVP_PKEY centric implementation once openssl supports dilithium.

The new dilithium feature is OPTIONAL.
To compile MoCOCrW with dilithium support specify -DDILITHIUM_ENABLED
when invoking cmake.
You have to make sure, that the static libraries created by libdilithium
(https://github.com/pq-crystals/dilithium) can be found the linker.
Additionally the compiler needs access to "api.h" from libdilithium.

To be compliant to the current implementation an additional function to 
retrieve the public key from the private key for dilithium is added to 
libdilithium (pq-crystals/dilithium#68). This one is
required for compilation.

If you have problems compiling and installing libdillithium there is another
PR which enhances cmake for libdilithium 
(pq-crystals/dilithium#69).

The following openssl functions are required for the implementation and were
consequently added:
* d2i_X509_PUBKEY (reading ASN.1 pubkey structures)
* X509_PUBKEY_free (freeing the memory)
* ASN1_INTEGER_get_int64 (modern function for ASN1_INTEGER_get)
* d2i_PKCS8_PRIV_KEY_INFO (reading RFC 5958 DER data)
* PKCS8_PRIV_KEY_INFO_free (free it)
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.

None yet

1 participant