Skip to content

script: Implement sign and verify operations of KMAC - #46622

Merged
TimvdLippe merged 1 commit into
servo:mainfrom
kkoyung:kmac-sign-verify
Jul 19, 2026
Merged

script: Implement sign and verify operations of KMAC#46622
TimvdLippe merged 1 commit into
servo:mainfrom
kkoyung:kmac-sign-verify

Conversation

@kkoyung

@kkoyung kkoyung commented Jul 19, 2026

Copy link
Copy Markdown
Member

Finalize the KMAC support in WebCrypto API implementation.

This patch implements the "sign" and "verify" operations of KMAC.

RustCrypto currently does not provide a dedicated crate for KMAC. Fortunately, we can build KMAC128 and KMAC256 from cSHAKE128 and cSHAKE256 supported by the cshake crate.

Specification:
https://wicg.github.io/webcrypto-modern-algos/#kmac-operations-sign
https://wicg.github.io/webcrypto-modern-algos/#kmac-operations-verify

Testing: Pass more WPT tests in WebCryptoAPI/sign_verify directory
Part-of: #46582

Finalize the KMAC support in WebCrypto API implementation.

This patch implements the "sign" and "verify" operations of KMAC.

RustCrypto currently does not provide a dedicated crate for KMAC.
Fortunately, we can build KMAC128 and KMAC256 from cSHAKE128 and
cSHAKE256 supported by the `cshake` crate.

Specification:
<https://wicg.github.io/webcrypto-modern-algos/#kmac-operations-sign>
<https://wicg.github.io/webcrypto-modern-algos/#kmac-operations-verify>

Testing: Pass more WPT tests in `WebCryptoAPI/sign_verify` directory
Part-of: 46582
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
@kkoyung
kkoyung requested a review from gterzian as a code owner July 19, 2026 03:46
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 19, 2026
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Jul 19, 2026
@TimvdLippe
TimvdLippe added this pull request to the merge queue Jul 19, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 19, 2026
Merged via the queue into servo:main with commit 64bc083 Jul 19, 2026
34 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 19, 2026
@servo-highfive

Copy link
Copy Markdown

Someone thinks this change could be added to the monthly blog post! To help with this, we need someone to answer the following questions: 😄

  1. Who is most impacted by this change: users, Servo developers, embedders, or some other group?
  2. What observable difference does this change make?
  3. What preferences (if any) need to be enabled to observe this difference?
  4. What (if any) specific URLs are affected?

If this change is part of a broader feature/project please make sure the PR description contains a Fixes: #12345 or Part of: #12345 issue reference.

Please add @servo-highfive monthly update answer when answering these questions so the bot notices your answer (or just quote this comment).

Thanks for helping us prepare the monthly blog post! ❤️

@kkoyung

kkoyung commented Jul 31, 2026

Copy link
Copy Markdown
Member Author

@servo-highfive monthly update answer

Combined with PRs #46583, #46606.
Tracked in issue #46582.

  1. Who is most impacted by this change: users, Servo developers, embedders, or some other group?
    Users and web developers.

  2. What observable difference does this change make?
    Our WebCrypto API now supports KMAC algorithms, with "sign", "verify", "generateKey", "importKey", "exportKey", "get key length" operations.

  3. What preferences (if any) need to be enabled to observe this difference?
    The dom_crypto_subtle_enabled web platform feature flag is enabled by default.

  4. What (if any) specific URLs are affected?
    This new cryptographic algorithm has not yet been wildly adopted.

@kkoyung
kkoyung deleted the kmac-sign-verify branch August 2, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants