aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-01-21remove the root build.rsuse_gutsJack O'Connor
2024-01-21factor out the `blake3` crate changes from the guts_api branchJack O'Connor
This commit and the branch that it starts are unlikely to land as-is, but I want to maintain them while I flesh out the new `blake3_guts` sub-crate.
2024-01-21add a guts docs exampleguts_0.0.0Jack O'Connor
2024-01-21guts readme updatesJack O'Connor
2024-01-21add guts testing to CIJack O'Connor
2024-01-21configure no_std for guts, but not for testingJack O'Connor
2024-01-21factor out just the portable parts of the guts_api branchJack O'Connor
2024-01-21update memmap2 to v0.9Jack O'Connor
2023-12-30replace unmaintained actions-rs/toolchain action in CIDirk Stolle
Basically all of the `actions-rs/*` actions are unmaintained. See <https://github.com/actions-rs/toolchain/issues/216> for more information. Due to their age they generate several warnings in CI runs. To get rid of those warnings the occurrences of `actions-rs/toolchain` are replaced by `dtolnay/rust-toolchain`.
2023-12-28update actions/checkout in GitHub Actions to v4Dirk Stolle
2023-12-08add Bazel to the list of users in the readmeJack O'Connor
2023-12-02build(CMake): Require C99 modeHenrik S. Gaßmann
Specify language requirement as a [compile-feature] and force compiler extensions off ensuring portability problems are detected early on. Note that we do not use the `C_STANDARD` property, because it doesn't propagate to dependent targets and would prohibit users from compiling their code base with consistent flags / language configuations if they were to target a newer C standard. Similarly we do not configure `C_STANDARD_REQUIRED` as [compile-features] do not interact with it--they are enforced regardless. [compile-feature]: https://cmake.org/cmake/help/latest/manual/cmake-compile-features.7.html#compile-feature-requirements
2023-11-05add the compiler name to CMake CI jobsJack O'Connor
2023-11-05Fix CMake target include directories if library is used with ↵Viacheslav H
add_subdirectory or FetchContent
2023-11-05Fix Windows build with clang-clRui Ueyama
clang-cl is LLVM's MSVC-compatible compiler frontend for Windows ABI. If clang-cl is in use, `CMAKE_C_COMPILER_ID` is `Clang` even though it doesn't take Unix-like command line options but MSVC-like options. `if(MSVC)` is the correct predicate to check if we should pass MSVC-ish command line options.
2023-10-31style: Exclude whitespace fixups from git blameHenrik Gaßmann
2023-10-31style: Remove trailing whitespace in CMakeLists.txtHenrik Gaßmann
2023-10-31build(CMake): Provide NEON cflags for ARMv8 32bitHenrik Gaßmann
ARMv8 CPUs are guaranteed to support NEON instructions. However, for 32bit ARMv8 triplets GCC needs to explicitly be configured to enable NEON intrinsics.
2023-10-02build(CMake): Apply PP definitions to all sourcesHenrik Gaßmann
2023-10-02allow(unreachable_code) in all the *_detected functionsJack O'Connor
Previously we only disabled these warnings for SSE2, which is assumed enabled on x86-64, but it looks like new nightly compilers are also assuming SSE4.1 on macOS. Disabling these warnings across all the detection functions accounts for that, and it also gets rid of some warnings that you'd see if you used RUSTFLAGS='-C target-cpu=native'.
2023-09-20version 1.5.01.5.0Jack O'Connor
Changes since 1.4.1: - The Rust crate's Hasher type has gained new helper methods for common forms of IO: update_reader, update_mmap, and update_mmap_rayon. The latter matches the default behavior of b3sum. The mmap methods are gated by the new "mmap" Cargo feature. - Most of the Rust crate's public types now implement the Zeroize trait. This is gated by the new "zeroize" Cargo feature. - The Rust crate's Hash types now implements the serde Serialize and Deserialize traits. This is gated by the new "serde" Cargo feature. - The C library now uses atomics to cache detected CPU features under most compilers other than MSVC. Previously this was a non-atomic write, which was probably "benign" but made TSan unhappy. - NEON support is now disabled by default on big-endian AArch64. Previously this was a build error if the caller didn't explicitly disable it.
2023-09-19add a test for the new serde featureJack O'Connor
2023-09-19Add serde support for Hash behind optional featureRalph Minderhoud
Added a new cargo feature `serde` that when enabled will derive `serde::Serialize` and `serde::Deserialize` for the `blake3::Hash` struct.
2023-09-19don't default to NEON intrinsics in build.rs for big-endian targetsJack O'Connor
2023-09-19c/blake3_impl.h: don't try to do NEON on big-endian aarch64.Havard Eidnes
...because this would otherwise hit #error "This implementation only supports little-endian ARM." in c/blake3_neon.c.
2023-09-19minor cleanup in Hasher docsJack O'Connor
2023-09-16make update_reader/mmap/mmap_rayon return selfJack O'Connor
This makes them consistent with how the existing update() and update_rayon() methods work, with the difference being that it's it's io::Result<&mut Self> instead of just &mut Self.
2023-09-16replace the new file module with inherent methods on HasherJack O'Connor
New methods: - update_reader - update_mmap - update_mmap_rayon These are more discoverable, more convenient, and safer. There are two problems I want to avoid by taking a `Path` instead of a `File`. First, exposing `Mmap` objects to the caller is fundamentally unsafe, and making `maybe_mmap_file` private avoids that issue. Second, taking a `File` raises questions about whether memory mapped reads should behave like regular file reads. (Should they respect the current seek position? Should they update the seek position?) Taking a `Path` from the caller and opening the `File` internally avoids these questions.
2023-09-16move file operations from b3sum to blake3Banyc
2023-09-16document the `zeroize` Cargo featureJack O'Connor
As part of this change, I don't think we need the `zeroize_crate` workaround anymore if we use the relateively new `dep:` syntax in Cargo.toml.
2023-09-10stop using MIPS for big-endian testingJack O'Connor
https://twitter.com/burntsushi5/status/1695483429997945092 https://github.com/rust-lang/compiler-team/issues/648
2023-09-10update the MSRV for b3sum to 1.70.0Jack O'Connor
As usual, the driver here is the MSRV of clap. I should've checked this when I updated the Cargo.lock file.
2023-09-10fix a build break in the blake3_c testsJack O'Connor
2023-09-10update dev-dependenciesJack O'Connor
2023-07-21blake3_dispatch: Fix race condition initializing g_cpu_features.Javier Blazquez
If multiple threads try to compute a hash simultaneously before the library has been used for the first time, the logic in get_cpu_features that detects CPU features will write to g_cpu_features without synchronization, which is a race condition and flagged by ThreadSanitizer. This change marks g_cpu_features as an atomic variable to address the race condition.
2023-07-16Remove unneeded digest/std in std featureElichai Turkel
2023-07-16Add tests for ZeroizeElichai Turkel
2023-07-16Implement Zeroize on exported typesElichai Turkel
2023-07-06version 1.4.11.4.1Jack O'Connor
Changes since 1.4.0: - Improved performance in the ARM NEON implementation for both C and Rust callers. This affects AArch64 targets by default and ARMv7 targets that explicitly enable (and support) NEON. The size of the improvement depends on the microarchitecture, but I've benchmarked ~1.3x on a Cortex-A53 and ~1.2x on an Apple M1. Contributed by @sdlyyxy in #319. - The MSRV is now 1.66.1 for both the `blake3` crate and `b3sum`.
2023-07-06update constant_time_eq to v0.3.0Jack O'Connor
This bumps the MSRV of both `blake3` and `b3sum` to 1.66.1.
2023-07-05retain the old NEON rotations in inline commentsJack O'Connor
2023-07-05NEON rot7/rot12 use shl+srisdlyyxy
2023-07-05NEON: only use __builtin_shufflevector on clangsdlyyxy
2023-07-05Improve NEON rot16/rot8sdlyyxy
2023-06-27Fix typo exendable -> extendable1f604
2023-06-17build(CMake): Rework NEON detectionHenrik S. Gaßmann
Given the myriad of `-mfpu` options for ARM [1], the inability to portably query for CPU support, and the lack of standardized ISA names we have no other choice, but to opt out of automatically supplying NEON compile flags. Instead we simply add the NEON optimized source file if we detect an ISA with guaranteed NEON support (>= ARMv8) or the user explicitly requests it (in which case he is expected to provide the compile flags with `CMAKE_C_FLAGS` or `BLAKE3_CFLAGS_NEON` either through a toolchain file or commandline parameters). [1]: https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
2023-06-17correct the VERSION in CMakeLists.txtJack O'Connor
2023-06-17build(CMake): Fix pkg-config directory specificationHenrik S. Gaßmann
- Properly add the install prefix to the libdir and includedir. - Define the prefix once. - Quote paths which may contain whitespace.
2023-06-08version 1.4.01.4.0Jack O'Connor
Changes since 1.3.3: - The C implementation provides a `CMakeLists.txt` for callers who build with CMake. The CMake build is not yet stable, and callers should expect breaking changes in patch version updates. The "by hand" build will always continue to be supported and documented. - `b3sum` supports the `--seek` flag, to set the starting position in the output stream. - `b3sum --check` prints a summary of errors to stderr. - `Hash::as_bytes` is const. - `Hash` supports `from_bytes`, which is const.
2023-06-08update memmap2 to v0.7.0Jack O'Connor