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
  1. jamesob commented at 7:10 pm on July 14, 2023: member
    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.
  2. 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`.
    a3a15f40a5
  3. jamesob commented at 7:11 pm on July 14, 2023: member
    (Probably worth tagging @real-or-random @jonasschnelli @sipa)
  4. luke-jr added the label Proposed BIP modification on Jul 18, 2023
  5. jamesob force-pushed on Jul 21, 2023
  6. jamesob force-pushed on Jul 21, 2023
  7. jamesob force-pushed on Jul 21, 2023
  8. jamesob force-pushed on Jul 21, 2023
  9. 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.
    f1cd630099
  10. 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.
  11. 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 encrypt and decrypt methods to the class.
  12. 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.
  13. real-or-random commented at 4:37 pm on September 24, 2023: contributor

    Thanks! It seems people actually read this. :)

    Sad that GitHub rendering is that broken…

  14. real-or-random commented at 4:37 pm on September 24, 2023: contributor
    cc @dhruv
  15. sipa commented at 6:07 pm on January 5, 2024: member
    @jamesob Rebase?
  16. murchandamus commented at 6:44 pm on May 1, 2024: contributor
    Are you still working on this, @jamesob?
  17. murchandamus added the label PR Author action required on May 8, 2024
  18. jonatack commented at 3:52 pm on July 1, 2024: member
    Closing due to PR author inactivity, happy to re-open (comment here). Otherwise up for grabs.
  19. jonatack closed this on Jul 1, 2024

  20. bitcoin 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: 2024-12-26 12:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me