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

Updates to CI actions and README file. #4

Merged
merged 1 commit into from
Jul 8, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
31 changes: 23 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ jobs:
run: rustup update nightly --no-self-update && rustup default nightly
- run: cargo test --release

test-no-default-features:
name: cargo test (${{ matrix.os }}) --no-default-features
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
- run: cargo test --release --no-default-features

clippy:
name: cargo clippy
runs-on: ubuntu-latest
Expand All @@ -58,11 +73,11 @@ jobs:
run: rustup update stable
- run: cargo fmt --all -- --check

# docs:
# name: cargo doc
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Install Rust
# run: rustup update nightly && rustup default nightly
# - run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc -p openthread --no-deps --all-features
docs:
name: cargo doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc -p msecret --no-deps --all-features
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ documentation = "https://docs.rs/msecret"
repository = "https://github.com/darconeous/msecret"
readme = "README.md"
categories = ["cryptography"]
rust-version = "1.70"
edition = "2021"

[features]
"default" = ["openssl", "share", "bin"]
"share" = ["gf256", "crc"]
"bin" = ["rpassword", "shellwords", "rustyline", "mnemonic", "clap" ]
"longtest" = []
"default" = ["openssl", "share", "bin"]

[dependencies]
openssl = { version = "0.10", features = ["vendored"], optional = true }
openssl = { version = ">=0.10.55", features = ["vendored"], optional = true }
gf256 = { version = "0.3", features = ["shamir", "thread-rng"], optional = true }
crc = { version = "3", optional = true }

Expand Down
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# MSecret — Experimental Key Derivation Utility #
MSecret — Experimental Key Derivation Utility
=============================================

[![crates.io][crate-image]][crate-link]
[![Build Status][build-image]][build-link]
[![Documentation][doc-image]][doc-link]
[![dependency status][deps-image]][deps-link]
![MSRV][msrv-image]

-------

This project includes both:

1. A [specification][MSECRET] (with [test vectors][VECTORS]) for deterministically deriving
various types of data (bytes, integers, primes, etc.) and
cryptographic keys (RSA, ECC, etc.) from a symmetric master secret.
2. A reference implementation written in Rust, including a helpful
command-line utility and library.
2. A reference implementation written in Rust, including a [helpful
command-line utility](#command-line-tool) and [library][doc-link].

[MSECRET]: doc/MSECRET.md
[VECTORS]: doc/TEST_VECTORS.md
Expand Down Expand Up @@ -104,14 +113,10 @@ To update an existing installation, use rustup:
$ rustup update
```

Then you can check out a copy of the git repository, test, build, and
install:
Then you can grab the latest version of `msecretctl`:

```shell
$ git clone https://github.com/darconeous/msecret-rust
$ cd msecret-rust
$ cargo test --release
$ cargo install --path .
$ cargo install msecret
```

You should now be able to use the `msecretctl` tool.
Expand Down Expand Up @@ -242,3 +247,17 @@ UIVkSB54IZGHuuQKkYwfCjT69zDGVRwt7A==
# License

Apache 2.0; see [`LICENSE`](LICENSE) for details.

[//]: # (badges)

[crate-image]: https://buildstats.info/crate/msecret
[crate-link]: https://crates.io/crates/msecret
[doc-image]: https://docs.rs/msecret/badge.svg
[doc-link]: https://docs.rs/msecret
[build-image]: https://github.com/darconeous/msecret-rust/workflows/CI/badge.svg
[build-link]: https://github.com/darconeous/msecret-rust/actions?query=workflow%3ACI+branch%3Amain
[msrv-image]: https://img.shields.io/badge/rustc-1.70+-blue.svg
[deps-image]: https://deps.rs/crate/msecret/0.1.1/status.svg
[deps-link]: https://deps.rs/crate/msecret/0.1.1

[//]: # (links)
2 changes: 1 addition & 1 deletion src/rsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ use zeroize::Zeroizing;
/// The algorithm is largely based on the implementation
/// from OpenSSL's `RSA_generate_key()` method, as seen here:
///
/// https://opensource.apple.com/source/OpenSSL097/OpenSSL097-16/openssl/crypto/rsa/rsa_gen.c
/// <https://opensource.apple.com/source/OpenSSL097/OpenSSL097-16/openssl/crypto/rsa/rsa_gen.c>
///
/// This is a straightforward algorithm that avoids doing the
/// sorts of checks that are extremely unlikely to ever be
Expand Down
2 changes: 1 addition & 1 deletion src/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl Secret {
Ok(())
}

/// Recovers a secret from `k` of the shares previously split using [`split_shares()`].
/// Recovers a secret from `k` of the shares previously split using [`Secret::split_shares()`].
pub fn try_from_shares<S: AsRef<[u8]>>(shares: &[S]) -> Result<Secret> {
ensure!(!shares.is_empty(), "No shares given");

Expand Down