Skip to content

Add Curve448#425

Draft
twiss wants to merge 1 commit into
mainfrom
curve448
Draft

Add Curve448#425
twiss wants to merge 1 commit into
mainfrom
curve448

Conversation

@twiss

@twiss twiss commented Jan 28, 2026

Copy link
Copy Markdown
Member

This is not intended to be merged now, but rather to have a placeholder for the code and discussion after we archive https://github.com/WICG/webcrypto-secure-curves/ (and until we have sufficient implementer support to merge it here).


Preview | Diff

@tete17 tete17 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread spec/Overview.html
</li>
<li>
<p>
If the [= length in bits =] of |data| is not 448 then [= exception/throw =] a {{DataError}}.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
If the [= length in bits =] of |data| is not 448 then [= exception/throw =] a {{DataError}}.
If the [= length in bits =] of |data| is not 456 then [= exception/throw =] a {{DataError}}.

Ref: https://www.rfc-editor.org/rfc/rfc8032#section-5.2.5

Comment thread spec/Overview.html
</li>
<li>
<p>
If the [= length in bits =] of |data| is not 448 then [= exception/throw =] a {{DataError}}.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
If the [= length in bits =] of |data| is not 448 then [= exception/throw =] a {{DataError}}.
If the [= length in bits =] of |data| is not 456 then [= exception/throw =] a {{DataError}}.

Ref: https://www.rfc-editor.org/rfc/rfc8032#section-5.2.5

tete17 added a commit to tete17/ladybird that referenced this pull request Apr 12, 2026
Ed448 public keys are 57 bytes (456 bits), not 56 bytes (448 bits).
The curve is named "Ed448" after its 448-bit prime field, but per
RFC 8032 Section 5.2.5, the parameter b=456 and both private and
public keys are 57 bytes. This caused importKey to reject valid raw
Ed448 public keys with a DataError.

Note: The spec incorrectly says "not 448" for this check.
See w3c/webcrypto#425 (comment)
tete17 added a commit to tete17/ladybird that referenced this pull request Apr 13, 2026
Ed448 public keys are 57 bytes (456 bits), not 56 bytes (448 bits).
The curve is named "Ed448" after its 448-bit prime field, but per
RFC 8032 Section 5.2.5, the parameter b=456 and both private and
public keys are 57 bytes. This caused importKey to reject valid raw
Ed448 public keys with a DataError.

Note: The spec incorrectly says "not 448" for this check.
See w3c/webcrypto#425 (comment)
tete17 added a commit to tete17/ladybird that referenced this pull request Apr 13, 2026
Ed448 public keys are 57 bytes (456 bits), not 56 bytes (448 bits).
The curve is named "Ed448" after its 448-bit prime field, but per
RFC 8032 Section 5.2.5, the parameter b=456 and both private and
public keys are 57 bytes. This caused importKey to reject valid raw
Ed448 public keys with a DataError.

Note: The spec incorrectly says "not 448" for this check.
See w3c/webcrypto#425 (comment)
tete17 added a commit to tete17/ladybird that referenced this pull request Apr 17, 2026
Ed448 public keys are 57 bytes (456 bits), not 56 bytes (448 bits).
The curve is named "Ed448" after its 448-bit prime field, but per
RFC 8032 Section 5.2.5, the parameter b=456 and both private and
public keys are 57 bytes. This caused importKey to reject valid raw
Ed448 public keys with a DataError.

Note: The spec incorrectly says "not 448" for this check.
See w3c/webcrypto#425 (comment)
gmta pushed a commit to LadybirdBrowser/ladybird that referenced this pull request Apr 19, 2026
Ed448 public keys are 57 bytes (456 bits), not 56 bytes (448 bits).
The curve is named "Ed448" after its 448-bit prime field, but per
RFC 8032 Section 5.2.5, the parameter b=456 and both private and
public keys are 57 bytes. This caused importKey to reject valid raw
Ed448 public keys with a DataError.

