From ef58f925774b9f826b2fe4c7ea0e28190c284987 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Thu, 19 Feb 2026 20:57:57 +0100 Subject: [PATCH] chore: update deps --- crdt-enc-gpgme/Cargo.toml | 2 +- crdt-enc-xchacha20poly1305/Cargo.toml | 2 +- crdt-enc-xchacha20poly1305/src/lib.rs | 6 +++--- crdt-enc/Cargo.toml | 4 ++-- crdt-enc/src/utils/version_bytes.rs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crdt-enc-gpgme/Cargo.toml b/crdt-enc-gpgme/Cargo.toml index 8560683..e7f3e3a 100644 --- a/crdt-enc-gpgme/Cargo.toml +++ b/crdt-enc-gpgme/Cargo.toml @@ -14,7 +14,7 @@ uuid = "1" crdts = "7" gpgme = "0.11" dyn-clone = "1" -phf = {version = "0.11", features = ["macros"]} +phf = {version = "0.13", features = ["macros"]} [dependencies.crdt-enc] path = "../crdt-enc" diff --git a/crdt-enc-xchacha20poly1305/Cargo.toml b/crdt-enc-xchacha20poly1305/Cargo.toml index ad5ab9e..436416b 100644 --- a/crdt-enc-xchacha20poly1305/Cargo.toml +++ b/crdt-enc-xchacha20poly1305/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" [dependencies] crdts = "7" -rand = "0.8" +rand = { version = "0.10", features = ["thread_rng"] } anyhow = "1" serde = "1" rmp-serde = "1" diff --git a/crdt-enc-xchacha20poly1305/src/lib.rs b/crdt-enc-xchacha20poly1305/src/lib.rs index 3226ffd..d2a5ba3 100644 --- a/crdt-enc-xchacha20poly1305/src/lib.rs +++ b/crdt-enc-xchacha20poly1305/src/lib.rs @@ -3,7 +3,7 @@ use ::anyhow::{Context, Error, Result}; use ::async_trait::async_trait; use ::chacha20poly1305::{Key, KeyInit, XChaCha20Poly1305, XNonce, aead::Aead}; use ::crdt_enc::utils::{VersionBytes, VersionBytesRef}; -use ::rand::{RngCore, thread_rng}; +use ::rand::{TryRng, rng}; use ::serde::{Deserialize, Serialize}; use ::std::{borrow::Cow, fmt::Debug}; use ::uuid::Uuid; @@ -29,7 +29,7 @@ impl crdt_enc::cryptor::Cryptor for EncHandler { async fn gen_key(&self) -> Result { spawn_blocking(|| { let mut key = [0u8; KEY_LEN]; - thread_rng() + rng() .try_fill_bytes(&mut key) .context("Unable to get random data for secret key")?; Ok(VersionBytes::new(KEY_VERSION, key.into())) @@ -49,7 +49,7 @@ impl crdt_enc::cryptor::Cryptor for EncHandler { let key = Key::from_slice(&key); let aead = XChaCha20Poly1305::new(key); let mut nonce = [0u8; NONCE_LEN]; - thread_rng() + rng() .try_fill_bytes(&mut nonce) .context("Unable to get random data for nonce")?; let xnonce = XNonce::from_slice(&nonce); diff --git a/crdt-enc/Cargo.toml b/crdt-enc/Cargo.toml index 0413f4c..6a29986 100644 --- a/crdt-enc/Cargo.toml +++ b/crdt-enc/Cargo.toml @@ -11,11 +11,11 @@ serde_bytes = "0.11" rmp-serde = "1" async-trait = "0.1" anyhow = "1" -thiserror = "1" +thiserror = "2" futures = "0.3" dyn-clone = "1" bytes = "1" -phf = {version = "0.11", features = ["macros"]} +phf = {version = "0.13", features = ["macros"]} [dependencies.uuid] version = "1" diff --git a/crdt-enc/src/utils/version_bytes.rs b/crdt-enc/src/utils/version_bytes.rs index 2b40a10..75f597c 100644 --- a/crdt-enc/src/utils/version_bytes.rs +++ b/crdt-enc/src/utils/version_bytes.rs @@ -253,7 +253,7 @@ impl<'a> VersionBytesBuf<'a> { pub fn new(version: Uuid, content: &'a [u8]) -> VersionBytesBuf<'a> { VersionBytesBuf { pos: 0, - version: *version.as_bytes(), + version: version.into_bytes(), content, } }