-
Notifications
You must be signed in to change notification settings - Fork 1
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
[1/3] Implement the generateKey
operation with support for HMAC algorithm
#35
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mstoykov
approved these changes
Mar 30, 2023
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.
LGTM!
did leave some comments that are not blocking
oleiade
force-pushed
the
feature/generateKey-hmac
branch
2 times, most recently
from
March 30, 2023 15:09
135f983
to
4f79696
Compare
oleiade
changed the title
Add support for the HMAC algorithm to the
[1/3] Implement the Mar 30, 2023
subtle.crypto.generateKey
operation generateKey
operation with support for HMAC algorithm
codebien
approved these changes
Mar 31, 2023
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.
Mostly LGTM, the null dependency should be addressed the rest are minor.
oleiade
force-pushed
the
feature/generateKey-hmac
branch
from
March 31, 2023 08:37
4f79696
to
0360eb2
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this?
This Pull Request adds support for the HMAC algorithm to the
subtle.crypto.generateKey
operation.Our plan moving forward is to go breadth first, and implement as much of the WebCrypto API's surface, and only later to add support for more algorithms. As a result this PR comes in with the intention to support the ability to implement the
sign
andverify
operations to the module.Just like with
encrypt
anddecrypt
, thesign
andverify
operations test suite rely on the ability to import and export a key of a support algorithm. As a result to supportsign
andverify
with a scope reduced to the HMAC algorithm, we need to implementimportKey
andexportKey
first.As
generateKey
laid a good base foundation for implementingimportKey
andexportKey
efficiently with AES support, I decided to once again start with that operation for HMAC.Because this is the first algorithm past the AES family currently supported, it led to a few valuable redesigns of how the
SubtleCrypto.GenerateKey
method works at the moment:KeyGenerator
interface to be able to transparently generate a key, without having to resort to much preparation in theSubtleCrypto.GenerateKey
method itself, making us even closer to the specification.