diff --git a/yarn-project/foundation/src/crypto/random/randomness_singleton.ts b/yarn-project/foundation/src/crypto/random/randomness_singleton.ts index f4d70f15f1f..fcdba51772d 100644 --- a/yarn-project/foundation/src/crypto/random/randomness_singleton.ts +++ b/yarn-project/foundation/src/crypto/random/randomness_singleton.ts @@ -52,6 +52,8 @@ export class RandomnessSingleton { } const result = Buffer.alloc(length); for (let i = 0; i < length; i++) { + // Each byte of the buffer is set to a 1 byte of this.counter's value. 0xff is 255 in decimal and it's used as + // a mask to get the last 8 bits of the shifted counter. result[i] = (this.counter >> (i * 8)) & 0xff; } this.counter++;