207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
#define OF_ROL(val, bits) \
(((val) << ((bits) % (sizeof(val) * 8))) | \
(val) >> (sizeof(val) * 8 - ((bits) % (sizeof(val) * 8))))
#define OF_HASH_INIT(hash) hash = 0
#define OF_HASH_ADD(hash, byte) \
{ \
hash += byte; \
hash += (hash << 10); \
hash ^= (hash >> 6); \
}
#define OF_HASH_FINALIZE(hash) \
{ \
hash += (hash << 3); \
hash ^= (hash >> 11); \
hash += (hash << 15); \
}
|
|
|
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
#define OF_ROL(val, bits) \
(((val) << ((bits) % (sizeof(val) * 8))) | \
(val) >> (sizeof(val) * 8 - ((bits) % (sizeof(val) * 8))))
#define OF_HASH_INIT(hash) hash = 0
#define OF_HASH_ADD(hash, byte) \
{ \
hash += (uint8_t)byte; \
hash += (hash << 10); \
hash ^= (hash >> 6); \
}
#define OF_HASH_FINALIZE(hash) \
{ \
hash += (hash << 3); \
hash ^= (hash >> 11); \
hash += (hash << 15); \
}
|