The FSChaCha20 class, as written in the BIP's pseudocode, doesn't have an encrypt() method (even though the equivalent class in bip-0324/reference.py does), so use crypt() to be clear that we're not using FSChaCha20Poly1305 for peer.send_L.
bip-324: fix FSChaCha20 type error #1478
pull jamesob wants to merge 2 commits into bitcoin:master from jamesob:jamesob-23-07-bip324-err changing 1 files +23 −21-
jamesob commented at 7:10 PM on July 14, 2023: member
-
a3a15f40a5
bip-324: fix FSChaCha20 type error
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`.
-
jamesob commented at 7:11 PM on July 14, 2023: member
(Probably worth tagging @real-or-random @jonasschnelli @sipa)
- luke-jr added the label Proposed BIP modification on Jul 18, 2023
- jamesob force-pushed on Jul 21, 2023
- jamesob force-pushed on Jul 21, 2023
- jamesob force-pushed on Jul 21, 2023
- jamesob force-pushed on Jul 21, 2023
-
f1cd630099
bip-324: properly highlight Python source
For some reason, the fragments `b''` and `__init__` don't display properly in Github's mediawiki format, so special-case those.
-
jamesob commented at 6:42 PM on July 21, 2023: member
While in the neighborhood, I've added Python syntax highlighting where possible. Apparently Python
<source>fragments containing__init__()don't render properly, probably due to a collision with mediawiki's italics syntax. -
in bip-0324.mediawiki:486 in f1cd630099
485 | +def v2_enc_packet(peer, contents, aad=b"", ignore=False): 486 | assert len(contents) <= 2**24 - 1 487 | header = (ignore << IGNORE_BIT_POS).to_bytes(HEADER_LEN, 'little') 488 | plaintext = header + contents 489 | aead_ciphertext = peer.send_P.encrypt(aad, plaintext) 490 | - enc_contents_len = peer.send_L.encrypt(len(contents).to_bytes(LENGTH_FIELD_LEN, 'little'))
real-or-random commented at 4:36 PM on September 24, 2023:Hm., I think I'd prefer to add
encryptanddecryptmethods to the class.in bip-0324.mediawiki:493 in f1cd630099
495 | 496 | -<pre> 497 | +<source lang="python"> 498 | CHACHA20POLY1305_EXPANSION = 16 499 | 500 | -def v2_receive_packet(peer, aad=b'', skip_decoy=True):
real-or-random commented at 4:36 PM on September 24, 2023:nit: Did you change these intentionally? Now we have both
'and"in the source, which is also not very consistent.real-or-random commented at 4:37 PM on September 24, 2023: contributorThanks! It seems people actually read this. :)
Sad that GitHub rendering is that broken...
real-or-random commented at 4:37 PM on September 24, 2023: contributorcc @dhruv
murchandamus commented at 6:44 PM on May 1, 2024: contributorAre you still working on this, @jamesob?
murchandamus added the label PR Author action required on May 8, 2024jonatack commented at 3:52 PM on July 1, 2024: memberClosing due to PR author inactivity, happy to re-open (comment here). Otherwise up for grabs.
jonatack closed this on Jul 1, 2024bitcoin deleted a comment on Aug 28, 2024
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 11:10 UTC
This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 11:10 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me