Giter Site home page Giter Site logo

cryptoecc's Introduction

Introduction

The implementation is in two header files only, mpi.h and ecc.h, which you can easily include in your C++ project. No linking of library code is needed. (but currently it does have some dependency on external source code, see Porting Guide)

Three types of ECC curve supported

  • Short Weierstrass : y^2 = x^3 + ax + b mod p
  • Montgomery curve : y^2 = x^3 + A x^2 + x mod p
  • Twisted Edward Curve : a * x^2 + y^2 = 1 + d x^2 y^2

Algorithm for ECDSA, EDDSA, and ECDH are implemented.

Support for Well-defined curve parameters:

  • NIST p256
  • curve25519
  • curve448
  • ed25519
  • ed448

Other parameters can be easily supported if you bother to look at the domain parameter template in the ecc.h.

You can figure out how to use these stuff mostly by looking at the demo.cpp of project.

Compile code and how to use it

When you pull code, make sure you also pull git submodules (git submodule update --init --recursive)

run 'make' in root folder and test folder will compile demo code and test code respectively.

demo code shows basics of signature signing and ECDH for all supported curves. test code has more intense stuff, including some performance benchmark. It shows some interesting data regarding mbedtls and this implementation.

Porting Guide

The implementation does not have much dependency on target system except that you will have to create a decent random number generator (used by implementation to generate secret keys and for counter-measure to side-channel attack). For a solution that needs to get PCI level security, the default rng implementation in default_rng.h is not good enough. You are on your own to go extra miles.

On the other hand, EDDSA needs sha512 and shake256 for signature scheme. It is not the goal of this project to implement such hashing alg from scratch. So you are welcome to use the reference implementation wrapped on mbedtls and tiny_sha3 project (in test/hash.cpp), or you can DIY.

cryptoecc's People

Contributors

daddyofqq avatar

Watchers

 avatar

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.