in src/ristretto255.js [315:326]
function iszero25519(p) {
// first pack the element which does a final reduction mod 2^255-19,
// otherwise the element is stored mod 2^256-38 for convenience by nacl.js
const s = new Uint8Array(32);
lowlevel.pack25519(s, p);
// do byte-by-byte comparison
let res = 1;
for (let i = 0; i < 32; i++) {
res &= s[i] === 0;
}
return res;
}