function MmodL()

in src/ristretto255.js [152:173]


function MmodL(o, a, b) {
  const t = new Float64Array(64);

  // Simple "operand scanning" schoolbook multiplication in two nested loops.
  // Elements of the resulting t have the max number of bits represented
  // by this 64-elements vector:
  // [16, 17, 18, 18, 19, 19, 19, 19, 20, 20,
  //  20, 20, 20, 20, 20, 20, 21, 21, 21, 21,
  //  21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
  //  21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
  //  21, 21, 21, 21, 21, 21, 21, 20, 20, 20,
  //  20, 20, 20, 20, 20, 19, 19, 19, 19, 18,
  //  18, 17, 16, 0]
  for (let i = 0; i < 32; i++) {
    for (let j = 0; j < 32; j++) {
      t[i + j] += a[i] * b[j];
    }
  }

  // Reduce t mod L and write to o
  lowlevel.modL(o, t);
}