This commit is contained in:
@@ -5,8 +5,6 @@
|
||||
#include "../../../common/assert/assert.h"
|
||||
#include "../../../common/misc/misc_utils.h"
|
||||
|
||||
#define _bigConstant(x) (x##LLU)
|
||||
|
||||
wp_intern inline void _validateIO(const WpMur3HasherIO *io);
|
||||
wp_intern inline u64 _fmix64(u64 k);
|
||||
|
||||
@@ -19,8 +17,8 @@ void wpX64Mur3Hasher128(WpU8Stream *bytes, void *hasher_io) {
|
||||
u64 h1 = io->seed;
|
||||
u64 h2 = io->seed;
|
||||
|
||||
const u64 c1 = _bigConstant(0x87c37b91114253d5);
|
||||
const u64 c2 = _bigConstant(0x4cf5ad432745937f);
|
||||
const u64 c1 = wpU64Const(0x87c37b91114253d5);
|
||||
const u64 c2 = wpU64Const(0x4cf5ad432745937f);
|
||||
|
||||
//----------
|
||||
// body
|
||||
@@ -103,9 +101,9 @@ wp_intern inline void _validateIO(const WpMur3HasherIO *io) {
|
||||
|
||||
wp_intern inline u64 _fmix64(u64 k) {
|
||||
k ^= k >> 33;
|
||||
k *= _bigConstant(0xff51afd7ed558ccd);
|
||||
k *= wpU64Const(0xff51afd7ed558ccd);
|
||||
k ^= k >> 33;
|
||||
k *= _bigConstant(0xc4ceb9fe1a85ec53);
|
||||
k *= wpU64Const(0xc4ceb9fe1a85ec53);
|
||||
k ^= k >> 33;
|
||||
|
||||
return k;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
BEGIN_C_LINKAGE
|
||||
#endif // !WP_PLATFORM_CPP
|
||||
|
||||
#define WP_MUR3_HASHER_MAGIC ((u64)0x57504d4841534833)
|
||||
#define WP_MUR3_HASHER_MAGIC wpU64Const(0x57504d4841534833)
|
||||
|
||||
typedef struct {
|
||||
u64 hash[2];
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "../../../common/assert/assert.h"
|
||||
#include "../../../common/misc/misc_utils.h"
|
||||
#include <stdint.h>
|
||||
|
||||
wp_intern inline void _siphash(WpStream *bytes, const WpSipHasherParams *params, u8 *out, u64 outlen);
|
||||
wp_intern inline void _validate128IO(const WpSipHasher128IO *io);
|
||||
@@ -64,10 +63,10 @@ wp_intern inline void _siphash(WpStream *bytes, const WpSipHasherParams *params,
|
||||
|
||||
wpRuntimeAssert((outlen == 8) || (outlen == 16), "outlen should be 8 or 16");
|
||||
|
||||
u64 v0 = UINT64_C(0x736f6d6570736575);
|
||||
u64 v1 = UINT64_C(0x646f72616e646f6d);
|
||||
u64 v2 = UINT64_C(0x6c7967656e657261);
|
||||
u64 v3 = UINT64_C(0x7465646279746573);
|
||||
u64 v0 = wpU64Const(0x736f6d6570736575);
|
||||
u64 v1 = wpU64Const(0x646f72616e646f6d);
|
||||
u64 v2 = wpU64Const(0x6c7967656e657261);
|
||||
u64 v3 = wpU64Const(0x7465646279746573);
|
||||
u64 k0 = _u8To64LE(kk);
|
||||
u64 k1 = _u8To64LE(kk + 8);
|
||||
u64 m;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
BEGIN_C_LINKAGE
|
||||
#endif // !WP_PLATFORM_CPP
|
||||
|
||||
#define WP_SIP_HASHER_128_MAGIC ((u64)0x5750534950313238)
|
||||
#define WP_SIP_HASHER_64_MAGIC ((u64)0x57505349503634)
|
||||
#define WP_SIP_HASHER_128_MAGIC wpU64Const(0x5750534950313238)
|
||||
#define WP_SIP_HASHER_64_MAGIC wpU64Const(0x57505349503634)
|
||||
|
||||
typedef struct {
|
||||
u64 lo;
|
||||
|
||||
Reference in New Issue
Block a user