Coder Social home page Coder Social logo

Comments (2)

Atul9 avatar Atul9 commented on June 4, 2024

@kurnevsky I am new to Rust and this project.
I tried to make the change([u8; 32]) locally and ran tests.

  1. I think the size of the array should be 91 since in onion_announce.rs ping_id function makes use of ONION_PING_DATA_SIZE which is 91. I came across this while fixing the failing tests hence I think it should be 91. Please let me know if I should proceed with updating the array size to 91
  2. What changes are needed to be done for and convert to PublicKey when needed since ping_id_or_pk is an array after this change.
  3. Is data_pk is needed on struct OnionNode after this change? since ping_id_or_pk is not a sha256::Digest or PublicKey after this change.
  4. Is ping_id_or_pk(onion_announce_response) is combination of ping_id and data_pk for OnionNode?

from tox.

kurnevsky avatar kurnevsky commented on June 4, 2024
  1. No, it should be 32 bytes - the length of curve25519 key and sha256 hash. ONION_PING_DATA_SIZE is the size of a data from which we calculate sha256 hash.
  2. We treat ping_id_or_pk as a key or as a hash depending on AnnounceStatus from a packet. So we just need to construct key and hash in the right places.
  3. Yes, ping_id_or_pk is still either a hash or a key. We just want to store it as a plain array unless we don't know what exactly it is.
  4. It's either a hash or a key.

from tox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.