Skip to content

Commit f9af45f

Browse files
authored
Add belt-hash (#416)
1 parent 4561d6f commit f9af45f

File tree

14 files changed

+711
-17
lines changed

14 files changed

+711
-17
lines changed

.github/workflows/belt-hash.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: belt-hash
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/belt-hash.yml"
7+
- "belt-hash/**"
8+
- "Cargo.*"
9+
push:
10+
branches: master
11+
12+
defaults:
13+
run:
14+
working-directory: belt-hash
15+
16+
env:
17+
CARGO_INCREMENTAL: 0
18+
RUSTFLAGS: "-Dwarnings"
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
rust:
26+
- 1.57.0 # MSRV
27+
- stable
28+
target:
29+
- thumbv7em-none-eabi
30+
- wasm32-unknown-unknown
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: RustCrypto/actions/cargo-cache@master
34+
- uses: actions-rs/toolchain@v1
35+
with:
36+
profile: minimal
37+
toolchain: ${{ matrix.rust }}
38+
target: ${{ matrix.target }}
39+
override: true
40+
- run: cargo build --no-default-features --target ${{ matrix.target }}
41+
42+
minimal-versions:
43+
uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master
44+
with:
45+
working-directory: ${{ github.workflow }}
46+
47+
test:
48+
runs-on: ubuntu-latest
49+
strategy:
50+
matrix:
51+
rust:
52+
- 1.57.0 # MSRV
53+
- stable
54+
steps:
55+
- uses: actions/checkout@v3
56+
- uses: RustCrypto/actions/cargo-cache@master
57+
- uses: actions-rs/toolchain@v1
58+
with:
59+
profile: minimal
60+
toolchain: ${{ matrix.rust }}
61+
override: true
62+
- run: cargo check --all-features
63+
- run: cargo test --no-default-features
64+
- run: cargo test
65+
- run: cargo test --all-features

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
target/
22
*/target/
33
*/*/target/
4+
*/Cargo.lock

Cargo.lock

Lines changed: 37 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ members = [
2121
"tiger",
2222
"whirlpool",
2323
]
24+
exclude = ["belt-hash"]
2425

2526
[profile.dev]
2627
opt-level = 2

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Additionally all crates do not require the standard library (i.e. `no_std` capab
1313

1414
| Algorithm | Crate | Crates.io | Documentation | MSRV | [Security] |
1515
|-----------|-------|:---------:|:-------------:|:----:|:----------:|
16+
| [BelT] hash | [`belt-hash`] | [![crates.io](https://img.shields.io/crates/v/belt-hash.svg)](https://crates.io/crates/belt-hash) | [![Documentation](https://docs.rs/belt-hash/badge.svg)](https://docs.rs/belt-hash) | ![MSRV 1.57][msrv-1.57] | :green_heart: |
1617
| [BLAKE2] | [`blake2`] | [![crates.io](https://img.shields.io/crates/v/blake2.svg)](https://crates.io/crates/blake2) | [![Documentation](https://docs.rs/blake2/badge.svg)](https://docs.rs/blake2) | ![MSRV 1.41][msrv-1.41] | :green_heart: |
1718
| [FSB] | [`fsb`] | [![crates.io](https://img.shields.io/crates/v/fsb.svg)](https://crates.io/crates/fsb) | [![Documentation](https://docs.rs/fsb/badge.svg)](https://docs.rs/fsb) | ![MSRV 1.41][msrv-1.41] | :green_heart: |
1819
| [GOST R 34.11-94][GOST94] | [`gost94`] | [![crates.io](https://img.shields.io/crates/v/gost94.svg)](https://crates.io/crates/gost94) | [![Documentation](https://docs.rs/gost94/badge.svg)](https://docs.rs/gost94) | ![MSRV 1.41][msrv-1.41] | :yellow_heart: |
@@ -230,9 +231,11 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
230231
[deps-image]: https://deps.rs/repo/github/RustCrypto/hashes/status.svg
231232
[deps-link]: https://deps.rs/repo/github/RustCrypto/hashes
232233
[msrv-1.41]: https://img.shields.io/badge/rustc-1.41.0+-blue.svg
234+
[msrv-1.57]: https://img.shields.io/badge/rustc-1.57.0+-blue.svg
233235

234236
[//]: # (crates)
235237

238+
[`belt-hash`]: ./belt-hash
236239
[`blake2`]: ./blake2
237240
[`fsb`]: ./fsb
238241
[`gost94`]: ./gost94
@@ -270,6 +273,7 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
270273

271274
[//]: # (algorithms)
272275

276+
[BelT]: https://ru.wikipedia.org/wiki/BelT
273277
[BLAKE2]: https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE2
274278
[FSB]: https://en.wikipedia.org/wiki/Fast_syndrome-based_hash
275279
[GOST94]: https://en.wikipedia.org/wiki/GOST_(hash_function)

belt-hash/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## 0.1.0 (2022-09-23)
9+
- Initial release ([#416])
10+
11+
[#416]: https://github.com/RustCrypto/hashes/pull/416

belt-hash/Cargo.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[package]
2+
name = "belt-hash"
3+
version = "0.1.0"
4+
description = "BelT hash function (STB 34.101.31-2020)"
5+
authors = ["RustCrypto Developers"]
6+
license = "MIT OR Apache-2.0"
7+
readme = "README.md"
8+
edition = "2021"
9+
rust-version = "1.57"
10+
documentation = "https://docs.rs/belt-hash"
11+
repository = "https://github.com/RustCrypto/hashes"
12+
keywords = ["crypto", "belt", "stb", "hash", "digest"]
13+
categories = ["cryptography", "no-std"]
14+
15+
[dependencies]
16+
digest = "0.10.4"
17+
belt-block = { version = "0.1.1", default-features = false }
18+
19+
[dev-dependencies]
20+
digest = { version = "0.10.4", features = ["dev"] }
21+
hex-literal = "0.3.3"
22+
23+
[features]
24+
default = ["std"]
25+
std = ["digest/std"]
26+
oid = ["digest/oid"]
27+
28+
# TODO: remove when crate will be part of the root workspace
29+
[profile.dev]
30+
opt-level = 2

0 commit comments

Comments
 (0)