LibWeb: Implement and test SubtleCrypto interface for HKDF operations

This fixes several hundred if not thousands of WPT tests:
https://wpt.live/WebCryptoAPI/derive_bits_keys/hkdf.https.any.html?1-1000
This commit is contained in:
Ben Wiederhake 2024-10-20 06:10:36 +02:00 committed by Andrew Kaster
commit f670c68ded
Notes: github-actions[bot] 2024-10-23 18:21:54 +00:00
3 changed files with 167 additions and 0 deletions

View file

@ -768,6 +768,11 @@ SupportedAlgorithmsMap supported_algorithms()
define_an_algorithm<SHA>("digest"_string, "SHA-384"_string);
define_an_algorithm<SHA>("digest"_string, "SHA-512"_string);
// https://w3c.github.io/webcrypto/#hkdf
define_an_algorithm<HKDF>("importKey"_string, "HKDF"_string);
define_an_algorithm<HKDF, HKDFParams>("deriveBits"_string, "HKDF"_string);
define_an_algorithm<HKDF>("get key length"_string, "HKDF"_string);
// https://w3c.github.io/webcrypto/#pbkdf2
define_an_algorithm<PBKDF2>("importKey"_string, "PBKDF2"_string);
define_an_algorithm<PBKDF2, PBKDF2Params>("deriveBits"_string, "PBKDF2"_string);