Skip to content

Commit

Permalink
chore: remove duplicated field
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec committed Jan 19, 2024
1 parent aebaab3 commit 802e712
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ferveo-tdec/benches/tpke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub fn bench_create_decryption_share(c: &mut Criterion) {
.map(|ctx| {
// Using create_unchecked here to avoid the cost of verifying the ciphertext
DecryptionShareSimple::create_unchecked(
&ctx.validator_private_key,
&ctx.setup_params.b,
&ctx.private_key_share,
&setup.shared.ciphertext.header().unwrap(),
)
Expand Down
8 changes: 3 additions & 5 deletions ferveo-tdec/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct PublicDecryptionContextSimple<E: Pairing> {

#[derive(Clone, Debug)]
pub struct SetupParams<E: Pairing> {
pub b: E::ScalarField,
pub b: E::ScalarField, // Validator private key
pub b_inv: E::ScalarField,
pub g: E::G1Affine,
pub g_inv: E::G1Prepared,
Expand Down Expand Up @@ -71,8 +71,6 @@ pub struct PrivateDecryptionContextSimple<E: Pairing> {
pub setup_params: SetupParams<E>,
pub private_key_share: PrivateKeyShare<E>,
pub public_decryption_contexts: Vec<PublicDecryptionContextSimple<E>>,
// TODO: Remove/replace with `setup_params.b` after refactoring
pub validator_private_key: E::ScalarField,
}

impl<E: Pairing> PrivateDecryptionContextSimple<E> {
Expand All @@ -82,7 +80,7 @@ impl<E: Pairing> PrivateDecryptionContextSimple<E> {
aad: &[u8],
) -> Result<DecryptionShareSimple<E>> {
DecryptionShareSimple::create(
&self.validator_private_key,
&self.setup_params.b,
&self.private_key_share,
ciphertext_header,
aad,
Expand All @@ -104,7 +102,7 @@ impl<E: Pairing> PrivateDecryptionContextSimple<E> {

DecryptionSharePrecomputed::new(
self.index,
&self.validator_private_key,
&self.setup_params.b,
&self.private_key_share,
ciphertext_header,
aad,
Expand Down
1 change: 0 additions & 1 deletion ferveo-tdec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ pub mod test_common {
h,
},
private_key_share,
validator_private_key: b,
public_decryption_contexts: vec![],
});
public_contexts.push(PublicDecryptionContextSimple::<E> {
Expand Down

0 comments on commit 802e712

Please sign in to comment.