fix: LiteHashDRBG에서 state 초기화 문제
This commit is contained in:
@@ -111,11 +111,11 @@ export class LiteHashDRBG implements RNG {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected async genNextBlock(): Promise<void> {
|
protected async genNextBlock(): Promise<void> {
|
||||||
|
this.bufferIdx = 0;
|
||||||
this.hq.setUint32(this.hqIdxPos, this.stateIdx, true);
|
this.hq.setUint32(this.hqIdxPos, this.stateIdx, true);
|
||||||
|
this.stateIdx += 1;
|
||||||
const digest = await sha512(this.hq.buffer);
|
const digest = await sha512(this.hq.buffer);
|
||||||
this.buffer = digest;
|
this.buffer = digest;
|
||||||
this.bufferIdx = 0;
|
|
||||||
this.stateIdx += 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public getMaxInt(): number {
|
public getMaxInt(): number {
|
||||||
|
|||||||
Reference in New Issue
Block a user