MCPcopy Create free account
hub / github.com/ProtonMail/proton-python-client / setup

Method setup

tests/testserver.py:7–26  ·  view source on GitHub ↗
(self, username, modulus, verifier)

Source from the content-addressed store, hash-verified

5
6class TestServer:
7 def setup(self, username, modulus, verifier):
8 self.hash_class = pmhash
9 self.generator = 2
10 self._authenticated = False
11
12 self.user = username.encode()
13 self.modulus = bytes_to_long(modulus)
14 self.verifier = bytes_to_long(verifier)
15
16 self.b = get_random_of_length(32)
17 self.B = (
18 self.calculate_k() * self.verifier + pow(
19 self.generator, self.b, self.modulus
20 )
21 ) % self.modulus
22
23 self.secret = None
24 self.A = None
25 self.u = None
26 self.key = None
27
28 def calculate_server_proof(self, client_proof):
29 h = self.hash_class()

Callers 1

test_srpMethod · 0.95

Calls 3

calculate_kMethod · 0.95
bytes_to_longFunction · 0.90
get_random_of_lengthFunction · 0.90

Tested by

no test coverage detected