File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ rand_chacha = "0.3.1"
2323curve25519-dalek = { version = " 4.1.3" , features = [" digest" , " rand_core" ] }
2424ed25519-dalek = { version = " 2.1.1" , features = [" rand_core" ] }
2525blake2b_simd = " 1.0.2"
26+ rayon = " 1.10.0"
2627
2728[dev-dependencies ]
2829criterion = " 0.5.1"
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ pub mod proof;
55
66use anyhow:: { anyhow, bail, ensure} ;
77use rand_core:: CryptoRngCore ;
8+ use rayon:: iter:: { IndexedParallelIterator , IntoParallelRefIterator , ParallelIterator } ;
89
910use super :: committee:: { ElectionPublicKey , ElectionSecretKey } ;
1011use crate :: crypto:: {
@@ -97,8 +98,8 @@ pub fn encrypt_vote<R: CryptoRngCore>(
9798
9899 let unit_vector = vote. to_unit_vector ( ) ;
99100 let ciphers = unit_vector
100- . iter ( )
101- . zip ( randomness. 0 . iter ( ) )
101+ . par_iter ( )
102+ . zip ( randomness. 0 . par_iter ( ) )
102103 . map ( |( m, r) | encrypt ( m, & public_key. 0 , r) )
103104 . collect ( ) ;
104105
You can’t perform that action at this time.
0 commit comments