GithubHelp home page GithubHelp logo

catid / snowshoe Goto Github PK

View Code? Open in Web Editor NEW
62.0 12.0 9.0 2.46 MB

Snowshoe - Portable, Secure, Fast Elliptic Curve Math Library in C

License: BSD 3-Clause "New" or "Revised" License

C 5.90% C++ 83.34% Makefile 0.52% SourcePawn 6.65% Pascal 3.60%

snowshoe's Issues

FYI-- Likely faster constant time modular inverse

I know you're not currently actively developing this (though maybe there is more interest in weird curves now that the GLV patent has expired...), but I thought I'd send you a note-- close the issue when you've seen it. :p

Your existing fermat inverse is super duper fast because you mostly only need to work over the base field and mersenne numbers result in really nice ladders but there is a new approach that could be faster that you might be interested in: See https://github.com/bitcoin-core/secp256k1/blob/master/doc/safegcd_implementation.md which describes the implementation in libsecp256k1 (and links to the safegcd paper that inspired the work).

At 256 bits the speedup over a ladder is enormous, for 2^127-1 I expect it to be faster but it's possible that it wouldn't be. If you're ever interested in trying it out, feel free to drop me a line. It should be trivial to modify our code for your sized numbers (it already works but will waste some time due to working with 256 bit numbers) -- I would have done it just to post benchmarks but that would have required me to figure out how to benchmark your code. :P

Performance

I haven't been able to reproduce the performance figures that are listed in the README.

I used Intel i5-2500K (Sandy Bridge from 2011) running at 3.29 GHz (Turbo disabled), Windows 10 and binaries built with Visual Studio 2019 in x64 Release configuration.

Snowshoe Unit Tester: EC Scalar Multiplication
RDTSC instruction runs at 3.29252 GHz
+ ec_elligator: `33772` median cycles, `10.3136` avg usec
+ ec_mul_gen: `114412` median cycles, `34.8923` avg usec
+ ec_mul: `337620` median cycles, `102.747` avg usec
+ ec_simul_gen: `389280` median cycles, `118.303` avg usec
+ ec_simul: `469072` median cycles, `142.706` avg usec

This is 2-2.5 times slower than the presented cycle counts for Sandy Bridge. Any explanation for this discrepancy? Are some optimizations not enabled for Windows/MSVC?

Bad phrasing in docs

Can you please remove or rephrase the hand waving comment in the ecdh description to clarify that you're referring only to the double application, not the rough proof as a whole?

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.