@guildofweavers/genstark
Advanced tools
Comparing version 0.7.4 to 0.7.5
@@ -32,3 +32,4 @@ "use strict"; | ||
// instantiate Hash object | ||
this.hash = merkle_1.createHash(sOptions.hashAlgorithm, this.air.field.isOptimized); | ||
const useWasm = (wasmOptions !== undefined) || this.air.field.isOptimized; | ||
this.hash = merkle_1.createHash(sOptions.hashAlgorithm, useWasm); | ||
if (!this.hash.isOptimized) { | ||
@@ -35,0 +36,0 @@ console.warn(`WARNING: WebAssembly optimization is not available for ${sOptions.hashAlgorithm} hash algorithm`); |
@@ -6,3 +6,3 @@ "use strict"; | ||
// ================================================================================================ | ||
const MASK_64B = 0xffffffffffffffffn; | ||
const MASK_32B = 0xffffffffn; | ||
// MERKLE PROOFS | ||
@@ -106,7 +106,6 @@ // ================================================================================================ | ||
function readBigInt(buffer, offset, elementSize) { | ||
const limbCount = elementSize >> 3; | ||
const limbCount = elementSize >> 2; | ||
let value = 0n; | ||
for (let i = 0n; i < limbCount; i++) { | ||
value = (buffer.readBigUInt64LE(offset) << (64n * i)) | value; | ||
offset += 8; | ||
for (let i = 0n; i < limbCount; i++, offset += 4) { | ||
value = (BigInt(buffer.readUInt32LE(offset)) << (32n * i)) | value; | ||
} | ||
@@ -117,7 +116,6 @@ return value; | ||
function writeBigInt(value, buffer, offset, elementSize) { | ||
const limbCount = elementSize >> 3; | ||
for (let i = 0; i < limbCount; i++) { | ||
buffer.writeBigUInt64LE(value & MASK_64B, offset); | ||
value = value >> 64n; | ||
offset += 8; | ||
const limbCount = elementSize >> 2; | ||
for (let i = 0; i < limbCount; i++, offset += 4) { | ||
buffer.writeUInt32LE(Number(value & MASK_32B), offset); | ||
value = value >> 32n; | ||
} | ||
@@ -124,0 +122,0 @@ return offset; |
{ | ||
"name": "@guildofweavers/genstark", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"description": "zk-STARK generation library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
96453
1631