Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sha1: implement collision detection and mitigation #566

Merged
merged 37 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f955736
feat(sha1): collision detection
dignifiedquire Feb 21, 2024
e22a1de
add basic tests
dignifiedquire Feb 22, 2024
fdf6903
refactor public api
dignifiedquire Feb 22, 2024
067492a
test: add shattered
dignifiedquire Feb 22, 2024
16b5cef
happy clippy
dignifiedquire Feb 22, 2024
0ff6e0d
feature flags
dignifiedquire Feb 22, 2024
c99b987
remove collision detection from default features
dignifiedquire Feb 22, 2024
bc1e75c
fixup feature flags
dignifiedquire Feb 22, 2024
6ff6dae
implement zeroize
dignifiedquire Feb 22, 2024
a13a46f
refactor: allow for both regular implementation and collision detecti…
dignifiedquire Feb 23, 2024
d257374
add benchmarks
dignifiedquire Feb 23, 2024
1fac270
start simplifying code
dignifiedquire Feb 23, 2024
2f5c9b1
more streamlining
dignifiedquire Feb 23, 2024
d791599
some more code cleanup
dignifiedquire Feb 23, 2024
dcb730a
add more benchmarks
dignifiedquire Feb 23, 2024
642a070
reduce code duplication, improve perf slightly
dignifiedquire Feb 23, 2024
eff6a9b
improve inline hints
dignifiedquire Feb 23, 2024
d6c95ed
CR: improve docs
dignifiedquire Feb 29, 2024
cfb93a8
refactor: keep collision detection seperate
dignifiedquire Mar 1, 2024
23d804f
cleanup
dignifiedquire Mar 1, 2024
3a87423
docs: improve attribution and licensing notes
dignifiedquire Mar 2, 2024
fd77654
fix quote
dignifiedquire Mar 2, 2024
01f2d1b
refactor: move compression implementation into checked mod
dignifiedquire Mar 2, 2024
57216db
restrict api
dignifiedquire Mar 2, 2024
17ff32c
fmt
dignifiedquire Mar 2, 2024
64dd689
refactor: move to its own crate
dignifiedquire Mar 4, 2024
888e7dc
remove extern crate std
dignifiedquire Mar 4, 2024
961942f
revert unrelated change
dignifiedquire Mar 4, 2024
901f8b7
docs: add reference to new crate to sha1 readme
dignifiedquire Mar 4, 2024
96589d4
ci: update workflow name
dignifiedquire Mar 4, 2024
67da70c
add extern std
dignifiedquire Mar 4, 2024
30009ad
test: add reduced round collision test
dignifiedquire Mar 4, 2024
d2afd9e
test: add more reduced rounds hash test
dignifiedquire Mar 4, 2024
6a0da53
apply CR
dignifiedquire Mar 13, 2024
417110e
refactor: backport to 0.10
dignifiedquire Mar 13, 2024
0d129f4
exclude shattered files from publishing
dignifiedquire Mar 13, 2024
2cb69a3
fixup zeroize
dignifiedquire Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 155 additions & 0 deletions .github/workflows/sha1-checked.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: sha1-checked

on:
pull_request:
paths:
- ".github/workflows/sha1-checked.yml"
- "sha1-checked/**"
- "Cargo.*"
push:
branches: master

defaults:
run:
working-directory: sha1-checked

env:
RUSTFLAGS: "-Dwarnings"
CARGO_INCREMENTAL: 0

jobs:
set-msrv:
uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master
with:
msrv: 1.72.0

# Builds for no_std platforms
build:
needs: set-msrv
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- ${{needs.set-msrv.outputs.msrv}}
- stable
target:
- thumbv7em-none-eabi
- wasm32-unknown-unknown
- loongarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- uses: RustCrypto/actions/cargo-hack-install@master
- run: cargo hack build --target ${{ matrix.target }} --each-feature --exclude-features default,std

minimal-versions:
uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master
with:
working-directory: ${{ github.workflow }}

# Linux tests
linux:
needs: set-msrv
strategy:
matrix:
include:
# 32-bit Linux/x86
#- target: i686-unknown-linux-gnu
# rust: ${{needs.set-msrv.outputs.msrv}}
# deps: sudo apt update && sudo apt install gcc-multilib
#- target: i686-unknown-linux-gnu
# rust: stable
# deps: sudo apt update && sudo apt install gcc-multilib

# 64-bit Linux/x86_64
- target: x86_64-unknown-linux-gnu
rust: ${{needs.set-msrv.outputs.msrv}}
- target: x86_64-unknown-linux-gnu
rust: stable

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- uses: RustCrypto/actions/cargo-hack-install@master
- run: ${{ matrix.deps }}
- run: cargo hack test --feature-powerset

# macOS tests
macos:
needs: set-msrv
strategy:
matrix:
rust:
- ${{needs.set-msrv.outputs.msrv}}
- stable

runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: x86_64-apple-darwin
- run: cargo test --no-default-features
- run: cargo test
- run: cargo test --all-features

# Windows tests
windows:
needs: set-msrv
strategy:
matrix:
include:
# 64-bit Windows (GNU)
- target: x86_64-pc-windows-gnu
toolchain: ${{needs.set-msrv.outputs.msrv}}
- target: x86_64-pc-windows-gnu
toolchain: stable

runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
targets: ${{ matrix.target }}
- uses: msys2/setup-msys2@v2
- run: cargo test --target ${{ matrix.target }}

# Cross-compiled tests
cross:
strategy:
matrix:
rust:
- 1.72.0
- stable
target:
- aarch64-unknown-linux-gnu
- powerpc-unknown-linux-gnu
features:
- default

runs-on: ubuntu-latest
defaults:
run:
# Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml
working-directory: .
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cross-tests
with:
rust: ${{ matrix.rust }}
package: ${{ github.workflow }}
target: ${{ matrix.target }}
features: ${{ matrix.features }}
Loading
Loading