1
0
Fork 0
mirror of https://github.com/BLAKE3-team/BLAKE3 synced 2024-05-18 20:36:07 +02:00
Commit Graph

72 Commits

Author SHA1 Message Date
Jack O'Connor 54930c9522 version 1.5.1
Changes since 1.5.0:
- The Rust crate is now compatible with Miri.
- ~1% performance improvement on Arm NEON contributed by @divinity76 (#384).
- Various fixes and improvements in the CMake build.
- The MSRV of b3sum is now 1.74.1. (The MSRV of the library crate is
  unchanged, 1.66.1.)
2024-03-12 00:34:53 -07:00
Jack O'Connor 5b9af1c347 test_miri_smoketest 2024-03-10 09:54:03 -07:00
Jack O'Connor 1ca383ba9b add guts testing to CI 2024-01-21 18:38:06 -08:00
Dirk Stolle 4d32708f51 replace unmaintained actions-rs/toolchain action in CI
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-30 02:28:33 -05:00
Dirk Stolle 5306464d03 update actions/checkout in GitHub Actions to v4 2023-12-28 10:46:51 +01:00
Jack O'Connor 92e4cd71be add the compiler name to CMake CI jobs 2023-11-05 09:18:39 -08:00
Jack O'Connor d7e9365be1 add a test for the new serde feature 2023-09-19 23:43:47 -07:00
Jack O'Connor cb32f0bd14 replace the new file module with inherent methods on Hasher
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-16 17:04:27 -07:00
Jack O'Connor f22d66b307 stop using MIPS for big-endian testing
https://twitter.com/burntsushi5/status/1695483429997945092
https://github.com/rust-lang/compiler-team/issues/648
2023-09-10 14:18:55 -07:00
Jack O'Connor cd4b3140cf update the MSRV for b3sum to 1.70.0
As usual, the driver here is the MSRV of clap. I should've checked this
when I updated the Cargo.lock file.
2023-09-10 14:14:54 -07:00
Elichai Turkel f18e19092b Add tests for Zeroize 2023-07-16 13:29:47 -04:00
Jack O'Connor 99af1ffc66 update constant_time_eq to v0.3.0
This bumps the MSRV of both `blake3` and `b3sum` to 1.66.1.
2023-07-06 13:26:08 -07:00
Jack O'Connor fbc96eb7ad factor out b3sum tests in ci.yml, to support a different MSRV 2023-06-08 12:49:32 -07:00
Henrik S. Gaßmann 4bb0466579 Refactor CMake buildsystem to be portable and modern
Aggreggate source files directly in the target instead of a proxy
variable.

Install CMake package config files in order to allow the project to be
found via `find_package()` by dependents.

Replace hard coded SIMD compiler flags with configurable options. Retain
the current GCC/Clang flags as defaults for these compilers. Add default
SIMD compiler flags for MSVC.

Remove hard coded compiler flags (including -fPIC). These are not
portable and should be set by the toolchain file or on the CLI.

- Guard ASM sources with triplet compatibility checks.
- Remove the `BLAKE3_STATIC` option in favor of [`BUILD_SHARED_LIBS`].

[`BUILD_SHARED_LIBS`]: https://cmake.org/cmake/help/v3.9/variable/BUILD_SHARED_LIBS.html
2023-05-23 14:48:45 -07:00
SteveGremory 3f65cabb7d Fixed CI for CMake. 2023-05-01 01:01:01 -07:00
SteveGremory d7f43a339a Added CI Support for the CMake build, Linux/macOS only (for now) 2023-05-01 01:00:59 -07:00
Jack O'Connor 62772b2d04 add GCC 5.4 to CI 2022-11-22 23:22:14 -08:00
Jack O'Connor 56b72b1738 add another retry loop to upload_github_release_asset.py
While we're at it, black format the .py files in this directory.
2022-11-20 17:18:35 -08:00
Jack O'Connor e067e7f498 add the MSRV toolchain (currently 1.60.0) to CI 2022-11-20 12:45:11 -08:00
Giovanni 9abc602848
Add missing sudo in ci.yml 2022-10-12 00:27:22 +02:00
wargio cf5d59cd43 Support portable build without intrinsics 2022-10-03 11:24:18 +02:00
Jack O'Connor 1631016b86 add a RAYON_NUM_THREADS=1 run to CI 2022-01-18 14:29:44 -05:00
Jack O'Connor 197ad57261 add aarch64-apple-darwin builds to GitHub CI
I'm not sure how to build for Apple Silicon from a Linux host, but it
seems to work as-is from an x86_64 macOS host. Alas, GitHub doesn't yet
provide Apple Silicon hosts to run these binaries, and Cross doesn't yet
support virtualizing them either.
2021-10-21 18:58:32 -04:00
rsdy f4d5c6e785 Disable no_neon feature for C bindings as we can't propagate from cargo build 2021-10-12 16:54:12 +01:00
rsdy faddc5af5c Add no_neon feature tests to CI 2021-10-08 11:51:18 +01:00
Jack O'Connor 05292a018b get rid of the standalone "*_rayon" functions
These clutter the toplevel API, and their prominence might lead callers
to prefer them as a first resort, which probably isn't a good idea.
Restricting multithreading to `Hasher::update_rayon` feels better,
similar to what we've done with `Hasher::finalize_xof`. (But I think
`update_rayon` is still an improvement over the trait-based interface
that it replaced.)
2021-03-21 21:14:13 -04:00
Jack O'Connor 07b746b1b4 gate digest and crypto-mac implementations behind "traits-preview"
This approach was suggested by @tarcieri at
https://github.com/BLAKE3-team/BLAKE3/pull/157.
2021-03-21 15:53:26 -04:00
Jack O'Connor 09546a677d include example.c 2020-10-20 12:51:30 -04:00
Jack O'Connor 3d212291b9 add cross_test.sh for the C bindings
This will let us add big endian testing to CI for our C code. (We were
already doing it for our Rust code.)

