1
0
Fork 0
mirror of https://github.com/BLAKE3-team/BLAKE3 synced 2024-05-25 19:06:02 +02:00
Commit Graph

312 Commits

Author SHA1 Message Date
Samuel Neves a3ec6c1ccf enable CET on asm 2020-06-27 17:44:43 +01:00
Jack O'Connor 4c41a893a0 a little bit of cleanup and more testing 2020-06-14 14:35:47 -04:00
Justus K 1ecb14ce34 Replace std::io::copy with clone_from_slice 2020-06-14 14:35:14 -04:00
Justus K 7eea9b4c75 Bump digest to 0.9.0 and crypto-mac to 0.8.0 2020-06-14 14:35:14 -04:00
Jack O'Connor e63ad97e8b link to prebuilt binaries from the b3sum README 2020-05-26 00:25:39 -04:00
Jack O'Connor f287b56bc6 all-capitalize "FILE" in the b3sum help output 2020-05-25 21:22:29 -04:00
Jack O'Connor 0215604c59 avoid repeating a string 2020-05-25 21:20:43 -04:00
Jack O'Connor ca9687e36c fix another small mistake in the docs 2020-05-23 15:16:02 -04:00
Jack O'Connor 0694d0f6a5 fix a typo in the docs 2020-05-23 15:13:19 -04:00
Jack O'Connor 8d6f0f2574 add a test comment 2020-05-23 14:56:43 -04:00
Jack O'Connor 7f154ceea3 version 0.3.4
Changes since 0.3.3:
- `b3sum` now supports the `--check` flag. This is intended to be a
  drop-in replacement for e.g. `md5sum --check` from Coreutils. The
  behavior is somewhat stricter than Coreutils with respect to invalid
  Unicode in filenames. For a complete description of how `--check`
  works, see the file `b3sum/what_does_check_do.md`.
- To support the `--check` feature, backslashes and newlines that appear
  in filenames are now escaped in the output of `b3sum`. This is done
  the same way as in Coreutils.
- To support `--check` interoperability between Unix and Windows,
  backslashes in filepaths on Windows are now replaced with forward
  slashes in the output of `b3sum`. Note that this is different from
  Coreutils.
2020-05-23 14:37:49 -04:00
Jack O'Connor cd093791ab remove an extra space in some help text 2020-05-23 14:28:10 -04:00
Jack O'Connor 48512ec4f0 use wild::args_os to support globbing on Windows 2020-05-23 12:46:45 -04:00
Jack O'Connor c9a1676942 add support for --quiet to `b3sum --check`
Suggested by @llowrey:
https://github.com/BLAKE3-team/BLAKE3/issues/33#issuecomment-629853747
2020-05-23 12:27:48 -04:00
Jack O'Connor cd436251b6 some more clarifications in the --check docs 2020-05-16 13:29:10 -04:00
Jack O'Connor e1f3043e76 clarify the replacement character example 2020-05-15 16:11:11 -04:00
Jack O'Connor c71d88ce37 small typo 2020-05-15 16:05:18 -04:00
Jack O'Connor e8a868d6e5 finish the --check documentation 2020-05-15 15:58:29 -04:00
Jack O'Connor 82005455be link to the test vectors from the README 2020-05-15 13:19:59 -04:00
Jack O'Connor ae8cf2f924 start documenting the --check flag 2020-05-14 18:35:31 -04:00
Jack O'Connor 5651ce7ee0 enable clap default features
These are nice to have. I used to think this would increase build times,
but in practice it doesn't.
2020-05-14 11:32:05 -04:00
Jack O'Connor 86d5a13731 clarify that --no-mmap disables threading 2020-05-14 11:29:28 -04:00
Jack O'Connor 1d03c7d3fa print per-file errros more gracefuly in --check 2020-05-14 11:19:31 -04:00
Jack O'Connor 11edfb76f3 print more compiler version info in CI 2020-05-13 18:45:39 -04:00
Jack O'Connor c5c07bb337 refactor b3sum to support --check
This is an overall cleanup of everything that b3sum is doing, especially
file opening and memory mapping, which makes it easier for the regular
hashing mode to share code with the checking mode.
2020-05-13 18:23:59 -04:00
Jack O'Connor 5030c0f1c3 switch from assert_cmd to CARGO_BIN_EXE_* 2020-05-13 17:47:59 -04:00
Jack O'Connor c6a99dbb23 add parse_check_line
As part of this, reorganize b3sum tests into src/unit_tests.rs and
tests/cli_tests.rs.
2020-05-12 17:09:38 -04:00
Jack O'Connor 584a66598d stop printing the lossy warning
Rather than breaking the check parse with more output, we'll have a rule
that a Unicode replacement character (�) in a path name automatically
fails the check.
2020-05-12 09:58:54 -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 4ad79ae457 lower our required version of `cc`
I've tested manually and found that 1.0.4 is the oldest version of `cc`
that builds successfully for us. (Version 1.0.3 is missing the
`is_flag_supported` method.)

