8 Commits

Author SHA1 Message Date
Petar Ivanov
fe1e97065e feat: add upper bound for encrypted random integers
Add overloads of TFHE.randEuint() methods that accept an upper bound,
e.g. TFHE.randEuint32(uint32 upperBound). The returned integer will be
in the [0, upperBound) range. Moreover, upperBound must be a power of
2 - that is a design choice for performance reasons.

Note that, as of now, the random numbers are generated in the plain and
are completely public and predictable. An FHE version is coming soon.

Add tests to cover above functionality.
2024-01-09 17:17:40 +02:00
Joseph-André Turk
535b055fc8 Updated Solidity version to ^0.8.20 and OpenZeppelin Contracts to ^5.0.1
updated to ethermint node

updated node dev version

removed parallel flag from hardhat test

reput inband test for ci

setup evm version to Paris to avoid PUSH0 error and updated hardhat version

removed utils.ts.new file

synced package.json and package-lock.json

prettier
2024-01-09 11:05:38 +01:00
Clément 'birdy' Danjou
cb1b8a27f1 fix() force 0.8.19 2023-09-25 16:37:13 +02:00
Clément 'birdy' Danjou
59f3480e3f fix() force 0.8.19 version for everything 2023-09-25 16:03:23 +02:00
Petar Ivanov
c91c2c2556 Add tests for storing decrypted random values (#136)
Tests apply to: https://github.com/zama-ai/go-ethereum/pull/167
2023-09-19 13:48:17 +03:00
Clément 'birdy' Danjou
dd385a2a40 feat() move contracts folder to examples folder 2023-09-11 13:42:57 +02:00
Clément 'birdy' Danjou
1abdec2ba6 Implement 712 with openzeppelin and begin clean 2023-06-01 17:11:29 +02:00
Petar Ivanov
d0669380df Add support for the rand precompile
Expose the `rand` precompile as `FHEOps.rand()`. It returns a handle to
a ciphertext that encrypts a random value. The returned ciphertext and
handle are deterministic and can be used on-chain.

Add an example contract that shows how the `rand` precompile works.
2023-02-14 15:29:35 +02:00