function cmov25519()

in src/ristretto255.js [337:348]


function cmov25519(p, q, b) {
  // if b = 1, c = 0xFFFFFFFF (32 bits);
  // else if b = 0, c = 0;
  // otherwise the behaviour is undefined
  let t;
  const c = -b;
  for (let i = 0; i < 16; i++) {
    t = p[i] ^ q[i];
    t &= c;
    p[i] ^= t;
  }
}