This change might help with
https://github.com/BLAKE3-team/BLAKE3/issues/83. That said, the
underlying issue there is related to "minimum supported Rust versions",
and `blake3` does not yet have an MSRV other than latest stable.
2020-05-04 10:23:03 -04:00
Jack O'Connor 0db6fddc86 version 0.3.3
Changes since 0.3.2:
- `b3sum` binaries are built in CI and attached to new GitHub tags.
2020-04-28 11:20:39 -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 fcb4b83419 version 0.3.2
Changes since 0.3.1:
- Fixed a compiler error on older versions of Clang,
  https://github.com/BLAKE3-team/BLAKE3/issues/79.
2020-04-14 01:13:38 -04:00
Jack O'Connor d5e26538fc refactor build.rs
Two main changes:
- In https://github.com/BLAKE3-team/BLAKE3/issues/79 we learned that
  older versions of Clang require AVX-512 flags even to compile AVX-512
  assembly.
- If the C compiler doesn't support AVX-512, we'd still prefer to build
  the SSE4.1 and AVX2 assembly implementations, on x86_64.
2020-04-13 20:46:42 -04:00
Samuel Neves 7ef795d62e Do not require AVX512DQ
Whereas vinserti64x4 is present on AVX512F, vinserti32x8 requires
AVX512DQ, which we do not test for. At this point there is not
much risk of incompatibility, since Skylake-X chips have all the
requires instruction sets, but let's be precise about this.
2020-04-12 11:38:11 +01: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 86c3174d5b unbreak neon benchmarks
A helper function was incorrectly restricted to x86-only. CI doesn't
currently cover this, because benchmarks are nightly-only, and it's kind
of inconvenient to set RUSTC_BOOTSTRAP=1 through `cross` (which normally
doesn't propagate env vars). But maybe we should start...
2020-04-10 11:24:39 -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 5e82396d80 version 0.3.1
Changes since 0.3.0:
- The x86 build now automatically falls back to "pure" Rust intrinsics,
  under either of two possible conditions:
  1. The `cc` crate fails to invoke a C compiler at all, indicating that
     nothing of the right name (e.g. "cc" or "$CC" on Unix) is installed.
  2. The `cc` crate detects that the compiler doesn't support AVX-512
     flags, usually because it's too old.
  The end result should be that most callers successfully build the
  assembly implementations, and that callers who can't build those see a
  warning but not an error. (And note that Cargo suppresses warnings for
  non-path depencies.)
2020-04-02 10:08:47 -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
Samuel Neves eec458d03e move prototypes to shared header file, and make all local functions static. 2020-03-31 21:21:08 +01:00
Jack O'Connor 2dff29cf0e turn all compiler warnings into errors in CI 2020-03-31 16:02:57 -04:00
Jack O'Connor 27f3273d68 put the CI badge back down in the README 2020-03-30 10:13:41 -04:00
Jack O'Connor 6fbc1a679d version 0.3.0
Changes since version 0.2.3:
- The optimized assembly implementations are now built by default. They
  perform better than the intrinsics implementations, and they compile
  much more quickly. Bringing the default behavior in line with reported
  benchmark figures should also simplify things for people running their
  own benchmarks. Previously this crate only built Rust intrinsics
  implementations by default, and the assembly implementations were
  gated by the (slightly confusingly named) "c" feature. Now the "c"
  feature is gone, and applications that need the old behavior can use
  the new "pure" feature. Mainly this will be applications that don't
  want to require a C compiler. Note that the `b3sum` crate previously
  activated the "c" feature by default, so its behavior hasn't changed.
2020-03-30 00:36:13 -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 7caf1ad4bb version 0.2.3
Changes since version 0.2.2:
- Bug fix: Commit 13556be fixes a crash on Windows when using the SSE4.1
  assembly implementation (--features=c, set by default for b3sum). This
  is undefined behavior and therefore a potential security issue.
- b3sum now supports the --num-threads flag.
- The C API now includes a blake3_hasher_finalize_seek() function, which
  returns output from any position in the extended output stream.
- Build fix: Commit 5fad419 fixes a compiler error in the AVX-512 C
  intrinsics implementation targeting the Windows GNU ABI.
2020-03-29 01:44:00 -04:00
Jack O'Connor 5fad419a8d add a Windows GNU AVX-512 build break workaround
The break in question only repros under --release, and we didn't start
testing a release build of the prefer-intrinsics mode until just now.
2020-03-29 01:42:41 -04:00
Jack O'Connor 96c36d5df9 add more --release mode testing 2020-03-29 01:01:30 -04:00
Samuel Neves 13556be388 save missing clobbered registers on Windows 2020-03-29 05:53:37 +01:00