Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
strategy:
matrix:
toolchain:
- 1.76
- 1.82
- nightly
os:
- ubuntu-latest
Expand All @@ -49,7 +49,7 @@ jobs:
strategy:
matrix:
toolchain:
- 1.76
- 1.82
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mscript_12_0 = { version = "12.0", default-features = false, features = ["serde"
async-hwi = {version = "0.0.29", optional = true}

# cli
clap = { version = "4.5.42", features = ["derive"] , optional = true}
clap = { version = "=4.5.42", features = ["derive"] , optional = true}
tokio = { version = "1", features = ["macros", "net", "rt", "rt-multi-thread", "io-util", "sync"], optional = true}

[dev-dependencies]
Expand Down
25 changes: 11 additions & 14 deletions src/ll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1259,11 +1259,13 @@ mod tests {
assert_eq!(encryption_type, 0x01);

let (content, decrypted_1) =
decrypt_chacha20_poly1305_v1(pk1(), &individual_secrets, cyphertext.clone(), nonce).unwrap();
decrypt_chacha20_poly1305_v1(pk1(), &individual_secrets, cyphertext.clone(), nonce)
.unwrap();
assert_eq!(content, Content::Bip380);
assert_eq!(String::from_utf8(decrypted_1).unwrap(), "test".to_string());
let (content, decrypted_2) =
decrypt_chacha20_poly1305_v1(pk2(), &individual_secrets, cyphertext.clone(), nonce).unwrap();
decrypt_chacha20_poly1305_v1(pk2(), &individual_secrets, cyphertext.clone(), nonce)
.unwrap();
assert_eq!(content, Content::Bip380);
assert_eq!(String::from_utf8(decrypted_2).unwrap(), "test".to_string());
let decrypted_3 =
Expand Down Expand Up @@ -1582,7 +1584,8 @@ mod encryption_vectors {
use super::*;
use alloc::{string::String, vec::Vec};

const TEST_VECTORS_JSON: &str = include_str!("../test_vectors/chacha20poly1305_encryption.json");
const TEST_VECTORS_JSON: &str =
include_str!("../test_vectors/chacha20poly1305_encryption.json");

#[derive(serde::Deserialize, serde::Serialize)]
struct TestVector {
Expand Down Expand Up @@ -1796,8 +1799,7 @@ mod encrypted_backup {
{
use base64::Engine as _;
if let Some(expected_b64) = v.expected_base64.as_deref() {
let computed_b64 =
base64::engine::general_purpose::STANDARD.encode(&encrypted);
let computed_b64 = base64::engine::general_purpose::STANDARD.encode(&encrypted);
assert_eq!(
computed_b64, expected_b64,
"Base64 encoding mismatch: {description}"
Expand Down Expand Up @@ -1875,8 +1877,7 @@ mod encrypted_backup {
"Version mismatch with trailing bytes: {description}"
);

let mut parsed_paths_t =
decode_derivation_paths(&with_trailer).expect(description);
let mut parsed_paths_t = decode_derivation_paths(&with_trailer).expect(description);
parsed_paths_t.sort();
assert_eq!(
parsed_paths_t, derivation_paths,
Expand All @@ -1899,13 +1900,9 @@ mod encrypted_backup {
);

for key in &keys {
let (decrypted_content, decrypted_plaintext) = decrypt_chacha20_poly1305_v1(
*key,
&is_t,
cyphertext_t.clone(),
nonce_t,
)
.expect(description);
let (decrypted_content, decrypted_plaintext) =
decrypt_chacha20_poly1305_v1(*key, &is_t, cyphertext_t.clone(), nonce_t)
.expect(description);
let decrypted_plaintext = String::from_utf8(decrypted_plaintext).unwrap();
assert_eq!(
decrypted_content, content,
Expand Down
Loading