Lines Matching refs:state
1396 XXH32_state_t state; in XXH32()
1397 XXH32_reset(&state, seed); in XXH32()
1398 XXH32_update(&state, (const xxh_u8*)input, len); in XXH32()
1399 return XXH32_digest(&state); in XXH32()
1433 …XXH32_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnin… in XXH32_reset() local
1434 memset(&state, 0, sizeof(state)); in XXH32_reset()
1435 state.v1 = seed + XXH_PRIME32_1 + XXH_PRIME32_2; in XXH32_reset()
1436 state.v2 = seed + XXH_PRIME32_2; in XXH32_reset()
1437 state.v3 = seed + 0; in XXH32_reset()
1438 state.v4 = seed - XXH_PRIME32_1; in XXH32_reset()
1440 memcpy(statePtr, &state, sizeof(state) - sizeof(state.reserved)); in XXH32_reset()
1446 XXH32_update(XXH32_state_t* state, const void* input, size_t len) in XXH32_update() argument
1458 state->total_len_32 += (XXH32_hash_t)len; in XXH32_update()
1459 state->large_len |= (XXH32_hash_t)((len>=16) | (state->total_len_32>=16)); in XXH32_update()
1461 if (state->memsize + len < 16) { /* fill in tmp buffer */ in XXH32_update()
1462 XXH_memcpy((xxh_u8*)(state->mem32) + state->memsize, input, len); in XXH32_update()
1463 state->memsize += (XXH32_hash_t)len; in XXH32_update()
1467 if (state->memsize) { /* some data left from previous update */ in XXH32_update()
1468 XXH_memcpy((xxh_u8*)(state->mem32) + state->memsize, input, 16-state->memsize); in XXH32_update()
1469 { const xxh_u32* p32 = state->mem32; in XXH32_update()
1470 state->v1 = XXH32_round(state->v1, XXH_readLE32(p32)); p32++; in XXH32_update()
1471 state->v2 = XXH32_round(state->v2, XXH_readLE32(p32)); p32++; in XXH32_update()
1472 state->v3 = XXH32_round(state->v3, XXH_readLE32(p32)); p32++; in XXH32_update()
1473 state->v4 = XXH32_round(state->v4, XXH_readLE32(p32)); in XXH32_update()
1475 p += 16-state->memsize; in XXH32_update()
1476 state->memsize = 0; in XXH32_update()
1481 xxh_u32 v1 = state->v1; in XXH32_update()
1482 xxh_u32 v2 = state->v2; in XXH32_update()
1483 xxh_u32 v3 = state->v3; in XXH32_update()
1484 xxh_u32 v4 = state->v4; in XXH32_update()
1493 state->v1 = v1; in XXH32_update()
1494 state->v2 = v2; in XXH32_update()
1495 state->v3 = v3; in XXH32_update()
1496 state->v4 = v4; in XXH32_update()
1500 XXH_memcpy(state->mem32, p, (size_t)(bEnd-p)); in XXH32_update()
1501 state->memsize = (unsigned)(bEnd-p); in XXH32_update()
1509 XXH_PUBLIC_API XXH32_hash_t XXH32_digest (const XXH32_state_t* state) in XXH32_digest() argument
1513 if (state->large_len) { in XXH32_digest()
1514 h32 = XXH_rotl32(state->v1, 1) in XXH32_digest()
1515 + XXH_rotl32(state->v2, 7) in XXH32_digest()
1516 + XXH_rotl32(state->v3, 12) in XXH32_digest()
1517 + XXH_rotl32(state->v4, 18); in XXH32_digest()
1519 h32 = state->v3 /* == seed */ + XXH_PRIME32_5; in XXH32_digest()
1522 h32 += state->total_len_32; in XXH32_digest()
1524 return XXH32_finalize(h32, (const xxh_u8*)state->mem32, state->memsize, XXH_aligned); in XXH32_digest()
1938 XXH64_state_t state; in XXH64()
1939 XXH64_reset(&state, seed); in XXH64()
1940 XXH64_update(&state, (const xxh_u8*)input, len); in XXH64()
1941 return XXH64_digest(&state); in XXH64()
1974 …XXH64_state_t state; /* use a local state to memcpy() in order to avoid strict-aliasing warnings… in XXH64_reset() local
1975 memset(&state, 0, sizeof(state)); in XXH64_reset()
1976 state.v1 = seed + XXH_PRIME64_1 + XXH_PRIME64_2; in XXH64_reset()
1977 state.v2 = seed + XXH_PRIME64_2; in XXH64_reset()
1978 state.v3 = seed + 0; in XXH64_reset()
1979 state.v4 = seed - XXH_PRIME64_1; in XXH64_reset()
1981 memcpy(statePtr, &state, sizeof(state) - sizeof(state.reserved64)); in XXH64_reset()
1986 XXH64_update (XXH64_state_t* state, const void* input, size_t len) in XXH64_update() argument
1998 state->total_len += len; in XXH64_update()
2000 if (state->memsize + len < 32) { /* fill in tmp buffer */ in XXH64_update()
2001 XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, len); in XXH64_update()
2002 state->memsize += (xxh_u32)len; in XXH64_update()
2006 if (state->memsize) { /* tmp buffer is full */ in XXH64_update()
2007 XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, 32-state->memsize); in XXH64_update()
2008 state->v1 = XXH64_round(state->v1, XXH_readLE64(state->mem64+0)); in XXH64_update()
2009 state->v2 = XXH64_round(state->v2, XXH_readLE64(state->mem64+1)); in XXH64_update()
2010 state->v3 = XXH64_round(state->v3, XXH_readLE64(state->mem64+2)); in XXH64_update()
2011 state->v4 = XXH64_round(state->v4, XXH_readLE64(state->mem64+3)); in XXH64_update()
2012 p += 32-state->memsize; in XXH64_update()
2013 state->memsize = 0; in XXH64_update()
2018 xxh_u64 v1 = state->v1; in XXH64_update()
2019 xxh_u64 v2 = state->v2; in XXH64_update()
2020 xxh_u64 v3 = state->v3; in XXH64_update()
2021 xxh_u64 v4 = state->v4; in XXH64_update()
2030 state->v1 = v1; in XXH64_update()
2031 state->v2 = v2; in XXH64_update()
2032 state->v3 = v3; in XXH64_update()
2033 state->v4 = v4; in XXH64_update()
2037 XXH_memcpy(state->mem64, p, (size_t)(bEnd-p)); in XXH64_update()
2038 state->memsize = (unsigned)(bEnd-p); in XXH64_update()
2046 XXH_PUBLIC_API XXH64_hash_t XXH64_digest (const XXH64_state_t* state) in XXH64_digest() argument
2050 if (state->total_len >= 32) { in XXH64_digest()
2051 xxh_u64 const v1 = state->v1; in XXH64_digest()
2052 xxh_u64 const v2 = state->v2; in XXH64_digest()
2053 xxh_u64 const v3 = state->v3; in XXH64_digest()
2054 xxh_u64 const v4 = state->v4; in XXH64_digest()
2062 h64 = state->v3 /*seed*/ + XXH_PRIME64_5; in XXH64_digest()
2065 h64 += (xxh_u64) state->total_len; in XXH64_digest()
2067 return XXH64_finalize(h64, (const xxh_u8*)state->mem64, (size_t)state->total_len, XXH_aligned); in XXH64_digest()
3953 XXH3_state_t* const state = (XXH3_state_t*)XXH_alignedMalloc(sizeof(XXH3_state_t), 64); in XXH3_createState() local
3954 if (state==NULL) return NULL; in XXH3_createState()
3955 XXH3_INITSTATE(state); in XXH3_createState()
3956 return state; in XXH3_createState()
4056 XXH3_update(XXH3_state_t* state, in XXH3_update() argument
4069 …const unsigned char* const secret = (state->extSecret == NULL) ? state->customSecret : state->extS… in XXH3_update()
4071 state->totalLen += len; in XXH3_update()
4073 if (state->bufferedSize + len <= XXH3_INTERNALBUFFER_SIZE) { /* fill in tmp buffer */ in XXH3_update()
4074 XXH_memcpy(state->buffer + state->bufferedSize, input, len); in XXH3_update()
4075 state->bufferedSize += (XXH32_hash_t)len; in XXH3_update()
4087 if (state->bufferedSize) { in XXH3_update()
4088 size_t const loadSize = XXH3_INTERNALBUFFER_SIZE - state->bufferedSize; in XXH3_update()
4089 XXH_memcpy(state->buffer + state->bufferedSize, input, loadSize); in XXH3_update()
4091 XXH3_consumeStripes(state->acc, in XXH3_update()
4092 &state->nbStripesSoFar, state->nbStripesPerBlock, in XXH3_update()
4093 state->buffer, XXH3_INTERNALBUFFER_STRIPES, in XXH3_update()
4094 secret, state->secretLimit, in XXH3_update()
4096 state->bufferedSize = 0; in XXH3_update()
4104 XXH3_consumeStripes(state->acc, in XXH3_update()
4105 &state->nbStripesSoFar, state->nbStripesPerBlock, in XXH3_update()
4107 secret, state->secretLimit, in XXH3_update()
4112 …memcpy(state->buffer + sizeof(state->buffer) - XXH_STRIPE_LEN, input - XXH_STRIPE_LEN, XXH_STRIPE_… in XXH3_update()
4117 XXH_memcpy(state->buffer, input, (size_t)(bEnd-input)); in XXH3_update()
4118 state->bufferedSize = (XXH32_hash_t)(bEnd-input); in XXH3_update()
4125 XXH3_64bits_update(XXH3_state_t* state, const void* input, size_t len) in XXH3_64bits_update() argument
4127 return XXH3_update(state, (const xxh_u8*)input, len, in XXH3_64bits_update()
4134 const XXH3_state_t* state, in XXH3_digest_long() argument
4141 memcpy(acc, state->acc, sizeof(state->acc)); in XXH3_digest_long()
4142 if (state->bufferedSize >= XXH_STRIPE_LEN) { in XXH3_digest_long()
4143 size_t const nbStripes = (state->bufferedSize - 1) / XXH_STRIPE_LEN; in XXH3_digest_long()
4144 size_t nbStripesSoFar = state->nbStripesSoFar; in XXH3_digest_long()
4146 &nbStripesSoFar, state->nbStripesPerBlock, in XXH3_digest_long()
4147 state->buffer, nbStripes, in XXH3_digest_long()
4148 secret, state->secretLimit, in XXH3_digest_long()
4152 state->buffer + state->bufferedSize - XXH_STRIPE_LEN, in XXH3_digest_long()
4153 secret + state->secretLimit - XXH_SECRET_LASTACC_START); in XXH3_digest_long()
4156 size_t const catchupSize = XXH_STRIPE_LEN - state->bufferedSize; in XXH3_digest_long()
4157 XXH_ASSERT(state->bufferedSize > 0); /* there is always some input buffered */ in XXH3_digest_long()
4158 memcpy(lastStripe, state->buffer + sizeof(state->buffer) - catchupSize, catchupSize); in XXH3_digest_long()
4159 memcpy(lastStripe + catchupSize, state->buffer, state->bufferedSize); in XXH3_digest_long()
4162 secret + state->secretLimit - XXH_SECRET_LASTACC_START); in XXH3_digest_long()
4166 XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_digest (const XXH3_state_t* state) in XXH3_64bits_digest() argument
4168 …const unsigned char* const secret = (state->extSecret == NULL) ? state->customSecret : state->extS… in XXH3_64bits_digest()
4169 if (state->totalLen > XXH3_MIDSIZE_MAX) { in XXH3_64bits_digest()
4171 XXH3_digest_long(acc, state, secret); in XXH3_64bits_digest()
4174 (xxh_u64)state->totalLen * XXH_PRIME64_1); in XXH3_64bits_digest()
4177 if (state->seed) in XXH3_64bits_digest()
4178 return XXH3_64bits_withSeed(state->buffer, (size_t)state->totalLen, state->seed); in XXH3_64bits_digest()
4179 return XXH3_64bits_withSecret(state->buffer, (size_t)(state->totalLen), in XXH3_64bits_digest()
4180 secret, state->secretLimit + XXH_STRIPE_LEN); in XXH3_64bits_digest()
4672 XXH3_128bits_update(XXH3_state_t* state, const void* input, size_t len) in XXH3_128bits_update() argument
4674 return XXH3_update(state, (const xxh_u8*)input, len, in XXH3_128bits_update()
4678 XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_digest (const XXH3_state_t* state) in XXH3_128bits_digest() argument
4680 …const unsigned char* const secret = (state->extSecret == NULL) ? state->customSecret : state->extS… in XXH3_128bits_digest()
4681 if (state->totalLen > XXH3_MIDSIZE_MAX) { in XXH3_128bits_digest()
4683 XXH3_digest_long(acc, state, secret); in XXH3_128bits_digest()
4684 XXH_ASSERT(state->secretLimit + XXH_STRIPE_LEN >= sizeof(acc) + XXH_SECRET_MERGEACCS_START); in XXH3_128bits_digest()
4688 (xxh_u64)state->totalLen * XXH_PRIME64_1); in XXH3_128bits_digest()
4690 secret + state->secretLimit + XXH_STRIPE_LEN in XXH3_128bits_digest()
4692 ~((xxh_u64)state->totalLen * XXH_PRIME64_2)); in XXH3_128bits_digest()
4697 if (state->seed) in XXH3_128bits_digest()
4698 return XXH3_128bits_withSeed(state->buffer, (size_t)state->totalLen, state->seed); in XXH3_128bits_digest()
4699 return XXH3_128bits_withSecret(state->buffer, (size_t)(state->totalLen), in XXH3_128bits_digest()
4700 secret, state->secretLimit + XXH_STRIPE_LEN); in XXH3_128bits_digest()