@mysten/zklogin
Advanced tools
Comparing version 0.0.0-experimental-20240806174754 to 0.0.0-experimental-20240812145036
# @mysten/zklogin | ||
## 0.0.0-experimental-20240806174754 | ||
## 0.0.0-experimental-20240812145036 | ||
### Patch Changes | ||
- 6f79ed9: Additional check for bigints | ||
## 0.7.14 | ||
### Patch Changes | ||
- Updated dependencies [0851b31] | ||
- Updated dependencies [f37b3c2] | ||
- Updated dependencies [f37b3c2] | ||
- @mysten/sui@0.0.0-experimental-20240806174754 | ||
- @mysten/bcs@0.0.0-experimental-20240806174754 | ||
- @mysten/sui@1.5.0 | ||
- @mysten/bcs@1.0.4 | ||
@@ -13,0 +19,0 @@ ## 0.7.13 |
@@ -0,1 +1,2 @@ | ||
export declare const BN254_FIELD_SIZE = 21888242871839275222246405745257275088548364400416034343698204186575808495617n; | ||
export declare function poseidonHash(inputs: (number | bigint | string)[]): bigint; |
@@ -21,2 +21,3 @@ "use strict"; | ||
__export(poseidon_exports, { | ||
BN254_FIELD_SIZE: () => BN254_FIELD_SIZE, | ||
poseidonHash: () => poseidonHash | ||
@@ -44,3 +45,10 @@ }); | ||
]; | ||
const BN254_FIELD_SIZE = 21888242871839275222246405745257275088548364400416034343698204186575808495617n; | ||
function poseidonHash(inputs) { | ||
inputs.forEach((x) => { | ||
const b = BigInt(x); | ||
if (b < 0 || b >= BN254_FIELD_SIZE) { | ||
throw new Error(`Element ${b} not in the BN254 field`); | ||
} | ||
}); | ||
const hashFN = poseidonNumToHashFN[inputs.length - 1]; | ||
@@ -47,0 +55,0 @@ if (hashFN) { |
@@ -0,1 +1,2 @@ | ||
export declare const BN254_FIELD_SIZE = 21888242871839275222246405745257275088548364400416034343698204186575808495617n; | ||
export declare function poseidonHash(inputs: (number | bigint | string)[]): bigint; |
@@ -37,3 +37,10 @@ import { | ||
]; | ||
const BN254_FIELD_SIZE = 21888242871839275222246405745257275088548364400416034343698204186575808495617n; | ||
function poseidonHash(inputs) { | ||
inputs.forEach((x) => { | ||
const b = BigInt(x); | ||
if (b < 0 || b >= BN254_FIELD_SIZE) { | ||
throw new Error(`Element ${b} not in the BN254 field`); | ||
} | ||
}); | ||
const hashFN = poseidonNumToHashFN[inputs.length - 1]; | ||
@@ -51,4 +58,5 @@ if (hashFN) { | ||
export { | ||
BN254_FIELD_SIZE, | ||
poseidonHash | ||
}; | ||
//# sourceMappingURL=poseidon.js.map |
{ | ||
"name": "@mysten/zklogin", | ||
"version": "0.0.0-experimental-20240806174754", | ||
"version": "0.0.0-experimental-20240812145036", | ||
"description": "Utilities for interacting with zkLogin in Sui", | ||
@@ -41,4 +41,4 @@ "license": "Apache-2.0", | ||
"poseidon-lite": "^0.2.0", | ||
"@mysten/bcs": "0.0.0-experimental-20240806174754", | ||
"@mysten/sui": "0.0.0-experimental-20240806174754" | ||
"@mysten/bcs": "1.0.4", | ||
"@mysten/sui": "1.5.0" | ||
}, | ||
@@ -45,0 +45,0 @@ "scripts": { |
@@ -42,3 +42,13 @@ // Copyright (c) Mysten Labs, Inc. | ||
export const BN254_FIELD_SIZE = | ||
21888242871839275222246405745257275088548364400416034343698204186575808495617n; | ||
export function poseidonHash(inputs: (number | bigint | string)[]): bigint { | ||
inputs.forEach((x) => { | ||
const b = BigInt(x); | ||
if (b < 0 || b >= BN254_FIELD_SIZE) { | ||
throw new Error(`Element ${b} not in the BN254 field`); | ||
} | ||
}); | ||
const hashFN = poseidonNumToHashFN[inputs.length - 1]; | ||
@@ -45,0 +55,0 @@ |
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
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
197831
795
+ Added@mysten/bcs@1.0.4(transitive)
+ Added@mysten/sui@1.5.0(transitive)
- Removed@mysten/bcs@0.0.0-experimental-20240806174754(transitive)
- Removed@mysten/sui@0.0.0-experimental-20240806174754(transitive)
Updated@mysten/bcs@1.0.4
Updated@mysten/sui@1.5.0