]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
reorder operations for "update" to match "hash"
authorAlan T. DeKok <aland@freeradius.org>
Sat, 14 Feb 2026 14:24:18 +0000 (09:24 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 15 Feb 2026 15:51:35 +0000 (10:51 -0500)
src/lib/util/hash.c

index 19967307917596067ea701c8cb121e7b8a20af52..c6617986f9a50d53c7aa30016d52c1836f793ce2 100644 (file)
@@ -856,8 +856,8 @@ uint32_t fr_hash_update(void const *data, size_t size, uint32_t hash)
 
        q = p + size;
        while (p < q) {
-               hash *= FNV_MAGIC_PRIME;
                hash ^= (uint32_t) (*p++);
+               hash *= FNV_MAGIC_PRIME;
        }
 
        return hash;
@@ -943,8 +943,8 @@ uint64_t fr_hash64_update(void const *data, size_t size, uint64_t hash)
 
        q = p + size;
        while (p < q) {
-               hash *= FNV_MAGIC_PRIME;
                hash ^= (uint64_t) (*p++);
+               hash *= FNV_MAGIC_PRIME;
        }
 
        return hash;