Python-ELMO is a Python library which offers an encapsulation of the binary tool ELMO, in order to manipulate it easily in Python and SageMath script.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

projectclass.py 763B

  1. class KyberNTTSimulation(SimulationProject):
  2. @classmethod
  3. def get_binary(cl):
  4. return 'project.bin'
  5. def __init__(self, *args, **kwargs):
  6. super().__init__(*args, **kwargs)
  7. def set_input(self, input):
  8. """ Write into the 'input' file of ELMO tool
  9. the parameters and the challenges for the simulation """
  10. super().set_input(input)
  11. def set_input_for_each_challenge(self, input, challenge):
  12. """ Write into the 'input' file of ELMO tool
  13. the 'challenge' for the simulation """
  14. secret = challenge
  15. # Write the secret vector
  16. for j in range(2): #k=2 for Kyber512
  17. for k in range(256): #n=256 for Kyber512
  18. write(input, secret[j,k])