Conversation
| </li> | ||
| <li> | ||
| <p> | ||
| If the [= length in bits =] of |data| is not 448 then [= exception/throw =] a {{DataError}}. |
There was a problem hiding this comment.
| 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}}. |
| </li> | ||
| <li> | ||
| <p> | ||
| If the [= length in bits =] of |data| is not 448 then [= exception/throw =] a {{DataError}}. |
There was a problem hiding this comment.
| 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}}. |
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)
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)
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)
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)
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
left a comment
There was a problem hiding this comment.
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).
| Let |result| be a new {{ArrayBuffer}} associated with the | ||
| [= relevant global object =] | ||
| of `this` [[HTML]], and containing | ||
| |data|. |
There was a problem hiding this comment.
| 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|. |
| Let |result| be a new {{ArrayBuffer}} associated with the | ||
| [= relevant global object =] | ||
| of `this` [[HTML]], and containing | ||
| |data|. |
There was a problem hiding this comment.
| 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|. |
| Let |result| be the result of converting |jwk| | ||
| to an ECMAScript Object, as defined by [[WebIDL]]. |
There was a problem hiding this comment.
| Let |result| be the result of converting |jwk| | |
| to an ECMAScript Object, as defined by [[WebIDL]]. | |
| Let |result| be |jwk|. |
| Let |result| be a new {{ArrayBuffer}} associated with the | ||
| [= relevant global object =] | ||
| of `this` [[HTML]], and containing |
There was a problem hiding this comment.
| 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|. |
| Return the result of converting |result| to an ECMAScript Object, as | ||
| defined by [[WebIDL]]. |
There was a problem hiding this comment.
| Return the result of converting |result| to an ECMAScript Object, as | |
| defined by [[WebIDL]]. | |
| Return |result|. |
| Let |result| be a new {{ArrayBuffer}} associated with the | ||
| [= relevant global object =] | ||
| of `this` [[HTML]], and containing | ||
| |data|. |
There was a problem hiding this comment.
| 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|. |
| Let |result| be a new {{ArrayBuffer}} associated with the | ||
| [= relevant global object =] | ||
| of `this` [[HTML]], and containing | ||
| |data|. |
There was a problem hiding this comment.
| 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|. |
| Let |result| be a new {{ArrayBuffer}} associated with the | ||
| [= relevant global object =] | ||
| of `this` [[HTML]], and containing | ||
| |data|. |
There was a problem hiding this comment.
| Let |result| be a new {{ArrayBuffer}} associated with the | |
| [= relevant global object =] | |
| of `this` [[HTML]], and containing | |
| |data|. | |
| Let |result| be |data|. |
| <li> | ||
| <p> | ||
| Return the result of converting |result| to an ECMAScript Object, as | ||
| defined by [[WebIDL]]. |
There was a problem hiding this comment.
| defined by [[WebIDL]]. | |
| Return |result|. |
| Let |result| be the result of converting |jwk| | ||
| to an ECMAScript Object, as defined by [[WebIDL]]. |
There was a problem hiding this comment.
| Let |result| be the result of converting |jwk| | |
| to an ECMAScript Object, as defined by [[WebIDL]]. | |
| Let |result| be |jwk|. |
|
Servo has implemented both Ed448 and X448 recently. servo/servo#46140 |
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