Преглед изворни кода

add y_mu, rho_mu random samples to the leadcoin

mohab metwally пре 4 година
родитељ
комит
c857f34913
2 измењених фајлова са 6 додато и 3 уклоњено
  1. 3 3
      src/consensus/block.rs
  2. 3 0
      src/crypto/leadcoin.rs

+ 3 - 3
src/consensus/block.rs

@@ -2,7 +2,7 @@ use std::io;
 
 use log::debug;
 
-use super::{Metadata, StreamletMetadata, BLOCK_VERSION};
+use super::{Metadata, StreamletMetadata, OuroborosMetadata, BLOCK_VERSION};
 use crate::{
     crypto::{address::Address, keypair::PublicKey, schnorr::Signature},
     impl_vec, net,
@@ -46,9 +46,9 @@ impl Block {
     }
 
     /// Generate the genesis block.
-    pub fn genesis_block(genesis_ts: Timestamp, genesis_data: blake3::Hash) -> Self {
+    pub fn genesis_block(genesis_ts: Timestamp, genesis_data: blake3::Hash, eta: [u8;32]) -> Self {
         let metadata =
-            Metadata::new(genesis_ts, String::from("proof"), String::from("r"), String::from("s"));
+            Metadata::new(genesis_ts, eta);
 
         Self::new(genesis_data, 0, 0, vec![], metadata)
     }

+ 3 - 0
src/crypto/leadcoin.rs

@@ -33,6 +33,9 @@ pub struct LeadCoin {
     pub path_sk: Option<[MerkleNode; MERKLE_DEPTH_ORCHARD]>,
     pub c1_blind: Option<pallas::Scalar>,
     pub c2_blind: Option<pallas::Scalar>,
+    // election seeds
+    pub y_mu: Option<pallas::Base>,
+    pub rho_mu: Option<pallas::Base>,
 }
 
 impl LeadCoin {