Skip to content

Commit

Permalink
TODOs and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnusv committed Sep 13, 2023
1 parent 8407f78 commit d51b516
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions ferveo/src/pvss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ impl<E: Pairing, T: Aggregate> PubliclyVerifiableSS<E, T> {
.map_err(|e| e.into())
}

// TODO: Consider relocate to different place, maybe PrivateKeyShare?
pub fn update_private_key_share_for_recovery(
&self,
validator_decryption_key: &E::ScalarField,
Expand Down
2 changes: 2 additions & 0 deletions ferveo/src/refresh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub fn prepare_share_updates_for_recovery<E: Pairing>(
prepare_share_updates_with_root::<E>(domain_points, h, x_r, threshold, rng)
}

// TODO: Consider relocating to PrivateKeyShare
/// From PSS paper, section 4.2.3, (https://link.springer.com/content/pdf/10.1007/3-540-44750-4_27.pdf)
pub fn apply_updates_to_private_share<E: Pairing>(
private_key_share: &PrivateKeyShare<E>,
Expand Down Expand Up @@ -147,6 +148,7 @@ mod tests_refresh {
remaining_participants: &[PrivateDecryptionContextSimple<E>],
) -> Vec<PrivateKeyShare<E>> {
// Each participant prepares an update for each other participant
// TODO: Extract as parameter
let domain_points = remaining_participants[0]
.public_decryption_contexts
.iter()
Expand Down
2 changes: 2 additions & 0 deletions tpke/src/combine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ pub fn prepare_combine_fast<E: Pairing>(
.collect::<Vec<_>>()
}

// TODO: Combine `tpke::prepare_combine_simple` and `tpke::share_combine_simple` into
// one function and expose it in the tpke::api?
pub fn prepare_combine_simple<E: Pairing>(
domain: &[E::ScalarField],
) -> Vec<E::ScalarField> {
Expand Down
2 changes: 2 additions & 0 deletions tpke/src/decryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ impl<E: Pairing> ValidatorShareChecksum<E> {
h: &E::G2,
ciphertext: &Ciphertext<E>,
) -> bool {
// See https://github.com/nucypher/ferveo/issues/42#issuecomment-1398953777
// D_i == e(C_i, Y_i)
if *decryption_share != E::pairing(self.checksum, *share_aggregate).0 {
return false;
}

// TODO: use multipairing here (h_inv)
// e(C_i, ek_i) == e(U, H)
if E::pairing(self.checksum, *validator_public_key)
!= E::pairing(ciphertext.commitment, *h)
Expand Down

0 comments on commit d51b516

Please sign in to comment.