{"id":28176347,"url":"https://github.com/azuchi/ruby_ecdsa_ext","last_synced_at":"2025-10-12T03:32:37.560Z","repository":{"id":82256658,"uuid":"605941471","full_name":"azuchi/ruby_ecdsa_ext","owner":"azuchi","description":"Extension of the ecdsa gem.","archived":false,"fork":false,"pushed_at":"2024-12-27T07:24:16.000Z","size":83,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T07:30:23.563Z","etag":null,"topics":["ecdsa","elliptic-curve"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/azuchi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":"azuchi"}},"created_at":"2023-02-24T08:33:28.000Z","updated_at":"2024-12-27T07:24:19.000Z","dependencies_parsed_at":"2024-01-11T08:36:00.655Z","dependency_job_id":"09311f48-4ea5-4d56-8b22-31e3d227041b","html_url":"https://github.com/azuchi/ruby_ecdsa_ext","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"888d0b3b1b8e00d34698d32dcb6d5d4346f9a856"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azuchi%2Fruby_ecdsa_ext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azuchi%2Fruby_ecdsa_ext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azuchi%2Fruby_ecdsa_ext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azuchi%2Fruby_ecdsa_ext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azuchi","download_url":"https://codeload.github.com/azuchi/ruby_ecdsa_ext/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442785,"owners_count":22071879,"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","elliptic-curve"],"created_at":"2025-05-16T00:17:54.629Z","updated_at":"2025-10-12T03:32:37.547Z","avatar_url":"https://github.com/azuchi.png","language":"Ruby","funding_links":["https://github.com/sponsors/azuchi"],"categories":[],"sub_categories":[],"readme":"# Extension of the ecdsa gem\n\nThis library is an extension of the [ecdsa gem](https://github.com/DavidEGrayson/ruby_ecdsa/),\nwhich mainly speeds up the computation of points on elliptic curves by using projective rather than affine coordinates.\n\nThis gem was not written by a cryptography expert and has not been carefully checked as with the original gem.\nIt is provided \"as is\" and it is the user's responsibility to make sure it will be suitable for the desired purpose.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'ecdsa_ext'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install ecdsa_ext\n\n## Usage\n\n### Convert coordinate from affine to projective\n\n```ruby\nrequire 'ecdsa_ext'\nrequire 'securerandom'\n\ngroup = ECDSA::Group::Secp256k1\nprivate_key = 1 + SecureRandom.random_number(group.order - 1)\naffine_point = group.generator * private_key\n#\u003cECDSA::Point: secp256k1, 0x22a7d03cd6fec52e13d2713da6921cf8f374631ecea7d575d31c3f338a410ad, 0x530b82285b951582bc330fc0b1d26df56bf93277d1229676ab9c2d4749098a7c\u003e\n\n# convert to projective point\nprojective_point = affine_point.to_projective\n#\u003cECDSA::Ext::ProjectivePoint:0x00007f45baa7f5b0 @group=#\u003cECDSA::Group:secp256k1\u003e, @x=979696094695476041658010915065787178569931130816884020506645009594358960301, @y=37562300065191370074864991137132392549749230653372621152572375247509483260540, @z=1\u003e\n```\n\n### Create directory\n\n```ruby\nrequire 'ecdsa_ext'\nrequire 'securerandom'\n\ngroup = ECDSA::Group::Secp256k1\nprivate_key = 1 + SecureRandom.random_number(group.order - 1)\nprojective_point = group.generator.to_projective * private_key\n#\u003cECDSA::Ext::ProjectivePoint:0x00007f45baa7f5b0 @group=#\u003cECDSA::Group:secp256k1\u003e, @x=979696094695476041658010915065787178569931130816884020506645009594358960301, @y=37562300065191370074864991137132392549749230653372621152572375247509483260540, @z=1\u003e\n```\n\n### Operation\n\n`ECDSA::Ext::ProjectivePoint` instance supports point addition, scalar multiplication and negation.\n\n```ruby\nrequire 'ecdsa_ext'\n\n# addition\nprojective_point3 = projective_point1 + projective_point2\n\n# multiplication\nprojective_point4 = projective_point3 * 123\n\n# negation\nprojective_point4_neg = projective_point4.negate\n```\n\n### Convert coordinate from projective to affine\n\n```ruby\nrequire 'ecdsa_ext'\n\naffine_point = projective_point4.to_affine\n```\n\n### Use jacobian coordinates\n\nJacobian coordinates have been supported since 0.3.0.\n\nWhen using Jacobian coordinates, use `ECDSA::Ext::JacobianPoint` instead of `ECDSA::Ext::ProjectivePoint`.\nIn addition, `ECDSA::Point` now has a `to_jacobian` method that convert affine coordinates to jacobian coordinates.\n\n### Apply jacobian coordinates to existing ECDSA sign/verify\n\nIf you want the existing ECDSA gem to generate and verify signatures in Jacobian coordinates,\nadd the following code. This code is a monkey patch to do the existing process in Jacobian coordinates.\n\n```ruby\nrequire 'ecdsa/ext/sign_verify'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazuchi%2Fruby_ecdsa_ext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazuchi%2Fruby_ecdsa_ext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazuchi%2Fruby_ecdsa_ext/lists"}