(remote_public_key_str: int, prime: int)
| 242 | |
| 243 | @staticmethod |
| 244 | def is_valid_public_key_static(remote_public_key_str: int, prime: int) -> bool: |
| 245 | # check if the other public key is valid based on NIST SP800-56 |
| 246 | return ( |
| 247 | 2 <= remote_public_key_str <= prime - 2 |
| 248 | and pow(remote_public_key_str, (prime - 1) // 2, prime) == 1 |
| 249 | ) |
| 250 | |
| 251 | @staticmethod |
| 252 | def generate_shared_key_static( |
no outgoing calls
no test coverage detected