Note: The spec incorrectly says "not 448" for this check.
See w3c/webcrypto#425 (comment)

@kkoyung kkoyung left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The conversions are done by step 11 of the generateKey method (https://w3c.github.io/webcrypto/#SubtleCrypto-method-generateKey), and step 10 of the exportKey method (https://w3c.github.io/webcrypto/#SubtleCrypto-method-exportKey).

Comment thread spec/Overview.html
Comment on lines +12810 to +12813
Let |result| be a new {{ArrayBuffer}} associated with the
[= relevant global object =]
of `this` [[HTML]], and containing
|data|.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Let |result| be a new {{ArrayBuffer}} associated with the
[= relevant global object =]
of `this` [[HTML]], and containing
|data|.
Let |result| be the result of DER-encoding |data|.

Comment thread spec/Overview.html
Comment on lines +12866 to +12869
Let |result| be a new {{ArrayBuffer}} associated with the
[= relevant global object =]
of `this` [[HTML]], and containing
|data|.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Let |result| be a new {{ArrayBuffer}} associated with the
[= relevant global object =]
of `this` [[HTML]], and containing
|data|.
Let |result| be the result of DER-encoding |data|.

Comment thread spec/Overview.html
Comment on lines +12932 to +12933
Let |result| be the result of converting |jwk|
to an ECMAScript Object, as defined by [[WebIDL]].

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Let |result| be the result of converting |jwk|
to an ECMAScript Object, as defined by [[WebIDL]].
Let |result| be |jwk|.

Comment thread spec/Overview.html
Comment on lines +12958 to +12960
Let |result| be a new {{ArrayBuffer}} associated with the
[= relevant global object =]
of `this` [[HTML]], and containing

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Let |result| be a new {{ArrayBuffer}} associated with the
[= relevant global object =]
of `this` [[HTML]], and containing
Let |result| be the result of DER-encoding |data|.

Comment thread spec/Overview.html
Comment on lines +13222 to +13223
Return the result of converting |result| to an ECMAScript Object, as
defined by [[WebIDL]].

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Return the result of converting |result| to an ECMAScript Object, as
defined by [[WebIDL]].
Return |result|.

Comment thread spec/Overview.html
Comment on lines +13678 to +13681
Let |result| be a new {{ArrayBuffer}} associated with the
[= relevant global object =]
of `this` [[HTML]], and containing
|data|.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Let |result| be a new {{ArrayBuffer}} associated with the
[= relevant global object =]
of `this` [[HTML]], and containing
|data|.
Let |result| be the result of DER-encoding |data|.

Comment thread spec/Overview.html
Comment on lines +13734 to +13737
Let |result| be a new {{ArrayBuffer}} associated with the
[= relevant global object =]
of `this` [[HTML]], and containing
|data|.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Let |result| be a new {{ArrayBuffer}} associated with the
[= relevant global object =]
of `this` [[HTML]], and containing
|data|.
Let |result| be the result of DER-encoding |data|.

Comment thread spec/Overview.html
Comment on lines +13820 to +13823
Let |result| be a new {{ArrayBuffer}} associated with the
[= relevant global object =]
of `this` [[HTML]], and containing
|data|.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Let |result| be a new {{ArrayBuffer}} associated with the
[= relevant global object =]
of `this` [[HTML]], and containing
|data|.
Let |result| be |data|.

Comment thread spec/Overview.html
<li>
<p>
Return the result of converting |result| to an ECMAScript Object, as
defined by [[WebIDL]].

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
defined by [[WebIDL]].
Return |result|.

Comment thread spec/Overview.html
Comment on lines +13794 to +13795
Let |result| be the result of converting |jwk|
to an ECMAScript Object, as defined by [[WebIDL]].

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Let |result| be the result of converting |jwk|
to an ECMAScript Object, as defined by [[WebIDL]].
Let |result| be |jwk|.

@kkoyung

kkoyung commented Jul 9, 2026

Copy link
Copy Markdown

Servo has implemented both Ed448 and X448 recently. servo/servo#46140

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