polyvecfrombytes function

PolyVec polyvecfrombytes(
  1. Uint8List r
)

Converts bytes to a polyvec, assuming the format produced by polyvectobytes.

Implementation

PolyVec polyvecfrombytes(Uint8List r) {
  PolyVec v = PolyVec();
  for (int i = 0; i < KYBER_K; i++) {
    v.vec[i] = polyfrombytes(
        r.sublist(i * KYBER_POLYBYTES, (i + 1) * KYBER_POLYBYTES));
  }
  return v;
}