Skip to main content

Reveal

src/reveal.py
from nada_dsl import *


def nada_main():
party = Party(name="Alice")
num = SecretInteger(Input(name="favorite_number", party=party))
base = num.to_public()
# power operations can only be performed on public integers, so the input needs to be revealed
num_squared = base ** Integer(2)
return [Output(num_squared, "num_squared", party)]

Run and test the reveal program

1. Open "Nada by Example"

Open in Gitpod

2. Run the program with inputs from the test file

nada run reveal_test

3. Test the program with inputs from the test file against the expected_outputs from the test file

nada test reveal_test
Feedback