Skip to content

Commit

Permalink
Update secret_key.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojian-ant authored Oct 14, 2024
1 parent d066409 commit 4704aa1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions heu/library/algorithms/paillier_zahlen/secret_key.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ void SecretKey::Init() {
MPInt q_square_inv;
MPInt::InvertMod(q_square_, p_square_, &q_square_inv);
q_square_inv_mul_q_square_ =
q_square_inv * q_square_; // [(q^2)^{-1} mod p^2] * q^2
MPInt::InvertMod(p_, q_, &p_inv_mod_q_); // p^{-1} mod q
phi_p_square_ = p_ * (p_ - MPInt::_1_); // p(p-1)
phi_q_square_ = q_ * (q_ - MPInt::_1_); // q(q-1)
phi_p_ = p_ - 1_mp; // p-1
phi_q_ = q_ - 1_mp; // q-1
q_square_inv * q_square_; // [(q^2)^{-1} mod p^2] * q^2
MPInt::InvertMod(p_, q_, &p_inv_mod_q_); // p^{-1} mod q
phi_p_square_ = p_ * (p_ - MPInt::_1_); // p(p-1)
phi_q_square_ = q_ * (q_ - MPInt::_1_); // q(q-1)
phi_p_ = p_ - 1_mp; // p-1
phi_q_ = q_ - 1_mp; // q-1

// Precompute hp
MPInt n = p_ * q_;
Expand Down

0 comments on commit 4704aa1

Please sign in to comment.