Skip to content

Commit b7c79dc

Browse files
committed
address feedback (newline + extra whitespace)
1 parent b26f77d commit b7c79dc

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

bip-0352/reference.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def create_outputs(input_priv_keys: List[Tuple[ECKey, bool]], outpoints: List[CO
130130
# Input privkeys sum is zero -> fail
131131
return []
132132
assert ECKey().set(bytes.fromhex(expected.get("input_private_key_sum"))) == a_sum, "a_sum did not match expected input_private_key_sum"
133-
134133
input_hash = get_input_hash(outpoints, a_sum * G)
135134
silent_payment_groups: Dict[ECPubKey, List[ECPubKey]] = {}
136135
for recipient in recipients:
@@ -148,7 +147,6 @@ def create_outputs(input_priv_keys: List[Tuple[ECKey, bool]], outpoints: List[CO
148147
outputs = []
149148
for B_scan, B_m_values in silent_payment_groups.items():
150149
ecdh_shared_secret = input_hash * a_sum * B_scan
151-
152150
expected_shared_secrets = expected.get("shared_secrets", {})
153151
# Find the recipient address that corresponds to this B_scan and get its index
154152
for recipient_idx, recipient in enumerate(recipients):
@@ -157,7 +155,6 @@ def create_outputs(input_priv_keys: List[Tuple[ECKey, bool]], outpoints: List[CO
157155
expected_shared_secret_hex = expected_shared_secrets[recipient_idx]
158156
assert ecdh_shared_secret.get_bytes(False).hex() == expected_shared_secret_hex, f"ecdh_shared_secret did not match expected, recipient {recipient_idx} ({recipient['address']}): expected={expected_shared_secret_hex}"
159157
break
160-
161158
k = 0
162159
for B_m in B_m_values:
163160
t_k = TaggedHash("BIP0352/SharedSecret", ecdh_shared_secret.get_bytes(False) + ser_uint32(k))
@@ -173,10 +170,8 @@ def scanning(b_scan: ECKey, B_spend: ECPubKey, A_sum: ECPubKey, input_hash: byte
173170
input_hash_key = ECKey().set(input_hash)
174171
computed_tweak_point = input_hash_key * A_sum
175172
assert computed_tweak_point.get_bytes(False).hex() == expected.get("tweak"), "tweak did not match expected"
176-
177173
ecdh_shared_secret = input_hash * b_scan * A_sum
178174
assert ecdh_shared_secret.get_bytes(False).hex() == expected.get("shared_secret"), "ecdh_shared_secret did not match expected shared_secret"
179-
180175
k = 0
181176
wallet = []
182177
while True:

bip-0352/send_and_receive_test_vectors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3186,4 +3186,4 @@
31863186
}
31873187
]
31883188
}
3189-
]
3189+
]

0 commit comments

Comments
 (0)