diff --git a/src/libs/zelu.ts b/src/libs/zelu.ts new file mode 100644 index 0000000..6ebaee1 --- /dev/null +++ b/src/libs/zelu.ts @@ -0,0 +1,35 @@ +import { + Field, + Mina, + PrivateKey, + AccountUpdate, + SelfProof, + ZkProgram, + Struct, + Bool, + Circuit, + Poseidon, + MerkleMap, + MerkleTree, + MerkleWitness, + MerkleMapWitness, + verify, + Provable, + } from 'o1js'; + + const Zelu = ZkProgram({ + name: 'Zelu', + publicOutput: Field, + methods: { + zelu: { + privateInputs: [Field, Field], + + method(input, remainder): Field { + const n = Field(1000000000); // Assuming n is 10^9 + remainder.assertLessThan(n); + let tmp = input.square().add(input.mul(n)); + return tmp.sub(remainder).div(n); + }, + }, + }, + }); \ No newline at end of file