From 1e00a22a1f7708fdf3dd7e356c0d1f7a4e9f1c97 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 19 Nov 2024 13:19:24 -0800 Subject: [PATCH] chore: update a few dependencies (thiserror, subtle, base64*) Unfortunately we can't yet update the sha2 or hkdf until https://github.com/zkcrypto/bls12_381/issues/139 is resolved. --- Cargo.toml | 8 ++++---- src/signature.rs | 17 +++++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b555101..ac49ed3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,8 +16,8 @@ readme = "README.md" [dependencies] rayon = { version = "1", optional = true } rand_core = "0.6.0" -thiserror = "1.0" -subtle = "2.2.1" +thiserror = "2.0" +subtle = "2.6.1" ff = "0.13" group = "0.13" @@ -39,10 +39,10 @@ blst-portable = [ "blst_lib", "blst_lib/portable", "blstrs/portable" ] [dev-dependencies] rand = "0.8" -base64 = "0.13.0" +base64 = "0.22.1" serde = { version = "1.0.106", features = ["derive"] } serde_json = "1.0.52" -base64-serde = "0.6.1" +base64-serde = "0.8.0" rand_chacha = "0.3.1" [[example]] diff --git a/src/signature.rs b/src/signature.rs index f5ffb64..e2bed6c 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -306,7 +306,7 @@ pub fn verify_messages( mod tests { use super::*; - use base64::STANDARD; + use base64::prelude::*; use ff::Field; use rand::{Rng, SeedableRng}; use rand_chacha::ChaCha8Rng; @@ -490,7 +490,7 @@ mod tests { assert_eq!(Signature::from_bytes(&signature_bytes).unwrap(), signature); } - base64_serde_type!(Base64Standard, STANDARD); + base64_serde_type!(Base64Standard, BASE64_STANDARD); #[derive(Debug, Clone, Deserialize)] struct Case { @@ -564,12 +564,17 @@ mod tests { ); if case.ciphersuite.as_bytes() == CSUITE { - let pub_key = - PublicKey::from_bytes(&base64::decode(case.pub_key.as_ref().unwrap()).unwrap()) - .unwrap(); + let pub_key = PublicKey::from_bytes( + &BASE64_STANDARD + .decode(case.pub_key.as_ref().unwrap()) + .unwrap(), + ) + .unwrap(); let priv_key = PrivateKey::from_string(case.priv_key.as_ref().unwrap()).unwrap(); let signature = Signature::from_bytes( - &base64::decode(case.signature.as_ref().unwrap()).unwrap(), + &BASE64_STANDARD + .decode(case.signature.as_ref().unwrap()) + .unwrap(), ) .unwrap();