1. Environment  ------------------------------
Ubuntu 20.04.2 LTS (GNU/Linux 5.8.0-63-generic x86_64)
sage version :   sage-9.2-Ubuntu_20.04-x86_64
Visual Studio version :  2019

2. How to use
1) C Code compile ----------------------
(1) Type "gcc -c REDOG.cpp" in the command window
(2) Type "ar crv libfile.a REDOG.o" in the command window
(3) Type "g++ -shared -fPIC -o REDOG.so ./REDOG.cpp" in the command window
End C Code compile

2) C Code after Run Python ---------------------
※ The REDOG.py file is the code used to output the result value once (random seed value)
※ The test.py file is the code used to output the submitted KAT result (fixed seed value)
(1) Modify the path of REDOG.so in REDOG.py and test.py before executing Python.
(2) Call Sage REDOG.py or Sage test.py in the Sage environment.
(3) Enter one of 128, 192, 256 in the security level question.
(4) If you enter 128, it will be executed. Seed, message, cipher text, and decrypted text are output.
The program is input in C and calculated in Sage. The calculated value is output in C.

3. Reason for additional creation of test.py in existing REDOG.py ------------------------------
There are no modifications to the calculation method in the code we are previously sending.
However, the existing REDOG code randomly assigns seed values. In order to compare the result of REDOG, the seed value in the previously sent KAT has been fixed.
And since security level 128 rotates 30 times and security level 192 and security level 256 rotate 15 times, this part is modified with an if statement.
Finally, there is a code that converts security level 128 to hexadecimal. Security level 128 takes a lot of time and memory.
So, security level 192 and security level 256 are not applied due to memory burden. This part also used 128 and 192, 256 using an if statement.