[webkit-changes] [WebKit/WebKit] 8e5527: Add CryptoKit Implementation for create/addBytes/c...

Commit Queue noreply at github.com
Wed Aug 21 17:48:39 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8e5527887dcff1ea16f48998e05a3d11086ae563
      https://github.com/WebKit/WebKit/commit/8e5527887dcff1ea16f48998e05a3d11086ae563
  Author: Nitin Mahendru <nitinmahendru at apple.com>
  Date:   2024-08-21 (Wed, 21 Aug 2024)

  Changed paths:
    M Source/WebCore/PAL/pal/PALSwift/CryptoKitShim.swift
    M Source/WebCore/PAL/pal/crypto/CryptoDigest.h
    M Source/WebCore/PAL/pal/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp
    M Source/WebCore/PAL/pal/crypto/gcrypt/CryptoDigestGCrypt.cpp
    M Source/WebCore/PAL/pal/crypto/openssl/CryptoDigestOpenSSL.cpp
    M Source/WebCore/crypto/CryptoAlgorithm.cpp
    M Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp

  Log Message:
  -----------
  Add CryptoKit Implementation for create/addBytes/computeHash.
https://bugs.webkit.org/show_bug.cgi?id=278449
rdar://134394086

Reviewed by Alex Christensen.

Earlier implementation was a oneshot API. That does not work well for
cases where multiple spans need to be added for calculating digest.
That also makes it harder to keep on supporting SHA224.

With this change we will keep on supporting SHA224 until we consciously remove it.

With this in place, we also delete the oneshot API and use the existing
create/addBytes/computeHash trio everywhere.
Also a minor improvement to SHA224 implementation in that it uses the dispatchDigest
utility function.

No new tests are needed as there is no beahavior change.

* Source/WebCore/PAL/pal/PALSwift/CryptoKitShim.swift:
(Digest.ctx):
(Digest.sha1Init):
(Digest.sha256Init):
(Digest.sha384Init):
(Digest.sha512Init):
(Digest.update(_:)):
(Digest.finalize):
* Source/WebCore/PAL/pal/crypto/CryptoDigest.h:
* Source/WebCore/PAL/pal/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp:
(PAL::createCryptoDigest):
(PAL::CryptoDigest::addBytes):
(PAL::CryptoDigest::computeHash):
* Source/WebCore/PAL/pal/crypto/gcrypt/CryptoDigestGCrypt.cpp:
* Source/WebCore/PAL/pal/crypto/openssl/CryptoDigestOpenSSL.cpp:
* Source/WebCore/crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::dispatchDigest):
* Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp:
(WebCore::CryptoAlgorithmSHA224::digest):

Canonical link: https://commits.webkit.org/282596@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list