(self, other_key_str: str)
| 234 | ) |
| 235 | |
| 236 | def generate_shared_key(self, other_key_str: str) -> str: |
| 237 | other_key = int(other_key_str, base=16) |
| 238 | if not self.is_valid_public_key(other_key): |
| 239 | raise ValueError("Invalid public key") |
| 240 | shared_key = pow(other_key, self.__private_key, self.prime) |
| 241 | return sha256(str(shared_key).encode()).hexdigest() |
| 242 | |
| 243 | @staticmethod |
| 244 | def is_valid_public_key_static(remote_public_key_str: int, prime: int) -> bool: |
nothing calls this directly
no test coverage detected