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

Signature support: ECDSA and Ed25519 #17

Merged
merged 1 commit into from
Oct 9, 2020
Merged

Signature support: ECDSA and Ed25519 #17

merged 1 commit into from
Oct 9, 2020

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Oct 9, 2020

Adds a toplevel signature module with ecdsa and ed25519 submodules.

Adds a toplevel `signature` module with `ecdsa` and `ed25519`
submodules.
const TEST_VECTORS: &[TestVector] = &[
TestVector {
sk: b"\x9D\x61\xB1\x9D\xEF\xFD\x5A\x60\xBA\x84\x4A\xF4\x92\xEC\x2C\xC4\x44\x49\xC5\x69\x7B\x32\x69\x19\x70\x3B\xAC\x03\x1C\xAE\x7F\x60",
pk: b"\xD7\x5A\x98\x01\x82\xB1\x0A\xB7\xD5\x4B\xFE\xD3\xC9\x64\x07\x3A\x0E\xE1\x72\xF3\xDA\xA6\x23\x25\xAF\x02\x1A\x68\xF7\x07\x51\x1A",
Copy link
Member

Choose a reason for hiding this comment

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

Use hex-literal to make these vectors more compact?

Copy link
Member Author

Choose a reason for hiding this comment

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

@newpavlov yeah, can do that. might do it in a follow-up (this was just the most convenient form to copy/paste them in)

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually it's a bit tricky, since they're differently-sized...

Copy link
Member

Choose a reason for hiding this comment

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

IIRC &hex!("0123")[..] should do the job.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah that should be fine. I guess on 1.47.0+ we can do .as_ref()?

Copy link
Member

Choose a reason for hiding this comment

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

Probably, yes.

@tarcieri tarcieri merged commit 2d78815 into master Oct 9, 2020
@tarcieri tarcieri deleted the signatures branch October 9, 2020 16:01
@tarcieri tarcieri mentioned this pull request Oct 9, 2020
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

2 participants