Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
regenerate requires public key not private key
  • Loading branch information
serengil authored Aug 3, 2024
1 parent c8bd4ca commit e8ef9c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lightphe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ def regenerate_ciphertext(self, ciphertext: Ciphertext) -> Ciphertext:
Returns:
ciphertext (from lightphe.models.Ciphertext import Ciphertext): encrypted message
"""
if self.cs.keys.get("private_key") is None:
raise ValueError("You must have private key to perform decryption")
if self.cs.keys.get("public_key") is None:
raise ValueError("You must have public key to perform decryption")

ciphertext_new = self.cs.reencrypt(ciphertext=ciphertext.value)
return Ciphertext(
Expand Down

0 comments on commit e8ef9c1

Please sign in to comment.