npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

o1js-rsa

v0.0.1

Published

This repository exposes the API from the [o1js RSA example](https://github.com/o1-labs/o1js/tree/main/src/examples/crypto/rsa), making it importable and enabling RSA65537 signature verification on the Mina blockchain across various projects that utilize [

Downloads

3

Readme

O1JS VERIFY RSA65537

This repository exposes the API from the o1js RSA example, making it importable and enabling RSA65537 signature verification on the Mina blockchain across various projects that utilize o1js.

For more details on the source code, please review PR #1229.

How to use the package

  1. Install the package
npm install o1js-rsa
  1. Import the Bigint2048 provable type and the rsaVerify65537 function
import { Bigint2048, rsaVerify65537 } from 'o1js-rsa';
  1. Given a message, signature, and modulus you can verify an RSA65537 signature in o1js as follows:
const message = Bigint2048.from(msg);
const signature = Bigint2048.from(sig);
const modulus = Bigint2048.from(pubKey); // domain public key

rsaVerify65537(message, signature, modulus);

Please refer to rsaZkProgram or this test-case for better context on how to use the package API.

Notes

  • The Bigint2048.from() static method takes native bigint type inputs.

  • The provable type Bigint2048 is a combination of 18 limbs, with each limb being a 116-bit field element. Therefore, it will only throw an overflow error if the input size exceeds 2088 bits.

  • The Bigint2048 provable type only supports the x*y mod p operation, but not other operations like addition, division, etc.

  • Please ensure to input the correct RSA parameters in order to receive an intuitive response from the rsaVerify65537 function.

  • For concise information on RSA theory, visit this link.

How to build

npm run build

How to run tests

npm run test
npm run testw # watch mode

How to run coverage

npm run coverage

How to benchmark

npm run summary

Preview

| Summary | | | ----------- | ----- | | Total rows | 12401 | | RangeCheck0 | 2488 | | Generic | 9913 |


| Action | Time (s) | | ------- | -------- | | Compile | 2.103 | | Prove | 14.656 | | Verify | 1.187 |

License

Apache-2.0