#4266·k6

Implement `HKDF` across supported API

Author: olegbespalovCreated Oct 30, 2024Updated Sep 22, 2026
Labelstriagearea: webcrypto

What?

WebCrypto API defines HKDF algorithm identifier (https://www.w3.org/TR/WebCryptoAPI/#hkdf) for operations like:

  • Derive Bits (our implementation has it)
  • Derive Key (in-progress grafana/xk6-webcrypto#83)
  • Import key (our implementation has it)

Golang has an implementation in x/crypto https://pkg.go.dev/golang.org/x/crypto/hkdf.

As part of the issue, probably following web platform tests (see README) should be enabled:

  • WebCryptoAPI/derive_bits_keys/hkdf_vectors.js
  • WebCryptoAPI/derive_bits_keys/hkdf.js
  • and others test cases that could be useful for testing HKDF

Why?

Having support of the HKDF makes our implementation compliant with web crypto API