@iden3/js-crypto
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -6,5 +6,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.poseidon = exports.Poseidon = void 0; | ||
exports.poseidon = exports.Poseidon = exports.OPT = void 0; | ||
const ff_1 = require("../ff"); | ||
const poseidon_constants_opt_json_1 = __importDefault(require("./poseidon-constants-opt.json")); | ||
exports.OPT = ff_1.utils.unstringifyBigInts(poseidon_constants_opt_json_1.default); | ||
const N_ROUNDS_F = 8; | ||
@@ -22,10 +23,9 @@ const N_ROUNDS_P = [56, 57, 56, 60, 60, 63, 64, 63, 60, 66, 60, 65, 70, 60, 64, 68]; | ||
} | ||
const opt = ff_1.utils.unstringifyBigInts(poseidon_constants_opt_json_1.default); | ||
const t = inputs.length + 1; | ||
const nRoundsF = N_ROUNDS_F; | ||
const nRoundsP = N_ROUNDS_P[t - 2]; | ||
const C = opt.C[t - 2]; | ||
const S = opt.S[t - 2]; | ||
const M = opt.M[t - 2]; | ||
const P = opt.P[t - 2]; | ||
const C = exports.OPT.C[t - 2]; | ||
const S = exports.OPT.S[t - 2]; | ||
const M = exports.OPT.M[t - 2]; | ||
const P = exports.OPT.P[t - 2]; | ||
let state = [F.zero, ...inputs.map((a) => F.e(a))]; | ||
@@ -32,0 +32,0 @@ state = state.map((a, i) => F.add(a, C[i])); |
import { F1Field, Scalar, utils } from '../ff'; | ||
import op from './poseidon-constants-opt.json'; | ||
export const OPT = utils.unstringifyBigInts(op); | ||
const N_ROUNDS_F = 8; | ||
@@ -15,10 +16,9 @@ const N_ROUNDS_P = [56, 57, 56, 60, 60, 63, 64, 63, 60, 66, 60, 65, 70, 60, 64, 68]; | ||
} | ||
const opt = utils.unstringifyBigInts(op); | ||
const t = inputs.length + 1; | ||
const nRoundsF = N_ROUNDS_F; | ||
const nRoundsP = N_ROUNDS_P[t - 2]; | ||
const C = opt.C[t - 2]; | ||
const S = opt.S[t - 2]; | ||
const M = opt.M[t - 2]; | ||
const P = opt.P[t - 2]; | ||
const C = OPT.C[t - 2]; | ||
const S = OPT.S[t - 2]; | ||
const M = OPT.M[t - 2]; | ||
const P = OPT.P[t - 2]; | ||
let state = [F.zero, ...inputs.map((a) => F.e(a))]; | ||
@@ -25,0 +25,0 @@ state = state.map((a, i) => F.add(a, C[i])); |
@@ -0,1 +1,2 @@ | ||
export declare const OPT: any; | ||
export declare class Poseidon { | ||
@@ -2,0 +3,0 @@ static F: any; |
{ | ||
"name": "@iden3/js-crypto", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11384761
102098