From 608e03e852c936f8d49ca7ab59436113ef2dce04 Mon Sep 17 00:00:00 2001 From: Norman Date: Tue, 22 Aug 2023 18:40:53 +0800 Subject: [PATCH] fix verify bug, update hexToBNs --- src/helper/util.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/helper/util.ts b/src/helper/util.ts index 8bee4a64..5a9dfb6e 100644 --- a/src/helper/util.ts +++ b/src/helper/util.ts @@ -4,9 +4,9 @@ import { AddImageParams, ProvingParams, DeployParams, ResetImageParams, ModifyIm export class ZkWasmUtil { static hexToBNs(hexString: string): Array { - let bytes = new Array(hexString.length / 2); - for (var i = 0; i < hexString.length; i += 2) { - bytes[i] = new BN(hexString.slice(i, i + 2), 16); + let bytes = new Array(Math.ceil(hexString.length / 16)); + for (var i = 0; i < hexString.length; i += 16) { + bytes[i] = new BN(hexString.slice(i, Math.min(i + 16, hexString.length)), 16); } return bytes; }