Skip to content

Commit

Permalink
fix!: remove unneeded pub uses (#94)
Browse files Browse the repository at this point in the history
* fix!: remove unneeded pub use

* Update src/ristretto/constants.rs

Co-authored-by: Stan Bondi <sdbondi@users.noreply.github.com>

* fix: add licence ignore

* fix: add deny file and style lints

* add licence

* chore: add more docs

* make file_license_check executable

* chore: remove makefile

Co-authored-by: Stan Bondi <sdbondi@users.noreply.github.com>
  • Loading branch information
stringhandler and sdbondi committed Jul 4, 2022
1 parent fcb02af commit b81f1bb
Show file tree
Hide file tree
Showing 56 changed files with 629 additions and 877 deletions.
9 changes: 0 additions & 9 deletions .clog.toml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/check_licence.yml
@@ -0,0 +1,24 @@
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
licenses:
name: file licenses
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
- name: install ripgrep
run: |
wget https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep_13.0.0_amd64.deb
sudo dpkg -i ripgrep_13.0.0_amd64.deb
rg --version || exit 1
- name: run the license check
run: ./scripts/file_license_check.sh
2 changes: 1 addition & 1 deletion .github/workflows/clippy-check.yml
Expand Up @@ -23,4 +23,4 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: lints
args: clippy --all-targets --all-features
args: clippy --all-targets --features "wasm,ffi"
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -45,3 +45,13 @@ jobs:
# TODO: re-add all features once https://github.com/rust-lang/packed_simd/pull/341 is used by dalek
# args: --release --all-features
args: --release --features wasm --features ffi
- name: docs build
uses: actions-rs/cargo@v1
with:
command: doc
args: --features wasm --features ffi
- name: bench
uses: actions-rs/cargo@v1
with:
command: check
args: --benches
2 changes: 2 additions & 0 deletions .license.ignore
@@ -0,0 +1,2 @@
./LICENSE
./test_vectors/edDSA_testvectors
14 changes: 6 additions & 8 deletions Cargo.toml
Expand Up @@ -17,24 +17,23 @@ base64 = "0.10.1"
blake2 = "0.9.1"
bulletproofs = { package = "tari_bulletproofs", git = "https://github.com/tari-project/bulletproofs", tag = "v4.2.1" }
bulletproofs_plus = { package = "tari_bulletproofs_plus", git = "https://github.com/tari-project/bulletproofs-plus", tag = "v0.0.6" }
curve25519-dalek = { package = "curve25519-dalek-ng", version = "4.1", default-features = false, features = ["u64_backend", "serde", "alloc"] }
curve25519-dalek = { package = "curve25519-dalek-ng", version = "4.1", default-features = false, features = ["serde", "alloc"] }
digest = "0.9.0"
getrandom = { version = "0.2.3", default-features = false, optional = true }
lazy_static = "1.3.0"
log = "0.4.0"
merlin = { version = "3", default-features = false }
merlin = { version = "3.0.0", default-features = false }
once_cell = "1.8.0"
rand = { version = "0.8", default-features = false }
rand = { version = "0.8.0", default-features = false }
serde = "1.0.89"
serde_json = "1.0"
sha3 = "0.9"
sha3 = "0.9.0"
thiserror = "1.0.20"
wasm-bindgen = { version = "^0.2", features = ["serde-serialize"], optional = true }
zeroize = "1.4.0"

[dev-dependencies]
bincode = "1.1.4"
blake3 = "0.3"
criterion = "0.3.4"
sha2 = "0.9.5"
wasm-bindgen-test = "0.3.24"
Expand All @@ -43,10 +42,9 @@ wasm-bindgen-test = "0.3.24"
cbindgen = "0.17.0"

[features]
default = []
default = ["u64_backend"]
u64_backend = ["curve25519-dalek/u64_backend"]
simd_backend = ["curve25519-dalek/simd_backend", "bulletproofs/simd_backend"]
simd = ["simd_backend"]
avx2 = ["simd_backend"] # deprecated alias for simd_backend
wasm = ["wasm-bindgen", "getrandom/js"]
ffi = []
musig = []
Expand Down
29 changes: 29 additions & 0 deletions LICENSE
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2019, The Tari Developer Community
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5 changes: 4 additions & 1 deletion Makefile
@@ -1,3 +1,6 @@
# Copyright 2019. The Tari Project
# SPDX-License-Identifier: BSD-3-Clause

ifeq ($(shell uname),Darwin)
LDFLAGS := -Ltarget/release/
else
Expand Down Expand Up @@ -39,4 +42,4 @@ wasm-node:
wasm-pack build --target nodejs -d tari_js . -- --features "wasm"

wasm-test:
wasm-pack test --node --features wasm
wasm-pack test --node --features wasm
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -11,7 +11,7 @@ Major features of this library include:
- Pedersen commitments
- Schnorr Signatures
- Generic Public and Secret Keys
- [Musig!](https://blockstream.com/2018/01/23/musig-key-aggregation-schnorr-signatures/)
- [Musig!](https://blockstream.com/2018/01/23/musig-key-aggregation-schnorr-signatures/) **NOT PRODUCTION READY**

The `tari_crypto` crate makes heavy use of the excellent [Dalek](https://github.com/dalek-cryptography/curve25519-dalek)
libraries. The default implementation for Tari ECC is the [Ristretto255 curve](https://ristretto.group).
Expand Down
23 changes: 3 additions & 20 deletions benches/mod.rs
@@ -1,24 +1,7 @@
// Copyright 2019. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
// following disclaimer in the documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
// products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// SPDX-License-Identifier: BSD-3-Clause

#![allow(missing_docs)]

use criterion::criterion_main;

Expand Down
23 changes: 2 additions & 21 deletions benches/range_proof.rs
@@ -1,24 +1,5 @@
// Copyright 2019. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
// following disclaimer in the documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
// products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// SPDX-License-Identifier: BSD-3-Clause

use std::time::Duration;

Expand All @@ -29,8 +10,8 @@ use tari_crypto::{
keys::SecretKey,
range_proof::RangeProofService,
ristretto::{
dalek_range_proof::DalekRangeProofService,
pedersen::{commitment_factory::PedersenCommitmentFactory, PedersenCommitment},
DalekRangeProofService,
RistrettoSecretKey,
},
};
Expand Down
3 changes: 3 additions & 0 deletions benches/signatures.rs
@@ -1,3 +1,6 @@
// Copyright 2022. The Tari Project
// SPDX-License-Identifier: BSD-3-Clause

use std::time::Duration;

use criterion::{criterion_group, BatchSize, Criterion};
Expand Down
17 changes: 2 additions & 15 deletions build.rs
@@ -1,20 +1,7 @@
// Copyright 2020. The Tari Project
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
// following disclaimer in the documentation and/or other materials provided with the distribution.
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
// products derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// SPDX-License-Identifier: BSD-3-Clause

//! Custom build step to generate FFI header if needed
use std::{env, path::Path};

use cbindgen::Config;
Expand Down

0 comments on commit b81f1bb

Please sign in to comment.