/src/openssl/crypto/hashtable/hashfunc.c
Line  | Count  | Source  | 
1  |  | /*  | 
2  |  |  * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.  | 
3  |  |  *  | 
4  |  |  * Licensed under the Apache License 2.0 (the "License").  You may not use  | 
5  |  |  * this file except in compliance with the License.  You can obtain a copy  | 
6  |  |  * in the file LICENSE in the source distribution or at  | 
7  |  |  * https://www.openssl.org/source/license.html  | 
8  |  |  *  | 
9  |  |  */  | 
10  |  |  | 
11  |  | #include "internal/hashfunc.h"  | 
12  |  |  | 
13  |  | ossl_unused uint64_t ossl_fnv1a_hash(uint8_t *key, size_t len)  | 
14  | 1.14M  | { | 
15  | 1.14M  |     uint64_t hash = 0xcbf29ce484222325ULL;  | 
16  | 1.14M  |     size_t i;  | 
17  |  |  | 
18  | 74.4M  |     for (i = 0; i < len; i++) { | 
19  | 73.3M  |         hash ^= key[i];  | 
20  | 73.3M  |         hash *= 0x00000100000001B3ULL;  | 
21  | 73.3M  |     }  | 
22  | 1.14M  |     return hash;  | 
23  | 1.14M  | }  |