-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
script: Implement derive bits operation of ECDH #40333
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
Conversation
| let secret_length = secret.len(); | ||
| secret[secret_length - 1] &= mask; | ||
| } | ||
| Ok(secret[..length.div_ceil(8) as usize].to_vec()) |
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.
nit: This be de-duplicated from the previous occurrence.
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.
Nice catch. The resizing of secret at L267 is redundant since it has been done before.
jdm
left a comment
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 looks fine, but I'd like to understand the remaining test failure.
| [P-521 mismatched curves] | ||
| expected: FAIL | ||
|
|
||
| [P-521 public property of algorithm is not an ECDSA public key] |
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.
Why do we still fail this subtest?
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 test tries to derive a key with an ECDSA public key rather than an ECDH public key, and expects step 4 throw an InvalidAccessError. However, we have not yet implemented key import operation of ECDSA, so this test cannot reach step 4 to get an InvalidAccessError.
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
16ca840 to
bf76e79
Compare
|
I rebased on the main branch, and added the CanGc argument introduced in recent PR #40404 |
Finish adding ECDH support to WebCrypto API. This patch implements derive bits operation of ECDH.
Testing: Pass some WPT tests that were expected to fail.
Fixes: Part of #39060