chore: update deps
This commit is contained in:
@@ -14,7 +14,7 @@ uuid = "1"
|
|||||||
crdts = "7"
|
crdts = "7"
|
||||||
gpgme = "0.11"
|
gpgme = "0.11"
|
||||||
dyn-clone = "1"
|
dyn-clone = "1"
|
||||||
phf = {version = "0.11", features = ["macros"]}
|
phf = {version = "0.13", features = ["macros"]}
|
||||||
|
|
||||||
[dependencies.crdt-enc]
|
[dependencies.crdt-enc]
|
||||||
path = "../crdt-enc"
|
path = "../crdt-enc"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ edition = "2024"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
crdts = "7"
|
crdts = "7"
|
||||||
rand = "0.8"
|
rand = { version = "0.10", features = ["thread_rng"] }
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
serde = "1"
|
serde = "1"
|
||||||
rmp-serde = "1"
|
rmp-serde = "1"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use ::anyhow::{Context, Error, Result};
|
|||||||
use ::async_trait::async_trait;
|
use ::async_trait::async_trait;
|
||||||
use ::chacha20poly1305::{Key, KeyInit, XChaCha20Poly1305, XNonce, aead::Aead};
|
use ::chacha20poly1305::{Key, KeyInit, XChaCha20Poly1305, XNonce, aead::Aead};
|
||||||
use ::crdt_enc::utils::{VersionBytes, VersionBytesRef};
|
use ::crdt_enc::utils::{VersionBytes, VersionBytesRef};
|
||||||
use ::rand::{RngCore, thread_rng};
|
use ::rand::{TryRng, rng};
|
||||||
use ::serde::{Deserialize, Serialize};
|
use ::serde::{Deserialize, Serialize};
|
||||||
use ::std::{borrow::Cow, fmt::Debug};
|
use ::std::{borrow::Cow, fmt::Debug};
|
||||||
use ::uuid::Uuid;
|
use ::uuid::Uuid;
|
||||||
@@ -29,7 +29,7 @@ impl crdt_enc::cryptor::Cryptor for EncHandler {
|
|||||||
async fn gen_key(&self) -> Result<VersionBytes> {
|
async fn gen_key(&self) -> Result<VersionBytes> {
|
||||||
spawn_blocking(|| {
|
spawn_blocking(|| {
|
||||||
let mut key = [0u8; KEY_LEN];
|
let mut key = [0u8; KEY_LEN];
|
||||||
thread_rng()
|
rng()
|
||||||
.try_fill_bytes(&mut key)
|
.try_fill_bytes(&mut key)
|
||||||
.context("Unable to get random data for secret key")?;
|
.context("Unable to get random data for secret key")?;
|
||||||
Ok(VersionBytes::new(KEY_VERSION, key.into()))
|
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 key = Key::from_slice(&key);
|
||||||
let aead = XChaCha20Poly1305::new(key);
|
let aead = XChaCha20Poly1305::new(key);
|
||||||
let mut nonce = [0u8; NONCE_LEN];
|
let mut nonce = [0u8; NONCE_LEN];
|
||||||
thread_rng()
|
rng()
|
||||||
.try_fill_bytes(&mut nonce)
|
.try_fill_bytes(&mut nonce)
|
||||||
.context("Unable to get random data for nonce")?;
|
.context("Unable to get random data for nonce")?;
|
||||||
let xnonce = XNonce::from_slice(&nonce);
|
let xnonce = XNonce::from_slice(&nonce);
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ serde_bytes = "0.11"
|
|||||||
rmp-serde = "1"
|
rmp-serde = "1"
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
thiserror = "1"
|
thiserror = "2"
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
dyn-clone = "1"
|
dyn-clone = "1"
|
||||||
bytes = "1"
|
bytes = "1"
|
||||||
phf = {version = "0.11", features = ["macros"]}
|
phf = {version = "0.13", features = ["macros"]}
|
||||||
|
|
||||||
[dependencies.uuid]
|
[dependencies.uuid]
|
||||||
version = "1"
|
version = "1"
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ impl<'a> VersionBytesBuf<'a> {
|
|||||||
pub fn new(version: Uuid, content: &'a [u8]) -> VersionBytesBuf<'a> {
|
pub fn new(version: Uuid, content: &'a [u8]) -> VersionBytesBuf<'a> {
|
||||||
VersionBytesBuf {
|
VersionBytesBuf {
|
||||||
pos: 0,
|
pos: 0,
|
||||||
version: *version.as_bytes(),
|
version: version.into_bytes(),
|
||||||
content,
|
content,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user