Use a transcript when generating the per-chain binding for a given set of keys

While it was fine as-is, as it only had one variable length property, 
this is a bit more robust. Also binds the Curve ID, which should declare 
differently even for just different basepoints, and therefore adds two 
variable length properties (justifying the transcript).
This commit is contained in:
Luke Parker
2022-06-03 01:37:12 -04:00
parent 44452d9bfe
commit e4fc469e58
8 changed files with 20 additions and 23 deletions

View File

@@ -135,7 +135,7 @@ impl DLEqProof {
// the proper order if they want to reach consensus
// It'd be a poor API to have CLSAG define a new transcript solely to pass here, just to try to
// merge later in some form, when it should instead just merge xH (as it does)
let mut transcript = Transcript::new(b"DLEq Proof".to_vec());
let mut transcript = Transcript::new(b"DLEq Proof");
// Bit redundant, keeps things consistent
transcript.domain_separate(b"DLEq");
// Doesn't include G which is constant, does include H which isn't, even though H manipulation

View File

@@ -96,7 +96,7 @@ fn clsag_multisig() -> Result<(), MultisigError> {
algorithm_machines(
&mut OsRng,
ClsagMultisig::new(
Transcript::new(b"Monero Serai CLSAG Test".to_vec()),
Transcript::new(b"Monero Serai CLSAG Test"),
Rc::new(RefCell::new(Some(
ClsagDetails::new(
ClsagInput::new(

View File

@@ -37,7 +37,7 @@ pub struct TransactionMachine {
impl SignableTransaction {
pub async fn multisig<R: RngCore + CryptoRng>(
mut self,
label: Vec<u8>,
mut transcript: Transcript,
rng: &mut R,
rpc: &Rpc,
height: usize,
@@ -56,8 +56,9 @@ impl SignableTransaction {
// Create a RNG out of the input shared keys, which either requires the view key or being every
// sender, and the payments (address and amount), which a passive adversary may be able to know
// depending on how these transactions are coordinated
// Being every sender would already let you note rings which happen to use your transactions
// multiple times, already breaking privacy there
let mut transcript = Transcript::new(label);
transcript.domain_separate(b"monero_transaction");
// Include the height we're using for our data
// The data itself will be included, making this unnecessary, yet a lot of this is technically

View File

@@ -25,7 +25,7 @@ mod rpc;
use crate::rpc::{rpc, mine_block};
#[cfg(feature = "multisig")]
use monero_serai::frost::Ed25519;
use monero_serai::frost::{Transcript, Ed25519};
lazy_static! {
static ref SEQUENTIAL: Mutex<()> = Mutex::new(());
@@ -145,7 +145,7 @@ async fn send_core(test: usize, multisig: bool) {
machines.insert(
i,
signable.clone().multisig(
b"Monero Serai Test Transaction".to_vec(),
Transcript::new(b"Monero Serai Test Transaction"),
&mut OsRng,
&rpc,
rpc.get_height().await.unwrap() - 10,