Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split fheRand and fheRandBounded in two functions #204

Closed
immortal-tofu opened this issue Dec 20, 2024 · 2 comments
Closed

Split fheRand and fheRandBounded in two functions #204

immortal-tofu opened this issue Dec 20, 2024 · 2 comments

Comments

@immortal-tofu
Copy link
Collaborator

immortal-tofu commented Dec 20, 2024

There is a need to get the seed in contract which extends TFHEExecutor.sol (for event). For this, we need to split the generation of the seed and the generation of the randomness in two functions. It will be easier to override the function.

We need to do it for fheRand and fheRandBounded.

    /* TFHEExecutor.sol */
    function fheRand(bytes1 randType) public virtual override returns (uint256 result) {
        seed = generateSeed();
        result = generateRand(randType, seed);
    }

    /* TFHEExecutorWithEvents.sol (Overloaded function for events) */
    function fheRand(bytes1 randType) public virtual override returns (uint256 result) {
        seed = generateSeed();
        result = generateRand(randType, seed);
        emit FheRand(randType, seed, result);
    }
@jat9292
Copy link

jat9292 commented Dec 20, 2024

We need a similar generateRandBounded

@immortal-tofu immortal-tofu changed the title Split fheRand in two functions Split fheRand and fheRandBounded in two functions Dec 20, 2024
@jatZama
Copy link
Member

jatZama commented Dec 23, 2024

Done in #211

@jatZama jatZama closed this as completed Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants