Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
quexten committed Nov 1, 2024
1 parent 83d5fba commit f1cdc2e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/bitwarden-wasm-internal/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@ impl ClientCrypto {
authenticated_data: &[u8],
key: &[u8],
) -> Result<Vec<u8>> {
println!("encrypt_xchacha20_poly1305");
println!("secret_data {:?}", secret_data);
println!("authenticated_data {:?}", authenticated_data);
println!("key {:?}", key);
let key_len32 = key[..32].try_into().unwrap();
let (nonce, ciphertext) =
chacha20::encrypt_xchacha20_poly1305(secret_data, authenticated_data, key_len32)?;

println!("encrytped");
let result: Vec<u8> = nonce.into_iter().chain(ciphertext.into_iter()).collect();
println!("result {:?}", result);
Ok(result)
}

Check warning on line 51 in crates/bitwarden-wasm-internal/src/crypto.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-wasm-internal/src/crypto.rs#L35-L51

Added lines #L35 - L51 were not covered by tests
}

0 comments on commit f1cdc2e

Please sign in to comment.