Skip to content

Commit

Permalink
Implemented state for Tally (private)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsanchezq authored and Mikhail Zabaluev committed Oct 19, 2020
1 parent 63f4dd0 commit 5c01f89
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chain-vote/src/lib.rs
Expand Up @@ -155,6 +155,12 @@ impl Tally {
(TallyState { r2s }, TallyDecryptShare { r1s: dshares })
}

pub fn state(&self) -> TallyState {
TallyState {
r2s: self.r.iter().map(|r| r.elements().1.clone()).collect(),
}
}

pub fn to_bytes(&self) -> Vec<u8> {
use std::io::Write;
let mut bytes: Vec<u8> = Vec::with_capacity(CIPHERTEXT_BYTES_LEN * self.r.len());
Expand Down

0 comments on commit 5c01f89

Please sign in to comment.