1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-01-19 05:45:07 +01:00

bip-0324: remove initiating parameter from ellswift_create calls

This commit is contained in:
Sebastian Falbesoner 2023-03-19 19:12:29 +01:00
parent 99ae9d9373
commit 59915dfc71

View File

@ -181,11 +181,11 @@ As explained before, these messages are sent to set up the connection:
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
| Initiator Responder | | Initiator Responder |
| | | |
| x, ellswift_X = ellswift_create(initiating=True) | | x, ellswift_X = ellswift_create() |
| | | |
| --- ellswift_X + initiator_garbage (initiator_garbage_len bytes; max 4095) ---> | | --- ellswift_X + initiator_garbage (initiator_garbage_len bytes; max 4095) ---> |
| | | |
| y, ellswift_Y = ellswift_create(initiating=False) | | y, ellswift_Y = ellswift_create() |
| ecdh_secret = v2_ecdh( | | ecdh_secret = v2_ecdh( |
| y, ellswift_X, ellswift_Y, initiating=False) | | y, ellswift_X, ellswift_Y, initiating=False) |
| v2_initialize(initiator, ecdh_secret, initiating=False) | | v2_initialize(initiator, ecdh_secret, initiating=False) |
@ -333,7 +333,7 @@ To establish a v2 encrypted connection, the initiator generates an ephemeral sec
<pre> <pre>
def initiate_v2_handshake(peer, garbage_len): def initiate_v2_handshake(peer, garbage_len):
peer.privkey_ours, peer.ellswift_ours = ellswift_create(initiating=True) peer.privkey_ours, peer.ellswift_ours = ellswift_create()
peer.sent_garbage = rand_bytes(garbage_len) peer.sent_garbage = rand_bytes(garbage_len)
send(peer, peer.ellswift_ours + peer.sent_garbage) send(peer, peer.ellswift_ours + peer.sent_garbage)
</pre> </pre>
@ -350,7 +350,7 @@ def respond_v2_handshake(peer, garbage_len):
while len(peer.received_prefix) < 12: while len(peer.received_prefix) < 12:
peer.received_prefix += receive(peer, 1) peer.received_prefix += receive(peer, 1)
if peer.received_prefix[-1] != V1_PREFIX[len(peer.received_prefix) - 1]: if peer.received_prefix[-1] != V1_PREFIX[len(peer.received_prefix) - 1]:
peer.privkey_ours, peer.ellswift_ours = ellswift_create(initiating=False) peer.privkey_ours, peer.ellswift_ours = ellswift_create()
peer.sent_garbage = rand_bytes(garbage_len) peer.sent_garbage = rand_bytes(garbage_len)
send(peer, ellswift_Y + peer.sent_garbage) send(peer, ellswift_Y + peer.sent_garbage)
return return