diff --git a/Makefile b/Makefile index 3ec36dee90..5f61eda9b4 100644 --- a/Makefile +++ b/Makefile @@ -143,6 +143,12 @@ install_tarpaulin: install_rs_build_toolchain cargo $(CARGO_RS_BUILD_TOOLCHAIN) install cargo-tarpaulin --locked || \ ( echo "Unable to install cargo tarpaulin, unknown error." && exit 1 ) +.PHONY: install_cargo_deny # Install cargo-deny to check licenses +install_cargo_deny: install_rs_build_toolchain + @cargo deny --version > /dev/null 2>&1 || \ + cargo $(CARGO_RS_BUILD_TOOLCHAIN) install cargo-deny || \ + ( echo "Unable to install cargo deny, unknown error." && exit 1 ) + .PHONY: install_tfhe_lints # Install custom tfhe-rs lints install_tfhe_lints: (cd utils/cargo-tfhe-lints-inner && cargo install --path .) && \ @@ -296,6 +302,10 @@ check_newline: check_linelint_installed lint_workflow: check_actionlint_installed actionlint +.PHONY: check_licenses # Run cargo-deny to check dependencies licenses +check_licenses: install_cargo_deny + cargo deny check licenses + .PHONY: clippy_core # Run clippy lints on core_crypto with and without experimental features clippy_core: install_rs_check_toolchain RUSTFLAGS="$(RUSTFLAGS)" cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" clippy \ @@ -1251,14 +1261,14 @@ sha256_bool: install_rs_check_toolchain --features=$(TARGET_ARCH_FEATURE),boolean .PHONY: pcc # pcc stands for pre commit checks (except GPU) -pcc: no_tfhe_typo no_dbg_log check_fmt check_typos lint_doc check_md_docs_are_tested check_intra_md_links \ +pcc: no_tfhe_typo no_dbg_log check_fmt check_typos check_licenses lint_doc check_md_docs_are_tested check_intra_md_links \ clippy_all tfhe_lints check_compile_tests .PHONY: pcc_gpu # pcc stands for pre commit checks for GPU compilation pcc_gpu: clippy_gpu clippy_cuda_backend check_compile_tests_benches_gpu check_rust_bindings_did_not_change .PHONY: fpcc # pcc stands for pre commit checks, the f stands for fast -fpcc: no_tfhe_typo no_dbg_log check_fmt check_typos lint_doc check_md_docs_are_tested clippy_fast \ +fpcc: no_tfhe_typo no_dbg_log check_fmt check_typos check_licenses lint_doc check_md_docs_are_tested clippy_fast \ check_compile_tests .PHONY: conformance # Automatically fix problems that can be fixed diff --git a/apps/trivium/Cargo.toml b/apps/trivium/Cargo.toml index f309a54b5b..ec74e5a19d 100644 --- a/apps/trivium/Cargo.toml +++ b/apps/trivium/Cargo.toml @@ -2,6 +2,7 @@ name = "tfhe-trivium" version = "0.1.0" edition = "2021" +license = "BSD-3-Clause-Clear" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/deny.toml b/deny.toml new file mode 100644 index 0000000000..80e3601112 --- /dev/null +++ b/deny.toml @@ -0,0 +1,27 @@ +# This section is considered when running `cargo deny check licenses` +# More documentation for the licenses section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html +[licenses] +# List of explicitly allowed licenses +# See https://spdx.org/licenses/ for list of possible licenses +# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. +allow = [ + "MIT", + "BSD-3-Clause", + "ISC", + "Apache-2.0", + "Unicode-DFS-2016" +] + +exceptions = [ + { crate = "concrete-csprng", allow = ["BSD-3-Clause-Clear"] }, + { crate = "concrete-fft", allow = ["BSD-3-Clause-Clear"] }, + { crate = "concrete-ntt", allow = ["BSD-3-Clause-Clear"] }, + { crate = "tasks", allow = ["BSD-3-Clause-Clear"] }, + { crate = "tfhe", allow = ["BSD-3-Clause-Clear"] }, + { crate = "tfhe-cuda-backend", allow = ["BSD-3-Clause-Clear"] }, + { crate = "tfhe-trivium", allow = ["BSD-3-Clause-Clear"] }, + { crate = "tfhe-versionable", allow = ["BSD-3-Clause-Clear"] }, + { crate = "tfhe-versionable-derive", allow = ["BSD-3-Clause-Clear"] }, + { crate = "tfhe-zk-pok", allow = ["BSD-3-Clause-Clear"] } +] \ No newline at end of file diff --git a/tasks/Cargo.toml b/tasks/Cargo.toml index dfe0aa2513..0a73c9c70f 100644 --- a/tasks/Cargo.toml +++ b/tasks/Cargo.toml @@ -2,6 +2,7 @@ name = "tasks" version = "0.0.0" edition = "2021" +license = "BSD-3-Clause-Clear" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html