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

react-native-bls-signatures

v1.0.6

Published

bls

Downloads

40

Readme

React Native BLS Signatures

This is a React Native wrapper for BLS Signatures that offers quick and direct bindings to the native C++ library, accessible through a user-friendly TypeScript API.

Installation

To use this library in your React Native project run the following command:

yarn add react-native-bls-signatures

or

npm install react-native-bls-signatures

Example

const seed = Uint8Array.from([
  0, 50, 6, 244, 24, 199, 1, 25, 52, 88, 192, 19, 18, 12, 89, 6, 220, 18, 102,
  58, 209, 82, 12, 62, 89, 110, 182, 9, 44, 20, 254, 22,
]).buffer;

const sk = AugSchemeMPL.keyGen(seed);
const pk = sk.getG1();

const message = Uint8Array.from([1, 2, 3, 4, 5]).buffer;
const signature = AugSchemeMPL.sign(sk, message);

const ok = AugSchemeMPL.verify(pk, message, signature);
console.log(ok); // true

Documentation

AugSchemeMPL

Static Methods:

  • skToG1(sk: PrivateKey) -> G1Element
  • keyGen(seed: ArrayBuffer) -> PrivateKey
  • sign(sk: PrivateKey, msg: ArrayBuffer) -> G2Element
  • signPrepend(sk: PrivateKey, msg: ArrayBuffer, prependPk: G1Element) -> G2Element
  • verify(pk: G1Element, msg: ArrayBuffer, sig: G2Element) -> boolean
  • aggregate(g2Elements: G2Element[]) -> G2Element
  • aggregateVerify(pks: G1Element[], msgs: ArrayBuffer[], sig: G2Element) -> boolean
  • deriveChildSk(sk: PrivateKey, index: number) -> PrivateKey
  • deriveChildSkUnhardened(sk: PrivateKey, index: number) -> PrivateKey
  • deriveChildPkUnhardened(pk: G1Element, index: number) -> G1Element

BasicSchemeMPL

Static Methods:

  • skToG1(sk: PrivateKey) -> G1Element
  • keyGen(seed: ArrayBuffer) -> PrivateKey
  • sign(sk: PrivateKey, msg: ArrayBuffer) -> G2Element
  • verify(pk: G1Element, msg: ArrayBuffer, sig: G2Element) -> boolean
  • aggregate(g2Elements: G2Element[]) -> G2Element
  • aggregateVerify(pks: G1Element[], msgs: ArrayBuffer[], sig: G2Element) -> boolean
  • deriveChildSk(sk: PrivateKey, index: number) -> PrivateKey
  • deriveChildSkUnhardened(sk: PrivateKey, index: number) -> PrivateKey
  • deriveChildPkUnhardened(pk: G1Element, index: number) -> G1Element

PopSchemeMPL

Static Methods:

  • skToG1(sk: PrivateKey) -> G1Element
  • keyGen(seed: ArrayBuffer) -> PrivateKey
  • sign(sk: PrivateKey, msg: ArrayBuffer) -> G2Element
  • verify(pk: G1Element, msg: ArrayBuffer, sig: G2Element) -> boolean
  • aggregate(g2Elements: G2Element[]) -> G2Element
  • aggregateVerify(pks: G1Element[], msgs: ArrayBuffer[], sig: G2Element) -> boolean
  • deriveChildSk(sk: PrivateKey, index: number) -> PrivateKey
  • deriveChildSkUnhardened(sk: PrivateKey, index: number) -> PrivateKey
  • deriveChildPkUnhardened(pk: G1Element, index: number) -> G1Element
  • popVerify(pk: G1Element, sigProof: G2Element) -> boolean
  • popProve(sk: PrivateKey) -> G2Element
  • fastAggregateVerify(pks: G1Element[], msg: ArrayBuffer, sig: G2Element) -> boolean

PrivateKey

Static Methods:

  • fromBytes(bytes: ArrayBuffer, modOrder?: boolean) -> PrivateKey
  • fromHex(hex: string) -> PrivateKey
  • aggregate(pks: PrivateKey[]) -> PrivateKey

Methods:

  • toBytes() -> ArrayBuffer
  • toHex() -> string
  • toString() -> string
  • equals(sk: PrivateKey) -> boolean
  • getG1() -> G1Element
  • getG2() -> G2Element

G1Element

Static Methods:

  • fromBytes(bytes: ArrayBuffer) -> G1Element
  • fromHex(hex: string) -> G1Element

Methods:

  • toBytes() -> ArrayBuffer
  • toHex() -> string
  • getFingerPrint() -> number
  • add(g1e: G1Element) -> G1Element
  • negate() -> G1Element
  • equals(g1e: G1Element) -> boolean

G2Element

Static Methods:

  • fromBytes(bytes: ArrayBuffer) -> G2Element
  • fromHex(hex: string) -> G2Element

Methods:

  • toBytes() -> ArrayBuffer
  • toHex() -> string
  • add(g2e: G2Element) -> G2Element
  • negate() -> G2Element
  • equals(g2e: G2Element) -> boolean

Utils

  • hash256(msg: ArrayBuffer) -> ArrayBuffer
  • toHex(bytes: ArrayBuffer) -> string
  • fromHex(hex: string) -> ArrayBuffer
  • getRandomSeed() -> ArrayBuffer Only use if sodium is enabled!

Libsodium license

The libsodium static library is licensed under the ISC license which requires the following copyright notice.

ISC License

Copyright (c) 2013-2020 Frank Denis <j at pureftpd dot org>

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

BLST license

BLST is used with the Apache 2.0 license

Resources