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

Fix curve25519 endianness #89

Merged
merged 3 commits into from
Nov 18, 2022
Merged

Conversation

sosthene-nitrokey
Copy link
Collaborator

GPG doesn't exactly implement X25519, because it stores ECC scalars in Big-Endian format when the standardised X25519 operates with little endian scalars Therfore we need to reverse the endianness of the private key on key import.

This also highlight that the gpg-import test for X25519 was incorrect because the key import failed silently

Closes #84

GPG doesn't exactly implement X25519, because it stores ECC scalars in
Big-Endian format when the standardised X25519 operates with little endian scalars
Therfore we need to reverse the endianness of the private key on key import.

This also highlight that the gpg-import test for X25519 was incorrect because
the key import failed silently
@sosthene-nitrokey
Copy link
Collaborator Author

Thanks @hko-s and @wiktor-k for help finding the bug and the fix!

@wiktor-k
Copy link

No problem, happy to help! 👍

Very cool to see you working on that and also using Trussed... What a time to be alive! 🥳

Have a nice day! 👋

@runcom
Copy link

runcom commented Oct 24, 2022

is there any way for me to build and test this on my nk3m? :) (instructions mainly)

Copy link
Member

@robin-nitrokey robin-nitrokey left a comment

Choose a reason for hiding this comment

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

What a nasty issue, thanks for the fix!

CHANGELOG.md Outdated Show resolved Hide resolved
@robin-nitrokey
Copy link
Member

@runcom We plan to release a new alpha version probably next week. If you want to give it a try with a virtualized smartcard instead of the hardware, you can install the build dependencies (currently being added in #88) and run the virtual example with cargo run --features virtual --example virtual.

@sosthene-nitrokey sosthene-nitrokey merged commit 56c4620 into main Nov 18, 2022
@sosthene-nitrokey sosthene-nitrokey deleted the fix-curve25519-endianess branch November 18, 2022 09:11
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.

cv25519 encryption key doesn't show as moved to card
4 participants