What changed, and why it matters
This commit is a routine maintenance change titled 'chore: optimize test and lints'. It updates code-coverage thresholds in CI workflows, adds Rust lint configuration for a nightly coverage feature, removes an obsolete nightly Rust feature flag, and adjusts some test data and test cases. There is no indication of a security fix or vulnerability being addressed.
No security action required. Treat as normal maintenance. Reviewers may optionally verify that the removed TON tests and updated RSA test vectors do not reduce meaningful security-relevant test coverage.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies GitHub Actions workflow files to raise or tune llvm-cov coverage thresholds and to ignore certain dependency paths (keystore, utils, xrp, zcash_vendor) from coverage calculations. It adds [lints.rust] unexpected_cfgs entries to many Cargo.toml files to allow cfg(coverage_nightly). It removes the #![feature(error_in_core)] attribute from several lib.rs files (avalanche, near, stellar, tron), which is a compatibility/lint cleanup. It updates RSA test vectors in arweave and keystore to use a shorter 16-byte seed and new primes, and removes several TON mnemonic tests. It also changes cosmos/src/lib.rs to use Message::from_digest_slice instead of Message::from_slice, matching a secp256k1 API update. None of these changes appear to fix a security bug.
Changed components
GitHub Actions CI workflows for Rust app coverageCargo.toml lint configuration across Rust appsrust/apps/arweave test vectorsrust/apps/avalanche/src/lib.rsrust/apps/cosmos/src/lib.rsrust/apps/near/src/lib.rsrust/apps/solana/src/lib.rsrust/apps/stellar/src/lib.rsrust/apps/ton/src/lib.rsrust/apps/ton/src/mnemonic.rs testsrust/apps/tron/src/lib.rsrust/keystore/src/algorithms/rsa/mod.rs testsInspect captured patch +121 / −122
diff --git a/.github/workflows/rust-aptos-checks.yml b/.github/workflows/rust-aptos-checks.yml
index 2f74b5a..799063e 100644
--- a/.github/workflows/rust-aptos-checks.yml
+++ b/.github/workflows/rust-aptos-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/aptos
- run: cd rust/apps/aptos && cargo +nightly-2025-05-01 llvm-cov --fail-under-functions 50 --fail-under-lines 50 --fail-under-regions 50
+ run: cd rust/apps/aptos && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 50 --fail-under-functions 70 --fail-under-lines 65 --ignore-filename-regex 'keystore/*|utils/*'
diff --git a/.github/workflows/rust-arweave-checks.yml b/.github/workflows/rust-arweave-checks.yml
index ce5ca5b..2fc4440 100644
--- a/.github/workflows/rust-arweave-checks.yml
+++ b/.github/workflows/rust-arweave-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/arweave
- run: cd rust/apps/arweave && cargo +nightly-2025-05-01 llvm-cov --fail-under-functions 50 --fail-under-lines 50 --fail-under-regions 50
+ run: cd rust/apps/arweave && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 78 --fail-under-functions 81 --fail-under-lines 85 --ignore-filename-regex 'keystore/*|utils/*'
diff --git a/.github/workflows/rust-bitcoin-checks.yml b/.github/workflows/rust-bitcoin-checks.yml
index 0fcf448..9950fc6 100644
--- a/.github/workflows/rust-bitcoin-checks.yml
+++ b/.github/workflows/rust-bitcoin-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/bitcoin
- run: cd rust/apps/bitcoin && cargo +nightly-2025-05-01 llvm-cov --fail-under-functions 50 --fail-under-lines 50 --fail-under-regions 50
+ run: cd rust/apps/bitcoin && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 74 --fail-under-functions 78 --fail-under-lines 86 --ignore-filename-regex 'keystore/*|utils/*'
diff --git a/.github/workflows/rust-cardano-checks.yml b/.github/workflows/rust-cardano-checks.yml
index bfe43ff..4b3aef4 100644
--- a/.github/workflows/rust-cardano-checks.yml
+++ b/.github/workflows/rust-cardano-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/cardano
- run: cd rust/apps/cardano && cargo +nightly-2025-05-01 llvm-cov --fail-under-functions 50 --fail-under-lines 50 --fail-under-regions 50
+ run: cd rust/apps/cardano && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 53 --fail-under-functions 63 --fail-under-lines 66 --ignore-filename-regex 'keystore/*|utils/*'
diff --git a/.github/workflows/rust-cosmos-checks.yml b/.github/workflows/rust-cosmos-checks.yml
index 4d9c367..a5d1b74 100644
--- a/.github/workflows/rust-cosmos-checks.yml
+++ b/.github/workflows/rust-cosmos-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/cosmos
- run: cd rust/apps/cosmos && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 18 --fail-under-functions 12 --fail-under-lines 47
+ run: cd rust/apps/cosmos && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 65 --fail-under-functions 57 --fail-under-lines 74 --ignore-filename-regex 'keystore/*|utils/*'
diff --git a/.github/workflows/rust-ethereum-checks.yml b/.github/workflows/rust-ethereum-checks.yml
index fa0ccf5..be00f75 100644
--- a/.github/workflows/rust-ethereum-checks.yml
+++ b/.github/workflows/rust-ethereum-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/ethereum
- run: cd rust/apps/ethereum && cargo +nightly-2025-05-01 llvm-cov --fail-under-functions 50 --fail-under-lines 50 --fail-under-regions 50
+ run: cd rust/apps/ethereum && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 52 --fail-under-functions 56 --fail-under-lines 75 --ignore-filename-regex 'keystore/*|utils/*'
diff --git a/.github/workflows/rust-keystore-checks.yml b/.github/workflows/rust-keystore-checks.yml
index 5da6e10..bd5338a 100644
--- a/.github/workflows/rust-keystore-checks.yml
+++ b/.github/workflows/rust-keystore-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/keystore
- run: cd rust/keystore && cargo +nightly-2025-05-01 llvm-cov --fail-under-functions 50 --fail-under-lines 50 --fail-under-regions 50
+ run: cd rust/keystore && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 65 --fail-under-functions 59 --fail-under-lines 83
diff --git a/.github/workflows/rust-monero-checks.yml b/.github/workflows/rust-monero-checks.yml
index b4be70f..57521f4 100644
--- a/.github/workflows/rust-monero-checks.yml
+++ b/.github/workflows/rust-monero-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/monero
- run: cd rust/apps/monero && cargo +nightly-2025-05-01 llvm-cov --fail-under-functions 50 --fail-under-lines 50 --fail-under-regions 50
+ run: cd rust/apps/monero && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 36 --fail-under-functions 41 --fail-under-lines 46 --ignore-filename-regex 'keystore/*'
diff --git a/.github/workflows/rust-solana-checks.yml b/.github/workflows/rust-solana-checks.yml
index e22de92..88396fc 100644
--- a/.github/workflows/rust-solana-checks.yml
+++ b/.github/workflows/rust-solana-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/solana
- run: cd rust/apps/solana && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 21 --fail-under-functions 34 --fail-under-lines 38
+ run: cd rust/apps/solana && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 49 --fail-under-functions 65 --fail-under-lines 68 --ignore-filename-regex 'keystore/*|utils/*'
diff --git a/.github/workflows/rust-stellar-checks.yml b/.github/workflows/rust-stellar-checks.yml
index 2579324..2480a47 100644
--- a/.github/workflows/rust-stellar-checks.yml
+++ b/.github/workflows/rust-stellar-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/stellar
- run: cd rust/apps/stellar && cargo +nightly-2025-05-01 llvm-cov --fail-under-functions 50 --fail-under-lines 50 --fail-under-regions 50
+ run: cd rust/apps/stellar && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 73 --fail-under-functions 89 --fail-under-lines 86 --ignore-filename-regex 'keystore/*|utils/*'
diff --git a/.github/workflows/rust-sui-checks.yml b/.github/workflows/rust-sui-checks.yml
index 8c1547d..f756e40 100644
--- a/.github/workflows/rust-sui-checks.yml
+++ b/.github/workflows/rust-sui-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/sui
- run: cd rust/apps/sui && cargo +nightly-2025-05-01 llvm-cov --fail-under-functions 50 --fail-under-lines 50 --fail-under-regions 50
+ run: cd rust/apps/sui && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 84 --fail-under-functions 78 --fail-under-lines 91 --ignore-filename-regex 'keystore/*|utils/*'
diff --git a/.github/workflows/rust-ton-checks.yml b/.github/workflows/rust-ton-checks.yml
index 456ee30..a11c958 100644
--- a/.github/workflows/rust-ton-checks.yml
+++ b/.github/workflows/rust-ton-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/ton
- run: cd rust/apps/ton && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 41 --fail-under-functions 48 --fail-under-lines 47
+ run: cd rust/apps/ton && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 80 --fail-under-functions 92 --fail-under-lines 91 --ignore-filename-regex 'keystore/*'
diff --git a/.github/workflows/rust-tron-checks.yml b/.github/workflows/rust-tron-checks.yml
index 407c4bd..5bb351f 100644
--- a/.github/workflows/rust-tron-checks.yml
+++ b/.github/workflows/rust-tron-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/tron
- run: cd rust/apps/tron && cargo +nightly-2025-05-01 llvm-cov --fail-under-functions 50 --fail-under-lines 50 --fail-under-regions 50
+ run: cd rust/apps/tron && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 77 --fail-under-functions 79 --fail-under-lines 90 --ignore-filename-regex 'keystore/*|utils/*'
diff --git a/.github/workflows/rust-utils-checks.yml b/.github/workflows/rust-utils-checks.yml
index fa43384..97f67e7 100644
--- a/.github/workflows/rust-utils-checks.yml
+++ b/.github/workflows/rust-utils-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/utils
- run: cd rust/apps/utils && cargo +nightly-2025-05-01 llvm-cov --fail-under-functions 50 --fail-under-lines 50 --fail-under-regions 50
+ run: cd rust/apps/utils && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 91 --fail-under-functions 80 --fail-under-lines 84 --ignore-filename-regex 'keystore/*'
diff --git a/.github/workflows/rust-wallets-checks.yml b/.github/workflows/rust-wallets-checks.yml
index 20240cc..ce0bba6 100644
--- a/.github/workflows/rust-wallets-checks.yml
+++ b/.github/workflows/rust-wallets-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/wallets
- run: cd rust/apps/wallets && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 39 --fail-under-functions 40 --fail-under-lines 57
+ run: cd rust/apps/wallets && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 51 --fail-under-functions 54 --fail-under-lines 70 --ignore-filename-regex 'keystore/*|xrp/*'
diff --git a/.github/workflows/rust-xrp-checks.yml b/.github/workflows/rust-xrp-checks.yml
index 1fd408a..70c3ef7 100644
--- a/.github/workflows/rust-xrp-checks.yml
+++ b/.github/workflows/rust-xrp-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/xrp
- run: cd rust/apps/xrp && cargo +nightly-2025-05-01 llvm-cov --fail-under-functions 50 --fail-under-lines 50 --fail-under-regions 50
+ run: cd rust/apps/xrp && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 84 --fail-under-functions 90 --fail-under-lines 93 --ignore-filename-regex 'keystore/*|utils/*'
diff --git a/.github/workflows/rust-zcash-checks.yml b/.github/workflows/rust-zcash-checks.yml
index 3268c04..8abe4e4 100644
--- a/.github/workflows/rust-zcash-checks.yml
+++ b/.github/workflows/rust-zcash-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/zcash
- run: cd rust/apps/zcash && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 48 --fail-under-functions 42 --fail-under-lines 56
+ run: cd rust/apps/zcash && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 69 --fail-under-functions 67 --fail-under-lines 74 --ignore-filename-regex 'keystore/*|utils/*|zcash_vendor/*'
diff --git a/rust/apps/aptos/Cargo.toml b/rust/apps/aptos/Cargo.toml
index d520271..860e622 100644
--- a/rust/apps/aptos/Cargo.toml
+++ b/rust/apps/aptos/Cargo.toml
@@ -19,3 +19,6 @@ cryptoxide = { workspace = true }
[dev-dependencies]
keystore = { workspace = true }
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/arweave/Cargo.toml b/rust/apps/arweave/Cargo.toml
index 5683b8f..9005d48 100644
--- a/rust/apps/arweave/Cargo.toml
+++ b/rust/apps/arweave/Cargo.toml
@@ -26,3 +26,6 @@ zeroize = { workspace = true }
[dev-dependencies]
keystore = { workspace = true }
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/arweave/src/lib.rs b/rust/apps/arweave/src/lib.rs
index 3e656df..4639e9a 100644
--- a/rust/apps/arweave/src/lib.rs
+++ b/rust/apps/arweave/src/lib.rs
@@ -161,27 +161,34 @@ pub fn parse_data_item(serial: &[u8]) -> Result<DataItem> {
mod tests {
use super::*;
use alloc::borrow::ToOwned;
+ use hex::ToHex;
use {hex, rsa::PublicKeyParts};
#[test]
fn test_generate_address() {
- let seed = hex::decode("cfd803c49799c014c239ff2e6a986575c360269927c715ee275a4f21f336eb342c3e3659ccd65385c3ba9017a3e4aee721ad4310b131fe98eb50e8944acd2ad5").unwrap();
+ let seed = hex::decode("2f1986623bdc5d4f908e5be9d6fa00ec").unwrap();
let result = generate_secret(seed.as_slice()).unwrap();
let address = generate_address(result.n().to_bytes_be()).unwrap();
- assert_eq!(address, "cV_M3Zdqq9_hWOqfSLGezrKz4slXjWYOLn_lrN0ouLE");
+ assert_eq!(address, "ICwtdLdGrJJ5bIe7rTWS1dd2_8tpOv1ZZIKnChvb19Y");
}
#[test]
fn test_generate_secret() {
- let seed = hex::decode("5eb00bbddcf069084889a8ab9155568165f5c453ccb85e70811aaed6f6da5fc19a5ac40b389cd370d086206dec8aa6c43daea6690f20ad3d8d48b2d2ce9e38e4").unwrap();
- let p = hex::decode("fdec3a1aee520780ca4058402d0422b5cd5950b715728f532499dd4bbcb68e5d44650818b43656782237316c4b0e2faa2b15c245fb82d10cf4f5b420f1f293ba75b2c8d8cef6ad899c34ce9de482cb248cc5ab802fd93094a63577590d812d5dd781846ef7d4f5d9018199c293966371c2349b0f847c818ec99caad800116e02085d35a39a913bc735327705161761ae30a4ec775f127fbb5165418c0fe08e54ae0aff8b2dab2b82d3b4b9c807de5fae116096075cf6d5b77450d743d743e7dcc56e7cafdcc555f228e57b363488e171d099876993e93e37a94983ccc12dba894c58ca84ac154c1343922c6a99008fabd0fa7010d3cc34f69884fec902984771").unwrap();
- let q = hex::decode("c5b50031ba31ab7c8b76453ce771f048b84fb89a3e4d44c222c3d8c823c683988b0dbf354d8b8cbf65f3db53e1365d3c5e043f0155b41d1ebeca6e20b2d6778600b5c98ffdba33961dae73b018307ef2bce9d217bbdf32964080f8db6f0cf7ef27ac825fcaf98d5143690a5d7e138f4875280ed6de581e66ed17f83371c268a073e4594814bcc88a33cbb4ec8819cc722ea15490312b85fed06e39274c4f73ac91c7f4d1b899729691cce616fb1a5feee1972456addcb51ac830e947fcc1b823468f0eefbaf195ac3b34f0baf96afc6fa77ee2e176081d6d91ce8c93c3d0f3547e48d059c9da447ba05ee3984703bebfd6d704b7f327ffaea7d0f63d0d3c6d65").unwrap();
+ let seed = hex::decode("2f1986623bdc5d4f908e5be9d6fa00ec").unwrap();
+ let p = hex::decode("f1fc92541273845b7b55d125b99839306d6815ccf905ab80daff13794f40616f8653c3356e25ec4fb899e12b3147a66ddb5c2b8daf8eb8a72909709d05e69c39c16742afdcae9899d97d8619bee42342deabc75b30c2673d6f4c981eb17c00e11b2621ed89f46772132ed56907027c8e4b2ae5e3d86702ee0d8060ed7e143c60793fcacd61dc31d3021637e13f0724e66baf92aeb321620136f4357c365cf6a7ec96feaa0428b7bfac7c82d6e35fecaf4b4c0dcd8531e4ac5c1db29296e5dbe557aa1be4b9da853ae4543bc8254bb77fdabc617434f23cae4b08b68c9a5c467ef46198f1cb76702d82cb2a4dd7aa29dcef478f9dc5feb8b43eddb5c5683ca027").unwrap();
+ let q = hex::decode("ed7d44523fa5fe95c1d084261329296ca8e55cb26d9f6742be0ecd9996f1aacaa22b5acd1208a118e1b7da83d9052cc76b67966f616ceb02e33cb0d2d9a4e5b4cf8e0ee68272d528f5a5ad2d75ee275c9cc3cd061c17bc9517606a74d749b9b1156f58647645326130109e1d32c00472026794ce45dd2225c4a93b09b0bf05d0369aff2692038d040553aa7ea059e6610a084e34a20a3b9ebff2bb586b78aae8ebc15621f8e7bcb2fa2cd6b51a63d42aebad67b17c200a7515d89f8fda4380e3815bbae1a4bdda1b6ceddeeeaf68bd27ce38a5ec46ac43c77f0c7392c4196260992df9393965676469ee8c34f2711af6c88e2d96702857eb08f9cc65ca361fa5").unwrap();
let result = generate_secret(seed.as_slice()).unwrap();
let public_key = generate_public_key_from_primes(p.as_slice(), q.as_slice()).unwrap();
- assert_eq!(result.primes()[0], BigUint::from_bytes_be(&p));
- assert_eq!(result.primes()[1], BigUint::from_bytes_be(&q));
+ assert_eq!(
+ hex::encode(result.primes()[0].to_bytes_be()),
+ hex::encode(&p)
+ );
+ assert_eq!(
+ hex::encode(result.primes()[1].to_bytes_be()),
+ hex::encode(&q)
+ );
assert_eq!(
result.n().to_owned().to_bytes_be(),
BigUint::from_bytes_be(public_key.as_slice()).to_bytes_be()
diff --git a/rust/apps/avalanche/Cargo.toml b/rust/apps/avalanche/Cargo.toml
index a3d9b0f..72dc042 100644
--- a/rust/apps/avalanche/Cargo.toml
+++ b/rust/apps/avalanche/Cargo.toml
@@ -31,3 +31,6 @@ testnet = []
[dev-dependencies]
keystore = { workspace = true }
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/avalanche/src/lib.rs b/rust/apps/avalanche/src/lib.rs
index a79abcc..405df13 100644
--- a/rust/apps/avalanche/src/lib.rs
+++ b/rust/apps/avalanche/src/lib.rs
@@ -1,5 +1,4 @@
#![no_std]
-#![feature(error_in_core)]
#[allow(unused_imports)]
#[macro_use]
diff --git a/rust/apps/bitcoin/Cargo.toml b/rust/apps/bitcoin/Cargo.toml
index f15064d..8887227 100644
--- a/rust/apps/bitcoin/Cargo.toml
+++ b/rust/apps/bitcoin/Cargo.toml
@@ -30,3 +30,6 @@ std = []
[dev-dependencies]
keystore = { workspace = true }
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/cardano/Cargo.toml b/rust/apps/cardano/Cargo.toml
index 5768960..a9ef9d5 100644
--- a/rust/apps/cardano/Cargo.toml
+++ b/rust/apps/cardano/Cargo.toml
@@ -23,3 +23,6 @@ bech32 = { workspace = true }
[dependencies.cardano-serialization-lib]
git = "https://git@github.com/KeystoneHQ/cardano-serialization-lib.git"
tag = "keystone-0.1.7"
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/cosmos/Cargo.toml b/rust/apps/cosmos/Cargo.toml
index 2fbdfa7..e403dc3 100644
--- a/rust/apps/cosmos/Cargo.toml
+++ b/rust/apps/cosmos/Cargo.toml
@@ -30,4 +30,7 @@ default = ["std"]
std = []
[lib]
-doctest = false
\ No newline at end of file
+doctest = false
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/cosmos/src/lib.rs b/rust/apps/cosmos/src/lib.rs
index 51cbef6..656aa1c 100644
--- a/rust/apps/cosmos/src/lib.rs
+++ b/rust/apps/cosmos/src/lib.rs
@@ -1,5 +1,5 @@
#![no_std]
-#![feature(error_in_core)]
+#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
#[allow(unused_imports)] //report unused_import in test
#[macro_use]
@@ -19,6 +19,8 @@ use bitcoin::secp256k1::{Message, PublicKey};
use keystore::algorithms::secp256k1::derive_public_key;
+#[cfg_attr(coverage_nightly, coverage(off))]
+#[allow(warnings)]
mod cosmos_sdk_proto;
pub mod errors;
mod proto_wrapper;
@@ -66,7 +68,7 @@ pub fn sign_tx(
SignMode::EVM => keccak256(message).to_vec(),
};
- if let Ok(message) = Message::from_slice(hash.as_slice()) {
+ if let Ok(message) = Message::from_digest_slice(hash.as_slice()) {
let (_, signature) =
keystore::algorithms::secp256k1::sign_message_by_seed(seed, path, &message)
.map_err(|e| CosmosError::KeystoreError(format!("sign failed {e}")))?;
diff --git a/rust/apps/ethereum/Cargo.toml b/rust/apps/ethereum/Cargo.toml
index 6b6b9fd..02eb1af 100644
--- a/rust/apps/ethereum/Cargo.toml
+++ b/rust/apps/ethereum/Cargo.toml
@@ -26,3 +26,6 @@ ur-registry = { workspace = true }
[dev-dependencies]
keystore = { path = "../../keystore" }
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/iota/Cargo.toml b/rust/apps/iota/Cargo.toml
index c27e8e1..36a7041 100644
--- a/rust/apps/iota/Cargo.toml
+++ b/rust/apps/iota/Cargo.toml
@@ -10,3 +10,6 @@ keystore = { workspace = true, default-features = false }
hex = { workspace = true }
cryptoxide = { workspace = true }
thiserror = { workspace = true }
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/monero/Cargo.toml b/rust/apps/monero/Cargo.toml
index c984e02..fe6deb2 100644
--- a/rust/apps/monero/Cargo.toml
+++ b/rust/apps/monero/Cargo.toml
@@ -21,4 +21,7 @@ thiserror = { workspace = true }
keystore = { workspace = true, default-features = false }
cuprate-cryptonight = { git = "https://github.com/KeystoneHQ/cuprate", default-features = false, features = ["no_std"] }
monero-serai = { git = "https://github.com/KeystoneHQ/serai", default-features = false }
-monero-wallet = { git = "https://github.com/KeystoneHQ/serai", default-features = false }
\ No newline at end of file
+monero-wallet = { git = "https://github.com/KeystoneHQ/serai", default-features = false }
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/near/Cargo.toml b/rust/apps/near/Cargo.toml
index e7f4b17..299e262 100644
--- a/rust/apps/near/Cargo.toml
+++ b/rust/apps/near/Cargo.toml
@@ -22,3 +22,6 @@ bitcoin = { workspace = true }
[dev-dependencies]
keystore = { workspace = true }
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/near/src/lib.rs b/rust/apps/near/src/lib.rs
index c3e5627..d3e5ad7 100644
--- a/rust/apps/near/src/lib.rs
+++ b/rust/apps/near/src/lib.rs
@@ -1,5 +1,4 @@
#![no_std]
-#![feature(error_in_core)]
#[allow(unused_imports)] //stupid compiler
#[macro_use]
diff --git a/rust/apps/solana/Cargo.toml b/rust/apps/solana/Cargo.toml
index 565ce13..553d157 100644
--- a/rust/apps/solana/Cargo.toml
+++ b/rust/apps/solana/Cargo.toml
@@ -31,13 +31,12 @@ borsh = { version = "1.5.1", default-features = false, features = [
bitcoin = { workspace = true }
ur-registry = { workspace = true }
-
-[dev-dependencies]
-keystore = { path = "../../keystore" }
-
[features]
default = ["std"]
std = []
[lib]
doctest = false
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/solana/src/lib.rs b/rust/apps/solana/src/lib.rs
index a618fd1..ca039a9 100644
--- a/rust/apps/solana/src/lib.rs
+++ b/rust/apps/solana/src/lib.rs
@@ -1,5 +1,6 @@
#![no_std]
#![allow(dead_code)] // add for solana use a lot of external code
+#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
extern crate alloc;
extern crate core;
@@ -24,8 +25,11 @@ mod instruction;
pub mod message;
pub mod parser;
pub mod read;
+#[cfg_attr(coverage_nightly, coverage(off))]
mod resolvers;
#[allow(clippy::all)]
+#[cfg_attr(coverage_nightly, coverage(off))]
+#[allow(warnings)]
mod solana_lib;
pub mod structs;
pub mod utils;
diff --git a/rust/apps/stellar/Cargo.toml b/rust/apps/stellar/Cargo.toml
index b46f733..4fba2a2 100644
--- a/rust/apps/stellar/Cargo.toml
+++ b/rust/apps/stellar/Cargo.toml
@@ -11,4 +11,7 @@ hex = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
cryptoxide = { workspace = true }
-base64 = { workspace = true }
\ No newline at end of file
+base64 = { workspace = true }
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/stellar/src/lib.rs b/rust/apps/stellar/src/lib.rs
index be57621..abad484 100644
--- a/rust/apps/stellar/src/lib.rs
+++ b/rust/apps/stellar/src/lib.rs
@@ -1,5 +1,4 @@
#![no_std]
-#![feature(error_in_core)]
pub mod address;
pub mod errors;
diff --git a/rust/apps/sui/Cargo.toml b/rust/apps/sui/Cargo.toml
index 5ffbaf6..a9e2022 100644
--- a/rust/apps/sui/Cargo.toml
+++ b/rust/apps/sui/Cargo.toml
@@ -30,3 +30,6 @@ simulator = [
[lib]
doctest = false
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/ton/Cargo.toml b/rust/apps/ton/Cargo.toml
index 50e2f15..748597c 100644
--- a/rust/apps/ton/Cargo.toml
+++ b/rust/apps/ton/Cargo.toml
@@ -32,3 +32,6 @@ zeroize = { workspace = true }
keystore = { workspace = true }
anyhow = "*"
urlencoding = "2.1.3"
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
diff --git a/rust/apps/ton/src/lib.rs b/rust/apps/ton/src/lib.rs
index 106d79d..3fa187c 100644
--- a/rust/apps/ton/src/lib.rs
+++ b/rust/apps/ton/src/lib.rs
@@ -1,4 +1,5 @@
#![no_std]
+#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
use core::str::FromStr;
@@ -19,6 +20,9 @@ pub mod mnemonic;
pub mod structs;
pub mod transaction;
mod utils;
+
+#[cfg_attr(coverage_nightly, coverage(off))]
+#[allow(warnings)]
mod vendor;
pub fn ton_public_key_to_address(pk: Vec<u8>) -> Result<String> {
diff --git a/rust/apps/ton/src/mnemonic.rs b/rust/apps/ton/src/mnemonic.rs
index 2f41cde..b9f0706 100644
--- a/rust/apps/ton/src/mnemonic.rs
+++ b/rust/apps/ton/src/mnemonic.rs
@@ -236,17 +236,6 @@ mod tests {
);
}
- #[test]
- fn test_ton_entropy_to_seed_deterministic() {
- let entropy = vec![0u8; 64];
- let seed1 = ton_entropy_to_seed(&entropy);
- let seed2 = ton_entropy_to_seed(&entropy);
-
- // Verify the function is deterministic
- assert_eq!(seed1, seed2);
- assert_eq!(seed1.len(), 64);
- }
-
#[test]
fn test_ton_mnemonic_with_empty_password() {
let words: Vec<String> = vec![
@@ -266,33 +255,6 @@ mod tests {
assert_eq!(result_no_password, result_empty_password);
}
- #[test]
- fn test_ton_mnemonic_normalization() {
- let words_lower: Vec<String> = vec![
- "dose", "ice", "enrich", "trigger", "test", "dove", "century", "still", "betray",
- "gas", "diet", "dune", "use", "other", "base", "gym", "mad", "law", "immense",
- "village", "world", "example", "praise", "game",
- ]
- .iter()
- .map(|v| v.to_string())
- .collect();
-
- let words_mixed: Vec<String> = vec![
- "Dose", "ICE", "Enrich", "TRIGGER", "test", "Dove", "CENTURY", "still", "Betray",
- "GAS", "diet", "DUNE", "use", "Other", "BASE", "gym", "MAD", "law", "Immense",
- "VILLAGE", "world", "Example", "PRAISE", "game",
- ]
- .iter()
- .map(|v| v.to_string())
- .collect();
-
- let seed_lower = ton_mnemonic_to_master_seed(words_lower, None).unwrap();
- let seed_mixed = ton_mnemonic_to_master_seed(words_mixed, None).unwrap();
-
- // Should produce same result regardless of case
- assert_eq!(seed_lower, seed_mixed);
- }
-
#[test]
fn test_ton_mnemonic_with_whitespace() {
let words_with_spaces: Vec<String> = vec![
@@ -378,18 +340,6 @@ mod tests {
// The validation might fail because this specific mnemonic is passwordless
}
- #[test]
- fn test_ton_entropy_to_seed_different_inputs() {
- let entropy1 = vec![1u8; 64];
- let entropy2 = vec![2u8; 64];
-
- let seed1 = ton_entropy_to_seed(&entropy1);
- let seed2 = ton_entropy_to_seed(&entropy2);
-
- // Different entropies should produce different seeds
- assert_ne!(seed1, seed2);
- }
-
#[test]
fn test_ton_mnemonic_different_passwords_different_seeds() {
let words: Vec<String> = vec![
@@ -511,17 +461,6 @@ mod tests {
assert!(result.is_ok());
}
- #[test]
- fn test_ton_entropy_to_seed_output_size() {
- let entropies = vec![vec![0u8; 64], vec![255u8; 64], (0..64).collect::<Vec<u8>>()];
-
- for entropy in entropies {
- let seed = ton_entropy_to_seed(&entropy);
- // Seed should always be 64 bytes
- assert_eq!(seed.len(), 64);
- }
- }
-
#[test]
fn test_ton_mnemonic_long_password() {
let words: Vec<String> = vec![
@@ -674,25 +613,6 @@ mod tests {
assert_eq!(entropy2, entropy3);
}
- #[test]
- fn test_ton_master_seed_consistency_with_clone() {
- let words1: Vec<String> = vec![
- "dose", "ice", "enrich", "trigger", "test", "dove", "century", "still", "betray",
- "gas", "diet", "dune", "use", "other", "base", "gym", "mad", "law", "immense",
- "village", "world", "example", "praise", "game",
- ]
- .iter()
- .map(|v| v.to_lowercase())
- .collect();
-
- let words2 = words1.clone();
-
- let seed1 = ton_mnemonic_to_master_seed(words1, None).unwrap();
- let seed2 = ton_mnemonic_to_master_seed(words2, None).unwrap();
-
- assert_eq!(seed1, seed2);
- }
-
#[test]
fn test_ton_mnemonic_empty_string_vs_none_password() {
let words: Vec<String> = vec![
diff --git a/rust/apps/tron/Cargo.toml b/rust/apps/tron/Cargo.toml
index c8aec41..6aea451 100644
--- a/rust/apps/tron/Cargo.toml
+++ b/rust/apps/tron/Cargo.toml
@@ -27,3 +27,6 @@ prost-build = { version = "0.11.8" }
[features]
generate_pb = []
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/tron/src/lib.rs b/rust/apps/tron/src/lib.rs
index 42af347..7f0f023 100644
--- a/rust/apps/tron/src/lib.rs
+++ b/rust/apps/tron/src/lib.rs
@@ -1,5 +1,4 @@
#![no_std]
-#![feature(error_in_core)]
extern crate alloc;
extern crate core;
diff --git a/rust/apps/utils/Cargo.toml b/rust/apps/utils/Cargo.toml
index d32592e..e681e8a 100644
--- a/rust/apps/utils/Cargo.toml
+++ b/rust/apps/utils/Cargo.toml
@@ -8,4 +8,7 @@ edition = "2021"
[dependencies]
paste = "1"
bitcoin = { workspace = true }
-unicode-blocks = { workspace = true }
\ No newline at end of file
+unicode-blocks = { workspace = true }
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/wallets/Cargo.toml b/rust/apps/wallets/Cargo.toml
index 5b69df7..5b6dc43 100644
--- a/rust/apps/wallets/Cargo.toml
+++ b/rust/apps/wallets/Cargo.toml
@@ -16,3 +16,6 @@ bitcoin = { workspace = true }
cryptoxide = { workspace = true }
serde_json = { workspace = true }
zcash_vendor = { workspace = true }
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/xrp/Cargo.toml b/rust/apps/xrp/Cargo.toml
index 071ad68..1c91a38 100644
--- a/rust/apps/xrp/Cargo.toml
+++ b/rust/apps/xrp/Cargo.toml
@@ -21,3 +21,6 @@ thiserror = { workspace = true }
[dev-dependencies]
keystore = { workspace = true }
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/zcash/Cargo.toml b/rust/apps/zcash/Cargo.toml
index f66488f..d8b1f1d 100644
--- a/rust/apps/zcash/Cargo.toml
+++ b/rust/apps/zcash/Cargo.toml
@@ -20,3 +20,6 @@ zcash_note_encryption = "0.4.1"
[dev-dependencies]
keystore = { path = "../../keystore" }
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/keystore/Cargo.toml b/rust/keystore/Cargo.toml
index c186779..6afed1c 100644
--- a/rust/keystore/Cargo.toml
+++ b/rust/keystore/Cargo.toml
@@ -27,3 +27,6 @@ zeroize = { workspace = true }
default = ["std"]
std = []
rsa = []
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/keystore/src/algorithms/rsa/mod.rs b/rust/keystore/src/algorithms/rsa/mod.rs
index 14adbb2..3ea22d6 100644
--- a/rust/keystore/src/algorithms/rsa/mod.rs
+++ b/rust/keystore/src/algorithms/rsa/mod.rs
@@ -147,11 +147,21 @@ mod tests {
use rsa::pss::{Signature as PssSignature, VerifyingKey};
use rsa::signature::Verifier;
+ // random quick seeds:
+ // Seed: ffa41e446bcd9aa4d245607da395a16f, Time: 8.856716042s
+ // Seed: ffce250799aa9e495fe19b4f8d13bd3d, Time: 10.709974083s
+ // Seed: ed0b92515425e600d469253af4f4ba4e, Time: 7.341941458s
+ // Seed: 71e8b47b48f5041e4f883980815db6e6, Time: 7.613651792s
+ // Seed: 2f1986623bdc5d4f908e5be9d6fa00ec, Time: 6.1233855s
+ // Seed: 72cc31ba74feb35327da05247045c978, Time: 7.62863725s
+ // Seed: b87ff97df474c47beb0cfee2fa38394b, Time: 6.754611291s
+ // Seed: ee21b42aedcbbd035f4b17d4d14c95bd, Time: 6.861722958s
+
#[test]
fn test_private_key_recover() {
- let p = hex::decode("FDEC3A1AEE520780CA4058402D0422B5CD5950B715728F532499DD4BBCB68E5D44650818B43656782237316C4B0E2FAA2B15C245FB82D10CF4F5B420F1F293BA75B2C8D8CEF6AD899C34CE9DE482CB248CC5AB802FD93094A63577590D812D5DD781846EF7D4F5D9018199C293966371C2349B0F847C818EC99CAAD800116E02085D35A39A913BC735327705161761AE30A4EC775F127FBB5165418C0FE08E54AE0AFF8B2DAB2B82D3B4B9C807DE5FAE116096075CF6D5B77450D743D743E7DCC56E7CAFDCC555F228E57B363488E171D099876993E93E37A94983CCC12DBA894C58CA84AC154C1343922C6A99008FABD0FA7010D3CC34F69884FEC902984771").unwrap();
- let q = hex::decode("C5B50031BA31AB7C8B76453CE771F048B84FB89A3E4D44C222C3D8C823C683988B0DBF354D8B8CBF65F3DB53E1365D3C5E043F0155B41D1EBECA6E20B2D6778600B5C98FFDBA33961DAE73B018307EF2BCE9D217BBDF32964080F8DB6F0CF7EF27AC825FCAF98D5143690A5D7E138F4875280ED6DE581E66ED17F83371C268A073E4594814BCC88A33CBB4EC8819CC722EA15490312B85FED06E39274C4F73AC91C7F4D1B899729691CCE616FB1A5FEEE1972456ADDCB51AC830E947FCC1B823468F0EEFBAF195AC3B34F0BAF96AFC6FA77EE2E176081D6D91CE8C93C3D0F3547E48D059C9DA447BA05EE3984703BEBFD6D704B7F327FFAEA7D0F63D0D3C6D65").unwrap();
- let seed = hex::decode("5eb00bbddcf069084889a8ab9155568165f5c453ccb85e70811aaed6f6da5fc19a5ac40b389cd370d086206dec8aa6c43daea6690f20ad3d8d48b2d2ce9e38e4").unwrap();
+ let p = hex::decode("F1FC92541273845B7B55D125B99839306D6815CCF905AB80DAFF13794F40616F8653C3356E25EC4FB899E12B3147A66DDB5C2B8DAF8EB8A72909709D05E69C39C16742AFDCAE9899D97D8619BEE42342DEABC75B30C2673D6F4C981EB17C00E11B2621ED89F46772132ED56907027C8E4B2AE5E3D86702EE0D8060ED7E143C60793FCACD61DC31D3021637E13F0724E66BAF92AEB321620136F4357C365CF6A7EC96FEAA0428B7BFAC7C82D6E35FECAF4B4C0DCD8531E4AC5C1DB29296E5DBE557AA1BE4B9DA853AE4543BC8254BB77FDABC617434F23CAE4B08B68C9A5C467EF46198F1CB76702D82CB2A4DD7AA29DCEF478F9DC5FEB8B43EDDB5C5683CA027").unwrap();
+ let q = hex::decode("ED7D44523FA5FE95C1D084261329296CA8E55CB26D9F6742BE0ECD9996F1AACAA22B5ACD1208A118E1B7DA83D9052CC76B67966F616CEB02E33CB0D2D9A4E5B4CF8E0EE68272D528F5A5AD2D75EE275C9CC3CD061C17BC9517606A74D749B9B1156F58647645326130109E1D32C00472026794CE45DD2225C4A93B09B0BF05D0369AFF2692038D040553AA7EA059E6610A084E34A20A3B9EBFF2BB586B78AAE8EBC15621F8E7BCB2FA2CD6B51A63D42AEBAD67B17C200A7515D89F8FDA4380E3815BBAE1A4BDDA1B6CEDDEEEAF68BD27CE38A5EC46AC43C77F0C7392C4196260992DF9393965676469EE8C34F2711AF6C88E2D96702857EB08F9CC65CA361FA5").unwrap();
+ let seed = hex::decode("2f1986623bdc5d4f908e5be9d6fa00ec").unwrap();
let result = get_rsa_secret_from_seed(seed.as_slice()).unwrap();
let p = p.to_upper_hex_string();
let q = q.to_upper_hex_string();
@@ -161,7 +171,7 @@ mod tests {
#[test]
fn test_get_rsa_secret_from_seed_valid_lengths() {
- let seed_16 = hex::decode("0102030405060708090a0b0c0d0e0f10").unwrap();
+ let seed_16 = hex::decode("2f1986623bdc5d4f908e5be9d6fa00ec").unwrap();
let result_16 = get_rsa_secret_from_seed(seed_16.as_slice()).unwrap();
assert_eq!(result_16.size(), MODULUS_LENGTH_IN_BYTE);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.