diff --git a/flag_encoder/index.html b/flag_encoder/index.html
index 3f52701..1070c07 100644
--- a/flag_encoder/index.html
+++ b/flag_encoder/index.html
@@ -34,7 +34,7 @@
return null;
h += c.toString(16).padStart(2, "0");
}
- return "0x" + new BN(keccak256(h).slice(2), 16).mod(secp256k1n).toString(16).padStart(64, 0);
+ return "0x" + new BN(keccak256(h).slice(2), 16).mod(secp256k1n.sub(new BN(1))).add(new BN(1)).toString(16).padStart(64, 0);
}
function updateOutputValues(ev) {