summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2018-02-09 17:26:30 +0100
committerAnatol Belski <ab@php.net>2018-02-09 19:28:20 +0100
commit3e6492f30578cc72d90b74c026179314cabaaf5f (patch)
tree47600a3dd6789c258124803b1049ba5c34793280
parente87dfb1da200b9a03eabe71bc5ee2c4d8b704c2f (diff)
downloadphp-git-3e6492f30578cc72d90b74c026179314cabaaf5f.tar.gz
Improve loop vectorization
-rw-r--r--ext/hash/hash.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index 889577e87f..df17deef96 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -529,10 +529,11 @@ PHP_FUNCTION(hash_final)
digest = zend_string_alloc(digest_len, 0);
hash->ops->hash_final((unsigned char *) ZSTR_VAL(digest), hash->context);
if (hash->options & PHP_HASH_HMAC) {
- int i;
+ int i, block_size;
/* Convert K to opad -- 0x6A = 0x36 ^ 0x5C */
- for(i=0; i < hash->ops->block_size; i++) {
+ block_size = hash->ops->block_size;
+ for(i=0; i < block_size; i++) {
hash->key[i] ^= 0x6A;
}