1
0
Fork 0
mirror of https://github.com/BLAKE3-team/BLAKE3 synced 2024-05-30 15:46:09 +02:00
Commit Graph

245 Commits

Author SHA1 Message Date
Jack O'Connor 72ba63ca86 turn on AVX-512 in the test vectors 2020-01-04 21:49:38 -05:00
Jack O'Connor 5b4f79fc7f comment punctuation nit 2020-01-04 10:30:59 -05:00
JP Aumasson 86aaa13064 merge fix 2020-01-04 04:33:55 -05:00
JP Aumasson 02be834292 readme tweaks 2020-01-04 04:30:43 -05:00
Jack O'Connor dc324a189e add the guts module to share code with Bao 2019-12-29 11:55:19 -06:00
Jack O'Connor 2fac7447e0 make derive_key take a key of any length
The previous version of this API called for a key of exactly 256 bits.
That's good for optimal performance, but it would mean losing the
use-with-other-algorithms property for applications whose input keys are
a different size. There's no way for an abstraction over the previous
version to provide reliable domain separation for the "extract" step.
2019-12-28 17:56:29 -06:00
Jack O'Connor ba28064963 switch back to counting trailing 0 bits
These things are totally equivalent, and I keep going back and forth,
but now I think this is slightly clearer.
2019-12-24 16:51:43 -06:00
Jack O'Connor c9ffbdd365 use self.flags instead of self.chunk_state.flags in the reference impl
This is clearer, and because of padding requirements it doesn't change
the size of the Hasher struct. (We have a test for this.)
2019-12-24 13:30:04 -06:00
Jack O'Connor 8aae07f91a switch from counting trailing 0 bits to counting trailing 1 bits 2019-12-24 13:12:18 -06:00
Jack O'Connor 6c1155a41d get rid of unnecessary variables in push_chunk_chaining_value 2019-12-23 15:47:40 -06:00
Jack O'Connor 3016ddcb3a add a parent_cv helper function to the reference impl
Also use fewer array references (the compiler doesn't care) be more
explicit with a `new_cv` mutable variable. This clarifies
push_chunk_chaining_value just a bit. Since that's the trickiest
function in the entire thing, it's good to clarify it. (It also gets
excerpted directly into the spec.)
2019-12-23 15:14:13 -06:00
Jack O'Connor 021c7b66be switch to simplified rotations
This is a performance improvement on modern x86 chips (Skylake and
later), and the LLVM optimizer can convert these to AVX-512 rotations
when those are enabled.
2019-12-23 13:41:06 -06:00
Jack O'Connor e800e0659f rework push_chunk_chaining_value in terms of trailing 0's 2019-12-22 16:31:47 -05:00
Jack O'Connor 5fb359023c add a readme link to b3sum 2019-12-15 19:22:01 -05:00
Jack O'Connor 5f29918b7e add a LICENSE file including CC0 and Apache 2.0 2019-12-15 17:44:01 -05:00
Jack O'Connor ab88db1aed docs tweaks 2019-12-14 10:13:10 -05:00
Jack O'Connor e6e4e6d687 a few more comments in reference_impl.rs 2019-12-14 09:55:50 -05:00
Jack O'Connor 7f20c473f2 show the default value for b3sum --length 2019-12-13 16:23:03 -05:00
Jack O'Connor ddd4f4a202 make the b3sum --help text wording more consistent 2019-12-13 16:17:57 -05:00
Jack O'Connor b1b507d43a make b3sum --keyed and --derive-key read the key from stdin
Putting secret keys on the command line is bad practice, because command
line args are usually globally visible within the OS. Even if these
flags are mostly intended for testing and experimentation, we might as
well do the right thing. Plus this saves people the trouble of hex
encoding their keys.
2019-12-13 16:10:55 -05:00
Jack O'Connor 1a6e863513 fix another warning in b3sum --no-default-features 2019-12-13 13:27:01 -05:00
Jack O'Connor f54c292a53 silence another warning in the --no-default-features tests 2019-12-13 13:19:44 -05:00
Jack O'Connor d963fe18f3 test release mode in CI
As part of this, get rid of the BLAKE3_FUZZ_ITERATIONS variable. I
wasn't using it anywhere, and it was leading to some compiler warnings
in --no-default-features mode.
2019-12-13 13:15:48 -05:00
Jack O'Connor 0c245f21bf fix the doc tests build 2019-12-13 13:12:06 -05:00
Jack O'Connor aa0d282ee5 add to b3sum/README.md 2019-12-13 13:10:05 -05:00
Jack O'Connor 811b5109c5 add --no-names to b3sum
Printing all names by default is more consistent with Coreutils.
2019-12-13 13:08:50 -05:00
Jack O'Connor 04f5ccd648 expand the docs 2019-12-13 12:53:09 -05:00
Jack O'Connor 1384edd67c rename 1_chunk benchmarks to 1_kib 2019-12-13 10:06:46 -05:00
Jack O'Connor fb0682c4c5 add 2 KiB benchmarks 2019-12-13 09:23:21 -05:00
Jack O'Connor a52d4daa98 update MAX_DEPTH 2019-12-12 23:40:13 -05:00
Jack O'Connor fe9b8fedd7 fix benchmarks build 2019-12-12 23:31:02 -05:00
Jack O'Connor b5f1e925f7 rename "offset" to "counter" and always increment it by 1
This is simpler than sometimes incrementing by CHUNK_LEN and other times
incrementing by BLOCK_LEN.
2019-12-12 21:41:30 -05:00
Jack O'Connor a5cc3b2867 reduce the CHUNK_LEN from 2048 bytes to 1024 bytes
Smaller chunk sizes are a big benefit for parallelism at shorter input
lengths, and recent benchmarks show that this reduction has a relative
small cost in terms of peak throughput. It's also a nice round number.
2019-12-12 20:39:00 -05:00
Jack O'Connor 66fee0c6ef add some more description in README.md 2019-12-12 15:22:09 -05:00
Jack O'Connor 9bf1020213 make the "c_avx512" feature a no-op on non-x86
This lets us enable it by default in b3sum.
2019-12-12 15:13:04 -05:00
Jack O'Connor b9a05913ee fix the test_vectors build 2019-12-12 14:07:58 -05:00
Jack O'Connor 7cf6b8f174 initial version of b3sum 2019-12-12 13:18:57 -05:00
Jack O'Connor 3b5664c8a5 struct OutputReader 2019-12-12 11:33:21 -05:00
Jack O'Connor 59752de9bd fix syntax errors in ci.yml 2019-12-11 23:21:25 -05:00
Jack O'Connor 6823655aed run the test vectors on cross tests (ARM, MIPS) on CI 2019-12-11 23:19:58 -05:00
Jack O'Connor c8d21fab95 account for Windows newlines when checking for test vector changes 2019-12-11 22:41:59 -05:00
Jack O'Connor a3be434d28 fix bench tests running in the wrong directory 2019-12-11 22:34:03 -05:00
Jack O'Connor 1a57232b49 delete an unused import 2019-12-11 22:32:53 -05:00
Jack O'Connor dd3a72fb9f run test vectors and bench tests in the regular CI test matrix 2019-12-11 22:30:19 -05:00
Jack O'Connor 52ea6487f8 switch to representing CVs as words for the compression function
The portable implementation was getting slowed down by converting back
and forth between words and bytes.

I made the corresponding change on the C side first
(12a37be8b5),
and as part of this commit I'm re-vendoring the C code. I'm also
exposing a small FFI interface to C so that blake3_neon.c can link
against portable.rs rather than blake3_portable.c, see c_neon.rs.
2019-12-11 18:05:26 -05:00
Jack O'Connor d68882da0d test_checked_in_vectors_up_to_date 2019-12-11 11:04:41 -05:00
Jack O'Connor c81d5c2522 test against test_vectors.json in CI 2019-12-11 10:50:18 -05:00
Jack O'Connor 48b3fba833 check in test_vectors.json
This file is generated with:

cd ./test_vectors
cargo run --bin generate > ./test_vectors.json
2019-12-11 10:47:12 -05:00
Jack O'Connor d183149b2e add the test_vectors sub-crate 2019-12-11 10:14:24 -05:00
Jack O'Connor 4ca4c60694 add `cargo +nightly test --benches` to CI 2019-12-10 14:57:46 -05:00