From 2fb22ed6a9a5f6bdc81c7313adf407cc6437b084 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 5 Aug 2023 17:23:21 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20LiteHashDRBG=EC=97=90=EC=84=9C=20state?= =?UTF-8?q?=20=EC=B4=88=EA=B8=B0=ED=99=94=20=EB=AC=B8=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/util/LiteHashDRBG.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/util/LiteHashDRBG.ts b/server/util/LiteHashDRBG.ts index d5b4f82..e178059 100644 --- a/server/util/LiteHashDRBG.ts +++ b/server/util/LiteHashDRBG.ts @@ -111,11 +111,11 @@ export class LiteHashDRBG implements RNG { } protected async genNextBlock(): Promise { + this.bufferIdx = 0; this.hq.setUint32(this.hqIdxPos, this.stateIdx, true); + this.stateIdx += 1; const digest = await sha512(this.hq.buffer); this.buffer = digest; - this.bufferIdx = 0; - this.stateIdx += 1; } public getMaxInt(): number {