Skip to content

Commit

Permalink
refactor: hide g_inv from internat apis
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec committed Mar 19, 2024
1 parent b9b24f1 commit 4d04600
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions ferveo/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ impl AggregatedTranscript {
validator_keypair,
dkg.0.me.share_index,
&dkg.0.domain_points(),
&dkg.0.pvss_params.g_inv(),
)
}

Expand Down Expand Up @@ -547,14 +546,12 @@ impl PrivateKeyShare {
share_index: u32,
domain_points: &[DomainPoint<E>],
) -> Result<DecryptionSharePrecomputed> {
let g_inv = PubliclyVerifiableParams::<E>::default().g_inv();
let share = self.0.create_decryption_share_simple_precomputed(
&ciphertext_header.0,
aad,
validator_keypair,
share_index,
domain_points,
&g_inv,
)?;
Ok(share)
}
Expand Down
1 change: 0 additions & 1 deletion ferveo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ mod test_dkg_full {
validator_keypair,
validator.share_index,
&domain_points,
&dkg.pvss_params.g_inv(),
)
.unwrap()
})
Expand Down
2 changes: 0 additions & 2 deletions ferveo/src/pvss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ impl<E: Pairing, T: Aggregate> PubliclyVerifiableSS<E, T> {
validator_keypair: &Keypair<E>,
share_index: u32,
domain_points: &[DomainPoint<E>],
g_inv: &E::G1Prepared,
) -> Result<DecryptionSharePrecomputed<E>> {
self.decrypt_private_key_share(validator_keypair, share_index)?
.create_decryption_share_simple_precomputed(
Expand All @@ -368,7 +367,6 @@ impl<E: Pairing, T: Aggregate> PubliclyVerifiableSS<E, T> {
validator_keypair,
share_index,
domain_points,
g_inv,
)
}

Expand Down
4 changes: 2 additions & 2 deletions ferveo/src/refresh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ impl<E: Pairing> PrivateKeyShare<E> {
validator_keypair: &Keypair<E>,
share_index: u32,
domain_points: &[DomainPoint<E>],
g_inv: &E::G1Prepared,
) -> Result<DecryptionSharePrecomputed<E>> {
let g_inv = PubliclyVerifiableParams::<E>::default().g_inv();
// In precomputed variant, we offload some of the decryption related computation to the server-side:
// We use the `prepare_combine_simple` function to precompute the lagrange coefficients
let lagrange_coeffs = prepare_combine_simple::<E>(domain_points);
Expand All @@ -104,7 +104,7 @@ impl<E: Pairing> PrivateKeyShare<E> {
ciphertext_header,
aad,
lagrange_coeff,
g_inv,
&g_inv,
)
.map_err(|e| e.into())
}
Expand Down

0 comments on commit 4d04600

Please sign in to comment.