{"id":28571892,"url":"https://github.com/tdrerup/elliptic-curve-solidity","last_synced_at":"2025-06-10T20:02:28.820Z","repository":{"id":45745909,"uuid":"169492889","full_name":"tdrerup/elliptic-curve-solidity","owner":"tdrerup","description":"A pure solidity implementation of elliptic curve math, parameterised for curve secp256r1 / prime256v1 / p256.","archived":false,"fork":false,"pushed_at":"2024-03-25T19:39:25.000Z","size":12,"stargazers_count":103,"open_issues_count":6,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-25T23:36:23.139Z","etag":null,"topics":["ecdsa","ecdsa-signature","elliptic-curves","ethereum","p256","secp256r1","solidity"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tdrerup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-06T23:28:05.000Z","updated_at":"2024-11-22T01:50:09.000Z","dependencies_parsed_at":"2024-06-18T17:03:13.945Z","dependency_job_id":null,"html_url":"https://github.com/tdrerup/elliptic-curve-solidity","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"2e1e5b251a220304871654a092132a6bf2158d3c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdrerup%2Felliptic-curve-solidity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdrerup%2Felliptic-curve-solidity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdrerup%2Felliptic-curve-solidity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdrerup%2Felliptic-curve-solidity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tdrerup","download_url":"https://codeload.github.com/tdrerup/elliptic-curve-solidity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdrerup%2Felliptic-curve-solidity/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258838549,"owners_count":22765933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecdsa","ecdsa-signature","elliptic-curves","ethereum","p256","secp256r1","solidity"],"created_at":"2025-06-10T20:01:02.799Z","updated_at":"2025-06-10T20:02:28.806Z","avatar_url":"https://github.com/tdrerup.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elliptic-curve-solidity\n\nA pure Solidity implementation of elliptic curve secp256r1 / prime256v1 / p256.\n\n#### Signature verification\n\nThe main purpose of this contract is verification of ECDSA signatures based on curve secp256r1 / prime256v1 / p256. To verify a signature, use the function\n\n    function validateSignature(bytes32 message, uint[2] memory rs, uint[2] memory Q) public pure\n        returns (bool)\n\nwhere\n\n* `bytes32 message` is the hash of the signed message\n* `uint[2] rs` contains the signature\n* `uint[2] Q` contains the coordinates of the public key\n\nThe function returns `true` for valid signatures, `false` otherwise.\n\nNotes:\n\n* To disambiguate public keys when verifying signatures, activate condition `rs[1] \u003e lowSmax` in `validateSignature()`.\n* To run the tests, first install the node packages (`npm install`) and then run `truffle test`.\n* Verifying signatures is costly (!) in terms of gas.\n\n#### Miscellanea\n\n* Tested with Solidity 0.5.0 and Truffle v5.0.1.\n* Some newer versions of web3.js cause issues due to improper handling of bigNumber objects.\n* Some components of the contract are based on code written by Andreas Olofsson, Alexander Vlasov (https://github.com/BANKEX/CurveArithmetics), and Avi Asayag (https://github.com/orbs-network/elliptic-curve-solidity).\n* Versions of the contract have been deployed on the main Ethereum network (https://etherscan.io/address/0xf471789937856d80e589f5996cf8b0511ddd9de4) as well as the Ropsten test network (https://ropsten.etherscan.io/address/0x8025532f39e089d8bb3ed783ccdd974ee8c3948f).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdrerup%2Felliptic-curve-solidity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftdrerup%2Felliptic-curve-solidity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdrerup%2Felliptic-curve-solidity/lists"}