#include "system.h"
#include "rpmiotypes.h"
#include "debug.h"
Go to the source code of this file.
|
#define | HASH_LITTLE_ENDIAN (endian.uc[0] == (unsigned char) 0x44) |
|
#define | HASH_BIG_ENDIAN (endian.uc[0] == (unsigned char) 0x11) |
|
#define | ROTL32(x, s) (((x) << (s)) | ((x) >> (32 - (s)))) |
|
#define | _JLU3_INIT(_h, _size) (0xdeadbeef + ((rpmuint32_t)(_size)) + (_h)) |
|
#define | _JLU3_MIX(a, b, c) |
|
#define | _JLU3_FINAL(a, b, c) |
| _JLU3_FINAL – final mixing of 3 32-bit values (a,b,c) into c More...
|
|
§ _JLU3_FINAL
#define _JLU3_FINAL |
( |
|
a, |
|
|
|
b, |
|
|
|
c |
|
) |
| |
Value:
_JLU3_FINAL – final mixing of 3 32-bit values (a,b,c) into c
Pairs of (a,b,c) values differing in only a few bits will usually produce values of c that look totally different. This was tested for
- pairs that differed by one bit, by two bits, in any combination of top bits of (a,b,c), or in any combination of bottom bits of (a,b,c).
- "differ" is defined as +, -, ^, or ~^. For + and -, I transformed the output delta to a Gray code (a^(a>>1)) so a string of 1's (as is commonly produced by subtraction) look like a single 1-bit difference.
- the base values were pseudorandom, all zero but one bit set, or all zero plus a counter that starts at zero.
These constants passed: 14 11 25 16 4 14 24 12 14 25 16 4 14 24 and these came close: 4 8 15 26 3 22 24 10 8 15 26 3 22 24 11 8 15 26 3 22 24
Definition at line 154 of file lookup3.c.
§ _JLU3_INIT
#define _JLU3_INIT |
( |
|
_h, |
|
|
|
_size |
|
) |
| (0xdeadbeef + ((rpmuint32_t)(_size)) + (_h)) |
§ _JLU3_MIX
#define _JLU3_MIX |
( |
|
a, |
|
|
|
b, |
|
|
|
c |
|
) |
| |
Value:{ \
a -= c; a ^=
ROTL32(c, 4); c += b; \
b -= a; b ^=
ROTL32(a, 6); a += c; \
c -= b; c ^=
ROTL32(b, 8); b += a; \
a -= c; a ^=
ROTL32(c,16); c += b; \
b -= a; b ^=
ROTL32(a,19); a += c; \
c -= b; c ^=
ROTL32(b, 4); b += a; \
}
Definition at line 119 of file lookup3.c.
§ HASH_BIG_ENDIAN
#define HASH_BIG_ENDIAN (endian.uc[0] == (unsigned char) 0x11) |
§ HASH_LITTLE_ENDIAN
#define HASH_LITTLE_ENDIAN (endian.uc[0] == (unsigned char) 0x44) |
§ ROTL32
#define ROTL32 |
( |
|
x, |
|
|
|
s |
|
) |
| (((x) << (s)) | ((x) >> (32 - (s)))) |
§ endian
const union _dbswap endian = { 0x11223344 } |
|
static |