This is adapted from test_vectors/cross_test.sh. It works around the
limitation that the `cross` tool can't reach parent directories. It's an
unfortunate hack, but at least it's only for testing. It might've been
less hacky to use symlinks for this somehow, but I worry that would
break things on Windows, and I don't want to have to add workarounds for
my workarounds.
2020-09-29 16:48:18 -04:00
Jack O'Connor cc04130eaa cover the no_sse2 flags in CI testing 2020-09-02 12:23:49 -04:00
Jack O'Connor 5b22bf57c8 add i586-unknown-linux-musl as a test target
Samuel noticed that rustc seems to assume (incorrectly?) that all i686
targets support SSE2, but it doesn't make that assumption for i586.
2020-08-31 18:25:38 -04:00
Jack O'Connor a79fec7e39 fix a build break on x86 targets without guaranteed SSE2 support
This is quite hard to trigger, because SSE2 has been guaranteed for a
long time. But you could trigger it this way:

    rustup target add i686-unknown-linux-musl
    RUSTFLAGS="-C target-cpu=i386" cargo build --target i686-unknown-linux-musl

Note a relevant gotcha though: The `cross` tool will not forward
environment variables like RUSTFLAGS to the container by default, so if
you're testing with `cross` you'll need to use the `rustc` command to
explicitly pass the flag, as I've done here in ci.yml. (Or you could
create a `Cross.toml` file, but I don't want to commit one of those if I
can avoid it.)
2020-08-31 18:25:38 -04:00
Jack O'Connor e4703ac170 rename the C Makefile to Makefile.testing 2020-07-20 09:47:38 -04:00
Jack O'Connor dc2a79d266 add newline and backslash escaping to b3sum output
As proposed in
https://github.com/BLAKE3-team/BLAKE3/issues/33#issuecomment-623153164

This brings b3sum behavior close to md5sum. All occurrences of backslash
are replaced with "\\", and all occurrences of (Unix) newline are
replaced with "\n". In addition, any line containing these escapes has a
single "\" prepended to the front.

Filepaths were already being converted to UTF-8 with to_string_lossy(),
but this commit adds an extra warning when that conversion is in fact
lossy (because the path is not valid Unicode). This new warning is
printed to stdout, with the goal of deliberately breaking --check (which
is not yet implemented) in this case.
2020-05-05 00:59:31 -04:00
Jack O'Connor ba468fbb4f build b3sum binaries in CI for new tags
These configs and code are adapted from the CI workflow in
https://github.com/oconnor663/blake3-py, especially the
upload_github_release_asset.py script, which is copied verbatim.
2020-04-28 11:04:29 -04:00
Jack O'Connor 370ba3644a print the compiler version in CI, for help with debugging 2020-04-11 23:03:32 -04:00
Jack O'Connor e3069da68e only run CI on branches and PRs, not tags 2020-04-02 10:23:46 -04:00
Jack O'Connor b8cdcb1f84 automatically fall back to the pure Rust build
There are two scenarios where compiling AVX-512 C or assembly code might
not work:

1. There might not be a C compiler installed at all. Most commonly this
   is either in cross-compiling situations, or with the Windows GNU
   target.
2. The installed C compiler might not support e.g. -mavx512f, because
   it's too old.

In both of these cases, print a relevant warning, and then automatically
fall back to using the pure Rust intrinsics build.

Note that this only affects x86 targets. Other targets always use pure
Rust, unless the "neon" feature is enabled.
2020-04-01 19:13:15 -04:00
Jack O'Connor 2dff29cf0e turn all compiler warnings into errors in CI 2020-03-31 16:02:57 -04:00
Jack O'Connor 152740578e add testing-only flags to disable individual instruction sets
This lets CI test a wider range of possible SIMD support settings.
2020-03-29 23:12:47 -04:00
Jack O'Connor e06a0f255a refactor the Cargo feature set
The biggest change here is that assembly implementations are enabled by
default.

Added features:
- "pure" (Pure Rust, with no C or assembly implementations.)

Removed features:
- "c" (Now basically the default.)

Renamed features;
- "c_prefer_intrinsics" -> "prefer_intrinsics"
- "c_neon" -> "neon"

Unchanged:
- "rayon"
- "std" (Still the only feature on by default.)
2020-03-29 18:02:03 -04:00
Jack O'Connor 96c36d5df9 add more --release mode testing 2020-03-29 01:01:30 -04:00
Jack O'Connor be4e7babee print instruction set support quietly 2020-03-28 19:51:54 -04:00
Jack O'Connor f77c8ffd7c print out instruction set support in CI 2020-03-28 19:30:28 -04:00
Jack O'Connor eb50d82f16 add release assembly tests 2020-03-28 19:15:25 -04:00
Jack O'Connor 4feadee6bb disable fail-fast for cross tests too 2020-03-24 16:45:33 -04:00
Jack O'Connor fcc14c8c1b more file renaming, use underscores more consistently 2020-02-12 18:41:41 -05:00
Erik Johansson 0281f1ae16 Rename assembly files (blake3-* -> blake3_*)
This gives the assembly files the same prefix as the intrinsics files which
simplifies building when the build system should pick between the assembly and
the intrinsics files.
2020-02-12 23:08:44 +01:00
Jack O'Connor 1c4d7fdd8d add test_asm to the C Makefile 2020-02-12 13:12:05 -05:00
Jack O'Connor b8a1d2d982 integrate assembly implementations into blake3_c_rust_bindings 2020-02-12 10:23:17 -05:00