mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibWeb: Expose SHA3 hashing algorithm through WebCryptoAPI
This give us 48 WPT subtests :)
This commit is contained in:
Notes:
github-actions[bot]
2025-11-27 03:01:53 +00:00
Author: https://github.com/tete17 Commit: https://github.com/LadybirdBrowser/ladybird/commit/5e736d4e07b Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6942
@@ -3639,6 +3639,12 @@ WebIDL::ExceptionOr<GC::Ref<JS::ArrayBuffer>> SHA::digest(AlgorithmParams const&
|
||||
hash_kind = ::Crypto::Hash::HashKind::SHA384;
|
||||
} else if (algorithm_name == "SHA-512") {
|
||||
hash_kind = ::Crypto::Hash::HashKind::SHA512;
|
||||
} else if (algorithm_name == "SHA3-256") {
|
||||
hash_kind = ::Crypto::Hash::HashKind::SHA3_256;
|
||||
} else if (algorithm_name == "SHA3-384") {
|
||||
hash_kind = ::Crypto::Hash::HashKind::SHA3_384;
|
||||
} else if (algorithm_name == "SHA3-512") {
|
||||
hash_kind = ::Crypto::Hash::HashKind::SHA3_512;
|
||||
} else {
|
||||
return WebIDL::NotSupportedError::create(m_realm, Utf16String::formatted("Invalid hash function '{}'", algorithm_name));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user