From: Joel Rosdahl Date: Mon, 26 Jul 2021 12:59:05 +0000 (+0200) Subject: bump: Upgrade to BLAKE3 1.0.0 X-Git-Tag: v4.4~82 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1aff3956ca4b1543b83d9b63c3857fcbae59a1d1;p=thirdparty%2Fccache.git bump: Upgrade to BLAKE3 1.0.0 --- diff --git a/LICENSE.adoc b/LICENSE.adoc index e7f75bc72..5611a3f32 100644 --- a/LICENSE.adoc +++ b/LICENSE.adoc @@ -78,7 +78,7 @@ along with this program. If not, see . src/third_party/blake3/blake3_* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This is a subset of https://github.com/BLAKE3-team/BLAKE3[BLAKE3] 0.3.7 with +This is a subset of https://github.com/BLAKE3-team/BLAKE3[BLAKE3] 1.0.0 with the following license: ------------------------------------------------------------------------------- diff --git a/src/third_party/blake3/blake3.c b/src/third_party/blake3/blake3.c index 7abf5324e..9998f75c7 100644 --- a/src/third_party/blake3/blake3.c +++ b/src/third_party/blake3/blake3.c @@ -5,9 +5,7 @@ #include "blake3.h" #include "blake3_impl.h" -const char * blake3_version(void) { - return BLAKE3_VERSION_STRING; -} +const char *blake3_version(void) { return BLAKE3_VERSION_STRING; } INLINE void chunk_state_init(blake3_chunk_state *self, const uint32_t key[8], uint8_t flags) { diff --git a/src/third_party/blake3/blake3.h b/src/third_party/blake3/blake3.h index 57ebd5adc..5eacf1801 100644 --- a/src/third_party/blake3/blake3.h +++ b/src/third_party/blake3/blake3.h @@ -8,13 +8,12 @@ extern "C" { #endif -#define BLAKE3_VERSION_STRING "0.3.7" +#define BLAKE3_VERSION_STRING "1.0.0" #define BLAKE3_KEY_LEN 32 #define BLAKE3_OUT_LEN 32 #define BLAKE3_BLOCK_LEN 64 #define BLAKE3_CHUNK_LEN 1024 #define BLAKE3_MAX_DEPTH 54 -#define BLAKE3_MAX_SIMD_DEGREE 16 // This struct is a private implementation detail. It has to be here because // it's part of blake3_hasher below. @@ -39,12 +38,12 @@ typedef struct { uint8_t cv_stack[(BLAKE3_MAX_DEPTH + 1) * BLAKE3_OUT_LEN]; } blake3_hasher; -const char * blake3_version(void); +const char *blake3_version(void); void blake3_hasher_init(blake3_hasher *self); void blake3_hasher_init_keyed(blake3_hasher *self, const uint8_t key[BLAKE3_KEY_LEN]); void blake3_hasher_init_derive_key(blake3_hasher *self, const char *context); -void blake3_hasher_init_derive_key_raw(blake3_hasher *self, const void *context, +void blake3_hasher_init_derive_key_raw(blake3_hasher *self, const void *context, size_t context_len); void blake3_hasher_update(blake3_hasher *self, const void *input, size_t input_len); diff --git a/src/third_party/blake3/blake3_avx512_x86-64_windows_msvc.asm b/src/third_party/blake3/blake3_avx512_x86-64_windows_msvc.asm index 97a726874..b19efbaae 100644 --- a/src/third_party/blake3/blake3_avx512_x86-64_windows_msvc.asm +++ b/src/third_party/blake3/blake3_avx512_x86-64_windows_msvc.asm @@ -2421,8 +2421,8 @@ _blake3_compress_in_place_avx512 PROC movzx r8d, r8b shl rax, 32 add r8, rax - vmovd xmm3, r9 - vmovd xmm4, r8 + vmovq xmm3, r9 + vmovq xmm4, r8 vpunpcklqdq xmm3, xmm3, xmm4 vmovaps xmm2, xmmword ptr [BLAKE3_IV] vmovups xmm8, xmmword ptr [rdx] @@ -2516,8 +2516,8 @@ _blake3_compress_xof_avx512 PROC mov r10, qword ptr [rsp+78H] shl rax, 32 add r8, rax - vmovd xmm3, r9 - vmovd xmm4, r8 + vmovq xmm3, r9 + vmovq xmm4, r8 vpunpcklqdq xmm3, xmm3, xmm4 vmovaps xmm2, xmmword ptr [BLAKE3_IV] vmovups xmm8, xmmword ptr [rdx] diff --git a/src/third_party/blake3/blake3_sse2_x86-64_unix.S b/src/third_party/blake3/blake3_sse2_x86-64_unix.S index d144046ab..99f033fef 100644 --- a/src/third_party/blake3/blake3_sse2_x86-64_unix.S +++ b/src/third_party/blake3/blake3_sse2_x86-64_unix.S @@ -1704,7 +1704,7 @@ blake3_hash_many_sse2: pshufd xmm15, xmm11, 0x93 shl rax, 0x20 or rax, 0x40 - movd xmm3, rax + movq xmm3, rax movdqa xmmword ptr [rsp+0x20], xmm3 movaps xmm3, xmmword ptr [rsp] movaps xmm11, xmmword ptr [rsp+0x10] @@ -1917,7 +1917,7 @@ blake3_hash_many_sse2: movaps xmm2, xmmword ptr [BLAKE3_IV+rip] shl rax, 32 or rax, 64 - movd xmm12, rax + movq xmm12, rax movdqa xmm3, xmm13 punpcklqdq xmm3, xmm12 movups xmm4, xmmword ptr [r8+rdx-0x40] diff --git a/src/third_party/blake3/blake3_sse2_x86-64_windows_gnu.S b/src/third_party/blake3/blake3_sse2_x86-64_windows_gnu.S index 494c0c6fd..424b4f85e 100644 --- a/src/third_party/blake3/blake3_sse2_x86-64_windows_gnu.S +++ b/src/third_party/blake3/blake3_sse2_x86-64_windows_gnu.S @@ -1715,7 +1715,7 @@ blake3_hash_many_sse2: pshufd xmm15, xmm11, 0x93 shl rax, 0x20 or rax, 0x40 - movd xmm3, rax + movq xmm3, rax movdqa xmmword ptr [rsp+0x20], xmm3 movaps xmm3, xmmword ptr [rsp] movaps xmm11, xmmword ptr [rsp+0x10] @@ -1928,7 +1928,7 @@ blake3_hash_many_sse2: movaps xmm2, xmmword ptr [BLAKE3_IV+rip] shl rax, 32 or rax, 64 - movd xmm12, rax + movq xmm12, rax movdqa xmm3, xmm13 punpcklqdq xmm3, xmm12 movups xmm4, xmmword ptr [r8+rdx-0x40]