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 support for nist P384 and P521 curves, as well as the brainpool 256, 384 and 512 bit curves #207

Merged
merged 17 commits into from
Jul 30, 2024

Conversation

sosthene-nitrokey
Copy link
Collaborator

@sosthene-nitrokey sosthene-nitrokey commented Apr 19, 2024

@jans23
Copy link
Member

jans23 commented Jul 9, 2024

Does this support SE050?

@sosthene-nitrokey
Copy link
Collaborator Author

Yes. It fully works with the software implementation, but it also contains a workaround for an issue that comes with the SE050 implementation and private key import.

The other relevant PRs are:

Due to binary size constraints, we are going to only support these curves when the SE050 anyways on the NK3 firmware (at least until we make significant progress on that front).

@sosthene-nitrokey sosthene-nitrokey changed the title Add support for nist P384 and P521 curves Add support for nist P384 and P521 curves, as well as the brainpool 256, 384 and 512 bit curves Jul 16, 2024
@sosthene-nitrokey sosthene-nitrokey marked this pull request as ready for review July 17, 2024 14:21
There is no software implementation of these curves, so it is only tested with hardware tests.
This uses an arch linux docker image because:

Debian 12 does not have gnupg 2.4
Ubuntu 24.04 has it and vsmartcard but not cargo-tarpaulin. And building cargo-tarpaulin seems to always lead to a dynamic dependency on `libssl1.1.so` which is not available in the repos.

This is still not perfect. Building vsmartcard fails, so I'm just bundling a binary package...
src/card.rs Outdated
/// EdDsa25519
const ED_25519 = 1 << 7;
/// BRAINPOOL_P256R1 Brainpool curve
const BRAINPOOL_P256R1 = 1<<8;
Copy link
Contributor

Choose a reason for hiding this comment

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

tiny nit - cargo fmt doesn't catch this ?

Suggested change
const BRAINPOOL_P256R1 = 1<<8;
const BRAINPOOL_P256R1 = 1 << 8;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I suppose no because of the bitflags macro.

@sosthene-nitrokey sosthene-nitrokey merged commit 0c0f18b into main Jul 30, 2024
1 check was pending
@sosthene-nitrokey sosthene-nitrokey deleted the more-curves branch July 30, 2024 14:56
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