Use a global transcript

This commit is contained in:
Luke Parker
2022-05-06 07:33:08 -04:00
parent cc9c2e0d40
commit 964cb357e6
12 changed files with 165 additions and 182 deletions

View File

@@ -7,7 +7,7 @@ use curve25519_dalek::{constants::ED25519_BASEPOINT_TABLE, scalar::Scalar};
use monero_serai::{random_scalar, Commitment, key_image, clsag};
#[cfg(feature = "multisig")]
use monero_serai::frost::MultisigError;
use monero_serai::frost::{MultisigError, Transcript};
#[cfg(feature = "multisig")]
mod frost;
@@ -84,6 +84,7 @@ fn test_multisig() -> Result<(), MultisigError> {
machines.push(
sign::AlgorithmMachine::new(
clsag::Multisig::new(
Transcript::new(b"Monero Serai CLSAG Test".to_vec()),
clsag::Input::new(ring.clone(), RING_INDEX, Commitment::new(randomness, AMOUNT)).unwrap(),
Rc::new(RefCell::new([1; 32])),
Rc::new(RefCell::new(Scalar::from(42u64)))

View File

@@ -32,7 +32,7 @@ pub async fn send_multisig() {
let t = keys[0].params().t();
// Generate an address
let view = Scalar::from_hash(Blake2b512::new().chain("Serai DEX")).0;
let view = Scalar::from_hash(Blake2b512::new().chain("Monero Serai Transaction Test")).0;
let spend = keys[0].group_key().0;
let addr = Address::standard(
Network::Mainnet,
@@ -57,6 +57,7 @@ pub async fn send_multisig() {
SignableTransaction::new(
vec![output.clone()], vec![(addr, amount)], addr, fee_per_byte
).unwrap().multisig(
b"Monero Serai Test Transaction".to_vec(),
&mut OsRng,
&rpc,
keys[i - 1].clone(),