Move to Arc/RwLock

This commit is contained in:
Luke Parker
2022-06-05 07:33:15 -04:00
parent a46432b829
commit fdb1929ba4
7 changed files with 34 additions and 36 deletions

View File

@@ -1,4 +1,4 @@
use std::{marker::PhantomData, rc::Rc, collections::HashMap};
use std::{marker::PhantomData, sync::Arc, collections::HashMap};
use rand_core::{RngCore, CryptoRng};
@@ -80,7 +80,7 @@ pub(crate) fn core_batch_verify<R: RngCore + CryptoRng, C: Curve>(rng: &mut R) {
fn sign_core<R: RngCore + CryptoRng, C: Curve>(
rng: &mut R,
group_key: C::G,
keys: &HashMap<u16, Rc<MultisigKeys<C>>>
keys: &HashMap<u16, Arc<MultisigKeys<C>>>
) {
const MESSAGE: &'static [u8] = b"Hello, World!";
@@ -111,7 +111,7 @@ fn sign_with_offset<R: RngCore + CryptoRng, C: Curve>(rng: &mut R) {
let offset = C::hash_to_F(b"FROST Test sign_with_offset", b"offset");
for i in 1 ..= u16::try_from(keys.len()).unwrap() {
keys.insert(i, Rc::new(keys[&i].offset(offset)));
keys.insert(i, Arc::new(keys[&i].offset(offset)));
}
let offset_key = group_key + (C::GENERATOR_TABLE * offset);