-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from payjoin/secp-only
Prune crate to only use secp256k1 dhkem
- Loading branch information
Showing
17 changed files
with
84 additions
and
2,162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,30 +37,6 @@ jobs: | |
RUSTFLAGS: -D warnings -A dead_code -A unused_imports | ||
run: cargo test --no-default-features --features="secp" | ||
|
||
- name: Run cargo test with just X25519 enabled | ||
env: | ||
CARGO_INCREMENTAL: 0 | ||
RUSTFLAGS: -D warnings -A dead_code -A unused_imports | ||
run: cargo test --no-default-features --features="x25519" | ||
|
||
- name: Run cargo test with just P256 enabled | ||
env: | ||
CARGO_INCREMENTAL: 0 | ||
RUSTFLAGS: -D warnings -A dead_code -A unused_imports | ||
run: cargo test --no-default-features --features="p256" | ||
|
||
- name: Run cargo test with just P384 enabled | ||
env: | ||
CARGO_INCREMENTAL: 0 | ||
RUSTFLAGS: -D warnings -A dead_code -A unused_imports | ||
run: cargo test --no-default-features --features="p384" | ||
|
||
- name: Run cargo test with just P521 enabled | ||
env: | ||
CARGO_INCREMENTAL: 0 | ||
RUSTFLAGS: -D warnings -A dead_code -A unused_imports | ||
run: cargo test --no-default-features --features="p521" | ||
|
||
- name: Run cargo test with all features enabled | ||
env: | ||
CARGO_INCREMENTAL: 0 | ||
|
@@ -91,20 +67,20 @@ jobs: | |
command: fmt | ||
args: --all -- --check | ||
|
||
# Enable this once x25519-dalek has another 2.0-pre.X release | ||
#msrv: | ||
# name: Current MSRV is 1.65.0 | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# # First run `cargo +nightly -Z minimal-verisons check` in order to get a | ||
# # Cargo.lock with the oldest possible deps | ||
# - uses: dtolnay/rust-toolchain@nightly | ||
# - run: cargo -Z minimal-versions check --all-features | ||
# # Now check that `cargo build` works with respect to the oldest possible | ||
# # deps and the stated MSRV | ||
# - uses: dtolnay/[email protected] | ||
# - run: cargo build --all-features | ||
msrv: | ||
name: Current MSRV is 1.63.0 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# Check that `cargo build` works with respect to the oldest possible | ||
# deps and the stated MSRV | ||
- uses: dtolnay/[email protected] | ||
- name: Pin MSRV dependencies | ||
run: | | ||
cargo update | ||
cargo update -p half --precise 2.2.1 | ||
cargo update -p regex --precise 1.9.6 | ||
- run: cargo build --all-features | ||
|
||
clippy: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,19 @@ | ||
[package] | ||
name = "hpke" | ||
repository = "https://github.com/rozbb/rust-hpke" | ||
documentation = "https://docs.rs/rust-hpke" | ||
description = "An implementation of the HPKE hybrid encryption standard (RFC 9180) in pure Rust" | ||
name = "bitcoin-hpke" | ||
repository = "https://github.com/payjoin/bitcoin-hpke" | ||
documentation = "https://docs.rs/bitcoin-hpke" | ||
description = "An implementation of the HPKE hybrid encryption standard (RFC 9180) on libsecp256k1" | ||
readme = "README.md" | ||
version = "0.12.0" | ||
authors = ["Michael Rosenberg <[email protected]>"] | ||
authors = ["Dan Gould <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT/Apache-2.0" | ||
keywords = ["cryptography", "crypto", "key-exchange", "encryption", "aead"] | ||
keywords = ["cryptography", "crypto", "key-exchange", "encryption", "aead", "secp256k1", "bitcoin"] | ||
categories = ["cryptography", "no-std"] | ||
|
||
[features] | ||
# "p256" enables the use of ECDH-NIST-P256 as a KEM | ||
# "p384" enables the use of ECDH-NIST-P384 as a KEM | ||
# "x25519" enables the use of the X25519 as a KEM | ||
default = ["alloc", "p256", "x25519"] | ||
x25519 = ["dep:x25519-dalek"] | ||
p384 = ["dep:p384"] | ||
p256 = ["dep:p256"] | ||
p521 = ["dep:p521"] | ||
k256 = ["dep:k256"] | ||
secp = ["bitcoin", "secp256k1/global-context", "secp256k1/rand-std"] | ||
default = ["alloc", "secp"] | ||
secp = ["secp256k1/global-context", "secp256k1/rand-std"] | ||
# Include allocating methods like open() and seal() | ||
alloc = [] | ||
# Includes an implementation of `std::error::Error` for `HpkeError`. Also does what `alloc` does. | ||
|
@@ -30,21 +22,15 @@ std = [] | |
[dependencies] | ||
aead = "0.5" | ||
aes-gcm = "0.10" | ||
bitcoin = { version = "0.32.0", optional = true } | ||
secp256k1 = { version = "0.29", optional = true } | ||
chacha20poly1305 = "0.10" | ||
generic-array = { version = "0.14", default-features = false } | ||
digest = "0.10" | ||
hkdf = "0.12" | ||
hmac = "0.12" | ||
rand_core = { version = "0.6", default-features = false } | ||
k256 = { version = "0.13", default-features = false, features = ["arithmetic", "ecdh"], optional = true} | ||
p256 = { version = "0.13", default-features = false, features = ["arithmetic", "ecdh"], optional = true} | ||
p384 = { version = "0.13", default-features = false, features = ["arithmetic", "ecdh"], optional = true} | ||
p521 = { version = "0.13", default-features = false, features = ["arithmetic", "ecdh"], optional = true} | ||
sha2 = { version = "0.10", default-features = false } | ||
subtle = { version = "2.6", default-features = false } | ||
x25519-dalek = { version = "2", default-features = false, features = ["static_secrets"], optional = true } | ||
zeroize = { version = "1", default-features = false, features = ["zeroize_derive"] } | ||
|
||
[dev-dependencies] | ||
|
@@ -55,14 +41,6 @@ serde = { version = "1.0", features = ["derive"] } | |
serde_json = "1.0" | ||
rand = { version = "0.8", default-features = false, features = ["getrandom", "std_rng"] } | ||
|
||
[[example]] | ||
name = "client_server" | ||
required-features = ["x25519"] | ||
|
||
[[example]] | ||
name = "agility" | ||
required-features = ["p256", "p384", "p521", "x25519"] | ||
|
||
# Tell docs.rs to build docs with `--all-features` and `--cfg docsrs` (for nightly docs features) | ||
[package.metadata.docs.rs] | ||
all-features = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.