Lines Matching refs:ctx
40 PHP_HASH_API void PHP_XXH32Init(PHP_XXH32_CTX *ctx, HashTable *args) in PHP_XXH32Init() argument
43 memset(&ctx->s, 0, sizeof ctx->s); in PHP_XXH32Init()
51 XXH32_reset(&ctx->s, (XXH32_hash_t)Z_LVAL_P(seed)); in PHP_XXH32Init()
59 XXH32_reset(&ctx->s, 0); in PHP_XXH32Init()
62 PHP_HASH_API void PHP_XXH32Update(PHP_XXH32_CTX *ctx, const unsigned char *in, size_t len) in PHP_XXH32Update() argument
64 XXH32_update(&ctx->s, in, len); in PHP_XXH32Update()
67 PHP_HASH_API void PHP_XXH32Final(unsigned char digest[4], PHP_XXH32_CTX *ctx) in PHP_XXH32Final() argument
69 XXH32_canonicalFromHash((XXH32_canonical_t*)digest, XXH32_digest(&ctx->s)); in PHP_XXH32Final()
81 PHP_XXH32_CTX *ctx = (PHP_XXH32_CTX *) hash->context; in php_hash_xxh32_unserialize() local
85 && ctx->s.memsize < 16) { in php_hash_xxh32_unserialize()
107 PHP_HASH_API void PHP_XXH64Init(PHP_XXH64_CTX *ctx, HashTable *args) in PHP_XXH64Init() argument
110 memset(&ctx->s, 0, sizeof ctx->s); in PHP_XXH64Init()
117 XXH64_reset(&ctx->s, (XXH64_hash_t)Z_LVAL_P(seed)); in PHP_XXH64Init()
124 XXH64_reset(&ctx->s, 0); in PHP_XXH64Init()
127 PHP_HASH_API void PHP_XXH64Update(PHP_XXH64_CTX *ctx, const unsigned char *in, size_t len) in PHP_XXH64Update() argument
129 XXH64_update(&ctx->s, in, len); in PHP_XXH64Update()
132 PHP_HASH_API void PHP_XXH64Final(unsigned char digest[8], PHP_XXH64_CTX *ctx) in PHP_XXH64Final() argument
134 XXH64_canonicalFromHash((XXH64_canonical_t*)digest, XXH64_digest(&ctx->s)); in PHP_XXH64Final()
161 zend_always_inline static void _PHP_XXH3_Init(PHP_XXH3_64_CTX *ctx, HashTable *args, in _PHP_XXH3_Init() argument
164 memset(&ctx->s, 0, sizeof ctx->s); in _PHP_XXH3_Init()
182 func_init_seed(&ctx->s, (XXH64_hash_t)Z_LVAL_P(_seed)); in _PHP_XXH3_Init()
199 if (len > sizeof(ctx->secret)) { in _PHP_XXH3_Init()
200 len = sizeof(ctx->secret); in _PHP_XXH3_Init()
201 …LL, E_WARNING, "%s: Secret content exceeding %zu bytes discarded", algo_name, sizeof(ctx->secret)); in _PHP_XXH3_Init()
203 memcpy((unsigned char *)ctx->secret, ZSTR_VAL(secret_string), len); in _PHP_XXH3_Init()
205 func_init_secret(&ctx->s, ctx->secret, len); in _PHP_XXH3_Init()
210 func_init_seed(&ctx->s, 0); in _PHP_XXH3_Init()
213 PHP_HASH_API void PHP_XXH3_64_Init(PHP_XXH3_64_CTX *ctx, HashTable *args) in PHP_XXH3_64_Init() argument
215 _PHP_XXH3_Init(ctx, args, XXH3_64bits_reset_withSeed, XXH3_64bits_reset_withSecret, "xxh3"); in PHP_XXH3_64_Init()
218 PHP_HASH_API void PHP_XXH3_64_Update(PHP_XXH3_64_CTX *ctx, const unsigned char *in, size_t len) in PHP_XXH3_64_Update() argument
220 XXH3_64bits_update(&ctx->s, in, len); in PHP_XXH3_64_Update()
223 PHP_HASH_API void PHP_XXH3_64_Final(unsigned char digest[8], PHP_XXH3_64_CTX *ctx) in PHP_XXH3_64_Final() argument
225 XXH64_canonicalFromHash((XXH64_canonical_t*)digest, XXH3_64bits_digest(&ctx->s)); in PHP_XXH3_64_Final()
237 PHP_XXH64_CTX *ctx = (PHP_XXH64_CTX *) hash->context; in php_hash_xxh64_unserialize() local
241 && ctx->s.memsize < 32) { in php_hash_xxh64_unserialize()
263 PHP_HASH_API void PHP_XXH3_128_Init(PHP_XXH3_128_CTX *ctx, HashTable *args) in PHP_XXH3_128_Init() argument
265 _PHP_XXH3_Init(ctx, args, XXH3_128bits_reset_withSeed, XXH3_128bits_reset_withSecret, "xxh128"); in PHP_XXH3_128_Init()
268 PHP_HASH_API void PHP_XXH3_128_Update(PHP_XXH3_128_CTX *ctx, const unsigned char *in, size_t len) in PHP_XXH3_128_Update() argument
270 XXH3_128bits_update(&ctx->s, in, len); in PHP_XXH3_128_Update()
273 PHP_HASH_API void PHP_XXH3_128_Final(unsigned char digest[16], PHP_XXH3_128_CTX *ctx) in PHP_XXH3_128_Final() argument
275 XXH128_canonicalFromHash((XXH128_canonical_t*)digest, XXH3_128bits_digest(&ctx->s)); in PHP_XXH3_128_Final()