-
Notifications
You must be signed in to change notification settings - Fork 325
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
Implement Secure Curves API #500
Conversation
for (kj::byte b : sharedSecret) { | ||
isNonZeroSecret |= b; | ||
} | ||
JSG_REQUIRE(isNonZeroSecret == 0, DOMOperationError, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition seems odd to me at first sight. It seems to me that isNonZeroSecret == 0
if and only if all bytes of sharedSecret
are 0, so shouldn't this assertion be negated? (I haven't looked at this codebase or the spec in a long time so I might be missing something.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, the assertion is wrong here – I'll take care of this on Monday
The identifier
Because this appears in the public facing messages, i'm seeing this being referred to as EdDH for the first time. |
Yeah, our backwards compat requirements, however, mean that we'll be keeping it around indefinitely. |
Perhaps just
Perfectly fine with me.
Not necessary. I think what you have here is fine. |
df9940b
to
dfa930a
Compare
dfa930a
to
7a842a4
Compare
7a842a4
to
a479395
Compare
a479395
to
c9e5174
Compare
- Accept `Ed25519` algorithm (supported as of cloudflare/workerd#500) - Return `Ed25519` as the algorithm for `NODE-ED25519` keys - Mark `X448` and `Ed448` algorithms as unsupported This passes Miniflare's test suite on Node 16.13.0 and 20.1.0. It also passes `panva/jose`'s `workerd` tap tests on Node 16.17.0 and 20.1.0. Some of those tests fail on 16.13.0 as support for the `X25519` algorithm was only added in 16.17.0. See https://nodejs.org/api/webcrypto.html#web-crypto-api for details.
This patch implements the Web Crypto Secure Curves X25519 and Ed25519.
Caveats/Potential issues:
EdDsaKey
now that it's shared between both Eddsa and Eddh?kj::OneOf<KeyAlgorithm, EllipticKeyAlgorithm >
– I wanted to avoid breaking the JSG integration for now