indcpadec function

void indcpadec(
  1. Uint8List m,
  2. Uint8List c,
  3. Uint8List sk
)

Implementation

void indcpadec(Uint8List m, Uint8List c, Uint8List sk) {
  PolyVec u = polyvecdecompress(c.sublist(0, KYBER_POLYVECCOMPRESSEDBYTES));
  Poly v = polydecompress(c.sublist(KYBER_POLYVECCOMPRESSEDBYTES));

  PolyVec s = polyvecfrombytes(sk);

  Poly tmp = Poly();
  tmp.coeffs.fillRange(0, KYBER_N, 0);
  for (int i = 0; i < KYBER_K; i++) {
    Poly t = polybasemul(u.vec[i], s.vec[i]);
    tmp = polyadd(tmp, t);
  }

  Poly mp = polysub(v, tmp);
  polytomsg(m, mp);
}