maci-crypto
Advanced tools
Comparing version 0.0.0-ci.ce41668 to 0.0.0-ci.cf6344f
@@ -62,3 +62,3 @@ import type { Plaintext } from "./types"; | ||
*/ | ||
export declare const hash13: (elements: Plaintext) => bigint; | ||
export declare const hash12: (elements: Plaintext) => bigint; | ||
/** | ||
@@ -65,0 +65,0 @@ * Hash a single BigInt with the Poseidon hash function |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hashOne = exports.hash13 = exports.hash5 = exports.hash4 = exports.hash3 = exports.hash2 = exports.hashN = exports.hashLeftRight = exports.poseidonT6 = exports.poseidonT5 = exports.poseidonT4 = exports.poseidonT3 = exports.poseidon = exports.sha256Hash = void 0; | ||
exports.hashOne = exports.hash12 = exports.hash5 = exports.hash4 = exports.hash3 = exports.hash2 = exports.hashN = exports.hashLeftRight = exports.poseidonT6 = exports.poseidonT5 = exports.poseidonT4 = exports.poseidonT3 = exports.poseidon = exports.sha256Hash = void 0; | ||
const poseidon_cipher_1 = require("@zk-kit/poseidon-cipher"); | ||
@@ -122,4 +122,4 @@ const ethers_1 = require("ethers"); | ||
*/ | ||
const hash13 = (elements) => { | ||
const max = 13; | ||
const hash12 = (elements) => { | ||
const max = 12; | ||
const elementLength = elements.length; | ||
@@ -135,11 +135,10 @@ if (elementLength > max) { | ||
} | ||
return (0, exports.poseidonT6)([ | ||
elementsPadded[0], | ||
(0, exports.poseidonT6)(elementsPadded.slice(1, 6)), | ||
(0, exports.poseidonT6)(elementsPadded.slice(6, 11)), | ||
return (0, exports.poseidonT5)([ | ||
(0, exports.poseidonT6)(elementsPadded.slice(0, 5)), | ||
(0, exports.poseidonT6)(elementsPadded.slice(5, 10)), | ||
elementsPadded[10], | ||
elementsPadded[11], | ||
elementsPadded[12], | ||
]); | ||
}; | ||
exports.hash13 = hash13; | ||
exports.hash12 = hash12; | ||
/** | ||
@@ -146,0 +145,0 @@ * Hash a single BigInt with the Poseidon hash function |
@@ -8,3 +8,3 @@ export { AccQueue } from "./AccQueue"; | ||
export { G1Point, G2Point, genRandomBabyJubValue } from "./babyjub"; | ||
export { sha256Hash, hashLeftRight, hashN, hash2, hash3, hash4, hash5, hash13, hashOne } from "./hashing"; | ||
export { sha256Hash, hashLeftRight, hashN, hash2, hash3, hash4, hash5, hash12, hashOne } from "./hashing"; | ||
export { inCurve } from "@zk-kit/baby-jubjub"; | ||
@@ -11,0 +11,0 @@ export { poseidonDecrypt, poseidonDecryptWithoutCheck, poseidonEncrypt } from "@zk-kit/poseidon-cipher"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sign = exports.verifySignature = exports.poseidonEncrypt = exports.poseidonDecryptWithoutCheck = exports.poseidonDecrypt = exports.inCurve = exports.hashOne = exports.hash13 = exports.hash5 = exports.hash4 = exports.hash3 = exports.hash2 = exports.hashN = exports.hashLeftRight = exports.sha256Hash = exports.genRandomBabyJubValue = exports.G2Point = exports.G1Point = exports.unpackPubKey = exports.packPubKey = exports.genEcdhSharedKey = exports.genKeypair = exports.genPubKey = exports.formatPrivKeyForBabyJub = exports.genRandomSalt = exports.genPrivKey = exports.SNARK_FIELD_SIZE = exports.NOTHING_UP_MY_SLEEVE = exports.deepCopyBigIntArray = exports.unstringifyBigInts = exports.stringifyBigInts = exports.bigInt2Buffer = exports.IncrementalQuinTree = exports.genTreeProof = exports.genTreeCommitment = exports.calcDepthFromNumLeaves = exports.AccQueue = void 0; | ||
exports.sign = exports.verifySignature = exports.poseidonEncrypt = exports.poseidonDecryptWithoutCheck = exports.poseidonDecrypt = exports.inCurve = exports.hashOne = exports.hash12 = exports.hash5 = exports.hash4 = exports.hash3 = exports.hash2 = exports.hashN = exports.hashLeftRight = exports.sha256Hash = exports.genRandomBabyJubValue = exports.G2Point = exports.G1Point = exports.unpackPubKey = exports.packPubKey = exports.genEcdhSharedKey = exports.genKeypair = exports.genPubKey = exports.formatPrivKeyForBabyJub = exports.genRandomSalt = exports.genPrivKey = exports.SNARK_FIELD_SIZE = exports.NOTHING_UP_MY_SLEEVE = exports.deepCopyBigIntArray = exports.unstringifyBigInts = exports.stringifyBigInts = exports.bigInt2Buffer = exports.IncrementalQuinTree = exports.genTreeProof = exports.genTreeCommitment = exports.calcDepthFromNumLeaves = exports.AccQueue = void 0; | ||
var AccQueue_1 = require("./AccQueue"); | ||
@@ -41,3 +41,3 @@ Object.defineProperty(exports, "AccQueue", { enumerable: true, get: function () { return AccQueue_1.AccQueue; } }); | ||
Object.defineProperty(exports, "hash5", { enumerable: true, get: function () { return hashing_1.hash5; } }); | ||
Object.defineProperty(exports, "hash13", { enumerable: true, get: function () { return hashing_1.hash13; } }); | ||
Object.defineProperty(exports, "hash12", { enumerable: true, get: function () { return hashing_1.hash12; } }); | ||
Object.defineProperty(exports, "hashOne", { enumerable: true, get: function () { return hashing_1.hashOne; } }); | ||
@@ -44,0 +44,0 @@ var baby_jubjub_1 = require("@zk-kit/baby-jubjub"); |
@@ -6,2 +6,10 @@ # Change Log | ||
**Note:** Version bump only for package maci-crypto | ||
## [1.2.0](https://github.com/privacy-scaling-explorations/maci/compare/v1.1.1...v1.2.0) (2024-02-23) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "maci-crypto", | ||
"version": "0.0.0-ci.ce41668", | ||
"version": "0.0.0-ci.cf6344f", | ||
"description": "A package containing cryptography utilities for MACI", | ||
@@ -27,3 +27,3 @@ "main": "build/ts/index.js", | ||
"@zk-kit/poseidon-cipher": "^0.3.0", | ||
"ethers": "^6.12.0" | ||
"ethers": "^6.12.1" | ||
}, | ||
@@ -33,3 +33,3 @@ "devDependencies": { | ||
"@types/mocha": "^10.0.6", | ||
"@types/node": "^20.12.7", | ||
"@types/node": "^20.12.10", | ||
"benny": "^3.7.1", | ||
@@ -65,3 +65,3 @@ "chai": "^4.3.10", | ||
}, | ||
"gitHead": "a241900eb939bb76edc422a585732479f85c56e4" | ||
"gitHead": "a666602d7c8703ae4c5d9393e774be2525c2ace7" | ||
} |
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 not supported yet
195132
1977
Updatedethers@^6.12.1