Skip to content

Commit

Permalink
bip-324: fix FSChaCha20 type error
Browse files Browse the repository at this point in the history
The FSChaCha20 class, as written in the BIP's pseudocode, doesn't have
an encrypt() method (even though the equivalent class in the
`bip-0324/reference.py` does), so use crypt() to be clear that we're
not using FSChaCha20Poly1305 for `peer.send_L`.
  • Loading branch information
jamesob committed Jul 14, 2023
1 parent 66a1a81 commit a3a15f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bip-0324.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def v2_enc_packet(peer, contents, aad=b'', ignore=False):
header = (ignore << IGNORE_BIT_POS).to_bytes(HEADER_LEN, 'little')
plaintext = header + contents
aead_ciphertext = peer.send_P.encrypt(aad, plaintext)
enc_contents_len = peer.send_L.encrypt(len(contents).to_bytes(LENGTH_FIELD_LEN, 'little'))
enc_contents_len = peer.send_L.crypt(len(contents).to_bytes(LENGTH_FIELD_LEN, 'little'))
return enc_contents_len + aead_ciphertext
</pre>
Expand Down

0 comments on commit a3a15f4

Please sign in to comment.