Skip to content

Commit 263b2f6

Browse files
committed
attempt 32bit serialization fix
I don't have a 32bit system to test on locally, so testing on CI for now..
1 parent b7f46f8 commit 263b2f6

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

ext/hash/blake3/upstream_blake3/c/blake3.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ typedef struct {
4444
uint64_t chunk_counter;
4545
uint8_t buf[BLAKE3_BLOCK_LEN];
4646
uint8_t buf_len;
47+
uint8_t padding_1[5];
4748
uint8_t blocks_compressed;
4849
uint8_t flags;
4950
} blake3_chunk_state;
@@ -58,6 +59,7 @@ typedef struct {
5859
// don't know whether more input is coming. This is different from how the
5960
// reference implementation does things.
6061
uint8_t cv_stack[(BLAKE3_MAX_DEPTH + 1) * BLAKE3_OUT_LEN];
62+
uint8_t padding_2[7];
6163
} blake3_hasher;
6264

6365
BLAKE3_API const char *blake3_version(void);

ext/hash/php_hash_blake3.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
/* uint64_t chunk_counter; */ "q" \
3333
/* uint8_t buf[BLAKE3_BLOCK_LEN]; */ "b64" \
3434
/* uint8_t buf_len; */ "b" \
35-
/* skip 5 bytes of alignment padding in chunk */ "B5" \
35+
/* skip uint8_t padding_1[5] */ "B5" \
3636
/* uint8_t blocks_compressed */ "b" \
3737
/* uint8_t flags; */ "b" \
3838
/* uint8_t cv_stack_len; */ "b" \
3939
/* uint8_t cv_stack[(BLAKE3_MAX_DEPTH + 1) * BLAKE3_OUT_LEN]; */ "b1760" \
40-
/* skip 7 trailing alignment bytes */ "B7" \
40+
/* skip 7 uint8_t padding_2[7]*/ "B7" \
4141
"."
4242

4343

ext/hash/tests/hash_serialize_001.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ function not_serializable(string $algo)
4444
return in_array($algo, [
4545
"xxh3",
4646
"xxh128",
47-
"blake3", // todo: blake3 can be seralized but it's not implemented yet
4847
], true);
4948
}
5049

0 commit comments

Comments
 (0)