Skip to content

Commit

Permalink
chore(crypto): CRP-2438 rename clib tecdsa (dfinity#1903)
Browse files Browse the repository at this point in the history
Renames `rs/crypto/internal/threshold_sig/tecdsa` to
`rs/crypto/internal/threshold_sig/canister_threshold_sig` because it now
also contains threshold Schnorr code.
  • Loading branch information
altkdf authored Oct 15, 2024
1 parent 55140ca commit 23c544f
Show file tree
Hide file tree
Showing 134 changed files with 183 additions and 159 deletions.
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ members = [
"rs/crypto/secp256k1",
"rs/crypto/secrets_containers",
"rs/crypto/internal/crypto_lib/threshold_sig/bls12_381",
"rs/crypto/internal/crypto_lib/threshold_sig/tecdsa",
"rs/crypto/internal/crypto_lib/threshold_sig/tecdsa/test_utils",
"rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig",
"rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils",
"rs/crypto/internal/crypto_lib/tls",
"rs/crypto/internal/crypto_lib/types",
"rs/crypto/internal/crypto_service_provider",
Expand Down
4 changes: 2 additions & 2 deletions rs/crypto/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ DEPENDENCIES = [
"//rs/crypto/internal/crypto_lib/basic_sig/ed25519",
"//rs/crypto/internal/crypto_lib/seed",
"//rs/crypto/internal/crypto_lib/threshold_sig/bls12_381",
"//rs/crypto/internal/crypto_lib/threshold_sig/tecdsa",
"//rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig",
"//rs/crypto/internal/crypto_lib/types",
"//rs/crypto/internal/crypto_service_provider",
"//rs/crypto/internal/logmon",
Expand Down Expand Up @@ -64,7 +64,7 @@ DEV_DEPENDENCIES = [
"//rs/crypto/internal/crypto_lib/basic_sig/ecdsa_secp256k1",
"//rs/crypto/internal/crypto_lib/basic_sig/ecdsa_secp256r1",
"//rs/crypto/internal/crypto_lib/basic_sig/rsa_pkcs1",
"//rs/crypto/internal/crypto_lib/threshold_sig/tecdsa/test_utils",
"//rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils",
"//rs/crypto/internal/crypto_lib/tls",
"//rs/crypto/internal/crypto_service_provider/csp_proptest_utils",
"//rs/crypto/internal/csp_test_utils",
Expand Down
4 changes: 2 additions & 2 deletions rs/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ic-crypto-internal-csp = { path = "internal/crypto_service_provider" }
ic-crypto-internal-logmon = { path = "internal/logmon" }
ic-crypto-internal-seed = { path = "internal/crypto_lib/seed" }
ic-crypto-internal-threshold-sig-bls12381 = { path = "internal/crypto_lib/threshold_sig/bls12_381" }
ic-crypto-internal-threshold-sig-ecdsa = { path = "internal/crypto_lib/threshold_sig/tecdsa" }
ic-crypto-internal-threshold-sig-canister-threshold-sig = { path = "internal/crypto_lib/threshold_sig/canister_threshold_sig" }
ic-crypto-internal-types = { path = "internal/crypto_lib/types" }
ic-crypto-standalone-sig-verifier = { path = "standalone-sig-verifier" }
ic-crypto-tls-cert-validation = { path = "node_key_validation/tls_cert_validation" }
Expand Down Expand Up @@ -60,7 +60,7 @@ ic-crypto-internal-basic-sig-rsa-pkcs1 = { path = "internal/crypto_lib/basic_sig
ic-crypto-internal-csp-proptest-utils = { path = "internal/crypto_service_provider/csp_proptest_utils" }
ic-crypto-internal-csp-test-utils = { path = "internal/csp_test_utils" }
ic-crypto-internal-test-vectors = { path = "internal/test_vectors" }
ic-crypto-internal-threshold-sig-ecdsa-test-utils = { path = "internal/crypto_lib/threshold_sig/tecdsa/test_utils" }
ic-crypto-internal-threshold-sig-canister-threshold-sig-test-utils = { path = "internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils" }
ic-crypto-internal-tls = { path = "internal/crypto_lib/tls" }
ic-crypto-node-key-generation = { path = "node_key_generation" }
ic-crypto-node-key-validation = { path = "node_key_validation" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ DEPENDENCIES = [

MACRO_DEPENDENCIES = [
# Keep sorted.
"//rs/crypto/internal/crypto_lib/threshold_sig/tecdsa/fe-derive",
"//rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/fe-derive",
"@crate_index//:paste",
"@crate_index//:strum_macros",
]

DEV_DEPENDENCIES = [
# Keep sorted.
"//rs/crypto/internal/crypto_lib/threshold_sig/tecdsa/test_utils",
"//rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils",
"//rs/crypto/test_utils/reproducible_rng",
"@crate_index//:assert_matches",
"@crate_index//:bip32",
Expand All @@ -51,10 +51,10 @@ MACRO_DEV_DEPENDENCIES = []
ALIASES = {}

rust_library(
name = "tecdsa",
name = "canister_threshold_sig",
srcs = glob(["src/**"]),
aliases = ALIASES,
crate_name = "ic_crypto_internal_threshold_sig_ecdsa",
crate_name = "ic_crypto_internal_threshold_sig_canister_threshold_sig",
proc_macro_deps = MACRO_DEPENDENCIES,
rustc_flags = select({
"//bazel:fuzzing_code_enabled": DEFAULT_RUSTC_FLAGS_FOR_FUZZING,
Expand All @@ -65,9 +65,9 @@ rust_library(
)

rust_test(
name = "tecdsa_test",
name = "canister_threshold_sig_test",
aliases = ALIASES,
crate = ":tecdsa",
crate = ":canister_threshold_sig",
proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES,
deps = DEPENDENCIES + DEV_DEPENDENCIES,
)
Expand All @@ -80,7 +80,7 @@ rust_test_suite(
aliases = ALIASES,
compile_data = glob(["tests/data/*"]),
proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES,
deps = [":tecdsa"] + DEPENDENCIES + DEV_DEPENDENCIES,
deps = [":canister_threshold_sig"] + DEPENDENCIES + DEV_DEPENDENCIES,
)

rust_bench(
Expand All @@ -89,7 +89,7 @@ rust_bench(
srcs = ["benches/dealings.rs"],
deps = [
# Keep sorted.
":tecdsa",
":canister_threshold_sig",
"//rs/crypto/test_utils/reproducible_rng",
"//rs/rust_canisters/canister_test",
"//rs/types/types",
Expand All @@ -104,7 +104,7 @@ rust_bench(
srcs = ["benches/group_ops.rs"],
deps = [
# Keep sorted.
":tecdsa",
":canister_threshold_sig",
"//rs/crypto/test_utils/reproducible_rng",
"@crate_index//:criterion",
"@crate_index//:rand",
Expand All @@ -117,7 +117,7 @@ rust_bench(
srcs = ["benches/hash2curve.rs"],
deps = [
# Keep sorted.
":tecdsa",
":canister_threshold_sig",
"@crate_index//:criterion",
],
)
Expand All @@ -128,7 +128,7 @@ rust_bench(
srcs = ["benches/key_derivation.rs"],
deps = [
# Keep sorted.
":tecdsa",
":canister_threshold_sig",
"//rs/crypto/test_utils/reproducible_rng",
"//rs/types/types",
"@crate_index//:criterion",
Expand All @@ -142,7 +142,7 @@ rust_bench(
srcs = ["benches/poly.rs"],
deps = [
# Keep sorted.
":tecdsa",
":canister_threshold_sig",
"//rs/crypto/test_utils/reproducible_rng",
"@crate_index//:criterion",
"@crate_index//:rand",
Expand All @@ -155,7 +155,7 @@ rust_bench(
srcs = ["benches/zk.rs"],
deps = [
# Keep sorted.
":tecdsa",
":canister_threshold_sig",
"//rs/crypto/test_utils/reproducible_rng",
"@crate_index//:criterion",
"@crate_index//:rand",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "ic-crypto-internal-threshold-sig-ecdsa"
name = "ic-crypto-internal-threshold-sig-canister-threshold-sig"
version.workspace = true
authors.workspace = true
edition.workspace = true
Expand Down Expand Up @@ -38,7 +38,7 @@ assert_matches = { workspace = true }
bip32 = { version = "0.5", features = ["secp256k1"] }
criterion = { workspace = true }
ed25519-dalek = { workspace = true }
ic-crypto-internal-threshold-sig-ecdsa-test-utils = { path = "test_utils" }
ic-crypto-internal-threshold-sig-canister-threshold-sig-test-utils = { path = "test_utils" }
ic-crypto-test-utils-reproducible-rng = { path = "../../../../test_utils/reproducible_rng" }
num-traits = { workspace = true }
strum = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use criterion::*;
use ic_crypto_internal_threshold_sig_ecdsa::*;
use ic_crypto_internal_threshold_sig_canister_threshold_sig::*;
use ic_crypto_test_utils_reproducible_rng::reproducible_rng;
use ic_types::crypto::AlgorithmId;
use ic_types::NumberOfNodes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use criterion::*;
use ic_crypto_internal_threshold_sig_ecdsa::*;
use ic_crypto_internal_threshold_sig_canister_threshold_sig::*;
use ic_crypto_test_utils_reproducible_rng::reproducible_rng;
use rand::{CryptoRng, Rng};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use criterion::*;
use ic_crypto_internal_threshold_sig_ecdsa::*;
use ic_crypto_internal_threshold_sig_canister_threshold_sig::*;

fn hash2curve(c: &mut Criterion) {
let input = "greetings humans".as_bytes();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use criterion::*;
use ic_crypto_internal_threshold_sig_ecdsa::*;
use ic_crypto_internal_threshold_sig_canister_threshold_sig::*;
use ic_crypto_test_utils_reproducible_rng::reproducible_rng;
use ic_types::crypto::canister_threshold_sig::MasterPublicKey;
use ic_types::crypto::AlgorithmId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use criterion::*;
use ic_crypto_internal_threshold_sig_ecdsa::*;
use ic_crypto_internal_threshold_sig_canister_threshold_sig::*;
use ic_crypto_test_utils_reproducible_rng::reproducible_rng;
use rand::{CryptoRng, Rng};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use criterion::*;
use ic_crypto_internal_threshold_sig_ecdsa::*;
use ic_crypto_internal_threshold_sig_canister_threshold_sig::*;
use ic_crypto_test_utils_reproducible_rng::reproducible_rng;
use rand::Rng;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package(default_visibility = ["//visibility:private"])

DEPENDENCIES = [
# Keep sorted.
"//rs/crypto/internal/crypto_lib/threshold_sig/tecdsa",
"//rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig",
"@crate_index//:arbitrary",
"@crate_index//:hex",
"@crate_index//:libfuzzer-sys",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "tecdsa-fuzz"
name = "canister-threshold-sig-fuzz"
version = "0.0.0"
publish = false
authors.workspace = true
Expand All @@ -16,7 +16,7 @@ libfuzzer-sys = "0.4"
num-bigint = { workspace = true }
subtle = "2.4"

[dependencies.ic-crypto-internal-threshold-sig-ecdsa]
[dependencies.ic-crypto-internal-threshold-sig-canister-threshold-sig]
path = ".."

# Prevent this from interfering with workspaces
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package(default_visibility = ["//visibility:private"])

DEPENDENCIES = [
# Keep sorted.
"//rs/crypto/internal/crypto_lib/threshold_sig/tecdsa",
"//rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig",
"//rs/types/types",
"@crate_index//:assert_matches",
"@crate_index//:clap",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::Parser;
use ic_crypto_internal_threshold_sig_ecdsa::*;
use ic_crypto_internal_threshold_sig_canister_threshold_sig::*;
use ic_types::crypto::AlgorithmId;
use ic_types::NumberOfNodes;
use rand::thread_rng;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_main]
use libfuzzer_sys::fuzz_target;

use ic_crypto_internal_threshold_sig_ecdsa::IDkgDealingInternal;
use ic_crypto_internal_threshold_sig_canister_threshold_sig::IDkgDealingInternal;

// This fuzzer tries to find panics in CBOR deserialization of dealings. We ignore errors
// returned by the decoding, as these do not lead to panics. You can run the fuzzer locally:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_main]
use libfuzzer_sys::fuzz_target;

use ic_crypto_internal_threshold_sig_ecdsa::{EccCurveType, EccPoint};
use ic_crypto_internal_threshold_sig_canister_threshold_sig::{EccCurveType, EccPoint};

// This fuzzer tries to find panics in CBOR deserialization of ECC points. We ignore errors
// returned by the decoding, as these do not lead to panics. You can run the fuzzer locally:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use arbitrary::{Arbitrary, Unstructured};
use libfuzzer_sys::fuzz_target;

use ic_crypto_internal_threshold_sig_ecdsa::{EccCurveType, EccPoint};
use ic_crypto_internal_threshold_sig_canister_threshold_sig::{EccCurveType, EccPoint};

// This fuzzer tries to find panics in hashing to ECC points. We ignore errors
// returned by the function, as these do not lead to panics. You can run the fuzzer locally:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_main]
use libfuzzer_sys::fuzz_target;

use ic_crypto_internal_threshold_sig_ecdsa::*;
use ic_crypto_internal_threshold_sig_canister_threshold_sig::*;
use num_bigint::BigUint;

fn prime_for(curve: EccCurveType) -> BigUint {
Expand Down
Loading

0 comments on commit 23c544f

Please sign in to comment.