Git Product home page Git Product logo

Comments (9)

jan-wassenberg avatar jan-wassenberg commented on May 5, 2024

Hi Vinzent, we were keen on simplifying the headers (already complicated due to conditional compilation and *State classes). How about this approach using a separate header?

from highwayhash.

vks avatar vks commented on May 5, 2024

I think that would be the best solution.

from highwayhash.

jan-wassenberg avatar jan-wassenberg commented on May 5, 2024

Glad to hear it, thanks :)

from highwayhash.

vks avatar vks commented on May 5, 2024

The bindings seem a bit inconsistent:

  • ScalarHighwayTreeHashC and SSE41HighwayTreeHashC seem to duplicate ScalarHighwayTreeHash and SSE41HighwayTreeHash. I think only the ones with a C suffix should exist?
  • There is ScalarSipTreeHash and SipTreeHash. They should probably get a C suffix as well?
  • HighwayTreeHashC was not callable from C before, so it's nice to have it.
  • There is no SipHashC.

I'll test the bindings once I get the build working again (#12).

from highwayhash.

jan-wassenberg avatar jan-wassenberg commented on May 5, 2024

The C-suffix functions have two disadvantages: they're harder to inline (requires link-time inlining because they're not in the header) and the key parameter is not type-safe (can cause out of bounds accesses - SipHash expects 2 uint64, the others 4). That's why we'd like to keep the C bindings separate :)

Honestly, I don't see much value in SipTreeHash because it's not drop-in compatible with SipHash, nor is it as fast as HighwayHash. Still, we can add their bindings for completeness (plus SipHashC - thanks for pointing that out). Please feel free to re-open if needed :)

from highwayhash.

vks avatar vks commented on May 5, 2024

I see. I bound against the non-suffix functions and it worked, probably due to an implicit cast.

Looks good to me, except that SipHashC seems to be missing from c_bindings.h.

from highwayhash.

jan-wassenberg avatar jan-wassenberg commented on May 5, 2024

Thanks for looking, sorry about the missing SipHashC. Will add that next week :)

from highwayhash.

jan-wassenberg avatar jan-wassenberg commented on May 5, 2024

Done :)

from highwayhash.

vks avatar vks commented on May 5, 2024

Great, thanks!

from highwayhash.

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.