New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

poseidon-h

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

poseidon-h

Poseidon hash with alt_bn128 implementation in Typescript

latest
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

Poseidon Hash over bn254 with Typescript

MIT License Language npm version CI Check

A poseidon hash implementation over BN254. Circom circuit and Groth16 tests.

Use at your own risk.

Install

$ npm i poseidon-h

Usage

import { poseidon, randomFieldElement } from "poseidon-h";
const wasm = require("circom_tester").wasm;

const hash = poseidon([1n, 2n]);
const hash2 = poseidon([randomFieldElement(), randomFieldElement()]);
const circuit = await wasm(path.join("circuit", "poseidon.circom"));
const witness = await circuit.calculateWitness({ inputs });
const hash = poseidon(inputs);

await circuit.assertOut(witness, { out: hash });

Test

$ yarn test

Groth16

$ yarn groth16

Keywords

poseidon

FAQs

Package last updated on 10 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts