From: Joel Rosdahl Date: Thu, 6 Aug 2020 14:48:07 +0000 (+0200) Subject: Upgrade to BLAKE3 0.3.6 X-Git-Tag: v4.0~210 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ba5ef751c759246177e3ebd74ad1df00d73f243;p=thirdparty%2Fccache.git Upgrade to BLAKE3 0.3.6 --- diff --git a/LICENSE.adoc b/LICENSE.adoc index 405d7e346..5612a8363 100644 --- a/LICENSE.adoc +++ b/LICENSE.adoc @@ -299,8 +299,8 @@ from . src/third_party/blake3/*.[hcS] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This is a subset of with the following -license: +This is a subset of https://github.com/BLAKE3-team/BLAKE3[BLAKE3] 0.3.6 with +the following license: ------------------------------------------------------------------------------- This work is released into the public domain with CC0 1.0. Alternatively, it is diff --git a/src/third_party/blake3/blake3.c b/src/third_party/blake3/blake3.c index 0acefbade..c99d059ab 100644 --- a/src/third_party/blake3/blake3.c +++ b/src/third_party/blake3/blake3.c @@ -335,7 +335,7 @@ INLINE void compress_subtree_to_parent_node( assert(input_len > BLAKE3_CHUNK_LEN); #endif - uint8_t cv_array[2 * MAX_SIMD_DEGREE_OR_2 * BLAKE3_OUT_LEN]; + uint8_t cv_array[MAX_SIMD_DEGREE_OR_2 * BLAKE3_OUT_LEN]; size_t num_cvs = blake3_compress_subtree_wide(input, input_len, key, chunk_counter, flags, cv_array); diff --git a/src/third_party/blake3/blake3_avx2_x86-64_unix.S b/src/third_party/blake3/blake3_avx2_x86-64_unix.S index fa6f61dd2..14dcf5b46 100644 --- a/src/third_party/blake3/blake3_avx2_x86-64_unix.S +++ b/src/third_party/blake3/blake3_avx2_x86-64_unix.S @@ -1,3 +1,13 @@ +#if defined(__ELF__) && defined(__CET__) && defined(__has_include) +#if __has_include() +#include +#endif +#endif + +#if !defined(_CET_ENDBR) +#define _CET_ENDBR +#endif + .intel_syntax noprefix .global _blake3_hash_many_avx2 .global blake3_hash_many_avx2 @@ -9,6 +19,7 @@ .p2align 6 _blake3_hash_many_avx2: blake3_hash_many_avx2: + _CET_ENDBR push r15 push r14 push r13 diff --git a/src/third_party/blake3/blake3_avx512_x86-64_unix.S b/src/third_party/blake3/blake3_avx512_x86-64_unix.S index 25612cbf0..fb28d2358 100644 --- a/src/third_party/blake3/blake3_avx512_x86-64_unix.S +++ b/src/third_party/blake3/blake3_avx512_x86-64_unix.S @@ -1,5 +1,14 @@ -.intel_syntax noprefix +#if defined(__ELF__) && defined(__CET__) && defined(__has_include) +#if __has_include() +#include +#endif +#endif +#if !defined(_CET_ENDBR) +#define _CET_ENDBR +#endif + +.intel_syntax noprefix .global _blake3_hash_many_avx512 .global blake3_hash_many_avx512 .global blake3_compress_in_place_avx512 @@ -15,6 +24,7 @@ .p2align 6 _blake3_hash_many_avx512: blake3_hash_many_avx512: + _CET_ENDBR push r15 push r14 push r13 @@ -2372,6 +2382,7 @@ blake3_hash_many_avx512: .p2align 6 _blake3_compress_in_place_avx512: blake3_compress_in_place_avx512: + _CET_ENDBR vmovdqu xmm0, xmmword ptr [rdi] vmovdqu xmm1, xmmword ptr [rdi+0x10] movzx eax, r8b @@ -2454,6 +2465,7 @@ blake3_compress_in_place_avx512: .p2align 6 _blake3_compress_xof_avx512: blake3_compress_xof_avx512: + _CET_ENDBR vmovdqu xmm0, xmmword ptr [rdi] vmovdqu xmm1, xmmword ptr [rdi+0x10] movzx eax, r8b diff --git a/src/third_party/blake3/blake3_sse41_x86-64_unix.S b/src/third_party/blake3/blake3_sse41_x86-64_unix.S index 268c91bd5..41a1eb252 100644 --- a/src/third_party/blake3/blake3_sse41_x86-64_unix.S +++ b/src/third_party/blake3/blake3_sse41_x86-64_unix.S @@ -1,3 +1,13 @@ +#if defined(__ELF__) && defined(__CET__) && defined(__has_include) +#if __has_include() +#include +#endif +#endif + +#if !defined(_CET_ENDBR) +#define _CET_ENDBR +#endif + .intel_syntax noprefix .global blake3_hash_many_sse41 .global _blake3_hash_many_sse41 @@ -13,6 +23,7 @@ .p2align 6 _blake3_hash_many_sse41: blake3_hash_many_sse41: + _CET_ENDBR push r15 push r14 push r13 @@ -1774,6 +1785,7 @@ blake3_hash_many_sse41: .p2align 6 blake3_compress_in_place_sse41: _blake3_compress_in_place_sse41: + _CET_ENDBR movups xmm0, xmmword ptr [rdi] movups xmm1, xmmword ptr [rdi+0x10] movaps xmm2, xmmword ptr [BLAKE3_IV+rip] @@ -1874,6 +1886,7 @@ _blake3_compress_in_place_sse41: .p2align 6 blake3_compress_xof_sse41: _blake3_compress_xof_sse41: + _CET_ENDBR movups xmm0, xmmword ptr [rdi] movups xmm1, xmmword ptr [rdi+0x10] movaps xmm2, xmmword ptr [BLAKE3_IV+rip]