Skip to content

Build an EC public point from a private scalar - #78

Open
OskarEichler wants to merge 1 commit into
cedarcode:masterfrom
OskarEichler:codex/ec2-private-key
Open

OskarEichler wants to merge 1 commit into
cedarcode:masterfrom
OskarEichler:codex/ec2-private-key

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Derives the public point from the private scalar when an EC2 key contains d but omits x and y, allowing valid private-only COSE keys to produce an OpenSSL key.

Verified with 86 upstream examples plus focused EC2 round-trip and WebAuthn integration models.

@santiagorodriguez96

Copy link
Copy Markdown
Contributor

Thanks for this!

Could you add a regression test? spec/cose/key/ec2_spec.rb already builds private-only keys (in .new and #serialize) and already exercises #to_pkey, but never crosses the two – which is how this slipped through.

This branch has not been deployed

No deployments
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.

COSE::Key::EC2#to_pkey raises NoMethodError for a key that has d but no x and y

2 participants