Skip to content

Commit

Permalink
🚚 migrate to @get-smooth orga
Browse files Browse the repository at this point in the history
  • Loading branch information
qd-qd committed May 7, 2024
1 parent aee38ba commit 481f08c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 34 deletions.
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

34 changes: 7 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
# secp256r1 computation

[![quality workflow](https://github.com/0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation/actions/workflows/quality.yml/badge.svg?branch=main)](https://github.com/0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation/actions/workflows/quality.yml)
[![unit-test workflow](https://github.com/0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation/actions/workflows/tests.yml)
[![Publish package to GitHub Packages](https://github.com/0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation/actions/workflows/release-package.yml/badge.svg)](https://github.com/0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation/actions/workflows/release-package.yml)
[![quality workflow](https://github.com/get-smooth/secp256r1-computation/actions/workflows/quality.yml/badge.svg?branch=main)](https://github.com/get-smooth/secp256r1-computation/actions/workflows/quality.yml)
[![unit-test workflow](https://github.com/get-smooth/secp256r1-computation/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/get-smooth/secp256r1-computation/actions/workflows/tests.yml)
[![Publish package to GitHub Packages](https://github.com/get-smooth/secp256r1-computation/actions/workflows/release-package.yml/badge.svg)](https://github.com/get-smooth/secp256r1-computation/actions/workflows/release-package.yml)

## Description

This library is a powerful tool designed to enhance the performance of ECDSA signing and verification processes. It achieves this by generating a precomputed table of 256 points on the secp256r1 elliptic curve from a given public key. By optimizing point multiplication operations, our package significantly accelerates cryptographic computations, thus facilitating less costly elliptic curve digital signature algorithms.

## Installation

To install the `secp256r1-computation` package, you need to add the Github registry to your npm configuration. To do so, you can use the following command in your terminal:
To install the `secp256r1-computation` package, you can use the following command in your terminal:

```sh
npm config set @0x90d2b2b7fb7599eebb6e7a32980857d8:registry=https://npm.pkg.github.com
```

That will tell npm to use the Github registry for packages starting with `@0x90d2b2b7fb7599eebb6e7a32980857d8`.

Once the Github registry is set, you have to create a **classic** token on Github. To do so, go to your [Github settings](https://github.com/settings/tokens). The token must have the `read:packages` scope. Once you have created the token, you can use the following command in your terminal to authenticate to the Github registry:

```sh
npm login --auth-type=legacy --registry=https://npm.pkg.github.com
```

The username is your Github username and your password is the token you just created.

You are ready to install the package. To do so, you can use the following command in your terminal:

```sh
npm install @0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation
npm install @smoo.th/secp256r1-computation
```

This will install the latest version of the package. Once the installation is complete, you can import the package into your project and start using it to generate precomputed points for the secp256r1 elliptic curve.

> ℹ️ Note that this package is not published on the npm registry. It is only available on GitHub Packages. This means that you need to be authenticated to GitHub Packages to install it. For more information, please refer to the [GitHub documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#installing-a-package). We would be happy to deploy it on the npm registry if there is a need for it. Feel free to open an issue if you would like to see this package on the npm registry.
Here's the [page of the package on GitHub Packages](https://github.com/0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation/pkgs/npm/secp256r1-computation)

## Contributing

To contribute to this project, you need to have Node.js and npm installed on your system. You can download them from the official Node.js website: https://nodejs.org/
Expand Down Expand Up @@ -110,7 +90,7 @@ The returned value is a string containing the precomputation table in JSON forma
Here's an example of how to use this library:

```ts
import precomputedPoints from "@0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation";
import precomputedPoints from "@smoo.th/secp256r1-computation";

const x = 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdefn;
const y = BitInt(42);
Expand All @@ -131,7 +111,7 @@ node cli.mjs <x> <y>
If you want to use it globally on your laptop, you can use `npx` for that. Run the following command to run and install the script globally:

```sh
npx @0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation <x> <y>
npx @smoo.th/secp256r1-computation <x> <y>
```

> 💡 You should probably set an zsh/bash/... alias for this command if you plan on using it often.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation",
"name": "@smoo.th/secp256r1-computation",
"version": "2.2.0",
"description": "This library boosts ECDSA performance by generating a precomputed table of 256 points on the secp256r1 curve from a public key. This optimization speeds up point multiplication, making elliptic curve digital signature algorithms more efficient.",
"source": "src/index.ts",
Expand Down Expand Up @@ -50,12 +50,12 @@
],
"repository": {
"type": "git",
"url": "[email protected]:0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation.git"
"url": "[email protected]:get-smooth/secp256r1-computation.git"
},
"bugs": {
"url": "https://github.com/0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation/issues"
"url": "https://github.com/get-smooth/secp256r1-computation/issues"
},
"homepage": "https://github.com/0x90d2b2b7fb7599eebb6e7a32980857d8/secp256r1-computation#readme",
"homepage": "https://github.com/get-smooth/secp256r1-computation#readme",
"license": "MIT",
"dependencies": {
"@noble/curves": "^1.0.0"
Expand Down

0 comments on commit 481f08c

Please sign in to comment.