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

epir

v0.0.15

Published

EllipticPIR client library (Node.js / TypeScript bindings).

Downloads

64

Readme

libepir - EllipticPIR client library

CMake Node.js CI codecov

EllipticPIR is a private information retrieval (PIR) implementation backed by the EC-ElGamal encryption.

Try online WebAssembly demo: https://demo.ellipticpir.com/

This library contains cryptographic functions which are required to encrypt a query (a selector) to the EllipticPIR server and to decrypt a reply from the EllipticPIR server.

This repository provides native C library and bindings for C++, JavaScript and TypeScript programming languages.

C / C++

The C implementation has no runtime heap memory allocation. The C++ bindings is a header-only library.

Install

$ git clone https://github.com/EllipticPIR/libepir.git
$ cd libepir
$ mkdir build_c
$ cd build_c
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make -j4  # (change the number "4" to your physical CPU cores to parallelize the build).
$ sudo make install

Generate mG.bin

$ epir_genm

Usage

Include epir.h (C) or epir.hpp (C++) in your source code.

For general usage, see ./src_c/bench_*.(c|cpp) files.

Node.js / TypeScript

This library both includes Node.js native addons (faster, no browser support) and WebAssembly builds (slower, browser support).

Install

npm

$ npm install epir

Build your own

$ git clone https://github.com/EllipticPIR/libepir.git
$ cd libepir
$ npm ci

Usage

See ./src_ts/types.ts for Node.js binding definitions.

For general usage, see files under the ./src_ts/__tests__ directory and ./pages/index.vue.

FAQs

What is mG.bin?

To decrypt a server's reply, you need to generate the mG.bin file. This file contains the pre-computation values of (G, 2*G, .., (0xFFFFFF)*G), where G is the generater of the Ed25519 curve.

To generate mG.bin, run

$ epir_genm

or

$ npm run epir_genm

The computation may take tens of seconds to finish. The computation time depends on the CPU power of your machine. (For comparison, on my desktop (Intel Core i7-7700K) it takes about ~15sec.)

The generated file will be located in $HOME/.EllipticPIR/mG.bin. The file size will be ~576MiB.

If you will not decrypt a server's reply, you can skip this step.