=== src/third_party/blake3/blake3_*
-This is a subset of https://github.com/BLAKE3-team/BLAKE3[BLAKE3] (git SHA:
-https://github.com/BLAKE3-team/BLAKE3/commit/71a2646180c787e22f8681c5fec7655a0ad51e99[71a2646])
-with the following license:
+This is a subset of https://github.com/BLAKE3-team/BLAKE3[BLAKE3] 1.4.0 with the
+following license:
----
This work is released into the public domain with CC0 1.0. Alternatively, it is
#include <stddef.h>
#include <stdint.h>
+#if !defined(BLAKE3_API)
+# if defined(_WIN32) || defined(__CYGWIN__)
+# if defined(BLAKE3_DLL)
+# if defined(BLAKE3_DLL_EXPORTS)
+# define BLAKE3_API __declspec(dllexport)
+# else
+# define BLAKE3_API __declspec(dllimport)
+# endif
+# define BLAKE3_PRIVATE
+# else
+# define BLAKE3_API
+# define BLAKE3_PRIVATE
+# endif
+# elif __GNUC__ >= 4
+# define BLAKE3_API __attribute__((visibility("default")))
+# define BLAKE3_PRIVATE __attribute__((visibility("hidden")))
+# else
+# define BLAKE3_API
+# define BLAKE3_PRIVATE
+# endif
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
-#define BLAKE3_VERSION_STRING "1.3.3"
+#define BLAKE3_VERSION_STRING "1.4.0"
#define BLAKE3_KEY_LEN 32
#define BLAKE3_OUT_LEN 32
#define BLAKE3_BLOCK_LEN 64
uint8_t cv_stack[(BLAKE3_MAX_DEPTH + 1) * BLAKE3_OUT_LEN];
} blake3_hasher;
-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,
- size_t context_len);
-void blake3_hasher_update(blake3_hasher *self, const void *input,
- size_t input_len);
-void blake3_hasher_finalize(const blake3_hasher *self, uint8_t *out,
- size_t out_len);
-void blake3_hasher_finalize_seek(const blake3_hasher *self, uint64_t seek,
- uint8_t *out, size_t out_len);
-void blake3_hasher_reset(blake3_hasher *self);
+BLAKE3_API const char *blake3_version(void);
+BLAKE3_API void blake3_hasher_init(blake3_hasher *self);
+BLAKE3_API void blake3_hasher_init_keyed(blake3_hasher *self,
+ const uint8_t key[BLAKE3_KEY_LEN]);
+BLAKE3_API void blake3_hasher_init_derive_key(blake3_hasher *self, const char *context);
+BLAKE3_API void blake3_hasher_init_derive_key_raw(blake3_hasher *self, const void *context,
+ size_t context_len);
+BLAKE3_API void blake3_hasher_update(blake3_hasher *self, const void *input,
+ size_t input_len);
+BLAKE3_API void blake3_hasher_finalize(const blake3_hasher *self, uint8_t *out,
+ size_t out_len);
+BLAKE3_API void blake3_hasher_finalize_seek(const blake3_hasher *self, uint64_t seek,
+ uint8_t *out, size_t out_len);
+BLAKE3_API void blake3_hasher_reset(blake3_hasher *self);
#ifdef __cplusplus
}
__m256i gh_0145 = _mm256_unpacklo_epi32(vecs[6], vecs[7]);
__m256i gh_2367 = _mm256_unpackhi_epi32(vecs[6], vecs[7]);
- // Interleave 64-bit lates. The low unpack is lanes 00/22 and the high is
+ // Interleave 64-bit lanes. The low unpack is lanes 00/22 and the high is
// 11/33.
__m256i abcd_04 = _mm256_unpacklo_epi64(ab_0145, cd_0145);
__m256i abcd_15 = _mm256_unpackhi_epi64(ab_0145, cd_0145);
}
INLINE void transpose_vecs_128(__m128i vecs[4]) {
- // Interleave 32-bit lates. The low unpack is lanes 00/11 and the high is
+ // Interleave 32-bit lanes. The low unpack is lanes 00/11 and the high is
// 22/33. Note that this doesn't split the vector into two lanes, as the
// AVX2 counterparts do.
__m128i ab_01 = _mm_unpacklo_epi32(vecs[0], vecs[1]);
__m256i gh_0145 = _mm256_unpacklo_epi32(vecs[6], vecs[7]);
__m256i gh_2367 = _mm256_unpackhi_epi32(vecs[6], vecs[7]);
- // Interleave 64-bit lates. The low unpack is lanes 00/22 and the high is
+ // Interleave 64-bit lanes. The low unpack is lanes 00/22 and the high is
// 11/33.
__m256i abcd_04 = _mm256_unpacklo_epi64(ab_0145, cd_0145);
__m256i abcd_15 = _mm256_unpackhi_epi64(ab_0145, cd_0145);
__m512i op_0 = _mm512_unpacklo_epi32(vecs[14], vecs[15]);
__m512i op_2 = _mm512_unpackhi_epi32(vecs[14], vecs[15]);
- // Interleave 64-bit lates. The _0 unpack is lanes
+ // Interleave 64-bit lanes. The _0 unpack is lanes
// 0/0/0/0/4/4/4/4/8/8/8/8/12/12/12/12, the _1 unpack is lanes
// 1/1/1/1/5/5/5/5/9/9/9/9/13/13/13/13, the _2 unpack is lanes
// 2/2/2/2/6/6/6/6/10/10/10/10/14/14/14/14, and the _3 unpack is lanes
}
INLINE void transpose_vecs(__m128i vecs[DEGREE]) {
- // Interleave 32-bit lates. The low unpack is lanes 00/11 and the high is
+ // Interleave 32-bit lanes. The low unpack is lanes 00/11 and the high is
// 22/33. Note that this doesn't split the vector into two lanes, as the
// AVX2 counterparts do.
__m128i ab_01 = _mm_unpacklo_epi32(vecs[0], vecs[1]);
}
INLINE void transpose_vecs(__m128i vecs[DEGREE]) {
- // Interleave 32-bit lates. The low unpack is lanes 00/11 and the high is
+ // Interleave 32-bit lanes. The low unpack is lanes 00/11 and the high is
// 22/33. Note that this doesn't split the vector into two lanes, as the
// AVX2 counterparts do.
__m128i ab_01 = _mm_unpacklo_epi32(vecs[0], vecs[1]);