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

Belt-HMAC-rng #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
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
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
58 changes: 58 additions & 0 deletions .github/workflows/belt-hmac-rng.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: belt-hmac-rng

on:
pull_request:
paths:
- ".github/workflows/belt-hmac-rng.yml"
- "belt-hmac-rng/**"
- "Cargo.*"
push:
branches: master

defaults:
run:
working-directory: belt-hmac-rng

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings"

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.65.0 # MSRV
- stable
target:
- thumbv7em-none-eabi
- wasm32-unknown-unknown
steps:
- uses: actions/checkout@v4
- 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 }} --feature-powerset --exclude-features std

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

test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.65.0 # MSRV
- stable
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: RustCrypto/actions/cargo-hack-install@master
- run: cargo hack test --feature-powerset
46 changes: 46 additions & 0 deletions .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Workspace

on:
pull_request:
paths-ignore:
- README.md
push:
branches: master
paths-ignore:
- README.md

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings"
RUSTDOCFLAGS: "-Dwarnings"

jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.73.0
components: clippy
- run: cargo clippy --all --all-features --tests

doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- run: cargo doc --workspace --all-features

rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- run: cargo fmt --all -- --check
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[workspace]
resolver = "2"
members = [
"belt-hmac-rng"
]

[profile.dev]
opt-level = 2
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# RustCrypto: CSRNGs [![Build Status](https://travis-ci.org/RustCrypto/CSRNGs.svg?branch=master)](https://travis-ci.org/RustCrypto/CSRNGs)
# RustCrypto: CSRNGs

Collection of Cryptographically Secure Random Number Generators (CSRNG) written
in pure Rust.

Expand All @@ -7,12 +8,18 @@ All algorithms are split into separate crates and implemented using
do not require the standard library (i.e. `no_std` capable) and can
be easily used for bare-metal programming.

## Crates

| Name | Crate name | crates.io | Docs | MSRV |
|-----------------|-------------------|-----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|-------------------------|
| [belt-hmac-rng] | [`belt-hmac-rng`] | [![crates.io](https://img.shields.io/crates/v/belt-hmac-rng.svg)](https://crates.io/crates/belt-hmac-rng) | [![Documentation](https://docs.rs/belt-hmac-rng/badge.svg)](https://docs.rs/aes) | ![MSRV 1.65][msrv-1.65] |

## License

All crates licensed under either of

* [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
* [MIT license](http://opensource.org/licenses/MIT)
* [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
* [MIT license](http://opensource.org/licenses/MIT)

at your option.

Expand All @@ -21,3 +28,13 @@ at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.


[//]: # (badges)
[msrv-1.65]: https://img.shields.io/badge/rustc-1.65.0+-blue.svg

[//]: # (crates)
[`belt-hmac-rng`]: ./belt-hmac-rng

[//]: # (links)
[belt-hmac-rng]: https://apmi.bsu.by/assets/files/std/brng-spec25.pdf
9 changes: 9 additions & 0 deletions belt-hmac-rng/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.1.0 (0000-00-00)
- Initial release
25 changes: 25 additions & 0 deletions belt-hmac-rng/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "belt-hmac-rng"
version = "0.1.0"
description = "Pure Rust implementation of cryptographically secure random number generator based on the Belt-HMAC PRNG."
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
edition = "2021"
readme = "README.md"
documentation = "https://docs.rs/belt-hmac-rng"
repository = "https://github.com/RustCrypto/CSRNGs"
keywords = ["crypto", "rng", "belt-hmac", "hmac", "stb"]
categories = ["cryptography", "no-std"]


[dependencies]
rand_core = { version = "0.6.4", default-features = false }
belt-hash = { version = "0.1.1", default-features = false }
hmac = { version = "0.12.1", features = ["reset"] }

[dev-dependencies]
rand_core = { version = "0.6.4", default-features = false, features = ["getrandom"] }
hex-literal = "0.4.1"

[features]
std = ["rand_core/std"]
Loading