Repository navigation
php-in-php: hash_equals/hash_hmac_algos PHP LLVM (#7189 phase 1) - #7480
Merged
Merged
Conversation
…phase 1) Move timing-safe compare and HMAC algo list off hash_crypto_jit_runtime.c into StringHashEquals and StringHashHmacAlgos PHPLLVM emitters; digest functions remain in C pending full VmHashNative IR port. Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
This was referenced Jun 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 1 of #7189 — migrate
__compiler_hash_equalsand__compiler_hash_hmac_algosfrom hand-written C to PHPLLVM emitters (StringHashEquals.php,StringHashHmacAlgos.php). Digest bodies (__compiler_hash*, PBKDF2) remain inhash_crypto_jit_runtime.cfor a follow-up VmHashNative IR port.C runtime shrink: 38 lines removed from
lib/JIT/Builtin/hash_crypto_jit_runtime.c(800 → 762).PHP path
__compiler_hash_equalslib/JIT/Builtin/StringHashEquals.php(mirrorsVmHash::equals())__compiler_hash_hmac_algoslib/JIT/Builtin/StringHashHmacAlgos.php(mirrorsVmHash::hmacAlgos())Wired from
StringHashCryptoJit::implement()before MCJIT bitcode link.Verification
Output:
Follow-up (#7189 phase 2)
Port sha256/sha1/md5/HMAC/PBKDF2 digest loops from
VmHashNative.phpintoStringHashCryptoNativeJit.phpPHPLLVM Builder emission (~762 C lines remaining), then deletehash_crypto_jit_runtime.cfrom Linker.Part of #7189 — does not close the issue.
Made with Cursor