fix: LiteHashDRBG에서 state 초기화 문제

This commit is contained in:
2023-08-05 17:23:21 +00:00
parent 743ab3e1aa
commit 2fb22ed6a9
+2 -2
View File
@@ -111,11 +111,11 @@ export class LiteHashDRBG implements RNG {
}
protected async genNextBlock(): Promise<void> {
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 {