File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 33
33
94730058721143827257669456336351159718085716196507891067256111928318063085006
34
34
)
35
35
36
- sample_seed = 'TIGER, tiger, burning bright. In the forests of the night'
37
- # RIPE hash on step
36
+ sample_seed = b 'TIGER, tiger, burning bright. In the forests of the night'
37
+ # RIPE hash on step 22 with signing key nonce 42
38
38
sample_deterministic_ripe = b'00cfb69416ae76f68a81c459de4e13460c7d17eb'
39
39
# Deterministic addresses with stream 1 and versions 3, 4
40
40
sample_deterministic_addr3 = 'BM-2DBPTgeSawWYZceFD69AbDT5q4iUWtj1ZN'
Original file line number Diff line number Diff line change @@ -87,12 +87,15 @@ def test_random_keys(self):
87
87
self .assertEqual (len (priv ), 32 )
88
88
self .assertEqual (highlevelcrypto .pointMult (priv ), pub )
89
89
90
- # def test_deterministic_keys(self):
91
- # """Generate deterministic keys, make ripe and compare it to sample"""
92
- # sigkey = highlevelcrypto.deterministic_keys(sample_seed, b'\x00')[1]
93
- # enkey = highlevelcrypto.deterministic_keys(sample_seed, b'\x01')[1]
94
- # self.assertEqual(
95
- # TestHashlib._hashdigest(sigkey + enkey), sample_deterministic_ripe)
90
+ def test_deterministic_keys (self ):
91
+ """Generate deterministic keys, make ripe and compare it to sample"""
92
+ # encodeVarint(42) = b'*'
93
+ sigkey = highlevelcrypto .deterministic_keys (sample_seed , b'*' )[1 ]
94
+ enkey = highlevelcrypto .deterministic_keys (sample_seed , b'+' )[1 ]
95
+ self .assertEqual (
96
+ sample_deterministic_ripe ,
97
+ hexlify (TestHashlib ._hashdigest (
98
+ hashlib .sha512 (sigkey + enkey ).digest ())))
96
99
97
100
def test_verify (self ):
98
101
"""Verify sample signatures and newly generated ones"""
You can’t perform that action at this time.
0 commit comments