toBytes method

List<int> toBytes(
  1. List<int> label,
  2. int outLen
)

Generates pseudo-random bytes based on the current transcript state.

Parameters:

  • label: A list of integers representing the label for the pseudo-random data.
  • outLen: The length of the pseudo-random data to generate, specified as an integer.

Implementation

List<int> toBytes(List<int> label, int outLen) {
  final len = List.filled(4, 0);
  BinaryOps.writeUint32LE(outLen, len);
  final List<int> labelSize = [...label, ...len];
  strobe.additionalData(true, labelSize);

  final List<int> outBytes = strobe.pseudoRandomData(outLen);
  return outBytes.asBytes;
}