Giter Site home page Giter Site logo

blackboxsystems / elliptic-curve-solidity Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tdrerup/elliptic-curve-solidity

0.0 2.0 0.0 9 KB

A pure solidity implementation of elliptic curve math, parameterised for curve secp256r1 / prime256v1 / p256.

License: MIT License

JavaScript 100.00%

elliptic-curve-solidity's Introduction

elliptic-curve-solidity

A pure Solidity implementation of elliptic curve secp256r1 / prime256v1 / p256.

Signature verification

The main purpose of this contract is verification of ECDSA signatures based on curve secp256r1 / prime256v1 / p256. To verify a signature, use the function

function validateSignature(bytes32 message, uint[2] memory rs, uint[2] memory Q) public pure
    returns (bool)

where

  • bytes32 message is the hash of the signed message
  • uint[2] rs contains the signature
  • uint[2] Q contains the coordinates of the public key

The function returns true for valid signatures, false otherwise.

Notes:

  • To disambiguate public keys when verifying signatures, activate condition rs[1] > lowSmax in validateSignature().
  • To run the tests, first install the node packages (npm install) and then run truffle test.
  • Verifying signatures is costly (!) in terms of gas.

Miscellanea

elliptic-curve-solidity's People

Watchers

James Cloos avatar  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.