@@ -2,9 +2,7 @@ use aes_gcm::{AeadCore, Aes256Gcm, aead};
2
2
use anyhow:: anyhow;
3
3
use ark_ec:: { AffineRepr , CurveGroup , hashing:: HashToCurve } ;
4
4
use ark_ff:: { PrimeField , UniformRand } ;
5
- use ark_poly:: EvaluationDomain ;
6
- use ark_poly:: Radix2EvaluationDomain ;
7
- use ark_poly:: { DenseUVPolynomial , polynomial:: univariate:: DensePolynomial } ;
5
+ use ark_poly:: { DenseUVPolynomial , Polynomial , polynomial:: univariate:: DensePolynomial } ;
8
6
use ark_std:: rand:: Rng ;
9
7
use ark_std:: rand:: rngs:: OsRng ;
10
8
use digest:: { Digest , generic_array:: GenericArray } ;
@@ -73,12 +71,15 @@ where
73
71
let generator = C :: generator ( ) ;
74
72
let mut poly: DensePolynomial < _ > = DensePolynomial :: rand ( degree, rng) ;
75
73
76
- let domain = Radix2EvaluationDomain :: < C :: ScalarField > :: new ( committee_size)
77
- . ok_or_else ( || ThresholdEncError :: Internal ( anyhow ! ( "Unable to create eval domain" ) ) ) ?;
78
-
79
74
let mut alpha_0 = poly[ 0 ] ;
80
- let mut evals: Vec < _ > = domain. fft ( & poly) ;
81
- evals. truncate ( committee_size) ; // FFT might produce to next_power_of_two(committee_size)
75
+
76
+ // Evaluate polynomial at points 1, 2, 3, ..., committee_size (same as Feldman VSS)
77
+ let mut evals = Vec :: with_capacity ( committee_size) ;
78
+ for i in 0 ..committee_size {
79
+ let eval_point = C :: ScalarField :: from ( ( i + 1 ) as u64 ) ;
80
+ let eval = poly. evaluate ( & eval_point) ;
81
+ evals. push ( eval) ;
82
+ }
82
83
83
84
let u_0 = generator * alpha_0;
84
85
let pub_key = PublicKey { key : u_0 } ;
@@ -178,7 +179,6 @@ where
178
179
ciphertext : & Self :: Ciphertext ,
179
180
aad : & Self :: AssociatedData ,
180
181
) -> Result < Self :: Plaintext , ThresholdEncError > {
181
- let committee_size: usize = committee. size ( ) . get ( ) ;
182
182
let threshold = committee. one_honest_threshold ( ) . get ( ) ;
183
183
let generator = C :: generator ( ) ;
184
184
@@ -188,13 +188,6 @@ where
188
188
if dec_shares. len ( ) < threshold {
189
189
return Err ( ThresholdEncError :: NotEnoughShares ) ;
190
190
}
191
- let domain: Radix2EvaluationDomain < C :: ScalarField > =
192
- Radix2EvaluationDomain :: new ( committee_size) . ok_or_else ( || {
193
- ThresholdEncError :: Internal ( anyhow ! (
194
- "Unable to create eval domain for size {:?}" ,
195
- committee_size
196
- ) )
197
- } ) ?;
198
191
199
192
let ( v, nonce, data) = (
200
193
ciphertext. v ,
@@ -229,11 +222,11 @@ where
229
222
return Err ( ThresholdEncError :: FaultySubset ( faulty_subset) ) ;
230
223
}
231
224
232
- // Collect eval points for decryption shares
225
+ // Collect eval points using simple evaluation points (same as Feldman VSS)
233
226
let ( x, w_vec) : ( Vec < _ > , Vec < _ > ) = dec_shares
234
227
. iter ( )
235
228
. take ( threshold)
236
- . map ( |share| ( domain . element ( share. index as usize ) , share. w ) )
229
+ . map ( |share| ( C :: ScalarField :: from ( ( share. index + 1 ) as u64 ) , share. w ) )
237
230
. unzip ( ) ;
238
231
239
232
// interpolate in the exponent
0 commit comments