diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CHANGES.md b/TIIGER_TLS/PQ_TIIGER_TLS/CHANGES.md new file mode 100644 index 0000000..e5fa255 --- /dev/null +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CHANGES.md @@ -0,0 +1,243 @@ +# Change Log +All notable changes to this project will be documented in this file. + +## 2023-11-20 +### Added + +- support for Windows platform: + - pre-processor condition with Windows headers *winsock2.h*, *afunix.h*, *ws2tcpip.h* in tls_sockets.h + + - pre-processor condition in *int setclientsock()* function - changing input argument in *setsockopt()* function for Windows compatibility in tls_sockets.cpp + + - WSA structure inicialization and cleanup in client.cpp file + + - linking *-lws2_32* in CMakeLists.txt + +- *-lstdc++* in CMakeLists.txt for compatibility with gcc + + +## 2023-11-20 +### Added + +- Header file *oqs/oqs.h* and *oqs/oqsconfig.h* from liboqs library + +- linking liboqs library with *-loqs* in CMakeLists.txt + +### Changed + +- Library name in *char *SAL_name()* +- Random number generator *OQS_randombytes()* in *bool SAL_initLib()* + +### Removed +- Unused conditions and functions + +## 2023-12-22 +### Added + +- Notes for dilithium3 functions from liboqs + +## 2024-01-13 +### Changed + +- *void SAL_generateKeyPair()* for kyber768 now working with function from liboqs + +- both *static bool DILITHIUM3_VERIFY()* and *static void DILITHIUM3_SIGN()* now working with functions from liboqs + +### Removed + +- Unused declarations and variables + +## 2024-01-15 +### Changed + +- *bool SAL_generateSharedSecret()* for kyber768 now working with function from liboqs + +### Removed + +- Header file *kyber.h* +- Unused declarations and variables + +## 2024-01-25 +### Added + +- New CA certificate for https://test.openquantumsafe.org/ in tls_cacerts.cpp + +### Changed +- Client certificate update + +## 2024-02-17 +### Added + +- TLS IDs for PQ KEM algorithms based on https://github.com/open-quantum-safe/oqs-provider/blob/main/ALGORITHMS.md in tls1_3.h + +- new PQ KEM algorithms in *int SAL_groups()* + +- functions for key generating for kyber512, kyber1024, bikel1, bikel3, bikel5, hqc128, hqc192, hqc256, FrodoKEM-640-AES, FrodoKEM-640-SHAKE, FrodoKEM-976-AES, FrodoKEM-976-SHAKE, FrodoKEM-1344-AES, FrodoKEM-1344-SHAKE in *void SAL_generateKeyPair()* function + +- decapsulation functions for kyber512, kyber1024, bikel1, bikel3, bikel5, hqc128, hqc192, hqc256, FrodoKEM-640-AES, FrodoKEM-640-SHAKE, FrodoKEM-976-AES, FrodoKEM-976-SHAKE, FrodoKEM-1344-AES, FrodoKEM-1344-SHAKE in *bool SAL_generateSharedSecret()* + +### Changed + +- variables for PQ crypto_setting in tls1_3.h file: + - TLS_MAX_KEX_PUB_KEY_SIZE - according the biggest public key size from all available KEM algorithm (FrodoKEM-1344-SHAKE) + - TLS_MAX_KEX_CIPHERTEXT_SIZE - according the biggest ciphertext size from all available KEM algorithm (FrodoKEM-1344-SHAKE) + - TLS_MAX_KEX_SECRET_KEY_SIZE - according the biggest secret key size from all available KEM algorithm (FrodoKEM-1344-SHAKE) + - TLS_MAX_SUPPORTED_GROUPS - need to raise the variable because of adding more KEM algorithms + +27-29 +## 2024-02-26 +### Added + +- listing of KEM key sizes (public and private keys) in client.cpp + +- TLS IDs for PQ signature algorithms in tls1_3.h based on https://github.com/open-quantum-safe/oqs-provider/blob/main/ALGORITHMS.md + +- Object IDs for dilitihum2 and dilitihum3 in tls_x509.cpp based on https://github.com/open-quantum-safe/oqs-provider/blob/main/ALGORITHMS.md + +- PQ curve variables for dilitihum2, dilitihum3 and dilitihum5 in tls_x509.h for recognizing used algorithm in further processing + +- PQ signature algorithms dilithium2 and dilithium5 in *int SAL_sigs()* and *int SAL_sigCerts()* + +- verification functions for PQ signature algorithms dilithium2, dilithium5; calling them in *bool SAL_tlsSignatureVerify()* + +- signing functions for PQ signature algorithms dilithium2, dilithium5; calling them in *void SAL_tlsSignature()* + +- listing of all new KEM and dilithium signature algorithms in tls_logger.cpp and client.cpp + +- conditions for certificate verification for dilitihum2, dilithium3 and dilithium5 in tls_cert_chain.cpp + +- functions for public and private key from PQ certificates, setting PQ curve for further processing + +## 2024-02-27 +### Added + +- verification functions for PQ signature algorithms falcon512, falcon1024, SPHINCS+-SHA2-128f-simple, SPHINCS+-SHA2-128s-simple, SPHINCS+-SHA2-192f-simple, SPHINCS+-SHA2-192s-simple, SPHINCS+-SHA2-256f-simple, SPHINCS+-SHA2-256s-simple, SPHINCS+-SHAKE-128f-simple, SPHINCS+-SHAKE-128s-simple, SPHINCS+-SHAKE-192f-simple, SPHINCS+-SHAKE-192s-simple, SPHINCS+-SHAKE-256f-simple, SPHINCS+-SHAKE-256s-simple; ; calling them in *bool SAL_tlsSignatureVerify()* + +- signing functions for PQ signature algorithms falcon512, falcon1024, SPHINCS+-SHA2-128f-simple, SPHINCS+-SHA2-128s-simple, SPHINCS+-SHA2-192f-simple, SPHINCS+-SHA2-192s-simple, SPHINCS+-SHA2-256f-simple, SPHINCS+-SHA2-256s-simple, SPHINCS+-SHAKE-128f-simple, SPHINCS+-SHAKE-128s-simple, SPHINCS+-SHAKE-192f-simple, SPHINCS+-SHAKE-192s-simple, SPHINCS+-SHAKE-256f-simple, SPHINCS+-SHAKE-256s-simple; ; calling them in *void SAL_tlsSignature()* + +## 2024-02-28 +### Added + +- PQ curve variables for falcon512, falcon1024, SPHINCS+-SHA2-128f-simple, SPHINCS+-SHA2-128s-simple, SPHINCS+-SHAKE-128f-simple, SPHINCS+-SHA2-192f-simple + +- Object IDs for falcon512, falcon1024, SPHINCS+-SHA2-128f-simple, SPHINCS+-SHA2-128s-simple, SPHINCS+-SHAKE-128f-simple, SPHINCS+-SHA2-192f-simple + +- conditions for certificate verification for falcon512, falcon1024, SPHINCS+-SHA2-128f-simple, SPHINCS+-SHA2-128s-simple, SPHINCS+-SHAKE-128f-simple, SPHINCS+-SHA2-192f-simple + +- functions for public and private key from PQ certificates, setting PQ curve for further processing + +- listing of all new PQ signature algorithms in tls_logger.cpp and client.cpp + +### Removed +- TLS IDs for unsupported PQ signature algorithms (unsupported by oqsprovider (unable to test them)) - SPHINCS+-SHA2-192s-simple, SPHINCS+-SHA2-256f-simple, SPHINCS+-SHA2-256s-simple, SPHINCS+-SHAKE-128s-simple, SPHINCS+-SHAKE-192f-simple, SPHINCS+-SHAKE-192s-simple, SPHINCS+-SHAKE-256f-simple, SPHINCS+-SHAKE-256s-simple + +- verification functions for unsupported PQ signature algorithms (unsupported by oqsprovider (unable to test them)) - SPHINCS+-SHA2-192s-simple, SPHINCS+-SHA2-256f-simple, SPHINCS+-SHA2-256s-simple, SPHINCS+-SHAKE-128s-simple, SPHINCS+-SHAKE-192f-simple, SPHINCS+-SHAKE-192s-simple, SPHINCS+-SHAKE-256f-simple, SPHINCS+-SHAKE-256s-simple + +- signing functions for unsupported PQ signature algorithms (unsupported by oqsprovider (unable to test them)) - SPHINCS+-SHA2-192s-simple, SPHINCS+-SHA2-256f-simple, SPHINCS+-SHA2-256s-simple, SPHINCS+-SHAKE-128s-simple, SPHINCS+-SHAKE-192f-simple, SPHINCS+-SHAKE-192s-simple, SPHINCS+-SHAKE-256f-simple, SPHINCS+-SHAKE-256s-simple + +### Changed + +- Linux pre-processor condition for BIKE signature algorithm (BIKE is not supported on Windows platform (yet)) in *void SAL_generateKeyPair()* + +- variables for PQ crypto_setting in tls1_3.h file: + - TLS_MAX_SIG_PUB_KEY_SIZE - according the biggest public key size from all available signature algorithms (dilithium5) + - TLS_MAX_SIG_SECRET_KEY_SIZE - according the biggest secret key size from all available signature algorithms (dilithium5) + - TLS_MAX_SIGNATURE_SIZE - according the biggest signature size from all available signature algorithms (SPHINCS+-SHA2-128f-simple or SPHINCS+-SHAKE-128f-simple) + - TLS_MAX_SUPPORTED_SIGS - need to raise the variable because of adding more signature algorithms + - MAX_IBUFF_SIZE - need to raise the variable because of bigger size of certchain (SPHINCS+-SHAKE-128f-simple) + - TLS_X509_MAX_FIELD - need to raise the variable because of bigger size of certchain (SPHINCS+-SHAKE-128f-simple) + +### Tested + +- all KEM protocols and signature algorithms with OpenSSL native server and test.openquantumsafe.org server + +- correct behaviour on Linux and Windows x64 platform + +## 2024-02-29 +### Changed + +- same PQ curve for SPHINCS+-SHA2-128f-simple and SPHINCS+-SHAKE-128f-simple (same size) +- calling verification functions for both SPHINCS+-SHA2-128f-simple and SPHINCS+-SHAKE-128f-simple + +### Removed + +- sign and verify function for SPHINCS+-SHA2-192f-simple (return of wrong expiration date; bug?) +- removed all added changes associated with SPHINCS+-SHA2-192f-simple (ID, OID, curve, conditions) + +## 2024-03-01 +### Added + +- *OQS_TEST_results.txt* with results of testing on test.openquantumsafe.org server + +### Removed + +- unused functions and variables for unsupported algorithms by liboqs or oqsprovider (unable to test them) + +## 2024-03-03 +### Added + +- comments about changes of functions and variables + +- comments on the beggining of every changed file + +- readme with information about building and using the client, summary of all changes, details of testing + +### Removed + +- arduino conditions in files: tls_octads.h, tls_sockets.h, tls_logger.cpp, tls_octads.cpp, tls_sockets.cpp + +- files for arduino - arduino/client.cpp, wifi.h + +- removed unnecessery files: blogs, unused .xpp files + +## 2024-03-03 +### Changed + +- *OQS_randombytes()* used as seed for original miracl rng + +## 2024-03-04 +### Added + +- .exe file for Windows x64 generated with CMake 'MinGW file' instead 'Unix MakeFile' + +- miracl core folders for Windows x64, Windows x86 and Linux Ubuntu 22.04 in sal folder + +- readme in sal folder with guideline for generating miracl core files + +- permanent library linking *-lws2_32* in CMakeLists.txt for Windows compatibility (remove in case of Linux platform) + +### Removed + +- unused conditions and variables from CMakeLists.txt + +## 2024-04-14 +### Added + +- IDs for ML-KEM and ML-DSA + +- functions for key generating for ml-kem512, ml-kem768, ml-kem1024 + +- decapsulation functions for ml-kem512, ml-kem768, ml-kem1024 + +- object IDs for ML-KEM and ML-DSA + +- signing functions for PQ signature algorithms ml-dsa44, ml-dsa65, ml-dsa87; calling them in *void SAL_tlsSignature()* + +- listing of ML-KEMs and ML-DSAs in tls_logger.cpp and client.cpp + +- conditions for certificate verification for ml-dsa44, ml-dsa65, ml-dsa87 in tls_cert_chain.cpp + +- functions for public and private key from PQ certificates, setting PQ curve for further processing + +- new PQ curve to distinguish SPHINCS+-SHA2-128f-simple and SPHINCS+-SHAKE-128f-simple + +### Changed + +- IDs for HQC and Falcon algorithms according to https://github.com/open-quantum-safe/oqs-provider/releases/tag/0.6.0 + +- PQ curves for all PQ signature schemes + +## 2024-04-15 +### Added + +- *OQS_TEST_results2.txt* with results of testing on test.openquantumsafe.org server with new \ No newline at end of file diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeCache.txt b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeCache.txt index c1dc5d3..9fc8ab5 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeCache.txt +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeCache.txt @@ -1,5 +1,5 @@ # This is the CMakeCache file. -# For build in directory: d:/DOKUMENTY/diplomovka-final/Scott-cpp-win +# For build in directory: d:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS # It was generated by CMake: C:/mingw64/bin/cmake.exe # You can edit this file to change values found and used by cmake. # If you do not want to change any of the values, simply exit the editor. @@ -104,7 +104,7 @@ CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= //Value Computed by CMake. -CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/pkgRedirects +CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/pkgRedirects //Convert GNU import libraries to MS format (requires Visual Studio) CMAKE_GNUtoMS:BOOL=OFF @@ -240,13 +240,13 @@ CMAKE_TAPI:FILEPATH=CMAKE_TAPI-NOTFOUND CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE //Value Computed by CMake -tiitls1.3_BINARY_DIR:STATIC=D:/DOKUMENTY/diplomovka-final/Scott-cpp-win +tiitls1.3_BINARY_DIR:STATIC=D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS //Value Computed by CMake tiitls1.3_IS_TOP_LEVEL:STATIC=ON //Value Computed by CMake -tiitls1.3_SOURCE_DIR:STATIC=D:/DOKUMENTY/diplomovka-final/Scott-cpp-win +tiitls1.3_SOURCE_DIR:STATIC=D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS ######################## @@ -258,7 +258,7 @@ CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_AR CMAKE_AR-ADVANCED:INTERNAL=1 //This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=d:/DOKUMENTY/diplomovka-final/Scott-cpp-win +CMAKE_CACHEFILE_DIR:INTERNAL=d:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS //Major version of cmake used to create the current loaded cache CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 //Minor version of cmake used to create the current loaded cache @@ -335,7 +335,7 @@ CMAKE_GENERATOR_PLATFORM:INTERNAL= CMAKE_GENERATOR_TOOLSET:INTERNAL= //Source directory with the top level CMakeLists.txt file for this // project -CMAKE_HOME_DIRECTORY:INTERNAL=D:/DOKUMENTY/diplomovka-final/Scott-cpp-win +CMAKE_HOME_DIRECTORY:INTERNAL=D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS //ADVANCED property for variable: CMAKE_LINKER CMAKE_LINKER-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_MAKE_PROGRAM diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CMakeDetermineCompilerABI_C.bin b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CMakeDetermineCompilerABI_C.bin index d231954..8fe06c2 100644 Binary files a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CMakeDetermineCompilerABI_C.bin and b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CMakeDetermineCompilerABI_C.bin differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CMakeDetermineCompilerABI_CXX.bin b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CMakeDetermineCompilerABI_CXX.bin index c0477e1..a9b99e7 100644 Binary files a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CMakeDetermineCompilerABI_CXX.bin and b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CMakeDetermineCompilerABI_CXX.bin differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CompilerIdC/a.exe b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CompilerIdC/a.exe index f50e503..068042f 100644 Binary files a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CompilerIdC/a.exe and b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CompilerIdC/a.exe differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CompilerIdCXX/a.exe b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CompilerIdCXX/a.exe index 95e0d14..18084ba 100644 Binary files a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CompilerIdCXX/a.exe and b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CompilerIdCXX/a.exe differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeConfigureLog.yaml b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeConfigureLog.yaml index d401519..27605d5 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeConfigureLog.yaml +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeConfigureLog.yaml @@ -28,7 +28,7 @@ events: Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.exe" The C compiler identification is GNU, found in: - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/3.28.2/CompilerIdC/a.exe + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CompilerIdC/a.exe - kind: "message-v1" @@ -50,7 +50,7 @@ events: Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.exe" The CXX compiler identification is GNU, found in: - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/3.28.2/CompilerIdCXX/a.exe + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/3.28.2/CompilerIdCXX/a.exe - kind: "try_compile-v1" @@ -61,8 +61,8 @@ events: checks: - "Detecting C compiler ABI info" directories: - source: "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-731u3b" - binary: "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-731u3b" + source: "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-cztr8p" + binary: "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-cztr8p" cmakeVariables: CMAKE_C_FLAGS: "" CMAKE_C_FLAGS_DEBUG: "-g" @@ -71,13 +71,13 @@ events: variable: "CMAKE_C_ABI_COMPILED" cached: true stdout: | - Change Dir: 'D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-731u3b' + Change Dir: 'D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-cztr8p' - Run Build Command(s): C:/mingw64/bin/cmake.exe -E env VERBOSE=1 C:/mingw64/bin/mingw32-make.exe -f Makefile cmTC_e8c03/fast - C:/mingw64/bin/mingw32-make.exe -f CMakeFiles\\cmTC_e8c03.dir\\build.make CMakeFiles/cmTC_e8c03.dir/build - mingw32-make[1]: Entering directory 'D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-731u3b' - Building C object CMakeFiles/cmTC_e8c03.dir/CMakeCCompilerABI.c.obj - C:\\mingw64\\bin\\gcc.exe -v -o CMakeFiles\\cmTC_e8c03.dir\\CMakeCCompilerABI.c.obj -c C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCCompilerABI.c + Run Build Command(s): C:/mingw64/bin/cmake.exe -E env VERBOSE=1 C:/mingw64/bin/mingw32-make.exe -f Makefile cmTC_38c81/fast + C:/mingw64/bin/mingw32-make.exe -f CMakeFiles\\cmTC_38c81.dir\\build.make CMakeFiles/cmTC_38c81.dir/build + mingw32-make[1]: Entering directory 'D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-cztr8p' + Building C object CMakeFiles/cmTC_38c81.dir/CMakeCCompilerABI.c.obj + C:\\mingw64\\bin\\gcc.exe -v -o CMakeFiles\\cmTC_38c81.dir\\CMakeCCompilerABI.c.obj -c C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCCompilerABI.c Using built-in specs. COLLECT_GCC=C:\\mingw64\\bin\\gcc.exe OFFLOAD_TARGET_NAMES=nvptx-none @@ -86,8 +86,8 @@ events: Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 13.2.0 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r5) - COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_e8c03.dir\\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_e8c03.dir\\' - C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/cc1.exe -quiet -v -iprefix C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/ -D_REENTRANT C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCCompilerABI.c -quiet -dumpdir CMakeFiles\\cmTC_e8c03.dir\\ -dumpbase CMakeCCompilerABI.c.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -o C:\\Users\\simko\\AppData\\Local\\Temp\\cc717B8l.s + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_38c81.dir\\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_38c81.dir\\' + C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/cc1.exe -quiet -v -iprefix C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/ -D_REENTRANT C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCCompilerABI.c -quiet -dumpdir CMakeFiles\\cmTC_38c81.dir\\ -dumpbase CMakeCCompilerABI.c.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -o C:\\Users\\simko\\AppData\\Local\\Temp\\cciqLujk.s GNU C17 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r5) version 13.2.0 (x86_64-w64-mingw32) compiled by GNU C version 13.2.0, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP @@ -106,17 +106,17 @@ events: C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/include End of search list. Compiler executable checksum: 7a441bbadf19345f9c279b4b244f7757 - COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_e8c03.dir\\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_e8c03.dir\\' - C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o CMakeFiles\\cmTC_e8c03.dir\\CMakeCCompilerABI.c.obj C:\\Users\\simko\\AppData\\Local\\Temp\\cc717B8l.s + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_38c81.dir\\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_38c81.dir\\' + C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o CMakeFiles\\cmTC_38c81.dir\\CMakeCCompilerABI.c.obj C:\\Users\\simko\\AppData\\Local\\Temp\\cciqLujk.s GNU assembler version 2.42 (x86_64-w64-mingw32) using BFD version (Binutils for MinGW-W64 x86_64, built by Brecht Sanders, r5) 2.42 COMPILER_PATH=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/;C:/mingw64/bin/../libexec/gcc/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ LIBRARY_PATH=C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/;C:/mingw64/bin/../lib/gcc/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../ - COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_e8c03.dir\\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_e8c03.dir\\CMakeCCompilerABI.c.' - Linking C executable cmTC_e8c03.exe - C:\\mingw64\\bin\\cmake.exe -E cmake_link_script CMakeFiles\\cmTC_e8c03.dir\\link.txt --verbose=1 - C:\\mingw64\\bin\\cmake.exe -E rm -f CMakeFiles\\cmTC_e8c03.dir/objects.a - C:\\mingw64\\bin\\ar.exe qc CMakeFiles\\cmTC_e8c03.dir/objects.a @CMakeFiles\\cmTC_e8c03.dir\\objects1.rsp - C:\\mingw64\\bin\\gcc.exe -v -Wl,--whole-archive CMakeFiles\\cmTC_e8c03.dir/objects.a -Wl,--no-whole-archive -o cmTC_e8c03.exe -Wl,--out-implib,libcmTC_e8c03.dll.a -Wl,--major-image-version,0,--minor-image-version,0 + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_38c81.dir\\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_38c81.dir\\CMakeCCompilerABI.c.' + Linking C executable cmTC_38c81.exe + C:\\mingw64\\bin\\cmake.exe -E cmake_link_script CMakeFiles\\cmTC_38c81.dir\\link.txt --verbose=1 + C:\\mingw64\\bin\\cmake.exe -E rm -f CMakeFiles\\cmTC_38c81.dir/objects.a + C:\\mingw64\\bin\\ar.exe qc CMakeFiles\\cmTC_38c81.dir/objects.a @CMakeFiles\\cmTC_38c81.dir\\objects1.rsp + C:\\mingw64\\bin\\gcc.exe -v -Wl,--whole-archive CMakeFiles\\cmTC_38c81.dir/objects.a -Wl,--no-whole-archive -o cmTC_38c81.exe -Wl,--out-implib,libcmTC_38c81.dll.a -Wl,--major-image-version,0,--minor-image-version,0 Using built-in specs. COLLECT_GCC=C:\\mingw64\\bin\\gcc.exe COLLECT_LTO_WRAPPER=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe @@ -128,10 +128,10 @@ events: gcc version 13.2.0 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r5) COMPILER_PATH=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/;C:/mingw64/bin/../libexec/gcc/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ LIBRARY_PATH=C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/;C:/mingw64/bin/../lib/gcc/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../ - COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e8c03.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_e8c03.' - C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/collect2.exe -plugin C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/liblto_plugin.dll -plugin-opt=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\\Users\\simko\\AppData\\Local\\Temp\\ccvQWfYs.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -m i386pep -Bdynamic -o cmTC_e8c03.exe C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtbegin.o -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0 -LC:/mingw64/bin/../lib/gcc -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../.. --whole-archive CMakeFiles\\cmTC_e8c03.dir/objects.a --no-whole-archive --out-implib libcmTC_e8c03.dll.a --major-image-version 0 --minor-image-version 0 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtend.o - COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e8c03.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_e8c03.' - mingw32-make[1]: Leaving directory 'D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-731u3b' + COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_38c81.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_38c81.' + C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/collect2.exe -plugin C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/liblto_plugin.dll -plugin-opt=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\\Users\\simko\\AppData\\Local\\Temp\\cchzEVFf.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -m i386pep -Bdynamic -o cmTC_38c81.exe C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtbegin.o -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0 -LC:/mingw64/bin/../lib/gcc -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../.. --whole-archive CMakeFiles\\cmTC_38c81.dir/objects.a --no-whole-archive --out-implib libcmTC_38c81.dll.a --major-image-version 0 --minor-image-version 0 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtend.o + COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_38c81.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_38c81.' + mingw32-make[1]: Leaving directory 'D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-cztr8p' exitCode: 0 - @@ -165,13 +165,13 @@ events: message: | Parsed C implicit link information: link line regex: [^( *|.*[/\\])(ld\\.exe|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] - ignore line: [Change Dir: 'D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-731u3b'] + ignore line: [Change Dir: 'D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-cztr8p'] ignore line: [] - ignore line: [Run Build Command(s): C:/mingw64/bin/cmake.exe -E env VERBOSE=1 C:/mingw64/bin/mingw32-make.exe -f Makefile cmTC_e8c03/fast] - ignore line: [C:/mingw64/bin/mingw32-make.exe -f CMakeFiles\\cmTC_e8c03.dir\\build.make CMakeFiles/cmTC_e8c03.dir/build] - ignore line: [mingw32-make[1]: Entering directory 'D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-731u3b'] - ignore line: [Building C object CMakeFiles/cmTC_e8c03.dir/CMakeCCompilerABI.c.obj] - ignore line: [C:\\mingw64\\bin\\gcc.exe -v -o CMakeFiles\\cmTC_e8c03.dir\\CMakeCCompilerABI.c.obj -c C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCCompilerABI.c] + ignore line: [Run Build Command(s): C:/mingw64/bin/cmake.exe -E env VERBOSE=1 C:/mingw64/bin/mingw32-make.exe -f Makefile cmTC_38c81/fast] + ignore line: [C:/mingw64/bin/mingw32-make.exe -f CMakeFiles\\cmTC_38c81.dir\\build.make CMakeFiles/cmTC_38c81.dir/build] + ignore line: [mingw32-make[1]: Entering directory 'D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-cztr8p'] + ignore line: [Building C object CMakeFiles/cmTC_38c81.dir/CMakeCCompilerABI.c.obj] + ignore line: [C:\\mingw64\\bin\\gcc.exe -v -o CMakeFiles\\cmTC_38c81.dir\\CMakeCCompilerABI.c.obj -c C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCCompilerABI.c] ignore line: [Using built-in specs.] ignore line: [COLLECT_GCC=C:\\mingw64\\bin\\gcc.exe] ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none] @@ -180,8 +180,8 @@ events: ignore line: [Thread model: posix] ignore line: [Supported LTO compression algorithms: zlib zstd] ignore line: [gcc version 13.2.0 (MinGW-W64 x86_64-ucrt-posix-seh built by Brecht Sanders r5) ] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_e8c03.dir\\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_e8c03.dir\\'] - ignore line: [ C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/cc1.exe -quiet -v -iprefix C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/ -D_REENTRANT C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCCompilerABI.c -quiet -dumpdir CMakeFiles\\cmTC_e8c03.dir\\ -dumpbase CMakeCCompilerABI.c.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -o C:\\Users\\simko\\AppData\\Local\\Temp\\cc717B8l.s] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_38c81.dir\\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_38c81.dir\\'] + ignore line: [ C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/cc1.exe -quiet -v -iprefix C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/ -D_REENTRANT C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCCompilerABI.c -quiet -dumpdir CMakeFiles\\cmTC_38c81.dir\\ -dumpbase CMakeCCompilerABI.c.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -o C:\\Users\\simko\\AppData\\Local\\Temp\\cciqLujk.s] ignore line: [GNU C17 (MinGW-W64 x86_64-ucrt-posix-seh built by Brecht Sanders r5) version 13.2.0 (x86_64-w64-mingw32)] ignore line: [ compiled by GNU C version 13.2.0 GMP version 6.3.0 MPFR version 4.2.1 MPC version 1.3.1 isl version isl-0.26-GMP] ignore line: [] @@ -200,8 +200,8 @@ events: ignore line: [ C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/include] ignore line: [End of search list.] ignore line: [Compiler executable checksum: 7a441bbadf19345f9c279b4b244f7757] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_e8c03.dir\\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_e8c03.dir\\'] - ignore line: [ C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o CMakeFiles\\cmTC_e8c03.dir\\CMakeCCompilerABI.c.obj C:\\Users\\simko\\AppData\\Local\\Temp\\cc717B8l.s] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_38c81.dir\\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_38c81.dir\\'] + ignore line: [ C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o CMakeFiles\\cmTC_38c81.dir\\CMakeCCompilerABI.c.obj C:\\Users\\simko\\AppData\\Local\\Temp\\cciqLujk.s] ignore line: [GNU assembler version 2.42 (x86_64-w64-mingw32) using BFD version (Binutils for MinGW-W64 x86_64 built by Brecht Sanders r5) 2.42] ignore line: [COMPILER_PATH=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/] ignore line: [C:/mingw64/bin/../libexec/gcc/] @@ -212,12 +212,12 @@ events: ignore line: [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/] ignore line: [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/] ignore line: [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_e8c03.dir\\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_e8c03.dir\\CMakeCCompilerABI.c.'] - ignore line: [Linking C executable cmTC_e8c03.exe] - ignore line: [C:\\mingw64\\bin\\cmake.exe -E cmake_link_script CMakeFiles\\cmTC_e8c03.dir\\link.txt --verbose=1] - ignore line: [C:\\mingw64\\bin\\cmake.exe -E rm -f CMakeFiles\\cmTC_e8c03.dir/objects.a] - ignore line: [C:\\mingw64\\bin\\ar.exe qc CMakeFiles\\cmTC_e8c03.dir/objects.a @CMakeFiles\\cmTC_e8c03.dir\\objects1.rsp] - ignore line: [C:\\mingw64\\bin\\gcc.exe -v -Wl --whole-archive CMakeFiles\\cmTC_e8c03.dir/objects.a -Wl --no-whole-archive -o cmTC_e8c03.exe -Wl --out-implib libcmTC_e8c03.dll.a -Wl --major-image-version 0 --minor-image-version 0 ] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_38c81.dir\\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_38c81.dir\\CMakeCCompilerABI.c.'] + ignore line: [Linking C executable cmTC_38c81.exe] + ignore line: [C:\\mingw64\\bin\\cmake.exe -E cmake_link_script CMakeFiles\\cmTC_38c81.dir\\link.txt --verbose=1] + ignore line: [C:\\mingw64\\bin\\cmake.exe -E rm -f CMakeFiles\\cmTC_38c81.dir/objects.a] + ignore line: [C:\\mingw64\\bin\\ar.exe qc CMakeFiles\\cmTC_38c81.dir/objects.a @CMakeFiles\\cmTC_38c81.dir\\objects1.rsp] + ignore line: [C:\\mingw64\\bin\\gcc.exe -v -Wl --whole-archive CMakeFiles\\cmTC_38c81.dir/objects.a -Wl --no-whole-archive -o cmTC_38c81.exe -Wl --out-implib libcmTC_38c81.dll.a -Wl --major-image-version 0 --minor-image-version 0 ] ignore line: [Using built-in specs.] ignore line: [COLLECT_GCC=C:\\mingw64\\bin\\gcc.exe] ignore line: [COLLECT_LTO_WRAPPER=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe] @@ -236,13 +236,13 @@ events: ignore line: [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/] ignore line: [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/] ignore line: [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e8c03.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_e8c03.'] - link line: [ C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/collect2.exe -plugin C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/liblto_plugin.dll -plugin-opt=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\\Users\\simko\\AppData\\Local\\Temp\\ccvQWfYs.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -m i386pep -Bdynamic -o cmTC_e8c03.exe C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtbegin.o -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0 -LC:/mingw64/bin/../lib/gcc -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../.. --whole-archive CMakeFiles\\cmTC_e8c03.dir/objects.a --no-whole-archive --out-implib libcmTC_e8c03.dll.a --major-image-version 0 --minor-image-version 0 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtend.o] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_38c81.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_38c81.'] + link line: [ C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/collect2.exe -plugin C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/liblto_plugin.dll -plugin-opt=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\\Users\\simko\\AppData\\Local\\Temp\\cchzEVFf.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -m i386pep -Bdynamic -o cmTC_38c81.exe C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtbegin.o -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0 -LC:/mingw64/bin/../lib/gcc -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../.. --whole-archive CMakeFiles\\cmTC_38c81.dir/objects.a --no-whole-archive --out-implib libcmTC_38c81.dll.a --major-image-version 0 --minor-image-version 0 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtend.o] arg [C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/collect2.exe] ==> ignore arg [-plugin] ==> ignore arg [C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/liblto_plugin.dll] ==> ignore arg [-plugin-opt=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe] ==> ignore - arg [-plugin-opt=-fresolution=C:\\Users\\simko\\AppData\\Local\\Temp\\ccvQWfYs.res] ==> ignore + arg [-plugin-opt=-fresolution=C:\\Users\\simko\\AppData\\Local\\Temp\\cchzEVFf.res] ==> ignore arg [-plugin-opt=-pass-through=-lmingw32] ==> ignore arg [-plugin-opt=-pass-through=-lgcc] ==> ignore arg [-plugin-opt=-pass-through=-lgcc_eh] ==> ignore @@ -266,7 +266,7 @@ events: arg [i386pep] ==> ignore arg [-Bdynamic] ==> search dynamic arg [-o] ==> ignore - arg [cmTC_e8c03.exe] ==> ignore + arg [cmTC_38c81.exe] ==> ignore arg [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o] ==> obj [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o] arg [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtbegin.o] ==> obj [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtbegin.o] arg [-LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0] ==> dir [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0] @@ -276,10 +276,10 @@ events: arg [-LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib] ==> dir [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib] arg [-LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../..] ==> dir [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../..] arg [--whole-archive] ==> ignore - arg [CMakeFiles\\cmTC_e8c03.dir/objects.a] ==> ignore + arg [CMakeFiles\\cmTC_38c81.dir/objects.a] ==> ignore arg [--no-whole-archive] ==> ignore arg [--out-implib] ==> ignore - arg [libcmTC_e8c03.dll.a] ==> ignore + arg [libcmTC_38c81.dll.a] ==> ignore arg [--major-image-version] ==> ignore arg [0] ==> ignore arg [--minor-image-version] ==> ignore @@ -332,8 +332,8 @@ events: checks: - "Detecting CXX compiler ABI info" directories: - source: "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-mcbgwq" - binary: "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-mcbgwq" + source: "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-f4ei0o" + binary: "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-f4ei0o" cmakeVariables: CMAKE_CXX_FLAGS: "" CMAKE_CXX_FLAGS_DEBUG: "-g" @@ -342,13 +342,13 @@ events: variable: "CMAKE_CXX_ABI_COMPILED" cached: true stdout: | - Change Dir: 'D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-mcbgwq' + Change Dir: 'D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-f4ei0o' - Run Build Command(s): C:/mingw64/bin/cmake.exe -E env VERBOSE=1 C:/mingw64/bin/mingw32-make.exe -f Makefile cmTC_d3ce1/fast - C:/mingw64/bin/mingw32-make.exe -f CMakeFiles\\cmTC_d3ce1.dir\\build.make CMakeFiles/cmTC_d3ce1.dir/build - mingw32-make[1]: Entering directory 'D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-mcbgwq' - Building CXX object CMakeFiles/cmTC_d3ce1.dir/CMakeCXXCompilerABI.cpp.obj - C:\\mingw64\\bin\\gcc.exe -v -o CMakeFiles\\cmTC_d3ce1.dir\\CMakeCXXCompilerABI.cpp.obj -c C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCXXCompilerABI.cpp + Run Build Command(s): C:/mingw64/bin/cmake.exe -E env VERBOSE=1 C:/mingw64/bin/mingw32-make.exe -f Makefile cmTC_d41b0/fast + C:/mingw64/bin/mingw32-make.exe -f CMakeFiles\\cmTC_d41b0.dir\\build.make CMakeFiles/cmTC_d41b0.dir/build + mingw32-make[1]: Entering directory 'D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-f4ei0o' + Building CXX object CMakeFiles/cmTC_d41b0.dir/CMakeCXXCompilerABI.cpp.obj + C:\\mingw64\\bin\\gcc.exe -v -o CMakeFiles\\cmTC_d41b0.dir\\CMakeCXXCompilerABI.cpp.obj -c C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCXXCompilerABI.cpp Using built-in specs. COLLECT_GCC=C:\\mingw64\\bin\\gcc.exe OFFLOAD_TARGET_NAMES=nvptx-none @@ -357,8 +357,8 @@ events: Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 13.2.0 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r5) - COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_d3ce1.dir\\CMakeCXXCompilerABI.cpp.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_d3ce1.dir\\' - C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/cc1plus.exe -quiet -v -iprefix C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/ -D_REENTRANT C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles\\cmTC_d3ce1.dir\\ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -o C:\\Users\\simko\\AppData\\Local\\Temp\\ccX2dQ6R.s + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_d41b0.dir\\CMakeCXXCompilerABI.cpp.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_d41b0.dir\\' + C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/cc1plus.exe -quiet -v -iprefix C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/ -D_REENTRANT C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles\\cmTC_d41b0.dir\\ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -o C:\\Users\\simko\\AppData\\Local\\Temp\\cc5adFuE.s GNU C++17 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r5) version 13.2.0 (x86_64-w64-mingw32) compiled by GNU C version 13.2.0, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP @@ -383,17 +383,17 @@ events: C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/include End of search list. Compiler executable checksum: 6327a8e4b2efaceec00a9874ea909a3f - COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_d3ce1.dir\\CMakeCXXCompilerABI.cpp.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_d3ce1.dir\\' - C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o CMakeFiles\\cmTC_d3ce1.dir\\CMakeCXXCompilerABI.cpp.obj C:\\Users\\simko\\AppData\\Local\\Temp\\ccX2dQ6R.s + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_d41b0.dir\\CMakeCXXCompilerABI.cpp.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_d41b0.dir\\' + C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o CMakeFiles\\cmTC_d41b0.dir\\CMakeCXXCompilerABI.cpp.obj C:\\Users\\simko\\AppData\\Local\\Temp\\cc5adFuE.s GNU assembler version 2.42 (x86_64-w64-mingw32) using BFD version (Binutils for MinGW-W64 x86_64, built by Brecht Sanders, r5) 2.42 COMPILER_PATH=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/;C:/mingw64/bin/../libexec/gcc/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ LIBRARY_PATH=C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/;C:/mingw64/bin/../lib/gcc/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../ - COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_d3ce1.dir\\CMakeCXXCompilerABI.cpp.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_d3ce1.dir\\CMakeCXXCompilerABI.cpp.' - Linking CXX executable cmTC_d3ce1.exe - C:\\mingw64\\bin\\cmake.exe -E cmake_link_script CMakeFiles\\cmTC_d3ce1.dir\\link.txt --verbose=1 - C:\\mingw64\\bin\\cmake.exe -E rm -f CMakeFiles\\cmTC_d3ce1.dir/objects.a - C:\\mingw64\\bin\\ar.exe qc CMakeFiles\\cmTC_d3ce1.dir/objects.a @CMakeFiles\\cmTC_d3ce1.dir\\objects1.rsp - C:\\mingw64\\bin\\gcc.exe -v -Wl,--whole-archive CMakeFiles\\cmTC_d3ce1.dir/objects.a -Wl,--no-whole-archive -o cmTC_d3ce1.exe -Wl,--out-implib,libcmTC_d3ce1.dll.a -Wl,--major-image-version,0,--minor-image-version,0 + COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_d41b0.dir\\CMakeCXXCompilerABI.cpp.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_d41b0.dir\\CMakeCXXCompilerABI.cpp.' + Linking CXX executable cmTC_d41b0.exe + C:\\mingw64\\bin\\cmake.exe -E cmake_link_script CMakeFiles\\cmTC_d41b0.dir\\link.txt --verbose=1 + C:\\mingw64\\bin\\cmake.exe -E rm -f CMakeFiles\\cmTC_d41b0.dir/objects.a + C:\\mingw64\\bin\\ar.exe qc CMakeFiles\\cmTC_d41b0.dir/objects.a @CMakeFiles\\cmTC_d41b0.dir\\objects1.rsp + C:\\mingw64\\bin\\gcc.exe -v -Wl,--whole-archive CMakeFiles\\cmTC_d41b0.dir/objects.a -Wl,--no-whole-archive -o cmTC_d41b0.exe -Wl,--out-implib,libcmTC_d41b0.dll.a -Wl,--major-image-version,0,--minor-image-version,0 Using built-in specs. COLLECT_GCC=C:\\mingw64\\bin\\gcc.exe COLLECT_LTO_WRAPPER=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe @@ -405,10 +405,10 @@ events: gcc version 13.2.0 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r5) COMPILER_PATH=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/;C:/mingw64/bin/../libexec/gcc/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ LIBRARY_PATH=C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/;C:/mingw64/bin/../lib/gcc/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../ - COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_d3ce1.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_d3ce1.' - C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/collect2.exe -plugin C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/liblto_plugin.dll -plugin-opt=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\\Users\\simko\\AppData\\Local\\Temp\\ccra7b3X.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -m i386pep -Bdynamic -o cmTC_d3ce1.exe C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtbegin.o -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0 -LC:/mingw64/bin/../lib/gcc -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../.. --whole-archive CMakeFiles\\cmTC_d3ce1.dir/objects.a --no-whole-archive --out-implib libcmTC_d3ce1.dll.a --major-image-version 0 --minor-image-version 0 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtend.o - COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_d3ce1.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_d3ce1.' - mingw32-make[1]: Leaving directory 'D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-mcbgwq' + COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_d41b0.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_d41b0.' + C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/collect2.exe -plugin C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/liblto_plugin.dll -plugin-opt=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\\Users\\simko\\AppData\\Local\\Temp\\cc5YXFnL.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -m i386pep -Bdynamic -o cmTC_d41b0.exe C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtbegin.o -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0 -LC:/mingw64/bin/../lib/gcc -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../.. --whole-archive CMakeFiles\\cmTC_d41b0.dir/objects.a --no-whole-archive --out-implib libcmTC_d41b0.dll.a --major-image-version 0 --minor-image-version 0 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtend.o + COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_d41b0.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_d41b0.' + mingw32-make[1]: Leaving directory 'D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-f4ei0o' exitCode: 0 - @@ -448,13 +448,13 @@ events: message: | Parsed CXX implicit link information: link line regex: [^( *|.*[/\\])(ld\\.exe|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] - ignore line: [Change Dir: 'D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-mcbgwq'] + ignore line: [Change Dir: 'D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-f4ei0o'] ignore line: [] - ignore line: [Run Build Command(s): C:/mingw64/bin/cmake.exe -E env VERBOSE=1 C:/mingw64/bin/mingw32-make.exe -f Makefile cmTC_d3ce1/fast] - ignore line: [C:/mingw64/bin/mingw32-make.exe -f CMakeFiles\\cmTC_d3ce1.dir\\build.make CMakeFiles/cmTC_d3ce1.dir/build] - ignore line: [mingw32-make[1]: Entering directory 'D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/CMakeScratch/TryCompile-mcbgwq'] - ignore line: [Building CXX object CMakeFiles/cmTC_d3ce1.dir/CMakeCXXCompilerABI.cpp.obj] - ignore line: [C:\\mingw64\\bin\\gcc.exe -v -o CMakeFiles\\cmTC_d3ce1.dir\\CMakeCXXCompilerABI.cpp.obj -c C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCXXCompilerABI.cpp] + ignore line: [Run Build Command(s): C:/mingw64/bin/cmake.exe -E env VERBOSE=1 C:/mingw64/bin/mingw32-make.exe -f Makefile cmTC_d41b0/fast] + ignore line: [C:/mingw64/bin/mingw32-make.exe -f CMakeFiles\\cmTC_d41b0.dir\\build.make CMakeFiles/cmTC_d41b0.dir/build] + ignore line: [mingw32-make[1]: Entering directory 'D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeScratch/TryCompile-f4ei0o'] + ignore line: [Building CXX object CMakeFiles/cmTC_d41b0.dir/CMakeCXXCompilerABI.cpp.obj] + ignore line: [C:\\mingw64\\bin\\gcc.exe -v -o CMakeFiles\\cmTC_d41b0.dir\\CMakeCXXCompilerABI.cpp.obj -c C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCXXCompilerABI.cpp] ignore line: [Using built-in specs.] ignore line: [COLLECT_GCC=C:\\mingw64\\bin\\gcc.exe] ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none] @@ -463,8 +463,8 @@ events: ignore line: [Thread model: posix] ignore line: [Supported LTO compression algorithms: zlib zstd] ignore line: [gcc version 13.2.0 (MinGW-W64 x86_64-ucrt-posix-seh built by Brecht Sanders r5) ] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_d3ce1.dir\\CMakeCXXCompilerABI.cpp.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_d3ce1.dir\\'] - ignore line: [ C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/cc1plus.exe -quiet -v -iprefix C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/ -D_REENTRANT C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles\\cmTC_d3ce1.dir\\ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -o C:\\Users\\simko\\AppData\\Local\\Temp\\ccX2dQ6R.s] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_d41b0.dir\\CMakeCXXCompilerABI.cpp.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_d41b0.dir\\'] + ignore line: [ C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/cc1plus.exe -quiet -v -iprefix C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/ -D_REENTRANT C:\\mingw64\\share\\cmake-3.28\\Modules\\CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles\\cmTC_d41b0.dir\\ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -o C:\\Users\\simko\\AppData\\Local\\Temp\\cc5adFuE.s] ignore line: [GNU C++17 (MinGW-W64 x86_64-ucrt-posix-seh built by Brecht Sanders r5) version 13.2.0 (x86_64-w64-mingw32)] ignore line: [ compiled by GNU C version 13.2.0 GMP version 6.3.0 MPFR version 4.2.1 MPC version 1.3.1 isl version isl-0.26-GMP] ignore line: [] @@ -489,8 +489,8 @@ events: ignore line: [ C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/include] ignore line: [End of search list.] ignore line: [Compiler executable checksum: 6327a8e4b2efaceec00a9874ea909a3f] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_d3ce1.dir\\CMakeCXXCompilerABI.cpp.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_d3ce1.dir\\'] - ignore line: [ C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o CMakeFiles\\cmTC_d3ce1.dir\\CMakeCXXCompilerABI.cpp.obj C:\\Users\\simko\\AppData\\Local\\Temp\\ccX2dQ6R.s] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_d41b0.dir\\CMakeCXXCompilerABI.cpp.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_d41b0.dir\\'] + ignore line: [ C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o CMakeFiles\\cmTC_d41b0.dir\\CMakeCXXCompilerABI.cpp.obj C:\\Users\\simko\\AppData\\Local\\Temp\\cc5adFuE.s] ignore line: [GNU assembler version 2.42 (x86_64-w64-mingw32) using BFD version (Binutils for MinGW-W64 x86_64 built by Brecht Sanders r5) 2.42] ignore line: [COMPILER_PATH=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/] ignore line: [C:/mingw64/bin/../libexec/gcc/] @@ -501,12 +501,12 @@ events: ignore line: [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/] ignore line: [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/] ignore line: [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_d3ce1.dir\\CMakeCXXCompilerABI.cpp.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_d3ce1.dir\\CMakeCXXCompilerABI.cpp.'] - ignore line: [Linking CXX executable cmTC_d3ce1.exe] - ignore line: [C:\\mingw64\\bin\\cmake.exe -E cmake_link_script CMakeFiles\\cmTC_d3ce1.dir\\link.txt --verbose=1] - ignore line: [C:\\mingw64\\bin\\cmake.exe -E rm -f CMakeFiles\\cmTC_d3ce1.dir/objects.a] - ignore line: [C:\\mingw64\\bin\\ar.exe qc CMakeFiles\\cmTC_d3ce1.dir/objects.a @CMakeFiles\\cmTC_d3ce1.dir\\objects1.rsp] - ignore line: [C:\\mingw64\\bin\\gcc.exe -v -Wl --whole-archive CMakeFiles\\cmTC_d3ce1.dir/objects.a -Wl --no-whole-archive -o cmTC_d3ce1.exe -Wl --out-implib libcmTC_d3ce1.dll.a -Wl --major-image-version 0 --minor-image-version 0 ] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\\cmTC_d41b0.dir\\CMakeCXXCompilerABI.cpp.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\\cmTC_d41b0.dir\\CMakeCXXCompilerABI.cpp.'] + ignore line: [Linking CXX executable cmTC_d41b0.exe] + ignore line: [C:\\mingw64\\bin\\cmake.exe -E cmake_link_script CMakeFiles\\cmTC_d41b0.dir\\link.txt --verbose=1] + ignore line: [C:\\mingw64\\bin\\cmake.exe -E rm -f CMakeFiles\\cmTC_d41b0.dir/objects.a] + ignore line: [C:\\mingw64\\bin\\ar.exe qc CMakeFiles\\cmTC_d41b0.dir/objects.a @CMakeFiles\\cmTC_d41b0.dir\\objects1.rsp] + ignore line: [C:\\mingw64\\bin\\gcc.exe -v -Wl --whole-archive CMakeFiles\\cmTC_d41b0.dir/objects.a -Wl --no-whole-archive -o cmTC_d41b0.exe -Wl --out-implib libcmTC_d41b0.dll.a -Wl --major-image-version 0 --minor-image-version 0 ] ignore line: [Using built-in specs.] ignore line: [COLLECT_GCC=C:\\mingw64\\bin\\gcc.exe] ignore line: [COLLECT_LTO_WRAPPER=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe] @@ -525,13 +525,13 @@ events: ignore line: [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/] ignore line: [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/] ignore line: [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_d3ce1.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_d3ce1.'] - link line: [ C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/collect2.exe -plugin C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/liblto_plugin.dll -plugin-opt=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\\Users\\simko\\AppData\\Local\\Temp\\ccra7b3X.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -m i386pep -Bdynamic -o cmTC_d3ce1.exe C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtbegin.o -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0 -LC:/mingw64/bin/../lib/gcc -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../.. --whole-archive CMakeFiles\\cmTC_d3ce1.dir/objects.a --no-whole-archive --out-implib libcmTC_d3ce1.dll.a --major-image-version 0 --minor-image-version 0 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtend.o] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_d41b0.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_d41b0.'] + link line: [ C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/collect2.exe -plugin C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/liblto_plugin.dll -plugin-opt=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\\Users\\simko\\AppData\\Local\\Temp\\cc5YXFnL.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -m i386pep -Bdynamic -o cmTC_d41b0.exe C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtbegin.o -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0 -LC:/mingw64/bin/../lib/gcc -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib -LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../.. --whole-archive CMakeFiles\\cmTC_d41b0.dir/objects.a --no-whole-archive --out-implib libcmTC_d41b0.dll.a --major-image-version 0 --minor-image-version 0 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtend.o] arg [C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/collect2.exe] ==> ignore arg [-plugin] ==> ignore arg [C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/liblto_plugin.dll] ==> ignore arg [-plugin-opt=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe] ==> ignore - arg [-plugin-opt=-fresolution=C:\\Users\\simko\\AppData\\Local\\Temp\\ccra7b3X.res] ==> ignore + arg [-plugin-opt=-fresolution=C:\\Users\\simko\\AppData\\Local\\Temp\\cc5YXFnL.res] ==> ignore arg [-plugin-opt=-pass-through=-lmingw32] ==> ignore arg [-plugin-opt=-pass-through=-lgcc] ==> ignore arg [-plugin-opt=-pass-through=-lgcc_eh] ==> ignore @@ -555,7 +555,7 @@ events: arg [i386pep] ==> ignore arg [-Bdynamic] ==> search dynamic arg [-o] ==> ignore - arg [cmTC_d3ce1.exe] ==> ignore + arg [cmTC_d41b0.exe] ==> ignore arg [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o] ==> obj [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o] arg [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtbegin.o] ==> obj [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/crtbegin.o] arg [-LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0] ==> dir [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0] @@ -565,10 +565,10 @@ events: arg [-LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib] ==> dir [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/lib] arg [-LC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../..] ==> dir [C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../..] arg [--whole-archive] ==> ignore - arg [CMakeFiles\\cmTC_d3ce1.dir/objects.a] ==> ignore + arg [CMakeFiles\\cmTC_d41b0.dir/objects.a] ==> ignore arg [--no-whole-archive] ==> ignore arg [--out-implib] ==> ignore - arg [libcmTC_d3ce1.dll.a] ==> ignore + arg [libcmTC_d41b0.dll.a] ==> ignore arg [--major-image-version] ==> ignore arg [0] ==> ignore arg [--minor-image-version] ==> ignore diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeDirectoryInformation.cmake b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeDirectoryInformation.cmake index af27e04..d98b6a9 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeDirectoryInformation.cmake +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/CMakeDirectoryInformation.cmake @@ -2,8 +2,8 @@ # Generated by "MinGW Makefiles" Generator, CMake Version 3.28 # Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win") +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS") # Force unix paths in dependencies. set(CMAKE_FORCE_UNIX_PATHS 1) diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/Makefile.cmake b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/Makefile.cmake index af1a75c..33fe518 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/Makefile.cmake +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/Makefile.cmake @@ -7,19 +7,99 @@ set(CMAKE_DEPENDS_GENERATOR "MinGW Makefiles") # The top level Makefile was generated from the following files: set(CMAKE_MAKEFILE_DEPENDS "CMakeCache.txt" + "C:/mingw64/share/cmake-3.28/Modules/CMakeCCompiler.cmake.in" + "C:/mingw64/share/cmake-3.28/Modules/CMakeCCompilerABI.c" "C:/mingw64/share/cmake-3.28/Modules/CMakeCInformation.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeCXXCompiler.cmake.in" + "C:/mingw64/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp" "C:/mingw64/share/cmake-3.28/Modules/CMakeCXXInformation.cmake" "C:/mingw64/share/cmake-3.28/Modules/CMakeCommonLanguageInclude.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeCompilerIdDetection.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeDetermineCCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeDetermineCXXCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeDetermineCompileFeatures.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeDetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeDetermineCompilerABI.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeDetermineCompilerId.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeDetermineRCCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeDetermineSystem.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeFindBinUtils.cmake" "C:/mingw64/share/cmake-3.28/Modules/CMakeGenericSystem.cmake" "C:/mingw64/share/cmake-3.28/Modules/CMakeInitializeConfigs.cmake" "C:/mingw64/share/cmake-3.28/Modules/CMakeLanguageInformation.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeMinGWFindMake.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeParseImplicitIncludeInfo.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeParseImplicitLinkInfo.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeParseLibraryArchitecture.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeRCCompiler.cmake.in" "C:/mingw64/share/cmake-3.28/Modules/CMakeRCInformation.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeSystem.cmake.in" "C:/mingw64/share/cmake-3.28/Modules/CMakeSystemSpecificInformation.cmake" "C:/mingw64/share/cmake-3.28/Modules/CMakeSystemSpecificInitialize.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeTestCXXCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeTestCompilerCommon.cmake" + "C:/mingw64/share/cmake-3.28/Modules/CMakeTestRCCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/ADSP-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/ARMCC-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/ARMClang-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/AppleClang-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/Borland-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/Bruce-C-DetermineCompiler.cmake" "C:/mingw64/share/cmake-3.28/Modules/Compiler/CMakeCommonCompilerMacros.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/Clang-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/Compaq-C-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/Cray-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/CrayClang-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/FujitsuClang-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/GHS-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/GNU-C-DetermineCompiler.cmake" "C:/mingw64/share/cmake-3.28/Modules/Compiler/GNU-C.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake" "C:/mingw64/share/cmake-3.28/Modules/Compiler/GNU-CXX.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/GNU-FindBinUtils.cmake" "C:/mingw64/share/cmake-3.28/Modules/Compiler/GNU.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/HP-C-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/HP-CXX-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/IAR-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/IBMClang-C-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/IBMClang-CXX-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/Intel-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/IntelLLVM-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/LCC-C-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/LCC-CXX-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/MSVC-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/NVHPC-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/OrangeC-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/PGI-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/PathScale-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/SCO-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/SDCC-C-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/SunPro-C-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/TI-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/Tasking-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/Watcom-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/XL-C-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/XL-CXX-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/XLClang-C-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/zOS-C-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Internal/FeatureTesting.cmake" + "C:/mingw64/share/cmake-3.28/Modules/Platform/Windows-Determine-CXX.cmake" "C:/mingw64/share/cmake-3.28/Modules/Platform/Windows-GNU-C-ABI.cmake" "C:/mingw64/share/cmake-3.28/Modules/Platform/Windows-GNU-C.cmake" "C:/mingw64/share/cmake-3.28/Modules/Platform/Windows-GNU-CXX-ABI.cmake" @@ -45,6 +125,12 @@ set(CMAKE_MAKEFILE_OUTPUTS # Byproducts of CMake generate step: set(CMAKE_MAKEFILE_PRODUCTS + "CMakeFiles/3.28.2/CMakeSystem.cmake" + "CMakeFiles/3.28.2/CMakeCCompiler.cmake" + "CMakeFiles/3.28.2/CMakeCXXCompiler.cmake" + "CMakeFiles/3.28.2/CMakeRCCompiler.cmake" + "CMakeFiles/3.28.2/CMakeCCompiler.cmake" + "CMakeFiles/3.28.2/CMakeCXXCompiler.cmake" "lib/tls_sal.cpp" "CMakeFiles/CMakeDirectoryInformation.cmake" ) diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/Makefile2 b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/Makefile2 index 5131c47..d77a36c 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/Makefile2 +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/Makefile2 @@ -53,10 +53,10 @@ RM = C:\mingw64\bin\cmake.exe -E rm -f EQUALS = = # The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = D:\DOKUMENTY\diplomovka-final\Scott-cpp-win +CMAKE_SOURCE_DIR = D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS # The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = D:\DOKUMENTY\diplomovka-final\Scott-cpp-win +CMAKE_BINARY_DIR = D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS #============================================================================= # Directory level rules for the build root directory @@ -82,14 +82,14 @@ clean: CMakeFiles/client.dir/clean CMakeFiles/tiitls.dir/all: $(MAKE) $(MAKESILENT) -f CMakeFiles\tiitls.dir\build.make CMakeFiles/tiitls.dir/depend $(MAKE) $(MAKESILENT) -f CMakeFiles\tiitls.dir\build.make CMakeFiles/tiitls.dir/build - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 "Built target tiitls" + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 "Built target tiitls" .PHONY : CMakeFiles/tiitls.dir/all # Build rule for subdir invocation for target. CMakeFiles/tiitls.dir/rule: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles 16 + $(CMAKE_COMMAND) -E cmake_progress_start D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles 16 $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 CMakeFiles/tiitls.dir/all - $(CMAKE_COMMAND) -E cmake_progress_start D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles 0 + $(CMAKE_COMMAND) -E cmake_progress_start D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles 0 .PHONY : CMakeFiles/tiitls.dir/rule # Convenience name for target. @@ -108,14 +108,14 @@ CMakeFiles/tiitls.dir/clean: CMakeFiles/client.dir/all: CMakeFiles/tiitls.dir/all $(MAKE) $(MAKESILENT) -f CMakeFiles\client.dir\build.make CMakeFiles/client.dir/depend $(MAKE) $(MAKESILENT) -f CMakeFiles\client.dir\build.make CMakeFiles/client.dir/build - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=1,2 "Built target client" + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=1,2 "Built target client" .PHONY : CMakeFiles/client.dir/all # Build rule for subdir invocation for target. CMakeFiles/client.dir/rule: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles 18 + $(CMAKE_COMMAND) -E cmake_progress_start D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles 18 $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 CMakeFiles/client.dir/all - $(CMAKE_COMMAND) -E cmake_progress_start D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles 0 + $(CMAKE_COMMAND) -E cmake_progress_start D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles 0 .PHONY : CMakeFiles/client.dir/rule # Convenience name for target. diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/TargetDirectories.txt b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/TargetDirectories.txt index ed11258..7cd7de3 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/TargetDirectories.txt +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/TargetDirectories.txt @@ -1,4 +1,4 @@ -D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/tiitls.dir -D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/client.dir -D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/edit_cache.dir -D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/CMakeFiles/rebuild_cache.dir +D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir +D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir +D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/edit_cache.dir +D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/rebuild_cache.dir diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/DependInfo.cmake b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/DependInfo.cmake index 406360b..3f75f47 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/DependInfo.cmake +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/DependInfo.cmake @@ -8,7 +8,7 @@ set(CMAKE_DEPENDS_LANGUAGES # The set of dependency files which are needed: set(CMAKE_DEPENDS_DEPENDENCY_FILES - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/src/client.cpp" "CMakeFiles/client.dir/src/client.cpp.obj" "gcc" "CMakeFiles/client.dir/src/client.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/src/client.cpp" "CMakeFiles/client.dir/src/client.cpp.obj" "gcc" "CMakeFiles/client.dir/src/client.cpp.obj.d" ) # Targets to which this target links which contain Fortran sources. diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/build.make b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/build.make index af8cbf1..c96fc91 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/build.make +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/build.make @@ -52,10 +52,10 @@ RM = C:\mingw64\bin\cmake.exe -E rm -f EQUALS = = # The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = D:\DOKUMENTY\diplomovka-final\Scott-cpp-win +CMAKE_SOURCE_DIR = D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS # The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = D:\DOKUMENTY\diplomovka-final\Scott-cpp-win +CMAKE_BINARY_DIR = D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS # Include any dependencies generated for this target. include CMakeFiles/client.dir/depend.make @@ -72,16 +72,16 @@ CMakeFiles/client.dir/src/client.cpp.obj: CMakeFiles/client.dir/flags.make CMakeFiles/client.dir/src/client.cpp.obj: CMakeFiles/client.dir/includes_CXX.rsp CMakeFiles/client.dir/src/client.cpp.obj: src/client.cpp CMakeFiles/client.dir/src/client.cpp.obj: CMakeFiles/client.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/client.dir/src/client.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/client.dir/src/client.cpp.obj -MF CMakeFiles\client.dir\src\client.cpp.obj.d -o CMakeFiles\client.dir\src\client.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\src\client.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/client.dir/src/client.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/client.dir/src/client.cpp.obj -MF CMakeFiles\client.dir\src\client.cpp.obj.d -o CMakeFiles\client.dir\src\client.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\src\client.cpp CMakeFiles/client.dir/src/client.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/client.dir/src/client.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\src\client.cpp > CMakeFiles\client.dir\src\client.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\src\client.cpp > CMakeFiles\client.dir\src\client.cpp.i CMakeFiles/client.dir/src/client.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/client.dir/src/client.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\src\client.cpp -o CMakeFiles\client.dir\src\client.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\src\client.cpp -o CMakeFiles\client.dir\src\client.cpp.s # Object files for target client client_OBJECTS = \ @@ -97,7 +97,7 @@ client.exe: sal/miracl/core.a client.exe: CMakeFiles/client.dir/linkLibs.rsp client.exe: CMakeFiles/client.dir/objects1.rsp client.exe: CMakeFiles/client.dir/link.txt - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --bold --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable client.exe" + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --bold --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable client.exe" $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles\client.dir\link.txt --verbose=$(VERBOSE) # Rule to build all files generated by this target. @@ -109,6 +109,6 @@ CMakeFiles/client.dir/clean: .PHONY : CMakeFiles/client.dir/clean CMakeFiles/client.dir/depend: - $(CMAKE_COMMAND) -E cmake_depends "MinGW Makefiles" D:\DOKUMENTY\diplomovka-final\Scott-cpp-win D:\DOKUMENTY\diplomovka-final\Scott-cpp-win D:\DOKUMENTY\diplomovka-final\Scott-cpp-win D:\DOKUMENTY\diplomovka-final\Scott-cpp-win D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles\client.dir\DependInfo.cmake "--color=$(COLOR)" + $(CMAKE_COMMAND) -E cmake_depends "MinGW Makefiles" D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles\client.dir\DependInfo.cmake "--color=$(COLOR)" .PHONY : CMakeFiles/client.dir/depend diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/compiler_depend.internal b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/compiler_depend.internal deleted file mode 100644 index f1671be..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/compiler_depend.internal +++ /dev/null @@ -1,330 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "MinGW Makefiles" Generator, CMake Version 3.28 - -CMakeFiles/client.dir/src/client.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/src/client.cpp - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/afunix.h - C:/mingw64/x86_64-w64-mingw32/include/apiset.h - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h - C:/mingw64/x86_64-w64-mingw32/include/cderr.h - C:/mingw64/x86_64-w64-mingw32/include/cguid.h - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/ctype.h - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h - C:/mingw64/x86_64-w64-mingw32/include/dde.h - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/excpt.h - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h - C:/mingw64/x86_64-w64-mingw32/include/getopt.h - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h - C:/mingw64/x86_64-w64-mingw32/include/imm.h - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h - C:/mingw64/x86_64-w64-mingw32/include/inttypes.h - C:/mingw64/x86_64-w64-mingw32/include/io.h - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h - C:/mingw64/x86_64-w64-mingw32/include/mcx.h - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h - C:/mingw64/x86_64-w64-mingw32/include/msxml.h - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h - C:/mingw64/x86_64-w64-mingw32/include/nb30.h - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h - C:/mingw64/x86_64-w64-mingw32/include/objbase.h - C:/mingw64/x86_64-w64-mingw32/include/objidl.h - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h - C:/mingw64/x86_64-w64-mingw32/include/ole2.h - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h - C:/mingw64/x86_64-w64-mingw32/include/poppack.h - C:/mingw64/x86_64-w64-mingw32/include/process.h - C:/mingw64/x86_64-w64-mingw32/include/processenv.h - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h - C:/mingw64/x86_64-w64-mingw32/include/propidl.h - C:/mingw64/x86_64-w64-mingw32/include/prsht.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h - C:/mingw64/x86_64-w64-mingw32/include/qos.h - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h - C:/mingw64/x86_64-w64-mingw32/include/reason.h - C:/mingw64/x86_64-w64-mingw32/include/rpc.h - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h - C:/mingw64/x86_64-w64-mingw32/include/sal.h - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/servprov.h - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/stralign.h - C:/mingw64/x86_64-w64-mingw32/include/string.h - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h - C:/mingw64/x86_64-w64-mingw32/include/tvout.h - C:/mingw64/x86_64-w64-mingw32/include/unistd.h - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h - C:/mingw64/x86_64-w64-mingw32/include/winbase.h - C:/mingw64/x86_64-w64-mingw32/include/wincon.h - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h - C:/mingw64/x86_64-w64-mingw32/include/windef.h - C:/mingw64/x86_64-w64-mingw32/include/windows.h - C:/mingw64/x86_64-w64-mingw32/include/winefs.h - C:/mingw64/x86_64-w64-mingw32/include/winerror.h - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h - C:/mingw64/x86_64-w64-mingw32/include/winnls.h - C:/mingw64/x86_64-w64-mingw32/include/winnt.h - C:/mingw64/x86_64-w64-mingw32/include/winperf.h - C:/mingw64/x86_64-w64-mingw32/include/winreg.h - C:/mingw64/x86_64-w64-mingw32/include/winscard.h - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h - C:/mingw64/x86_64-w64-mingw32/include/winsock.h - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h - C:/mingw64/x86_64-w64-mingw32/include/winspool.h - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h - C:/mingw64/x86_64-w64-mingw32/include/winuser.h - C:/mingw64/x86_64-w64-mingw32/include/winver.h - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_bfibe.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_cert_chain.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_pqibe.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_protocol.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_tickets.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/arch.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/big_B384_58.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_big_B384_58.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_field_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/core.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp2_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp12_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp2_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp4_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/pair_BLS12381.h - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/compiler_depend.make b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/compiler_depend.make index adf4316..c83e634 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/compiler_depend.make +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/compiler_depend.make @@ -1,979 +1,2 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "MinGW Makefiles" Generator, CMake Version 3.28 - -CMakeFiles/client.dir/src/client.cpp.obj: src/client.cpp \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h \ - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/afunix.h \ - C:/mingw64/x86_64-w64-mingw32/include/apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h \ - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h \ - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/cderr.h \ - C:/mingw64/x86_64-w64-mingw32/include/cguid.h \ - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h \ - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/ctype.h \ - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dde.h \ - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h \ - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h \ - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h \ - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/excpt.h \ - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/getopt.h \ - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/imm.h \ - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h \ - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h \ - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/inttypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/io.h \ - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mcx.h \ - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h \ - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/msxml.h \ - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/nb30.h \ - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/ole2.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/poppack.h \ - C:/mingw64/x86_64-w64-mingw32/include/process.h \ - C:/mingw64/x86_64-w64-mingw32/include/processenv.h \ - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/propidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/prsht.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/qos.h \ - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/reason.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpc.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h \ - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/servprov.h \ - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/stralign.h \ - C:/mingw64/x86_64-w64-mingw32/include/string.h \ - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h \ - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/tvout.h \ - C:/mingw64/x86_64-w64-mingw32/include/unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h \ - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h \ - C:/mingw64/x86_64-w64-mingw32/include/winbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincon.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/windef.h \ - C:/mingw64/x86_64-w64-mingw32/include/windows.h \ - C:/mingw64/x86_64-w64-mingw32/include/winefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/winerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h \ - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnls.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnt.h \ - C:/mingw64/x86_64-w64-mingw32/include/winperf.h \ - C:/mingw64/x86_64-w64-mingw32/include/winreg.h \ - C:/mingw64/x86_64-w64-mingw32/include/winscard.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ - C:/mingw64/x86_64-w64-mingw32/include/winspool.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h \ - C:/mingw64/x86_64-w64-mingw32/include/winuser.h \ - C:/mingw64/x86_64-w64-mingw32/include/winver.h \ - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h \ - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h \ - include/tls1_3.h \ - include/tls_bfibe.h \ - include/tls_cert_chain.h \ - include/tls_certs.h \ - include/tls_client_recv.h \ - include/tls_client_send.h \ - include/tls_keys_calc.h \ - include/tls_logger.h \ - include/tls_octads.h \ - include/tls_pqibe.h \ - include/tls_protocol.h \ - include/tls_sal.h \ - include/tls_sockets.h \ - include/tls_tickets.h \ - include/tls_x509.h \ - sal/miracl/includes/arch.h \ - sal/miracl/includes/big_B384_58.h \ - sal/miracl/includes/config_big_B384_58.h \ - sal/miracl/includes/config_curve_BLS12381.h \ - sal/miracl/includes/config_field_BLS12381.h \ - sal/miracl/includes/core.h \ - sal/miracl/includes/ecp2_BLS12381.h \ - sal/miracl/includes/ecp_BLS12381.h \ - sal/miracl/includes/fp12_BLS12381.h \ - sal/miracl/includes/fp2_BLS12381.h \ - sal/miracl/includes/fp4_BLS12381.h \ - sal/miracl/includes/fp_BLS12381.h \ - sal/miracl/includes/pair_BLS12381.h - - -sal/miracl/includes/pair_BLS12381.h: - -sal/miracl/includes/fp_BLS12381.h: - -sal/miracl/includes/fp4_BLS12381.h: - -sal/miracl/includes/fp2_BLS12381.h: - -sal/miracl/includes/ecp2_BLS12381.h: - -sal/miracl/includes/core.h: - -sal/miracl/includes/config_field_BLS12381.h: - -include/tls_x509.h: - -include/tls_tickets.h: - -sal/miracl/includes/config_big_B384_58.h: - -include/tls_sal.h: - -include/tls_protocol.h: - -include/tls_logger.h: - -include/tls_keys_calc.h: - -include/tls_client_send.h: - -include/tls_client_recv.h: - -include/tls_cert_chain.h: - -include/tls_bfibe.h: - -include/tls1_3.h: - -C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h: - -C:/mingw64/x86_64-w64-mingw32/include/wtypes.h: - -C:/mingw64/x86_64-w64-mingw32/include/ws2def.h: - -C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h: - -C:/mingw64/x86_64-w64-mingw32/include/winsvc.h: - -C:/mingw64/x86_64-w64-mingw32/include/winsock2.h: - -C:/mingw64/x86_64-w64-mingw32/include/winsock.h: - -C:/mingw64/x86_64-w64-mingw32/include/winnt.h: - -C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h: - -C:/mingw64/x86_64-w64-mingw32/include/winioctl.h: - -C:/mingw64/x86_64-w64-mingw32/include/wingdi.h: - -C:/mingw64/x86_64-w64-mingw32/include/winerror.h: - -C:/mingw64/x86_64-w64-mingw32/include/winefs.h: - -C:/mingw64/x86_64-w64-mingw32/include/windows.h: - -C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h: - -include/tls_certs.h: - -C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h: - -C:/mingw64/x86_64-w64-mingw32/include/vadefs.h: - -C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h: - -C:/mingw64/x86_64-w64-mingw32/include/urlmon.h: - -C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h: - -C:/mingw64/x86_64-w64-mingw32/include/unknwn.h: - -C:/mingw64/x86_64-w64-mingw32/include/unistd.h: - -C:/mingw64/x86_64-w64-mingw32/include/_timeval.h: - -C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h: - -C:/mingw64/x86_64-w64-mingw32/include/handleapi.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/dde.h: - -C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/stdarg.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/timeapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h: - -C:/mingw64/x86_64-w64-mingw32/include/cguid.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h: - -C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h: - -sal/miracl/includes/ecp_BLS12381.h: - -C:/mingw64/x86_64-w64-mingw32/include/shellapi.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/winspool.h: - -C:/mingw64/x86_64-w64-mingw32/include/poppack.h: - -include/tls_octads.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/windef.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/winnls.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h: - -C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h: - -C:/mingw64/include/c++/13.2.0/stdlib.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h: - -C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h: - -C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/sal.h: - -C:/mingw64/x86_64-w64-mingw32/include/processenv.h: - -C:/mingw64/x86_64-w64-mingw32/include/winscard.h: - -C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h: - -C:/mingw64/x86_64-w64-mingw32/include/dlgs.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h: - -sal/miracl/includes/arch.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h: - -C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h: - -C:/mingw64/x86_64-w64-mingw32/include/oaidl.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/winperf.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h: - -C:/mingw64/x86_64-w64-mingw32/include/stralign.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h: - -src/client.cpp: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/objidl.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h: - -C:/mingw64/include/c++/13.2.0/bits/std_abs.h: - -C:/mingw64/x86_64-w64-mingw32/include/winuser.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h: - -C:/mingw64/x86_64-w64-mingw32/include/stdint.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/mcx.h: - -C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/objbase.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/afunix.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpc.h: - -C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/specstrings.h: - -C:/mingw64/x86_64-w64-mingw32/include/_mingw.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h: - -C:/mingw64/x86_64-w64-mingw32/include/imm.h: - -C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h: - -C:/mingw64/x86_64-w64-mingw32/include/wincon.h: - -C:/mingw64/include/c++/13.2.0/cstdlib: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/winbase.h: - -C:/mingw64/x86_64-w64-mingw32/include/reason.h: - -C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/corecrt.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/apiset.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/basetsd.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/tvout.h: - -C:/mingw64/x86_64-w64-mingw32/include/inttypes.h: - -C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h: - -C:/mingw64/x86_64-w64-mingw32/include/cderr.h: - -C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/commdlg.h: - -C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h: - -C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h: - -C:/mingw64/x86_64-w64-mingw32/include/ddeml.h: - -C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/dpapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h: - -C:/mingw64/x86_64-w64-mingw32/include/errno.h: - -C:/mingw64/x86_64-w64-mingw32/include/winver.h: - -C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/fileapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/excpt.h: - -C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h: - -C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h: - -C:/mingw64/x86_64-w64-mingw32/include/getopt.h: - -C:/mingw64/x86_64-w64-mingw32/include/guiddef.h: - -C:/mingw64/x86_64-w64-mingw32/include/stddef.h: - -C:/mingw64/x86_64-w64-mingw32/include/debugapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/heapapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/in6addr.h: - -sal/miracl/includes/fp12_BLS12381.h: - -C:/mingw64/x86_64-w64-mingw32/include/inaddr.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/io.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/jobapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h: - -C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h: - -C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/limits.h: - -C:/mingw64/x86_64-w64-mingw32/include/malloc.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h: - -C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h: - -C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h: - -C:/mingw64/x86_64-w64-mingw32/include/wnnc.h: - -C:/mingw64/x86_64-w64-mingw32/include/minwindef.h: - -C:/mingw64/x86_64-w64-mingw32/include/time.h: - -C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/msxml.h: - -C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h: - -C:/mingw64/x86_64-w64-mingw32/include/nb30.h: - -C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h: - -include/tls_sockets.h: - -C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h: - -C:/mingw64/x86_64-w64-mingw32/include/oleauto.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/servprov.h: - -C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h: - -C:/mingw64/x86_64-w64-mingw32/include/oleidl.h: - -C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h: - -C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/winreg.h: - -C:/mingw64/x86_64-w64-mingw32/include/process.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/prsht.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h: - -sal/miracl/includes/config_curve_BLS12381.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h: - -C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/stdio.h: - -sal/miracl/includes/big_B384_58.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/profileapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/propidl.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h: - -C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h: - -C:/mingw64/x86_64-w64-mingw32/include/qos.h: - -C:/mingw64/x86_64-w64-mingw32/include/synchapi.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h: - -C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h: - -C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h: - -C:/mingw64/x86_64-w64-mingw32/include/ole2.h: - -C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h: - -C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h: - -C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h: - -C:/mingw64/x86_64-w64-mingw32/include/stdlib.h: - -C:/mingw64/x86_64-w64-mingw32/include/ctype.h: - -C:/mingw64/x86_64-w64-mingw32/include/mciapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h: - -C:/mingw64/x86_64-w64-mingw32/include/string.h: - -C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h: - -include/tls_pqibe.h: - -C:/mingw64/x86_64-w64-mingw32/include/sys/types.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h: +# Empty compiler generated dependencies file for client. +# This may be replaced when dependencies are built. diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/includes_CXX.rsp b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/includes_CXX.rsp index 75b7757..d383f49 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/includes_CXX.rsp +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/includes_CXX.rsp @@ -1 +1 @@ --I"D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include" -I"D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl" -I"D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes" +-ID:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include -ID:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl -ID:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/objects.a b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/objects.a index 9ceae7d..7e98ea6 100644 Binary files a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/objects.a and b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/objects.a differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/src/client.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/src/client.cpp.obj.d index 641b1bc..87d83cb 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/src/client.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/client.dir/src/client.cpp.obj.d @@ -1,5 +1,5 @@ CMakeFiles/client.dir/src/client.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\src\client.cpp \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\src\client.cpp \ C:/mingw64/x86_64-w64-mingw32/include/time.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ @@ -12,14 +12,14 @@ CMakeFiles/client.dir/src/client.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sal.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls1_3.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sockets.h \ C:/mingw64/x86_64-w64-mingw32/include/string.h \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ @@ -302,31 +302,31 @@ CMakeFiles/client.dir/src/client.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_protocol.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_cert_chain.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_tickets.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_bfibe.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/pair_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp12_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp4_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp2_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/big_B384_58.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_protocol.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_keys_calc.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sal.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_recv.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_send.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_cert_chain.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_x509.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_logger.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_certs.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_tickets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_bfibe.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/pair_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/fp12_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/fp4_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/fp2_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/fp_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/big_B384_58.h \ C:/mingw64/x86_64-w64-mingw32/include/inttypes.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/arch.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/core.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/arch.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/core.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_big_B384_58.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_field_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp2_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_pqibe.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/core.h + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_big_B384_58.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_field_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_curve_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ecp2_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ecp_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_pqibe.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/core.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/DependInfo.cmake b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/DependInfo.cmake index a9814f5..f25359a 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/DependInfo.cmake +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/DependInfo.cmake @@ -8,21 +8,21 @@ set(CMAKE_DEPENDS_LANGUAGES # The set of dependency files which are needed: set(CMAKE_DEPENDS_DEPENDENCY_FILES - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/ibe/tls_bfibe.cpp" "CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/ibe/tls_pqibe.cpp" "CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_cacerts.cpp" "CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_cert_chain.cpp" "CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_client_cert.cpp" "CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_client_recv.cpp" "CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_client_send.cpp" "CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_keys_calc.cpp" "CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_logger.cpp" "CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_octads.cpp" "CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_protocol.cpp" "CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_sal.cpp" "CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_sockets.cpp" "CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_tickets.cpp" "CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj.d" - "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_x509.cpp" "CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/ibe/tls_bfibe.cpp" "CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/ibe/tls_pqibe.cpp" "CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/tls_cacerts.cpp" "CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/tls_cert_chain.cpp" "CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/tls_client_cert.cpp" "CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/tls_client_recv.cpp" "CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/tls_client_send.cpp" "CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/tls_keys_calc.cpp" "CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/tls_logger.cpp" "CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/tls_octads.cpp" "CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/tls_protocol.cpp" "CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/tls_sal.cpp" "CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/tls_sockets.cpp" "CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/tls_tickets.cpp" "CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj.d" + "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/lib/tls_x509.cpp" "CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj" "gcc" "CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj.d" ) # Targets to which this target links which contain Fortran sources. diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/build.make b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/build.make index c9bcb3e..da39c60 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/build.make +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/build.make @@ -52,10 +52,10 @@ RM = C:\mingw64\bin\cmake.exe -E rm -f EQUALS = = # The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = D:\DOKUMENTY\diplomovka-final\Scott-cpp-win +CMAKE_SOURCE_DIR = D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS # The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = D:\DOKUMENTY\diplomovka-final\Scott-cpp-win +CMAKE_BINARY_DIR = D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS # Include any dependencies generated for this target. include CMakeFiles/tiitls.dir/depend.make @@ -72,226 +72,226 @@ CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj: CMakeFiles/tiitls.dir/flags.ma CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj: lib/tls_cert_chain.cpp CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_cert_chain.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_cert_chain.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_cert_chain.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_cert_chain.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_cert_chain.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_cert_chain.cpp CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_cert_chain.cpp > CMakeFiles\tiitls.dir\lib\tls_cert_chain.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_cert_chain.cpp > CMakeFiles\tiitls.dir\lib\tls_cert_chain.cpp.i CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_cert_chain.cpp -o CMakeFiles\tiitls.dir\lib\tls_cert_chain.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_cert_chain.cpp -o CMakeFiles\tiitls.dir\lib\tls_cert_chain.cpp.s CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj: lib/tls_client_recv.cpp CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_client_recv.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_client_recv.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_client_recv.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_client_recv.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_client_recv.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_client_recv.cpp CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_client_recv.cpp > CMakeFiles\tiitls.dir\lib\tls_client_recv.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_client_recv.cpp > CMakeFiles\tiitls.dir\lib\tls_client_recv.cpp.i CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_client_recv.cpp -o CMakeFiles\tiitls.dir\lib\tls_client_recv.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_client_recv.cpp -o CMakeFiles\tiitls.dir\lib\tls_client_recv.cpp.s CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj: lib/tls_client_send.cpp CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_client_send.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_client_send.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_client_send.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_client_send.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_client_send.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_client_send.cpp CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_client_send.cpp > CMakeFiles\tiitls.dir\lib\tls_client_send.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_client_send.cpp > CMakeFiles\tiitls.dir\lib\tls_client_send.cpp.i CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_client_send.cpp -o CMakeFiles\tiitls.dir\lib\tls_client_send.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_client_send.cpp -o CMakeFiles\tiitls.dir\lib\tls_client_send.cpp.s CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj: lib/tls_keys_calc.cpp CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_keys_calc.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_keys_calc.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_keys_calc.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_keys_calc.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_keys_calc.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_keys_calc.cpp CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_keys_calc.cpp > CMakeFiles\tiitls.dir\lib\tls_keys_calc.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_keys_calc.cpp > CMakeFiles\tiitls.dir\lib\tls_keys_calc.cpp.i CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_keys_calc.cpp -o CMakeFiles\tiitls.dir\lib\tls_keys_calc.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_keys_calc.cpp -o CMakeFiles\tiitls.dir\lib\tls_keys_calc.cpp.s CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj: lib/tls_sockets.cpp CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_sockets.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_sockets.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_sockets.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_sockets.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_sockets.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_sockets.cpp CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_sockets.cpp > CMakeFiles\tiitls.dir\lib\tls_sockets.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_sockets.cpp > CMakeFiles\tiitls.dir\lib\tls_sockets.cpp.i CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_sockets.cpp -o CMakeFiles\tiitls.dir\lib\tls_sockets.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_sockets.cpp -o CMakeFiles\tiitls.dir\lib\tls_sockets.cpp.s CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj: lib/tls_octads.cpp CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_octads.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_octads.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_octads.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_octads.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_octads.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_octads.cpp CMakeFiles/tiitls.dir/lib/tls_octads.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/tls_octads.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_octads.cpp > CMakeFiles\tiitls.dir\lib\tls_octads.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_octads.cpp > CMakeFiles\tiitls.dir\lib\tls_octads.cpp.i CMakeFiles/tiitls.dir/lib/tls_octads.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/tls_octads.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_octads.cpp -o CMakeFiles\tiitls.dir\lib\tls_octads.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_octads.cpp -o CMakeFiles\tiitls.dir\lib\tls_octads.cpp.s CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj: lib/tls_logger.cpp CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_logger.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_logger.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_logger.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_logger.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_logger.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_logger.cpp CMakeFiles/tiitls.dir/lib/tls_logger.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/tls_logger.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_logger.cpp > CMakeFiles\tiitls.dir\lib\tls_logger.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_logger.cpp > CMakeFiles\tiitls.dir\lib\tls_logger.cpp.i CMakeFiles/tiitls.dir/lib/tls_logger.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/tls_logger.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_logger.cpp -o CMakeFiles\tiitls.dir\lib\tls_logger.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_logger.cpp -o CMakeFiles\tiitls.dir\lib\tls_logger.cpp.s CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj: lib/tls_protocol.cpp CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_protocol.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_protocol.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_protocol.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_protocol.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_protocol.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_protocol.cpp CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_protocol.cpp > CMakeFiles\tiitls.dir\lib\tls_protocol.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_protocol.cpp > CMakeFiles\tiitls.dir\lib\tls_protocol.cpp.i CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_protocol.cpp -o CMakeFiles\tiitls.dir\lib\tls_protocol.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_protocol.cpp -o CMakeFiles\tiitls.dir\lib\tls_protocol.cpp.s CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj: lib/tls_cacerts.cpp CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_cacerts.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_cacerts.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_cacerts.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_cacerts.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_cacerts.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_cacerts.cpp CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_cacerts.cpp > CMakeFiles\tiitls.dir\lib\tls_cacerts.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_cacerts.cpp > CMakeFiles\tiitls.dir\lib\tls_cacerts.cpp.i CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_cacerts.cpp -o CMakeFiles\tiitls.dir\lib\tls_cacerts.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_cacerts.cpp -o CMakeFiles\tiitls.dir\lib\tls_cacerts.cpp.s CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj: lib/tls_client_cert.cpp CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_10) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_client_cert.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_client_cert.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_client_cert.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_10) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_client_cert.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_client_cert.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_client_cert.cpp CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_client_cert.cpp > CMakeFiles\tiitls.dir\lib\tls_client_cert.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_client_cert.cpp > CMakeFiles\tiitls.dir\lib\tls_client_cert.cpp.i CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_client_cert.cpp -o CMakeFiles\tiitls.dir\lib\tls_client_cert.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_client_cert.cpp -o CMakeFiles\tiitls.dir\lib\tls_client_cert.cpp.s CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj: lib/tls_tickets.cpp CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_11) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_tickets.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_tickets.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_tickets.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_11) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_tickets.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_tickets.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_tickets.cpp CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_tickets.cpp > CMakeFiles\tiitls.dir\lib\tls_tickets.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_tickets.cpp > CMakeFiles\tiitls.dir\lib\tls_tickets.cpp.i CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_tickets.cpp -o CMakeFiles\tiitls.dir\lib\tls_tickets.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_tickets.cpp -o CMakeFiles\tiitls.dir\lib\tls_tickets.cpp.s CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj: lib/tls_x509.cpp CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_12) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_x509.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_x509.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_x509.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_12) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_x509.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_x509.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_x509.cpp CMakeFiles/tiitls.dir/lib/tls_x509.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/tls_x509.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_x509.cpp > CMakeFiles\tiitls.dir\lib\tls_x509.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_x509.cpp > CMakeFiles\tiitls.dir\lib\tls_x509.cpp.i CMakeFiles/tiitls.dir/lib/tls_x509.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/tls_x509.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_x509.cpp -o CMakeFiles\tiitls.dir\lib\tls_x509.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_x509.cpp -o CMakeFiles\tiitls.dir\lib\tls_x509.cpp.s CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj: lib/tls_sal.cpp CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_13) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_sal.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_sal.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_sal.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_13) "Building CXX object CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj -MF CMakeFiles\tiitls.dir\lib\tls_sal.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\tls_sal.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_sal.cpp CMakeFiles/tiitls.dir/lib/tls_sal.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/tls_sal.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_sal.cpp > CMakeFiles\tiitls.dir\lib\tls_sal.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_sal.cpp > CMakeFiles\tiitls.dir\lib\tls_sal.cpp.i CMakeFiles/tiitls.dir/lib/tls_sal.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/tls_sal.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_sal.cpp -o CMakeFiles\tiitls.dir\lib\tls_sal.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_sal.cpp -o CMakeFiles\tiitls.dir\lib\tls_sal.cpp.s CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj: lib/ibe/tls_bfibe.cpp CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_14) "Building CXX object CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj -MF CMakeFiles\tiitls.dir\lib\ibe\tls_bfibe.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\ibe\tls_bfibe.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\ibe\tls_bfibe.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_14) "Building CXX object CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj -MF CMakeFiles\tiitls.dir\lib\ibe\tls_bfibe.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\ibe\tls_bfibe.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\ibe\tls_bfibe.cpp CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\ibe\tls_bfibe.cpp > CMakeFiles\tiitls.dir\lib\ibe\tls_bfibe.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\ibe\tls_bfibe.cpp > CMakeFiles\tiitls.dir\lib\ibe\tls_bfibe.cpp.i CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\ibe\tls_bfibe.cpp -o CMakeFiles\tiitls.dir\lib\ibe\tls_bfibe.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\ibe\tls_bfibe.cpp -o CMakeFiles\tiitls.dir\lib\ibe\tls_bfibe.cpp.s CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj: CMakeFiles/tiitls.dir/flags.make CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj: CMakeFiles/tiitls.dir/includes_CXX.rsp CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj: lib/ibe/tls_pqibe.cpp CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj: CMakeFiles/tiitls.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_15) "Building CXX object CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj -MF CMakeFiles\tiitls.dir\lib\ibe\tls_pqibe.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\ibe\tls_pqibe.cpp.obj -c D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\ibe\tls_pqibe.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_15) "Building CXX object CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj" + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj -MF CMakeFiles\tiitls.dir\lib\ibe\tls_pqibe.cpp.obj.d -o CMakeFiles\tiitls.dir\lib\ibe\tls_pqibe.cpp.obj -c D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\ibe\tls_pqibe.cpp CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.i" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\ibe\tls_pqibe.cpp > CMakeFiles\tiitls.dir\lib\ibe\tls_pqibe.cpp.i + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\ibe\tls_pqibe.cpp > CMakeFiles\tiitls.dir\lib\ibe\tls_pqibe.cpp.i CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.s" - C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\ibe\tls_pqibe.cpp -o CMakeFiles\tiitls.dir\lib\ibe\tls_pqibe.cpp.s + C:\mingw64\bin\gcc.exe $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\ibe\tls_pqibe.cpp -o CMakeFiles\tiitls.dir\lib\ibe\tls_pqibe.cpp.s # Object files for target tiitls tiitls_OBJECTS = \ @@ -331,7 +331,7 @@ libtiitls.a: CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj libtiitls.a: CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj libtiitls.a: CMakeFiles/tiitls.dir/build.make libtiitls.a: CMakeFiles/tiitls.dir/link.txt - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --bold --progress-dir=D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles --progress-num=$(CMAKE_PROGRESS_16) "Linking CXX static library libtiitls.a" + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --bold --progress-dir=D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles --progress-num=$(CMAKE_PROGRESS_16) "Linking CXX static library libtiitls.a" $(CMAKE_COMMAND) -P CMakeFiles\tiitls.dir\cmake_clean_target.cmake $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles\tiitls.dir\link.txt --verbose=$(VERBOSE) @@ -344,6 +344,6 @@ CMakeFiles/tiitls.dir/clean: .PHONY : CMakeFiles/tiitls.dir/clean CMakeFiles/tiitls.dir/depend: - $(CMAKE_COMMAND) -E cmake_depends "MinGW Makefiles" D:\DOKUMENTY\diplomovka-final\Scott-cpp-win D:\DOKUMENTY\diplomovka-final\Scott-cpp-win D:\DOKUMENTY\diplomovka-final\Scott-cpp-win D:\DOKUMENTY\diplomovka-final\Scott-cpp-win D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles\tiitls.dir\DependInfo.cmake "--color=$(COLOR)" + $(CMAKE_COMMAND) -E cmake_depends "MinGW Makefiles" D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles\tiitls.dir\DependInfo.cmake "--color=$(COLOR)" .PHONY : CMakeFiles/tiitls.dir/depend diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/compiler_depend.internal b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/compiler_depend.internal deleted file mode 100644 index 1ebb5e7..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/compiler_depend.internal +++ /dev/null @@ -1,3660 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "MinGW Makefiles" Generator, CMake Version 3.28 - -CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/ibe/tls_bfibe.cpp - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/inttypes.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/string.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_bfibe.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/arch.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/big_B384_58.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_big_B384_58.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_field_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/core.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp2_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp12_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp2_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp4_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/pair_BLS12381.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/randapi.h - -CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/ibe/tls_pqibe.cpp - C:/mingw64/include/c++/13.2.0/backward/binders.h - C:/mingw64/include/c++/13.2.0/bit - C:/mingw64/include/c++/13.2.0/bits/alloc_traits.h - C:/mingw64/include/c++/13.2.0/bits/allocator.h - C:/mingw64/include/c++/13.2.0/bits/basic_ios.h - C:/mingw64/include/c++/13.2.0/bits/basic_ios.tcc - C:/mingw64/include/c++/13.2.0/bits/basic_string.h - C:/mingw64/include/c++/13.2.0/bits/basic_string.tcc - C:/mingw64/include/c++/13.2.0/bits/char_traits.h - C:/mingw64/include/c++/13.2.0/bits/charconv.h - C:/mingw64/include/c++/13.2.0/bits/concept_check.h - C:/mingw64/include/c++/13.2.0/bits/cpp_type_traits.h - C:/mingw64/include/c++/13.2.0/bits/cxxabi_forced.h - C:/mingw64/include/c++/13.2.0/bits/cxxabi_init_exception.h - C:/mingw64/include/c++/13.2.0/bits/exception.h - C:/mingw64/include/c++/13.2.0/bits/exception_defines.h - C:/mingw64/include/c++/13.2.0/bits/exception_ptr.h - C:/mingw64/include/c++/13.2.0/bits/functexcept.h - C:/mingw64/include/c++/13.2.0/bits/functional_hash.h - C:/mingw64/include/c++/13.2.0/bits/hash_bytes.h - C:/mingw64/include/c++/13.2.0/bits/invoke.h - C:/mingw64/include/c++/13.2.0/bits/ios_base.h - C:/mingw64/include/c++/13.2.0/bits/istream.tcc - C:/mingw64/include/c++/13.2.0/bits/locale_classes.h - C:/mingw64/include/c++/13.2.0/bits/locale_classes.tcc - C:/mingw64/include/c++/13.2.0/bits/locale_facets.h - C:/mingw64/include/c++/13.2.0/bits/locale_facets.tcc - C:/mingw64/include/c++/13.2.0/bits/localefwd.h - C:/mingw64/include/c++/13.2.0/bits/memory_resource.h - C:/mingw64/include/c++/13.2.0/bits/memoryfwd.h - C:/mingw64/include/c++/13.2.0/bits/move.h - C:/mingw64/include/c++/13.2.0/bits/nested_exception.h - C:/mingw64/include/c++/13.2.0/bits/new_allocator.h - C:/mingw64/include/c++/13.2.0/bits/ostream.tcc - C:/mingw64/include/c++/13.2.0/bits/ostream_insert.h - C:/mingw64/include/c++/13.2.0/bits/postypes.h - C:/mingw64/include/c++/13.2.0/bits/predefined_ops.h - C:/mingw64/include/c++/13.2.0/bits/ptr_traits.h - C:/mingw64/include/c++/13.2.0/bits/range_access.h - C:/mingw64/include/c++/13.2.0/bits/refwrap.h - C:/mingw64/include/c++/13.2.0/bits/requires_hosted.h - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/bits/stl_algobase.h - C:/mingw64/include/c++/13.2.0/bits/stl_construct.h - C:/mingw64/include/c++/13.2.0/bits/stl_function.h - C:/mingw64/include/c++/13.2.0/bits/stl_iterator.h - C:/mingw64/include/c++/13.2.0/bits/stl_iterator_base_funcs.h - C:/mingw64/include/c++/13.2.0/bits/stl_iterator_base_types.h - C:/mingw64/include/c++/13.2.0/bits/stl_pair.h - C:/mingw64/include/c++/13.2.0/bits/streambuf.tcc - C:/mingw64/include/c++/13.2.0/bits/streambuf_iterator.h - C:/mingw64/include/c++/13.2.0/bits/string_view.tcc - C:/mingw64/include/c++/13.2.0/bits/stringfwd.h - C:/mingw64/include/c++/13.2.0/bits/uses_allocator.h - C:/mingw64/include/c++/13.2.0/bits/uses_allocator_args.h - C:/mingw64/include/c++/13.2.0/bits/utility.h - C:/mingw64/include/c++/13.2.0/cctype - C:/mingw64/include/c++/13.2.0/cerrno - C:/mingw64/include/c++/13.2.0/clocale - C:/mingw64/include/c++/13.2.0/cstddef - C:/mingw64/include/c++/13.2.0/cstdint - C:/mingw64/include/c++/13.2.0/cstdio - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/cwchar - C:/mingw64/include/c++/13.2.0/cwctype - C:/mingw64/include/c++/13.2.0/debug/assertions.h - C:/mingw64/include/c++/13.2.0/debug/debug.h - C:/mingw64/include/c++/13.2.0/exception - C:/mingw64/include/c++/13.2.0/ext/alloc_traits.h - C:/mingw64/include/c++/13.2.0/ext/atomicity.h - C:/mingw64/include/c++/13.2.0/ext/numeric_traits.h - C:/mingw64/include/c++/13.2.0/ext/string_conversions.h - C:/mingw64/include/c++/13.2.0/ext/type_traits.h - C:/mingw64/include/c++/13.2.0/initializer_list - C:/mingw64/include/c++/13.2.0/ios - C:/mingw64/include/c++/13.2.0/iosfwd - C:/mingw64/include/c++/13.2.0/iostream - C:/mingw64/include/c++/13.2.0/istream - C:/mingw64/include/c++/13.2.0/new - C:/mingw64/include/c++/13.2.0/ostream - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdexcept - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/streambuf - C:/mingw64/include/c++/13.2.0/string - C:/mingw64/include/c++/13.2.0/string_view - C:/mingw64/include/c++/13.2.0/system_error - C:/mingw64/include/c++/13.2.0/tuple - C:/mingw64/include/c++/13.2.0/type_traits - C:/mingw64/include/c++/13.2.0/typeinfo - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/atomic_word.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++allocator.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++locale.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/ctype_base.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/ctype_inline.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/error_constants.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/gthr-default.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/gthr.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stat64.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/ctype.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/locale.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/process.h - C:/mingw64/x86_64-w64-mingw32/include/pthread.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_compat.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_signal.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/wchar_s.h - C:/mingw64/x86_64-w64-mingw32/include/signal.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - C:/mingw64/x86_64-w64-mingw32/include/wchar.h - C:/mingw64/x86_64-w64-mingw32/include/wctype.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_pqibe.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/arch.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/core.h - -CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_cacerts.cpp - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/afunix.h - C:/mingw64/x86_64-w64-mingw32/include/apiset.h - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h - C:/mingw64/x86_64-w64-mingw32/include/cderr.h - C:/mingw64/x86_64-w64-mingw32/include/cguid.h - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/ctype.h - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h - C:/mingw64/x86_64-w64-mingw32/include/dde.h - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/excpt.h - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h - C:/mingw64/x86_64-w64-mingw32/include/getopt.h - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h - C:/mingw64/x86_64-w64-mingw32/include/imm.h - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h - C:/mingw64/x86_64-w64-mingw32/include/io.h - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h - C:/mingw64/x86_64-w64-mingw32/include/mcx.h - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h - C:/mingw64/x86_64-w64-mingw32/include/msxml.h - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h - C:/mingw64/x86_64-w64-mingw32/include/nb30.h - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h - C:/mingw64/x86_64-w64-mingw32/include/objbase.h - C:/mingw64/x86_64-w64-mingw32/include/objidl.h - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h - C:/mingw64/x86_64-w64-mingw32/include/ole2.h - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h - C:/mingw64/x86_64-w64-mingw32/include/poppack.h - C:/mingw64/x86_64-w64-mingw32/include/process.h - C:/mingw64/x86_64-w64-mingw32/include/processenv.h - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h - C:/mingw64/x86_64-w64-mingw32/include/propidl.h - C:/mingw64/x86_64-w64-mingw32/include/prsht.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h - C:/mingw64/x86_64-w64-mingw32/include/qos.h - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h - C:/mingw64/x86_64-w64-mingw32/include/reason.h - C:/mingw64/x86_64-w64-mingw32/include/rpc.h - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h - C:/mingw64/x86_64-w64-mingw32/include/sal.h - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/servprov.h - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/stralign.h - C:/mingw64/x86_64-w64-mingw32/include/string.h - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h - C:/mingw64/x86_64-w64-mingw32/include/tvout.h - C:/mingw64/x86_64-w64-mingw32/include/unistd.h - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h - C:/mingw64/x86_64-w64-mingw32/include/winbase.h - C:/mingw64/x86_64-w64-mingw32/include/wincon.h - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h - C:/mingw64/x86_64-w64-mingw32/include/windef.h - C:/mingw64/x86_64-w64-mingw32/include/windows.h - C:/mingw64/x86_64-w64-mingw32/include/winefs.h - C:/mingw64/x86_64-w64-mingw32/include/winerror.h - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h - C:/mingw64/x86_64-w64-mingw32/include/winnls.h - C:/mingw64/x86_64-w64-mingw32/include/winnt.h - C:/mingw64/x86_64-w64-mingw32/include/winperf.h - C:/mingw64/x86_64-w64-mingw32/include/winreg.h - C:/mingw64/x86_64-w64-mingw32/include/winscard.h - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h - C:/mingw64/x86_64-w64-mingw32/include/winsock.h - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h - C:/mingw64/x86_64-w64-mingw32/include/winspool.h - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h - C:/mingw64/x86_64-w64-mingw32/include/winuser.h - C:/mingw64/x86_64-w64-mingw32/include/winver.h - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h - -CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_cert_chain.cpp - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/afunix.h - C:/mingw64/x86_64-w64-mingw32/include/apiset.h - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h - C:/mingw64/x86_64-w64-mingw32/include/cderr.h - C:/mingw64/x86_64-w64-mingw32/include/cguid.h - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/ctype.h - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h - C:/mingw64/x86_64-w64-mingw32/include/dde.h - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/excpt.h - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h - C:/mingw64/x86_64-w64-mingw32/include/getopt.h - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h - C:/mingw64/x86_64-w64-mingw32/include/imm.h - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h - C:/mingw64/x86_64-w64-mingw32/include/io.h - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h - C:/mingw64/x86_64-w64-mingw32/include/mcx.h - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h - C:/mingw64/x86_64-w64-mingw32/include/msxml.h - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h - C:/mingw64/x86_64-w64-mingw32/include/nb30.h - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h - C:/mingw64/x86_64-w64-mingw32/include/objbase.h - C:/mingw64/x86_64-w64-mingw32/include/objidl.h - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h - C:/mingw64/x86_64-w64-mingw32/include/ole2.h - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h - C:/mingw64/x86_64-w64-mingw32/include/poppack.h - C:/mingw64/x86_64-w64-mingw32/include/process.h - C:/mingw64/x86_64-w64-mingw32/include/processenv.h - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h - C:/mingw64/x86_64-w64-mingw32/include/propidl.h - C:/mingw64/x86_64-w64-mingw32/include/prsht.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h - C:/mingw64/x86_64-w64-mingw32/include/qos.h - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h - C:/mingw64/x86_64-w64-mingw32/include/reason.h - C:/mingw64/x86_64-w64-mingw32/include/rpc.h - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h - C:/mingw64/x86_64-w64-mingw32/include/sal.h - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/servprov.h - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/stralign.h - C:/mingw64/x86_64-w64-mingw32/include/string.h - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h - C:/mingw64/x86_64-w64-mingw32/include/tvout.h - C:/mingw64/x86_64-w64-mingw32/include/unistd.h - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h - C:/mingw64/x86_64-w64-mingw32/include/winbase.h - C:/mingw64/x86_64-w64-mingw32/include/wincon.h - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h - C:/mingw64/x86_64-w64-mingw32/include/windef.h - C:/mingw64/x86_64-w64-mingw32/include/windows.h - C:/mingw64/x86_64-w64-mingw32/include/winefs.h - C:/mingw64/x86_64-w64-mingw32/include/winerror.h - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h - C:/mingw64/x86_64-w64-mingw32/include/winnls.h - C:/mingw64/x86_64-w64-mingw32/include/winnt.h - C:/mingw64/x86_64-w64-mingw32/include/winperf.h - C:/mingw64/x86_64-w64-mingw32/include/winreg.h - C:/mingw64/x86_64-w64-mingw32/include/winscard.h - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h - C:/mingw64/x86_64-w64-mingw32/include/winsock.h - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h - C:/mingw64/x86_64-w64-mingw32/include/winspool.h - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h - C:/mingw64/x86_64-w64-mingw32/include/winuser.h - C:/mingw64/x86_64-w64-mingw32/include/winver.h - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_cert_chain.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_client_cert.cpp - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/afunix.h - C:/mingw64/x86_64-w64-mingw32/include/apiset.h - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h - C:/mingw64/x86_64-w64-mingw32/include/cderr.h - C:/mingw64/x86_64-w64-mingw32/include/cguid.h - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/ctype.h - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h - C:/mingw64/x86_64-w64-mingw32/include/dde.h - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/excpt.h - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h - C:/mingw64/x86_64-w64-mingw32/include/getopt.h - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h - C:/mingw64/x86_64-w64-mingw32/include/imm.h - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h - C:/mingw64/x86_64-w64-mingw32/include/io.h - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h - C:/mingw64/x86_64-w64-mingw32/include/mcx.h - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h - C:/mingw64/x86_64-w64-mingw32/include/msxml.h - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h - C:/mingw64/x86_64-w64-mingw32/include/nb30.h - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h - C:/mingw64/x86_64-w64-mingw32/include/objbase.h - C:/mingw64/x86_64-w64-mingw32/include/objidl.h - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h - C:/mingw64/x86_64-w64-mingw32/include/ole2.h - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h - C:/mingw64/x86_64-w64-mingw32/include/poppack.h - C:/mingw64/x86_64-w64-mingw32/include/process.h - C:/mingw64/x86_64-w64-mingw32/include/processenv.h - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h - C:/mingw64/x86_64-w64-mingw32/include/propidl.h - C:/mingw64/x86_64-w64-mingw32/include/prsht.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h - C:/mingw64/x86_64-w64-mingw32/include/qos.h - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h - C:/mingw64/x86_64-w64-mingw32/include/reason.h - C:/mingw64/x86_64-w64-mingw32/include/rpc.h - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h - C:/mingw64/x86_64-w64-mingw32/include/sal.h - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/servprov.h - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/stralign.h - C:/mingw64/x86_64-w64-mingw32/include/string.h - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h - C:/mingw64/x86_64-w64-mingw32/include/tvout.h - C:/mingw64/x86_64-w64-mingw32/include/unistd.h - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h - C:/mingw64/x86_64-w64-mingw32/include/winbase.h - C:/mingw64/x86_64-w64-mingw32/include/wincon.h - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h - C:/mingw64/x86_64-w64-mingw32/include/windef.h - C:/mingw64/x86_64-w64-mingw32/include/windows.h - C:/mingw64/x86_64-w64-mingw32/include/winefs.h - C:/mingw64/x86_64-w64-mingw32/include/winerror.h - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h - C:/mingw64/x86_64-w64-mingw32/include/winnls.h - C:/mingw64/x86_64-w64-mingw32/include/winnt.h - C:/mingw64/x86_64-w64-mingw32/include/winperf.h - C:/mingw64/x86_64-w64-mingw32/include/winreg.h - C:/mingw64/x86_64-w64-mingw32/include/winscard.h - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h - C:/mingw64/x86_64-w64-mingw32/include/winsock.h - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h - C:/mingw64/x86_64-w64-mingw32/include/winspool.h - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h - C:/mingw64/x86_64-w64-mingw32/include/winuser.h - C:/mingw64/x86_64-w64-mingw32/include/winver.h - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h - -CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_client_recv.cpp - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/afunix.h - C:/mingw64/x86_64-w64-mingw32/include/apiset.h - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h - C:/mingw64/x86_64-w64-mingw32/include/cderr.h - C:/mingw64/x86_64-w64-mingw32/include/cguid.h - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/ctype.h - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h - C:/mingw64/x86_64-w64-mingw32/include/dde.h - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/excpt.h - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h - C:/mingw64/x86_64-w64-mingw32/include/getopt.h - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h - C:/mingw64/x86_64-w64-mingw32/include/imm.h - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h - C:/mingw64/x86_64-w64-mingw32/include/io.h - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h - C:/mingw64/x86_64-w64-mingw32/include/mcx.h - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h - C:/mingw64/x86_64-w64-mingw32/include/msxml.h - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h - C:/mingw64/x86_64-w64-mingw32/include/nb30.h - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h - C:/mingw64/x86_64-w64-mingw32/include/objbase.h - C:/mingw64/x86_64-w64-mingw32/include/objidl.h - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h - C:/mingw64/x86_64-w64-mingw32/include/ole2.h - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h - C:/mingw64/x86_64-w64-mingw32/include/poppack.h - C:/mingw64/x86_64-w64-mingw32/include/process.h - C:/mingw64/x86_64-w64-mingw32/include/processenv.h - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h - C:/mingw64/x86_64-w64-mingw32/include/propidl.h - C:/mingw64/x86_64-w64-mingw32/include/prsht.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h - C:/mingw64/x86_64-w64-mingw32/include/qos.h - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h - C:/mingw64/x86_64-w64-mingw32/include/reason.h - C:/mingw64/x86_64-w64-mingw32/include/rpc.h - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h - C:/mingw64/x86_64-w64-mingw32/include/sal.h - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/servprov.h - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/stralign.h - C:/mingw64/x86_64-w64-mingw32/include/string.h - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h - C:/mingw64/x86_64-w64-mingw32/include/tvout.h - C:/mingw64/x86_64-w64-mingw32/include/unistd.h - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h - C:/mingw64/x86_64-w64-mingw32/include/winbase.h - C:/mingw64/x86_64-w64-mingw32/include/wincon.h - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h - C:/mingw64/x86_64-w64-mingw32/include/windef.h - C:/mingw64/x86_64-w64-mingw32/include/windows.h - C:/mingw64/x86_64-w64-mingw32/include/winefs.h - C:/mingw64/x86_64-w64-mingw32/include/winerror.h - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h - C:/mingw64/x86_64-w64-mingw32/include/winnls.h - C:/mingw64/x86_64-w64-mingw32/include/winnt.h - C:/mingw64/x86_64-w64-mingw32/include/winperf.h - C:/mingw64/x86_64-w64-mingw32/include/winreg.h - C:/mingw64/x86_64-w64-mingw32/include/winscard.h - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h - C:/mingw64/x86_64-w64-mingw32/include/winsock.h - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h - C:/mingw64/x86_64-w64-mingw32/include/winspool.h - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h - C:/mingw64/x86_64-w64-mingw32/include/winuser.h - C:/mingw64/x86_64-w64-mingw32/include/winver.h - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_cert_chain.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_client_send.cpp - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/afunix.h - C:/mingw64/x86_64-w64-mingw32/include/apiset.h - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h - C:/mingw64/x86_64-w64-mingw32/include/cderr.h - C:/mingw64/x86_64-w64-mingw32/include/cguid.h - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/ctype.h - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h - C:/mingw64/x86_64-w64-mingw32/include/dde.h - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/excpt.h - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h - C:/mingw64/x86_64-w64-mingw32/include/getopt.h - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h - C:/mingw64/x86_64-w64-mingw32/include/imm.h - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h - C:/mingw64/x86_64-w64-mingw32/include/io.h - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h - C:/mingw64/x86_64-w64-mingw32/include/mcx.h - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h - C:/mingw64/x86_64-w64-mingw32/include/msxml.h - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h - C:/mingw64/x86_64-w64-mingw32/include/nb30.h - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h - C:/mingw64/x86_64-w64-mingw32/include/objbase.h - C:/mingw64/x86_64-w64-mingw32/include/objidl.h - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h - C:/mingw64/x86_64-w64-mingw32/include/ole2.h - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h - C:/mingw64/x86_64-w64-mingw32/include/poppack.h - C:/mingw64/x86_64-w64-mingw32/include/process.h - C:/mingw64/x86_64-w64-mingw32/include/processenv.h - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h - C:/mingw64/x86_64-w64-mingw32/include/propidl.h - C:/mingw64/x86_64-w64-mingw32/include/prsht.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h - C:/mingw64/x86_64-w64-mingw32/include/qos.h - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h - C:/mingw64/x86_64-w64-mingw32/include/reason.h - C:/mingw64/x86_64-w64-mingw32/include/rpc.h - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h - C:/mingw64/x86_64-w64-mingw32/include/sal.h - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/servprov.h - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/stralign.h - C:/mingw64/x86_64-w64-mingw32/include/string.h - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h - C:/mingw64/x86_64-w64-mingw32/include/tvout.h - C:/mingw64/x86_64-w64-mingw32/include/unistd.h - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h - C:/mingw64/x86_64-w64-mingw32/include/winbase.h - C:/mingw64/x86_64-w64-mingw32/include/wincon.h - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h - C:/mingw64/x86_64-w64-mingw32/include/windef.h - C:/mingw64/x86_64-w64-mingw32/include/windows.h - C:/mingw64/x86_64-w64-mingw32/include/winefs.h - C:/mingw64/x86_64-w64-mingw32/include/winerror.h - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h - C:/mingw64/x86_64-w64-mingw32/include/winnls.h - C:/mingw64/x86_64-w64-mingw32/include/winnt.h - C:/mingw64/x86_64-w64-mingw32/include/winperf.h - C:/mingw64/x86_64-w64-mingw32/include/winreg.h - C:/mingw64/x86_64-w64-mingw32/include/winscard.h - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h - C:/mingw64/x86_64-w64-mingw32/include/winsock.h - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h - C:/mingw64/x86_64-w64-mingw32/include/winspool.h - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h - C:/mingw64/x86_64-w64-mingw32/include/winuser.h - C:/mingw64/x86_64-w64-mingw32/include/winver.h - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_keys_calc.cpp - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/afunix.h - C:/mingw64/x86_64-w64-mingw32/include/apiset.h - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h - C:/mingw64/x86_64-w64-mingw32/include/cderr.h - C:/mingw64/x86_64-w64-mingw32/include/cguid.h - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/ctype.h - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h - C:/mingw64/x86_64-w64-mingw32/include/dde.h - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/excpt.h - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h - C:/mingw64/x86_64-w64-mingw32/include/getopt.h - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h - C:/mingw64/x86_64-w64-mingw32/include/imm.h - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h - C:/mingw64/x86_64-w64-mingw32/include/io.h - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h - C:/mingw64/x86_64-w64-mingw32/include/mcx.h - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h - C:/mingw64/x86_64-w64-mingw32/include/msxml.h - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h - C:/mingw64/x86_64-w64-mingw32/include/nb30.h - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h - C:/mingw64/x86_64-w64-mingw32/include/objbase.h - C:/mingw64/x86_64-w64-mingw32/include/objidl.h - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h - C:/mingw64/x86_64-w64-mingw32/include/ole2.h - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h - C:/mingw64/x86_64-w64-mingw32/include/poppack.h - C:/mingw64/x86_64-w64-mingw32/include/process.h - C:/mingw64/x86_64-w64-mingw32/include/processenv.h - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h - C:/mingw64/x86_64-w64-mingw32/include/propidl.h - C:/mingw64/x86_64-w64-mingw32/include/prsht.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h - C:/mingw64/x86_64-w64-mingw32/include/qos.h - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h - C:/mingw64/x86_64-w64-mingw32/include/reason.h - C:/mingw64/x86_64-w64-mingw32/include/rpc.h - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h - C:/mingw64/x86_64-w64-mingw32/include/sal.h - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/servprov.h - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/stralign.h - C:/mingw64/x86_64-w64-mingw32/include/string.h - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h - C:/mingw64/x86_64-w64-mingw32/include/tvout.h - C:/mingw64/x86_64-w64-mingw32/include/unistd.h - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h - C:/mingw64/x86_64-w64-mingw32/include/winbase.h - C:/mingw64/x86_64-w64-mingw32/include/wincon.h - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h - C:/mingw64/x86_64-w64-mingw32/include/windef.h - C:/mingw64/x86_64-w64-mingw32/include/windows.h - C:/mingw64/x86_64-w64-mingw32/include/winefs.h - C:/mingw64/x86_64-w64-mingw32/include/winerror.h - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h - C:/mingw64/x86_64-w64-mingw32/include/winnls.h - C:/mingw64/x86_64-w64-mingw32/include/winnt.h - C:/mingw64/x86_64-w64-mingw32/include/winperf.h - C:/mingw64/x86_64-w64-mingw32/include/winreg.h - C:/mingw64/x86_64-w64-mingw32/include/winscard.h - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h - C:/mingw64/x86_64-w64-mingw32/include/winsock.h - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h - C:/mingw64/x86_64-w64-mingw32/include/winspool.h - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h - C:/mingw64/x86_64-w64-mingw32/include/winuser.h - C:/mingw64/x86_64-w64-mingw32/include/winver.h - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_logger.cpp - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/afunix.h - C:/mingw64/x86_64-w64-mingw32/include/apiset.h - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h - C:/mingw64/x86_64-w64-mingw32/include/cderr.h - C:/mingw64/x86_64-w64-mingw32/include/cguid.h - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/ctype.h - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h - C:/mingw64/x86_64-w64-mingw32/include/dde.h - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/excpt.h - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h - C:/mingw64/x86_64-w64-mingw32/include/getopt.h - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h - C:/mingw64/x86_64-w64-mingw32/include/imm.h - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h - C:/mingw64/x86_64-w64-mingw32/include/io.h - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h - C:/mingw64/x86_64-w64-mingw32/include/mcx.h - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h - C:/mingw64/x86_64-w64-mingw32/include/msxml.h - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h - C:/mingw64/x86_64-w64-mingw32/include/nb30.h - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h - C:/mingw64/x86_64-w64-mingw32/include/objbase.h - C:/mingw64/x86_64-w64-mingw32/include/objidl.h - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h - C:/mingw64/x86_64-w64-mingw32/include/ole2.h - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h - C:/mingw64/x86_64-w64-mingw32/include/poppack.h - C:/mingw64/x86_64-w64-mingw32/include/process.h - C:/mingw64/x86_64-w64-mingw32/include/processenv.h - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h - C:/mingw64/x86_64-w64-mingw32/include/propidl.h - C:/mingw64/x86_64-w64-mingw32/include/prsht.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h - C:/mingw64/x86_64-w64-mingw32/include/qos.h - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h - C:/mingw64/x86_64-w64-mingw32/include/reason.h - C:/mingw64/x86_64-w64-mingw32/include/rpc.h - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h - C:/mingw64/x86_64-w64-mingw32/include/sal.h - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/servprov.h - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/stralign.h - C:/mingw64/x86_64-w64-mingw32/include/string.h - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h - C:/mingw64/x86_64-w64-mingw32/include/tvout.h - C:/mingw64/x86_64-w64-mingw32/include/unistd.h - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h - C:/mingw64/x86_64-w64-mingw32/include/winbase.h - C:/mingw64/x86_64-w64-mingw32/include/wincon.h - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h - C:/mingw64/x86_64-w64-mingw32/include/windef.h - C:/mingw64/x86_64-w64-mingw32/include/windows.h - C:/mingw64/x86_64-w64-mingw32/include/winefs.h - C:/mingw64/x86_64-w64-mingw32/include/winerror.h - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h - C:/mingw64/x86_64-w64-mingw32/include/winnls.h - C:/mingw64/x86_64-w64-mingw32/include/winnt.h - C:/mingw64/x86_64-w64-mingw32/include/winperf.h - C:/mingw64/x86_64-w64-mingw32/include/winreg.h - C:/mingw64/x86_64-w64-mingw32/include/winscard.h - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h - C:/mingw64/x86_64-w64-mingw32/include/winsock.h - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h - C:/mingw64/x86_64-w64-mingw32/include/winspool.h - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h - C:/mingw64/x86_64-w64-mingw32/include/winuser.h - C:/mingw64/x86_64-w64-mingw32/include/winver.h - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_octads.cpp - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/sys/time.h - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - -CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_protocol.cpp - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/afunix.h - C:/mingw64/x86_64-w64-mingw32/include/apiset.h - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h - C:/mingw64/x86_64-w64-mingw32/include/cderr.h - C:/mingw64/x86_64-w64-mingw32/include/cguid.h - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/ctype.h - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h - C:/mingw64/x86_64-w64-mingw32/include/dde.h - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/excpt.h - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h - C:/mingw64/x86_64-w64-mingw32/include/getopt.h - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h - C:/mingw64/x86_64-w64-mingw32/include/imm.h - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h - C:/mingw64/x86_64-w64-mingw32/include/io.h - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h - C:/mingw64/x86_64-w64-mingw32/include/mcx.h - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h - C:/mingw64/x86_64-w64-mingw32/include/msxml.h - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h - C:/mingw64/x86_64-w64-mingw32/include/nb30.h - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h - C:/mingw64/x86_64-w64-mingw32/include/objbase.h - C:/mingw64/x86_64-w64-mingw32/include/objidl.h - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h - C:/mingw64/x86_64-w64-mingw32/include/ole2.h - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h - C:/mingw64/x86_64-w64-mingw32/include/poppack.h - C:/mingw64/x86_64-w64-mingw32/include/process.h - C:/mingw64/x86_64-w64-mingw32/include/processenv.h - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h - C:/mingw64/x86_64-w64-mingw32/include/propidl.h - C:/mingw64/x86_64-w64-mingw32/include/prsht.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h - C:/mingw64/x86_64-w64-mingw32/include/qos.h - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h - C:/mingw64/x86_64-w64-mingw32/include/reason.h - C:/mingw64/x86_64-w64-mingw32/include/rpc.h - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h - C:/mingw64/x86_64-w64-mingw32/include/sal.h - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/servprov.h - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/stralign.h - C:/mingw64/x86_64-w64-mingw32/include/string.h - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h - C:/mingw64/x86_64-w64-mingw32/include/tvout.h - C:/mingw64/x86_64-w64-mingw32/include/unistd.h - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h - C:/mingw64/x86_64-w64-mingw32/include/winbase.h - C:/mingw64/x86_64-w64-mingw32/include/wincon.h - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h - C:/mingw64/x86_64-w64-mingw32/include/windef.h - C:/mingw64/x86_64-w64-mingw32/include/windows.h - C:/mingw64/x86_64-w64-mingw32/include/winefs.h - C:/mingw64/x86_64-w64-mingw32/include/winerror.h - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h - C:/mingw64/x86_64-w64-mingw32/include/winnls.h - C:/mingw64/x86_64-w64-mingw32/include/winnt.h - C:/mingw64/x86_64-w64-mingw32/include/winperf.h - C:/mingw64/x86_64-w64-mingw32/include/winreg.h - C:/mingw64/x86_64-w64-mingw32/include/winscard.h - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h - C:/mingw64/x86_64-w64-mingw32/include/winsock.h - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h - C:/mingw64/x86_64-w64-mingw32/include/winspool.h - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h - C:/mingw64/x86_64-w64-mingw32/include/winuser.h - C:/mingw64/x86_64-w64-mingw32/include/winver.h - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_cert_chain.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_protocol.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_tickets.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_sal.cpp - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/include/oqs/common.h - C:/mingw64/include/oqs/kem.h - C:/mingw64/include/oqs/kem_classic_mceliece.h - C:/mingw64/include/oqs/kem_frodokem.h - C:/mingw64/include/oqs/kem_hqc.h - C:/mingw64/include/oqs/kem_kyber.h - C:/mingw64/include/oqs/kem_ml_kem.h - C:/mingw64/include/oqs/kem_ntruprime.h - C:/mingw64/include/oqs/oqs.h - C:/mingw64/include/oqs/oqsconfig.h - C:/mingw64/include/oqs/rand.h - C:/mingw64/include/oqs/sig.h - C:/mingw64/include/oqs/sig_dilithium.h - C:/mingw64/include/oqs/sig_falcon.h - C:/mingw64/include/oqs/sig_ml_dsa.h - C:/mingw64/include/oqs/sig_sphincs.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/afunix.h - C:/mingw64/x86_64-w64-mingw32/include/apiset.h - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h - C:/mingw64/x86_64-w64-mingw32/include/cderr.h - C:/mingw64/x86_64-w64-mingw32/include/cguid.h - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/ctype.h - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h - C:/mingw64/x86_64-w64-mingw32/include/dde.h - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/excpt.h - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h - C:/mingw64/x86_64-w64-mingw32/include/getopt.h - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h - C:/mingw64/x86_64-w64-mingw32/include/imm.h - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h - C:/mingw64/x86_64-w64-mingw32/include/inttypes.h - C:/mingw64/x86_64-w64-mingw32/include/io.h - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h - C:/mingw64/x86_64-w64-mingw32/include/mcx.h - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h - C:/mingw64/x86_64-w64-mingw32/include/msxml.h - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h - C:/mingw64/x86_64-w64-mingw32/include/nb30.h - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h - C:/mingw64/x86_64-w64-mingw32/include/objbase.h - C:/mingw64/x86_64-w64-mingw32/include/objidl.h - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h - C:/mingw64/x86_64-w64-mingw32/include/ole2.h - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h - C:/mingw64/x86_64-w64-mingw32/include/poppack.h - C:/mingw64/x86_64-w64-mingw32/include/process.h - C:/mingw64/x86_64-w64-mingw32/include/processenv.h - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h - C:/mingw64/x86_64-w64-mingw32/include/propidl.h - C:/mingw64/x86_64-w64-mingw32/include/prsht.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h - C:/mingw64/x86_64-w64-mingw32/include/qos.h - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h - C:/mingw64/x86_64-w64-mingw32/include/reason.h - C:/mingw64/x86_64-w64-mingw32/include/rpc.h - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h - C:/mingw64/x86_64-w64-mingw32/include/sal.h - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/servprov.h - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/stralign.h - C:/mingw64/x86_64-w64-mingw32/include/string.h - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h - C:/mingw64/x86_64-w64-mingw32/include/tvout.h - C:/mingw64/x86_64-w64-mingw32/include/unistd.h - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h - C:/mingw64/x86_64-w64-mingw32/include/winbase.h - C:/mingw64/x86_64-w64-mingw32/include/wincon.h - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h - C:/mingw64/x86_64-w64-mingw32/include/windef.h - C:/mingw64/x86_64-w64-mingw32/include/windows.h - C:/mingw64/x86_64-w64-mingw32/include/winefs.h - C:/mingw64/x86_64-w64-mingw32/include/winerror.h - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h - C:/mingw64/x86_64-w64-mingw32/include/winnls.h - C:/mingw64/x86_64-w64-mingw32/include/winnt.h - C:/mingw64/x86_64-w64-mingw32/include/winperf.h - C:/mingw64/x86_64-w64-mingw32/include/winreg.h - C:/mingw64/x86_64-w64-mingw32/include/winscard.h - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h - C:/mingw64/x86_64-w64-mingw32/include/winsock.h - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h - C:/mingw64/x86_64-w64-mingw32/include/winspool.h - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h - C:/mingw64/x86_64-w64-mingw32/include/winuser.h - C:/mingw64/x86_64-w64-mingw32/include/winver.h - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/arch.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/big_B256_56.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/big_B384_56.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/big_B448_58.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/big_B512_60.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_big_B256_56.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_big_B384_56.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_big_B448_58.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_big_B512_60.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_C25519.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_Ed25519.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_Ed448.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_NIST256.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_NIST384.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_ff_RSA2048.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_ff_RSA4096.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_field_F25519.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_field_F448.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_field_NIST256.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_field_NIST384.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/core.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecdh_C25519.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecdh_NIST256.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecdh_NIST384.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_C25519.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_Ed25519.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_Ed448.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_NIST256.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_NIST384.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/eddsa_Ed25519.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/eddsa_Ed448.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ff_RSA2048.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ff_RSA4096.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp_F25519.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp_F448.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp_NIST256.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp_NIST384.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/rsa_RSA2048.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/rsa_RSA4096.h - -CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_sockets.cpp - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/afunix.h - C:/mingw64/x86_64-w64-mingw32/include/apiset.h - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h - C:/mingw64/x86_64-w64-mingw32/include/cderr.h - C:/mingw64/x86_64-w64-mingw32/include/cguid.h - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/ctype.h - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h - C:/mingw64/x86_64-w64-mingw32/include/dde.h - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/excpt.h - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h - C:/mingw64/x86_64-w64-mingw32/include/getopt.h - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h - C:/mingw64/x86_64-w64-mingw32/include/imm.h - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h - C:/mingw64/x86_64-w64-mingw32/include/io.h - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h - C:/mingw64/x86_64-w64-mingw32/include/mcx.h - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h - C:/mingw64/x86_64-w64-mingw32/include/msxml.h - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h - C:/mingw64/x86_64-w64-mingw32/include/nb30.h - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h - C:/mingw64/x86_64-w64-mingw32/include/objbase.h - C:/mingw64/x86_64-w64-mingw32/include/objidl.h - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h - C:/mingw64/x86_64-w64-mingw32/include/ole2.h - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h - C:/mingw64/x86_64-w64-mingw32/include/poppack.h - C:/mingw64/x86_64-w64-mingw32/include/process.h - C:/mingw64/x86_64-w64-mingw32/include/processenv.h - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h - C:/mingw64/x86_64-w64-mingw32/include/propidl.h - C:/mingw64/x86_64-w64-mingw32/include/prsht.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h - C:/mingw64/x86_64-w64-mingw32/include/qos.h - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h - C:/mingw64/x86_64-w64-mingw32/include/reason.h - C:/mingw64/x86_64-w64-mingw32/include/rpc.h - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h - C:/mingw64/x86_64-w64-mingw32/include/sal.h - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/servprov.h - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/stralign.h - C:/mingw64/x86_64-w64-mingw32/include/string.h - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h - C:/mingw64/x86_64-w64-mingw32/include/tvout.h - C:/mingw64/x86_64-w64-mingw32/include/unistd.h - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h - C:/mingw64/x86_64-w64-mingw32/include/winbase.h - C:/mingw64/x86_64-w64-mingw32/include/wincon.h - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h - C:/mingw64/x86_64-w64-mingw32/include/windef.h - C:/mingw64/x86_64-w64-mingw32/include/windows.h - C:/mingw64/x86_64-w64-mingw32/include/winefs.h - C:/mingw64/x86_64-w64-mingw32/include/winerror.h - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h - C:/mingw64/x86_64-w64-mingw32/include/winnls.h - C:/mingw64/x86_64-w64-mingw32/include/winnt.h - C:/mingw64/x86_64-w64-mingw32/include/winperf.h - C:/mingw64/x86_64-w64-mingw32/include/winreg.h - C:/mingw64/x86_64-w64-mingw32/include/winscard.h - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h - C:/mingw64/x86_64-w64-mingw32/include/winsock.h - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h - C:/mingw64/x86_64-w64-mingw32/include/winspool.h - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h - C:/mingw64/x86_64-w64-mingw32/include/winuser.h - C:/mingw64/x86_64-w64-mingw32/include/winver.h - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_tickets.cpp - C:/mingw64/include/c++/13.2.0/bits/std_abs.h - C:/mingw64/include/c++/13.2.0/cstdlib - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h - C:/mingw64/include/c++/13.2.0/stdlib.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h - C:/mingw64/x86_64-w64-mingw32/include/afunix.h - C:/mingw64/x86_64-w64-mingw32/include/apiset.h - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h - C:/mingw64/x86_64-w64-mingw32/include/cderr.h - C:/mingw64/x86_64-w64-mingw32/include/cguid.h - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/ctype.h - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h - C:/mingw64/x86_64-w64-mingw32/include/dde.h - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h - C:/mingw64/x86_64-w64-mingw32/include/errno.h - C:/mingw64/x86_64-w64-mingw32/include/excpt.h - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h - C:/mingw64/x86_64-w64-mingw32/include/getopt.h - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h - C:/mingw64/x86_64-w64-mingw32/include/imm.h - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h - C:/mingw64/x86_64-w64-mingw32/include/io.h - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h - C:/mingw64/x86_64-w64-mingw32/include/limits.h - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h - C:/mingw64/x86_64-w64-mingw32/include/malloc.h - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h - C:/mingw64/x86_64-w64-mingw32/include/mcx.h - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h - C:/mingw64/x86_64-w64-mingw32/include/msxml.h - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h - C:/mingw64/x86_64-w64-mingw32/include/nb30.h - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h - C:/mingw64/x86_64-w64-mingw32/include/objbase.h - C:/mingw64/x86_64-w64-mingw32/include/objidl.h - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h - C:/mingw64/x86_64-w64-mingw32/include/ole2.h - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h - C:/mingw64/x86_64-w64-mingw32/include/poppack.h - C:/mingw64/x86_64-w64-mingw32/include/process.h - C:/mingw64/x86_64-w64-mingw32/include/processenv.h - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h - C:/mingw64/x86_64-w64-mingw32/include/propidl.h - C:/mingw64/x86_64-w64-mingw32/include/prsht.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h - C:/mingw64/x86_64-w64-mingw32/include/qos.h - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h - C:/mingw64/x86_64-w64-mingw32/include/reason.h - C:/mingw64/x86_64-w64-mingw32/include/rpc.h - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h - C:/mingw64/x86_64-w64-mingw32/include/sal.h - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h - C:/mingw64/x86_64-w64-mingw32/include/servprov.h - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdint.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h - C:/mingw64/x86_64-w64-mingw32/include/stralign.h - C:/mingw64/x86_64-w64-mingw32/include/string.h - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h - C:/mingw64/x86_64-w64-mingw32/include/time.h - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h - C:/mingw64/x86_64-w64-mingw32/include/tvout.h - C:/mingw64/x86_64-w64-mingw32/include/unistd.h - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h - C:/mingw64/x86_64-w64-mingw32/include/winbase.h - C:/mingw64/x86_64-w64-mingw32/include/wincon.h - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h - C:/mingw64/x86_64-w64-mingw32/include/windef.h - C:/mingw64/x86_64-w64-mingw32/include/windows.h - C:/mingw64/x86_64-w64-mingw32/include/winefs.h - C:/mingw64/x86_64-w64-mingw32/include/winerror.h - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h - C:/mingw64/x86_64-w64-mingw32/include/winnls.h - C:/mingw64/x86_64-w64-mingw32/include/winnt.h - C:/mingw64/x86_64-w64-mingw32/include/winperf.h - C:/mingw64/x86_64-w64-mingw32/include/winreg.h - C:/mingw64/x86_64-w64-mingw32/include/winscard.h - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h - C:/mingw64/x86_64-w64-mingw32/include/winsock.h - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h - C:/mingw64/x86_64-w64-mingw32/include/winspool.h - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h - C:/mingw64/x86_64-w64-mingw32/include/winuser.h - C:/mingw64/x86_64-w64-mingw32/include/winver.h - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_tickets.h - -CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/lib/tls_x509.cpp - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h - C:/mingw64/x86_64-w64-mingw32/include/stddef.h - C:/mingw64/x86_64-w64-mingw32/include/stdio.h - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/compiler_depend.make b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/compiler_depend.make index 5299f90..c6adfcb 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/compiler_depend.make +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/compiler_depend.make @@ -1,4639 +1,2 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "MinGW Makefiles" Generator, CMake Version 3.28 - -CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj: lib/ibe/tls_bfibe.cpp \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/inttypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/string.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - include/tls_bfibe.h \ - sal/miracl/includes/arch.h \ - sal/miracl/includes/big_B384_58.h \ - sal/miracl/includes/config_big_B384_58.h \ - sal/miracl/includes/config_curve_BLS12381.h \ - sal/miracl/includes/config_field_BLS12381.h \ - sal/miracl/includes/core.h \ - sal/miracl/includes/ecp2_BLS12381.h \ - sal/miracl/includes/ecp_BLS12381.h \ - sal/miracl/includes/fp12_BLS12381.h \ - sal/miracl/includes/fp2_BLS12381.h \ - sal/miracl/includes/fp4_BLS12381.h \ - sal/miracl/includes/fp_BLS12381.h \ - sal/miracl/includes/pair_BLS12381.h \ - sal/miracl/includes/randapi.h - -CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj: lib/ibe/tls_pqibe.cpp \ - C:/mingw64/include/c++/13.2.0/backward/binders.h \ - C:/mingw64/include/c++/13.2.0/bit \ - C:/mingw64/include/c++/13.2.0/bits/alloc_traits.h \ - C:/mingw64/include/c++/13.2.0/bits/allocator.h \ - C:/mingw64/include/c++/13.2.0/bits/basic_ios.h \ - C:/mingw64/include/c++/13.2.0/bits/basic_ios.tcc \ - C:/mingw64/include/c++/13.2.0/bits/basic_string.h \ - C:/mingw64/include/c++/13.2.0/bits/basic_string.tcc \ - C:/mingw64/include/c++/13.2.0/bits/char_traits.h \ - C:/mingw64/include/c++/13.2.0/bits/charconv.h \ - C:/mingw64/include/c++/13.2.0/bits/concept_check.h \ - C:/mingw64/include/c++/13.2.0/bits/cpp_type_traits.h \ - C:/mingw64/include/c++/13.2.0/bits/cxxabi_forced.h \ - C:/mingw64/include/c++/13.2.0/bits/cxxabi_init_exception.h \ - C:/mingw64/include/c++/13.2.0/bits/exception.h \ - C:/mingw64/include/c++/13.2.0/bits/exception_defines.h \ - C:/mingw64/include/c++/13.2.0/bits/exception_ptr.h \ - C:/mingw64/include/c++/13.2.0/bits/functexcept.h \ - C:/mingw64/include/c++/13.2.0/bits/functional_hash.h \ - C:/mingw64/include/c++/13.2.0/bits/hash_bytes.h \ - C:/mingw64/include/c++/13.2.0/bits/invoke.h \ - C:/mingw64/include/c++/13.2.0/bits/ios_base.h \ - C:/mingw64/include/c++/13.2.0/bits/istream.tcc \ - C:/mingw64/include/c++/13.2.0/bits/locale_classes.h \ - C:/mingw64/include/c++/13.2.0/bits/locale_classes.tcc \ - C:/mingw64/include/c++/13.2.0/bits/locale_facets.h \ - C:/mingw64/include/c++/13.2.0/bits/locale_facets.tcc \ - C:/mingw64/include/c++/13.2.0/bits/localefwd.h \ - C:/mingw64/include/c++/13.2.0/bits/memory_resource.h \ - C:/mingw64/include/c++/13.2.0/bits/memoryfwd.h \ - C:/mingw64/include/c++/13.2.0/bits/move.h \ - C:/mingw64/include/c++/13.2.0/bits/nested_exception.h \ - C:/mingw64/include/c++/13.2.0/bits/new_allocator.h \ - C:/mingw64/include/c++/13.2.0/bits/ostream.tcc \ - C:/mingw64/include/c++/13.2.0/bits/ostream_insert.h \ - C:/mingw64/include/c++/13.2.0/bits/postypes.h \ - C:/mingw64/include/c++/13.2.0/bits/predefined_ops.h \ - C:/mingw64/include/c++/13.2.0/bits/ptr_traits.h \ - C:/mingw64/include/c++/13.2.0/bits/range_access.h \ - C:/mingw64/include/c++/13.2.0/bits/refwrap.h \ - C:/mingw64/include/c++/13.2.0/bits/requires_hosted.h \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/bits/stl_algobase.h \ - C:/mingw64/include/c++/13.2.0/bits/stl_construct.h \ - C:/mingw64/include/c++/13.2.0/bits/stl_function.h \ - C:/mingw64/include/c++/13.2.0/bits/stl_iterator.h \ - C:/mingw64/include/c++/13.2.0/bits/stl_iterator_base_funcs.h \ - C:/mingw64/include/c++/13.2.0/bits/stl_iterator_base_types.h \ - C:/mingw64/include/c++/13.2.0/bits/stl_pair.h \ - C:/mingw64/include/c++/13.2.0/bits/streambuf.tcc \ - C:/mingw64/include/c++/13.2.0/bits/streambuf_iterator.h \ - C:/mingw64/include/c++/13.2.0/bits/string_view.tcc \ - C:/mingw64/include/c++/13.2.0/bits/stringfwd.h \ - C:/mingw64/include/c++/13.2.0/bits/uses_allocator.h \ - C:/mingw64/include/c++/13.2.0/bits/uses_allocator_args.h \ - C:/mingw64/include/c++/13.2.0/bits/utility.h \ - C:/mingw64/include/c++/13.2.0/cctype \ - C:/mingw64/include/c++/13.2.0/cerrno \ - C:/mingw64/include/c++/13.2.0/clocale \ - C:/mingw64/include/c++/13.2.0/cstddef \ - C:/mingw64/include/c++/13.2.0/cstdint \ - C:/mingw64/include/c++/13.2.0/cstdio \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/cwchar \ - C:/mingw64/include/c++/13.2.0/cwctype \ - C:/mingw64/include/c++/13.2.0/debug/assertions.h \ - C:/mingw64/include/c++/13.2.0/debug/debug.h \ - C:/mingw64/include/c++/13.2.0/exception \ - C:/mingw64/include/c++/13.2.0/ext/alloc_traits.h \ - C:/mingw64/include/c++/13.2.0/ext/atomicity.h \ - C:/mingw64/include/c++/13.2.0/ext/numeric_traits.h \ - C:/mingw64/include/c++/13.2.0/ext/string_conversions.h \ - C:/mingw64/include/c++/13.2.0/ext/type_traits.h \ - C:/mingw64/include/c++/13.2.0/initializer_list \ - C:/mingw64/include/c++/13.2.0/ios \ - C:/mingw64/include/c++/13.2.0/iosfwd \ - C:/mingw64/include/c++/13.2.0/iostream \ - C:/mingw64/include/c++/13.2.0/istream \ - C:/mingw64/include/c++/13.2.0/new \ - C:/mingw64/include/c++/13.2.0/ostream \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdexcept \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/streambuf \ - C:/mingw64/include/c++/13.2.0/string \ - C:/mingw64/include/c++/13.2.0/string_view \ - C:/mingw64/include/c++/13.2.0/system_error \ - C:/mingw64/include/c++/13.2.0/tuple \ - C:/mingw64/include/c++/13.2.0/type_traits \ - C:/mingw64/include/c++/13.2.0/typeinfo \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/atomic_word.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++allocator.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++locale.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/ctype_base.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/ctype_inline.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/error_constants.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/gthr-default.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/gthr.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stat64.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/ctype.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/locale.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/process.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_compat.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_signal.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/wchar_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/signal.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/wchar.h \ - C:/mingw64/x86_64-w64-mingw32/include/wctype.h \ - include/tls_pqibe.h \ - sal/miracl/includes/arch.h \ - sal/miracl/includes/core.h - -CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj: lib/tls_cacerts.cpp \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h \ - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/afunix.h \ - C:/mingw64/x86_64-w64-mingw32/include/apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h \ - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h \ - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/cderr.h \ - C:/mingw64/x86_64-w64-mingw32/include/cguid.h \ - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h \ - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/ctype.h \ - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dde.h \ - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h \ - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h \ - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h \ - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/excpt.h \ - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/getopt.h \ - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/imm.h \ - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h \ - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h \ - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/io.h \ - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mcx.h \ - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h \ - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/msxml.h \ - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/nb30.h \ - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/ole2.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/poppack.h \ - C:/mingw64/x86_64-w64-mingw32/include/process.h \ - C:/mingw64/x86_64-w64-mingw32/include/processenv.h \ - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/propidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/prsht.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/qos.h \ - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/reason.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpc.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h \ - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/servprov.h \ - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/stralign.h \ - C:/mingw64/x86_64-w64-mingw32/include/string.h \ - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h \ - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/tvout.h \ - C:/mingw64/x86_64-w64-mingw32/include/unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h \ - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h \ - C:/mingw64/x86_64-w64-mingw32/include/winbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincon.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/windef.h \ - C:/mingw64/x86_64-w64-mingw32/include/windows.h \ - C:/mingw64/x86_64-w64-mingw32/include/winefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/winerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h \ - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnls.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnt.h \ - C:/mingw64/x86_64-w64-mingw32/include/winperf.h \ - C:/mingw64/x86_64-w64-mingw32/include/winreg.h \ - C:/mingw64/x86_64-w64-mingw32/include/winscard.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ - C:/mingw64/x86_64-w64-mingw32/include/winspool.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h \ - C:/mingw64/x86_64-w64-mingw32/include/winuser.h \ - C:/mingw64/x86_64-w64-mingw32/include/winver.h \ - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h \ - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h \ - include/tls1_3.h \ - include/tls_certs.h \ - include/tls_octads.h \ - include/tls_sockets.h - -CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj: lib/tls_cert_chain.cpp \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h \ - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/afunix.h \ - C:/mingw64/x86_64-w64-mingw32/include/apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h \ - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h \ - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/cderr.h \ - C:/mingw64/x86_64-w64-mingw32/include/cguid.h \ - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h \ - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/ctype.h \ - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dde.h \ - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h \ - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h \ - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h \ - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/excpt.h \ - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/getopt.h \ - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/imm.h \ - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h \ - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h \ - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/io.h \ - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mcx.h \ - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h \ - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/msxml.h \ - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/nb30.h \ - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/ole2.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/poppack.h \ - C:/mingw64/x86_64-w64-mingw32/include/process.h \ - C:/mingw64/x86_64-w64-mingw32/include/processenv.h \ - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/propidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/prsht.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/qos.h \ - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/reason.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpc.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h \ - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/servprov.h \ - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/stralign.h \ - C:/mingw64/x86_64-w64-mingw32/include/string.h \ - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h \ - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/tvout.h \ - C:/mingw64/x86_64-w64-mingw32/include/unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h \ - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h \ - C:/mingw64/x86_64-w64-mingw32/include/winbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincon.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/windef.h \ - C:/mingw64/x86_64-w64-mingw32/include/windows.h \ - C:/mingw64/x86_64-w64-mingw32/include/winefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/winerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h \ - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnls.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnt.h \ - C:/mingw64/x86_64-w64-mingw32/include/winperf.h \ - C:/mingw64/x86_64-w64-mingw32/include/winreg.h \ - C:/mingw64/x86_64-w64-mingw32/include/winscard.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ - C:/mingw64/x86_64-w64-mingw32/include/winspool.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h \ - C:/mingw64/x86_64-w64-mingw32/include/winuser.h \ - C:/mingw64/x86_64-w64-mingw32/include/winver.h \ - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h \ - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h \ - include/tls1_3.h \ - include/tls_cert_chain.h \ - include/tls_certs.h \ - include/tls_client_recv.h \ - include/tls_client_send.h \ - include/tls_keys_calc.h \ - include/tls_logger.h \ - include/tls_octads.h \ - include/tls_sal.h \ - include/tls_sockets.h \ - include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj: lib/tls_client_cert.cpp \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h \ - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/afunix.h \ - C:/mingw64/x86_64-w64-mingw32/include/apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h \ - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h \ - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/cderr.h \ - C:/mingw64/x86_64-w64-mingw32/include/cguid.h \ - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h \ - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/ctype.h \ - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dde.h \ - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h \ - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h \ - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h \ - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/excpt.h \ - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/getopt.h \ - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/imm.h \ - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h \ - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h \ - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/io.h \ - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mcx.h \ - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h \ - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/msxml.h \ - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/nb30.h \ - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/ole2.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/poppack.h \ - C:/mingw64/x86_64-w64-mingw32/include/process.h \ - C:/mingw64/x86_64-w64-mingw32/include/processenv.h \ - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/propidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/prsht.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/qos.h \ - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/reason.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpc.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h \ - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/servprov.h \ - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/stralign.h \ - C:/mingw64/x86_64-w64-mingw32/include/string.h \ - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h \ - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/tvout.h \ - C:/mingw64/x86_64-w64-mingw32/include/unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h \ - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h \ - C:/mingw64/x86_64-w64-mingw32/include/winbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincon.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/windef.h \ - C:/mingw64/x86_64-w64-mingw32/include/windows.h \ - C:/mingw64/x86_64-w64-mingw32/include/winefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/winerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h \ - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnls.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnt.h \ - C:/mingw64/x86_64-w64-mingw32/include/winperf.h \ - C:/mingw64/x86_64-w64-mingw32/include/winreg.h \ - C:/mingw64/x86_64-w64-mingw32/include/winscard.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ - C:/mingw64/x86_64-w64-mingw32/include/winspool.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h \ - C:/mingw64/x86_64-w64-mingw32/include/winuser.h \ - C:/mingw64/x86_64-w64-mingw32/include/winver.h \ - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h \ - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h \ - include/tls1_3.h \ - include/tls_certs.h \ - include/tls_octads.h \ - include/tls_sockets.h - -CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj: lib/tls_client_recv.cpp \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h \ - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/afunix.h \ - C:/mingw64/x86_64-w64-mingw32/include/apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h \ - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h \ - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/cderr.h \ - C:/mingw64/x86_64-w64-mingw32/include/cguid.h \ - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h \ - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/ctype.h \ - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dde.h \ - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h \ - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h \ - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h \ - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/excpt.h \ - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/getopt.h \ - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/imm.h \ - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h \ - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h \ - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/io.h \ - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mcx.h \ - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h \ - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/msxml.h \ - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/nb30.h \ - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/ole2.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/poppack.h \ - C:/mingw64/x86_64-w64-mingw32/include/process.h \ - C:/mingw64/x86_64-w64-mingw32/include/processenv.h \ - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/propidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/prsht.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/qos.h \ - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/reason.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpc.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h \ - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/servprov.h \ - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/stralign.h \ - C:/mingw64/x86_64-w64-mingw32/include/string.h \ - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h \ - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/tvout.h \ - C:/mingw64/x86_64-w64-mingw32/include/unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h \ - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h \ - C:/mingw64/x86_64-w64-mingw32/include/winbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincon.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/windef.h \ - C:/mingw64/x86_64-w64-mingw32/include/windows.h \ - C:/mingw64/x86_64-w64-mingw32/include/winefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/winerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h \ - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnls.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnt.h \ - C:/mingw64/x86_64-w64-mingw32/include/winperf.h \ - C:/mingw64/x86_64-w64-mingw32/include/winreg.h \ - C:/mingw64/x86_64-w64-mingw32/include/winscard.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ - C:/mingw64/x86_64-w64-mingw32/include/winspool.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h \ - C:/mingw64/x86_64-w64-mingw32/include/winuser.h \ - C:/mingw64/x86_64-w64-mingw32/include/winver.h \ - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h \ - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h \ - include/tls1_3.h \ - include/tls_cert_chain.h \ - include/tls_certs.h \ - include/tls_client_recv.h \ - include/tls_client_send.h \ - include/tls_keys_calc.h \ - include/tls_logger.h \ - include/tls_octads.h \ - include/tls_sal.h \ - include/tls_sockets.h \ - include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj: lib/tls_client_send.cpp \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h \ - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/afunix.h \ - C:/mingw64/x86_64-w64-mingw32/include/apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h \ - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h \ - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/cderr.h \ - C:/mingw64/x86_64-w64-mingw32/include/cguid.h \ - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h \ - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/ctype.h \ - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dde.h \ - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h \ - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h \ - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h \ - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/excpt.h \ - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/getopt.h \ - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/imm.h \ - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h \ - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h \ - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/io.h \ - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mcx.h \ - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h \ - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/msxml.h \ - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/nb30.h \ - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/ole2.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/poppack.h \ - C:/mingw64/x86_64-w64-mingw32/include/process.h \ - C:/mingw64/x86_64-w64-mingw32/include/processenv.h \ - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/propidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/prsht.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/qos.h \ - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/reason.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpc.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h \ - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/servprov.h \ - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/stralign.h \ - C:/mingw64/x86_64-w64-mingw32/include/string.h \ - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h \ - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/tvout.h \ - C:/mingw64/x86_64-w64-mingw32/include/unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h \ - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h \ - C:/mingw64/x86_64-w64-mingw32/include/winbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincon.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/windef.h \ - C:/mingw64/x86_64-w64-mingw32/include/windows.h \ - C:/mingw64/x86_64-w64-mingw32/include/winefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/winerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h \ - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnls.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnt.h \ - C:/mingw64/x86_64-w64-mingw32/include/winperf.h \ - C:/mingw64/x86_64-w64-mingw32/include/winreg.h \ - C:/mingw64/x86_64-w64-mingw32/include/winscard.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ - C:/mingw64/x86_64-w64-mingw32/include/winspool.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h \ - C:/mingw64/x86_64-w64-mingw32/include/winuser.h \ - C:/mingw64/x86_64-w64-mingw32/include/winver.h \ - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h \ - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h \ - include/tls1_3.h \ - include/tls_certs.h \ - include/tls_client_recv.h \ - include/tls_client_send.h \ - include/tls_keys_calc.h \ - include/tls_logger.h \ - include/tls_octads.h \ - include/tls_sal.h \ - include/tls_sockets.h \ - include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj: lib/tls_keys_calc.cpp \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h \ - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/afunix.h \ - C:/mingw64/x86_64-w64-mingw32/include/apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h \ - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h \ - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/cderr.h \ - C:/mingw64/x86_64-w64-mingw32/include/cguid.h \ - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h \ - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/ctype.h \ - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dde.h \ - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h \ - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h \ - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h \ - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/excpt.h \ - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/getopt.h \ - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/imm.h \ - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h \ - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h \ - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/io.h \ - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mcx.h \ - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h \ - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/msxml.h \ - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/nb30.h \ - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/ole2.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/poppack.h \ - C:/mingw64/x86_64-w64-mingw32/include/process.h \ - C:/mingw64/x86_64-w64-mingw32/include/processenv.h \ - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/propidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/prsht.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/qos.h \ - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/reason.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpc.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h \ - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/servprov.h \ - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/stralign.h \ - C:/mingw64/x86_64-w64-mingw32/include/string.h \ - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h \ - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/tvout.h \ - C:/mingw64/x86_64-w64-mingw32/include/unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h \ - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h \ - C:/mingw64/x86_64-w64-mingw32/include/winbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincon.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/windef.h \ - C:/mingw64/x86_64-w64-mingw32/include/windows.h \ - C:/mingw64/x86_64-w64-mingw32/include/winefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/winerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h \ - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnls.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnt.h \ - C:/mingw64/x86_64-w64-mingw32/include/winperf.h \ - C:/mingw64/x86_64-w64-mingw32/include/winreg.h \ - C:/mingw64/x86_64-w64-mingw32/include/winscard.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ - C:/mingw64/x86_64-w64-mingw32/include/winspool.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h \ - C:/mingw64/x86_64-w64-mingw32/include/winuser.h \ - C:/mingw64/x86_64-w64-mingw32/include/winver.h \ - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h \ - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h \ - include/tls1_3.h \ - include/tls_client_recv.h \ - include/tls_client_send.h \ - include/tls_keys_calc.h \ - include/tls_logger.h \ - include/tls_octads.h \ - include/tls_sal.h \ - include/tls_sockets.h \ - include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj: lib/tls_logger.cpp \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h \ - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/afunix.h \ - C:/mingw64/x86_64-w64-mingw32/include/apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h \ - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h \ - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/cderr.h \ - C:/mingw64/x86_64-w64-mingw32/include/cguid.h \ - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h \ - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/ctype.h \ - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dde.h \ - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h \ - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h \ - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h \ - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/excpt.h \ - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/getopt.h \ - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/imm.h \ - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h \ - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h \ - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/io.h \ - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mcx.h \ - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h \ - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/msxml.h \ - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/nb30.h \ - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/ole2.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/poppack.h \ - C:/mingw64/x86_64-w64-mingw32/include/process.h \ - C:/mingw64/x86_64-w64-mingw32/include/processenv.h \ - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/propidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/prsht.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/qos.h \ - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/reason.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpc.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h \ - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/servprov.h \ - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/stralign.h \ - C:/mingw64/x86_64-w64-mingw32/include/string.h \ - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h \ - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/tvout.h \ - C:/mingw64/x86_64-w64-mingw32/include/unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h \ - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h \ - C:/mingw64/x86_64-w64-mingw32/include/winbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincon.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/windef.h \ - C:/mingw64/x86_64-w64-mingw32/include/windows.h \ - C:/mingw64/x86_64-w64-mingw32/include/winefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/winerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h \ - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnls.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnt.h \ - C:/mingw64/x86_64-w64-mingw32/include/winperf.h \ - C:/mingw64/x86_64-w64-mingw32/include/winreg.h \ - C:/mingw64/x86_64-w64-mingw32/include/winscard.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ - C:/mingw64/x86_64-w64-mingw32/include/winspool.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h \ - C:/mingw64/x86_64-w64-mingw32/include/winuser.h \ - C:/mingw64/x86_64-w64-mingw32/include/winver.h \ - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h \ - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h \ - include/tls1_3.h \ - include/tls_logger.h \ - include/tls_octads.h \ - include/tls_sockets.h \ - include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj: lib/tls_octads.cpp \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - include/tls_octads.h - -CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj: lib/tls_protocol.cpp \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h \ - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/afunix.h \ - C:/mingw64/x86_64-w64-mingw32/include/apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h \ - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h \ - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/cderr.h \ - C:/mingw64/x86_64-w64-mingw32/include/cguid.h \ - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h \ - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/ctype.h \ - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dde.h \ - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h \ - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h \ - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h \ - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/excpt.h \ - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/getopt.h \ - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/imm.h \ - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h \ - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h \ - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/io.h \ - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mcx.h \ - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h \ - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/msxml.h \ - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/nb30.h \ - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/ole2.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/poppack.h \ - C:/mingw64/x86_64-w64-mingw32/include/process.h \ - C:/mingw64/x86_64-w64-mingw32/include/processenv.h \ - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/propidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/prsht.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/qos.h \ - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/reason.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpc.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h \ - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/servprov.h \ - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/stralign.h \ - C:/mingw64/x86_64-w64-mingw32/include/string.h \ - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h \ - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/tvout.h \ - C:/mingw64/x86_64-w64-mingw32/include/unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h \ - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h \ - C:/mingw64/x86_64-w64-mingw32/include/winbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincon.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/windef.h \ - C:/mingw64/x86_64-w64-mingw32/include/windows.h \ - C:/mingw64/x86_64-w64-mingw32/include/winefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/winerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h \ - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnls.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnt.h \ - C:/mingw64/x86_64-w64-mingw32/include/winperf.h \ - C:/mingw64/x86_64-w64-mingw32/include/winreg.h \ - C:/mingw64/x86_64-w64-mingw32/include/winscard.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ - C:/mingw64/x86_64-w64-mingw32/include/winspool.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h \ - C:/mingw64/x86_64-w64-mingw32/include/winuser.h \ - C:/mingw64/x86_64-w64-mingw32/include/winver.h \ - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h \ - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h \ - include/tls1_3.h \ - include/tls_cert_chain.h \ - include/tls_certs.h \ - include/tls_client_recv.h \ - include/tls_client_send.h \ - include/tls_keys_calc.h \ - include/tls_logger.h \ - include/tls_octads.h \ - include/tls_protocol.h \ - include/tls_sal.h \ - include/tls_sockets.h \ - include/tls_tickets.h \ - include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj: lib/tls_sal.cpp \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/include/oqs/common.h \ - C:/mingw64/include/oqs/kem.h \ - C:/mingw64/include/oqs/kem_classic_mceliece.h \ - C:/mingw64/include/oqs/kem_frodokem.h \ - C:/mingw64/include/oqs/kem_hqc.h \ - C:/mingw64/include/oqs/kem_kyber.h \ - C:/mingw64/include/oqs/kem_ml_kem.h \ - C:/mingw64/include/oqs/kem_ntruprime.h \ - C:/mingw64/include/oqs/oqs.h \ - C:/mingw64/include/oqs/oqsconfig.h \ - C:/mingw64/include/oqs/rand.h \ - C:/mingw64/include/oqs/sig.h \ - C:/mingw64/include/oqs/sig_dilithium.h \ - C:/mingw64/include/oqs/sig_falcon.h \ - C:/mingw64/include/oqs/sig_ml_dsa.h \ - C:/mingw64/include/oqs/sig_sphincs.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h \ - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/afunix.h \ - C:/mingw64/x86_64-w64-mingw32/include/apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h \ - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h \ - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/cderr.h \ - C:/mingw64/x86_64-w64-mingw32/include/cguid.h \ - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h \ - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/ctype.h \ - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dde.h \ - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h \ - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h \ - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h \ - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/excpt.h \ - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/getopt.h \ - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/imm.h \ - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h \ - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h \ - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/inttypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/io.h \ - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mcx.h \ - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h \ - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/msxml.h \ - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/nb30.h \ - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/ole2.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/poppack.h \ - C:/mingw64/x86_64-w64-mingw32/include/process.h \ - C:/mingw64/x86_64-w64-mingw32/include/processenv.h \ - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/propidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/prsht.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/qos.h \ - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/reason.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpc.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h \ - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/servprov.h \ - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/stralign.h \ - C:/mingw64/x86_64-w64-mingw32/include/string.h \ - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h \ - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/tvout.h \ - C:/mingw64/x86_64-w64-mingw32/include/unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h \ - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h \ - C:/mingw64/x86_64-w64-mingw32/include/winbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincon.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/windef.h \ - C:/mingw64/x86_64-w64-mingw32/include/windows.h \ - C:/mingw64/x86_64-w64-mingw32/include/winefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/winerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h \ - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnls.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnt.h \ - C:/mingw64/x86_64-w64-mingw32/include/winperf.h \ - C:/mingw64/x86_64-w64-mingw32/include/winreg.h \ - C:/mingw64/x86_64-w64-mingw32/include/winscard.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ - C:/mingw64/x86_64-w64-mingw32/include/winspool.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h \ - C:/mingw64/x86_64-w64-mingw32/include/winuser.h \ - C:/mingw64/x86_64-w64-mingw32/include/winver.h \ - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h \ - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h \ - include/tls1_3.h \ - include/tls_octads.h \ - include/tls_sal.h \ - include/tls_sockets.h \ - sal/miracl/includes/arch.h \ - sal/miracl/includes/big_B256_56.h \ - sal/miracl/includes/big_B384_56.h \ - sal/miracl/includes/big_B448_58.h \ - sal/miracl/includes/big_B512_60.h \ - sal/miracl/includes/config_big_B256_56.h \ - sal/miracl/includes/config_big_B384_56.h \ - sal/miracl/includes/config_big_B448_58.h \ - sal/miracl/includes/config_big_B512_60.h \ - sal/miracl/includes/config_curve_C25519.h \ - sal/miracl/includes/config_curve_Ed25519.h \ - sal/miracl/includes/config_curve_Ed448.h \ - sal/miracl/includes/config_curve_NIST256.h \ - sal/miracl/includes/config_curve_NIST384.h \ - sal/miracl/includes/config_ff_RSA2048.h \ - sal/miracl/includes/config_ff_RSA4096.h \ - sal/miracl/includes/config_field_F25519.h \ - sal/miracl/includes/config_field_F448.h \ - sal/miracl/includes/config_field_NIST256.h \ - sal/miracl/includes/config_field_NIST384.h \ - sal/miracl/includes/core.h \ - sal/miracl/includes/ecdh_C25519.h \ - sal/miracl/includes/ecdh_NIST256.h \ - sal/miracl/includes/ecdh_NIST384.h \ - sal/miracl/includes/ecp_C25519.h \ - sal/miracl/includes/ecp_Ed25519.h \ - sal/miracl/includes/ecp_Ed448.h \ - sal/miracl/includes/ecp_NIST256.h \ - sal/miracl/includes/ecp_NIST384.h \ - sal/miracl/includes/eddsa_Ed25519.h \ - sal/miracl/includes/eddsa_Ed448.h \ - sal/miracl/includes/ff_RSA2048.h \ - sal/miracl/includes/ff_RSA4096.h \ - sal/miracl/includes/fp_F25519.h \ - sal/miracl/includes/fp_F448.h \ - sal/miracl/includes/fp_NIST256.h \ - sal/miracl/includes/fp_NIST384.h \ - sal/miracl/includes/rsa_RSA2048.h \ - sal/miracl/includes/rsa_RSA4096.h - -CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj: lib/tls_sockets.cpp \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h \ - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/afunix.h \ - C:/mingw64/x86_64-w64-mingw32/include/apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h \ - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h \ - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/cderr.h \ - C:/mingw64/x86_64-w64-mingw32/include/cguid.h \ - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h \ - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/ctype.h \ - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dde.h \ - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h \ - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h \ - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h \ - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/excpt.h \ - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/getopt.h \ - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/imm.h \ - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h \ - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h \ - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/io.h \ - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mcx.h \ - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h \ - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/msxml.h \ - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/nb30.h \ - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/ole2.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/poppack.h \ - C:/mingw64/x86_64-w64-mingw32/include/process.h \ - C:/mingw64/x86_64-w64-mingw32/include/processenv.h \ - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/propidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/prsht.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/qos.h \ - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/reason.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpc.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h \ - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/servprov.h \ - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/stralign.h \ - C:/mingw64/x86_64-w64-mingw32/include/string.h \ - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h \ - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/tvout.h \ - C:/mingw64/x86_64-w64-mingw32/include/unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h \ - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h \ - C:/mingw64/x86_64-w64-mingw32/include/winbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincon.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/windef.h \ - C:/mingw64/x86_64-w64-mingw32/include/windows.h \ - C:/mingw64/x86_64-w64-mingw32/include/winefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/winerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h \ - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnls.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnt.h \ - C:/mingw64/x86_64-w64-mingw32/include/winperf.h \ - C:/mingw64/x86_64-w64-mingw32/include/winreg.h \ - C:/mingw64/x86_64-w64-mingw32/include/winscard.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ - C:/mingw64/x86_64-w64-mingw32/include/winspool.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h \ - C:/mingw64/x86_64-w64-mingw32/include/winuser.h \ - C:/mingw64/x86_64-w64-mingw32/include/winver.h \ - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h \ - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h \ - include/tls1_3.h \ - include/tls_logger.h \ - include/tls_octads.h \ - include/tls_sockets.h \ - include/tls_x509.h - -CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj: lib/tls_tickets.cpp \ - C:/mingw64/include/c++/13.2.0/bits/std_abs.h \ - C:/mingw64/include/c++/13.2.0/cstdlib \ - C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h \ - C:/mingw64/include/c++/13.2.0/stdlib.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h \ - C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h \ - C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ - C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ - C:/mingw64/x86_64-w64-mingw32/include/afunix.h \ - C:/mingw64/x86_64-w64-mingw32/include/apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h \ - C:/mingw64/x86_64-w64-mingw32/include/basetsd.h \ - C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/cderr.h \ - C:/mingw64/x86_64-w64-mingw32/include/cguid.h \ - C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/commdlg.h \ - C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/ctype.h \ - C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dde.h \ - C:/mingw64/x86_64-w64-mingw32/include/ddeml.h \ - C:/mingw64/x86_64-w64-mingw32/include/debugapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/dlgs.h \ - C:/mingw64/x86_64-w64-mingw32/include/dpapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h \ - C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/errno.h \ - C:/mingw64/x86_64-w64-mingw32/include/excpt.h \ - C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/getopt.h \ - C:/mingw64/x86_64-w64-mingw32/include/guiddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/handleapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/heapapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/imm.h \ - C:/mingw64/x86_64-w64-mingw32/include/in6addr.h \ - C:/mingw64/x86_64-w64-mingw32/include/inaddr.h \ - C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/io.h \ - C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/jobapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/limits.h \ - C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h \ - C:/mingw64/x86_64-w64-mingw32/include/malloc.h \ - C:/mingw64/x86_64-w64-mingw32/include/mciapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mcx.h \ - C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/minwindef.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h \ - C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h \ - C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/msxml.h \ - C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/nb30.h \ - C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/oaidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/ole2.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleauto.h \ - C:/mingw64/x86_64-w64-mingw32/include/oleidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/poppack.h \ - C:/mingw64/x86_64-w64-mingw32/include/process.h \ - C:/mingw64/x86_64-w64-mingw32/include/processenv.h \ - C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/profileapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/propidl.h \ - C:/mingw64/x86_64-w64-mingw32/include/prsht.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h \ - C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h \ - C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/qos.h \ - C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/reason.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpc.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h \ - C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sal.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h \ - C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/servprov.h \ - C:/mingw64/x86_64-w64-mingw32/include/shellapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/specstrings.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdarg.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdlib.h \ - C:/mingw64/x86_64-w64-mingw32/include/stralign.h \ - C:/mingw64/x86_64-w64-mingw32/include/string.h \ - C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/synchapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h \ - C:/mingw64/x86_64-w64-mingw32/include/sys/types.h \ - C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/time.h \ - C:/mingw64/x86_64-w64-mingw32/include/timeapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/tvout.h \ - C:/mingw64/x86_64-w64-mingw32/include/unistd.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwn.h \ - C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/urlmon.h \ - C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h \ - C:/mingw64/x86_64-w64-mingw32/include/winbase.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincon.h \ - C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h \ - C:/mingw64/x86_64-w64-mingw32/include/windef.h \ - C:/mingw64/x86_64-w64-mingw32/include/windows.h \ - C:/mingw64/x86_64-w64-mingw32/include/winefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/winerror.h \ - C:/mingw64/x86_64-w64-mingw32/include/wingdi.h \ - C:/mingw64/x86_64-w64-mingw32/include/winioctl.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnls.h \ - C:/mingw64/x86_64-w64-mingw32/include/winnt.h \ - C:/mingw64/x86_64-w64-mingw32/include/winperf.h \ - C:/mingw64/x86_64-w64-mingw32/include/winreg.h \ - C:/mingw64/x86_64-w64-mingw32/include/winscard.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ - C:/mingw64/x86_64-w64-mingw32/include/winspool.h \ - C:/mingw64/x86_64-w64-mingw32/include/winsvc.h \ - C:/mingw64/x86_64-w64-mingw32/include/winuser.h \ - C:/mingw64/x86_64-w64-mingw32/include/winver.h \ - C:/mingw64/x86_64-w64-mingw32/include/wnnc.h \ - C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2def.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h \ - C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypes.h \ - C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h \ - include/tls1_3.h \ - include/tls_client_recv.h \ - include/tls_client_send.h \ - include/tls_keys_calc.h \ - include/tls_octads.h \ - include/tls_sal.h \ - include/tls_sockets.h \ - include/tls_tickets.h - -CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj: lib/tls_x509.cpp \ - C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ - C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ - C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ - C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ - C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ - C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ - C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ - include/tls_octads.h \ - include/tls_x509.h - - -lib/tls_sockets.cpp: - -sal/miracl/includes/fp_NIST384.h: - -sal/miracl/includes/fp_NIST256.h: - -sal/miracl/includes/fp_F448.h: - -sal/miracl/includes/fp_F25519.h: - -sal/miracl/includes/ff_RSA4096.h: - -sal/miracl/includes/ecp_NIST384.h: - -sal/miracl/includes/ecp_NIST256.h: - -sal/miracl/includes/ecp_Ed448.h: - -sal/miracl/includes/ecdh_NIST256.h: - -sal/miracl/includes/config_field_F448.h: - -sal/miracl/includes/config_field_F25519.h: - -sal/miracl/includes/rsa_RSA4096.h: - -sal/miracl/includes/config_ff_RSA4096.h: - -sal/miracl/includes/config_curve_NIST384.h: - -sal/miracl/includes/config_curve_NIST256.h: - -sal/miracl/includes/config_curve_C25519.h: - -sal/miracl/includes/big_B512_60.h: - -sal/miracl/includes/big_B448_58.h: - -C:/mingw64/include/oqs/sig_sphincs.h: - -C:/mingw64/include/oqs/sig_dilithium.h: - -C:/mingw64/include/oqs/kem_ml_kem.h: - -C:/mingw64/include/oqs/kem_frodokem.h: - -C:/mingw64/include/oqs/common.h: - -include/tls_protocol.h: - -lib/tls_protocol.cpp: - -lib/tls_logger.cpp: - -lib/tls_keys_calc.cpp: - -lib/tls_client_recv.cpp: - -lib/tls_client_cert.cpp: - -include/tls_x509.h: - -include/tls_logger.h: - -lib/tls_x509.cpp: - -include/tls_keys_calc.h: - -include/tls_client_send.h: - -C:/mingw64/include/oqs/sig_ml_dsa.h: - -include/tls_client_recv.h: - -lib/tls_cert_chain.cpp: - -C:/mingw64/x86_64-w64-mingw32/include/wtypes.h: - -C:/mingw64/x86_64-w64-mingw32/include/ws2def.h: - -C:/mingw64/x86_64-w64-mingw32/include/wow64apiset.h: - -C:/mingw64/x86_64-w64-mingw32/include/sys/time.h: - -C:/mingw64/x86_64-w64-mingw32/include/winsvc.h: - -C:/mingw64/x86_64-w64-mingw32/include/winsock2.h: - -C:/mingw64/x86_64-w64-mingw32/include/winnetwk.h: - -C:/mingw64/x86_64-w64-mingw32/include/wingdi.h: - -C:/mingw64/x86_64-w64-mingw32/include/winerror.h: - -C:/mingw64/x86_64-w64-mingw32/include/winefs.h: - -C:/mingw64/x86_64-w64-mingw32/include/windows.h: - -C:/mingw64/x86_64-w64-mingw32/include/winapifamily.h: - -include/tls_certs.h: - -C:/mingw64/x86_64-w64-mingw32/include/virtdisk.h: - -C:/mingw64/x86_64-w64-mingw32/include/utilapiset.h: - -C:/mingw64/x86_64-w64-mingw32/include/urlmon.h: - -C:/mingw64/x86_64-w64-mingw32/include/unknwnbase.h: - -sal/miracl/includes/ecdh_NIST384.h: - -C:/mingw64/x86_64-w64-mingw32/include/unistd.h: - -C:/mingw64/x86_64-w64-mingw32/include/threadpoolapiset.h: - -C:/mingw64/x86_64-w64-mingw32/include/synchapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/stringapiset.h: - -C:/mingw64/x86_64-w64-mingw32/include/sec_api/stralign_s.h: - -C:/mingw64/x86_64-w64-mingw32/include/sdkddkver.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcsal.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcnterr.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcndr.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcdcep.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcasync.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpc.h: - -C:/mingw64/x86_64-w64-mingw32/include/qos.h: - -C:/mingw64/x86_64-w64-mingw32/include/pshpack1.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsadata.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_wsa_errnos.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_types.h: - -include/tls_sockets.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcnsip.h: - -C:/mingw64/x86_64-w64-mingw32/include/processthreadsapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/realtimeapiset.h: - -C:/mingw64/x86_64-w64-mingw32/include/oleidl.h: - -C:/mingw64/x86_64-w64-mingw32/include/oleauto.h: - -C:/mingw64/x86_64-w64-mingw32/include/objidlbase.h: - -C:/mingw64/x86_64-w64-mingw32/include/objbase.h: - -C:/mingw64/x86_64-w64-mingw32/include/nb30.h: - -C:/mingw64/x86_64-w64-mingw32/include/namespaceapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h: - -sal/miracl/includes/big_B256_56.h: - -C:/mingw64/x86_64-w64-mingw32/include/msxml.h: - -C:/mingw64/x86_64-w64-mingw32/include/mstcpip.h: - -C:/mingw64/x86_64-w64-mingw32/include/mmsyscom.h: - -C:/mingw64/include/oqs/oqsconfig.h: - -C:/mingw64/x86_64-w64-mingw32/include/minwinbase.h: - -C:/mingw64/x86_64-w64-mingw32/include/specstrings.h: - -C:/mingw64/x86_64-w64-mingw32/include/memoryapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/mcx.h: - -C:/mingw64/x86_64-w64-mingw32/include/lzexpand.h: - -C:/mingw64/x86_64-w64-mingw32/include/libloaderapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/playsoundapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/ktmtypes.h: - -C:/mingw64/x86_64-w64-mingw32/include/interlockedapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/in6addr.h: - -C:/mingw64/include/oqs/kem_hqc.h: - -C:/mingw64/x86_64-w64-mingw32/include/handleapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/guiddef.h: - -C:/mingw64/x86_64-w64-mingw32/include/fileapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/winver.h: - -C:/mingw64/x86_64-w64-mingw32/include/fibersapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/errhandlingapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/getopt.h: - -C:/mingw64/x86_64-w64-mingw32/include/driverspecs.h: - -C:/mingw64/x86_64-w64-mingw32/include/pshpack2.h: - -C:/mingw64/x86_64-w64-mingw32/include/dlgs.h: - -C:/mingw64/x86_64-w64-mingw32/include/heapapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/debugapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/ddeml.h: - -lib/tls_sal.cpp: - -C:/mingw64/x86_64-w64-mingw32/include/dde.h: - -C:/mingw64/x86_64-w64-mingw32/include/datetimeapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/concurrencysal.h: - -lib/tls_octads.cpp: - -C:/mingw64/x86_64-w64-mingw32/include/combaseapi.h: - -C:/mingw64/include/oqs/kem_ntruprime.h: - -C:/mingw64/x86_64-w64-mingw32/include/apiset.h: - -C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h: - -C:/mingw64/x86_64-w64-mingw32/include/timeapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h: - -C:/mingw64/x86_64-w64-mingw32/include/imm.h: - -C:/mingw64/x86_64-w64-mingw32/include/_bsd_types.h: - -sal/miracl/includes/config_field_NIST384.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xtestintrin.h: - -C:/mingw64/include/oqs/sig.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavesintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveoptintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsaveintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcdce.h: - -C:/mingw64/x86_64-w64-mingw32/include/mmiscapi2.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xsavecintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xmmintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86gprintrin.h: - -include/tls1_3.h: - -C:/mingw64/include/c++/13.2.0/debug/assertions.h: - -C:/mingw64/include/c++/13.2.0/cstdio: - -C:/mingw64/include/c++/13.2.0/cstdint: - -C:/mingw64/x86_64-w64-mingw32/include/sys/types.h: - -include/tls_pqibe.h: - -C:/mingw64/x86_64-w64-mingw32/include/ncrypt.h: - -C:/mingw64/include/c++/13.2.0/cstddef: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++allocator.h: - -C:/mingw64/include/c++/13.2.0/bits/utility.h: - -C:/mingw64/include/c++/13.2.0/bits/uses_allocator_args.h: - -C:/mingw64/include/c++/13.2.0/cerrno: - -C:/mingw64/include/c++/13.2.0/bits/stringfwd.h: - -sal/miracl/includes/big_B384_56.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512cdintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/locale.h: - -C:/mingw64/x86_64-w64-mingw32/include/_mingw_mac.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wbnoinvdintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/winscard.h: - -C:/mingw64/x86_64-w64-mingw32/include/bcrypt.h: - -C:/mingw64/include/c++/13.2.0/bits/stl_iterator.h: - -C:/mingw64/x86_64-w64-mingw32/include/cguid.h: - -C:/mingw64/include/c++/13.2.0/bits/refwrap.h: - -C:/mingw64/x86_64-w64-mingw32/include/timezoneapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/rpcnsi.h: - -C:/mingw64/include/c++/13.2.0/bits/locale_classes.h: - -C:/mingw64/include/c++/13.2.0/bits/ostream.tcc: - -C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h: - -C:/mingw64/include/c++/13.2.0/bits/range_access.h: - -C:/mingw64/include/c++/13.2.0/bits/move.h: - -C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h: - -include/tls_tickets.h: - -C:/mingw64/include/c++/13.2.0/string_view: - -sal/miracl/includes/eddsa_Ed448.h: - -C:/mingw64/x86_64-w64-mingw32/include/winnt.h: - -C:/mingw64/include/c++/13.2.0/bits/stl_iterator_base_funcs.h: - -C:/mingw64/include/c++/13.2.0/pstl/pstl_config.h: - -C:/mingw64/include/c++/13.2.0/bits/localefwd.h: - -C:/mingw64/x86_64-w64-mingw32/include/winsmcrd.h: - -C:/mingw64/x86_64-w64-mingw32/include/mmeapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/limits.h: - -C:/mingw64/include/c++/13.2.0/bits/locale_facets.tcc: - -C:/mingw64/x86_64-w64-mingw32/include/winioctl.h: - -C:/mingw64/include/c++/13.2.0/bits/locale_facets.h: - -sal/miracl/includes/ecp_Ed25519.h: - -C:/mingw64/x86_64-w64-mingw32/include/vadefs.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/x86intrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16vlintrin.h: - -sal/miracl/includes/config_ff_RSA2048.h: - -include/tls_octads.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pmmintrin.h: - -C:/mingw64/include/c++/13.2.0/bits/streambuf_iterator.h: - -C:/mingw64/include/c++/13.2.0/bits/string_view.tcc: - -C:/mingw64/include/c++/13.2.0/bits/istream.tcc: - -C:/mingw64/include/c++/13.2.0/bits/ios_base.h: - -C:/mingw64/include/c++/13.2.0/bits/stl_function.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lzcntintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/io.h: - -C:/mingw64/include/c++/13.2.0/bits/invoke.h: - -C:/mingw64/x86_64-w64-mingw32/include/joystickapi.h: - -C:/mingw64/include/c++/13.2.0/bits/cxxabi_init_exception.h: - -C:/mingw64/include/c++/13.2.0/bits/cxxabi_forced.h: - -C:/mingw64/include/c++/13.2.0/cctype: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxcomplexintrin.h: - -C:/mingw64/include/c++/13.2.0/ext/atomicity.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vaesintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/commdlg.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/serializeintrin.h: - -C:/mingw64/include/c++/13.2.0/bits/charconv.h: - -C:/mingw64/include/c++/13.2.0/bits/char_traits.h: - -C:/mingw64/include/c++/13.2.0/bits/basic_string.h: - -C:/mingw64/x86_64-w64-mingw32/include/threadpoollegacyapiset.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h: - -C:/mingw64/include/c++/13.2.0/bits/basic_ios.tcc: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512dqintrin.h: - -C:/mingw64/include/c++/13.2.0/bits/basic_ios.h: - -C:/mingw64/include/c++/13.2.0/bits/allocator.h: - -C:/mingw64/include/c++/13.2.0/ios: - -C:/mingw64/include/c++/13.2.0/bits/locale_classes.tcc: - -C:/mingw64/include/c++/13.2.0/bits/alloc_traits.h: - -C:/mingw64/include/c++/13.2.0/initializer_list: - -C:/mingw64/x86_64-w64-mingw32/include/windef.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/raointintrin.h: - -sal/miracl/includes/eddsa_Ed25519.h: - -C:/mingw64/x86_64-w64-mingw32/include/oaidl.h: - -C:/mingw64/include/c++/13.2.0/bits/new_allocator.h: - -C:/mingw64/include/c++/13.2.0/bit: - -C:/mingw64/x86_64-w64-mingw32/include/stddef.h: - -sal/miracl/includes/fp4_BLS12381.h: - -C:/mingw64/include/c++/13.2.0/bits/stl_algobase.h: - -include/tls_cert_chain.h: - -C:/mingw64/include/c++/13.2.0/bits/nested_exception.h: - -C:/mingw64/x86_64-w64-mingw32/include/sec_api/wchar_s.h: - -C:/mingw64/include/oqs/oqs.h: - -C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h: - -C:/mingw64/x86_64-w64-mingw32/include/securitybaseapi.h: - -C:/mingw64/include/c++/13.2.0/ext/numeric_traits.h: - -C:/mingw64/x86_64-w64-mingw32/include/stralign.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h: - -C:/mingw64/x86_64-w64-mingw32/include/wincrypt.h: - -C:/mingw64/include/c++/13.2.0/stdlib.h: - -C:/mingw64/include/c++/13.2.0/clocale: - -C:/mingw64/include/c++/13.2.0/bits/hash_bytes.h: - -C:/mingw64/x86_64-w64-mingw32/include/winreg.h: - -C:/mingw64/x86_64-w64-mingw32/include/process.h: - -C:/mingw64/x86_64-w64-mingw32/include/sal.h: - -C:/mingw64/x86_64-w64-mingw32/include/processenv.h: - -C:/mingw64/x86_64-w64-mingw32/include/_mingw_secapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/tvout.h: - -C:/mingw64/x86_64-w64-mingw32/include/inttypes.h: - -C:/mingw64/include/c++/13.2.0/bits/functexcept.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqintrin.h: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/cpu_defines.h: - -C:/mingw64/include/oqs/sig_falcon.h: - -C:/mingw64/x86_64-w64-mingw32/include/cderr.h: - -C:/mingw64/include/c++/13.2.0/bits/concept_check.h: - -C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/limits.h: - -C:/mingw64/x86_64-w64-mingw32/include/pthread.h: - -C:/mingw64/include/c++/13.2.0/ext/alloc_traits.h: - -C:/mingw64/include/c++/13.2.0/debug/debug.h: - -sal/miracl/includes/fp_BLS12381.h: - -sal/miracl/includes/core.h: - -C:/mingw64/include/oqs/kem.h: - -C:/mingw64/include/c++/13.2.0/bits/predefined_ops.h: - -C:/mingw64/include/oqs/kem_classic_mceliece.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmivlintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/mmsystem.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxintrin.h: - -C:/mingw64/include/c++/13.2.0/bits/ostream_insert.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/winbase.h: - -C:/mingw64/x86_64-w64-mingw32/include/reason.h: - -C:/mingw64/x86_64-w64-mingw32/include/corecrt_wstdlib.h: - -C:/mingw64/x86_64-w64-mingw32/include/shellapi.h: - -sal/miracl/includes/ecp_BLS12381.h: - -C:/mingw64/include/c++/13.2.0/bits/stl_iterator_base_types.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2vlintrin.h: - -sal/miracl/includes/config_big_B384_56.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm_malloc.h: - -sal/miracl/includes/ff_RSA2048.h: - -C:/mingw64/x86_64-w64-mingw32/include/winspool.h: - -C:/mingw64/x86_64-w64-mingw32/include/poppack.h: - -C:/mingw64/include/c++/13.2.0/bits/memory_resource.h: - -C:/mingw64/x86_64-w64-mingw32/include/stdint.h: - -lib/ibe/tls_bfibe.cpp: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnnivlintrin.h: - -include/tls_bfibe.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_fd_types.h: - -C:/mingw64/include/c++/13.2.0/bits/exception_defines.h: - -C:/mingw64/x86_64-w64-mingw32/include/wincon.h: - -C:/mingw64/include/c++/13.2.0/cstdlib: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h: - -C:/mingw64/include/c++/13.2.0/bits/ptr_traits.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vldqintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/ioapiset.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/emmintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl: - -C:/mingw64/include/c++/13.2.0/bits/memoryfwd.h: - -C:/mingw64/x86_64-w64-mingw32/include/inaddr.h: - -sal/miracl/includes/fp12_BLS12381.h: - -C:/mingw64/x86_64-w64-mingw32/include/winnls.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdarg.h: - -C:/mingw64/x86_64-w64-mingw32/include/pthread_signal.h: - -C:/mingw64/x86_64-w64-mingw32/include/corecrt.h: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/os_defines.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ip_mreq1.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h: - -C:/mingw64/x86_64-w64-mingw32/include/apisetcconv.h: - -C:/mingw64/x86_64-w64-mingw32/include/corecrt_startup.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_ws1_undef.h: - -sal/miracl/includes/config_curve_BLS12381.h: - -C:/mingw64/x86_64-w64-mingw32/include/malloc.h: - -C:/mingw64/x86_64-w64-mingw32/include/ole2.h: - -C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdlib_s.h: - -C:/mingw64/x86_64-w64-mingw32/include/wchar.h: - -C:/mingw64/include/c++/13.2.0/bits/std_abs.h: - -C:/mingw64/x86_64-w64-mingw32/include/dpapi.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16vlintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/mmiscapi.h: - -C:/mingw64/include/c++/13.2.0/bits/exception.h: - -C:/mingw64/x86_64-w64-mingw32/include/time.h: - -C:/mingw64/x86_64-w64-mingw32/include/stdlib.h: - -C:/mingw64/include/c++/13.2.0/tuple: - -C:/mingw64/include/c++/13.2.0/bits/postypes.h: - -C:/mingw64/include/c++/13.2.0/bits/cpp_type_traits.h: - -sal/miracl/includes/ecp_C25519.h: - -C:/mingw64/include/c++/13.2.0/istream: - -C:/mingw64/x86_64-w64-mingw32/include/mciapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h: - -C:/mingw64/x86_64-w64-mingw32/include/string.h: - -C:/mingw64/include/c++/13.2.0/bits/stl_construct.h: - -C:/mingw64/x86_64-w64-mingw32/include/ctype.h: - -C:/mingw64/x86_64-w64-mingw32/include/sys/timeb.h: - -C:/mingw64/x86_64-w64-mingw32/include/stdarg.h: - -C:/mingw64/include/c++/13.2.0/system_error: - -C:/mingw64/include/c++/13.2.0/bits/requires_hosted.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/keylockerintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxneconvertintrin.h: - -C:/mingw64/include/c++/13.2.0/bits/stl_pair.h: - -C:/mingw64/x86_64-w64-mingw32/include/fltwinerror.h: - -C:/mingw64/x86_64-w64-mingw32/include/excpt.h: - -C:/mingw64/include/c++/13.2.0/bits/streambuf.tcc: - -sal/miracl/includes/fp2_BLS12381.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vnniintrin.h: - -C:/mingw64/include/c++/13.2.0/exception: - -C:/mingw64/x86_64-w64-mingw32/include/ws2ipdef.h: - -C:/mingw64/x86_64-w64-mingw32/include/errno.h: - -C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h: - -C:/mingw64/x86_64-w64-mingw32/include/propidl.h: - -C:/mingw64/x86_64-w64-mingw32/include/profileapi.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/xopintrin.h: - -sal/miracl/includes/big_B384_58.h: - -C:/mingw64/include/c++/13.2.0/iostream: - -C:/mingw64/include/c++/13.2.0/ostream: - -sal/miracl/includes/pair_BLS12381.h: - -sal/miracl/includes/config_field_BLS12381.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxifmaintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/_mingw.h: - -sal/miracl/includes/ecp2_BLS12381.h: - -C:/mingw64/x86_64-w64-mingw32/include/wnnc.h: - -C:/mingw64/x86_64-w64-mingw32/include/minwindef.h: - -C:/mingw64/include/c++/13.2.0/backward/binders.h: - -C:/mingw64/x86_64-w64-mingw32/include/_timeval.h: - -sal/miracl/includes/randapi.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/waitpkgintrin.h: - -include/tls_sal.h: - -sal/miracl/includes/config_big_B384_58.h: - -C:/mingw64/x86_64-w64-mingw32/include/wtypesbase.h: - -lib/ibe/tls_pqibe.cpp: - -C:/mingw64/include/c++/13.2.0/ext/string_conversions.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmi2intrin.h: - -C:/mingw64/include/c++/13.2.0/ext/type_traits.h: - -C:/mingw64/x86_64-w64-mingw32/include/prsht.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cldemoteintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clflushoptintrin.h: - -C:/mingw64/include/c++/13.2.0/new: - -C:/mingw64/x86_64-w64-mingw32/include/winsock.h: - -C:/mingw64/include/c++/13.2.0/stdexcept: - -C:/mingw64/include/c++/13.2.0/streambuf: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlintrin.h: - -C:/mingw64/include/c++/13.2.0/bits/functional_hash.h: - -C:/mingw64/include/c++/13.2.0/typeinfo: - -C:/mingw64/x86_64-w64-mingw32/include/processtopologyapi.h: - -C:/mingw64/x86_64-w64-mingw32/include/stdio.h: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/atomic_word.h: - -C:/mingw64/include/oqs/rand.h: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/ctype_base.h: - -C:/mingw64/x86_64-w64-mingw32/include/unknwn.h: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/ctype_inline.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fma4intrin.h: - -C:/mingw64/include/c++/13.2.0/bits/basic_string.tcc: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/error_constants.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/sgxintrin.h: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/gthr.h: - -C:/mingw64/x86_64-w64-mingw32/include/_mingw_stat64.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/vpclmulqdqintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/pthread_unistd.h: - -C:/mingw64/x86_64-w64-mingw32/include/signal.h: - -C:/mingw64/x86_64-w64-mingw32/include/wctype.h: - -C:/mingw64/x86_64-w64-mingw32/include/pthread_compat.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmiintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/jobapi.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/immintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clwbintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/bmiintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/adxintrin.h: - -sal/miracl/includes/config_big_B512_60.h: - -C:/mingw64/include/c++/13.2.0/iosfwd: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/enqcmdintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/securityappcontainer.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ammintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/pshpack8.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxbf16intrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchiintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/winuser.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxint8intrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxtileintrin.h: - -lib/tls_cacerts.cpp: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124fmapsintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cmpccxaddintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/uintrintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx5124vnniwintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/movdirintrin.h: - -sal/miracl/includes/config_big_B448_58.h: - -sal/miracl/includes/arch.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bf16intrin.h: - -sal/miracl/includes/config_curve_Ed25519.h: - -C:/mingw64/x86_64-w64-mingw32/include/afunix.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bitalgintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512bwintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vpopcntdqvlintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512fp16intrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmaintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/basetsd.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512erintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512ifmavlintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512pfintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/systemtopologyapi.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/syslimits.h: - -C:/mingw64/include/c++/13.2.0/cwctype: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vbmi2intrin.h: - -sal/miracl/includes/ecdh_C25519.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vlbwintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx512vp2intersectvlintrin.h: - -sal/miracl/includes/config_big_B256_56.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avxvnniint8intrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/sysinfoapi.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/hresetintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/cetintrin.h: - -C:/mingw64/include/oqs/kem_kyber.h: - -C:/mingw64/include/c++/13.2.0/bits/uses_allocator.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/clzerointrin.h: - -sal/miracl/includes/rsa_RSA2048.h: - -C:/mingw64/x86_64-w64-mingw32/include/pshpack4.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/f16cintrin.h: - -lib/tls_client_send.cpp: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/gthr-default.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/amxfp16intrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fmaintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/fxsrintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/winperf.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/gfniintrin.h: - -sal/miracl/includes/config_field_NIST256.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/ia32intrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/lwpintrin.h: - -C:/mingw64/include/c++/13.2.0/type_traits: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mm3dnow.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mmintrin.h: - -sal/miracl/includes/config_curve_Ed448.h: - -C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++locale.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/mwaitxintrin.h: - -lib/tls_tickets.cpp: - -C:/mingw64/x86_64-w64-mingw32/include/objidl.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pconfigintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/smmintrin.h: - -C:/mingw64/include/c++/13.2.0/bits/exception_ptr.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/pkuintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/bemapiset.h: - -C:/mingw64/include/c++/13.2.0/cwchar: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/popcntintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/prfchwintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/avx2intrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rdseedintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/wmmintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/shaintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/rtmintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/ws2tcpip.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tbmintrin.h: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tmmintrin.h: - -C:/mingw64/x86_64-w64-mingw32/include/servprov.h: - -C:/mingw64/include/c++/13.2.0/string: - -C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/tsxldtrkintrin.h: +# Empty compiler generated dependencies file for tiitls. +# This may be replaced when dependencies are built. diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/includes_CXX.rsp b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/includes_CXX.rsp index 75b7757..d383f49 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/includes_CXX.rsp +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/includes_CXX.rsp @@ -1 +1 @@ --I"D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include" -I"D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl" -I"D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes" +-ID:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include -ID:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl -ID:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj.d index f9fbb49..cd4583a 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj.d @@ -1,5 +1,5 @@ CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\ibe\tls_bfibe.cpp \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\ibe\tls_bfibe.cpp \ C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ @@ -35,24 +35,24 @@ CMakeFiles/tiitls.dir/lib/ibe/tls_bfibe.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/sys/timeb_s.h \ C:/mingw64/x86_64-w64-mingw32/include/_timeval.h \ C:/mingw64/x86_64-w64-mingw32/include/pthread_time.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/randapi.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/core.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/randapi.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/core.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/arch.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_bfibe.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/pair_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp12_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp4_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp2_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/big_B384_58.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/arch.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_bfibe.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/pair_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/fp12_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/fp4_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/fp2_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/fp_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/big_B384_58.h \ C:/mingw64/x86_64-w64-mingw32/include/inttypes.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_big_B384_58.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_field_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp2_BLS12381.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_BLS12381.h + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_big_B384_58.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_field_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_curve_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ecp2_BLS12381.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ecp_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj.d index ea019db..674da6e 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj.d @@ -1,5 +1,5 @@ CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\ibe\tls_pqibe.cpp \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\ibe\tls_pqibe.cpp \ C:/mingw64/include/c++/13.2.0/iostream \ C:/mingw64/include/c++/13.2.0/bits/requires_hosted.h \ C:/mingw64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h \ @@ -144,7 +144,7 @@ CMakeFiles/tiitls.dir/lib/ibe/tls_pqibe.cpp.obj: \ C:/mingw64/include/c++/13.2.0/cstdint \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_pqibe.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/core.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_pqibe.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/core.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/arch.h + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/arch.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj.d index d569482..68c332c 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj.d @@ -1,7 +1,7 @@ CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_cacerts.cpp \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_cacerts.cpp \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_certs.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls1_3.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ @@ -13,8 +13,8 @@ CMakeFiles/tiitls.dir/lib/tls_cacerts.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sockets.h \ C:/mingw64/x86_64-w64-mingw32/include/string.h \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj.d index 1429d5e..76799ec 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj.d @@ -1,7 +1,7 @@ CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_cert_chain.cpp \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_cert_chain.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_cert_chain.cpp \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_cert_chain.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls1_3.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ @@ -13,8 +13,8 @@ CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sockets.h \ C:/mingw64/x86_64-w64-mingw32/include/string.h \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ @@ -302,10 +302,10 @@ CMakeFiles/tiitls.dir/lib/tls_cert_chain.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_x509.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sal.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_recv.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_keys_calc.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_send.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_logger.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_certs.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj.d index d85ea1a..3ed60af 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj.d @@ -1,7 +1,7 @@ CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_client_cert.cpp \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_client_cert.cpp \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_certs.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls1_3.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ @@ -13,8 +13,8 @@ CMakeFiles/tiitls.dir/lib/tls_client_cert.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sockets.h \ C:/mingw64/x86_64-w64-mingw32/include/string.h \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj.d index b7ae333..7b8c950 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj.d @@ -1,8 +1,8 @@ CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_client_recv.cpp \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_client_recv.cpp \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_recv.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sal.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls1_3.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ @@ -14,8 +14,8 @@ CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sockets.h \ C:/mingw64/x86_64-w64-mingw32/include/string.h \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ @@ -303,11 +303,11 @@ CMakeFiles/tiitls.dir/lib/tls_client_recv.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_cert_chain.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_keys_calc.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_recv.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_send.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_cert_chain.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_x509.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_logger.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_certs.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_logger.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj.d index 6926b73..b77d1d9 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj.d @@ -1,8 +1,8 @@ CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_client_send.cpp \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_client_send.cpp \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_send.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sal.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls1_3.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ @@ -14,8 +14,8 @@ CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sockets.h \ C:/mingw64/x86_64-w64-mingw32/include/string.h \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ @@ -303,9 +303,9 @@ CMakeFiles/tiitls.dir/lib/tls_client_send.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_keys_calc.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_recv.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_send.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_logger.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_x509.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_certs.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj.d index 23d7a74..5c4549e 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj.d @@ -1,7 +1,7 @@ CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_keys_calc.cpp \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_keys_calc.cpp \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_keys_calc.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls1_3.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ @@ -13,8 +13,8 @@ CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sockets.h \ C:/mingw64/x86_64-w64-mingw32/include/string.h \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ @@ -302,10 +302,10 @@ CMakeFiles/tiitls.dir/lib/tls_keys_calc.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sal.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_recv.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_keys_calc.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_send.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_logger.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_x509.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_x509.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj.d index aad188c..bce1f94 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj.d @@ -1,6 +1,6 @@ CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_logger.cpp \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_logger.cpp \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_logger.h \ C:/mingw64/x86_64-w64-mingw32/include/string.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ @@ -10,13 +10,13 @@ CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls1_3.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sockets.h \ C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ C:/mingw64/x86_64-w64-mingw32/include/windows.h \ @@ -302,4 +302,4 @@ CMakeFiles/tiitls.dir/lib/tls_logger.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_x509.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj.d index efe58d2..413084c 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj.d @@ -1,6 +1,6 @@ CMakeFiles/tiitls.dir/lib/tls_octads.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_octads.cpp \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_octads.cpp \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj.d index c142968..610ccf1 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj.d @@ -1,8 +1,8 @@ CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_protocol.cpp \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_protocol.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_protocol.cpp \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_protocol.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_keys_calc.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls1_3.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ @@ -14,8 +14,8 @@ CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sockets.h \ C:/mingw64/x86_64-w64-mingw32/include/string.h \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ @@ -303,11 +303,11 @@ CMakeFiles/tiitls.dir/lib/tls_protocol.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_cert_chain.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_certs.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_tickets.h + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sal.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_recv.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_send.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_cert_chain.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_x509.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_logger.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_certs.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_tickets.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj.d index 3328cd4..9d8c3d9 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj.d @@ -1,7 +1,7 @@ CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_sal.cpp \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_sal.cpp \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sal.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls1_3.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ @@ -13,8 +13,8 @@ CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sockets.h \ C:/mingw64/x86_64-w64-mingw32/include/string.h \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ @@ -302,48 +302,48 @@ CMakeFiles/tiitls.dir/lib/tls_sal.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/core.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/core.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdbool.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/arch.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecdh_NIST256.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_NIST256.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp_NIST256.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/big_B256_56.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/arch.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ecdh_NIST256.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ecp_NIST256.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/fp_NIST256.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/big_B256_56.h \ C:/mingw64/x86_64-w64-mingw32/include/inttypes.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/core.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_big_B256_56.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_field_NIST256.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_NIST256.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecdh_NIST384.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_NIST384.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp_NIST384.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/big_B384_56.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_big_B384_56.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_field_NIST384.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_NIST384.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecdh_C25519.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_C25519.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp_F25519.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_field_F25519.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_C25519.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/rsa_RSA2048.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ff_RSA2048.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/big_B512_60.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_big_B512_60.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_ff_RSA2048.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/rsa_RSA4096.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ff_RSA4096.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_ff_RSA4096.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/eddsa_Ed25519.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_Ed25519.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_Ed25519.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/eddsa_Ed448.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/ecp_Ed448.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/fp_F448.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/big_B448_58.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_big_B448_58.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_field_F448.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/sal/miracl/includes/config_curve_Ed448.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/core.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_big_B256_56.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_field_NIST256.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_curve_NIST256.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ecdh_NIST384.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ecp_NIST384.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/fp_NIST384.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/big_B384_56.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_big_B384_56.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_field_NIST384.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_curve_NIST384.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ecdh_C25519.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ecp_C25519.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/fp_F25519.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_field_F25519.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_curve_C25519.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/rsa_RSA2048.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ff_RSA2048.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/big_B512_60.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_big_B512_60.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_ff_RSA2048.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/rsa_RSA4096.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ff_RSA4096.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_ff_RSA4096.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/eddsa_Ed25519.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ecp_Ed25519.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_curve_Ed25519.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/eddsa_Ed448.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/ecp_Ed448.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/fp_F448.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/big_B448_58.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_big_B448_58.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_field_F448.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl/includes/config_curve_Ed448.h \ C:/mingw64/include/oqs/oqs.h C:/mingw64/include/oqs/oqsconfig.h \ C:/mingw64/include/oqs/common.h C:/mingw64/include/oqs/rand.h \ C:/mingw64/include/oqs/kem.h \ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj.d index a4b8920..cf29a19 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj.d @@ -1,6 +1,6 @@ CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_sockets.cpp \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_logger.h \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_sockets.cpp \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_logger.h \ C:/mingw64/x86_64-w64-mingw32/include/string.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ @@ -10,13 +10,13 @@ CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/vadefs.h \ C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls1_3.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sockets.h \ C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ C:/mingw64/x86_64-w64-mingw32/include/_mingw_unicode.h \ C:/mingw64/x86_64-w64-mingw32/include/windows.h \ @@ -302,4 +302,4 @@ CMakeFiles/tiitls.dir/lib/tls_sockets.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_x509.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj.d index c7d7303..e34efa7 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj.d @@ -1,7 +1,7 @@ CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_tickets.cpp \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_tickets.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls1_3.h \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_tickets.cpp \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_tickets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls1_3.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/stdint.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ @@ -13,8 +13,8 @@ CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sockets.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sockets.h \ C:/mingw64/x86_64-w64-mingw32/include/string.h \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h \ C:/mingw64/x86_64-w64-mingw32/include/winsock2.h \ @@ -302,7 +302,7 @@ CMakeFiles/tiitls.dir/lib/tls_tickets.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_recv.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_sal.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_keys_calc.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_client_send.h + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_recv.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_sal.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_keys_calc.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_client_send.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj.d b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj.d index fb1d191..9c7a1fa 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj.d +++ b/TIIGER_TLS/PQ_TIIGER_TLS/CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj.d @@ -1,5 +1,5 @@ CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj: \ - D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\lib\tls_x509.cpp \ + D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\lib\tls_x509.cpp \ C:/mingw64/x86_64-w64-mingw32/include/stdio.h \ C:/mingw64/x86_64-w64-mingw32/include/corecrt_stdio_config.h \ C:/mingw64/x86_64-w64-mingw32/include/corecrt.h \ @@ -11,8 +11,8 @@ CMakeFiles/tiitls.dir/lib/tls_x509.cpp.obj: \ C:/mingw64/x86_64-w64-mingw32/include/_mingw_off_t.h \ C:/mingw64/x86_64-w64-mingw32/include/swprintf.inl \ C:/mingw64/x86_64-w64-mingw32/include/sec_api/stdio_s.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_octads.h \ + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_octads.h \ C:/mingw64/lib/gcc/x86_64-w64-mingw32/13.2.0/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/stddef.h \ C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h \ - D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/include/tls_x509.h + D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/include/tls_x509.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/Makefile b/TIIGER_TLS/PQ_TIIGER_TLS/Makefile index 79d9e95..3334cdb 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/Makefile +++ b/TIIGER_TLS/PQ_TIIGER_TLS/Makefile @@ -56,10 +56,10 @@ RM = C:\mingw64\bin\cmake.exe -E rm -f EQUALS = = # The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = D:\DOKUMENTY\diplomovka-final\Scott-cpp-win +CMAKE_SOURCE_DIR = D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS # The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = D:\DOKUMENTY\diplomovka-final\Scott-cpp-win +CMAKE_BINARY_DIR = D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS #============================================================================= # Targets provided globally by CMake. @@ -86,9 +86,9 @@ rebuild_cache/fast: rebuild_cache # The main all target all: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\\CMakeFiles\progress.marks + $(CMAKE_COMMAND) -E cmake_progress_start D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\\CMakeFiles\progress.marks $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 all - $(CMAKE_COMMAND) -E cmake_progress_start D:\DOKUMENTY\diplomovka-final\Scott-cpp-win\CMakeFiles 0 + $(CMAKE_COMMAND) -E cmake_progress_start D:\TUKE\DIPLOMOVKA\MastersThesis\TIIGER_TLS\PQ_TIIGER_TLS\CMakeFiles 0 .PHONY : all # The main clean target diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/OQS_TEST_results.txt b/TIIGER_TLS/PQ_TIIGER_TLS/OQS_TEST_results.txt index 3cfe433..fa3217a 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/OQS_TEST_results.txt +++ b/TIIGER_TLS/PQ_TIIGER_TLS/OQS_TEST_results.txt @@ -5,52 +5,52 @@ Tested on Ubuntu 22.04.3 liboqs 0.9.2, oqs-provider 0.5.3 1.3.2024 -KEM + CERT PORT STATUS +CERT KEM PORT STATUS -dilithium2 + bikel1 6087 - OK -dilithium2 + frodo640aes 6088 - OK -dilithium2 + frodo640shake 6089 - OK -dilithium2 + hqc128 6090 - KEX error (kex=-1) -dilithium2 + kyber512 6091 - OK +dilithium2 bikel1 6087 - OK +dilithium2 frodo640aes 6088 - OK +dilithium2 frodo640shake 6089 - OK +dilithium2 hqc128 6090 - KEX error (kex=-1) +dilithium2 kyber512 6091 - OK -dilithium3 + bikel3 6105 - OK -dilithium3 + frodo976aes 6106 - OK -dilithium3 + frodo976shake 6107 - OK -dilithium3 + hqc192 6108 - KEX error (kex=-1) -dilithium3 + kyber768 6109 - OK +dilithium3 bikel3 6105 - OK +dilithium3 frodo976aes 6106 - OK +dilithium3 frodo976shake 6107 - OK +dilithium3 hqc192 6108 - KEX error (kex=-1) +dilithium3 kyber768 6109 - OK -dilithium5 bikel5 6121 - OK -dilithium5 frodo1344aes 6122 - OK -dilithium5 frodo1344shake 6123 - OK -dilithium5 hqc256 6124 - KEX error (kex=-1) -dilithium5 kyber1024 6125 - OK +dilithium5 bikel5 6121 - OK +dilithium5 frodo1344aes 6122 - OK +dilithium5 frodo1344shake 6123 - OK +dilithium5 hqc256 6124 - KEX error (kex=-1) +dilithium5 kyber1024 6125 - OK -falcon1024 bikel5 6132 - Server Certificate sig is NOT OK -falcon1024 frodo1344aes 6133 - Server Certificate sig is NOT OK -falcon1024 frodo1344shake 6134 - Server Certificate sig is NOT OK -falcon1024 hqc256 6135 - KEX error (kex=-1) -falcon1024 kyber1024 6136 - Server Certificate sig is NOT OK +falcon1024 bikel5 6132 - Server Certificate sig is NOT OK +falcon1024 frodo1344aes 6133 - Server Certificate sig is NOT OK +falcon1024 frodo1344shake 6134 - Server Certificate sig is NOT OK +falcon1024 hqc256 6135 - KEX error (kex=-1) +falcon1024 kyber1024 6136 - Server Certificate sig is NOT OK -falcon512 bikel1 6143 - Server Certificate sig is NOT OK -falcon512 frodo640aes 6144 - Server Certificate sig is NOT OK -falcon512 frodo640shake 6145 - Server Certificate sig is NOT OK -falcon512 hqc128 6146 - KEX error (kex=-1) -falcon512 kyber512 6147 - Server Certificate sig is NOT OK +falcon512 bikel1 6143 - Server Certificate sig is NOT OK +falcon512 frodo640aes 6144 - Server Certificate sig is NOT OK +falcon512 frodo640shake 6145 - Server Certificate sig is NOT OK +falcon512 hqc128 6146 - KEX error (kex=-1) +falcon512 kyber512 6147 - Server Certificate sig is NOT OK -sphincssha2128fsimple bikel1 6161 - OK -sphincssha2128fsimple frodo640aes 6162 - OK -sphincssha2128fsimple frodo640shake 6163 - OK -sphincssha2128fsimple hqc128 6164 - KEX error (kex=-1) -sphincssha2128fsimple kyber512 6165 - OK +sphincssha2128fsimple bikel1 6161 - OK +sphincssha2128fsimple frodo640aes 6162 - OK +sphincssha2128fsimple frodo640shake 6163 - OK +sphincssha2128fsimple hqc128 6164 - KEX error (kex=-1) +sphincssha2128fsimple kyber512 6165 - OK -sphincssha2128ssimple bikel1 6179 - OK -sphincssha2128ssimple frodo640aes 6180 - OK -sphincssha2128ssimple frodo640shake 6181 - OK -sphincssha2128ssimple hqc128 6182 - KEX error (kex=-1) -sphincssha2128ssimple kyber512 6183 - OK +sphincssha2128ssimple bikel1 6179 - OK +sphincssha2128ssimple frodo640aes 6180 - OK +sphincssha2128ssimple frodo640shake 6181 - OK +sphincssha2128ssimple hqc128 6182 - KEX error (kex=-1) +sphincssha2128ssimple kyber512 6183 - OK -sphincsshake128fsimple bikel1 6213 - OK -sphincsshake128fsimple frodo640aes 6214 - OK -sphincsshake128fsimple frodo640shake 6215 - OK -sphincsshake128fsimple hqc128 6216 - KEX error (kex=-1) -sphincsshake128fsimple kyber512 6217 - OK \ No newline at end of file +sphincsshake128fsimple bikel1 6213 - OK +sphincsshake128fsimple frodo640aes 6214 - OK +sphincsshake128fsimple frodo640shake 6215 - OK +sphincsshake128fsimple hqc128 6216 - KEX error (kex=-1) +sphincsshake128fsimple kyber512 6217 - OK \ No newline at end of file diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/OQS_TEST_results2.txt b/TIIGER_TLS/PQ_TIIGER_TLS/OQS_TEST_results2.txt new file mode 100644 index 0000000..b038900 --- /dev/null +++ b/TIIGER_TLS/PQ_TIIGER_TLS/OQS_TEST_results2.txt @@ -0,0 +1,84 @@ +Test server https://test.openquantumsafe.org/ +Root CA in file tls_cacerts.cpp + +Tested on Ubuntu 22.04.3 +liboqs 0.10.0, oqs-provider 0.6.0 +15.4.2024 + +CERT KEM PORT STATUS +dilithium2 bikel1 6109 OK +dilithium2 frodo640aes 6110 OK +dilithium2 frodo640shake 6111 OK +dilithium2 hqc128 6112 OK +dilithium2 kyber512 6113 OK +dilithium2 mlkem512 6114 OK + +dilithium3 bikel3 6132 OK +dilithium3 frodo976aes 6133 OK +dilithium3 frodo976shake 6134 OK +dilithium3 hqc192 6135 OK +dilithium3 kyber768 6136 OK +dilithium3 mlkem768 6137 OK + +dilithium5 bikel5 6152 OK +dilithium5 frodo1344aes 6153 OK +dilithium5 frodo1344shake 6154 OK +dilithium5 hqc256 6155 OK +dilithium5 kyber1024 6156 OK +dilithium5 mlkem1024 6157 OK + +falcon1024 bikel5 6165 OK +falcon1024 frodo1344aes 6166 OK +falcon1024 frodo1344shake 6167 OK +falcon1024 hqc256 6168 OK +falcon1024 kyber1024 6169 OK +falcon1024 mlkem1024 6170 OK + +falcon512 bikel1 6178 OK +falcon512 frodo640aes 6179 OK +falcon512 frodo640shake 6180 OK +falcon512 hqc128 6181 OK +falcon512 kyber512 6182 OK +falcon512 mlkem512 6183 OK + +mldsa44 bikel1 6237 OK +mldsa44 frodo640aes 6238 OK +mldsa44 frodo640shake 6239 OK +mldsa44 hqc128 6240 OK +mldsa44 kyber512 6241 OK +mldsa44 mlkem512 6242 OK + +mldsa65 bikel3 6260 OK +mldsa65 frodo976aes 6261 OK +mldsa65 frodo976shake 6262 OK +mldsa65 hqc192 6263 OK +mldsa65 kyber768 6264 OK +mldsa65 mlkem768 6265 OK + +mldsa87 bikel5 6280 OK +mldsa87 frodo1344aes 6281 OK +mldsa87 frodo1344shake 6282 OK +mldsa87 hqc256 6283 OK +mldsa87 kyber1024 6284 OK +mldsa87 mlkem1024 6285 OK + +sphincssha2128fsimple bikel1 6293 OK +sphincssha2128fsimple frodo640aes 6294 OK +sphincssha2128fsimple frodo640shake 6295 OK +sphincssha2128fsimple hqc128 6296 OK +sphincssha2128fsimple kyber512 6297 OK +sphincssha2128fsimple mlkem512 6298 OK + +sphincssha2128ssimple bikel1 6316 OK +sphincssha2128ssimple frodo640aes 6317 OK +sphincssha2128ssimple frodo640shake 6318 OK +sphincssha2128ssimple hqc128 6319 OK +sphincssha2128ssimple kyber512 6320 OK +sphincssha2128ssimple mlkem512 6321 OK + +sphincsshake128fsimple bikel1 6359 OK +sphincsshake128fsimple frodo640aes 6360 OK +sphincsshake128fsimple frodo640shake 6361 OK +sphincsshake128fsimple hqc128 6362 OK +sphincsshake128fsimple kyber512 6363 OK +sphincsshake128fsimple mlkem512 6364 OK \ No newline at end of file diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/README.txt b/TIIGER_TLS/PQ_TIIGER_TLS/README.txt index 6466b67..4e0b2a1 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/README.txt +++ b/TIIGER_TLS/PQ_TIIGER_TLS/README.txt @@ -12,14 +12,25 @@ Prikazy na kompilaciu (Windows): cmake -G "MinGW Makefiles" mingw32-make +alebo + +cmake -G "Unix Makefiles" +make + Priklad pouzitia: ./client.exe -r test.openquantumsafe.org:6109 +15.04.2024 +--------------------------- +- testovane s OpenSSL nativnym serverom s podporou pre PQ algoritmy +(OpenSSL 3.3.0, liboqs 0.10.0, oqsprovider 0.6.0) +- doplnene algoritmy ML-KEM a ML-DSA + 11.04.2024 --------------------------- - testovane s OpenSSL nativnym serverom s podporou pre PQ algoritmy (OpenSSL 3.3.0, liboqs 0.10.0, oqsprovider 0.5.3) - +- doplnenie najnovších verzií knižnice MIRACL core pre rôzne OS 29.02.2024 --------------------------- diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/client.exe b/TIIGER_TLS/PQ_TIIGER_TLS/client.exe index b7bb9af..3848e22 100644 Binary files a/TIIGER_TLS/PQ_TIIGER_TLS/client.exe and b/TIIGER_TLS/PQ_TIIGER_TLS/client.exe differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/cmake_install.cmake b/TIIGER_TLS/PQ_TIIGER_TLS/cmake_install.cmake index dba6ba7..1b02b0d 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/cmake_install.cmake +++ b/TIIGER_TLS/PQ_TIIGER_TLS/cmake_install.cmake @@ -1,4 +1,4 @@ -# Install script for directory: D:/DOKUMENTY/diplomovka-final/Scott-cpp-win +# Install script for directory: D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS # Set the install prefix if(NOT DEFINED CMAKE_INSTALL_PREFIX) @@ -45,5 +45,5 @@ endif() string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT "${CMAKE_INSTALL_MANIFEST_FILES}") -file(WRITE "D:/DOKUMENTY/diplomovka-final/Scott-cpp-win/${CMAKE_INSTALL_MANIFEST}" +file(WRITE "D:/TUKE/DIPLOMOVKA/MastersThesis/TIIGER_TLS/PQ_TIIGER_TLS/${CMAKE_INSTALL_MANIFEST}" "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/cookie.txt b/TIIGER_TLS/PQ_TIIGER_TLS/cookie.txt index f6fe981..58315ac 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/cookie.txt +++ b/TIIGER_TLS/PQ_TIIGER_TLS/cookie.txt @@ -1,10 +1,10 @@ test.openquantumsafe.org -0CFA9EC2D2A8EC2FEC3E5191755ED454696382A602CEBDB6B98CAEBAE8F9DA504886BBBBB9011E6727D69456674EEE1D7920B7D0C5AEB0F776FB33CA6FCCCE8496A02AB6C02F895E0ECB3CDA7E7BA1AC2788AE2CF38B5E9AF12220A4825EA8736159DC5B8D4EB618DDE5D5EFF67B04B8D91BE1341CD1674E9638D93012E6D80A61DBE75D904FB595BD5E295AFB121E0A8AC38F98420C618DC1414F4067441AF8EA949F3168BDBCF5150B3D00F43B880149E9CDF096735031E4BC883275D3764F0E762F97FAA9C3043749E4007370A28EE03DFD827248F3FE6B6FEF6A7076CB6A29CABADC760859C9505633A878CA93352EA684D1ACE0BC64D568B25716D694E9 -76BF0BFF6F94BC1F3DBBF63401B588A8AC39DFE5B54BFE441F0D3BD37DFFCE50 -1c159932 +42AC99545858D16825FDEF4DF86DABB8209F40B823D9E4976A5C9EEC0EE5397ED0F2F718324290A36DC93D3E346AE452F29B8EDDE1233FBDAF9FC16FFB98761973681278538BDA423A5A9D7DA8A8106D0C688F302380000320310A8EBCE04F66C94CF8F2C667D5698A019A18AAAA1CDA53C01FB33F902E6B288E25A3F3EEC282F78408A657BC80E96BC377567B25A88C12284F603F83B91A715547C77EEBA633727223ACE563542F64EE3A0917F3C825E3D44A921396D19E0EC35E1A6D08A58BF01C4C144F55890BBCD5B585C1F89CB3E3937FE7B5A8539281F8952525031D6FFE8200B9DC6087C947F21B150D68536D6BCAA5922791AAD7CC4B5C0D2F74E442 +A9C825A39CD59606BDE67D23A7CB48CAA06ECA9D5DB25948628E0D9B2A053C6E +7f663e28 0 -e12b1512 +e1420405 12c 1301 -247 +244 1 diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/libclient.dll.a b/TIIGER_TLS/PQ_TIIGER_TLS/libclient.dll.a index 3c99622..3435ba9 100644 Binary files a/TIIGER_TLS/PQ_TIIGER_TLS/libclient.dll.a and b/TIIGER_TLS/PQ_TIIGER_TLS/libclient.dll.a differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/libtiitls.a b/TIIGER_TLS/PQ_TIIGER_TLS/libtiitls.a index 37ff2ec..417cfb6 100644 Binary files a/TIIGER_TLS/PQ_TIIGER_TLS/libtiitls.a and b/TIIGER_TLS/PQ_TIIGER_TLS/libtiitls.a differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/README.txt b/TIIGER_TLS/PQ_TIIGER_TLS/sal/README.txt index 6221be5..56c7ff2 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/README.txt +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/README.txt @@ -47,5 +47,5 @@ Pouzita verzia kniznice v4.1 Podla historie gitu obsahuje v4.1 rozne upravy nedefinovane v ciselnych updatoch kniznice. -Posledné generovanie knižnice - 11-04-2024 +Posledné generovanie knižnice - 15-04-2024 diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/core.a b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/core.a similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/core.a rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/core.a diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/arch.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/arch.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/arch.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/arch.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B160_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B160_56.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B160_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B160_56.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B168_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B168_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B168_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B168_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B256_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B256_56.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B256_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B256_56.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B288_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B288_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B288_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B288_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B336_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B336_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B336_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B336_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B384_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B384_56.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B384_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B384_56.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B384_58.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B384_58.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B384_58.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B384_58.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B416_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B416_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B416_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B416_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B448_58.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B448_58.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B448_58.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B448_58.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B448_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B448_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B448_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B448_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B464_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B464_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B464_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B464_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B480_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B480_56.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B480_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B480_56.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B512_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B512_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B512_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B512_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B528_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B528_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B528_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B528_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B560_58.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B560_58.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B560_58.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B560_58.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B584_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B584_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big_B584_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/big_B584_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls192.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls192.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls192.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls192.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls192_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls192_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls192_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls192_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls256.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls256.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls256_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls256_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls256_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls256_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls256_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls256_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls256_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls256_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls256_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls256_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls256_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls256_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/bls_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B160_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B160_56.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B160_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B160_56.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B168_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B168_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B168_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B168_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B256_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B256_56.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B256_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B256_56.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B288_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B288_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B288_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B288_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B336_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B336_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B336_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B336_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B384_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B384_56.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B384_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B384_56.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B384_58.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B384_58.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B384_58.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B384_58.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B416_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B416_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B416_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B416_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B448_58.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B448_58.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B448_58.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B448_58.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B448_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B448_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B448_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B448_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B464_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B464_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B464_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B464_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B480_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B480_56.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B480_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B480_56.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B512_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B512_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B512_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B512_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B528_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B528_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B528_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B528_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B560_58.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B560_58.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B560_58.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B560_58.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B584_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B584_60.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big_B584_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_big_B584_60.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_ANSSI.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_ANSSI.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_ANSSI.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_ANSSI.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BRAINPOOL.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BRAINPOOL.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_BRAINPOOL.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_BRAINPOOL.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_C1174.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_C1174.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_C1174.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_C1174.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_C13318.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_C13318.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_C13318.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_C13318.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_C1665.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_C1665.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_C1665.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_C1665.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_C25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_C25519.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_C25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_C25519.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_C41417.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_C41417.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_C41417.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_C41417.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_Ed25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_Ed25519.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_Ed25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_Ed25519.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_Ed448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_Ed448.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_Ed448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_Ed448.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_HIFIVE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_HIFIVE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_HIFIVE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_HIFIVE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_JUBJUB.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_JUBJUB.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_JUBJUB.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_JUBJUB.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_MDC.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_MDC.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_MDC.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_MDC.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NIST256.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NIST256.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NIST256.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NIST256.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NIST384.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NIST384.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NIST384.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NIST384.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NIST521.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NIST521.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NIST521.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NIST521.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NUMS256E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NUMS256E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NUMS256E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NUMS256E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NUMS256W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NUMS256W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NUMS256W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NUMS256W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NUMS384E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NUMS384E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NUMS384E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NUMS384E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NUMS384W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NUMS384W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NUMS384W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NUMS384W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NUMS512E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NUMS512E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NUMS512E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NUMS512E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NUMS512W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NUMS512W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_NUMS512W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_NUMS512W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_SECP160R1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_SECP160R1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_SECP160R1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_SECP160R1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_SECP256K1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_SECP256K1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_SECP256K1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_SECP256K1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_SM2.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_SM2.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_SM2.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_SM2.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_TWEEDLEDEE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_TWEEDLEDEE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_TWEEDLEDEE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_TWEEDLEDEE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_TWEEDLEDUM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_TWEEDLEDUM.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_TWEEDLEDUM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_TWEEDLEDUM.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_X448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_X448.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve_X448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_curve_X448.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_ff.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_ff.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_ff.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_ff.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_ff_RSA2048.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_ff_RSA2048.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_ff_RSA2048.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_ff_RSA2048.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_ff_RSA3072.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_ff_RSA3072.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_ff_RSA3072.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_ff_RSA3072.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_ff_RSA4096.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_ff_RSA4096.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_ff_RSA4096.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_ff_RSA4096.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_ANSSI.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_ANSSI.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_ANSSI.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_ANSSI.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BRAINPOOL.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BRAINPOOL.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_BRAINPOOL.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_BRAINPOOL.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_C1174.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_C1174.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_C1174.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_C1174.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_C1665.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_C1665.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_C1665.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_C1665.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_C41417.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_C41417.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_C41417.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_C41417.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_F25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_F25519.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_F25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_F25519.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_F256PME.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_F256PME.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_F256PME.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_F256PME.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_F256PMW.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_F256PMW.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_F256PMW.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_F256PMW.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_F384PM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_F384PM.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_F384PM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_F384PM.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_F448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_F448.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_F448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_F448.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_F512PM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_F512PM.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_F512PM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_F512PM.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_HIFIVE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_HIFIVE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_HIFIVE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_HIFIVE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_JUBJUB.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_JUBJUB.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_JUBJUB.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_JUBJUB.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_MDC.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_MDC.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_MDC.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_MDC.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_NIST256.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_NIST256.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_NIST256.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_NIST256.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_NIST384.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_NIST384.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_NIST384.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_NIST384.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_NIST521.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_NIST521.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_NIST521.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_NIST521.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_SECP160R1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_SECP160R1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_SECP160R1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_SECP160R1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_SECP256K1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_SECP256K1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_SECP256K1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_SECP256K1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_SM2.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_SM2.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_SM2.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_SM2.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_TWEEDLEDEE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_TWEEDLEDEE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_TWEEDLEDEE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_TWEEDLEDEE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_TWEEDLEDUM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_TWEEDLEDUM.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field_TWEEDLEDUM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/config_field_TWEEDLEDUM.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/core.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/core.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/core.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/core.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/dilithium.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/dilithium.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/dilithium.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/dilithium.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecdh.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecdh.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_ANSSI.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_ANSSI.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_ANSSI.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_ANSSI.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BRAINPOOL.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BRAINPOOL.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_BRAINPOOL.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_BRAINPOOL.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_C1174.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_C1174.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_C1174.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_C1174.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_C13318.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_C13318.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_C13318.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_C13318.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_C1665.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_C1665.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_C1665.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_C1665.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_C25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_C25519.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_C25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_C25519.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_C41417.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_C41417.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_C41417.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_C41417.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_Ed25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_Ed25519.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_Ed25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_Ed25519.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_Ed448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_Ed448.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_Ed448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_Ed448.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_HIFIVE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_HIFIVE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_HIFIVE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_HIFIVE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_JUBJUB.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_JUBJUB.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_JUBJUB.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_JUBJUB.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_MDC.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_MDC.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_MDC.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_MDC.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NIST256.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NIST256.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NIST256.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NIST256.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NIST384.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NIST384.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NIST384.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NIST384.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NIST521.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NIST521.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NIST521.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NIST521.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NUMS256E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NUMS256E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NUMS256E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NUMS256E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NUMS256W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NUMS256W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NUMS256W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NUMS256W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NUMS384E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NUMS384E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NUMS384E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NUMS384E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NUMS384W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NUMS384W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NUMS384W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NUMS384W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NUMS512E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NUMS512E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NUMS512E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NUMS512E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NUMS512W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NUMS512W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_NUMS512W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_NUMS512W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_SECP160R1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_SECP160R1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_SECP160R1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_SECP160R1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_SECP256K1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_SECP256K1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_SECP256K1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_SECP256K1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_SM2.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_SM2.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_SM2.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_SM2.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_TWEEDLEDEE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_TWEEDLEDEE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_TWEEDLEDEE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_TWEEDLEDEE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_TWEEDLEDUM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_TWEEDLEDUM.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_TWEEDLEDUM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_TWEEDLEDUM.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_X448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_X448.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh_X448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecdh_X448.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp2.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp2.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp2_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp2_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp4.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp4.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp4.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp4.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp4_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp4_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp4_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp4_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp8.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp8.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp8.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp8.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp8_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp8_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp8_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp8_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp8_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp8_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp8_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp8_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp8_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp8_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp8_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp8_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_ANSSI.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_ANSSI.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_ANSSI.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_ANSSI.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BRAINPOOL.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BRAINPOOL.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_BRAINPOOL.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_BRAINPOOL.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_C1174.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_C1174.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_C1174.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_C1174.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_C13318.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_C13318.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_C13318.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_C13318.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_C1665.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_C1665.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_C1665.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_C1665.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_C25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_C25519.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_C25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_C25519.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_C41417.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_C41417.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_C41417.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_C41417.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_Ed25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_Ed25519.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_Ed25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_Ed25519.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_Ed448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_Ed448.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_Ed448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_Ed448.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_HIFIVE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_HIFIVE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_HIFIVE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_HIFIVE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_JUBJUB.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_JUBJUB.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_JUBJUB.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_JUBJUB.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_MDC.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_MDC.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_MDC.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_MDC.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NIST256.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NIST256.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NIST256.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NIST256.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NIST384.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NIST384.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NIST384.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NIST384.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NIST521.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NIST521.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NIST521.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NIST521.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NUMS256E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NUMS256E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NUMS256E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NUMS256E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NUMS256W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NUMS256W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NUMS256W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NUMS256W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NUMS384E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NUMS384E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NUMS384E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NUMS384E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NUMS384W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NUMS384W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NUMS384W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NUMS384W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NUMS512E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NUMS512E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NUMS512E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NUMS512E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NUMS512W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NUMS512W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_NUMS512W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_NUMS512W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_SECP160R1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_SECP160R1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_SECP160R1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_SECP160R1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_SECP256K1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_SECP256K1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_SECP256K1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_SECP256K1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_SM2.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_SM2.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_SM2.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_SM2.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_TWEEDLEDEE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_TWEEDLEDEE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_TWEEDLEDEE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_TWEEDLEDEE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_TWEEDLEDUM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_TWEEDLEDUM.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_TWEEDLEDUM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_TWEEDLEDUM.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_X448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_X448.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecp_X448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ecp_X448.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/eddsa.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/eddsa.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_ANSSI.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_ANSSI.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_ANSSI.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_ANSSI.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BRAINPOOL.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BRAINPOOL.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_BRAINPOOL.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_BRAINPOOL.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_C1174.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_C1174.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_C1174.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_C1174.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_C13318.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_C13318.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_C13318.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_C13318.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_C1665.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_C1665.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_C1665.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_C1665.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_C25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_C25519.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_C25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_C25519.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_C41417.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_C41417.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_C41417.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_C41417.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_Ed25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_Ed25519.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_Ed25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_Ed25519.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_Ed448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_Ed448.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_Ed448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_Ed448.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_HIFIVE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_HIFIVE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_HIFIVE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_HIFIVE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_JUBJUB.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_JUBJUB.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_JUBJUB.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_JUBJUB.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_MDC.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_MDC.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_MDC.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_MDC.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NIST256.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NIST256.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NIST256.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NIST256.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NIST384.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NIST384.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NIST384.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NIST384.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NIST521.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NIST521.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NIST521.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NIST521.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NUMS256E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NUMS256E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NUMS256E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NUMS256E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NUMS256W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NUMS256W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NUMS256W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NUMS256W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NUMS384E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NUMS384E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NUMS384E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NUMS384E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NUMS384W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NUMS384W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NUMS384W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NUMS384W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NUMS512E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NUMS512E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NUMS512E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NUMS512E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NUMS512W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NUMS512W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_NUMS512W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_NUMS512W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_SECP160R1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_SECP160R1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_SECP160R1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_SECP160R1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_SECP256K1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_SECP256K1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_SECP256K1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_SECP256K1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_SM2.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_SM2.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_SM2.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_SM2.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_TWEEDLEDEE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_TWEEDLEDEE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_TWEEDLEDEE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_TWEEDLEDEE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_TWEEDLEDUM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_TWEEDLEDUM.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_TWEEDLEDUM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_TWEEDLEDUM.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_X448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_X448.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/eddsa_X448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/eddsa_X448.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ff.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ff.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ff.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ff.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ff_RSA2048.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ff_RSA2048.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ff_RSA2048.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ff_RSA2048.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ff_RSA3072.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ff_RSA3072.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ff_RSA3072.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ff_RSA3072.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ff_RSA4096.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ff_RSA4096.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ff_RSA4096.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/ff_RSA4096.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp12_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp16.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp16.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp16_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp16_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp16_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp16_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp16_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp16_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp16_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp16_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp16_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp16_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp16_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp16_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp24.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp24.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp24.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp24.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp24_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp24_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp24_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp24_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp2_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp48.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp48.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp48_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp48_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp48_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp48_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp48_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp48_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp48_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp48_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp48_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp48_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp48_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp48_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp4_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp8.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp8.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp8_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp8_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp8_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp8_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp8_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp8_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp8_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp8_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp8_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp8_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp8_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp8_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp8_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp8_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp8_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp8_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_ANSSI.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_ANSSI.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_ANSSI.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_ANSSI.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BRAINPOOL.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BRAINPOOL.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_BRAINPOOL.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_BRAINPOOL.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_C1174.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_C1174.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_C1174.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_C1174.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_C1665.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_C1665.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_C1665.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_C1665.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_C41417.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_C41417.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_C41417.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_C41417.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_F25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_F25519.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_F25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_F25519.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_F256PME.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_F256PME.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_F256PME.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_F256PME.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_F256PMW.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_F256PMW.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_F256PMW.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_F256PMW.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_F384PM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_F384PM.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_F384PM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_F384PM.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_F448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_F448.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_F448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_F448.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_F512PM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_F512PM.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_F512PM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_F512PM.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_HIFIVE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_HIFIVE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_HIFIVE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_HIFIVE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_JUBJUB.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_JUBJUB.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_JUBJUB.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_JUBJUB.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_MDC.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_MDC.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_MDC.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_MDC.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_NIST256.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_NIST256.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_NIST256.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_NIST256.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_NIST384.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_NIST384.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_NIST384.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_NIST384.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_NIST521.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_NIST521.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_NIST521.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_NIST521.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_SECP160R1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_SECP160R1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_SECP160R1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_SECP160R1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_SECP256K1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_SECP256K1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_SECP256K1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_SECP256K1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_SM2.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_SM2.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_SM2.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_SM2.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_TWEEDLEDEE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_TWEEDLEDEE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_TWEEDLEDEE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_TWEEDLEDEE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_TWEEDLEDUM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_TWEEDLEDUM.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp_TWEEDLEDUM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/fp_TWEEDLEDUM.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/hpke.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/hpke.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_ANSSI.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_ANSSI.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_ANSSI.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_ANSSI.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BRAINPOOL.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BRAINPOOL.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_BRAINPOOL.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_BRAINPOOL.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_C1174.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_C1174.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_C1174.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_C1174.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_C13318.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_C13318.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_C13318.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_C13318.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_C1665.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_C1665.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_C1665.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_C1665.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_C25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_C25519.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_C25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_C25519.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_C41417.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_C41417.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_C41417.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_C41417.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_Ed25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_Ed25519.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_Ed25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_Ed25519.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_Ed448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_Ed448.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_Ed448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_Ed448.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_HIFIVE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_HIFIVE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_HIFIVE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_HIFIVE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_JUBJUB.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_JUBJUB.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_JUBJUB.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_JUBJUB.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_MDC.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_MDC.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_MDC.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_MDC.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NIST256.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NIST256.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NIST256.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NIST256.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NIST384.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NIST384.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NIST384.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NIST384.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NIST521.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NIST521.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NIST521.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NIST521.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NUMS256E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NUMS256E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NUMS256E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NUMS256E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NUMS256W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NUMS256W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NUMS256W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NUMS256W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NUMS384E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NUMS384E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NUMS384E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NUMS384E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NUMS384W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NUMS384W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NUMS384W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NUMS384W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NUMS512E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NUMS512E.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NUMS512E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NUMS512E.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NUMS512W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NUMS512W.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_NUMS512W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_NUMS512W.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_SECP160R1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_SECP160R1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_SECP160R1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_SECP160R1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_SECP256K1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_SECP256K1.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_SECP256K1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_SECP256K1.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_SM2.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_SM2.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_SM2.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_SM2.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_TWEEDLEDEE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_TWEEDLEDEE.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_TWEEDLEDEE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_TWEEDLEDEE.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_TWEEDLEDUM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_TWEEDLEDUM.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_TWEEDLEDUM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_TWEEDLEDUM.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_X448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_X448.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/hpke_X448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/hpke_X448.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/kyber.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/kyber.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/kyber.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/kyber.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin192.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin192.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin192.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin192.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin192_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin192_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin192_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin192_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin256.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin256.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin256.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin256.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin256_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin256_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin256_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin256_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin256_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin256_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin256_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin256_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin256_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin256_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin256_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin256_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/mpin_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/mpin_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/newhope.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/newhope.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/newhope.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/newhope.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair4.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair4.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair4.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair4.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair4_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair4_BLS24479.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair4_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair4_BLS24479.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair8.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair8.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair8.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair8.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair8_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair8_BLS48286.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair8_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair8_BLS48286.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair8_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair8_BLS48556.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair8_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair8_BLS48556.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair8_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair8_BLS48581.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair8_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair8_BLS48581.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BLS12381.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BLS12381.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BLS12383.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BLS12383.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BLS12443.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BLS12443.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BLS12461.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BLS12461.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BN158.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BN158.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BN254.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BN254.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BN254CX.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BN254CX.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BN462.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_BN462.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_FP256BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_FP256BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_FP512BN.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/pair_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/pair_FP512BN.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/randapi.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/randapi.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/randapi.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/randapi.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rsa.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/rsa.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rsa.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/rsa.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/rsa_RSA2048.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/rsa_RSA2048.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/rsa_RSA2048.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/rsa_RSA2048.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/rsa_RSA3072.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/rsa_RSA3072.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/rsa_RSA3072.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/rsa_RSA3072.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/rsa_RSA4096.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/rsa_RSA4096.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/rsa_RSA4096.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/rsa_RSA4096.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/x509.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/x509.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/x509.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-old/includes/x509.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/core.a b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/core.a new file mode 100644 index 0000000..a4b8627 Binary files /dev/null and b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/core.a differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/arch.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/arch.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/arch.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/arch.h index b37fea3..db16940 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/arch.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/arch.h @@ -1,106 +1,106 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Architecture definition header file */ - -/** - * @file arch.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Architecture Header File - * - * Specify Processor Architecture - * - */ - -/* NOTE: There is only one user configurable section in this header - see below */ - -#ifndef ARCH_H -#define ARCH_H -#include - -#define WOULD_USE_VLAS /* Would like to use variable length arrays? */ - -#ifdef WOULD_USE_VLAS -#if __cplusplus >= 201402L -#define USE_VLAS -#endif -#endif - -namespace core { - -/*** START OF USER CONFIGURABLE SECTION - set architecture ***/ - -#define CHUNK 64 /**< size of chunk in bits = wordlength of computer = 16, 32 or 64. Note not all curve options are supported on 16-bit processors */ - -/*** END OF USER CONFIGURABLE SECTION ***/ - -/* Create Integer types */ - -//#define byte uint8_t /**< 8-bit unsigned integer */ -//#define sign8 int8_t /**< 8-bit signed integer */ -//#define sign16 int16_t /**< 16-bit signed integer */ -//#define sign32 int32_t /**< 32-bit signed integer */ -//#define sign64 int64_t /**< 64-bit signed integer */ -//#define unsign32 uint32_t /**< 32-bit unsigned integer */ -//#define unsign64 uint64_t /**< 64-bit unsigned integer */ - -using byte = uint8_t; /**< 8-bit unsigned integer */ -using sign8 = int8_t; /**< 8-bit signed integer */ -using sign16 = int16_t; /**< 16-bit signed integer */ -using sign32 = int32_t; /**< 32-bit signed integer */ -using sign64 = int64_t; /**< 64-bit signed integer */ -using unsign32 = uint32_t; /**< 32-bit unsigned integer */ -using unsign64 = uint64_t; /**< 64-bit unsigned integer */ - -//#define uchar unsigned char /**< Unsigned char */ -using uchar = unsigned char; - -/* Don't mess with anything below this line unless you know what you are doing */ - -#if CHUNK==16 - -#define chunk int16_t /**< C type corresponding to word length */ -#define dchunk int32_t /**< Always define double length chunk type if available */ - -#endif - -#if CHUNK == 32 - -#define chunk int32_t /**< C type corresponding to word length */ -#define dchunk int64_t /**< Always define double length chunk type if available */ - -#endif - -#if CHUNK == 64 - -#define chunk int64_t /**< C type corresponding to word length */ -#if defined(__SIZEOF_INT128__) && __SIZEOF_INT128__ == 16 -#define dchunk __int128 -#endif - -#endif - -#ifdef dchunk -#define COMBA /**< Use COMBA method for faster muls, sqrs and reductions */ -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Architecture definition header file */ + +/** + * @file arch.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Architecture Header File + * + * Specify Processor Architecture + * + */ + +/* NOTE: There is only one user configurable section in this header - see below */ + +#ifndef ARCH_H +#define ARCH_H +#include + +#define WOULD_USE_VLAS /* Would like to use variable length arrays? */ + +#ifdef WOULD_USE_VLAS +#if __cplusplus >= 201402L +#define USE_VLAS +#endif +#endif + +namespace core { + +/*** START OF USER CONFIGURABLE SECTION - set architecture ***/ + +#define CHUNK 64 /**< size of chunk in bits = wordlength of computer = 16, 32 or 64. Note not all curve options are supported on 16-bit processors */ + +/*** END OF USER CONFIGURABLE SECTION ***/ + +/* Create Integer types */ + +//#define byte uint8_t /**< 8-bit unsigned integer */ +//#define sign8 int8_t /**< 8-bit signed integer */ +//#define sign16 int16_t /**< 16-bit signed integer */ +//#define sign32 int32_t /**< 32-bit signed integer */ +//#define sign64 int64_t /**< 64-bit signed integer */ +//#define unsign32 uint32_t /**< 32-bit unsigned integer */ +//#define unsign64 uint64_t /**< 64-bit unsigned integer */ + +using byte = uint8_t; /**< 8-bit unsigned integer */ +using sign8 = int8_t; /**< 8-bit signed integer */ +using sign16 = int16_t; /**< 16-bit signed integer */ +using sign32 = int32_t; /**< 32-bit signed integer */ +using sign64 = int64_t; /**< 64-bit signed integer */ +using unsign32 = uint32_t; /**< 32-bit unsigned integer */ +using unsign64 = uint64_t; /**< 64-bit unsigned integer */ + +//#define uchar unsigned char /**< Unsigned char */ +using uchar = unsigned char; + +/* Don't mess with anything below this line unless you know what you are doing */ + +#if CHUNK==16 + +#define chunk int16_t /**< C type corresponding to word length */ +#define dchunk int32_t /**< Always define double length chunk type if available */ + +#endif + +#if CHUNK == 32 + +#define chunk int32_t /**< C type corresponding to word length */ +#define dchunk int64_t /**< Always define double length chunk type if available */ + +#endif + +#if CHUNK == 64 + +#define chunk int64_t /**< C type corresponding to word length */ +#if defined(__SIZEOF_INT128__) && __SIZEOF_INT128__ == 16 +#define dchunk __int128 +#endif + +#endif + +#ifdef dchunk +#define COMBA /**< Use COMBA method for faster muls, sqrs and reductions */ +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/big.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B160_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B160_56.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B160_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B160_56.h index 85ef05b..369c4c1 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B160_56.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B160_56.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B160_56_H -#define BIG_B160_56_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B160_56.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B160_56 (8*MODBYTES_B160_56) -#define NLEN_B160_56 (1+((8*MODBYTES_B160_56-1)/BASEBITS_B160_56)) -#define DNLEN_B160_56 2*NLEN_B160_56 -#define BMASK_B160_56 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B160_56; - return (chunk)(prod >> BASEBITS_B160_56); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B160_56; - x1 = (x >> HBITS_B160_56); - y0 = y & HMASK_B160_56; - y1 = (y >> HBITS_B160_56); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B160_56; - x1 = (mid >> HBITS_B160_56); - bot += x0 << HBITS_B160_56; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B160_56; - bot &= BMASK_B160_56; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B160_56_H +#define BIG_B160_56_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B160_56.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B160_56 (8*MODBYTES_B160_56) +#define NLEN_B160_56 (1+((8*MODBYTES_B160_56-1)/BASEBITS_B160_56)) +#define DNLEN_B160_56 2*NLEN_B160_56 +#define BMASK_B160_56 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B160_56; + return (chunk)(prod >> BASEBITS_B160_56); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B160_56; + x1 = (x >> HBITS_B160_56); + y0 = y & HMASK_B160_56; + y1 = (y >> HBITS_B160_56); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B160_56; + x1 = (mid >> HBITS_B160_56); + bot += x0 << HBITS_B160_56; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B160_56; + bot &= BMASK_B160_56; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B168_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B168_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B168_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B168_60.h index cf431a0..0a57612 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B168_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B168_60.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B168_60_H -#define BIG_B168_60_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B168_60.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B168_60 (8*MODBYTES_B168_60) -#define NLEN_B168_60 (1+((8*MODBYTES_B168_60-1)/BASEBITS_B168_60)) -#define DNLEN_B168_60 2*NLEN_B168_60 -#define BMASK_B168_60 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B168_60; - return (chunk)(prod >> BASEBITS_B168_60); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B168_60; - x1 = (x >> HBITS_B168_60); - y0 = y & HMASK_B168_60; - y1 = (y >> HBITS_B168_60); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B168_60; - x1 = (mid >> HBITS_B168_60); - bot += x0 << HBITS_B168_60; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B168_60; - bot &= BMASK_B168_60; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B168_60_H +#define BIG_B168_60_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B168_60.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B168_60 (8*MODBYTES_B168_60) +#define NLEN_B168_60 (1+((8*MODBYTES_B168_60-1)/BASEBITS_B168_60)) +#define DNLEN_B168_60 2*NLEN_B168_60 +#define BMASK_B168_60 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B168_60; + return (chunk)(prod >> BASEBITS_B168_60); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B168_60; + x1 = (x >> HBITS_B168_60); + y0 = y & HMASK_B168_60; + y1 = (y >> HBITS_B168_60); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B168_60; + x1 = (mid >> HBITS_B168_60); + bot += x0 << HBITS_B168_60; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B168_60; + bot &= BMASK_B168_60; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B256_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B256_56.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B256_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B256_56.h index 63e0e1d..c16e9a1 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B256_56.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B256_56.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B256_56_H -#define BIG_B256_56_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B256_56.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B256_56 (8*MODBYTES_B256_56) -#define NLEN_B256_56 (1+((8*MODBYTES_B256_56-1)/BASEBITS_B256_56)) -#define DNLEN_B256_56 2*NLEN_B256_56 -#define BMASK_B256_56 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B256_56; - return (chunk)(prod >> BASEBITS_B256_56); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B256_56; - x1 = (x >> HBITS_B256_56); - y0 = y & HMASK_B256_56; - y1 = (y >> HBITS_B256_56); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B256_56; - x1 = (mid >> HBITS_B256_56); - bot += x0 << HBITS_B256_56; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B256_56; - bot &= BMASK_B256_56; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B256_56_H +#define BIG_B256_56_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B256_56.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B256_56 (8*MODBYTES_B256_56) +#define NLEN_B256_56 (1+((8*MODBYTES_B256_56-1)/BASEBITS_B256_56)) +#define DNLEN_B256_56 2*NLEN_B256_56 +#define BMASK_B256_56 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B256_56; + return (chunk)(prod >> BASEBITS_B256_56); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B256_56; + x1 = (x >> HBITS_B256_56); + y0 = y & HMASK_B256_56; + y1 = (y >> HBITS_B256_56); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B256_56; + x1 = (mid >> HBITS_B256_56); + bot += x0 << HBITS_B256_56; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B256_56; + bot &= BMASK_B256_56; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B288_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B288_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B288_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B288_60.h index 991383b..2034bee 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B288_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B288_60.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B288_60_H -#define BIG_B288_60_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B288_60.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B288_60 (8*MODBYTES_B288_60) -#define NLEN_B288_60 (1+((8*MODBYTES_B288_60-1)/BASEBITS_B288_60)) -#define DNLEN_B288_60 2*NLEN_B288_60 -#define BMASK_B288_60 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B288_60; - return (chunk)(prod >> BASEBITS_B288_60); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B288_60; - x1 = (x >> HBITS_B288_60); - y0 = y & HMASK_B288_60; - y1 = (y >> HBITS_B288_60); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B288_60; - x1 = (mid >> HBITS_B288_60); - bot += x0 << HBITS_B288_60; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B288_60; - bot &= BMASK_B288_60; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B288_60_H +#define BIG_B288_60_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B288_60.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B288_60 (8*MODBYTES_B288_60) +#define NLEN_B288_60 (1+((8*MODBYTES_B288_60-1)/BASEBITS_B288_60)) +#define DNLEN_B288_60 2*NLEN_B288_60 +#define BMASK_B288_60 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B288_60; + return (chunk)(prod >> BASEBITS_B288_60); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B288_60; + x1 = (x >> HBITS_B288_60); + y0 = y & HMASK_B288_60; + y1 = (y >> HBITS_B288_60); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B288_60; + x1 = (mid >> HBITS_B288_60); + bot += x0 << HBITS_B288_60; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B288_60; + bot &= BMASK_B288_60; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B336_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B336_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B336_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B336_60.h index 1072096..d4fa6c9 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B336_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B336_60.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B336_60_H -#define BIG_B336_60_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B336_60.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B336_60 (8*MODBYTES_B336_60) -#define NLEN_B336_60 (1+((8*MODBYTES_B336_60-1)/BASEBITS_B336_60)) -#define DNLEN_B336_60 2*NLEN_B336_60 -#define BMASK_B336_60 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B336_60; - return (chunk)(prod >> BASEBITS_B336_60); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B336_60; - x1 = (x >> HBITS_B336_60); - y0 = y & HMASK_B336_60; - y1 = (y >> HBITS_B336_60); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B336_60; - x1 = (mid >> HBITS_B336_60); - bot += x0 << HBITS_B336_60; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B336_60; - bot &= BMASK_B336_60; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B336_60_H +#define BIG_B336_60_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B336_60.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B336_60 (8*MODBYTES_B336_60) +#define NLEN_B336_60 (1+((8*MODBYTES_B336_60-1)/BASEBITS_B336_60)) +#define DNLEN_B336_60 2*NLEN_B336_60 +#define BMASK_B336_60 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B336_60; + return (chunk)(prod >> BASEBITS_B336_60); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B336_60; + x1 = (x >> HBITS_B336_60); + y0 = y & HMASK_B336_60; + y1 = (y >> HBITS_B336_60); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B336_60; + x1 = (mid >> HBITS_B336_60); + bot += x0 << HBITS_B336_60; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B336_60; + bot &= BMASK_B336_60; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B384_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B384_56.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B384_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B384_56.h index c160c76..a5724a1 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B384_56.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B384_56.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B384_56_H -#define BIG_B384_56_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B384_56.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B384_56 (8*MODBYTES_B384_56) -#define NLEN_B384_56 (1+((8*MODBYTES_B384_56-1)/BASEBITS_B384_56)) -#define DNLEN_B384_56 2*NLEN_B384_56 -#define BMASK_B384_56 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B384_56; - return (chunk)(prod >> BASEBITS_B384_56); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B384_56; - x1 = (x >> HBITS_B384_56); - y0 = y & HMASK_B384_56; - y1 = (y >> HBITS_B384_56); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B384_56; - x1 = (mid >> HBITS_B384_56); - bot += x0 << HBITS_B384_56; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B384_56; - bot &= BMASK_B384_56; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B384_56_H +#define BIG_B384_56_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B384_56.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B384_56 (8*MODBYTES_B384_56) +#define NLEN_B384_56 (1+((8*MODBYTES_B384_56-1)/BASEBITS_B384_56)) +#define DNLEN_B384_56 2*NLEN_B384_56 +#define BMASK_B384_56 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B384_56; + return (chunk)(prod >> BASEBITS_B384_56); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B384_56; + x1 = (x >> HBITS_B384_56); + y0 = y & HMASK_B384_56; + y1 = (y >> HBITS_B384_56); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B384_56; + x1 = (mid >> HBITS_B384_56); + bot += x0 << HBITS_B384_56; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B384_56; + bot &= BMASK_B384_56; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B384_58.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B384_58.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B384_58.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B384_58.h index 4eda3e5..3f0c9ce 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B384_58.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B384_58.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B384_58_H -#define BIG_B384_58_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B384_58.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B384_58 (8*MODBYTES_B384_58) -#define NLEN_B384_58 (1+((8*MODBYTES_B384_58-1)/BASEBITS_B384_58)) -#define DNLEN_B384_58 2*NLEN_B384_58 -#define BMASK_B384_58 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B384_58; - return (chunk)(prod >> BASEBITS_B384_58); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B384_58; - x1 = (x >> HBITS_B384_58); - y0 = y & HMASK_B384_58; - y1 = (y >> HBITS_B384_58); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B384_58; - x1 = (mid >> HBITS_B384_58); - bot += x0 << HBITS_B384_58; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B384_58; - bot &= BMASK_B384_58; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B384_58_H +#define BIG_B384_58_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B384_58.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B384_58 (8*MODBYTES_B384_58) +#define NLEN_B384_58 (1+((8*MODBYTES_B384_58-1)/BASEBITS_B384_58)) +#define DNLEN_B384_58 2*NLEN_B384_58 +#define BMASK_B384_58 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B384_58; + return (chunk)(prod >> BASEBITS_B384_58); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B384_58; + x1 = (x >> HBITS_B384_58); + y0 = y & HMASK_B384_58; + y1 = (y >> HBITS_B384_58); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B384_58; + x1 = (mid >> HBITS_B384_58); + bot += x0 << HBITS_B384_58; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B384_58; + bot &= BMASK_B384_58; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B416_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B416_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B416_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B416_60.h index 978bc98..ce05134 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B416_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B416_60.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B416_60_H -#define BIG_B416_60_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B416_60.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B416_60 (8*MODBYTES_B416_60) -#define NLEN_B416_60 (1+((8*MODBYTES_B416_60-1)/BASEBITS_B416_60)) -#define DNLEN_B416_60 2*NLEN_B416_60 -#define BMASK_B416_60 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B416_60; - return (chunk)(prod >> BASEBITS_B416_60); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B416_60; - x1 = (x >> HBITS_B416_60); - y0 = y & HMASK_B416_60; - y1 = (y >> HBITS_B416_60); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B416_60; - x1 = (mid >> HBITS_B416_60); - bot += x0 << HBITS_B416_60; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B416_60; - bot &= BMASK_B416_60; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B416_60_H +#define BIG_B416_60_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B416_60.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B416_60 (8*MODBYTES_B416_60) +#define NLEN_B416_60 (1+((8*MODBYTES_B416_60-1)/BASEBITS_B416_60)) +#define DNLEN_B416_60 2*NLEN_B416_60 +#define BMASK_B416_60 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B416_60; + return (chunk)(prod >> BASEBITS_B416_60); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B416_60; + x1 = (x >> HBITS_B416_60); + y0 = y & HMASK_B416_60; + y1 = (y >> HBITS_B416_60); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B416_60; + x1 = (mid >> HBITS_B416_60); + bot += x0 << HBITS_B416_60; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B416_60; + bot &= BMASK_B416_60; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B448_58.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B448_58.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B448_58.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B448_58.h index 8aa26f1..1ad28ee 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B448_58.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B448_58.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B448_58_H -#define BIG_B448_58_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B448_58.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B448_58 (8*MODBYTES_B448_58) -#define NLEN_B448_58 (1+((8*MODBYTES_B448_58-1)/BASEBITS_B448_58)) -#define DNLEN_B448_58 2*NLEN_B448_58 -#define BMASK_B448_58 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B448_58; - return (chunk)(prod >> BASEBITS_B448_58); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B448_58; - x1 = (x >> HBITS_B448_58); - y0 = y & HMASK_B448_58; - y1 = (y >> HBITS_B448_58); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B448_58; - x1 = (mid >> HBITS_B448_58); - bot += x0 << HBITS_B448_58; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B448_58; - bot &= BMASK_B448_58; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B448_58_H +#define BIG_B448_58_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B448_58.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B448_58 (8*MODBYTES_B448_58) +#define NLEN_B448_58 (1+((8*MODBYTES_B448_58-1)/BASEBITS_B448_58)) +#define DNLEN_B448_58 2*NLEN_B448_58 +#define BMASK_B448_58 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B448_58; + return (chunk)(prod >> BASEBITS_B448_58); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B448_58; + x1 = (x >> HBITS_B448_58); + y0 = y & HMASK_B448_58; + y1 = (y >> HBITS_B448_58); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B448_58; + x1 = (mid >> HBITS_B448_58); + bot += x0 << HBITS_B448_58; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B448_58; + bot &= BMASK_B448_58; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B448_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B448_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B448_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B448_60.h index ce14891..426c032 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B448_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B448_60.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B448_60_H -#define BIG_B448_60_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B448_60.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B448_60 (8*MODBYTES_B448_60) -#define NLEN_B448_60 (1+((8*MODBYTES_B448_60-1)/BASEBITS_B448_60)) -#define DNLEN_B448_60 2*NLEN_B448_60 -#define BMASK_B448_60 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B448_60; - return (chunk)(prod >> BASEBITS_B448_60); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B448_60; - x1 = (x >> HBITS_B448_60); - y0 = y & HMASK_B448_60; - y1 = (y >> HBITS_B448_60); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B448_60; - x1 = (mid >> HBITS_B448_60); - bot += x0 << HBITS_B448_60; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B448_60; - bot &= BMASK_B448_60; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B448_60_H +#define BIG_B448_60_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B448_60.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B448_60 (8*MODBYTES_B448_60) +#define NLEN_B448_60 (1+((8*MODBYTES_B448_60-1)/BASEBITS_B448_60)) +#define DNLEN_B448_60 2*NLEN_B448_60 +#define BMASK_B448_60 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B448_60; + return (chunk)(prod >> BASEBITS_B448_60); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B448_60; + x1 = (x >> HBITS_B448_60); + y0 = y & HMASK_B448_60; + y1 = (y >> HBITS_B448_60); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B448_60; + x1 = (mid >> HBITS_B448_60); + bot += x0 << HBITS_B448_60; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B448_60; + bot &= BMASK_B448_60; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B464_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B464_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B464_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B464_60.h index 0af3c14..cca82be 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B464_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B464_60.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B464_60_H -#define BIG_B464_60_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B464_60.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B464_60 (8*MODBYTES_B464_60) -#define NLEN_B464_60 (1+((8*MODBYTES_B464_60-1)/BASEBITS_B464_60)) -#define DNLEN_B464_60 2*NLEN_B464_60 -#define BMASK_B464_60 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B464_60; - return (chunk)(prod >> BASEBITS_B464_60); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B464_60; - x1 = (x >> HBITS_B464_60); - y0 = y & HMASK_B464_60; - y1 = (y >> HBITS_B464_60); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B464_60; - x1 = (mid >> HBITS_B464_60); - bot += x0 << HBITS_B464_60; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B464_60; - bot &= BMASK_B464_60; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B464_60_H +#define BIG_B464_60_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B464_60.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B464_60 (8*MODBYTES_B464_60) +#define NLEN_B464_60 (1+((8*MODBYTES_B464_60-1)/BASEBITS_B464_60)) +#define DNLEN_B464_60 2*NLEN_B464_60 +#define BMASK_B464_60 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B464_60; + return (chunk)(prod >> BASEBITS_B464_60); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B464_60; + x1 = (x >> HBITS_B464_60); + y0 = y & HMASK_B464_60; + y1 = (y >> HBITS_B464_60); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B464_60; + x1 = (mid >> HBITS_B464_60); + bot += x0 << HBITS_B464_60; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B464_60; + bot &= BMASK_B464_60; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B480_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B480_56.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B480_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B480_56.h index 7c76010..10bb1b3 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B480_56.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B480_56.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B480_56_H -#define BIG_B480_56_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B480_56.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B480_56 (8*MODBYTES_B480_56) -#define NLEN_B480_56 (1+((8*MODBYTES_B480_56-1)/BASEBITS_B480_56)) -#define DNLEN_B480_56 2*NLEN_B480_56 -#define BMASK_B480_56 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B480_56; - return (chunk)(prod >> BASEBITS_B480_56); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B480_56; - x1 = (x >> HBITS_B480_56); - y0 = y & HMASK_B480_56; - y1 = (y >> HBITS_B480_56); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B480_56; - x1 = (mid >> HBITS_B480_56); - bot += x0 << HBITS_B480_56; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B480_56; - bot &= BMASK_B480_56; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B480_56_H +#define BIG_B480_56_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B480_56.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B480_56 (8*MODBYTES_B480_56) +#define NLEN_B480_56 (1+((8*MODBYTES_B480_56-1)/BASEBITS_B480_56)) +#define DNLEN_B480_56 2*NLEN_B480_56 +#define BMASK_B480_56 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B480_56; + return (chunk)(prod >> BASEBITS_B480_56); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B480_56; + x1 = (x >> HBITS_B480_56); + y0 = y & HMASK_B480_56; + y1 = (y >> HBITS_B480_56); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B480_56; + x1 = (mid >> HBITS_B480_56); + bot += x0 << HBITS_B480_56; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B480_56; + bot &= BMASK_B480_56; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B512_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B512_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B512_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B512_60.h index fa72a4a..8cbbac2 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B512_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B512_60.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B512_60_H -#define BIG_B512_60_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B512_60.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B512_60 (8*MODBYTES_B512_60) -#define NLEN_B512_60 (1+((8*MODBYTES_B512_60-1)/BASEBITS_B512_60)) -#define DNLEN_B512_60 2*NLEN_B512_60 -#define BMASK_B512_60 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B512_60; - return (chunk)(prod >> BASEBITS_B512_60); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B512_60; - x1 = (x >> HBITS_B512_60); - y0 = y & HMASK_B512_60; - y1 = (y >> HBITS_B512_60); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B512_60; - x1 = (mid >> HBITS_B512_60); - bot += x0 << HBITS_B512_60; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B512_60; - bot &= BMASK_B512_60; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B512_60_H +#define BIG_B512_60_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B512_60.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B512_60 (8*MODBYTES_B512_60) +#define NLEN_B512_60 (1+((8*MODBYTES_B512_60-1)/BASEBITS_B512_60)) +#define DNLEN_B512_60 2*NLEN_B512_60 +#define BMASK_B512_60 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B512_60; + return (chunk)(prod >> BASEBITS_B512_60); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B512_60; + x1 = (x >> HBITS_B512_60); + y0 = y & HMASK_B512_60; + y1 = (y >> HBITS_B512_60); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B512_60; + x1 = (mid >> HBITS_B512_60); + bot += x0 << HBITS_B512_60; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B512_60; + bot &= BMASK_B512_60; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B528_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B528_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B528_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B528_60.h index 971a677..b8f357a 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B528_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B528_60.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B528_60_H -#define BIG_B528_60_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B528_60.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B528_60 (8*MODBYTES_B528_60) -#define NLEN_B528_60 (1+((8*MODBYTES_B528_60-1)/BASEBITS_B528_60)) -#define DNLEN_B528_60 2*NLEN_B528_60 -#define BMASK_B528_60 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B528_60; - return (chunk)(prod >> BASEBITS_B528_60); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B528_60; - x1 = (x >> HBITS_B528_60); - y0 = y & HMASK_B528_60; - y1 = (y >> HBITS_B528_60); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B528_60; - x1 = (mid >> HBITS_B528_60); - bot += x0 << HBITS_B528_60; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B528_60; - bot &= BMASK_B528_60; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B528_60_H +#define BIG_B528_60_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B528_60.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B528_60 (8*MODBYTES_B528_60) +#define NLEN_B528_60 (1+((8*MODBYTES_B528_60-1)/BASEBITS_B528_60)) +#define DNLEN_B528_60 2*NLEN_B528_60 +#define BMASK_B528_60 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B528_60; + return (chunk)(prod >> BASEBITS_B528_60); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B528_60; + x1 = (x >> HBITS_B528_60); + y0 = y & HMASK_B528_60; + y1 = (y >> HBITS_B528_60); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B528_60; + x1 = (mid >> HBITS_B528_60); + bot += x0 << HBITS_B528_60; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B528_60; + bot &= BMASK_B528_60; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B560_58.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B560_58.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B560_58.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B560_58.h index c9341c4..eef9fc8 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B560_58.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B560_58.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B560_58_H -#define BIG_B560_58_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B560_58.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B560_58 (8*MODBYTES_B560_58) -#define NLEN_B560_58 (1+((8*MODBYTES_B560_58-1)/BASEBITS_B560_58)) -#define DNLEN_B560_58 2*NLEN_B560_58 -#define BMASK_B560_58 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B560_58; - return (chunk)(prod >> BASEBITS_B560_58); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B560_58; - x1 = (x >> HBITS_B560_58); - y0 = y & HMASK_B560_58; - y1 = (y >> HBITS_B560_58); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B560_58; - x1 = (mid >> HBITS_B560_58); - bot += x0 << HBITS_B560_58; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B560_58; - bot &= BMASK_B560_58; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B560_58_H +#define BIG_B560_58_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B560_58.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B560_58 (8*MODBYTES_B560_58) +#define NLEN_B560_58 (1+((8*MODBYTES_B560_58-1)/BASEBITS_B560_58)) +#define DNLEN_B560_58 2*NLEN_B560_58 +#define BMASK_B560_58 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B560_58; + return (chunk)(prod >> BASEBITS_B560_58); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B560_58; + x1 = (x >> HBITS_B560_58); + y0 = y & HMASK_B560_58; + y1 = (y >> HBITS_B560_58); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B560_58; + x1 = (mid >> HBITS_B560_58); + bot += x0 << HBITS_B560_58; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B560_58; + bot &= BMASK_B560_58; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B584_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B584_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B584_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B584_60.h index 6024967..3c84b90 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big_B584_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/big_B584_60.h @@ -1,697 +1,697 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file big.h - * @author Mike Scott - * @date 23rd February 2016 - * @brief Big number Header File - * - * - */ - -#ifndef BIG_B584_60_H -#define BIG_B584_60_H - -#include -#include -#include -#include "arch.h" -#include "core.h" -#include "config_big_B584_60.h" - -using namespace core; - -/* could comment this out if code size is a major issue */ -#define UNWOUND -/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ -#define USE_KARATSUBA - -#define BIGBITS_B584_60 (8*MODBYTES_B584_60) -#define NLEN_B584_60 (1+((8*MODBYTES_B584_60-1)/BASEBITS_B584_60)) -#define DNLEN_B584_60 2*NLEN_B584_60 -#define BMASK_B584_60 (((chunk)1<y - */ -extern int BIG_comp(BIG x, BIG y); -/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) - * - @param x first DBIG number to be compared - @param y second DBIG number to be compared - @return -1 is xy - */ -extern int BIG_dcomp(DBIG x, DBIG y); -/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) - * - @param x BIG number - @return Number of bits in x - */ -extern int BIG_nbits(BIG x); -/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) - * - @param x DBIG number - @return Number of bits in x - */ -extern int BIG_dnbits(DBIG x); - -/** @brief Reduce x mod n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctmod(BIG x, BIG n, int bd); - -/** @brief x=y mod n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); - -/** @brief Divide x by n - constant time for fixed bd - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - @param bd non-negative bit difference between maximum x and n - */ -extern void BIG_ctsdiv(BIG x,BIG n,int bd); - -/** @brief x=y/n - constant time for fixed bd - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - @param bd non-negative bit difference between maximum y and n - */ -extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); - - -/** @brief Reduce x mod n - input and output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be reduced mod n - @param n The modulus - */ -extern void BIG_mod(BIG x, BIG n); -/** @brief Divide x by n - output normalised (Variable Time) - * - Slow but rarely used - @param x BIG number to be divided by n - @param n The Divisor - */ -extern void BIG_sdiv(BIG x, BIG n); -/** @brief x=y mod n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y mod n - @param y DBIG number - @param n Modulus - */ -extern void BIG_dmod(BIG x, DBIG y, BIG n); -/** @brief x=y/n - output normalised (Variable Time) - * - Slow but rarely used. y is destroyed. - @param x BIG number, on exit = y/n - @param y DBIG number - @param n Modulus - */ -extern void BIG_ddiv(BIG x, DBIG y, BIG n); -/** @brief return parity of BIG, that is the least significant bit (Constant Time) - * - @param x BIG number - @return 0 or 1 - */ -extern int BIG_parity(BIG x); -/** @brief return i-th of BIG (Constant Time) - * - @param x BIG number - @param i the bit of x to be returned - @return 0 or 1 - */ -extern int BIG_bit(BIG x, int i); -/** @brief return least significant bits of a BIG (Constant Time) - * - @param x BIG number - @param n number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int BIG_lastbits(BIG x, int n); -/** @brief Create a random BIG from a random number generator (Constant Time) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_random(BIG x, csprng *r); -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randomnum(BIG x, BIG n, csprng *r); - -/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) - * - Assumes that the random number generator has been suitably initialised - @param x BIG number, on exit a random number - @param n The modulus - @param t Maximum bit length - @param r A pointer to a Cryptographically Secure Random Number Generator - */ -extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); - -/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised - * - Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any - param x BIG number - param x3 BIG number, three times x - param i bit position - param nbs pointer to integer returning number of bits processed - param nzs pointer to integer returning number of trailing 0s - return + or - 1, 3 or 5 -*/ - -/** @brief Calculate x=y*z mod n (Variable Time) - * - Slow method for modular multiplication - @param x BIG number, on exit = y*z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y/z mod n (Variable Time) - * - Slow method for modular division - @param x BIG number, on exit = y/z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); -/** @brief Calculate x=y^2 mod n (Variable Time) - * - Slow method for modular squaring - @param x BIG number, on exit = y^2 mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modsqr(BIG x, BIG y, BIG n); -/** @brief Calculate x=-y mod n (Variable Time) - * - Modular negation - @param x BIG number, on exit = -y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_modneg(BIG x, BIG y, BIG n); - -/** @brief Calculate x=y+z mod n (Variable Time) - * - Slow method for modular addition - @param x BIG number, on exit = y+z mod n - @param y BIG number - @param z BIG number - @param n The BIG Modulus - */ -extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); - -/** @brief Calculate jacobi Symbol (x/y) (Variable Time) - * - @param x BIG number - @param y BIG number - @return Jacobi symbol, -1,0 or 1 - */ -extern int BIG_jacobi(BIG x, BIG y); -/** @brief Calculate x=1/y mod n (Variable Time) - * - Modular Inversion - This is slow. Uses binary method. - @param x BIG number, on exit = 1/y mod n - @param y BIG number - @param n The BIG Modulus - */ -extern void BIG_invmodp(BIG x, BIG y, BIG n); -/** @brief Calculate x=x mod 2^m (Variable Time) - * - Truncation - @param x BIG number, on reduced mod 2^m - @param m new truncated size -*/ -extern void BIG_mod2m(BIG x, int m); - -/** @brief Calculates a*b+c+*d - * - Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) - @param a multiplier - @param b multiplicand - @param c carry - @param d pointer to accumulated bottom half of result - @return top half of result - */ - - -extern int step1(BIG,BIG,BIG); -extern void step2(BIG,BIG,BIG); - -#ifdef dchunk - -/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - dchunk prod = (dchunk)x * y + c + *r; - *r = (chunk)prod & BMASK_B584_60; - return (chunk)(prod >> BASEBITS_B584_60); -} - -#else - -/* No integer type available that can store double the wordlength */ -/* accumulate partial products */ - -inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) -{ - chunk x0, x1, y0, y1; - chunk bot, top, mid, carry; - x0 = x & HMASK_B584_60; - x1 = (x >> HBITS_B584_60); - y0 = y & HMASK_B584_60; - y1 = (y >> HBITS_B584_60); - bot = x0 * y0; - top = x1 * y1; - mid = x0 * y1 + x1 * y0; - x0 = mid & HMASK_B584_60; - x1 = (mid >> HBITS_B584_60); - bot += x0 << HBITS_B584_60; - bot += *r; - bot += c; - - top += x1; - carry = bot >> BASEBITS_B584_60; - bot &= BMASK_B584_60; - top += carry; - - *r = bot; - return top; -} - -#endif - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file big.h + * @author Mike Scott + * @date 23rd February 2016 + * @brief Big number Header File + * + * + */ + +#ifndef BIG_B584_60_H +#define BIG_B584_60_H + +#include +#include +#include +#include "arch.h" +#include "core.h" +#include "config_big_B584_60.h" + +using namespace core; + +/* could comment this out if code size is a major issue */ +#define UNWOUND +/* Normally recommended, but may not be optimal for some architectures, for example 32-bit ARM M4 */ +#define USE_KARATSUBA + +#define BIGBITS_B584_60 (8*MODBYTES_B584_60) +#define NLEN_B584_60 (1+((8*MODBYTES_B584_60-1)/BASEBITS_B584_60)) +#define DNLEN_B584_60 2*NLEN_B584_60 +#define BMASK_B584_60 (((chunk)1<y + */ +extern int BIG_comp(BIG x, BIG y); +/** @brief Compares two DBIG numbers. Inputs must be normalised externally (Constant Time) + * + @param x first DBIG number to be compared + @param y second DBIG number to be compared + @return -1 is xy + */ +extern int BIG_dcomp(DBIG x, DBIG y); +/** @brief Calculate number of bits in a BIG - output normalised (Variable Time) + * + @param x BIG number + @return Number of bits in x + */ +extern int BIG_nbits(BIG x); +/** @brief Calculate number of bits in a DBIG - output normalised (Variable Time) + * + @param x DBIG number + @return Number of bits in x + */ +extern int BIG_dnbits(DBIG x); + +/** @brief Reduce x mod n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctmod(BIG x, BIG n, int bd); + +/** @brief x=y mod n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctdmod(BIG x, DBIG y, BIG n, int bd); + +/** @brief Divide x by n - constant time for fixed bd + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + @param bd non-negative bit difference between maximum x and n + */ +extern void BIG_ctsdiv(BIG x,BIG n,int bd); + +/** @brief x=y/n - constant time for fixed bd + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + @param bd non-negative bit difference between maximum y and n + */ +extern void BIG_ctddiv(BIG x, DBIG y, BIG n,int bd); + + +/** @brief Reduce x mod n - input and output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be reduced mod n + @param n The modulus + */ +extern void BIG_mod(BIG x, BIG n); +/** @brief Divide x by n - output normalised (Variable Time) + * + Slow but rarely used + @param x BIG number to be divided by n + @param n The Divisor + */ +extern void BIG_sdiv(BIG x, BIG n); +/** @brief x=y mod n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y mod n + @param y DBIG number + @param n Modulus + */ +extern void BIG_dmod(BIG x, DBIG y, BIG n); +/** @brief x=y/n - output normalised (Variable Time) + * + Slow but rarely used. y is destroyed. + @param x BIG number, on exit = y/n + @param y DBIG number + @param n Modulus + */ +extern void BIG_ddiv(BIG x, DBIG y, BIG n); +/** @brief return parity of BIG, that is the least significant bit (Constant Time) + * + @param x BIG number + @return 0 or 1 + */ +extern int BIG_parity(BIG x); +/** @brief return i-th of BIG (Constant Time) + * + @param x BIG number + @param i the bit of x to be returned + @return 0 or 1 + */ +extern int BIG_bit(BIG x, int i); +/** @brief return least significant bits of a BIG (Constant Time) + * + @param x BIG number + @param n number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int BIG_lastbits(BIG x, int n); +/** @brief Create a random BIG from a random number generator (Constant Time) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_random(BIG x, csprng *r); +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randomnum(BIG x, BIG n, csprng *r); + +/** @brief Create an unbiased random BIG from a random number generator, reduced with respect to a modulus and truncated to max bit length (Constant Time as used) + * + Assumes that the random number generator has been suitably initialised + @param x BIG number, on exit a random number + @param n The modulus + @param t Maximum bit length + @param r A pointer to a Cryptographically Secure Random Number Generator + */ +extern void BIG_randtrunc(BIG x, BIG n, int t, csprng *r); + +/** brief return NAF (Non-Adjacent-Form) value as +/- 1, 3 or 5, inputs must be normalised + * + Given x and 3*x extracts NAF value from given bit position, and returns number of bits processed, and number of trailing zeros detected if any + param x BIG number + param x3 BIG number, three times x + param i bit position + param nbs pointer to integer returning number of bits processed + param nzs pointer to integer returning number of trailing 0s + return + or - 1, 3 or 5 +*/ + +/** @brief Calculate x=y*z mod n (Variable Time) + * + Slow method for modular multiplication + @param x BIG number, on exit = y*z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modmul(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y/z mod n (Variable Time) + * + Slow method for modular division + @param x BIG number, on exit = y/z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_moddiv(BIG x, BIG y, BIG z, BIG n); +/** @brief Calculate x=y^2 mod n (Variable Time) + * + Slow method for modular squaring + @param x BIG number, on exit = y^2 mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modsqr(BIG x, BIG y, BIG n); +/** @brief Calculate x=-y mod n (Variable Time) + * + Modular negation + @param x BIG number, on exit = -y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_modneg(BIG x, BIG y, BIG n); + +/** @brief Calculate x=y+z mod n (Variable Time) + * + Slow method for modular addition + @param x BIG number, on exit = y+z mod n + @param y BIG number + @param z BIG number + @param n The BIG Modulus + */ +extern void BIG_modadd(BIG x, BIG y, BIG z, BIG n); + +/** @brief Calculate jacobi Symbol (x/y) (Variable Time) + * + @param x BIG number + @param y BIG number + @return Jacobi symbol, -1,0 or 1 + */ +extern int BIG_jacobi(BIG x, BIG y); +/** @brief Calculate x=1/y mod n (Variable Time) + * + Modular Inversion - This is slow. Uses binary method. + @param x BIG number, on exit = 1/y mod n + @param y BIG number + @param n The BIG Modulus + */ +extern void BIG_invmodp(BIG x, BIG y, BIG n); +/** @brief Calculate x=x mod 2^m (Variable Time) + * + Truncation + @param x BIG number, on reduced mod 2^m + @param m new truncated size +*/ +extern void BIG_mod2m(BIG x, int m); + +/** @brief Calculates a*b+c+*d + * + Calculate partial product of a.b, add in carry c, and add total to d (Constant Time) + @param a multiplier + @param b multiplicand + @param c carry + @param d pointer to accumulated bottom half of result + @return top half of result + */ + + +extern int step1(BIG,BIG,BIG); +extern void step2(BIG,BIG,BIG); + +#ifdef dchunk + +/* Method required to calculate x*y+c+r, bottom half in r, top half returned */ +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + dchunk prod = (dchunk)x * y + c + *r; + *r = (chunk)prod & BMASK_B584_60; + return (chunk)(prod >> BASEBITS_B584_60); +} + +#else + +/* No integer type available that can store double the wordlength */ +/* accumulate partial products */ + +inline chunk muladd(chunk x, chunk y, chunk c, chunk *r) +{ + chunk x0, x1, y0, y1; + chunk bot, top, mid, carry; + x0 = x & HMASK_B584_60; + x1 = (x >> HBITS_B584_60); + y0 = y & HMASK_B584_60; + y1 = (y >> HBITS_B584_60); + bot = x0 * y0; + top = x1 * y1; + mid = x0 * y1 + x1 * y0; + x0 = mid & HMASK_B584_60; + x1 = (mid >> HBITS_B584_60); + bot += x0 << HBITS_B584_60; + bot += *r; + bot += c; + + top += x1; + carry = bot >> BASEBITS_B584_60; + bot &= BMASK_B584_60; + top += carry; + + *r = bot; + return top; +} + +#endif + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls192.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls192.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls192.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls192.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls192_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls192_BLS24479.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls192_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls192_BLS24479.h index e5b67f5..b7302de 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls192_BLS24479.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls192_BLS24479.h @@ -1,86 +1,86 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls192.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS192_BLS24479_H -#define BLS192_BLS24479_H - -#include "pair4_BLS24479.h" - -using namespace core; - -namespace BLS24479 { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_BLS24479 MODBYTES_B480_56 /**< BLS Group Size */ -#define BFS_BLS24479 MODBYTES_B480_56 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param M is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param M is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls192.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS192_BLS24479_H +#define BLS192_BLS24479_H + +#include "pair4_BLS24479.h" + +using namespace core; + +namespace BLS24479 { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_BLS24479 MODBYTES_B480_56 /**< BLS Group Size */ +#define BFS_BLS24479 MODBYTES_B480_56 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param M is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param M is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls256.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls256.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/bls256.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls256.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls256_BLS48286.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls256_BLS48286.h index 323f20b..832a844 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256_BLS48286.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls256_BLS48286.h @@ -1,86 +1,86 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls256.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS256_BLS48286_H -#define BLS256_BLS48286_H - -#include "pair8_BLS48286.h" - -using namespace core; - -namespace BLS48286 { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_BLS48286 MODBYTES_B288_60 /**< BLS Group Size */ -#define BFS_BLS48286 MODBYTES_B288_60 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param m is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param m is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls256.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS256_BLS48286_H +#define BLS256_BLS48286_H + +#include "pair8_BLS48286.h" + +using namespace core; + +namespace BLS48286 { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_BLS48286 MODBYTES_B288_60 /**< BLS Group Size */ +#define BFS_BLS48286 MODBYTES_B288_60 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param m is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param m is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls256_BLS48556.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls256_BLS48556.h index a0b79b2..3173645 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256_BLS48556.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls256_BLS48556.h @@ -1,86 +1,86 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls256.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS256_BLS48556_H -#define BLS256_BLS48556_H - -#include "pair8_BLS48556.h" - -using namespace core; - -namespace BLS48556 { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_BLS48556 MODBYTES_B560_58 /**< BLS Group Size */ -#define BFS_BLS48556 MODBYTES_B560_58 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param m is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param m is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls256.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS256_BLS48556_H +#define BLS256_BLS48556_H + +#include "pair8_BLS48556.h" + +using namespace core; + +namespace BLS48556 { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_BLS48556 MODBYTES_B560_58 /**< BLS Group Size */ +#define BFS_BLS48556 MODBYTES_B560_58 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param m is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param m is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls256_BLS48581.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls256_BLS48581.h index 1196da4..c868eae 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256_BLS48581.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls256_BLS48581.h @@ -1,86 +1,86 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls256.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS256_BLS48581_H -#define BLS256_BLS48581_H - -#include "pair8_BLS48581.h" - -using namespace core; - -namespace BLS48581 { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_BLS48581 MODBYTES_B584_60 /**< BLS Group Size */ -#define BFS_BLS48581 MODBYTES_B584_60 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param m is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param m is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls256.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS256_BLS48581_H +#define BLS256_BLS48581_H + +#include "pair8_BLS48581.h" + +using namespace core; + +namespace BLS48581 { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_BLS48581 MODBYTES_B584_60 /**< BLS Group Size */ +#define BFS_BLS48581 MODBYTES_B584_60 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param m is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param m is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BLS12381.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BLS12381.h index e1bf9ff..de31cce 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BLS12381.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BLS12381.h @@ -1,87 +1,87 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS_BLS12381_H -#define BLS_BLS12381_H - -#include "pair_BLS12381.h" - -using namespace core; - -namespace BLS12381 { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_BLS12381 MODBYTES_B384_58 /**< BLS Group Size */ -#define BFS_BLS12381 MODBYTES_B384_58 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param M is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param M is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS_BLS12381_H +#define BLS_BLS12381_H + +#include "pair_BLS12381.h" + +using namespace core; + +namespace BLS12381 { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_BLS12381 MODBYTES_B384_58 /**< BLS Group Size */ +#define BFS_BLS12381 MODBYTES_B384_58 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param M is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param M is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BLS12383.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BLS12383.h index 32bd832..4eda3f3 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BLS12383.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BLS12383.h @@ -1,87 +1,87 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS_BLS12383_H -#define BLS_BLS12383_H - -#include "pair_BLS12383.h" - -using namespace core; - -namespace BLS12383 { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_BLS12383 MODBYTES_B384_58 /**< BLS Group Size */ -#define BFS_BLS12383 MODBYTES_B384_58 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param M is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param M is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS_BLS12383_H +#define BLS_BLS12383_H + +#include "pair_BLS12383.h" + +using namespace core; + +namespace BLS12383 { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_BLS12383 MODBYTES_B384_58 /**< BLS Group Size */ +#define BFS_BLS12383 MODBYTES_B384_58 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param M is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param M is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BLS12443.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BLS12443.h index 42b13f5..2d14991 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BLS12443.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BLS12443.h @@ -1,87 +1,87 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS_BLS12443_H -#define BLS_BLS12443_H - -#include "pair_BLS12443.h" - -using namespace core; - -namespace BLS12443 { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_BLS12443 MODBYTES_B448_60 /**< BLS Group Size */ -#define BFS_BLS12443 MODBYTES_B448_60 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param M is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param M is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS_BLS12443_H +#define BLS_BLS12443_H + +#include "pair_BLS12443.h" + +using namespace core; + +namespace BLS12443 { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_BLS12443 MODBYTES_B448_60 /**< BLS Group Size */ +#define BFS_BLS12443 MODBYTES_B448_60 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param M is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param M is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BLS12461.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BLS12461.h index f52b401..03a7e2c 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BLS12461.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BLS12461.h @@ -1,87 +1,87 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS_BLS12461_H -#define BLS_BLS12461_H - -#include "pair_BLS12461.h" - -using namespace core; - -namespace BLS12461 { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_BLS12461 MODBYTES_B464_60 /**< BLS Group Size */ -#define BFS_BLS12461 MODBYTES_B464_60 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param M is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param M is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS_BLS12461_H +#define BLS_BLS12461_H + +#include "pair_BLS12461.h" + +using namespace core; + +namespace BLS12461 { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_BLS12461 MODBYTES_B464_60 /**< BLS Group Size */ +#define BFS_BLS12461 MODBYTES_B464_60 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param M is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param M is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BN158.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BN158.h index 5ae3c37..f19142d 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BN158.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BN158.h @@ -1,87 +1,87 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS_BN158_H -#define BLS_BN158_H - -#include "pair_BN158.h" - -using namespace core; - -namespace BN158 { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_BN158 MODBYTES_B160_56 /**< BLS Group Size */ -#define BFS_BN158 MODBYTES_B160_56 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param M is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param M is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS_BN158_H +#define BLS_BN158_H + +#include "pair_BN158.h" + +using namespace core; + +namespace BN158 { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_BN158 MODBYTES_B160_56 /**< BLS Group Size */ +#define BFS_BN158 MODBYTES_B160_56 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param M is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param M is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BN254.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BN254.h index 3c725b6..f331731 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BN254.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BN254.h @@ -1,87 +1,87 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS_BN254_H -#define BLS_BN254_H - -#include "pair_BN254.h" - -using namespace core; - -namespace BN254 { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_BN254 MODBYTES_B256_56 /**< BLS Group Size */ -#define BFS_BN254 MODBYTES_B256_56 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param M is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param M is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS_BN254_H +#define BLS_BN254_H + +#include "pair_BN254.h" + +using namespace core; + +namespace BN254 { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_BN254 MODBYTES_B256_56 /**< BLS Group Size */ +#define BFS_BN254 MODBYTES_B256_56 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param M is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param M is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BN254CX.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BN254CX.h index a8e89b7..10b3b3d 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BN254CX.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BN254CX.h @@ -1,87 +1,87 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS_BN254CX_H -#define BLS_BN254CX_H - -#include "pair_BN254CX.h" - -using namespace core; - -namespace BN254CX { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_BN254CX MODBYTES_B256_56 /**< BLS Group Size */ -#define BFS_BN254CX MODBYTES_B256_56 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param M is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param M is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS_BN254CX_H +#define BLS_BN254CX_H + +#include "pair_BN254CX.h" + +using namespace core; + +namespace BN254CX { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_BN254CX MODBYTES_B256_56 /**< BLS Group Size */ +#define BFS_BN254CX MODBYTES_B256_56 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param M is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param M is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BN462.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BN462.h index 4593746..5563582 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_BN462.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_BN462.h @@ -1,87 +1,87 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS_BN462_H -#define BLS_BN462_H - -#include "pair_BN462.h" - -using namespace core; - -namespace BN462 { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_BN462 MODBYTES_B464_60 /**< BLS Group Size */ -#define BFS_BN462 MODBYTES_B464_60 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param M is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param M is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS_BN462_H +#define BLS_BN462_H + +#include "pair_BN462.h" + +using namespace core; + +namespace BN462 { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_BN462 MODBYTES_B464_60 /**< BLS Group Size */ +#define BFS_BN462 MODBYTES_B464_60 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param M is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param M is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_FP256BN.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_FP256BN.h index d699d50..ab661b5 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_FP256BN.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_FP256BN.h @@ -1,87 +1,87 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS_FP256BN_H -#define BLS_FP256BN_H - -#include "pair_FP256BN.h" - -using namespace core; - -namespace FP256BN { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_FP256BN MODBYTES_B256_56 /**< BLS Group Size */ -#define BFS_FP256BN MODBYTES_B256_56 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param M is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param M is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS_FP256BN_H +#define BLS_FP256BN_H + +#include "pair_FP256BN.h" + +using namespace core; + +namespace FP256BN { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_FP256BN MODBYTES_B256_56 /**< BLS Group Size */ +#define BFS_FP256BN MODBYTES_B256_56 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param M is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param M is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_FP512BN.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_FP512BN.h index ce2b275..1459b24 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls_FP512BN.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/bls_FP512BN.h @@ -1,87 +1,87 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file bls.h - * @author Mike Scott - * @date 28th Novemebr 2018 - * @brief BLS Header file - * - * Allows some user configuration - * defines structures - * declares functions - * - */ - -#ifndef BLS_FP512BN_H -#define BLS_FP512BN_H - -#include "pair_FP512BN.h" - -using namespace core; - -namespace FP512BN { - -/* Field size is assumed to be greater than or equal to group size */ - -#define BGS_FP512BN MODBYTES_B512_60 /**< BLS Group Size */ -#define BFS_FP512BN MODBYTES_B512_60 /**< BLS Field Size */ - -#define BLS_OK 0 /**< Function completed without error */ -#define BLS_FAIL -1 /**< Point is NOT on the curve */ - -/* BLS API functions */ - - -/** @brief Initialise BLS - * - @return BLS_OK if worked, otherwise BLS_FAIL - */ -int BLS_INIT(); - -/** @brief Generate Key Pair - * - @param IKM contains truly random keying material - @param S on output a private key - @param W on output a public key = S*G, where G is fixed generator - @return BLS_OK - */ -int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); - -/** @brief Calculate a signature - * - @param SIG the ouput signature - @param M is the message to be signed - @param S an input private key - @return BLS_OK - */ -int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); - -/** @brief Verify a signature - * - @param SIG an input signature - @param M is the message whose signature is to be verified. - @param W an public key - @return BLS_OK if verified, otherwise BLS_FAIL - */ -int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file bls.h + * @author Mike Scott + * @date 28th Novemebr 2018 + * @brief BLS Header file + * + * Allows some user configuration + * defines structures + * declares functions + * + */ + +#ifndef BLS_FP512BN_H +#define BLS_FP512BN_H + +#include "pair_FP512BN.h" + +using namespace core; + +namespace FP512BN { + +/* Field size is assumed to be greater than or equal to group size */ + +#define BGS_FP512BN MODBYTES_B512_60 /**< BLS Group Size */ +#define BFS_FP512BN MODBYTES_B512_60 /**< BLS Field Size */ + +#define BLS_OK 0 /**< Function completed without error */ +#define BLS_FAIL -1 /**< Point is NOT on the curve */ + +/* BLS API functions */ + + +/** @brief Initialise BLS + * + @return BLS_OK if worked, otherwise BLS_FAIL + */ +int BLS_INIT(); + +/** @brief Generate Key Pair + * + @param IKM contains truly random keying material + @param S on output a private key + @param W on output a public key = S*G, where G is fixed generator + @return BLS_OK + */ +int BLS_KEY_PAIR_GENERATE(octet *IKM, octet* S, octet *W); + +/** @brief Calculate a signature + * + @param SIG the ouput signature + @param M is the message to be signed + @param S an input private key + @return BLS_OK + */ +int BLS_CORE_SIGN(octet *SIG, octet *M, octet *S); + +/** @brief Verify a signature + * + @param SIG an input signature + @param M is the message whose signature is to be verified. + @param W an public key + @return BLS_OK if verified, otherwise BLS_FAIL + */ +int BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_big.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B160_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B160_56.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B160_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B160_56.h index e07a289..3c3e9e7 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B160_56.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B160_56.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B160_56_H -#define CONFIG_BIG_B160_56_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B160_56 20 -#define BASEBITS_B160_56 56 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B160_56_H +#define CONFIG_BIG_B160_56_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B160_56 20 +#define BASEBITS_B160_56 56 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B168_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B168_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B168_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B168_60.h index 5180f26..5cc2f30 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B168_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B168_60.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B168_60_H -#define CONFIG_BIG_B168_60_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B168_60 21 -#define BASEBITS_B168_60 60 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B168_60_H +#define CONFIG_BIG_B168_60_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B168_60 21 +#define BASEBITS_B168_60 60 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B256_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B256_56.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B256_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B256_56.h index 0cb6488..64d8b22 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B256_56.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B256_56.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B256_56_H -#define CONFIG_BIG_B256_56_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B256_56 32 -#define BASEBITS_B256_56 56 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B256_56_H +#define CONFIG_BIG_B256_56_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B256_56 32 +#define BASEBITS_B256_56 56 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B288_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B288_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B288_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B288_60.h index 7aa116a..135663e 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B288_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B288_60.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B288_60_H -#define CONFIG_BIG_B288_60_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B288_60 36 -#define BASEBITS_B288_60 60 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B288_60_H +#define CONFIG_BIG_B288_60_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B288_60 36 +#define BASEBITS_B288_60 60 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B336_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B336_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B336_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B336_60.h index 5cdd05d..db7c7bd 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B336_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B336_60.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B336_60_H -#define CONFIG_BIG_B336_60_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B336_60 42 -#define BASEBITS_B336_60 60 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B336_60_H +#define CONFIG_BIG_B336_60_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B336_60 42 +#define BASEBITS_B336_60 60 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B384_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B384_56.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B384_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B384_56.h index acfb14f..8c707de 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B384_56.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B384_56.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B384_56_H -#define CONFIG_BIG_B384_56_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B384_56 48 -#define BASEBITS_B384_56 56 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B384_56_H +#define CONFIG_BIG_B384_56_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B384_56 48 +#define BASEBITS_B384_56 56 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B384_58.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B384_58.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B384_58.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B384_58.h index 0d9dce8..abc05bb 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B384_58.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B384_58.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B384_58_H -#define CONFIG_BIG_B384_58_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B384_58 48 -#define BASEBITS_B384_58 58 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B384_58_H +#define CONFIG_BIG_B384_58_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B384_58 48 +#define BASEBITS_B384_58 58 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B416_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B416_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B416_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B416_60.h index 8aaab21..f57fbe9 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B416_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B416_60.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B416_60_H -#define CONFIG_BIG_B416_60_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B416_60 52 -#define BASEBITS_B416_60 60 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B416_60_H +#define CONFIG_BIG_B416_60_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B416_60 52 +#define BASEBITS_B416_60 60 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B448_58.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B448_58.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B448_58.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B448_58.h index 83fff6c..bd3d2fa 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B448_58.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B448_58.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B448_58_H -#define CONFIG_BIG_B448_58_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B448_58 56 -#define BASEBITS_B448_58 58 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B448_58_H +#define CONFIG_BIG_B448_58_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B448_58 56 +#define BASEBITS_B448_58 58 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B448_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B448_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B448_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B448_60.h index c031342..622ae94 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B448_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B448_60.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B448_60_H -#define CONFIG_BIG_B448_60_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B448_60 56 -#define BASEBITS_B448_60 60 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B448_60_H +#define CONFIG_BIG_B448_60_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B448_60 56 +#define BASEBITS_B448_60 60 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B464_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B464_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B464_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B464_60.h index cc0daa5..558d678 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B464_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B464_60.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B464_60_H -#define CONFIG_BIG_B464_60_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B464_60 58 -#define BASEBITS_B464_60 60 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B464_60_H +#define CONFIG_BIG_B464_60_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B464_60 58 +#define BASEBITS_B464_60 60 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B480_56.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B480_56.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B480_56.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B480_56.h index 1b0f11f..c7e730c 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B480_56.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B480_56.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B480_56_H -#define CONFIG_BIG_B480_56_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B480_56 60 -#define BASEBITS_B480_56 56 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B480_56_H +#define CONFIG_BIG_B480_56_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B480_56 60 +#define BASEBITS_B480_56 56 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B512_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B512_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B512_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B512_60.h index e2dce43..180f4ab 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B512_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B512_60.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B512_60_H -#define CONFIG_BIG_B512_60_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B512_60 64 -#define BASEBITS_B512_60 60 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B512_60_H +#define CONFIG_BIG_B512_60_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B512_60 64 +#define BASEBITS_B512_60 60 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B528_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B528_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B528_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B528_60.h index fa3c8dc..334db43 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B528_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B528_60.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B528_60_H -#define CONFIG_BIG_B528_60_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B528_60 66 -#define BASEBITS_B528_60 60 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B528_60_H +#define CONFIG_BIG_B528_60_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B528_60 66 +#define BASEBITS_B528_60 60 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B560_58.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B560_58.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B560_58.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B560_58.h index c2f9f59..4157e14 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B560_58.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B560_58.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B560_58_H -#define CONFIG_BIG_B560_58_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B560_58 70 -#define BASEBITS_B560_58 58 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B560_58_H +#define CONFIG_BIG_B560_58_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B560_58 70 +#define BASEBITS_B560_58 58 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B584_60.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B584_60.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B584_60.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B584_60.h index 733d55e..5e611b3 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_big_B584_60.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_big_B584_60.h @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_BIG_B584_60_H -#define CONFIG_BIG_B584_60_H - -#include"core.h" - -// BIG stuff - -#define MODBYTES_B584_60 73 -#define BASEBITS_B584_60 60 - - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_BIG_B584_60_H +#define CONFIG_BIG_B584_60_H + +#include"core.h" + +// BIG stuff + +#define MODBYTES_B584_60 73 +#define BASEBITS_B584_60 60 + + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_curve.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_ANSSI.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_ANSSI.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_ANSSI.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_ANSSI.h index 9b5648f..5fd0554 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_ANSSI.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_ANSSI.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_ANSSI_H -#define CONFIG_CURVE_ANSSI_H - -#include"core.h" -#include"config_field_ANSSI.h" - -// ECP stuff - -#define CURVETYPE_ANSSI WEIERSTRASS -#define CURVE_A_ANSSI -3 -#define PAIRING_FRIENDLY_ANSSI NOT_PF -#define CURVE_SECURITY_ANSSI 128 -#define HTC_ISO_ANSSI 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_ANSSI - -#if PAIRING_FRIENDLY_ANSSI != NOT_PF - -#define HTC_ISO_G2_ANSSI 0 - -#define USE_GLV_ANSSI /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_ANSSI /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_ANSSI /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_ANSSI -#define SIGN_OF_X_ANSSI - -#define ATE_BITS_ANSSI -#define G2_TABLE_ANSSI - -#endif - - -#if CURVE_SECURITY_ANSSI == 128 -#define AESKEY_ANSSI 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_ANSSI SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_ANSSI == 192 -#define AESKEY_ANSSI 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_ANSSI SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_ANSSI == 256 -#define AESKEY_ANSSI 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_ANSSI SHA512 /**< Hash type */ -#endif - - -namespace ANSSI_BIG = B256_56; -namespace ANSSI_FP = ANSSI; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_ANSSI_H +#define CONFIG_CURVE_ANSSI_H + +#include"core.h" +#include"config_field_ANSSI.h" + +// ECP stuff + +#define CURVETYPE_ANSSI WEIERSTRASS +#define CURVE_A_ANSSI -3 +#define PAIRING_FRIENDLY_ANSSI NOT_PF +#define CURVE_SECURITY_ANSSI 128 +#define HTC_ISO_ANSSI 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_ANSSI + +#if PAIRING_FRIENDLY_ANSSI != NOT_PF + +#define HTC_ISO_G2_ANSSI 0 + +#define USE_GLV_ANSSI /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_ANSSI /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_ANSSI /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_ANSSI +#define SIGN_OF_X_ANSSI + +#define ATE_BITS_ANSSI +#define G2_TABLE_ANSSI + +#endif + + +#if CURVE_SECURITY_ANSSI == 128 +#define AESKEY_ANSSI 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_ANSSI SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_ANSSI == 192 +#define AESKEY_ANSSI 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_ANSSI SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_ANSSI == 256 +#define AESKEY_ANSSI 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_ANSSI SHA512 /**< Hash type */ +#endif + + +namespace ANSSI_BIG = B256_56; +namespace ANSSI_FP = ANSSI; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS12381.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS12381.h index 14993f8..16c7f52 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS12381.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS12381.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_BLS12381_H -#define CONFIG_CURVE_BLS12381_H - -#include"core.h" -#include"config_field_BLS12381.h" - -// ECP stuff - -#define CURVETYPE_BLS12381 WEIERSTRASS -#define CURVE_A_BLS12381 0 -#define PAIRING_FRIENDLY_BLS12381 BLS12_CURVE -#define CURVE_SECURITY_BLS12381 128 -#define HTC_ISO_BLS12381 11 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_BLS12381 - -#if PAIRING_FRIENDLY_BLS12381 != NOT_PF - -#define HTC_ISO_G2_BLS12381 3 - -#define USE_GLV_BLS12381 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_BLS12381 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_BLS12381 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_BLS12381 M_TYPE -#define SIGN_OF_X_BLS12381 NEGATIVEX - -#define ATE_BITS_BLS12381 65 -#define G2_TABLE_BLS12381 69 - -#endif - - -#if CURVE_SECURITY_BLS12381 == 128 -#define AESKEY_BLS12381 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_BLS12381 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS12381 == 192 -#define AESKEY_BLS12381 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_BLS12381 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS12381 == 256 -#define AESKEY_BLS12381 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_BLS12381 SHA512 /**< Hash type */ -#endif - - -namespace BLS12381_BIG = B384_58; -namespace BLS12381_FP = BLS12381; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_BLS12381_H +#define CONFIG_CURVE_BLS12381_H + +#include"core.h" +#include"config_field_BLS12381.h" + +// ECP stuff + +#define CURVETYPE_BLS12381 WEIERSTRASS +#define CURVE_A_BLS12381 0 +#define PAIRING_FRIENDLY_BLS12381 BLS12_CURVE +#define CURVE_SECURITY_BLS12381 128 +#define HTC_ISO_BLS12381 11 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_BLS12381 + +#if PAIRING_FRIENDLY_BLS12381 != NOT_PF + +#define HTC_ISO_G2_BLS12381 3 + +#define USE_GLV_BLS12381 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_BLS12381 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_BLS12381 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_BLS12381 M_TYPE +#define SIGN_OF_X_BLS12381 NEGATIVEX + +#define ATE_BITS_BLS12381 65 +#define G2_TABLE_BLS12381 69 + +#endif + + +#if CURVE_SECURITY_BLS12381 == 128 +#define AESKEY_BLS12381 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_BLS12381 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS12381 == 192 +#define AESKEY_BLS12381 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_BLS12381 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS12381 == 256 +#define AESKEY_BLS12381 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_BLS12381 SHA512 /**< Hash type */ +#endif + + +namespace BLS12381_BIG = B384_58; +namespace BLS12381_FP = BLS12381; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS12383.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS12383.h index 9c50bfc..961080b 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS12383.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS12383.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_BLS12383_H -#define CONFIG_CURVE_BLS12383_H - -#include"core.h" -#include"config_field_BLS12383.h" - -// ECP stuff - -#define CURVETYPE_BLS12383 WEIERSTRASS -#define CURVE_A_BLS12383 0 -#define PAIRING_FRIENDLY_BLS12383 BLS12_CURVE -#define CURVE_SECURITY_BLS12383 128 -#define HTC_ISO_BLS12383 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_BLS12383 - -#if PAIRING_FRIENDLY_BLS12383 != NOT_PF - -#define HTC_ISO_G2_BLS12383 0 - -#define USE_GLV_BLS12383 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_BLS12383 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_BLS12383 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_BLS12383 M_TYPE -#define SIGN_OF_X_BLS12383 POSITIVEX - -#define ATE_BITS_BLS12383 65 -#define G2_TABLE_BLS12383 68 - -#endif - - -#if CURVE_SECURITY_BLS12383 == 128 -#define AESKEY_BLS12383 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_BLS12383 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS12383 == 192 -#define AESKEY_BLS12383 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_BLS12383 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS12383 == 256 -#define AESKEY_BLS12383 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_BLS12383 SHA512 /**< Hash type */ -#endif - - -namespace BLS12383_BIG = B384_58; -namespace BLS12383_FP = BLS12383; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_BLS12383_H +#define CONFIG_CURVE_BLS12383_H + +#include"core.h" +#include"config_field_BLS12383.h" + +// ECP stuff + +#define CURVETYPE_BLS12383 WEIERSTRASS +#define CURVE_A_BLS12383 0 +#define PAIRING_FRIENDLY_BLS12383 BLS12_CURVE +#define CURVE_SECURITY_BLS12383 128 +#define HTC_ISO_BLS12383 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_BLS12383 + +#if PAIRING_FRIENDLY_BLS12383 != NOT_PF + +#define HTC_ISO_G2_BLS12383 0 + +#define USE_GLV_BLS12383 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_BLS12383 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_BLS12383 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_BLS12383 M_TYPE +#define SIGN_OF_X_BLS12383 POSITIVEX + +#define ATE_BITS_BLS12383 65 +#define G2_TABLE_BLS12383 68 + +#endif + + +#if CURVE_SECURITY_BLS12383 == 128 +#define AESKEY_BLS12383 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_BLS12383 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS12383 == 192 +#define AESKEY_BLS12383 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_BLS12383 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS12383 == 256 +#define AESKEY_BLS12383 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_BLS12383 SHA512 /**< Hash type */ +#endif + + +namespace BLS12383_BIG = B384_58; +namespace BLS12383_FP = BLS12383; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS12443.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS12443.h index 087b02f..f69036f 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS12443.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS12443.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_BLS12443_H -#define CONFIG_CURVE_BLS12443_H - -#include"core.h" -#include"config_field_BLS12443.h" - -// ECP stuff - -#define CURVETYPE_BLS12443 WEIERSTRASS -#define CURVE_A_BLS12443 0 -#define PAIRING_FRIENDLY_BLS12443 BLS12_CURVE -#define CURVE_SECURITY_BLS12443 128 -#define HTC_ISO_BLS12443 11 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_BLS12443 - -#if PAIRING_FRIENDLY_BLS12443 != NOT_PF - -#define HTC_ISO_G2_BLS12443 3 - -#define USE_GLV_BLS12443 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_BLS12443 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_BLS12443 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_BLS12443 M_TYPE -#define SIGN_OF_X_BLS12443 POSITIVEX - -#define ATE_BITS_BLS12443 75 -#define G2_TABLE_BLS12443 78 - -#endif - - -#if CURVE_SECURITY_BLS12443 == 128 -#define AESKEY_BLS12443 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_BLS12443 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS12443 == 192 -#define AESKEY_BLS12443 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_BLS12443 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS12443 == 256 -#define AESKEY_BLS12443 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_BLS12443 SHA512 /**< Hash type */ -#endif - - -namespace BLS12443_BIG = B448_60; -namespace BLS12443_FP = BLS12443; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_BLS12443_H +#define CONFIG_CURVE_BLS12443_H + +#include"core.h" +#include"config_field_BLS12443.h" + +// ECP stuff + +#define CURVETYPE_BLS12443 WEIERSTRASS +#define CURVE_A_BLS12443 0 +#define PAIRING_FRIENDLY_BLS12443 BLS12_CURVE +#define CURVE_SECURITY_BLS12443 128 +#define HTC_ISO_BLS12443 11 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_BLS12443 + +#if PAIRING_FRIENDLY_BLS12443 != NOT_PF + +#define HTC_ISO_G2_BLS12443 3 + +#define USE_GLV_BLS12443 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_BLS12443 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_BLS12443 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_BLS12443 M_TYPE +#define SIGN_OF_X_BLS12443 POSITIVEX + +#define ATE_BITS_BLS12443 75 +#define G2_TABLE_BLS12443 78 + +#endif + + +#if CURVE_SECURITY_BLS12443 == 128 +#define AESKEY_BLS12443 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_BLS12443 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS12443 == 192 +#define AESKEY_BLS12443 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_BLS12443 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS12443 == 256 +#define AESKEY_BLS12443 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_BLS12443 SHA512 /**< Hash type */ +#endif + + +namespace BLS12443_BIG = B448_60; +namespace BLS12443_FP = BLS12443; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS12461.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS12461.h index 1648b99..d98a7c6 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS12461.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS12461.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_BLS12461_H -#define CONFIG_CURVE_BLS12461_H - -#include"core.h" -#include"config_field_BLS12461.h" - -// ECP stuff - -#define CURVETYPE_BLS12461 WEIERSTRASS -#define CURVE_A_BLS12461 0 -#define PAIRING_FRIENDLY_BLS12461 BLS12_CURVE -#define CURVE_SECURITY_BLS12461 128 -#define HTC_ISO_BLS12461 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_BLS12461 - -#if PAIRING_FRIENDLY_BLS12461 != NOT_PF - -#define HTC_ISO_G2_BLS12461 0 - -#define USE_GLV_BLS12461 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_BLS12461 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_BLS12461 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_BLS12461 M_TYPE -#define SIGN_OF_X_BLS12461 NEGATIVEX - -#define ATE_BITS_BLS12461 78 -#define G2_TABLE_BLS12461 79 - -#endif - - -#if CURVE_SECURITY_BLS12461 == 128 -#define AESKEY_BLS12461 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_BLS12461 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS12461 == 192 -#define AESKEY_BLS12461 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_BLS12461 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS12461 == 256 -#define AESKEY_BLS12461 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_BLS12461 SHA512 /**< Hash type */ -#endif - - -namespace BLS12461_BIG = B464_60; -namespace BLS12461_FP = BLS12461; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_BLS12461_H +#define CONFIG_CURVE_BLS12461_H + +#include"core.h" +#include"config_field_BLS12461.h" + +// ECP stuff + +#define CURVETYPE_BLS12461 WEIERSTRASS +#define CURVE_A_BLS12461 0 +#define PAIRING_FRIENDLY_BLS12461 BLS12_CURVE +#define CURVE_SECURITY_BLS12461 128 +#define HTC_ISO_BLS12461 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_BLS12461 + +#if PAIRING_FRIENDLY_BLS12461 != NOT_PF + +#define HTC_ISO_G2_BLS12461 0 + +#define USE_GLV_BLS12461 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_BLS12461 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_BLS12461 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_BLS12461 M_TYPE +#define SIGN_OF_X_BLS12461 NEGATIVEX + +#define ATE_BITS_BLS12461 78 +#define G2_TABLE_BLS12461 79 + +#endif + + +#if CURVE_SECURITY_BLS12461 == 128 +#define AESKEY_BLS12461 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_BLS12461 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS12461 == 192 +#define AESKEY_BLS12461 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_BLS12461 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS12461 == 256 +#define AESKEY_BLS12461 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_BLS12461 SHA512 /**< Hash type */ +#endif + + +namespace BLS12461_BIG = B464_60; +namespace BLS12461_FP = BLS12461; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS24479.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS24479.h index 1c1735b..15194b7 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS24479.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS24479.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_BLS24479_H -#define CONFIG_CURVE_BLS24479_H - -#include"core.h" -#include"config_field_BLS24479.h" - -// ECP stuff - -#define CURVETYPE_BLS24479 WEIERSTRASS -#define CURVE_A_BLS24479 0 -#define PAIRING_FRIENDLY_BLS24479 BLS24_CURVE -#define CURVE_SECURITY_BLS24479 192 -#define HTC_ISO_BLS24479 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_BLS24479 - -#if PAIRING_FRIENDLY_BLS24479 != NOT_PF - -#define HTC_ISO_G2_BLS24479 0 - -#define USE_GLV_BLS24479 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_BLS24479 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_BLS24479 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_BLS24479 M_TYPE -#define SIGN_OF_X_BLS24479 POSITIVEX - -#define ATE_BITS_BLS24479 49 -#define G2_TABLE_BLS24479 52 - -#endif - - -#if CURVE_SECURITY_BLS24479 == 128 -#define AESKEY_BLS24479 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_BLS24479 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS24479 == 192 -#define AESKEY_BLS24479 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_BLS24479 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS24479 == 256 -#define AESKEY_BLS24479 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_BLS24479 SHA512 /**< Hash type */ -#endif - - -namespace BLS24479_BIG = B480_56; -namespace BLS24479_FP = BLS24479; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_BLS24479_H +#define CONFIG_CURVE_BLS24479_H + +#include"core.h" +#include"config_field_BLS24479.h" + +// ECP stuff + +#define CURVETYPE_BLS24479 WEIERSTRASS +#define CURVE_A_BLS24479 0 +#define PAIRING_FRIENDLY_BLS24479 BLS24_CURVE +#define CURVE_SECURITY_BLS24479 192 +#define HTC_ISO_BLS24479 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_BLS24479 + +#if PAIRING_FRIENDLY_BLS24479 != NOT_PF + +#define HTC_ISO_G2_BLS24479 0 + +#define USE_GLV_BLS24479 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_BLS24479 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_BLS24479 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_BLS24479 M_TYPE +#define SIGN_OF_X_BLS24479 POSITIVEX + +#define ATE_BITS_BLS24479 49 +#define G2_TABLE_BLS24479 52 + +#endif + + +#if CURVE_SECURITY_BLS24479 == 128 +#define AESKEY_BLS24479 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_BLS24479 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS24479 == 192 +#define AESKEY_BLS24479 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_BLS24479 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS24479 == 256 +#define AESKEY_BLS24479 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_BLS24479 SHA512 /**< Hash type */ +#endif + + +namespace BLS24479_BIG = B480_56; +namespace BLS24479_FP = BLS24479; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS48286.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS48286.h index 792c00e..90bbad7 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS48286.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS48286.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_BLS48286_H -#define CONFIG_CURVE_BLS48286_H - -#include"core.h" -#include"config_field_BLS48286.h" - -// ECP stuff - -#define CURVETYPE_BLS48286 WEIERSTRASS -#define CURVE_A_BLS48286 0 -#define PAIRING_FRIENDLY_BLS48286 BLS48_CURVE -#define CURVE_SECURITY_BLS48286 128 -#define HTC_ISO_BLS48286 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_BLS48286 - -#if PAIRING_FRIENDLY_BLS48286 != NOT_PF - -#define HTC_ISO_G2_BLS48286 0 - -#define USE_GLV_BLS48286 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_BLS48286 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_BLS48286 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_BLS48286 M_TYPE -#define SIGN_OF_X_BLS48286 POSITIVEX - -#define ATE_BITS_BLS48286 17 -#define G2_TABLE_BLS48286 20 - -#endif - - -#if CURVE_SECURITY_BLS48286 == 128 -#define AESKEY_BLS48286 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_BLS48286 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS48286 == 192 -#define AESKEY_BLS48286 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_BLS48286 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS48286 == 256 -#define AESKEY_BLS48286 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_BLS48286 SHA512 /**< Hash type */ -#endif - - -namespace BLS48286_BIG = B288_60; -namespace BLS48286_FP = BLS48286; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_BLS48286_H +#define CONFIG_CURVE_BLS48286_H + +#include"core.h" +#include"config_field_BLS48286.h" + +// ECP stuff + +#define CURVETYPE_BLS48286 WEIERSTRASS +#define CURVE_A_BLS48286 0 +#define PAIRING_FRIENDLY_BLS48286 BLS48_CURVE +#define CURVE_SECURITY_BLS48286 128 +#define HTC_ISO_BLS48286 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_BLS48286 + +#if PAIRING_FRIENDLY_BLS48286 != NOT_PF + +#define HTC_ISO_G2_BLS48286 0 + +#define USE_GLV_BLS48286 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_BLS48286 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_BLS48286 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_BLS48286 M_TYPE +#define SIGN_OF_X_BLS48286 POSITIVEX + +#define ATE_BITS_BLS48286 17 +#define G2_TABLE_BLS48286 20 + +#endif + + +#if CURVE_SECURITY_BLS48286 == 128 +#define AESKEY_BLS48286 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_BLS48286 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS48286 == 192 +#define AESKEY_BLS48286 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_BLS48286 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS48286 == 256 +#define AESKEY_BLS48286 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_BLS48286 SHA512 /**< Hash type */ +#endif + + +namespace BLS48286_BIG = B288_60; +namespace BLS48286_FP = BLS48286; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS48556.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS48556.h index dd20b2a..91e026b 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS48556.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS48556.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_BLS48556_H -#define CONFIG_CURVE_BLS48556_H - -#include"core.h" -#include"config_field_BLS48556.h" - -// ECP stuff - -#define CURVETYPE_BLS48556 WEIERSTRASS -#define CURVE_A_BLS48556 0 -#define PAIRING_FRIENDLY_BLS48556 BLS48_CURVE -#define CURVE_SECURITY_BLS48556 256 -#define HTC_ISO_BLS48556 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_BLS48556 - -#if PAIRING_FRIENDLY_BLS48556 != NOT_PF - -#define HTC_ISO_G2_BLS48556 0 - -#define USE_GLV_BLS48556 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_BLS48556 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_BLS48556 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_BLS48556 M_TYPE -#define SIGN_OF_X_BLS48556 POSITIVEX - -#define ATE_BITS_BLS48556 32 -#define G2_TABLE_BLS48556 35 - -#endif - - -#if CURVE_SECURITY_BLS48556 == 128 -#define AESKEY_BLS48556 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_BLS48556 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS48556 == 192 -#define AESKEY_BLS48556 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_BLS48556 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS48556 == 256 -#define AESKEY_BLS48556 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_BLS48556 SHA512 /**< Hash type */ -#endif - - -namespace BLS48556_BIG = B560_58; -namespace BLS48556_FP = BLS48556; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_BLS48556_H +#define CONFIG_CURVE_BLS48556_H + +#include"core.h" +#include"config_field_BLS48556.h" + +// ECP stuff + +#define CURVETYPE_BLS48556 WEIERSTRASS +#define CURVE_A_BLS48556 0 +#define PAIRING_FRIENDLY_BLS48556 BLS48_CURVE +#define CURVE_SECURITY_BLS48556 256 +#define HTC_ISO_BLS48556 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_BLS48556 + +#if PAIRING_FRIENDLY_BLS48556 != NOT_PF + +#define HTC_ISO_G2_BLS48556 0 + +#define USE_GLV_BLS48556 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_BLS48556 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_BLS48556 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_BLS48556 M_TYPE +#define SIGN_OF_X_BLS48556 POSITIVEX + +#define ATE_BITS_BLS48556 32 +#define G2_TABLE_BLS48556 35 + +#endif + + +#if CURVE_SECURITY_BLS48556 == 128 +#define AESKEY_BLS48556 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_BLS48556 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS48556 == 192 +#define AESKEY_BLS48556 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_BLS48556 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS48556 == 256 +#define AESKEY_BLS48556 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_BLS48556 SHA512 /**< Hash type */ +#endif + + +namespace BLS48556_BIG = B560_58; +namespace BLS48556_FP = BLS48556; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS48581.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS48581.h index fe21b47..e74b07b 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BLS48581.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BLS48581.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_BLS48581_H -#define CONFIG_CURVE_BLS48581_H - -#include"core.h" -#include"config_field_BLS48581.h" - -// ECP stuff - -#define CURVETYPE_BLS48581 WEIERSTRASS -#define CURVE_A_BLS48581 0 -#define PAIRING_FRIENDLY_BLS48581 BLS48_CURVE -#define CURVE_SECURITY_BLS48581 256 -#define HTC_ISO_BLS48581 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_BLS48581 - -#if PAIRING_FRIENDLY_BLS48581 != NOT_PF - -#define HTC_ISO_G2_BLS48581 0 - -#define USE_GLV_BLS48581 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_BLS48581 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_BLS48581 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_BLS48581 D_TYPE -#define SIGN_OF_X_BLS48581 NEGATIVEX - -#define ATE_BITS_BLS48581 33 -#define G2_TABLE_BLS48581 36 - -#endif - - -#if CURVE_SECURITY_BLS48581 == 128 -#define AESKEY_BLS48581 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_BLS48581 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS48581 == 192 -#define AESKEY_BLS48581 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_BLS48581 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BLS48581 == 256 -#define AESKEY_BLS48581 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_BLS48581 SHA512 /**< Hash type */ -#endif - - -namespace BLS48581_BIG = B584_60; -namespace BLS48581_FP = BLS48581; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_BLS48581_H +#define CONFIG_CURVE_BLS48581_H + +#include"core.h" +#include"config_field_BLS48581.h" + +// ECP stuff + +#define CURVETYPE_BLS48581 WEIERSTRASS +#define CURVE_A_BLS48581 0 +#define PAIRING_FRIENDLY_BLS48581 BLS48_CURVE +#define CURVE_SECURITY_BLS48581 256 +#define HTC_ISO_BLS48581 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_BLS48581 + +#if PAIRING_FRIENDLY_BLS48581 != NOT_PF + +#define HTC_ISO_G2_BLS48581 0 + +#define USE_GLV_BLS48581 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_BLS48581 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_BLS48581 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_BLS48581 D_TYPE +#define SIGN_OF_X_BLS48581 NEGATIVEX + +#define ATE_BITS_BLS48581 33 +#define G2_TABLE_BLS48581 36 + +#endif + + +#if CURVE_SECURITY_BLS48581 == 128 +#define AESKEY_BLS48581 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_BLS48581 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS48581 == 192 +#define AESKEY_BLS48581 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_BLS48581 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BLS48581 == 256 +#define AESKEY_BLS48581 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_BLS48581 SHA512 /**< Hash type */ +#endif + + +namespace BLS48581_BIG = B584_60; +namespace BLS48581_FP = BLS48581; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BN158.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BN158.h index 821f6ac..5a689fe 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BN158.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BN158.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_BN158_H -#define CONFIG_CURVE_BN158_H - -#include"core.h" -#include"config_field_BN158.h" - -// ECP stuff - -#define CURVETYPE_BN158 WEIERSTRASS -#define CURVE_A_BN158 0 -#define PAIRING_FRIENDLY_BN158 BN_CURVE -#define CURVE_SECURITY_BN158 128 -#define HTC_ISO_BN158 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_BN158 - -#if PAIRING_FRIENDLY_BN158 != NOT_PF - -#define HTC_ISO_G2_BN158 0 - -#define USE_GLV_BN158 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_BN158 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_BN158 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_BN158 M_TYPE -#define SIGN_OF_X_BN158 NEGATIVEX - -#define ATE_BITS_BN158 42 -#define G2_TABLE_BN158 49 - -#endif - - -#if CURVE_SECURITY_BN158 == 128 -#define AESKEY_BN158 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_BN158 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BN158 == 192 -#define AESKEY_BN158 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_BN158 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BN158 == 256 -#define AESKEY_BN158 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_BN158 SHA512 /**< Hash type */ -#endif - - -namespace BN158_BIG = B160_56; -namespace BN158_FP = BN158; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_BN158_H +#define CONFIG_CURVE_BN158_H + +#include"core.h" +#include"config_field_BN158.h" + +// ECP stuff + +#define CURVETYPE_BN158 WEIERSTRASS +#define CURVE_A_BN158 0 +#define PAIRING_FRIENDLY_BN158 BN_CURVE +#define CURVE_SECURITY_BN158 128 +#define HTC_ISO_BN158 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_BN158 + +#if PAIRING_FRIENDLY_BN158 != NOT_PF + +#define HTC_ISO_G2_BN158 0 + +#define USE_GLV_BN158 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_BN158 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_BN158 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_BN158 M_TYPE +#define SIGN_OF_X_BN158 NEGATIVEX + +#define ATE_BITS_BN158 42 +#define G2_TABLE_BN158 49 + +#endif + + +#if CURVE_SECURITY_BN158 == 128 +#define AESKEY_BN158 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_BN158 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BN158 == 192 +#define AESKEY_BN158 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_BN158 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BN158 == 256 +#define AESKEY_BN158 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_BN158 SHA512 /**< Hash type */ +#endif + + +namespace BN158_BIG = B160_56; +namespace BN158_FP = BN158; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BN254.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BN254.h index f1bef15..0432c16 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BN254.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BN254.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_BN254_H -#define CONFIG_CURVE_BN254_H - -#include"core.h" -#include"config_field_BN254.h" - -// ECP stuff - -#define CURVETYPE_BN254 WEIERSTRASS -#define CURVE_A_BN254 0 -#define PAIRING_FRIENDLY_BN254 BN_CURVE -#define CURVE_SECURITY_BN254 128 -#define HTC_ISO_BN254 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_BN254 - -#if PAIRING_FRIENDLY_BN254 != NOT_PF - -#define HTC_ISO_G2_BN254 0 - -#define USE_GLV_BN254 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_BN254 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_BN254 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_BN254 D_TYPE -#define SIGN_OF_X_BN254 NEGATIVEX - -#define ATE_BITS_BN254 66 -#define G2_TABLE_BN254 71 - -#endif - - -#if CURVE_SECURITY_BN254 == 128 -#define AESKEY_BN254 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_BN254 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BN254 == 192 -#define AESKEY_BN254 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_BN254 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BN254 == 256 -#define AESKEY_BN254 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_BN254 SHA512 /**< Hash type */ -#endif - - -namespace BN254_BIG = B256_56; -namespace BN254_FP = BN254; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_BN254_H +#define CONFIG_CURVE_BN254_H + +#include"core.h" +#include"config_field_BN254.h" + +// ECP stuff + +#define CURVETYPE_BN254 WEIERSTRASS +#define CURVE_A_BN254 0 +#define PAIRING_FRIENDLY_BN254 BN_CURVE +#define CURVE_SECURITY_BN254 128 +#define HTC_ISO_BN254 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_BN254 + +#if PAIRING_FRIENDLY_BN254 != NOT_PF + +#define HTC_ISO_G2_BN254 0 + +#define USE_GLV_BN254 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_BN254 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_BN254 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_BN254 D_TYPE +#define SIGN_OF_X_BN254 NEGATIVEX + +#define ATE_BITS_BN254 66 +#define G2_TABLE_BN254 71 + +#endif + + +#if CURVE_SECURITY_BN254 == 128 +#define AESKEY_BN254 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_BN254 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BN254 == 192 +#define AESKEY_BN254 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_BN254 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BN254 == 256 +#define AESKEY_BN254 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_BN254 SHA512 /**< Hash type */ +#endif + + +namespace BN254_BIG = B256_56; +namespace BN254_FP = BN254; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BN254CX.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BN254CX.h index f446cac..af24e20 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BN254CX.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BN254CX.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_BN254CX_H -#define CONFIG_CURVE_BN254CX_H - -#include"core.h" -#include"config_field_BN254CX.h" - -// ECP stuff - -#define CURVETYPE_BN254CX WEIERSTRASS -#define CURVE_A_BN254CX 0 -#define PAIRING_FRIENDLY_BN254CX BN_CURVE -#define CURVE_SECURITY_BN254CX 128 -#define HTC_ISO_BN254CX 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_BN254CX - -#if PAIRING_FRIENDLY_BN254CX != NOT_PF - -#define HTC_ISO_G2_BN254CX 0 - -#define USE_GLV_BN254CX /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_BN254CX /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_BN254CX /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_BN254CX D_TYPE -#define SIGN_OF_X_BN254CX NEGATIVEX - -#define ATE_BITS_BN254CX 66 -#define G2_TABLE_BN254CX 76 - -#endif - - -#if CURVE_SECURITY_BN254CX == 128 -#define AESKEY_BN254CX 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_BN254CX SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BN254CX == 192 -#define AESKEY_BN254CX 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_BN254CX SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BN254CX == 256 -#define AESKEY_BN254CX 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_BN254CX SHA512 /**< Hash type */ -#endif - - -namespace BN254CX_BIG = B256_56; -namespace BN254CX_FP = BN254CX; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_BN254CX_H +#define CONFIG_CURVE_BN254CX_H + +#include"core.h" +#include"config_field_BN254CX.h" + +// ECP stuff + +#define CURVETYPE_BN254CX WEIERSTRASS +#define CURVE_A_BN254CX 0 +#define PAIRING_FRIENDLY_BN254CX BN_CURVE +#define CURVE_SECURITY_BN254CX 128 +#define HTC_ISO_BN254CX 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_BN254CX + +#if PAIRING_FRIENDLY_BN254CX != NOT_PF + +#define HTC_ISO_G2_BN254CX 0 + +#define USE_GLV_BN254CX /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_BN254CX /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_BN254CX /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_BN254CX D_TYPE +#define SIGN_OF_X_BN254CX NEGATIVEX + +#define ATE_BITS_BN254CX 66 +#define G2_TABLE_BN254CX 76 + +#endif + + +#if CURVE_SECURITY_BN254CX == 128 +#define AESKEY_BN254CX 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_BN254CX SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BN254CX == 192 +#define AESKEY_BN254CX 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_BN254CX SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BN254CX == 256 +#define AESKEY_BN254CX 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_BN254CX SHA512 /**< Hash type */ +#endif + + +namespace BN254CX_BIG = B256_56; +namespace BN254CX_FP = BN254CX; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BN462.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BN462.h index 51b4309..db222d6 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BN462.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BN462.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_BN462_H -#define CONFIG_CURVE_BN462_H - -#include"core.h" -#include"config_field_BN462.h" - -// ECP stuff - -#define CURVETYPE_BN462 WEIERSTRASS -#define CURVE_A_BN462 0 -#define PAIRING_FRIENDLY_BN462 BN_CURVE -#define CURVE_SECURITY_BN462 128 -#define HTC_ISO_BN462 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_BN462 - -#if PAIRING_FRIENDLY_BN462 != NOT_PF - -#define HTC_ISO_G2_BN462 0 - -#define USE_GLV_BN462 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_BN462 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_BN462 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_BN462 D_TYPE -#define SIGN_OF_X_BN462 POSITIVEX - -#define ATE_BITS_BN462 118 -#define G2_TABLE_BN462 125 - -#endif - - -#if CURVE_SECURITY_BN462 == 128 -#define AESKEY_BN462 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_BN462 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BN462 == 192 -#define AESKEY_BN462 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_BN462 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BN462 == 256 -#define AESKEY_BN462 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_BN462 SHA512 /**< Hash type */ -#endif - - -namespace BN462_BIG = B464_60; -namespace BN462_FP = BN462; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_BN462_H +#define CONFIG_CURVE_BN462_H + +#include"core.h" +#include"config_field_BN462.h" + +// ECP stuff + +#define CURVETYPE_BN462 WEIERSTRASS +#define CURVE_A_BN462 0 +#define PAIRING_FRIENDLY_BN462 BN_CURVE +#define CURVE_SECURITY_BN462 128 +#define HTC_ISO_BN462 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_BN462 + +#if PAIRING_FRIENDLY_BN462 != NOT_PF + +#define HTC_ISO_G2_BN462 0 + +#define USE_GLV_BN462 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_BN462 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_BN462 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_BN462 D_TYPE +#define SIGN_OF_X_BN462 POSITIVEX + +#define ATE_BITS_BN462 118 +#define G2_TABLE_BN462 125 + +#endif + + +#if CURVE_SECURITY_BN462 == 128 +#define AESKEY_BN462 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_BN462 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BN462 == 192 +#define AESKEY_BN462 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_BN462 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BN462 == 256 +#define AESKEY_BN462 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_BN462 SHA512 /**< Hash type */ +#endif + + +namespace BN462_BIG = B464_60; +namespace BN462_FP = BN462; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BRAINPOOL.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BRAINPOOL.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BRAINPOOL.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BRAINPOOL.h index 29cd927..bb29fb8 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_BRAINPOOL.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_BRAINPOOL.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_BRAINPOOL_H -#define CONFIG_CURVE_BRAINPOOL_H - -#include"core.h" -#include"config_field_BRAINPOOL.h" - -// ECP stuff - -#define CURVETYPE_BRAINPOOL WEIERSTRASS -#define CURVE_A_BRAINPOOL -3 -#define PAIRING_FRIENDLY_BRAINPOOL NOT_PF -#define CURVE_SECURITY_BRAINPOOL 128 -#define HTC_ISO_BRAINPOOL 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_BRAINPOOL - -#if PAIRING_FRIENDLY_BRAINPOOL != NOT_PF - -#define HTC_ISO_G2_BRAINPOOL 0 - -#define USE_GLV_BRAINPOOL /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_BRAINPOOL /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_BRAINPOOL /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_BRAINPOOL -#define SIGN_OF_X_BRAINPOOL - -#define ATE_BITS_BRAINPOOL -#define G2_TABLE_BRAINPOOL - -#endif - - -#if CURVE_SECURITY_BRAINPOOL == 128 -#define AESKEY_BRAINPOOL 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_BRAINPOOL SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BRAINPOOL == 192 -#define AESKEY_BRAINPOOL 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_BRAINPOOL SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_BRAINPOOL == 256 -#define AESKEY_BRAINPOOL 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_BRAINPOOL SHA512 /**< Hash type */ -#endif - - -namespace BRAINPOOL_BIG = B256_56; -namespace BRAINPOOL_FP = BRAINPOOL; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_BRAINPOOL_H +#define CONFIG_CURVE_BRAINPOOL_H + +#include"core.h" +#include"config_field_BRAINPOOL.h" + +// ECP stuff + +#define CURVETYPE_BRAINPOOL WEIERSTRASS +#define CURVE_A_BRAINPOOL -3 +#define PAIRING_FRIENDLY_BRAINPOOL NOT_PF +#define CURVE_SECURITY_BRAINPOOL 128 +#define HTC_ISO_BRAINPOOL 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_BRAINPOOL + +#if PAIRING_FRIENDLY_BRAINPOOL != NOT_PF + +#define HTC_ISO_G2_BRAINPOOL 0 + +#define USE_GLV_BRAINPOOL /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_BRAINPOOL /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_BRAINPOOL /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_BRAINPOOL +#define SIGN_OF_X_BRAINPOOL + +#define ATE_BITS_BRAINPOOL +#define G2_TABLE_BRAINPOOL + +#endif + + +#if CURVE_SECURITY_BRAINPOOL == 128 +#define AESKEY_BRAINPOOL 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_BRAINPOOL SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BRAINPOOL == 192 +#define AESKEY_BRAINPOOL 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_BRAINPOOL SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_BRAINPOOL == 256 +#define AESKEY_BRAINPOOL 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_BRAINPOOL SHA512 /**< Hash type */ +#endif + + +namespace BRAINPOOL_BIG = B256_56; +namespace BRAINPOOL_FP = BRAINPOOL; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C1174.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C1174.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C1174.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C1174.h index d759ba7..14eb019 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C1174.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C1174.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_C1174_H -#define CONFIG_CURVE_C1174_H - -#include"core.h" -#include"config_field_C1174.h" - -// ECP stuff - -#define CURVETYPE_C1174 EDWARDS -#define CURVE_A_C1174 1 -#define PAIRING_FRIENDLY_C1174 NOT_PF -#define CURVE_SECURITY_C1174 128 -#define HTC_ISO_C1174 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_C1174 - -#if PAIRING_FRIENDLY_C1174 != NOT_PF - -#define HTC_ISO_G2_C1174 0 - -#define USE_GLV_C1174 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_C1174 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_C1174 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_C1174 -#define SIGN_OF_X_C1174 - -#define ATE_BITS_C1174 -#define G2_TABLE_C1174 - -#endif - - -#if CURVE_SECURITY_C1174 == 128 -#define AESKEY_C1174 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_C1174 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_C1174 == 192 -#define AESKEY_C1174 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_C1174 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_C1174 == 256 -#define AESKEY_C1174 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_C1174 SHA512 /**< Hash type */ -#endif - - -namespace C1174_BIG = B256_56; -namespace C1174_FP = C1174; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_C1174_H +#define CONFIG_CURVE_C1174_H + +#include"core.h" +#include"config_field_C1174.h" + +// ECP stuff + +#define CURVETYPE_C1174 EDWARDS +#define CURVE_A_C1174 1 +#define PAIRING_FRIENDLY_C1174 NOT_PF +#define CURVE_SECURITY_C1174 128 +#define HTC_ISO_C1174 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_C1174 + +#if PAIRING_FRIENDLY_C1174 != NOT_PF + +#define HTC_ISO_G2_C1174 0 + +#define USE_GLV_C1174 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_C1174 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_C1174 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_C1174 +#define SIGN_OF_X_C1174 + +#define ATE_BITS_C1174 +#define G2_TABLE_C1174 + +#endif + + +#if CURVE_SECURITY_C1174 == 128 +#define AESKEY_C1174 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_C1174 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_C1174 == 192 +#define AESKEY_C1174 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_C1174 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_C1174 == 256 +#define AESKEY_C1174 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_C1174 SHA512 /**< Hash type */ +#endif + + +namespace C1174_BIG = B256_56; +namespace C1174_FP = C1174; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C13318.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C13318.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C13318.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C13318.h index eea03ff..2107469 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C13318.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C13318.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_C13318_H -#define CONFIG_CURVE_C13318_H - -#include"core.h" -#include"config_field_F25519.h" - -// ECP stuff - -#define CURVETYPE_C13318 WEIERSTRASS -#define CURVE_A_C13318 -3 -#define PAIRING_FRIENDLY_C13318 NOT_PF -#define CURVE_SECURITY_C13318 128 -#define HTC_ISO_C13318 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_C13318 - -#if PAIRING_FRIENDLY_C13318 != NOT_PF - -#define HTC_ISO_G2_C13318 0 - -#define USE_GLV_C13318 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_C13318 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_C13318 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_C13318 -#define SIGN_OF_X_C13318 - -#define ATE_BITS_C13318 -#define G2_TABLE_C13318 - -#endif - - -#if CURVE_SECURITY_C13318 == 128 -#define AESKEY_C13318 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_C13318 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_C13318 == 192 -#define AESKEY_C13318 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_C13318 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_C13318 == 256 -#define AESKEY_C13318 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_C13318 SHA512 /**< Hash type */ -#endif - - -namespace C13318_BIG = B256_56; -namespace C13318_FP = F25519; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_C13318_H +#define CONFIG_CURVE_C13318_H + +#include"core.h" +#include"config_field_F25519.h" + +// ECP stuff + +#define CURVETYPE_C13318 WEIERSTRASS +#define CURVE_A_C13318 -3 +#define PAIRING_FRIENDLY_C13318 NOT_PF +#define CURVE_SECURITY_C13318 128 +#define HTC_ISO_C13318 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_C13318 + +#if PAIRING_FRIENDLY_C13318 != NOT_PF + +#define HTC_ISO_G2_C13318 0 + +#define USE_GLV_C13318 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_C13318 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_C13318 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_C13318 +#define SIGN_OF_X_C13318 + +#define ATE_BITS_C13318 +#define G2_TABLE_C13318 + +#endif + + +#if CURVE_SECURITY_C13318 == 128 +#define AESKEY_C13318 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_C13318 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_C13318 == 192 +#define AESKEY_C13318 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_C13318 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_C13318 == 256 +#define AESKEY_C13318 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_C13318 SHA512 /**< Hash type */ +#endif + + +namespace C13318_BIG = B256_56; +namespace C13318_FP = F25519; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C1665.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C1665.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C1665.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C1665.h index f8239c7..256fa7f 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C1665.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C1665.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_C1665_H -#define CONFIG_CURVE_C1665_H - -#include"core.h" -#include"config_field_C1665.h" - -// ECP stuff - -#define CURVETYPE_C1665 EDWARDS -#define CURVE_A_C1665 1 -#define PAIRING_FRIENDLY_C1665 NOT_PF -#define CURVE_SECURITY_C1665 128 -#define HTC_ISO_C1665 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_C1665 - -#if PAIRING_FRIENDLY_C1665 != NOT_PF - -#define HTC_ISO_G2_C1665 0 - -#define USE_GLV_C1665 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_C1665 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_C1665 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_C1665 -#define SIGN_OF_X_C1665 - -#define ATE_BITS_C1665 -#define G2_TABLE_C1665 - -#endif - - -#if CURVE_SECURITY_C1665 == 128 -#define AESKEY_C1665 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_C1665 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_C1665 == 192 -#define AESKEY_C1665 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_C1665 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_C1665 == 256 -#define AESKEY_C1665 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_C1665 SHA512 /**< Hash type */ -#endif - - -namespace C1665_BIG = B168_60; -namespace C1665_FP = C1665; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_C1665_H +#define CONFIG_CURVE_C1665_H + +#include"core.h" +#include"config_field_C1665.h" + +// ECP stuff + +#define CURVETYPE_C1665 EDWARDS +#define CURVE_A_C1665 1 +#define PAIRING_FRIENDLY_C1665 NOT_PF +#define CURVE_SECURITY_C1665 128 +#define HTC_ISO_C1665 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_C1665 + +#if PAIRING_FRIENDLY_C1665 != NOT_PF + +#define HTC_ISO_G2_C1665 0 + +#define USE_GLV_C1665 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_C1665 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_C1665 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_C1665 +#define SIGN_OF_X_C1665 + +#define ATE_BITS_C1665 +#define G2_TABLE_C1665 + +#endif + + +#if CURVE_SECURITY_C1665 == 128 +#define AESKEY_C1665 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_C1665 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_C1665 == 192 +#define AESKEY_C1665 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_C1665 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_C1665 == 256 +#define AESKEY_C1665 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_C1665 SHA512 /**< Hash type */ +#endif + + +namespace C1665_BIG = B168_60; +namespace C1665_FP = C1665; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C25519.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C25519.h index ffa0325..21b6ce6 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C25519.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C25519.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_C25519_H -#define CONFIG_CURVE_C25519_H - -#include"core.h" -#include"config_field_F25519.h" - -// ECP stuff - -#define CURVETYPE_C25519 MONTGOMERY -#define CURVE_A_C25519 486662 -#define PAIRING_FRIENDLY_C25519 NOT_PF -#define CURVE_SECURITY_C25519 128 -#define HTC_ISO_C25519 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_C25519 - -#if PAIRING_FRIENDLY_C25519 != NOT_PF - -#define HTC_ISO_G2_C25519 0 - -#define USE_GLV_C25519 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_C25519 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_C25519 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_C25519 -#define SIGN_OF_X_C25519 - -#define ATE_BITS_C25519 -#define G2_TABLE_C25519 - -#endif - - -#if CURVE_SECURITY_C25519 == 128 -#define AESKEY_C25519 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_C25519 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_C25519 == 192 -#define AESKEY_C25519 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_C25519 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_C25519 == 256 -#define AESKEY_C25519 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_C25519 SHA512 /**< Hash type */ -#endif - - -namespace C25519_BIG = B256_56; -namespace C25519_FP = F25519; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_C25519_H +#define CONFIG_CURVE_C25519_H + +#include"core.h" +#include"config_field_F25519.h" + +// ECP stuff + +#define CURVETYPE_C25519 MONTGOMERY +#define CURVE_A_C25519 486662 +#define PAIRING_FRIENDLY_C25519 NOT_PF +#define CURVE_SECURITY_C25519 128 +#define HTC_ISO_C25519 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_C25519 + +#if PAIRING_FRIENDLY_C25519 != NOT_PF + +#define HTC_ISO_G2_C25519 0 + +#define USE_GLV_C25519 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_C25519 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_C25519 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_C25519 +#define SIGN_OF_X_C25519 + +#define ATE_BITS_C25519 +#define G2_TABLE_C25519 + +#endif + + +#if CURVE_SECURITY_C25519 == 128 +#define AESKEY_C25519 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_C25519 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_C25519 == 192 +#define AESKEY_C25519 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_C25519 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_C25519 == 256 +#define AESKEY_C25519 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_C25519 SHA512 /**< Hash type */ +#endif + + +namespace C25519_BIG = B256_56; +namespace C25519_FP = F25519; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C41417.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C41417.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C41417.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C41417.h index f66b588..e3ee32c 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_C41417.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_C41417.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_C41417_H -#define CONFIG_CURVE_C41417_H - -#include"core.h" -#include"config_field_C41417.h" - -// ECP stuff - -#define CURVETYPE_C41417 EDWARDS -#define CURVE_A_C41417 1 -#define PAIRING_FRIENDLY_C41417 NOT_PF -#define CURVE_SECURITY_C41417 256 -#define HTC_ISO_C41417 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_C41417 - -#if PAIRING_FRIENDLY_C41417 != NOT_PF - -#define HTC_ISO_G2_C41417 0 - -#define USE_GLV_C41417 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_C41417 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_C41417 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_C41417 -#define SIGN_OF_X_C41417 - -#define ATE_BITS_C41417 -#define G2_TABLE_C41417 - -#endif - - -#if CURVE_SECURITY_C41417 == 128 -#define AESKEY_C41417 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_C41417 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_C41417 == 192 -#define AESKEY_C41417 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_C41417 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_C41417 == 256 -#define AESKEY_C41417 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_C41417 SHA512 /**< Hash type */ -#endif - - -namespace C41417_BIG = B416_60; -namespace C41417_FP = C41417; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_C41417_H +#define CONFIG_CURVE_C41417_H + +#include"core.h" +#include"config_field_C41417.h" + +// ECP stuff + +#define CURVETYPE_C41417 EDWARDS +#define CURVE_A_C41417 1 +#define PAIRING_FRIENDLY_C41417 NOT_PF +#define CURVE_SECURITY_C41417 256 +#define HTC_ISO_C41417 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_C41417 + +#if PAIRING_FRIENDLY_C41417 != NOT_PF + +#define HTC_ISO_G2_C41417 0 + +#define USE_GLV_C41417 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_C41417 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_C41417 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_C41417 +#define SIGN_OF_X_C41417 + +#define ATE_BITS_C41417 +#define G2_TABLE_C41417 + +#endif + + +#if CURVE_SECURITY_C41417 == 128 +#define AESKEY_C41417 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_C41417 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_C41417 == 192 +#define AESKEY_C41417 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_C41417 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_C41417 == 256 +#define AESKEY_C41417 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_C41417 SHA512 /**< Hash type */ +#endif + + +namespace C41417_BIG = B416_60; +namespace C41417_FP = C41417; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_Ed25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_Ed25519.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_Ed25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_Ed25519.h index 3f5ace7..d619828 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_Ed25519.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_Ed25519.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_Ed25519_H -#define CONFIG_CURVE_Ed25519_H - -#include"core.h" -#include"config_field_F25519.h" - -// ECP stuff - -#define CURVETYPE_Ed25519 EDWARDS -#define CURVE_A_Ed25519 -1 -#define PAIRING_FRIENDLY_Ed25519 NOT_PF -#define CURVE_SECURITY_Ed25519 128 -#define HTC_ISO_Ed25519 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_Ed25519 - -#if PAIRING_FRIENDLY_Ed25519 != NOT_PF - -#define HTC_ISO_G2_Ed25519 0 - -#define USE_GLV_Ed25519 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_Ed25519 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_Ed25519 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_Ed25519 -#define SIGN_OF_X_Ed25519 - -#define ATE_BITS_Ed25519 -#define G2_TABLE_Ed25519 - -#endif - - -#if CURVE_SECURITY_Ed25519 == 128 -#define AESKEY_Ed25519 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_Ed25519 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_Ed25519 == 192 -#define AESKEY_Ed25519 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_Ed25519 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_Ed25519 == 256 -#define AESKEY_Ed25519 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_Ed25519 SHA512 /**< Hash type */ -#endif - - -namespace Ed25519_BIG = B256_56; -namespace Ed25519_FP = F25519; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_Ed25519_H +#define CONFIG_CURVE_Ed25519_H + +#include"core.h" +#include"config_field_F25519.h" + +// ECP stuff + +#define CURVETYPE_Ed25519 EDWARDS +#define CURVE_A_Ed25519 -1 +#define PAIRING_FRIENDLY_Ed25519 NOT_PF +#define CURVE_SECURITY_Ed25519 128 +#define HTC_ISO_Ed25519 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_Ed25519 + +#if PAIRING_FRIENDLY_Ed25519 != NOT_PF + +#define HTC_ISO_G2_Ed25519 0 + +#define USE_GLV_Ed25519 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_Ed25519 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_Ed25519 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_Ed25519 +#define SIGN_OF_X_Ed25519 + +#define ATE_BITS_Ed25519 +#define G2_TABLE_Ed25519 + +#endif + + +#if CURVE_SECURITY_Ed25519 == 128 +#define AESKEY_Ed25519 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_Ed25519 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_Ed25519 == 192 +#define AESKEY_Ed25519 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_Ed25519 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_Ed25519 == 256 +#define AESKEY_Ed25519 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_Ed25519 SHA512 /**< Hash type */ +#endif + + +namespace Ed25519_BIG = B256_56; +namespace Ed25519_FP = F25519; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_Ed448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_Ed448.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_Ed448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_Ed448.h index f85c80e..ae385ed 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_Ed448.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_Ed448.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_Ed448_H -#define CONFIG_CURVE_Ed448_H - -#include"core.h" -#include"config_field_F448.h" - -// ECP stuff - -#define CURVETYPE_Ed448 EDWARDS -#define CURVE_A_Ed448 1 -#define PAIRING_FRIENDLY_Ed448 NOT_PF -#define CURVE_SECURITY_Ed448 256 -#define HTC_ISO_Ed448 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_Ed448 - -#if PAIRING_FRIENDLY_Ed448 != NOT_PF - -#define HTC_ISO_G2_Ed448 0 - -#define USE_GLV_Ed448 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_Ed448 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_Ed448 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_Ed448 -#define SIGN_OF_X_Ed448 - -#define ATE_BITS_Ed448 -#define G2_TABLE_Ed448 - -#endif - - -#if CURVE_SECURITY_Ed448 == 128 -#define AESKEY_Ed448 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_Ed448 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_Ed448 == 192 -#define AESKEY_Ed448 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_Ed448 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_Ed448 == 256 -#define AESKEY_Ed448 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_Ed448 SHA512 /**< Hash type */ -#endif - - -namespace Ed448_BIG = B448_58; -namespace Ed448_FP = F448; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_Ed448_H +#define CONFIG_CURVE_Ed448_H + +#include"core.h" +#include"config_field_F448.h" + +// ECP stuff + +#define CURVETYPE_Ed448 EDWARDS +#define CURVE_A_Ed448 1 +#define PAIRING_FRIENDLY_Ed448 NOT_PF +#define CURVE_SECURITY_Ed448 256 +#define HTC_ISO_Ed448 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_Ed448 + +#if PAIRING_FRIENDLY_Ed448 != NOT_PF + +#define HTC_ISO_G2_Ed448 0 + +#define USE_GLV_Ed448 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_Ed448 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_Ed448 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_Ed448 +#define SIGN_OF_X_Ed448 + +#define ATE_BITS_Ed448 +#define G2_TABLE_Ed448 + +#endif + + +#if CURVE_SECURITY_Ed448 == 128 +#define AESKEY_Ed448 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_Ed448 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_Ed448 == 192 +#define AESKEY_Ed448 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_Ed448 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_Ed448 == 256 +#define AESKEY_Ed448 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_Ed448 SHA512 /**< Hash type */ +#endif + + +namespace Ed448_BIG = B448_58; +namespace Ed448_FP = F448; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_FP256BN.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_FP256BN.h index 3174557..f0abef8 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_FP256BN.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_FP256BN.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_FP256BN_H -#define CONFIG_CURVE_FP256BN_H - -#include"core.h" -#include"config_field_FP256BN.h" - -// ECP stuff - -#define CURVETYPE_FP256BN WEIERSTRASS -#define CURVE_A_FP256BN 0 -#define PAIRING_FRIENDLY_FP256BN BN_CURVE -#define CURVE_SECURITY_FP256BN 128 -#define HTC_ISO_FP256BN 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_FP256BN - -#if PAIRING_FRIENDLY_FP256BN != NOT_PF - -#define HTC_ISO_G2_FP256BN 0 - -#define USE_GLV_FP256BN /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_FP256BN /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_FP256BN /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_FP256BN M_TYPE -#define SIGN_OF_X_FP256BN NEGATIVEX - -#define ATE_BITS_FP256BN 66 -#define G2_TABLE_FP256BN 83 - -#endif - - -#if CURVE_SECURITY_FP256BN == 128 -#define AESKEY_FP256BN 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_FP256BN SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_FP256BN == 192 -#define AESKEY_FP256BN 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_FP256BN SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_FP256BN == 256 -#define AESKEY_FP256BN 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_FP256BN SHA512 /**< Hash type */ -#endif - - -namespace FP256BN_BIG = B256_56; -namespace FP256BN_FP = FP256BN; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_FP256BN_H +#define CONFIG_CURVE_FP256BN_H + +#include"core.h" +#include"config_field_FP256BN.h" + +// ECP stuff + +#define CURVETYPE_FP256BN WEIERSTRASS +#define CURVE_A_FP256BN 0 +#define PAIRING_FRIENDLY_FP256BN BN_CURVE +#define CURVE_SECURITY_FP256BN 128 +#define HTC_ISO_FP256BN 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_FP256BN + +#if PAIRING_FRIENDLY_FP256BN != NOT_PF + +#define HTC_ISO_G2_FP256BN 0 + +#define USE_GLV_FP256BN /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_FP256BN /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_FP256BN /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_FP256BN M_TYPE +#define SIGN_OF_X_FP256BN NEGATIVEX + +#define ATE_BITS_FP256BN 66 +#define G2_TABLE_FP256BN 83 + +#endif + + +#if CURVE_SECURITY_FP256BN == 128 +#define AESKEY_FP256BN 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_FP256BN SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_FP256BN == 192 +#define AESKEY_FP256BN 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_FP256BN SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_FP256BN == 256 +#define AESKEY_FP256BN 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_FP256BN SHA512 /**< Hash type */ +#endif + + +namespace FP256BN_BIG = B256_56; +namespace FP256BN_FP = FP256BN; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_FP512BN.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_FP512BN.h index c66ae27..42a1dcf 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_FP512BN.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_FP512BN.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_FP512BN_H -#define CONFIG_CURVE_FP512BN_H - -#include"core.h" -#include"config_field_FP512BN.h" - -// ECP stuff - -#define CURVETYPE_FP512BN WEIERSTRASS -#define CURVE_A_FP512BN 0 -#define PAIRING_FRIENDLY_FP512BN BN_CURVE -#define CURVE_SECURITY_FP512BN 128 -#define HTC_ISO_FP512BN 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_FP512BN - -#if PAIRING_FRIENDLY_FP512BN != NOT_PF - -#define HTC_ISO_G2_FP512BN 0 - -#define USE_GLV_FP512BN /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_FP512BN /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_FP512BN /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_FP512BN M_TYPE -#define SIGN_OF_X_FP512BN POSITIVEX - -#define ATE_BITS_FP512BN 130 -#define G2_TABLE_FP512BN 172 - -#endif - - -#if CURVE_SECURITY_FP512BN == 128 -#define AESKEY_FP512BN 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_FP512BN SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_FP512BN == 192 -#define AESKEY_FP512BN 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_FP512BN SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_FP512BN == 256 -#define AESKEY_FP512BN 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_FP512BN SHA512 /**< Hash type */ -#endif - - -namespace FP512BN_BIG = B512_60; -namespace FP512BN_FP = FP512BN; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_FP512BN_H +#define CONFIG_CURVE_FP512BN_H + +#include"core.h" +#include"config_field_FP512BN.h" + +// ECP stuff + +#define CURVETYPE_FP512BN WEIERSTRASS +#define CURVE_A_FP512BN 0 +#define PAIRING_FRIENDLY_FP512BN BN_CURVE +#define CURVE_SECURITY_FP512BN 128 +#define HTC_ISO_FP512BN 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_FP512BN + +#if PAIRING_FRIENDLY_FP512BN != NOT_PF + +#define HTC_ISO_G2_FP512BN 0 + +#define USE_GLV_FP512BN /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_FP512BN /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_FP512BN /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_FP512BN M_TYPE +#define SIGN_OF_X_FP512BN POSITIVEX + +#define ATE_BITS_FP512BN 130 +#define G2_TABLE_FP512BN 172 + +#endif + + +#if CURVE_SECURITY_FP512BN == 128 +#define AESKEY_FP512BN 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_FP512BN SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_FP512BN == 192 +#define AESKEY_FP512BN 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_FP512BN SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_FP512BN == 256 +#define AESKEY_FP512BN 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_FP512BN SHA512 /**< Hash type */ +#endif + + +namespace FP512BN_BIG = B512_60; +namespace FP512BN_FP = FP512BN; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_HIFIVE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_HIFIVE.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_HIFIVE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_HIFIVE.h index 436a71f..2aca8a4 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_HIFIVE.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_HIFIVE.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_HIFIVE_H -#define CONFIG_CURVE_HIFIVE_H - -#include"core.h" -#include"config_field_HIFIVE.h" - -// ECP stuff - -#define CURVETYPE_HIFIVE EDWARDS -#define CURVE_A_HIFIVE 1 -#define PAIRING_FRIENDLY_HIFIVE NOT_PF -#define CURVE_SECURITY_HIFIVE 192 -#define HTC_ISO_HIFIVE 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_HIFIVE - -#if PAIRING_FRIENDLY_HIFIVE != NOT_PF - -#define HTC_ISO_G2_HIFIVE 0 - -#define USE_GLV_HIFIVE /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_HIFIVE /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_HIFIVE /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_HIFIVE -#define SIGN_OF_X_HIFIVE - -#define ATE_BITS_HIFIVE -#define G2_TABLE_HIFIVE - -#endif - - -#if CURVE_SECURITY_HIFIVE == 128 -#define AESKEY_HIFIVE 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_HIFIVE SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_HIFIVE == 192 -#define AESKEY_HIFIVE 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_HIFIVE SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_HIFIVE == 256 -#define AESKEY_HIFIVE 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_HIFIVE SHA512 /**< Hash type */ -#endif - - -namespace HIFIVE_BIG = B336_60; -namespace HIFIVE_FP = HIFIVE; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_HIFIVE_H +#define CONFIG_CURVE_HIFIVE_H + +#include"core.h" +#include"config_field_HIFIVE.h" + +// ECP stuff + +#define CURVETYPE_HIFIVE EDWARDS +#define CURVE_A_HIFIVE 1 +#define PAIRING_FRIENDLY_HIFIVE NOT_PF +#define CURVE_SECURITY_HIFIVE 192 +#define HTC_ISO_HIFIVE 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_HIFIVE + +#if PAIRING_FRIENDLY_HIFIVE != NOT_PF + +#define HTC_ISO_G2_HIFIVE 0 + +#define USE_GLV_HIFIVE /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_HIFIVE /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_HIFIVE /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_HIFIVE +#define SIGN_OF_X_HIFIVE + +#define ATE_BITS_HIFIVE +#define G2_TABLE_HIFIVE + +#endif + + +#if CURVE_SECURITY_HIFIVE == 128 +#define AESKEY_HIFIVE 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_HIFIVE SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_HIFIVE == 192 +#define AESKEY_HIFIVE 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_HIFIVE SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_HIFIVE == 256 +#define AESKEY_HIFIVE 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_HIFIVE SHA512 /**< Hash type */ +#endif + + +namespace HIFIVE_BIG = B336_60; +namespace HIFIVE_FP = HIFIVE; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_JUBJUB.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_JUBJUB.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_JUBJUB.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_JUBJUB.h index bfe0f80..388fd68 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_JUBJUB.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_JUBJUB.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_JUBJUB_H -#define CONFIG_CURVE_JUBJUB_H - -#include"core.h" -#include"config_field_JUBJUB.h" - -// ECP stuff - -#define CURVETYPE_JUBJUB EDWARDS -#define CURVE_A_JUBJUB -1 -#define PAIRING_FRIENDLY_JUBJUB NOT_PF -#define CURVE_SECURITY_JUBJUB 128 -#define HTC_ISO_JUBJUB 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_JUBJUB - -#if PAIRING_FRIENDLY_JUBJUB != NOT_PF - -#define HTC_ISO_G2_JUBJUB 0 - -#define USE_GLV_JUBJUB /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_JUBJUB /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_JUBJUB /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_JUBJUB -#define SIGN_OF_X_JUBJUB - -#define ATE_BITS_JUBJUB -#define G2_TABLE_JUBJUB - -#endif - - -#if CURVE_SECURITY_JUBJUB == 128 -#define AESKEY_JUBJUB 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_JUBJUB SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_JUBJUB == 192 -#define AESKEY_JUBJUB 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_JUBJUB SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_JUBJUB == 256 -#define AESKEY_JUBJUB 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_JUBJUB SHA512 /**< Hash type */ -#endif - - -namespace JUBJUB_BIG = B256_56; -namespace JUBJUB_FP = JUBJUB; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_JUBJUB_H +#define CONFIG_CURVE_JUBJUB_H + +#include"core.h" +#include"config_field_JUBJUB.h" + +// ECP stuff + +#define CURVETYPE_JUBJUB EDWARDS +#define CURVE_A_JUBJUB -1 +#define PAIRING_FRIENDLY_JUBJUB NOT_PF +#define CURVE_SECURITY_JUBJUB 128 +#define HTC_ISO_JUBJUB 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_JUBJUB + +#if PAIRING_FRIENDLY_JUBJUB != NOT_PF + +#define HTC_ISO_G2_JUBJUB 0 + +#define USE_GLV_JUBJUB /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_JUBJUB /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_JUBJUB /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_JUBJUB +#define SIGN_OF_X_JUBJUB + +#define ATE_BITS_JUBJUB +#define G2_TABLE_JUBJUB + +#endif + + +#if CURVE_SECURITY_JUBJUB == 128 +#define AESKEY_JUBJUB 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_JUBJUB SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_JUBJUB == 192 +#define AESKEY_JUBJUB 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_JUBJUB SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_JUBJUB == 256 +#define AESKEY_JUBJUB 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_JUBJUB SHA512 /**< Hash type */ +#endif + + +namespace JUBJUB_BIG = B256_56; +namespace JUBJUB_FP = JUBJUB; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_MDC.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_MDC.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_MDC.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_MDC.h index 6828668..d526b29 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_MDC.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_MDC.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_MDC_H -#define CONFIG_CURVE_MDC_H - -#include"core.h" -#include"config_field_MDC.h" - -// ECP stuff - -#define CURVETYPE_MDC EDWARDS -#define CURVE_A_MDC 1 -#define PAIRING_FRIENDLY_MDC NOT_PF -#define CURVE_SECURITY_MDC 128 -#define HTC_ISO_MDC 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_MDC - -#if PAIRING_FRIENDLY_MDC != NOT_PF - -#define HTC_ISO_G2_MDC 0 - -#define USE_GLV_MDC /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_MDC /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_MDC /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_MDC -#define SIGN_OF_X_MDC - -#define ATE_BITS_MDC -#define G2_TABLE_MDC - -#endif - - -#if CURVE_SECURITY_MDC == 128 -#define AESKEY_MDC 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_MDC SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_MDC == 192 -#define AESKEY_MDC 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_MDC SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_MDC == 256 -#define AESKEY_MDC 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_MDC SHA512 /**< Hash type */ -#endif - - -namespace MDC_BIG = B256_56; -namespace MDC_FP = MDC; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_MDC_H +#define CONFIG_CURVE_MDC_H + +#include"core.h" +#include"config_field_MDC.h" + +// ECP stuff + +#define CURVETYPE_MDC EDWARDS +#define CURVE_A_MDC 1 +#define PAIRING_FRIENDLY_MDC NOT_PF +#define CURVE_SECURITY_MDC 128 +#define HTC_ISO_MDC 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_MDC + +#if PAIRING_FRIENDLY_MDC != NOT_PF + +#define HTC_ISO_G2_MDC 0 + +#define USE_GLV_MDC /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_MDC /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_MDC /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_MDC +#define SIGN_OF_X_MDC + +#define ATE_BITS_MDC +#define G2_TABLE_MDC + +#endif + + +#if CURVE_SECURITY_MDC == 128 +#define AESKEY_MDC 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_MDC SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_MDC == 192 +#define AESKEY_MDC 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_MDC SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_MDC == 256 +#define AESKEY_MDC 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_MDC SHA512 /**< Hash type */ +#endif + + +namespace MDC_BIG = B256_56; +namespace MDC_FP = MDC; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NIST256.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NIST256.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NIST256.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NIST256.h index 78c0807..dbd4b64 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NIST256.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NIST256.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_NIST256_H -#define CONFIG_CURVE_NIST256_H - -#include"core.h" -#include"config_field_NIST256.h" - -// ECP stuff - -#define CURVETYPE_NIST256 WEIERSTRASS -#define CURVE_A_NIST256 -3 -#define PAIRING_FRIENDLY_NIST256 NOT_PF -#define CURVE_SECURITY_NIST256 128 -#define HTC_ISO_NIST256 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_NIST256 - -#if PAIRING_FRIENDLY_NIST256 != NOT_PF - -#define HTC_ISO_G2_NIST256 0 - -#define USE_GLV_NIST256 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_NIST256 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_NIST256 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_NIST256 -#define SIGN_OF_X_NIST256 - -#define ATE_BITS_NIST256 -#define G2_TABLE_NIST256 - -#endif - - -#if CURVE_SECURITY_NIST256 == 128 -#define AESKEY_NIST256 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_NIST256 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NIST256 == 192 -#define AESKEY_NIST256 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_NIST256 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NIST256 == 256 -#define AESKEY_NIST256 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_NIST256 SHA512 /**< Hash type */ -#endif - - -namespace NIST256_BIG = B256_56; -namespace NIST256_FP = NIST256; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_NIST256_H +#define CONFIG_CURVE_NIST256_H + +#include"core.h" +#include"config_field_NIST256.h" + +// ECP stuff + +#define CURVETYPE_NIST256 WEIERSTRASS +#define CURVE_A_NIST256 -3 +#define PAIRING_FRIENDLY_NIST256 NOT_PF +#define CURVE_SECURITY_NIST256 128 +#define HTC_ISO_NIST256 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_NIST256 + +#if PAIRING_FRIENDLY_NIST256 != NOT_PF + +#define HTC_ISO_G2_NIST256 0 + +#define USE_GLV_NIST256 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_NIST256 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_NIST256 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_NIST256 +#define SIGN_OF_X_NIST256 + +#define ATE_BITS_NIST256 +#define G2_TABLE_NIST256 + +#endif + + +#if CURVE_SECURITY_NIST256 == 128 +#define AESKEY_NIST256 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_NIST256 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NIST256 == 192 +#define AESKEY_NIST256 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_NIST256 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NIST256 == 256 +#define AESKEY_NIST256 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_NIST256 SHA512 /**< Hash type */ +#endif + + +namespace NIST256_BIG = B256_56; +namespace NIST256_FP = NIST256; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NIST384.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NIST384.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NIST384.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NIST384.h index 1a089b1..ed648be 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NIST384.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NIST384.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_NIST384_H -#define CONFIG_CURVE_NIST384_H - -#include"core.h" -#include"config_field_NIST384.h" - -// ECP stuff - -#define CURVETYPE_NIST384 WEIERSTRASS -#define CURVE_A_NIST384 -3 -#define PAIRING_FRIENDLY_NIST384 NOT_PF -#define CURVE_SECURITY_NIST384 192 -#define HTC_ISO_NIST384 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_NIST384 - -#if PAIRING_FRIENDLY_NIST384 != NOT_PF - -#define HTC_ISO_G2_NIST384 0 - -#define USE_GLV_NIST384 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_NIST384 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_NIST384 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_NIST384 -#define SIGN_OF_X_NIST384 - -#define ATE_BITS_NIST384 -#define G2_TABLE_NIST384 - -#endif - - -#if CURVE_SECURITY_NIST384 == 128 -#define AESKEY_NIST384 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_NIST384 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NIST384 == 192 -#define AESKEY_NIST384 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_NIST384 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NIST384 == 256 -#define AESKEY_NIST384 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_NIST384 SHA512 /**< Hash type */ -#endif - - -namespace NIST384_BIG = B384_56; -namespace NIST384_FP = NIST384; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_NIST384_H +#define CONFIG_CURVE_NIST384_H + +#include"core.h" +#include"config_field_NIST384.h" + +// ECP stuff + +#define CURVETYPE_NIST384 WEIERSTRASS +#define CURVE_A_NIST384 -3 +#define PAIRING_FRIENDLY_NIST384 NOT_PF +#define CURVE_SECURITY_NIST384 192 +#define HTC_ISO_NIST384 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_NIST384 + +#if PAIRING_FRIENDLY_NIST384 != NOT_PF + +#define HTC_ISO_G2_NIST384 0 + +#define USE_GLV_NIST384 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_NIST384 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_NIST384 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_NIST384 +#define SIGN_OF_X_NIST384 + +#define ATE_BITS_NIST384 +#define G2_TABLE_NIST384 + +#endif + + +#if CURVE_SECURITY_NIST384 == 128 +#define AESKEY_NIST384 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_NIST384 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NIST384 == 192 +#define AESKEY_NIST384 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_NIST384 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NIST384 == 256 +#define AESKEY_NIST384 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_NIST384 SHA512 /**< Hash type */ +#endif + + +namespace NIST384_BIG = B384_56; +namespace NIST384_FP = NIST384; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NIST521.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NIST521.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NIST521.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NIST521.h index 9bad49d..888a733 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NIST521.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NIST521.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_NIST521_H -#define CONFIG_CURVE_NIST521_H - -#include"core.h" -#include"config_field_NIST521.h" - -// ECP stuff - -#define CURVETYPE_NIST521 WEIERSTRASS -#define CURVE_A_NIST521 -3 -#define PAIRING_FRIENDLY_NIST521 NOT_PF -#define CURVE_SECURITY_NIST521 256 -#define HTC_ISO_NIST521 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_NIST521 - -#if PAIRING_FRIENDLY_NIST521 != NOT_PF - -#define HTC_ISO_G2_NIST521 0 - -#define USE_GLV_NIST521 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_NIST521 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_NIST521 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_NIST521 -#define SIGN_OF_X_NIST521 - -#define ATE_BITS_NIST521 -#define G2_TABLE_NIST521 - -#endif - - -#if CURVE_SECURITY_NIST521 == 128 -#define AESKEY_NIST521 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_NIST521 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NIST521 == 192 -#define AESKEY_NIST521 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_NIST521 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NIST521 == 256 -#define AESKEY_NIST521 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_NIST521 SHA512 /**< Hash type */ -#endif - - -namespace NIST521_BIG = B528_60; -namespace NIST521_FP = NIST521; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_NIST521_H +#define CONFIG_CURVE_NIST521_H + +#include"core.h" +#include"config_field_NIST521.h" + +// ECP stuff + +#define CURVETYPE_NIST521 WEIERSTRASS +#define CURVE_A_NIST521 -3 +#define PAIRING_FRIENDLY_NIST521 NOT_PF +#define CURVE_SECURITY_NIST521 256 +#define HTC_ISO_NIST521 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_NIST521 + +#if PAIRING_FRIENDLY_NIST521 != NOT_PF + +#define HTC_ISO_G2_NIST521 0 + +#define USE_GLV_NIST521 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_NIST521 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_NIST521 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_NIST521 +#define SIGN_OF_X_NIST521 + +#define ATE_BITS_NIST521 +#define G2_TABLE_NIST521 + +#endif + + +#if CURVE_SECURITY_NIST521 == 128 +#define AESKEY_NIST521 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_NIST521 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NIST521 == 192 +#define AESKEY_NIST521 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_NIST521 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NIST521 == 256 +#define AESKEY_NIST521 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_NIST521 SHA512 /**< Hash type */ +#endif + + +namespace NIST521_BIG = B528_60; +namespace NIST521_FP = NIST521; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS256E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS256E.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS256E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS256E.h index 765d71f..dd5629e 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS256E.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS256E.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_NUMS256E_H -#define CONFIG_CURVE_NUMS256E_H - -#include"core.h" -#include"config_field_F256PME.h" - -// ECP stuff - -#define CURVETYPE_NUMS256E EDWARDS -#define CURVE_A_NUMS256E 1 -#define PAIRING_FRIENDLY_NUMS256E NOT_PF -#define CURVE_SECURITY_NUMS256E 128 -#define HTC_ISO_NUMS256E 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_NUMS256E - -#if PAIRING_FRIENDLY_NUMS256E != NOT_PF - -#define HTC_ISO_G2_NUMS256E 0 - -#define USE_GLV_NUMS256E /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_NUMS256E /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_NUMS256E /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_NUMS256E -#define SIGN_OF_X_NUMS256E - -#define ATE_BITS_NUMS256E -#define G2_TABLE_NUMS256E - -#endif - - -#if CURVE_SECURITY_NUMS256E == 128 -#define AESKEY_NUMS256E 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_NUMS256E SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NUMS256E == 192 -#define AESKEY_NUMS256E 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_NUMS256E SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NUMS256E == 256 -#define AESKEY_NUMS256E 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_NUMS256E SHA512 /**< Hash type */ -#endif - - -namespace NUMS256E_BIG = B256_56; -namespace NUMS256E_FP = F256PME; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_NUMS256E_H +#define CONFIG_CURVE_NUMS256E_H + +#include"core.h" +#include"config_field_F256PME.h" + +// ECP stuff + +#define CURVETYPE_NUMS256E EDWARDS +#define CURVE_A_NUMS256E 1 +#define PAIRING_FRIENDLY_NUMS256E NOT_PF +#define CURVE_SECURITY_NUMS256E 128 +#define HTC_ISO_NUMS256E 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_NUMS256E + +#if PAIRING_FRIENDLY_NUMS256E != NOT_PF + +#define HTC_ISO_G2_NUMS256E 0 + +#define USE_GLV_NUMS256E /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_NUMS256E /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_NUMS256E /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_NUMS256E +#define SIGN_OF_X_NUMS256E + +#define ATE_BITS_NUMS256E +#define G2_TABLE_NUMS256E + +#endif + + +#if CURVE_SECURITY_NUMS256E == 128 +#define AESKEY_NUMS256E 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_NUMS256E SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NUMS256E == 192 +#define AESKEY_NUMS256E 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_NUMS256E SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NUMS256E == 256 +#define AESKEY_NUMS256E 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_NUMS256E SHA512 /**< Hash type */ +#endif + + +namespace NUMS256E_BIG = B256_56; +namespace NUMS256E_FP = F256PME; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS256W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS256W.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS256W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS256W.h index 3c7901f..262bf4a 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS256W.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS256W.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_NUMS256W_H -#define CONFIG_CURVE_NUMS256W_H - -#include"core.h" -#include"config_field_F256PMW.h" - -// ECP stuff - -#define CURVETYPE_NUMS256W WEIERSTRASS -#define CURVE_A_NUMS256W -3 -#define PAIRING_FRIENDLY_NUMS256W NOT_PF -#define CURVE_SECURITY_NUMS256W 128 -#define HTC_ISO_NUMS256W 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_NUMS256W - -#if PAIRING_FRIENDLY_NUMS256W != NOT_PF - -#define HTC_ISO_G2_NUMS256W 0 - -#define USE_GLV_NUMS256W /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_NUMS256W /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_NUMS256W /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_NUMS256W -#define SIGN_OF_X_NUMS256W - -#define ATE_BITS_NUMS256W -#define G2_TABLE_NUMS256W - -#endif - - -#if CURVE_SECURITY_NUMS256W == 128 -#define AESKEY_NUMS256W 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_NUMS256W SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NUMS256W == 192 -#define AESKEY_NUMS256W 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_NUMS256W SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NUMS256W == 256 -#define AESKEY_NUMS256W 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_NUMS256W SHA512 /**< Hash type */ -#endif - - -namespace NUMS256W_BIG = B256_56; -namespace NUMS256W_FP = F256PMW; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_NUMS256W_H +#define CONFIG_CURVE_NUMS256W_H + +#include"core.h" +#include"config_field_F256PMW.h" + +// ECP stuff + +#define CURVETYPE_NUMS256W WEIERSTRASS +#define CURVE_A_NUMS256W -3 +#define PAIRING_FRIENDLY_NUMS256W NOT_PF +#define CURVE_SECURITY_NUMS256W 128 +#define HTC_ISO_NUMS256W 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_NUMS256W + +#if PAIRING_FRIENDLY_NUMS256W != NOT_PF + +#define HTC_ISO_G2_NUMS256W 0 + +#define USE_GLV_NUMS256W /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_NUMS256W /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_NUMS256W /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_NUMS256W +#define SIGN_OF_X_NUMS256W + +#define ATE_BITS_NUMS256W +#define G2_TABLE_NUMS256W + +#endif + + +#if CURVE_SECURITY_NUMS256W == 128 +#define AESKEY_NUMS256W 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_NUMS256W SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NUMS256W == 192 +#define AESKEY_NUMS256W 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_NUMS256W SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NUMS256W == 256 +#define AESKEY_NUMS256W 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_NUMS256W SHA512 /**< Hash type */ +#endif + + +namespace NUMS256W_BIG = B256_56; +namespace NUMS256W_FP = F256PMW; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS384E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS384E.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS384E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS384E.h index db14475..b089b3e 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS384E.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS384E.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_NUMS384E_H -#define CONFIG_CURVE_NUMS384E_H - -#include"core.h" -#include"config_field_F384PM.h" - -// ECP stuff - -#define CURVETYPE_NUMS384E EDWARDS -#define CURVE_A_NUMS384E 1 -#define PAIRING_FRIENDLY_NUMS384E NOT_PF -#define CURVE_SECURITY_NUMS384E 192 -#define HTC_ISO_NUMS384E 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_NUMS384E - -#if PAIRING_FRIENDLY_NUMS384E != NOT_PF - -#define HTC_ISO_G2_NUMS384E 0 - -#define USE_GLV_NUMS384E /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_NUMS384E /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_NUMS384E /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_NUMS384E -#define SIGN_OF_X_NUMS384E - -#define ATE_BITS_NUMS384E -#define G2_TABLE_NUMS384E - -#endif - - -#if CURVE_SECURITY_NUMS384E == 128 -#define AESKEY_NUMS384E 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_NUMS384E SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NUMS384E == 192 -#define AESKEY_NUMS384E 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_NUMS384E SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NUMS384E == 256 -#define AESKEY_NUMS384E 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_NUMS384E SHA512 /**< Hash type */ -#endif - - -namespace NUMS384E_BIG = B384_58; -namespace NUMS384E_FP = F384PM; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_NUMS384E_H +#define CONFIG_CURVE_NUMS384E_H + +#include"core.h" +#include"config_field_F384PM.h" + +// ECP stuff + +#define CURVETYPE_NUMS384E EDWARDS +#define CURVE_A_NUMS384E 1 +#define PAIRING_FRIENDLY_NUMS384E NOT_PF +#define CURVE_SECURITY_NUMS384E 192 +#define HTC_ISO_NUMS384E 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_NUMS384E + +#if PAIRING_FRIENDLY_NUMS384E != NOT_PF + +#define HTC_ISO_G2_NUMS384E 0 + +#define USE_GLV_NUMS384E /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_NUMS384E /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_NUMS384E /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_NUMS384E +#define SIGN_OF_X_NUMS384E + +#define ATE_BITS_NUMS384E +#define G2_TABLE_NUMS384E + +#endif + + +#if CURVE_SECURITY_NUMS384E == 128 +#define AESKEY_NUMS384E 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_NUMS384E SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NUMS384E == 192 +#define AESKEY_NUMS384E 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_NUMS384E SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NUMS384E == 256 +#define AESKEY_NUMS384E 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_NUMS384E SHA512 /**< Hash type */ +#endif + + +namespace NUMS384E_BIG = B384_58; +namespace NUMS384E_FP = F384PM; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS384W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS384W.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS384W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS384W.h index 83ea507..9f41c39 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS384W.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS384W.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_NUMS384W_H -#define CONFIG_CURVE_NUMS384W_H - -#include"core.h" -#include"config_field_F384PM.h" - -// ECP stuff - -#define CURVETYPE_NUMS384W WEIERSTRASS -#define CURVE_A_NUMS384W -3 -#define PAIRING_FRIENDLY_NUMS384W NOT_PF -#define CURVE_SECURITY_NUMS384W 192 -#define HTC_ISO_NUMS384W 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_NUMS384W - -#if PAIRING_FRIENDLY_NUMS384W != NOT_PF - -#define HTC_ISO_G2_NUMS384W 0 - -#define USE_GLV_NUMS384W /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_NUMS384W /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_NUMS384W /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_NUMS384W -#define SIGN_OF_X_NUMS384W - -#define ATE_BITS_NUMS384W -#define G2_TABLE_NUMS384W - -#endif - - -#if CURVE_SECURITY_NUMS384W == 128 -#define AESKEY_NUMS384W 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_NUMS384W SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NUMS384W == 192 -#define AESKEY_NUMS384W 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_NUMS384W SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NUMS384W == 256 -#define AESKEY_NUMS384W 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_NUMS384W SHA512 /**< Hash type */ -#endif - - -namespace NUMS384W_BIG = B384_58; -namespace NUMS384W_FP = F384PM; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_NUMS384W_H +#define CONFIG_CURVE_NUMS384W_H + +#include"core.h" +#include"config_field_F384PM.h" + +// ECP stuff + +#define CURVETYPE_NUMS384W WEIERSTRASS +#define CURVE_A_NUMS384W -3 +#define PAIRING_FRIENDLY_NUMS384W NOT_PF +#define CURVE_SECURITY_NUMS384W 192 +#define HTC_ISO_NUMS384W 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_NUMS384W + +#if PAIRING_FRIENDLY_NUMS384W != NOT_PF + +#define HTC_ISO_G2_NUMS384W 0 + +#define USE_GLV_NUMS384W /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_NUMS384W /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_NUMS384W /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_NUMS384W +#define SIGN_OF_X_NUMS384W + +#define ATE_BITS_NUMS384W +#define G2_TABLE_NUMS384W + +#endif + + +#if CURVE_SECURITY_NUMS384W == 128 +#define AESKEY_NUMS384W 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_NUMS384W SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NUMS384W == 192 +#define AESKEY_NUMS384W 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_NUMS384W SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NUMS384W == 256 +#define AESKEY_NUMS384W 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_NUMS384W SHA512 /**< Hash type */ +#endif + + +namespace NUMS384W_BIG = B384_58; +namespace NUMS384W_FP = F384PM; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS512E.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS512E.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS512E.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS512E.h index 6cc80c8..beacb50 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS512E.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS512E.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_NUMS512E_H -#define CONFIG_CURVE_NUMS512E_H - -#include"core.h" -#include"config_field_F512PM.h" - -// ECP stuff - -#define CURVETYPE_NUMS512E EDWARDS -#define CURVE_A_NUMS512E 1 -#define PAIRING_FRIENDLY_NUMS512E NOT_PF -#define CURVE_SECURITY_NUMS512E 256 -#define HTC_ISO_NUMS512E 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_NUMS512E - -#if PAIRING_FRIENDLY_NUMS512E != NOT_PF - -#define HTC_ISO_G2_NUMS512E 0 - -#define USE_GLV_NUMS512E /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_NUMS512E /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_NUMS512E /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_NUMS512E -#define SIGN_OF_X_NUMS512E - -#define ATE_BITS_NUMS512E -#define G2_TABLE_NUMS512E - -#endif - - -#if CURVE_SECURITY_NUMS512E == 128 -#define AESKEY_NUMS512E 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_NUMS512E SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NUMS512E == 192 -#define AESKEY_NUMS512E 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_NUMS512E SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NUMS512E == 256 -#define AESKEY_NUMS512E 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_NUMS512E SHA512 /**< Hash type */ -#endif - - -namespace NUMS512E_BIG = B512_60; -namespace NUMS512E_FP = F512PM; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_NUMS512E_H +#define CONFIG_CURVE_NUMS512E_H + +#include"core.h" +#include"config_field_F512PM.h" + +// ECP stuff + +#define CURVETYPE_NUMS512E EDWARDS +#define CURVE_A_NUMS512E 1 +#define PAIRING_FRIENDLY_NUMS512E NOT_PF +#define CURVE_SECURITY_NUMS512E 256 +#define HTC_ISO_NUMS512E 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_NUMS512E + +#if PAIRING_FRIENDLY_NUMS512E != NOT_PF + +#define HTC_ISO_G2_NUMS512E 0 + +#define USE_GLV_NUMS512E /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_NUMS512E /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_NUMS512E /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_NUMS512E +#define SIGN_OF_X_NUMS512E + +#define ATE_BITS_NUMS512E +#define G2_TABLE_NUMS512E + +#endif + + +#if CURVE_SECURITY_NUMS512E == 128 +#define AESKEY_NUMS512E 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_NUMS512E SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NUMS512E == 192 +#define AESKEY_NUMS512E 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_NUMS512E SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NUMS512E == 256 +#define AESKEY_NUMS512E 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_NUMS512E SHA512 /**< Hash type */ +#endif + + +namespace NUMS512E_BIG = B512_60; +namespace NUMS512E_FP = F512PM; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS512W.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS512W.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS512W.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS512W.h index 6d9d739..160675e 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_NUMS512W.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_NUMS512W.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_NUMS512W_H -#define CONFIG_CURVE_NUMS512W_H - -#include"core.h" -#include"config_field_F512PM.h" - -// ECP stuff - -#define CURVETYPE_NUMS512W WEIERSTRASS -#define CURVE_A_NUMS512W -3 -#define PAIRING_FRIENDLY_NUMS512W NOT_PF -#define CURVE_SECURITY_NUMS512W 256 -#define HTC_ISO_NUMS512W 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_NUMS512W - -#if PAIRING_FRIENDLY_NUMS512W != NOT_PF - -#define HTC_ISO_G2_NUMS512W 0 - -#define USE_GLV_NUMS512W /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_NUMS512W /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_NUMS512W /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_NUMS512W -#define SIGN_OF_X_NUMS512W - -#define ATE_BITS_NUMS512W -#define G2_TABLE_NUMS512W - -#endif - - -#if CURVE_SECURITY_NUMS512W == 128 -#define AESKEY_NUMS512W 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_NUMS512W SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NUMS512W == 192 -#define AESKEY_NUMS512W 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_NUMS512W SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_NUMS512W == 256 -#define AESKEY_NUMS512W 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_NUMS512W SHA512 /**< Hash type */ -#endif - - -namespace NUMS512W_BIG = B512_60; -namespace NUMS512W_FP = F512PM; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_NUMS512W_H +#define CONFIG_CURVE_NUMS512W_H + +#include"core.h" +#include"config_field_F512PM.h" + +// ECP stuff + +#define CURVETYPE_NUMS512W WEIERSTRASS +#define CURVE_A_NUMS512W -3 +#define PAIRING_FRIENDLY_NUMS512W NOT_PF +#define CURVE_SECURITY_NUMS512W 256 +#define HTC_ISO_NUMS512W 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_NUMS512W + +#if PAIRING_FRIENDLY_NUMS512W != NOT_PF + +#define HTC_ISO_G2_NUMS512W 0 + +#define USE_GLV_NUMS512W /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_NUMS512W /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_NUMS512W /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_NUMS512W +#define SIGN_OF_X_NUMS512W + +#define ATE_BITS_NUMS512W +#define G2_TABLE_NUMS512W + +#endif + + +#if CURVE_SECURITY_NUMS512W == 128 +#define AESKEY_NUMS512W 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_NUMS512W SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NUMS512W == 192 +#define AESKEY_NUMS512W 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_NUMS512W SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_NUMS512W == 256 +#define AESKEY_NUMS512W 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_NUMS512W SHA512 /**< Hash type */ +#endif + + +namespace NUMS512W_BIG = B512_60; +namespace NUMS512W_FP = F512PM; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_SECP160R1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_SECP160R1.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_SECP160R1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_SECP160R1.h index 21bdc09..03ebd84 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_SECP160R1.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_SECP160R1.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_SECP160R1_H -#define CONFIG_CURVE_SECP160R1_H - -#include"core.h" -#include"config_field_SECP160R1.h" - -// ECP stuff - -#define CURVETYPE_SECP160R1 WEIERSTRASS -#define CURVE_A_SECP160R1 -3 -#define PAIRING_FRIENDLY_SECP160R1 NOT_PF -#define CURVE_SECURITY_SECP160R1 128 -#define HTC_ISO_SECP160R1 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_SECP160R1 - -#if PAIRING_FRIENDLY_SECP160R1 != NOT_PF - -#define HTC_ISO_G2_SECP160R1 0 - -#define USE_GLV_SECP160R1 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_SECP160R1 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_SECP160R1 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_SECP160R1 -#define SIGN_OF_X_SECP160R1 - -#define ATE_BITS_SECP160R1 -#define G2_TABLE_SECP160R1 - -#endif - - -#if CURVE_SECURITY_SECP160R1 == 128 -#define AESKEY_SECP160R1 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_SECP160R1 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_SECP160R1 == 192 -#define AESKEY_SECP160R1 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_SECP160R1 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_SECP160R1 == 256 -#define AESKEY_SECP160R1 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_SECP160R1 SHA512 /**< Hash type */ -#endif - - -namespace SECP160R1_BIG = B160_56; -namespace SECP160R1_FP = SECP160R1; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_SECP160R1_H +#define CONFIG_CURVE_SECP160R1_H + +#include"core.h" +#include"config_field_SECP160R1.h" + +// ECP stuff + +#define CURVETYPE_SECP160R1 WEIERSTRASS +#define CURVE_A_SECP160R1 -3 +#define PAIRING_FRIENDLY_SECP160R1 NOT_PF +#define CURVE_SECURITY_SECP160R1 128 +#define HTC_ISO_SECP160R1 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_SECP160R1 + +#if PAIRING_FRIENDLY_SECP160R1 != NOT_PF + +#define HTC_ISO_G2_SECP160R1 0 + +#define USE_GLV_SECP160R1 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_SECP160R1 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_SECP160R1 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_SECP160R1 +#define SIGN_OF_X_SECP160R1 + +#define ATE_BITS_SECP160R1 +#define G2_TABLE_SECP160R1 + +#endif + + +#if CURVE_SECURITY_SECP160R1 == 128 +#define AESKEY_SECP160R1 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_SECP160R1 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_SECP160R1 == 192 +#define AESKEY_SECP160R1 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_SECP160R1 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_SECP160R1 == 256 +#define AESKEY_SECP160R1 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_SECP160R1 SHA512 /**< Hash type */ +#endif + + +namespace SECP160R1_BIG = B160_56; +namespace SECP160R1_FP = SECP160R1; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_SECP256K1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_SECP256K1.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_SECP256K1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_SECP256K1.h index 01676ab..ce4468a 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_SECP256K1.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_SECP256K1.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_SECP256K1_H -#define CONFIG_CURVE_SECP256K1_H - -#include"core.h" -#include"config_field_SECP256K1.h" - -// ECP stuff - -#define CURVETYPE_SECP256K1 WEIERSTRASS -#define CURVE_A_SECP256K1 0 -#define PAIRING_FRIENDLY_SECP256K1 NOT_PF -#define CURVE_SECURITY_SECP256K1 128 -#define HTC_ISO_SECP256K1 3 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_SECP256K1 - -#if PAIRING_FRIENDLY_SECP256K1 != NOT_PF - -#define HTC_ISO_G2_SECP256K1 0 - -#define USE_GLV_SECP256K1 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_SECP256K1 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_SECP256K1 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_SECP256K1 -#define SIGN_OF_X_SECP256K1 - -#define ATE_BITS_SECP256K1 -#define G2_TABLE_SECP256K1 - -#endif - - -#if CURVE_SECURITY_SECP256K1 == 128 -#define AESKEY_SECP256K1 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_SECP256K1 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_SECP256K1 == 192 -#define AESKEY_SECP256K1 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_SECP256K1 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_SECP256K1 == 256 -#define AESKEY_SECP256K1 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_SECP256K1 SHA512 /**< Hash type */ -#endif - - -namespace SECP256K1_BIG = B256_56; -namespace SECP256K1_FP = SECP256K1; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_SECP256K1_H +#define CONFIG_CURVE_SECP256K1_H + +#include"core.h" +#include"config_field_SECP256K1.h" + +// ECP stuff + +#define CURVETYPE_SECP256K1 WEIERSTRASS +#define CURVE_A_SECP256K1 0 +#define PAIRING_FRIENDLY_SECP256K1 NOT_PF +#define CURVE_SECURITY_SECP256K1 128 +#define HTC_ISO_SECP256K1 3 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_SECP256K1 + +#if PAIRING_FRIENDLY_SECP256K1 != NOT_PF + +#define HTC_ISO_G2_SECP256K1 0 + +#define USE_GLV_SECP256K1 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_SECP256K1 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_SECP256K1 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_SECP256K1 +#define SIGN_OF_X_SECP256K1 + +#define ATE_BITS_SECP256K1 +#define G2_TABLE_SECP256K1 + +#endif + + +#if CURVE_SECURITY_SECP256K1 == 128 +#define AESKEY_SECP256K1 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_SECP256K1 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_SECP256K1 == 192 +#define AESKEY_SECP256K1 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_SECP256K1 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_SECP256K1 == 256 +#define AESKEY_SECP256K1 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_SECP256K1 SHA512 /**< Hash type */ +#endif + + +namespace SECP256K1_BIG = B256_56; +namespace SECP256K1_FP = SECP256K1; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_SM2.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_SM2.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_SM2.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_SM2.h index 6207f4f..d193948 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_SM2.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_SM2.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_SM2_H -#define CONFIG_CURVE_SM2_H - -#include"core.h" -#include"config_field_SM2.h" - -// ECP stuff - -#define CURVETYPE_SM2 WEIERSTRASS -#define CURVE_A_SM2 -3 -#define PAIRING_FRIENDLY_SM2 NOT_PF -#define CURVE_SECURITY_SM2 128 -#define HTC_ISO_SM2 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_SM2 - -#if PAIRING_FRIENDLY_SM2 != NOT_PF - -#define HTC_ISO_G2_SM2 0 - -#define USE_GLV_SM2 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_SM2 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_SM2 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_SM2 -#define SIGN_OF_X_SM2 - -#define ATE_BITS_SM2 -#define G2_TABLE_SM2 - -#endif - - -#if CURVE_SECURITY_SM2 == 128 -#define AESKEY_SM2 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_SM2 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_SM2 == 192 -#define AESKEY_SM2 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_SM2 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_SM2 == 256 -#define AESKEY_SM2 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_SM2 SHA512 /**< Hash type */ -#endif - - -namespace SM2_BIG = B256_56; -namespace SM2_FP = SM2; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_SM2_H +#define CONFIG_CURVE_SM2_H + +#include"core.h" +#include"config_field_SM2.h" + +// ECP stuff + +#define CURVETYPE_SM2 WEIERSTRASS +#define CURVE_A_SM2 -3 +#define PAIRING_FRIENDLY_SM2 NOT_PF +#define CURVE_SECURITY_SM2 128 +#define HTC_ISO_SM2 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_SM2 + +#if PAIRING_FRIENDLY_SM2 != NOT_PF + +#define HTC_ISO_G2_SM2 0 + +#define USE_GLV_SM2 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_SM2 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_SM2 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_SM2 +#define SIGN_OF_X_SM2 + +#define ATE_BITS_SM2 +#define G2_TABLE_SM2 + +#endif + + +#if CURVE_SECURITY_SM2 == 128 +#define AESKEY_SM2 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_SM2 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_SM2 == 192 +#define AESKEY_SM2 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_SM2 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_SM2 == 256 +#define AESKEY_SM2 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_SM2 SHA512 /**< Hash type */ +#endif + + +namespace SM2_BIG = B256_56; +namespace SM2_FP = SM2; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_TWEEDLEDEE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_TWEEDLEDEE.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_TWEEDLEDEE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_TWEEDLEDEE.h index 329e004..beff313 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_TWEEDLEDEE.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_TWEEDLEDEE.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_TWEEDLEDEE_H -#define CONFIG_CURVE_TWEEDLEDEE_H - -#include"core.h" -#include"config_field_TWEEDLEDEE.h" - -// ECP stuff - -#define CURVETYPE_TWEEDLEDEE WEIERSTRASS -#define CURVE_A_TWEEDLEDEE 0 -#define PAIRING_FRIENDLY_TWEEDLEDEE NOT_PF -#define CURVE_SECURITY_TWEEDLEDEE 128 -#define HTC_ISO_TWEEDLEDEE 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_TWEEDLEDEE - -#if PAIRING_FRIENDLY_TWEEDLEDEE != NOT_PF - -#define HTC_ISO_G2_TWEEDLEDEE 0 - -#define USE_GLV_TWEEDLEDEE /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_TWEEDLEDEE /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_TWEEDLEDEE /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_TWEEDLEDEE -#define SIGN_OF_X_TWEEDLEDEE - -#define ATE_BITS_TWEEDLEDEE -#define G2_TABLE_TWEEDLEDEE - -#endif - - -#if CURVE_SECURITY_TWEEDLEDEE == 128 -#define AESKEY_TWEEDLEDEE 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_TWEEDLEDEE SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_TWEEDLEDEE == 192 -#define AESKEY_TWEEDLEDEE 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_TWEEDLEDEE SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_TWEEDLEDEE == 256 -#define AESKEY_TWEEDLEDEE 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_TWEEDLEDEE SHA512 /**< Hash type */ -#endif - - -namespace TWEEDLEDEE_BIG = B256_56; -namespace TWEEDLEDEE_FP = TWEEDLEDEE; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_TWEEDLEDEE_H +#define CONFIG_CURVE_TWEEDLEDEE_H + +#include"core.h" +#include"config_field_TWEEDLEDEE.h" + +// ECP stuff + +#define CURVETYPE_TWEEDLEDEE WEIERSTRASS +#define CURVE_A_TWEEDLEDEE 0 +#define PAIRING_FRIENDLY_TWEEDLEDEE NOT_PF +#define CURVE_SECURITY_TWEEDLEDEE 128 +#define HTC_ISO_TWEEDLEDEE 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_TWEEDLEDEE + +#if PAIRING_FRIENDLY_TWEEDLEDEE != NOT_PF + +#define HTC_ISO_G2_TWEEDLEDEE 0 + +#define USE_GLV_TWEEDLEDEE /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_TWEEDLEDEE /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_TWEEDLEDEE /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_TWEEDLEDEE +#define SIGN_OF_X_TWEEDLEDEE + +#define ATE_BITS_TWEEDLEDEE +#define G2_TABLE_TWEEDLEDEE + +#endif + + +#if CURVE_SECURITY_TWEEDLEDEE == 128 +#define AESKEY_TWEEDLEDEE 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_TWEEDLEDEE SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_TWEEDLEDEE == 192 +#define AESKEY_TWEEDLEDEE 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_TWEEDLEDEE SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_TWEEDLEDEE == 256 +#define AESKEY_TWEEDLEDEE 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_TWEEDLEDEE SHA512 /**< Hash type */ +#endif + + +namespace TWEEDLEDEE_BIG = B256_56; +namespace TWEEDLEDEE_FP = TWEEDLEDEE; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_TWEEDLEDUM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_TWEEDLEDUM.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_TWEEDLEDUM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_TWEEDLEDUM.h index 07fb3d7..84ad8cd 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_TWEEDLEDUM.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_TWEEDLEDUM.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_TWEEDLEDUM_H -#define CONFIG_CURVE_TWEEDLEDUM_H - -#include"core.h" -#include"config_field_TWEEDLEDUM.h" - -// ECP stuff - -#define CURVETYPE_TWEEDLEDUM WEIERSTRASS -#define CURVE_A_TWEEDLEDUM 0 -#define PAIRING_FRIENDLY_TWEEDLEDUM NOT_PF -#define CURVE_SECURITY_TWEEDLEDUM 128 -#define HTC_ISO_TWEEDLEDUM 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_TWEEDLEDUM - -#if PAIRING_FRIENDLY_TWEEDLEDUM != NOT_PF - -#define HTC_ISO_G2_TWEEDLEDUM 0 - -#define USE_GLV_TWEEDLEDUM /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_TWEEDLEDUM /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_TWEEDLEDUM /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_TWEEDLEDUM -#define SIGN_OF_X_TWEEDLEDUM - -#define ATE_BITS_TWEEDLEDUM -#define G2_TABLE_TWEEDLEDUM - -#endif - - -#if CURVE_SECURITY_TWEEDLEDUM == 128 -#define AESKEY_TWEEDLEDUM 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_TWEEDLEDUM SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_TWEEDLEDUM == 192 -#define AESKEY_TWEEDLEDUM 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_TWEEDLEDUM SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_TWEEDLEDUM == 256 -#define AESKEY_TWEEDLEDUM 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_TWEEDLEDUM SHA512 /**< Hash type */ -#endif - - -namespace TWEEDLEDUM_BIG = B256_56; -namespace TWEEDLEDUM_FP = TWEEDLEDUM; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_TWEEDLEDUM_H +#define CONFIG_CURVE_TWEEDLEDUM_H + +#include"core.h" +#include"config_field_TWEEDLEDUM.h" + +// ECP stuff + +#define CURVETYPE_TWEEDLEDUM WEIERSTRASS +#define CURVE_A_TWEEDLEDUM 0 +#define PAIRING_FRIENDLY_TWEEDLEDUM NOT_PF +#define CURVE_SECURITY_TWEEDLEDUM 128 +#define HTC_ISO_TWEEDLEDUM 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_TWEEDLEDUM + +#if PAIRING_FRIENDLY_TWEEDLEDUM != NOT_PF + +#define HTC_ISO_G2_TWEEDLEDUM 0 + +#define USE_GLV_TWEEDLEDUM /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_TWEEDLEDUM /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_TWEEDLEDUM /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_TWEEDLEDUM +#define SIGN_OF_X_TWEEDLEDUM + +#define ATE_BITS_TWEEDLEDUM +#define G2_TABLE_TWEEDLEDUM + +#endif + + +#if CURVE_SECURITY_TWEEDLEDUM == 128 +#define AESKEY_TWEEDLEDUM 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_TWEEDLEDUM SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_TWEEDLEDUM == 192 +#define AESKEY_TWEEDLEDUM 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_TWEEDLEDUM SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_TWEEDLEDUM == 256 +#define AESKEY_TWEEDLEDUM 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_TWEEDLEDUM SHA512 /**< Hash type */ +#endif + + +namespace TWEEDLEDUM_BIG = B256_56; +namespace TWEEDLEDUM_FP = TWEEDLEDUM; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_X448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_X448.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_X448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_X448.h index aa8e596..e12aced 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_curve_X448.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_curve_X448.h @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_CURVE_X448_H -#define CONFIG_CURVE_X448_H - -#include"core.h" -#include"config_field_F448.h" - -// ECP stuff - -#define CURVETYPE_X448 MONTGOMERY -#define CURVE_A_X448 156326 -#define PAIRING_FRIENDLY_X448 NOT_PF -#define CURVE_SECURITY_X448 256 -#define HTC_ISO_X448 0 - -// Permit alternate compression method if 3 spare top bits in field representation -// Must be set manually -// #define ALLOW_ALT_COMPRESS_X448 - -#if PAIRING_FRIENDLY_X448 != NOT_PF - -#define HTC_ISO_G2_X448 0 - -#define USE_GLV_X448 /**< Note this method is patented (GLV), so maybe you want to comment this out */ -#define USE_GS_G2_X448 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ -#define USE_GS_GT_X448 /**< Not patented, so probably safe to always use this */ - -#define POSITIVEX 0 -#define NEGATIVEX 1 - -#define SEXTIC_TWIST_X448 -#define SIGN_OF_X_X448 - -#define ATE_BITS_X448 -#define G2_TABLE_X448 - -#endif - - -#if CURVE_SECURITY_X448 == 128 -#define AESKEY_X448 16 /**< Symmetric Key size - 128 bits */ -#define HASH_TYPE_X448 SHA256 /**< Hash type */ -#endif - -#if CURVE_SECURITY_X448 == 192 -#define AESKEY_X448 24 /**< Symmetric Key size - 192 bits */ -#define HASH_TYPE_X448 SHA384 /**< Hash type */ -#endif - -#if CURVE_SECURITY_X448 == 256 -#define AESKEY_X448 32 /**< Symmetric Key size - 256 bits */ -#define HASH_TYPE_X448 SHA512 /**< Hash type */ -#endif - - -namespace X448_BIG = B448_58; -namespace X448_FP = F448; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_CURVE_X448_H +#define CONFIG_CURVE_X448_H + +#include"core.h" +#include"config_field_F448.h" + +// ECP stuff + +#define CURVETYPE_X448 MONTGOMERY +#define CURVE_A_X448 156326 +#define PAIRING_FRIENDLY_X448 NOT_PF +#define CURVE_SECURITY_X448 256 +#define HTC_ISO_X448 0 + +// Permit alternate compression method if 3 spare top bits in field representation +// Must be set manually +// #define ALLOW_ALT_COMPRESS_X448 + +#if PAIRING_FRIENDLY_X448 != NOT_PF + +#define HTC_ISO_G2_X448 0 + +#define USE_GLV_X448 /**< Note this method is patented (GLV), so maybe you want to comment this out */ +#define USE_GS_G2_X448 /**< Well we didn't patent it :) But may be covered by GLV patent :( */ +#define USE_GS_GT_X448 /**< Not patented, so probably safe to always use this */ + +#define POSITIVEX 0 +#define NEGATIVEX 1 + +#define SEXTIC_TWIST_X448 +#define SIGN_OF_X_X448 + +#define ATE_BITS_X448 +#define G2_TABLE_X448 + +#endif + + +#if CURVE_SECURITY_X448 == 128 +#define AESKEY_X448 16 /**< Symmetric Key size - 128 bits */ +#define HASH_TYPE_X448 SHA256 /**< Hash type */ +#endif + +#if CURVE_SECURITY_X448 == 192 +#define AESKEY_X448 24 /**< Symmetric Key size - 192 bits */ +#define HASH_TYPE_X448 SHA384 /**< Hash type */ +#endif + +#if CURVE_SECURITY_X448 == 256 +#define AESKEY_X448 32 /**< Symmetric Key size - 256 bits */ +#define HASH_TYPE_X448 SHA512 /**< Hash type */ +#endif + + +namespace X448_BIG = B448_58; +namespace X448_FP = F448; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_ff.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_ff.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_ff.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_ff.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_ff_RSA2048.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_ff_RSA2048.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_ff_RSA2048.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_ff_RSA2048.h index 9295409..69a2143 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_ff_RSA2048.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_ff_RSA2048.h @@ -1,32 +1,32 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_RSA_RSA2048_H -#define CONFIG_RSA_RSA2048_H - -#include "core.h" -#include "config_big_B512_60.h" - -// FF stuff - -#define FFLEN_RSA2048 4 /**< 2^n multiplier of BIGBITS to specify supported Finite Field size, e.g 2048=256*2^3 where BIGBITS=256 */ - -namespace RSA2048_BIG = B512_60; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_RSA_RSA2048_H +#define CONFIG_RSA_RSA2048_H + +#include "core.h" +#include "config_big_B512_60.h" + +// FF stuff + +#define FFLEN_RSA2048 4 /**< 2^n multiplier of BIGBITS to specify supported Finite Field size, e.g 2048=256*2^3 where BIGBITS=256 */ + +namespace RSA2048_BIG = B512_60; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_ff_RSA3072.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_ff_RSA3072.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_ff_RSA3072.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_ff_RSA3072.h index aa73885..5b58063 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_ff_RSA3072.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_ff_RSA3072.h @@ -1,32 +1,32 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_RSA_RSA3072_H -#define CONFIG_RSA_RSA3072_H - -#include "core.h" -#include "config_big_B384_56.h" - -// FF stuff - -#define FFLEN_RSA3072 8 /**< 2^n multiplier of BIGBITS to specify supported Finite Field size, e.g 2048=256*2^3 where BIGBITS=256 */ - -namespace RSA3072_BIG = B384_56; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_RSA_RSA3072_H +#define CONFIG_RSA_RSA3072_H + +#include "core.h" +#include "config_big_B384_56.h" + +// FF stuff + +#define FFLEN_RSA3072 8 /**< 2^n multiplier of BIGBITS to specify supported Finite Field size, e.g 2048=256*2^3 where BIGBITS=256 */ + +namespace RSA3072_BIG = B384_56; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_ff_RSA4096.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_ff_RSA4096.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_ff_RSA4096.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_ff_RSA4096.h index 8b0323c..605cccc 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_ff_RSA4096.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_ff_RSA4096.h @@ -1,32 +1,32 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_RSA_RSA4096_H -#define CONFIG_RSA_RSA4096_H - -#include "core.h" -#include "config_big_B512_60.h" - -// FF stuff - -#define FFLEN_RSA4096 8 /**< 2^n multiplier of BIGBITS to specify supported Finite Field size, e.g 2048=256*2^3 where BIGBITS=256 */ - -namespace RSA4096_BIG = B512_60; - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_RSA_RSA4096_H +#define CONFIG_RSA_RSA4096_H + +#include "core.h" +#include "config_big_B512_60.h" + +// FF stuff + +#define FFLEN_RSA4096 8 /**< 2^n multiplier of BIGBITS to specify supported Finite Field size, e.g 2048=256*2^3 where BIGBITS=256 */ + +namespace RSA4096_BIG = B512_60; + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/config_field.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_ANSSI.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_ANSSI.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_ANSSI.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_ANSSI.h index e810e76..a12e78a 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_ANSSI.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_ANSSI.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_ANSSI_H -#define CONFIG_FIELD_ANSSI_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_ANSSI 256 -#define PM1D2_ANSSI 1 -#define MODTYPE_ANSSI NOT_SPECIAL -#define MAXXES_ANSSI 24 -#define QNRI_ANSSI 0 -#define RIADZ_ANSSI -5 -#define RIADZG2A_ANSSI 0 -#define RIADZG2B_ANSSI 0 -#define TOWER_ANSSI NEGATOWER - -//#define BIG_ENDIAN_SIGN_ANSSI - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_ANSSI_H +#define CONFIG_FIELD_ANSSI_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_ANSSI 256 +#define PM1D2_ANSSI 1 +#define MODTYPE_ANSSI NOT_SPECIAL +#define MAXXES_ANSSI 24 +#define QNRI_ANSSI 0 +#define RIADZ_ANSSI -5 +#define RIADZG2A_ANSSI 0 +#define RIADZG2B_ANSSI 0 +#define TOWER_ANSSI NEGATOWER + +//#define BIG_ENDIAN_SIGN_ANSSI + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS12381.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS12381.h index 53923e3..579fce1 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS12381.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS12381.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_BLS12381_H -#define CONFIG_FIELD_BLS12381_H - -#include"core.h" -#include "config_big_B384_58.h" - -// FP stuff - -#define MBITS_BLS12381 381 -#define PM1D2_BLS12381 1 -#define MODTYPE_BLS12381 NOT_SPECIAL -#define MAXXES_BLS12381 25 -#define QNRI_BLS12381 0 -#define RIADZ_BLS12381 11 -#define RIADZG2A_BLS12381 -2 -#define RIADZG2B_BLS12381 -1 -#define TOWER_BLS12381 NEGATOWER - -//#define BIG_ENDIAN_SIGN_BLS12381 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_BLS12381_H +#define CONFIG_FIELD_BLS12381_H + +#include"core.h" +#include "config_big_B384_58.h" + +// FP stuff + +#define MBITS_BLS12381 381 +#define PM1D2_BLS12381 1 +#define MODTYPE_BLS12381 NOT_SPECIAL +#define MAXXES_BLS12381 25 +#define QNRI_BLS12381 0 +#define RIADZ_BLS12381 11 +#define RIADZG2A_BLS12381 -2 +#define RIADZG2B_BLS12381 -1 +#define TOWER_BLS12381 NEGATOWER + +//#define BIG_ENDIAN_SIGN_BLS12381 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS12383.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS12383.h index 48fef18..03cb9c7 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS12383.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS12383.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_BLS12383_H -#define CONFIG_FIELD_BLS12383_H - -#include"core.h" -#include "config_big_B384_58.h" - -// FP stuff - -#define MBITS_BLS12383 383 -#define PM1D2_BLS12383 1 -#define MODTYPE_BLS12383 NOT_SPECIAL -#define MAXXES_BLS12383 23 -#define QNRI_BLS12383 0 -#define RIADZ_BLS12383 1 -#define RIADZG2A_BLS12383 1 -#define RIADZG2B_BLS12383 0 -#define TOWER_BLS12383 NEGATOWER - -//#define BIG_ENDIAN_SIGN_BLS12383 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_BLS12383_H +#define CONFIG_FIELD_BLS12383_H + +#include"core.h" +#include "config_big_B384_58.h" + +// FP stuff + +#define MBITS_BLS12383 383 +#define PM1D2_BLS12383 1 +#define MODTYPE_BLS12383 NOT_SPECIAL +#define MAXXES_BLS12383 23 +#define QNRI_BLS12383 0 +#define RIADZ_BLS12383 1 +#define RIADZG2A_BLS12383 1 +#define RIADZG2B_BLS12383 0 +#define TOWER_BLS12383 NEGATOWER + +//#define BIG_ENDIAN_SIGN_BLS12383 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS12443.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS12443.h index 9201da4..03ffae8 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS12443.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS12443.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_BLS12443_H -#define CONFIG_FIELD_BLS12443_H - -#include"core.h" -#include "config_big_B448_60.h" - -// FP stuff - -#define MBITS_BLS12443 443 -#define PM1D2_BLS12443 1 -#define MODTYPE_BLS12443 NOT_SPECIAL -#define MAXXES_BLS12443 30 -#define QNRI_BLS12443 0 -#define RIADZ_BLS12443 -7 -#define RIADZG2A_BLS12443 1 -#define RIADZG2B_BLS12443 1 -#define TOWER_BLS12443 NEGATOWER - -//#define BIG_ENDIAN_SIGN_BLS12443 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_BLS12443_H +#define CONFIG_FIELD_BLS12443_H + +#include"core.h" +#include "config_big_B448_60.h" + +// FP stuff + +#define MBITS_BLS12443 443 +#define PM1D2_BLS12443 1 +#define MODTYPE_BLS12443 NOT_SPECIAL +#define MAXXES_BLS12443 30 +#define QNRI_BLS12443 0 +#define RIADZ_BLS12443 -7 +#define RIADZG2A_BLS12443 1 +#define RIADZG2B_BLS12443 1 +#define TOWER_BLS12443 NEGATOWER + +//#define BIG_ENDIAN_SIGN_BLS12443 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS12461.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS12461.h index 08e8713..5377186 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS12461.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS12461.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_BLS12461_H -#define CONFIG_FIELD_BLS12461_H - -#include"core.h" -#include "config_big_B464_60.h" - -// FP stuff - -#define MBITS_BLS12461 461 -#define PM1D2_BLS12461 1 -#define MODTYPE_BLS12461 NOT_SPECIAL -#define MAXXES_BLS12461 19 -#define QNRI_BLS12461 0 -#define RIADZ_BLS12461 1 -#define RIADZG2A_BLS12461 4 -#define RIADZG2B_BLS12461 0 -#define TOWER_BLS12461 NEGATOWER - -//#define BIG_ENDIAN_SIGN_BLS12461 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_BLS12461_H +#define CONFIG_FIELD_BLS12461_H + +#include"core.h" +#include "config_big_B464_60.h" + +// FP stuff + +#define MBITS_BLS12461 461 +#define PM1D2_BLS12461 1 +#define MODTYPE_BLS12461 NOT_SPECIAL +#define MAXXES_BLS12461 19 +#define QNRI_BLS12461 0 +#define RIADZ_BLS12461 1 +#define RIADZG2A_BLS12461 4 +#define RIADZG2B_BLS12461 0 +#define TOWER_BLS12461 NEGATOWER + +//#define BIG_ENDIAN_SIGN_BLS12461 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS24479.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS24479.h index 2feefdc..0d7aeaf 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS24479.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS24479.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_BLS24479_H -#define CONFIG_FIELD_BLS24479_H - -#include"core.h" -#include "config_big_B480_56.h" - -// FP stuff - -#define MBITS_BLS24479 479 -#define PM1D2_BLS24479 1 -#define MODTYPE_BLS24479 NOT_SPECIAL -#define MAXXES_BLS24479 25 -#define QNRI_BLS24479 0 -#define RIADZ_BLS24479 1 -#define RIADZG2A_BLS24479 4 -#define RIADZG2B_BLS24479 0 -#define TOWER_BLS24479 NEGATOWER - -//#define BIG_ENDIAN_SIGN_BLS24479 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_BLS24479_H +#define CONFIG_FIELD_BLS24479_H + +#include"core.h" +#include "config_big_B480_56.h" + +// FP stuff + +#define MBITS_BLS24479 479 +#define PM1D2_BLS24479 1 +#define MODTYPE_BLS24479 NOT_SPECIAL +#define MAXXES_BLS24479 25 +#define QNRI_BLS24479 0 +#define RIADZ_BLS24479 1 +#define RIADZG2A_BLS24479 4 +#define RIADZG2B_BLS24479 0 +#define TOWER_BLS24479 NEGATOWER + +//#define BIG_ENDIAN_SIGN_BLS24479 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS48286.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS48286.h index c7c8b56..c34c09d 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS48286.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS48286.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_BLS48286_H -#define CONFIG_FIELD_BLS48286_H - -#include"core.h" -#include "config_big_B288_60.h" - -// FP stuff - -#define MBITS_BLS48286 286 -#define PM1D2_BLS48286 1 -#define MODTYPE_BLS48286 NOT_SPECIAL -#define MAXXES_BLS48286 14 -#define QNRI_BLS48286 0 -#define RIADZ_BLS48286 1 -#define RIADZG2A_BLS48286 1 -#define RIADZG2B_BLS48286 0 -#define TOWER_BLS48286 NEGATOWER - -//#define BIG_ENDIAN_SIGN_BLS48286 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_BLS48286_H +#define CONFIG_FIELD_BLS48286_H + +#include"core.h" +#include "config_big_B288_60.h" + +// FP stuff + +#define MBITS_BLS48286 286 +#define PM1D2_BLS48286 1 +#define MODTYPE_BLS48286 NOT_SPECIAL +#define MAXXES_BLS48286 14 +#define QNRI_BLS48286 0 +#define RIADZ_BLS48286 1 +#define RIADZG2A_BLS48286 1 +#define RIADZG2B_BLS48286 0 +#define TOWER_BLS48286 NEGATOWER + +//#define BIG_ENDIAN_SIGN_BLS48286 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS48556.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS48556.h index 5837180..d5705c1 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS48556.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS48556.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_BLS48556_H -#define CONFIG_FIELD_BLS48556_H - -#include"core.h" -#include "config_big_B560_58.h" - -// FP stuff - -#define MBITS_BLS48556 556 -#define PM1D2_BLS48556 1 -#define MODTYPE_BLS48556 NOT_SPECIAL -#define MAXXES_BLS48556 24 -#define QNRI_BLS48556 0 -#define RIADZ_BLS48556 -1 -#define RIADZG2A_BLS48556 2 -#define RIADZG2B_BLS48556 0 -#define TOWER_BLS48556 NEGATOWER - -//#define BIG_ENDIAN_SIGN_BLS48556 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_BLS48556_H +#define CONFIG_FIELD_BLS48556_H + +#include"core.h" +#include "config_big_B560_58.h" + +// FP stuff + +#define MBITS_BLS48556 556 +#define PM1D2_BLS48556 1 +#define MODTYPE_BLS48556 NOT_SPECIAL +#define MAXXES_BLS48556 24 +#define QNRI_BLS48556 0 +#define RIADZ_BLS48556 -1 +#define RIADZG2A_BLS48556 2 +#define RIADZG2B_BLS48556 0 +#define TOWER_BLS48556 NEGATOWER + +//#define BIG_ENDIAN_SIGN_BLS48556 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS48581.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS48581.h index 9250ec0..20ad904 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BLS48581.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BLS48581.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_BLS48581_H -#define CONFIG_FIELD_BLS48581_H - -#include"core.h" -#include "config_big_B584_60.h" - -// FP stuff - -#define MBITS_BLS48581 581 -#define PM1D2_BLS48581 1 -#define MODTYPE_BLS48581 NOT_SPECIAL -#define MAXXES_BLS48581 19 -#define QNRI_BLS48581 0 -#define RIADZ_BLS48581 2 -#define RIADZG2A_BLS48581 2 -#define RIADZG2B_BLS48581 0 -#define TOWER_BLS48581 POSITOWER - -//#define BIG_ENDIAN_SIGN_BLS48581 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_BLS48581_H +#define CONFIG_FIELD_BLS48581_H + +#include"core.h" +#include "config_big_B584_60.h" + +// FP stuff + +#define MBITS_BLS48581 581 +#define PM1D2_BLS48581 1 +#define MODTYPE_BLS48581 NOT_SPECIAL +#define MAXXES_BLS48581 19 +#define QNRI_BLS48581 0 +#define RIADZ_BLS48581 2 +#define RIADZG2A_BLS48581 2 +#define RIADZG2B_BLS48581 0 +#define TOWER_BLS48581 POSITOWER + +//#define BIG_ENDIAN_SIGN_BLS48581 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BN158.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BN158.h index 8ca6c82..024b195 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BN158.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BN158.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_BN158_H -#define CONFIG_FIELD_BN158_H - -#include"core.h" -#include "config_big_B160_56.h" - -// FP stuff - -#define MBITS_BN158 158 -#define PM1D2_BN158 1 -#define MODTYPE_BN158 NOT_SPECIAL -#define MAXXES_BN158 10 -#define QNRI_BN158 0 -#define RIADZ_BN158 1 -#define RIADZG2A_BN158 1 -#define RIADZG2B_BN158 0 -#define TOWER_BN158 NEGATOWER - -//#define BIG_ENDIAN_SIGN_BN158 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_BN158_H +#define CONFIG_FIELD_BN158_H + +#include"core.h" +#include "config_big_B160_56.h" + +// FP stuff + +#define MBITS_BN158 158 +#define PM1D2_BN158 1 +#define MODTYPE_BN158 NOT_SPECIAL +#define MAXXES_BN158 10 +#define QNRI_BN158 0 +#define RIADZ_BN158 1 +#define RIADZG2A_BN158 1 +#define RIADZG2B_BN158 0 +#define TOWER_BN158 NEGATOWER + +//#define BIG_ENDIAN_SIGN_BN158 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BN254.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BN254.h index 6f1849c..187ae79 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BN254.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BN254.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_BN254_H -#define CONFIG_FIELD_BN254_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_BN254 254 -#define PM1D2_BN254 1 -#define MODTYPE_BN254 NOT_SPECIAL -#define MAXXES_BN254 26 -#define QNRI_BN254 0 -#define RIADZ_BN254 -1 -#define RIADZG2A_BN254 -1 -#define RIADZG2B_BN254 0 -#define TOWER_BN254 NEGATOWER - -//#define BIG_ENDIAN_SIGN_BN254 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_BN254_H +#define CONFIG_FIELD_BN254_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_BN254 254 +#define PM1D2_BN254 1 +#define MODTYPE_BN254 NOT_SPECIAL +#define MAXXES_BN254 26 +#define QNRI_BN254 0 +#define RIADZ_BN254 -1 +#define RIADZG2A_BN254 -1 +#define RIADZG2B_BN254 0 +#define TOWER_BN254 NEGATOWER + +//#define BIG_ENDIAN_SIGN_BN254 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BN254CX.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BN254CX.h index 5a65df1..b3b3e26 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BN254CX.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BN254CX.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_BN254CX_H -#define CONFIG_FIELD_BN254CX_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_BN254CX 254 -#define PM1D2_BN254CX 1 -#define MODTYPE_BN254CX NOT_SPECIAL -#define MAXXES_BN254CX 26 -#define QNRI_BN254CX 0 -#define RIADZ_BN254CX -1 -#define RIADZG2A_BN254CX -1 -#define RIADZG2B_BN254CX 0 -#define TOWER_BN254CX NEGATOWER - -//#define BIG_ENDIAN_SIGN_BN254CX - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_BN254CX_H +#define CONFIG_FIELD_BN254CX_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_BN254CX 254 +#define PM1D2_BN254CX 1 +#define MODTYPE_BN254CX NOT_SPECIAL +#define MAXXES_BN254CX 26 +#define QNRI_BN254CX 0 +#define RIADZ_BN254CX -1 +#define RIADZG2A_BN254CX -1 +#define RIADZG2B_BN254CX 0 +#define TOWER_BN254CX NEGATOWER + +//#define BIG_ENDIAN_SIGN_BN254CX + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BN462.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BN462.h index 8210e2f..1690105 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BN462.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BN462.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_BN462_H -#define CONFIG_FIELD_BN462_H - -#include"core.h" -#include "config_big_B464_60.h" - -// FP stuff - -#define MBITS_BN462 462 -#define PM1D2_BN462 1 -#define MODTYPE_BN462 NOT_SPECIAL -#define MAXXES_BN462 18 -#define QNRI_BN462 1 -#define RIADZ_BN462 1 -#define RIADZG2A_BN462 1 -#define RIADZG2B_BN462 0 -#define TOWER_BN462 NEGATOWER - -//#define BIG_ENDIAN_SIGN_BN462 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_BN462_H +#define CONFIG_FIELD_BN462_H + +#include"core.h" +#include "config_big_B464_60.h" + +// FP stuff + +#define MBITS_BN462 462 +#define PM1D2_BN462 1 +#define MODTYPE_BN462 NOT_SPECIAL +#define MAXXES_BN462 18 +#define QNRI_BN462 1 +#define RIADZ_BN462 1 +#define RIADZG2A_BN462 1 +#define RIADZG2B_BN462 0 +#define TOWER_BN462 NEGATOWER + +//#define BIG_ENDIAN_SIGN_BN462 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BRAINPOOL.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BRAINPOOL.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BRAINPOOL.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BRAINPOOL.h index 3747fb2..be6cb12 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_BRAINPOOL.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_BRAINPOOL.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_BRAINPOOL_H -#define CONFIG_FIELD_BRAINPOOL_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_BRAINPOOL 256 -#define PM1D2_BRAINPOOL 1 -#define MODTYPE_BRAINPOOL NOT_SPECIAL -#define MAXXES_BRAINPOOL 24 -#define QNRI_BRAINPOOL 0 -#define RIADZ_BRAINPOOL -3 -#define RIADZG2A_BRAINPOOL 0 -#define RIADZG2B_BRAINPOOL 0 -#define TOWER_BRAINPOOL NEGATOWER - -//#define BIG_ENDIAN_SIGN_BRAINPOOL - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_BRAINPOOL_H +#define CONFIG_FIELD_BRAINPOOL_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_BRAINPOOL 256 +#define PM1D2_BRAINPOOL 1 +#define MODTYPE_BRAINPOOL NOT_SPECIAL +#define MAXXES_BRAINPOOL 24 +#define QNRI_BRAINPOOL 0 +#define RIADZ_BRAINPOOL -3 +#define RIADZG2A_BRAINPOOL 0 +#define RIADZG2B_BRAINPOOL 0 +#define TOWER_BRAINPOOL NEGATOWER + +//#define BIG_ENDIAN_SIGN_BRAINPOOL + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_C1174.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_C1174.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_C1174.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_C1174.h index c7386c8..79f81eb 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_C1174.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_C1174.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_C1174_H -#define CONFIG_FIELD_C1174_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_C1174 251 -#define PM1D2_C1174 1 -#define MODTYPE_C1174 PSEUDO_MERSENNE -#define MAXXES_C1174 29 -#define QNRI_C1174 0 -#define RIADZ_C1174 0 -#define RIADZG2A_C1174 0 -#define RIADZG2B_C1174 0 -#define TOWER_C1174 NEGATOWER - -//#define BIG_ENDIAN_SIGN_C1174 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_C1174_H +#define CONFIG_FIELD_C1174_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_C1174 251 +#define PM1D2_C1174 1 +#define MODTYPE_C1174 PSEUDO_MERSENNE +#define MAXXES_C1174 29 +#define QNRI_C1174 0 +#define RIADZ_C1174 0 +#define RIADZG2A_C1174 0 +#define RIADZG2B_C1174 0 +#define TOWER_C1174 NEGATOWER + +//#define BIG_ENDIAN_SIGN_C1174 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_C1665.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_C1665.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_C1665.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_C1665.h index 3759646..8a1b1c4 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_C1665.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_C1665.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_C1665_H -#define CONFIG_FIELD_C1665_H - -#include"core.h" -#include "config_big_B168_60.h" - -// FP stuff - -#define MBITS_C1665 166 -#define PM1D2_C1665 1 -#define MODTYPE_C1665 PSEUDO_MERSENNE -#define MAXXES_C1665 14 -#define QNRI_C1665 0 -#define RIADZ_C1665 0 -#define RIADZG2A_C1665 0 -#define RIADZG2B_C1665 0 -#define TOWER_C1665 NEGATOWER - -//#define BIG_ENDIAN_SIGN_C1665 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_C1665_H +#define CONFIG_FIELD_C1665_H + +#include"core.h" +#include "config_big_B168_60.h" + +// FP stuff + +#define MBITS_C1665 166 +#define PM1D2_C1665 1 +#define MODTYPE_C1665 PSEUDO_MERSENNE +#define MAXXES_C1665 14 +#define QNRI_C1665 0 +#define RIADZ_C1665 0 +#define RIADZG2A_C1665 0 +#define RIADZG2B_C1665 0 +#define TOWER_C1665 NEGATOWER + +//#define BIG_ENDIAN_SIGN_C1665 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_C41417.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_C41417.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_C41417.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_C41417.h index 4424809..55391bd 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_C41417.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_C41417.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_C41417_H -#define CONFIG_FIELD_C41417_H - -#include"core.h" -#include "config_big_B416_60.h" - -// FP stuff - -#define MBITS_C41417 414 -#define PM1D2_C41417 1 -#define MODTYPE_C41417 PSEUDO_MERSENNE -#define MAXXES_C41417 6 -#define QNRI_C41417 0 -#define RIADZ_C41417 1 -#define RIADZG2A_C41417 0 -#define RIADZG2B_C41417 0 -#define TOWER_C41417 NEGATOWER - -//#define BIG_ENDIAN_SIGN_C41417 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_C41417_H +#define CONFIG_FIELD_C41417_H + +#include"core.h" +#include "config_big_B416_60.h" + +// FP stuff + +#define MBITS_C41417 414 +#define PM1D2_C41417 1 +#define MODTYPE_C41417 PSEUDO_MERSENNE +#define MAXXES_C41417 6 +#define QNRI_C41417 0 +#define RIADZ_C41417 1 +#define RIADZG2A_C41417 0 +#define RIADZG2B_C41417 0 +#define TOWER_C41417 NEGATOWER + +//#define BIG_ENDIAN_SIGN_C41417 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F25519.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F25519.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F25519.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F25519.h index 0546ad7..37c0fe4 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F25519.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F25519.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_F25519_H -#define CONFIG_FIELD_F25519_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_F25519 255 -#define PM1D2_F25519 2 -#define MODTYPE_F25519 PSEUDO_MERSENNE -#define MAXXES_F25519 25 -#define QNRI_F25519 0 -#define RIADZ_F25519 2 -#define RIADZG2A_F25519 0 -#define RIADZG2B_F25519 0 -#define TOWER_F25519 NEGATOWER - -//#define BIG_ENDIAN_SIGN_F25519 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_F25519_H +#define CONFIG_FIELD_F25519_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_F25519 255 +#define PM1D2_F25519 2 +#define MODTYPE_F25519 PSEUDO_MERSENNE +#define MAXXES_F25519 25 +#define QNRI_F25519 0 +#define RIADZ_F25519 2 +#define RIADZG2A_F25519 0 +#define RIADZG2B_F25519 0 +#define TOWER_F25519 NEGATOWER + +//#define BIG_ENDIAN_SIGN_F25519 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F256PME.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F256PME.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F256PME.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F256PME.h index 721f005..1b1296e 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F256PME.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F256PME.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_F256PME_H -#define CONFIG_FIELD_F256PME_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_F256PME 256 -#define PM1D2_F256PME 1 -#define MODTYPE_F256PME PSEUDO_MERSENNE -#define MAXXES_F256PME 24 -#define QNRI_F256PME 0 -#define RIADZ_F256PME 0 -#define RIADZG2A_F256PME 0 -#define RIADZG2B_F256PME 0 -#define TOWER_F256PME NEGATOWER - -//#define BIG_ENDIAN_SIGN_F256PME - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_F256PME_H +#define CONFIG_FIELD_F256PME_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_F256PME 256 +#define PM1D2_F256PME 1 +#define MODTYPE_F256PME PSEUDO_MERSENNE +#define MAXXES_F256PME 24 +#define QNRI_F256PME 0 +#define RIADZ_F256PME 0 +#define RIADZG2A_F256PME 0 +#define RIADZG2B_F256PME 0 +#define TOWER_F256PME NEGATOWER + +//#define BIG_ENDIAN_SIGN_F256PME + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F256PMW.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F256PMW.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F256PMW.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F256PMW.h index 16e7daa..8f0a5f8 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F256PMW.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F256PMW.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_F256PMW_H -#define CONFIG_FIELD_F256PMW_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_F256PMW 256 -#define PM1D2_F256PMW 1 -#define MODTYPE_F256PMW PSEUDO_MERSENNE -#define MAXXES_F256PMW 24 -#define QNRI_F256PMW 0 -#define RIADZ_F256PMW 7 -#define RIADZG2A_F256PMW 0 -#define RIADZG2B_F256PMW 0 -#define TOWER_F256PMW NEGATOWER - -//#define BIG_ENDIAN_SIGN_F256PMW - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_F256PMW_H +#define CONFIG_FIELD_F256PMW_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_F256PMW 256 +#define PM1D2_F256PMW 1 +#define MODTYPE_F256PMW PSEUDO_MERSENNE +#define MAXXES_F256PMW 24 +#define QNRI_F256PMW 0 +#define RIADZ_F256PMW 7 +#define RIADZG2A_F256PMW 0 +#define RIADZG2B_F256PMW 0 +#define TOWER_F256PMW NEGATOWER + +//#define BIG_ENDIAN_SIGN_F256PMW + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F384PM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F384PM.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F384PM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F384PM.h index 014d251..176caf5 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F384PM.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F384PM.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_F384PM_H -#define CONFIG_FIELD_F384PM_H - -#include"core.h" -#include "config_big_B384_58.h" - -// FP stuff - -#define MBITS_F384PM 384 -#define PM1D2_F384PM 1 -#define MODTYPE_F384PM PSEUDO_MERSENNE -#define MAXXES_F384PM 22 -#define QNRI_F384PM 0 -#define RIADZ_F384PM 0 -#define RIADZG2A_F384PM 0 -#define RIADZG2B_F384PM 0 -#define TOWER_F384PM NEGATOWER - -//#define BIG_ENDIAN_SIGN_F384PM - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_F384PM_H +#define CONFIG_FIELD_F384PM_H + +#include"core.h" +#include "config_big_B384_58.h" + +// FP stuff + +#define MBITS_F384PM 384 +#define PM1D2_F384PM 1 +#define MODTYPE_F384PM PSEUDO_MERSENNE +#define MAXXES_F384PM 22 +#define QNRI_F384PM 0 +#define RIADZ_F384PM 0 +#define RIADZG2A_F384PM 0 +#define RIADZG2B_F384PM 0 +#define TOWER_F384PM NEGATOWER + +//#define BIG_ENDIAN_SIGN_F384PM + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F448.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F448.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F448.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F448.h index bd806f0..39b770e 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F448.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F448.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_F448_H -#define CONFIG_FIELD_F448_H - -#include"core.h" -#include "config_big_B448_58.h" - -// FP stuff - -#define MBITS_F448 448 -#define PM1D2_F448 1 -#define MODTYPE_F448 GENERALISED_MERSENNE -#define MAXXES_F448 16 -#define QNRI_F448 0 -#define RIADZ_F448 0 -#define RIADZG2A_F448 0 -#define RIADZG2B_F448 0 -#define TOWER_F448 NEGATOWER - -//#define BIG_ENDIAN_SIGN_F448 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_F448_H +#define CONFIG_FIELD_F448_H + +#include"core.h" +#include "config_big_B448_58.h" + +// FP stuff + +#define MBITS_F448 448 +#define PM1D2_F448 1 +#define MODTYPE_F448 GENERALISED_MERSENNE +#define MAXXES_F448 16 +#define QNRI_F448 0 +#define RIADZ_F448 0 +#define RIADZG2A_F448 0 +#define RIADZG2B_F448 0 +#define TOWER_F448 NEGATOWER + +//#define BIG_ENDIAN_SIGN_F448 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F512PM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F512PM.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F512PM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F512PM.h index b39db70..81dfdc2 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_F512PM.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_F512PM.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_F512PM_H -#define CONFIG_FIELD_F512PM_H - -#include"core.h" -#include "config_big_B512_60.h" - -// FP stuff - -#define MBITS_F512PM 512 -#define PM1D2_F512PM 1 -#define MODTYPE_F512PM PSEUDO_MERSENNE -#define MAXXES_F512PM 28 -#define QNRI_F512PM 0 -#define RIADZ_F512PM 0 -#define RIADZG2A_F512PM 0 -#define RIADZG2B_F512PM 0 -#define TOWER_F512PM NEGATOWER - -//#define BIG_ENDIAN_SIGN_F512PM - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_F512PM_H +#define CONFIG_FIELD_F512PM_H + +#include"core.h" +#include "config_big_B512_60.h" + +// FP stuff + +#define MBITS_F512PM 512 +#define PM1D2_F512PM 1 +#define MODTYPE_F512PM PSEUDO_MERSENNE +#define MAXXES_F512PM 28 +#define QNRI_F512PM 0 +#define RIADZ_F512PM 0 +#define RIADZG2A_F512PM 0 +#define RIADZG2B_F512PM 0 +#define TOWER_F512PM NEGATOWER + +//#define BIG_ENDIAN_SIGN_F512PM + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_FP256BN.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_FP256BN.h index 45a6bb5..ab5d02a 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_FP256BN.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_FP256BN.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_FP256BN_H -#define CONFIG_FIELD_FP256BN_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_FP256BN 256 -#define PM1D2_FP256BN 1 -#define MODTYPE_FP256BN NOT_SPECIAL -#define MAXXES_FP256BN 24 -#define QNRI_FP256BN 0 -#define RIADZ_FP256BN 1 -#define RIADZG2A_FP256BN 1 -#define RIADZG2B_FP256BN 0 -#define TOWER_FP256BN NEGATOWER - -//#define BIG_ENDIAN_SIGN_FP256BN - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_FP256BN_H +#define CONFIG_FIELD_FP256BN_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_FP256BN 256 +#define PM1D2_FP256BN 1 +#define MODTYPE_FP256BN NOT_SPECIAL +#define MAXXES_FP256BN 24 +#define QNRI_FP256BN 0 +#define RIADZ_FP256BN 1 +#define RIADZG2A_FP256BN 1 +#define RIADZG2B_FP256BN 0 +#define TOWER_FP256BN NEGATOWER + +//#define BIG_ENDIAN_SIGN_FP256BN + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_FP512BN.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_FP512BN.h index 33b9c78..18c488f 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_FP512BN.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_FP512BN.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_FP512BN_H -#define CONFIG_FIELD_FP512BN_H - -#include"core.h" -#include "config_big_B512_60.h" - -// FP stuff - -#define MBITS_FP512BN 512 -#define PM1D2_FP512BN 1 -#define MODTYPE_FP512BN NOT_SPECIAL -#define MAXXES_FP512BN 28 -#define QNRI_FP512BN 0 -#define RIADZ_FP512BN 1 -#define RIADZG2A_FP512BN 1 -#define RIADZG2B_FP512BN 0 -#define TOWER_FP512BN NEGATOWER - -//#define BIG_ENDIAN_SIGN_FP512BN - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_FP512BN_H +#define CONFIG_FIELD_FP512BN_H + +#include"core.h" +#include "config_big_B512_60.h" + +// FP stuff + +#define MBITS_FP512BN 512 +#define PM1D2_FP512BN 1 +#define MODTYPE_FP512BN NOT_SPECIAL +#define MAXXES_FP512BN 28 +#define QNRI_FP512BN 0 +#define RIADZ_FP512BN 1 +#define RIADZG2A_FP512BN 1 +#define RIADZG2B_FP512BN 0 +#define TOWER_FP512BN NEGATOWER + +//#define BIG_ENDIAN_SIGN_FP512BN + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_HIFIVE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_HIFIVE.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_HIFIVE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_HIFIVE.h index b5ed2e7..85ddf5a 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_HIFIVE.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_HIFIVE.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_HIFIVE_H -#define CONFIG_FIELD_HIFIVE_H - -#include"core.h" -#include "config_big_B336_60.h" - -// FP stuff - -#define MBITS_HIFIVE 336 -#define PM1D2_HIFIVE 2 -#define MODTYPE_HIFIVE PSEUDO_MERSENNE -#define MAXXES_HIFIVE 24 -#define QNRI_HIFIVE 0 -#define RIADZ_HIFIVE 1 -#define RIADZG2A_HIFIVE 0 -#define RIADZG2B_HIFIVE 0 -#define TOWER_HIFIVE NEGATOWER - -//#define BIG_ENDIAN_SIGN_HIFIVE - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_HIFIVE_H +#define CONFIG_FIELD_HIFIVE_H + +#include"core.h" +#include "config_big_B336_60.h" + +// FP stuff + +#define MBITS_HIFIVE 336 +#define PM1D2_HIFIVE 2 +#define MODTYPE_HIFIVE PSEUDO_MERSENNE +#define MAXXES_HIFIVE 24 +#define QNRI_HIFIVE 0 +#define RIADZ_HIFIVE 1 +#define RIADZG2A_HIFIVE 0 +#define RIADZG2B_HIFIVE 0 +#define TOWER_HIFIVE NEGATOWER + +//#define BIG_ENDIAN_SIGN_HIFIVE + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_JUBJUB.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_JUBJUB.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_JUBJUB.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_JUBJUB.h index e6a1450..215298f 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_JUBJUB.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_JUBJUB.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_JUBJUB_H -#define CONFIG_FIELD_JUBJUB_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_JUBJUB 255 -#define PM1D2_JUBJUB 32 -#define MODTYPE_JUBJUB NOT_SPECIAL -#define MAXXES_JUBJUB 25 -#define QNRI_JUBJUB 5 -#define RIADZ_JUBJUB 1 -#define RIADZG2A_JUBJUB 0 -#define RIADZG2B_JUBJUB 0 -#define TOWER_JUBJUB NEGATOWER - -//#define BIG_ENDIAN_SIGN_JUBJUB - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_JUBJUB_H +#define CONFIG_FIELD_JUBJUB_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_JUBJUB 255 +#define PM1D2_JUBJUB 32 +#define MODTYPE_JUBJUB NOT_SPECIAL +#define MAXXES_JUBJUB 25 +#define QNRI_JUBJUB 5 +#define RIADZ_JUBJUB 1 +#define RIADZG2A_JUBJUB 0 +#define RIADZG2B_JUBJUB 0 +#define TOWER_JUBJUB NEGATOWER + +//#define BIG_ENDIAN_SIGN_JUBJUB + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_MDC.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_MDC.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_MDC.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_MDC.h index 995ae7f..2e4e77d 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_MDC.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_MDC.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_MDC_H -#define CONFIG_FIELD_MDC_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_MDC 256 -#define PM1D2_MDC 1 -#define MODTYPE_MDC NOT_SPECIAL -#define MAXXES_MDC 24 -#define QNRI_MDC 0 -#define RIADZ_MDC 0 -#define RIADZG2A_MDC 0 -#define RIADZG2B_MDC 0 -#define TOWER_MDC NEGATOWER - -//#define BIG_ENDIAN_SIGN_MDC - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_MDC_H +#define CONFIG_FIELD_MDC_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_MDC 256 +#define PM1D2_MDC 1 +#define MODTYPE_MDC NOT_SPECIAL +#define MAXXES_MDC 24 +#define QNRI_MDC 0 +#define RIADZ_MDC 0 +#define RIADZG2A_MDC 0 +#define RIADZG2B_MDC 0 +#define TOWER_MDC NEGATOWER + +//#define BIG_ENDIAN_SIGN_MDC + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_NIST256.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_NIST256.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_NIST256.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_NIST256.h index 0923d5d..dc4676b 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_NIST256.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_NIST256.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_NIST256_H -#define CONFIG_FIELD_NIST256_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_NIST256 256 -#define PM1D2_NIST256 1 -#define MODTYPE_NIST256 NOT_SPECIAL -#define MAXXES_NIST256 24 -#define QNRI_NIST256 0 -#define RIADZ_NIST256 -10 -#define RIADZG2A_NIST256 0 -#define RIADZG2B_NIST256 0 -#define TOWER_NIST256 NEGATOWER - -//#define BIG_ENDIAN_SIGN_NIST256 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_NIST256_H +#define CONFIG_FIELD_NIST256_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_NIST256 256 +#define PM1D2_NIST256 1 +#define MODTYPE_NIST256 NOT_SPECIAL +#define MAXXES_NIST256 24 +#define QNRI_NIST256 0 +#define RIADZ_NIST256 -10 +#define RIADZG2A_NIST256 0 +#define RIADZG2B_NIST256 0 +#define TOWER_NIST256 NEGATOWER + +//#define BIG_ENDIAN_SIGN_NIST256 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_NIST384.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_NIST384.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_NIST384.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_NIST384.h index d3c7219..50dfbb7 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_NIST384.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_NIST384.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_NIST384_H -#define CONFIG_FIELD_NIST384_H - -#include"core.h" -#include "config_big_B384_56.h" - -// FP stuff - -#define MBITS_NIST384 384 -#define PM1D2_NIST384 1 -#define MODTYPE_NIST384 NOT_SPECIAL -#define MAXXES_NIST384 8 -#define QNRI_NIST384 0 -#define RIADZ_NIST384 -12 -#define RIADZG2A_NIST384 0 -#define RIADZG2B_NIST384 0 -#define TOWER_NIST384 NEGATOWER - -//#define BIG_ENDIAN_SIGN_NIST384 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_NIST384_H +#define CONFIG_FIELD_NIST384_H + +#include"core.h" +#include "config_big_B384_56.h" + +// FP stuff + +#define MBITS_NIST384 384 +#define PM1D2_NIST384 1 +#define MODTYPE_NIST384 NOT_SPECIAL +#define MAXXES_NIST384 8 +#define QNRI_NIST384 0 +#define RIADZ_NIST384 -12 +#define RIADZG2A_NIST384 0 +#define RIADZG2B_NIST384 0 +#define TOWER_NIST384 NEGATOWER + +//#define BIG_ENDIAN_SIGN_NIST384 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_NIST521.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_NIST521.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_NIST521.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_NIST521.h index b89d9ac..eab05bc 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_NIST521.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_NIST521.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_NIST521_H -#define CONFIG_FIELD_NIST521_H - -#include"core.h" -#include "config_big_B528_60.h" - -// FP stuff - -#define MBITS_NIST521 521 -#define PM1D2_NIST521 1 -#define MODTYPE_NIST521 PSEUDO_MERSENNE -#define MAXXES_NIST521 19 -#define QNRI_NIST521 0 -#define RIADZ_NIST521 -4 -#define RIADZG2A_NIST521 0 -#define RIADZG2B_NIST521 0 -#define TOWER_NIST521 NEGATOWER - -//#define BIG_ENDIAN_SIGN_NIST521 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_NIST521_H +#define CONFIG_FIELD_NIST521_H + +#include"core.h" +#include "config_big_B528_60.h" + +// FP stuff + +#define MBITS_NIST521 521 +#define PM1D2_NIST521 1 +#define MODTYPE_NIST521 PSEUDO_MERSENNE +#define MAXXES_NIST521 19 +#define QNRI_NIST521 0 +#define RIADZ_NIST521 -4 +#define RIADZG2A_NIST521 0 +#define RIADZG2B_NIST521 0 +#define TOWER_NIST521 NEGATOWER + +//#define BIG_ENDIAN_SIGN_NIST521 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_SECP160R1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_SECP160R1.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_SECP160R1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_SECP160R1.h index e32db36..144a7fc 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_SECP160R1.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_SECP160R1.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_SECP160R1_H -#define CONFIG_FIELD_SECP160R1_H - -#include"core.h" -#include "config_big_B160_56.h" - -// FP stuff - -#define MBITS_SECP160R1 160 -#define PM1D2_SECP160R1 1 -#define MODTYPE_SECP160R1 NOT_SPECIAL -#define MAXXES_SECP160R1 8 -#define QNRI_SECP160R1 0 -#define RIADZ_SECP160R1 3 -#define RIADZG2A_SECP160R1 0 -#define RIADZG2B_SECP160R1 0 -#define TOWER_SECP160R1 NEGATOWER - -//#define BIG_ENDIAN_SIGN_SECP160R1 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_SECP160R1_H +#define CONFIG_FIELD_SECP160R1_H + +#include"core.h" +#include "config_big_B160_56.h" + +// FP stuff + +#define MBITS_SECP160R1 160 +#define PM1D2_SECP160R1 1 +#define MODTYPE_SECP160R1 NOT_SPECIAL +#define MAXXES_SECP160R1 8 +#define QNRI_SECP160R1 0 +#define RIADZ_SECP160R1 3 +#define RIADZG2A_SECP160R1 0 +#define RIADZG2B_SECP160R1 0 +#define TOWER_SECP160R1 NEGATOWER + +//#define BIG_ENDIAN_SIGN_SECP160R1 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_SECP256K1.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_SECP256K1.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_SECP256K1.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_SECP256K1.h index 5efff7a..dfdb516 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_SECP256K1.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_SECP256K1.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_SECP256K1_H -#define CONFIG_FIELD_SECP256K1_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_SECP256K1 256 -#define PM1D2_SECP256K1 1 -#define MODTYPE_SECP256K1 NOT_SPECIAL -#define MAXXES_SECP256K1 24 -#define QNRI_SECP256K1 0 -#define RIADZ_SECP256K1 -11 -#define RIADZG2A_SECP256K1 0 -#define RIADZG2B_SECP256K1 0 -#define TOWER_SECP256K1 NEGATOWER - -//#define BIG_ENDIAN_SIGN_SECP256K1 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_SECP256K1_H +#define CONFIG_FIELD_SECP256K1_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_SECP256K1 256 +#define PM1D2_SECP256K1 1 +#define MODTYPE_SECP256K1 NOT_SPECIAL +#define MAXXES_SECP256K1 24 +#define QNRI_SECP256K1 0 +#define RIADZ_SECP256K1 -11 +#define RIADZG2A_SECP256K1 0 +#define RIADZG2B_SECP256K1 0 +#define TOWER_SECP256K1 NEGATOWER + +//#define BIG_ENDIAN_SIGN_SECP256K1 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_SM2.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_SM2.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_SM2.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_SM2.h index 951875f..ff92883 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_SM2.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_SM2.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_SM2_H -#define CONFIG_FIELD_SM2_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_SM2 256 -#define PM1D2_SM2 1 -#define MODTYPE_SM2 NOT_SPECIAL -#define MAXXES_SM2 24 -#define QNRI_SM2 0 -#define RIADZ_SM2 -9 -#define RIADZG2A_SM2 0 -#define RIADZG2B_SM2 0 -#define TOWER_SM2 NEGATOWER - -//#define BIG_ENDIAN_SIGN_SM2 - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_SM2_H +#define CONFIG_FIELD_SM2_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_SM2 256 +#define PM1D2_SM2 1 +#define MODTYPE_SM2 NOT_SPECIAL +#define MAXXES_SM2 24 +#define QNRI_SM2 0 +#define RIADZ_SM2 -9 +#define RIADZG2A_SM2 0 +#define RIADZG2B_SM2 0 +#define TOWER_SM2 NEGATOWER + +//#define BIG_ENDIAN_SIGN_SM2 + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_TWEEDLEDEE.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_TWEEDLEDEE.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_TWEEDLEDEE.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_TWEEDLEDEE.h index a29cb68..55d7fd8 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_TWEEDLEDEE.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_TWEEDLEDEE.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_TWEEDLEDEE_H -#define CONFIG_FIELD_TWEEDLEDEE_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_TWEEDLEDEE 255 -#define PM1D2_TWEEDLEDEE 34 -#define MODTYPE_TWEEDLEDEE NOT_SPECIAL -#define MAXXES_TWEEDLEDEE 25 -#define QNRI_TWEEDLEDEE 5 -#define RIADZ_TWEEDLEDEE 1 -#define RIADZG2A_TWEEDLEDEE 0 -#define RIADZG2B_TWEEDLEDEE 0 -#define TOWER_TWEEDLEDEE NEGATOWER - -//#define BIG_ENDIAN_SIGN_TWEEDLEDEE - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_TWEEDLEDEE_H +#define CONFIG_FIELD_TWEEDLEDEE_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_TWEEDLEDEE 255 +#define PM1D2_TWEEDLEDEE 34 +#define MODTYPE_TWEEDLEDEE NOT_SPECIAL +#define MAXXES_TWEEDLEDEE 25 +#define QNRI_TWEEDLEDEE 5 +#define RIADZ_TWEEDLEDEE 1 +#define RIADZG2A_TWEEDLEDEE 0 +#define RIADZG2B_TWEEDLEDEE 0 +#define TOWER_TWEEDLEDEE NEGATOWER + +//#define BIG_ENDIAN_SIGN_TWEEDLEDEE + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_TWEEDLEDUM.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_TWEEDLEDUM.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_TWEEDLEDUM.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_TWEEDLEDUM.h index 68a6689..5f47ddc 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config_field_TWEEDLEDUM.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/config_field_TWEEDLEDUM.h @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CONFIG_FIELD_TWEEDLEDUM_H -#define CONFIG_FIELD_TWEEDLEDUM_H - -#include"core.h" -#include "config_big_B256_56.h" - -// FP stuff - -#define MBITS_TWEEDLEDUM 255 -#define PM1D2_TWEEDLEDUM 33 -#define MODTYPE_TWEEDLEDUM NOT_SPECIAL -#define MAXXES_TWEEDLEDUM 25 -#define QNRI_TWEEDLEDUM 5 -#define RIADZ_TWEEDLEDUM 1 -#define RIADZG2A_TWEEDLEDUM 0 -#define RIADZG2B_TWEEDLEDUM 0 -#define TOWER_TWEEDLEDUM NEGATOWER - -//#define BIG_ENDIAN_SIGN_TWEEDLEDUM - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONFIG_FIELD_TWEEDLEDUM_H +#define CONFIG_FIELD_TWEEDLEDUM_H + +#include"core.h" +#include "config_big_B256_56.h" + +// FP stuff + +#define MBITS_TWEEDLEDUM 255 +#define PM1D2_TWEEDLEDUM 33 +#define MODTYPE_TWEEDLEDUM NOT_SPECIAL +#define MAXXES_TWEEDLEDUM 25 +#define QNRI_TWEEDLEDUM 5 +#define RIADZ_TWEEDLEDUM 1 +#define RIADZG2A_TWEEDLEDUM 0 +#define RIADZG2B_TWEEDLEDUM 0 +#define TOWER_TWEEDLEDUM NEGATOWER + +//#define BIG_ENDIAN_SIGN_TWEEDLEDUM + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/core.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/core.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/core.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/core.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/dilithium.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/dilithium.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/dilithium.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/dilithium.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/ecdh.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/ecdh.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/ecdh.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecdh_ANSSI.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/ecdh_ANSSI.h similarity index 97% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecdh_ANSSI.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/ecdh_ANSSI.h index 53c64d9..bcc0a86 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecdh_ANSSI.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/ecdh_ANSSI.h @@ -1,161 +1,161 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file ecdh.h - * @author Mike Scott and Kealan McCusker - * @date 2nd June 2015 - * @brief ECDH Header file for implementation of standard EC protocols - * - * declares functions - * - */ - -#ifndef ECDH_ANSSI_H -#define ECDH_ANSSI_H - -#include "ecp_ANSSI.h" -//#include "ecdh_support.h" - -using namespace core; - - -/*** START OF USER CONFIGURABLE SECTION - ***/ - -/*** START OF USER CONFIGURABLE SECTION - ***/ - - -/*** END OF USER CONFIGURABLE SECTION ***/ - -#define EGS_ANSSI MODBYTES_B256_56 /**< ECC Group Size in bytes */ -#define EFS_ANSSI MODBYTES_B256_56 /**< ECC Field Size in bytes */ - -#define ECDH_OK 0 /**< Function completed without error */ -/*#define ECDH_DOMAIN_ERROR -1*/ -#define ECDH_INVALID_PUBLIC_KEY -2 /**< Public Key is Invalid */ -#define ECDH_ERROR -3 /**< ECDH Internal Error */ -//#define ECDH_INVALID -4 /**< ECDH Internal Error */ -/*#define ECDH_DOMAIN_NOT_FOUND -5 -#define ECDH_OUT_OF_MEMORY -6 -#define ECDH_DIV_BY_ZERO -7 -#define ECDH_BAD_ASSUMPTION -8*/ - - -namespace ANSSI { - -/** @brief Test if group element in correct range - * - @param s is a random number - @return 1 if 0>(P_TBITS_RSA2048))+1) -#define P_FEXCESS_RSA2048 ((chunk)1<<(BASEBITS_B512_60*NLEN_B512_60-P_MBITS_RSA2048-1)) - - -namespace RSA2048 { - -/* Finite Field Prototypes */ -/** @brief Copy one FF element of given length to another - * - @param x FF instance to be copied to, on exit = y - @param y FF instance to be copied from - @param n size of FF in BIGs - - */ -extern void FF_copy(B512_60::BIG *x, B512_60::BIG *y, int n); -/** @brief Initialize an FF element of given length from a 32-bit integer m - * - @param x FF instance to be copied to, on exit = m - @param m integer - @param n size of FF in BIGs - */ -extern void FF_init(B512_60::BIG *x, sign32 m, int n); -/** @brief Set FF element of given size to zero - * - @param x FF instance to be set to zero - @param n size of FF in BIGs - */ -extern void FF_zero(B512_60::BIG *x, int n); -/** @brief Tests for FF element equal to zero - * - @param x FF number to be tested - @param n size of FF in BIGs - @return 1 if zero, else returns 0 - */ -extern int FF_iszilch(B512_60::BIG *x, int n); -/** @brief return parity of an FF, that is the least significant bit - * - @param x FF number - @return 0 or 1 - */ -extern int FF_parity(B512_60::BIG *x); -/** @brief return least significant m bits of an FF - * - @param x FF number - @param m number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int FF_lastbits(B512_60::BIG *x, int m); -/** @brief Set FF element of given size to unity - * - @param x FF instance to be set to unity - @param n size of FF in BIGs - */ -extern void FF_one(B512_60::BIG *x, int n); -/** @brief Compares two FF numbers. Inputs must be normalised externally - * - @param x first FF number to be compared - @param y second FF number to be compared - @param n size of FF in BIGs - @return -1 is xy - */ -extern int FF_comp(B512_60::BIG *x, B512_60::BIG *y, int n); -/** @brief addition of two FFs - * - @param x FF instance, on exit = y+z - @param y FF instance - @param z FF instance - @param n size of FF in BIGs - */ -extern void FF_add(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); -/** @brief subtraction of two FFs - * - @param x FF instance, on exit = y-z - @param y FF instance - @param z FF instance - @param n size of FF in BIGs - */ -extern void FF_sub(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); -/** @brief increment an FF by an integer,and normalise - * - @param x FF instance, on exit = x+m - @param m an integer to be added to x - @param n size of FF in BIGs - */ -extern void FF_inc(B512_60::BIG *x, int m, int n); -/** @brief Decrement an FF by an integer,and normalise - * - @param x FF instance, on exit = x-m - @param m an integer to be subtracted from x - @param n size of FF in BIGs - */ -extern void FF_dec(B512_60::BIG *x, int m, int n); -/** @brief Normalises the components of an FF - * - @param x FF instance to be normalised - @param n size of FF in BIGs - */ -extern void FF_norm(B512_60::BIG *x, int n); -/** @brief Shift left an FF by 1 bit - * - @param x FF instance to be shifted left - @param n size of FF in BIGs - */ -extern void FF_shl(B512_60::BIG *x, int n); -/** @brief Shift right an FF by 1 bit - * - @param x FF instance to be shifted right - @param n size of FF in BIGs - */ -extern void FF_shr(B512_60::BIG *x, int n); -/** @brief Formats and outputs an FF to the console - * - @param x FF instance to be printed - @param n size of FF in BIGs - */ -extern void FF_output(B512_60::BIG *x, int n); -/** @brief Formats and outputs an FF to the console, in raw form - * - @param x FF instance to be printed - @param n size of FF in BIGs - */ -extern void FF_rawoutput(B512_60::BIG *x, int n); -/** @brief Formats and outputs an FF instance to an octet string - * - Converts an FF to big-endian base 256 form. - @param S output octet string - @param x FF instance to be converted to an octet string - @param n size of FF in BIGs - */ -extern void FF_toOctet(octet *S, B512_60::BIG *x, int n); -/** @brief Populates an FF instance from an octet string - * - Creates FF from big-endian base 256 form. - @param x FF instance to be created from an octet string - @param S input octet string - @param n size of FF in BIGs - */ -extern void FF_fromOctet(B512_60::BIG *x, octet *S, int n); -/** @brief Multiplication of two FFs - * - Uses Karatsuba method internally - @param x FF instance, on exit = y*z - @param y FF instance - @param z FF instance - @param n size of FF in BIGs - */ -extern void FF_mul(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); -/** @brief Reduce FF mod a modulus - * - This is slow - @param x FF instance to be reduced mod m - on exit = x mod m - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_mod(B512_60::BIG *x, B512_60::BIG *m, int n); -/** @brief Square an FF - * - Uses Karatsuba method internally - @param x FF instance, on exit = y^2 - @param y FF instance to be squared - @param n size of FF in BIGs - */ -extern void FF_sqr(B512_60::BIG *x, B512_60::BIG *y, int n); -/** @brief Reduces a double-length FF with respect to a given modulus - * - This is slow - @param x FF instance, on exit = y mod z - @param y FF instance, of double length 2*n - @param z FF modulus - @param n size of FF in BIGs - */ -extern void FF_dmod(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); -/** @brief Invert an FF mod a prime modulus - * - @param x FF instance, on exit = 1/y mod z - @param y FF instance - @param z FF prime modulus - @param n size of FF in BIGs - */ -extern void FF_invmodp(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); -/** @brief Create an FF from a random number generator - * - @param x FF instance, on exit x is a random number of length n BIGs with most significant bit a 1 - @param R an instance of a Cryptographically Secure Random Number Generator - @param n size of FF in BIGs - */ -extern void FF_random(B512_60::BIG *x, csprng *R, int n); -/** @brief Create a random FF less than a given modulus from a random number generator - * - @param x FF instance, on exit x is a random number < y - @param y FF instance, the modulus - @param R an instance of a Cryptographically Secure Random Number Generator - @param n size of FF in BIGs - */ -extern void FF_randomnum(B512_60::BIG *x, B512_60::BIG *y, csprng *R, int n); -/** @brief Calculate r=x^e mod m, side channel resistant - * - @param r FF instance, on exit = x^e mod p - @param x FF instance - @param e FF exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_skpow(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG * e, B512_60::BIG *m, int n); -/** @brief Calculate r=x^e mod m, side channel resistant - * - For short BIG exponent - @param r FF instance, on exit = x^e mod p - @param x FF instance - @param e BIG exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_skspow(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG e, B512_60::BIG *m, int n); -/** @brief Calculate r=x^e mod m - * - For very short integer exponent - @param r FF instance, on exit = x^e mod p - @param x FF instance - @param e integer exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_power(B512_60::BIG *r, B512_60::BIG *x, int e, B512_60::BIG *m, int n); -/** @brief Calculate r=x^e mod m - * - @param r FF instance, on exit = x^e mod p - @param x FF instance - @param e FF exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_pow(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG *e, B512_60::BIG *m, int n); -/** @brief Test if an FF has factor in common with integer s - * - @param x FF instance to be tested - @param s the supplied integer - @param n size of FF in BIGs - @return 1 if gcd(x,s)!=1, else return 0 - */ -extern int FF_cfactor(B512_60::BIG *x, sign32 s, int n); -/** @brief Test if an FF is prime - * - Uses Miller-Rabin Method - @param x FF instance to be tested - @param R an instance of a Cryptographically Secure Random Number Generator - @param n size of FF in BIGs - @return 1 if x is (almost certainly) prime, else return 0 - */ -extern int FF_prime(B512_60::BIG *x, csprng *R, int n); -/** @brief Calculate r=x^e.y^f mod m - * - @param r FF instance, on exit = x^e.y^f mod p - @param x FF instance - @param e BIG exponent - @param y FF instance - @param f BIG exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_pow2(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG e, B512_60::BIG *y, B512_60::BIG f, B512_60::BIG *m, int n); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FF_RSA2048_H +#define FF_RSA2048_H + +#include "big_B512_60.h" +#include "config_ff_RSA2048.h" + +using namespace core; + +#define HFLEN_RSA2048 (FFLEN_RSA2048/2) /**< Useful for half-size RSA private key operations */ +#define P_MBITS_RSA2048 (MODBYTES_B512_60*8) +#define P_TBITS_RSA2048 (P_MBITS_RSA2048%BASEBITS_B512_60) +#define P_EXCESS_RSA2048(a) (((a[NLEN_B512_60-1])>>(P_TBITS_RSA2048))+1) +#define P_FEXCESS_RSA2048 ((chunk)1<<(BASEBITS_B512_60*NLEN_B512_60-P_MBITS_RSA2048-1)) + + +namespace RSA2048 { + +/* Finite Field Prototypes */ +/** @brief Copy one FF element of given length to another + * + @param x FF instance to be copied to, on exit = y + @param y FF instance to be copied from + @param n size of FF in BIGs + + */ +extern void FF_copy(B512_60::BIG *x, B512_60::BIG *y, int n); +/** @brief Initialize an FF element of given length from a 32-bit integer m + * + @param x FF instance to be copied to, on exit = m + @param m integer + @param n size of FF in BIGs + */ +extern void FF_init(B512_60::BIG *x, sign32 m, int n); +/** @brief Set FF element of given size to zero + * + @param x FF instance to be set to zero + @param n size of FF in BIGs + */ +extern void FF_zero(B512_60::BIG *x, int n); +/** @brief Tests for FF element equal to zero + * + @param x FF number to be tested + @param n size of FF in BIGs + @return 1 if zero, else returns 0 + */ +extern int FF_iszilch(B512_60::BIG *x, int n); +/** @brief return parity of an FF, that is the least significant bit + * + @param x FF number + @return 0 or 1 + */ +extern int FF_parity(B512_60::BIG *x); +/** @brief return least significant m bits of an FF + * + @param x FF number + @param m number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int FF_lastbits(B512_60::BIG *x, int m); +/** @brief Set FF element of given size to unity + * + @param x FF instance to be set to unity + @param n size of FF in BIGs + */ +extern void FF_one(B512_60::BIG *x, int n); +/** @brief Compares two FF numbers. Inputs must be normalised externally + * + @param x first FF number to be compared + @param y second FF number to be compared + @param n size of FF in BIGs + @return -1 is xy + */ +extern int FF_comp(B512_60::BIG *x, B512_60::BIG *y, int n); +/** @brief addition of two FFs + * + @param x FF instance, on exit = y+z + @param y FF instance + @param z FF instance + @param n size of FF in BIGs + */ +extern void FF_add(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); +/** @brief subtraction of two FFs + * + @param x FF instance, on exit = y-z + @param y FF instance + @param z FF instance + @param n size of FF in BIGs + */ +extern void FF_sub(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); +/** @brief increment an FF by an integer,and normalise + * + @param x FF instance, on exit = x+m + @param m an integer to be added to x + @param n size of FF in BIGs + */ +extern void FF_inc(B512_60::BIG *x, int m, int n); +/** @brief Decrement an FF by an integer,and normalise + * + @param x FF instance, on exit = x-m + @param m an integer to be subtracted from x + @param n size of FF in BIGs + */ +extern void FF_dec(B512_60::BIG *x, int m, int n); +/** @brief Normalises the components of an FF + * + @param x FF instance to be normalised + @param n size of FF in BIGs + */ +extern void FF_norm(B512_60::BIG *x, int n); +/** @brief Shift left an FF by 1 bit + * + @param x FF instance to be shifted left + @param n size of FF in BIGs + */ +extern void FF_shl(B512_60::BIG *x, int n); +/** @brief Shift right an FF by 1 bit + * + @param x FF instance to be shifted right + @param n size of FF in BIGs + */ +extern void FF_shr(B512_60::BIG *x, int n); +/** @brief Formats and outputs an FF to the console + * + @param x FF instance to be printed + @param n size of FF in BIGs + */ +extern void FF_output(B512_60::BIG *x, int n); +/** @brief Formats and outputs an FF to the console, in raw form + * + @param x FF instance to be printed + @param n size of FF in BIGs + */ +extern void FF_rawoutput(B512_60::BIG *x, int n); +/** @brief Formats and outputs an FF instance to an octet string + * + Converts an FF to big-endian base 256 form. + @param S output octet string + @param x FF instance to be converted to an octet string + @param n size of FF in BIGs + */ +extern void FF_toOctet(octet *S, B512_60::BIG *x, int n); +/** @brief Populates an FF instance from an octet string + * + Creates FF from big-endian base 256 form. + @param x FF instance to be created from an octet string + @param S input octet string + @param n size of FF in BIGs + */ +extern void FF_fromOctet(B512_60::BIG *x, octet *S, int n); +/** @brief Multiplication of two FFs + * + Uses Karatsuba method internally + @param x FF instance, on exit = y*z + @param y FF instance + @param z FF instance + @param n size of FF in BIGs + */ +extern void FF_mul(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); +/** @brief Reduce FF mod a modulus + * + This is slow + @param x FF instance to be reduced mod m - on exit = x mod m + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_mod(B512_60::BIG *x, B512_60::BIG *m, int n); +/** @brief Square an FF + * + Uses Karatsuba method internally + @param x FF instance, on exit = y^2 + @param y FF instance to be squared + @param n size of FF in BIGs + */ +extern void FF_sqr(B512_60::BIG *x, B512_60::BIG *y, int n); +/** @brief Reduces a double-length FF with respect to a given modulus + * + This is slow + @param x FF instance, on exit = y mod z + @param y FF instance, of double length 2*n + @param z FF modulus + @param n size of FF in BIGs + */ +extern void FF_dmod(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); +/** @brief Invert an FF mod a prime modulus + * + @param x FF instance, on exit = 1/y mod z + @param y FF instance + @param z FF prime modulus + @param n size of FF in BIGs + */ +extern void FF_invmodp(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); +/** @brief Create an FF from a random number generator + * + @param x FF instance, on exit x is a random number of length n BIGs with most significant bit a 1 + @param R an instance of a Cryptographically Secure Random Number Generator + @param n size of FF in BIGs + */ +extern void FF_random(B512_60::BIG *x, csprng *R, int n); +/** @brief Create a random FF less than a given modulus from a random number generator + * + @param x FF instance, on exit x is a random number < y + @param y FF instance, the modulus + @param R an instance of a Cryptographically Secure Random Number Generator + @param n size of FF in BIGs + */ +extern void FF_randomnum(B512_60::BIG *x, B512_60::BIG *y, csprng *R, int n); +/** @brief Calculate r=x^e mod m, side channel resistant + * + @param r FF instance, on exit = x^e mod p + @param x FF instance + @param e FF exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_skpow(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG * e, B512_60::BIG *m, int n); +/** @brief Calculate r=x^e mod m, side channel resistant + * + For short BIG exponent + @param r FF instance, on exit = x^e mod p + @param x FF instance + @param e BIG exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_skspow(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG e, B512_60::BIG *m, int n); +/** @brief Calculate r=x^e mod m + * + For very short integer exponent + @param r FF instance, on exit = x^e mod p + @param x FF instance + @param e integer exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_power(B512_60::BIG *r, B512_60::BIG *x, int e, B512_60::BIG *m, int n); +/** @brief Calculate r=x^e mod m + * + @param r FF instance, on exit = x^e mod p + @param x FF instance + @param e FF exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_pow(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG *e, B512_60::BIG *m, int n); +/** @brief Test if an FF has factor in common with integer s + * + @param x FF instance to be tested + @param s the supplied integer + @param n size of FF in BIGs + @return 1 if gcd(x,s)!=1, else return 0 + */ +extern int FF_cfactor(B512_60::BIG *x, sign32 s, int n); +/** @brief Test if an FF is prime + * + Uses Miller-Rabin Method + @param x FF instance to be tested + @param R an instance of a Cryptographically Secure Random Number Generator + @param n size of FF in BIGs + @return 1 if x is (almost certainly) prime, else return 0 + */ +extern int FF_prime(B512_60::BIG *x, csprng *R, int n); +/** @brief Calculate r=x^e.y^f mod m + * + @param r FF instance, on exit = x^e.y^f mod p + @param x FF instance + @param e BIG exponent + @param y FF instance + @param f BIG exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_pow2(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG e, B512_60::BIG *y, B512_60::BIG f, B512_60::BIG *m, int n); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ff_RSA3072.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/ff_RSA3072.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ff_RSA3072.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/ff_RSA3072.h index 82554cf..d806bc6 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ff_RSA3072.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/ff_RSA3072.h @@ -1,295 +1,295 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FF_RSA3072_H -#define FF_RSA3072_H - -#include "big_B384_56.h" -#include "config_ff_RSA3072.h" - -using namespace core; - -#define HFLEN_RSA3072 (FFLEN_RSA3072/2) /**< Useful for half-size RSA private key operations */ -#define P_MBITS_RSA3072 (MODBYTES_B384_56*8) -#define P_TBITS_RSA3072 (P_MBITS_RSA3072%BASEBITS_B384_56) -#define P_EXCESS_RSA3072(a) (((a[NLEN_B384_56-1])>>(P_TBITS_RSA3072))+1) -#define P_FEXCESS_RSA3072 ((chunk)1<<(BASEBITS_B384_56*NLEN_B384_56-P_MBITS_RSA3072-1)) - - -namespace RSA3072 { - -/* Finite Field Prototypes */ -/** @brief Copy one FF element of given length to another - * - @param x FF instance to be copied to, on exit = y - @param y FF instance to be copied from - @param n size of FF in BIGs - - */ -extern void FF_copy(B384_56::BIG *x, B384_56::BIG *y, int n); -/** @brief Initialize an FF element of given length from a 32-bit integer m - * - @param x FF instance to be copied to, on exit = m - @param m integer - @param n size of FF in BIGs - */ -extern void FF_init(B384_56::BIG *x, sign32 m, int n); -/** @brief Set FF element of given size to zero - * - @param x FF instance to be set to zero - @param n size of FF in BIGs - */ -extern void FF_zero(B384_56::BIG *x, int n); -/** @brief Tests for FF element equal to zero - * - @param x FF number to be tested - @param n size of FF in BIGs - @return 1 if zero, else returns 0 - */ -extern int FF_iszilch(B384_56::BIG *x, int n); -/** @brief return parity of an FF, that is the least significant bit - * - @param x FF number - @return 0 or 1 - */ -extern int FF_parity(B384_56::BIG *x); -/** @brief return least significant m bits of an FF - * - @param x FF number - @param m number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int FF_lastbits(B384_56::BIG *x, int m); -/** @brief Set FF element of given size to unity - * - @param x FF instance to be set to unity - @param n size of FF in BIGs - */ -extern void FF_one(B384_56::BIG *x, int n); -/** @brief Compares two FF numbers. Inputs must be normalised externally - * - @param x first FF number to be compared - @param y second FF number to be compared - @param n size of FF in BIGs - @return -1 is xy - */ -extern int FF_comp(B384_56::BIG *x, B384_56::BIG *y, int n); -/** @brief addition of two FFs - * - @param x FF instance, on exit = y+z - @param y FF instance - @param z FF instance - @param n size of FF in BIGs - */ -extern void FF_add(B384_56::BIG *x, B384_56::BIG *y, B384_56::BIG *z, int n); -/** @brief subtraction of two FFs - * - @param x FF instance, on exit = y-z - @param y FF instance - @param z FF instance - @param n size of FF in BIGs - */ -extern void FF_sub(B384_56::BIG *x, B384_56::BIG *y, B384_56::BIG *z, int n); -/** @brief increment an FF by an integer,and normalise - * - @param x FF instance, on exit = x+m - @param m an integer to be added to x - @param n size of FF in BIGs - */ -extern void FF_inc(B384_56::BIG *x, int m, int n); -/** @brief Decrement an FF by an integer,and normalise - * - @param x FF instance, on exit = x-m - @param m an integer to be subtracted from x - @param n size of FF in BIGs - */ -extern void FF_dec(B384_56::BIG *x, int m, int n); -/** @brief Normalises the components of an FF - * - @param x FF instance to be normalised - @param n size of FF in BIGs - */ -extern void FF_norm(B384_56::BIG *x, int n); -/** @brief Shift left an FF by 1 bit - * - @param x FF instance to be shifted left - @param n size of FF in BIGs - */ -extern void FF_shl(B384_56::BIG *x, int n); -/** @brief Shift right an FF by 1 bit - * - @param x FF instance to be shifted right - @param n size of FF in BIGs - */ -extern void FF_shr(B384_56::BIG *x, int n); -/** @brief Formats and outputs an FF to the console - * - @param x FF instance to be printed - @param n size of FF in BIGs - */ -extern void FF_output(B384_56::BIG *x, int n); -/** @brief Formats and outputs an FF to the console, in raw form - * - @param x FF instance to be printed - @param n size of FF in BIGs - */ -extern void FF_rawoutput(B384_56::BIG *x, int n); -/** @brief Formats and outputs an FF instance to an octet string - * - Converts an FF to big-endian base 256 form. - @param S output octet string - @param x FF instance to be converted to an octet string - @param n size of FF in BIGs - */ -extern void FF_toOctet(octet *S, B384_56::BIG *x, int n); -/** @brief Populates an FF instance from an octet string - * - Creates FF from big-endian base 256 form. - @param x FF instance to be created from an octet string - @param S input octet string - @param n size of FF in BIGs - */ -extern void FF_fromOctet(B384_56::BIG *x, octet *S, int n); -/** @brief Multiplication of two FFs - * - Uses Karatsuba method internally - @param x FF instance, on exit = y*z - @param y FF instance - @param z FF instance - @param n size of FF in BIGs - */ -extern void FF_mul(B384_56::BIG *x, B384_56::BIG *y, B384_56::BIG *z, int n); -/** @brief Reduce FF mod a modulus - * - This is slow - @param x FF instance to be reduced mod m - on exit = x mod m - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_mod(B384_56::BIG *x, B384_56::BIG *m, int n); -/** @brief Square an FF - * - Uses Karatsuba method internally - @param x FF instance, on exit = y^2 - @param y FF instance to be squared - @param n size of FF in BIGs - */ -extern void FF_sqr(B384_56::BIG *x, B384_56::BIG *y, int n); -/** @brief Reduces a double-length FF with respect to a given modulus - * - This is slow - @param x FF instance, on exit = y mod z - @param y FF instance, of double length 2*n - @param z FF modulus - @param n size of FF in BIGs - */ -extern void FF_dmod(B384_56::BIG *x, B384_56::BIG *y, B384_56::BIG *z, int n); -/** @brief Invert an FF mod a prime modulus - * - @param x FF instance, on exit = 1/y mod z - @param y FF instance - @param z FF prime modulus - @param n size of FF in BIGs - */ -extern void FF_invmodp(B384_56::BIG *x, B384_56::BIG *y, B384_56::BIG *z, int n); -/** @brief Create an FF from a random number generator - * - @param x FF instance, on exit x is a random number of length n BIGs with most significant bit a 1 - @param R an instance of a Cryptographically Secure Random Number Generator - @param n size of FF in BIGs - */ -extern void FF_random(B384_56::BIG *x, csprng *R, int n); -/** @brief Create a random FF less than a given modulus from a random number generator - * - @param x FF instance, on exit x is a random number < y - @param y FF instance, the modulus - @param R an instance of a Cryptographically Secure Random Number Generator - @param n size of FF in BIGs - */ -extern void FF_randomnum(B384_56::BIG *x, B384_56::BIG *y, csprng *R, int n); -/** @brief Calculate r=x^e mod m, side channel resistant - * - @param r FF instance, on exit = x^e mod p - @param x FF instance - @param e FF exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_skpow(B384_56::BIG *r, B384_56::BIG *x, B384_56::BIG * e, B384_56::BIG *m, int n); -/** @brief Calculate r=x^e mod m, side channel resistant - * - For short BIG exponent - @param r FF instance, on exit = x^e mod p - @param x FF instance - @param e BIG exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_skspow(B384_56::BIG *r, B384_56::BIG *x, B384_56::BIG e, B384_56::BIG *m, int n); -/** @brief Calculate r=x^e mod m - * - For very short integer exponent - @param r FF instance, on exit = x^e mod p - @param x FF instance - @param e integer exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_power(B384_56::BIG *r, B384_56::BIG *x, int e, B384_56::BIG *m, int n); -/** @brief Calculate r=x^e mod m - * - @param r FF instance, on exit = x^e mod p - @param x FF instance - @param e FF exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_pow(B384_56::BIG *r, B384_56::BIG *x, B384_56::BIG *e, B384_56::BIG *m, int n); -/** @brief Test if an FF has factor in common with integer s - * - @param x FF instance to be tested - @param s the supplied integer - @param n size of FF in BIGs - @return 1 if gcd(x,s)!=1, else return 0 - */ -extern int FF_cfactor(B384_56::BIG *x, sign32 s, int n); -/** @brief Test if an FF is prime - * - Uses Miller-Rabin Method - @param x FF instance to be tested - @param R an instance of a Cryptographically Secure Random Number Generator - @param n size of FF in BIGs - @return 1 if x is (almost certainly) prime, else return 0 - */ -extern int FF_prime(B384_56::BIG *x, csprng *R, int n); -/** @brief Calculate r=x^e.y^f mod m - * - @param r FF instance, on exit = x^e.y^f mod p - @param x FF instance - @param e BIG exponent - @param y FF instance - @param f BIG exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_pow2(B384_56::BIG *r, B384_56::BIG *x, B384_56::BIG e, B384_56::BIG *y, B384_56::BIG f, B384_56::BIG *m, int n); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FF_RSA3072_H +#define FF_RSA3072_H + +#include "big_B384_56.h" +#include "config_ff_RSA3072.h" + +using namespace core; + +#define HFLEN_RSA3072 (FFLEN_RSA3072/2) /**< Useful for half-size RSA private key operations */ +#define P_MBITS_RSA3072 (MODBYTES_B384_56*8) +#define P_TBITS_RSA3072 (P_MBITS_RSA3072%BASEBITS_B384_56) +#define P_EXCESS_RSA3072(a) (((a[NLEN_B384_56-1])>>(P_TBITS_RSA3072))+1) +#define P_FEXCESS_RSA3072 ((chunk)1<<(BASEBITS_B384_56*NLEN_B384_56-P_MBITS_RSA3072-1)) + + +namespace RSA3072 { + +/* Finite Field Prototypes */ +/** @brief Copy one FF element of given length to another + * + @param x FF instance to be copied to, on exit = y + @param y FF instance to be copied from + @param n size of FF in BIGs + + */ +extern void FF_copy(B384_56::BIG *x, B384_56::BIG *y, int n); +/** @brief Initialize an FF element of given length from a 32-bit integer m + * + @param x FF instance to be copied to, on exit = m + @param m integer + @param n size of FF in BIGs + */ +extern void FF_init(B384_56::BIG *x, sign32 m, int n); +/** @brief Set FF element of given size to zero + * + @param x FF instance to be set to zero + @param n size of FF in BIGs + */ +extern void FF_zero(B384_56::BIG *x, int n); +/** @brief Tests for FF element equal to zero + * + @param x FF number to be tested + @param n size of FF in BIGs + @return 1 if zero, else returns 0 + */ +extern int FF_iszilch(B384_56::BIG *x, int n); +/** @brief return parity of an FF, that is the least significant bit + * + @param x FF number + @return 0 or 1 + */ +extern int FF_parity(B384_56::BIG *x); +/** @brief return least significant m bits of an FF + * + @param x FF number + @param m number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int FF_lastbits(B384_56::BIG *x, int m); +/** @brief Set FF element of given size to unity + * + @param x FF instance to be set to unity + @param n size of FF in BIGs + */ +extern void FF_one(B384_56::BIG *x, int n); +/** @brief Compares two FF numbers. Inputs must be normalised externally + * + @param x first FF number to be compared + @param y second FF number to be compared + @param n size of FF in BIGs + @return -1 is xy + */ +extern int FF_comp(B384_56::BIG *x, B384_56::BIG *y, int n); +/** @brief addition of two FFs + * + @param x FF instance, on exit = y+z + @param y FF instance + @param z FF instance + @param n size of FF in BIGs + */ +extern void FF_add(B384_56::BIG *x, B384_56::BIG *y, B384_56::BIG *z, int n); +/** @brief subtraction of two FFs + * + @param x FF instance, on exit = y-z + @param y FF instance + @param z FF instance + @param n size of FF in BIGs + */ +extern void FF_sub(B384_56::BIG *x, B384_56::BIG *y, B384_56::BIG *z, int n); +/** @brief increment an FF by an integer,and normalise + * + @param x FF instance, on exit = x+m + @param m an integer to be added to x + @param n size of FF in BIGs + */ +extern void FF_inc(B384_56::BIG *x, int m, int n); +/** @brief Decrement an FF by an integer,and normalise + * + @param x FF instance, on exit = x-m + @param m an integer to be subtracted from x + @param n size of FF in BIGs + */ +extern void FF_dec(B384_56::BIG *x, int m, int n); +/** @brief Normalises the components of an FF + * + @param x FF instance to be normalised + @param n size of FF in BIGs + */ +extern void FF_norm(B384_56::BIG *x, int n); +/** @brief Shift left an FF by 1 bit + * + @param x FF instance to be shifted left + @param n size of FF in BIGs + */ +extern void FF_shl(B384_56::BIG *x, int n); +/** @brief Shift right an FF by 1 bit + * + @param x FF instance to be shifted right + @param n size of FF in BIGs + */ +extern void FF_shr(B384_56::BIG *x, int n); +/** @brief Formats and outputs an FF to the console + * + @param x FF instance to be printed + @param n size of FF in BIGs + */ +extern void FF_output(B384_56::BIG *x, int n); +/** @brief Formats and outputs an FF to the console, in raw form + * + @param x FF instance to be printed + @param n size of FF in BIGs + */ +extern void FF_rawoutput(B384_56::BIG *x, int n); +/** @brief Formats and outputs an FF instance to an octet string + * + Converts an FF to big-endian base 256 form. + @param S output octet string + @param x FF instance to be converted to an octet string + @param n size of FF in BIGs + */ +extern void FF_toOctet(octet *S, B384_56::BIG *x, int n); +/** @brief Populates an FF instance from an octet string + * + Creates FF from big-endian base 256 form. + @param x FF instance to be created from an octet string + @param S input octet string + @param n size of FF in BIGs + */ +extern void FF_fromOctet(B384_56::BIG *x, octet *S, int n); +/** @brief Multiplication of two FFs + * + Uses Karatsuba method internally + @param x FF instance, on exit = y*z + @param y FF instance + @param z FF instance + @param n size of FF in BIGs + */ +extern void FF_mul(B384_56::BIG *x, B384_56::BIG *y, B384_56::BIG *z, int n); +/** @brief Reduce FF mod a modulus + * + This is slow + @param x FF instance to be reduced mod m - on exit = x mod m + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_mod(B384_56::BIG *x, B384_56::BIG *m, int n); +/** @brief Square an FF + * + Uses Karatsuba method internally + @param x FF instance, on exit = y^2 + @param y FF instance to be squared + @param n size of FF in BIGs + */ +extern void FF_sqr(B384_56::BIG *x, B384_56::BIG *y, int n); +/** @brief Reduces a double-length FF with respect to a given modulus + * + This is slow + @param x FF instance, on exit = y mod z + @param y FF instance, of double length 2*n + @param z FF modulus + @param n size of FF in BIGs + */ +extern void FF_dmod(B384_56::BIG *x, B384_56::BIG *y, B384_56::BIG *z, int n); +/** @brief Invert an FF mod a prime modulus + * + @param x FF instance, on exit = 1/y mod z + @param y FF instance + @param z FF prime modulus + @param n size of FF in BIGs + */ +extern void FF_invmodp(B384_56::BIG *x, B384_56::BIG *y, B384_56::BIG *z, int n); +/** @brief Create an FF from a random number generator + * + @param x FF instance, on exit x is a random number of length n BIGs with most significant bit a 1 + @param R an instance of a Cryptographically Secure Random Number Generator + @param n size of FF in BIGs + */ +extern void FF_random(B384_56::BIG *x, csprng *R, int n); +/** @brief Create a random FF less than a given modulus from a random number generator + * + @param x FF instance, on exit x is a random number < y + @param y FF instance, the modulus + @param R an instance of a Cryptographically Secure Random Number Generator + @param n size of FF in BIGs + */ +extern void FF_randomnum(B384_56::BIG *x, B384_56::BIG *y, csprng *R, int n); +/** @brief Calculate r=x^e mod m, side channel resistant + * + @param r FF instance, on exit = x^e mod p + @param x FF instance + @param e FF exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_skpow(B384_56::BIG *r, B384_56::BIG *x, B384_56::BIG * e, B384_56::BIG *m, int n); +/** @brief Calculate r=x^e mod m, side channel resistant + * + For short BIG exponent + @param r FF instance, on exit = x^e mod p + @param x FF instance + @param e BIG exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_skspow(B384_56::BIG *r, B384_56::BIG *x, B384_56::BIG e, B384_56::BIG *m, int n); +/** @brief Calculate r=x^e mod m + * + For very short integer exponent + @param r FF instance, on exit = x^e mod p + @param x FF instance + @param e integer exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_power(B384_56::BIG *r, B384_56::BIG *x, int e, B384_56::BIG *m, int n); +/** @brief Calculate r=x^e mod m + * + @param r FF instance, on exit = x^e mod p + @param x FF instance + @param e FF exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_pow(B384_56::BIG *r, B384_56::BIG *x, B384_56::BIG *e, B384_56::BIG *m, int n); +/** @brief Test if an FF has factor in common with integer s + * + @param x FF instance to be tested + @param s the supplied integer + @param n size of FF in BIGs + @return 1 if gcd(x,s)!=1, else return 0 + */ +extern int FF_cfactor(B384_56::BIG *x, sign32 s, int n); +/** @brief Test if an FF is prime + * + Uses Miller-Rabin Method + @param x FF instance to be tested + @param R an instance of a Cryptographically Secure Random Number Generator + @param n size of FF in BIGs + @return 1 if x is (almost certainly) prime, else return 0 + */ +extern int FF_prime(B384_56::BIG *x, csprng *R, int n); +/** @brief Calculate r=x^e.y^f mod m + * + @param r FF instance, on exit = x^e.y^f mod p + @param x FF instance + @param e BIG exponent + @param y FF instance + @param f BIG exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_pow2(B384_56::BIG *r, B384_56::BIG *x, B384_56::BIG e, B384_56::BIG *y, B384_56::BIG f, B384_56::BIG *m, int n); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ff_RSA4096.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/ff_RSA4096.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ff_RSA4096.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/ff_RSA4096.h index 91b37ae..4c49058 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ff_RSA4096.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/ff_RSA4096.h @@ -1,295 +1,295 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FF_RSA4096_H -#define FF_RSA4096_H - -#include "big_B512_60.h" -#include "config_ff_RSA4096.h" - -using namespace core; - -#define HFLEN_RSA4096 (FFLEN_RSA4096/2) /**< Useful for half-size RSA private key operations */ -#define P_MBITS_RSA4096 (MODBYTES_B512_60*8) -#define P_TBITS_RSA4096 (P_MBITS_RSA4096%BASEBITS_B512_60) -#define P_EXCESS_RSA4096(a) (((a[NLEN_B512_60-1])>>(P_TBITS_RSA4096))+1) -#define P_FEXCESS_RSA4096 ((chunk)1<<(BASEBITS_B512_60*NLEN_B512_60-P_MBITS_RSA4096-1)) - - -namespace RSA4096 { - -/* Finite Field Prototypes */ -/** @brief Copy one FF element of given length to another - * - @param x FF instance to be copied to, on exit = y - @param y FF instance to be copied from - @param n size of FF in BIGs - - */ -extern void FF_copy(B512_60::BIG *x, B512_60::BIG *y, int n); -/** @brief Initialize an FF element of given length from a 32-bit integer m - * - @param x FF instance to be copied to, on exit = m - @param m integer - @param n size of FF in BIGs - */ -extern void FF_init(B512_60::BIG *x, sign32 m, int n); -/** @brief Set FF element of given size to zero - * - @param x FF instance to be set to zero - @param n size of FF in BIGs - */ -extern void FF_zero(B512_60::BIG *x, int n); -/** @brief Tests for FF element equal to zero - * - @param x FF number to be tested - @param n size of FF in BIGs - @return 1 if zero, else returns 0 - */ -extern int FF_iszilch(B512_60::BIG *x, int n); -/** @brief return parity of an FF, that is the least significant bit - * - @param x FF number - @return 0 or 1 - */ -extern int FF_parity(B512_60::BIG *x); -/** @brief return least significant m bits of an FF - * - @param x FF number - @param m number of bits to return. Assumed to be less than BASEBITS. - @return least significant n bits as an integer - */ -extern int FF_lastbits(B512_60::BIG *x, int m); -/** @brief Set FF element of given size to unity - * - @param x FF instance to be set to unity - @param n size of FF in BIGs - */ -extern void FF_one(B512_60::BIG *x, int n); -/** @brief Compares two FF numbers. Inputs must be normalised externally - * - @param x first FF number to be compared - @param y second FF number to be compared - @param n size of FF in BIGs - @return -1 is xy - */ -extern int FF_comp(B512_60::BIG *x, B512_60::BIG *y, int n); -/** @brief addition of two FFs - * - @param x FF instance, on exit = y+z - @param y FF instance - @param z FF instance - @param n size of FF in BIGs - */ -extern void FF_add(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); -/** @brief subtraction of two FFs - * - @param x FF instance, on exit = y-z - @param y FF instance - @param z FF instance - @param n size of FF in BIGs - */ -extern void FF_sub(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); -/** @brief increment an FF by an integer,and normalise - * - @param x FF instance, on exit = x+m - @param m an integer to be added to x - @param n size of FF in BIGs - */ -extern void FF_inc(B512_60::BIG *x, int m, int n); -/** @brief Decrement an FF by an integer,and normalise - * - @param x FF instance, on exit = x-m - @param m an integer to be subtracted from x - @param n size of FF in BIGs - */ -extern void FF_dec(B512_60::BIG *x, int m, int n); -/** @brief Normalises the components of an FF - * - @param x FF instance to be normalised - @param n size of FF in BIGs - */ -extern void FF_norm(B512_60::BIG *x, int n); -/** @brief Shift left an FF by 1 bit - * - @param x FF instance to be shifted left - @param n size of FF in BIGs - */ -extern void FF_shl(B512_60::BIG *x, int n); -/** @brief Shift right an FF by 1 bit - * - @param x FF instance to be shifted right - @param n size of FF in BIGs - */ -extern void FF_shr(B512_60::BIG *x, int n); -/** @brief Formats and outputs an FF to the console - * - @param x FF instance to be printed - @param n size of FF in BIGs - */ -extern void FF_output(B512_60::BIG *x, int n); -/** @brief Formats and outputs an FF to the console, in raw form - * - @param x FF instance to be printed - @param n size of FF in BIGs - */ -extern void FF_rawoutput(B512_60::BIG *x, int n); -/** @brief Formats and outputs an FF instance to an octet string - * - Converts an FF to big-endian base 256 form. - @param S output octet string - @param x FF instance to be converted to an octet string - @param n size of FF in BIGs - */ -extern void FF_toOctet(octet *S, B512_60::BIG *x, int n); -/** @brief Populates an FF instance from an octet string - * - Creates FF from big-endian base 256 form. - @param x FF instance to be created from an octet string - @param S input octet string - @param n size of FF in BIGs - */ -extern void FF_fromOctet(B512_60::BIG *x, octet *S, int n); -/** @brief Multiplication of two FFs - * - Uses Karatsuba method internally - @param x FF instance, on exit = y*z - @param y FF instance - @param z FF instance - @param n size of FF in BIGs - */ -extern void FF_mul(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); -/** @brief Reduce FF mod a modulus - * - This is slow - @param x FF instance to be reduced mod m - on exit = x mod m - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_mod(B512_60::BIG *x, B512_60::BIG *m, int n); -/** @brief Square an FF - * - Uses Karatsuba method internally - @param x FF instance, on exit = y^2 - @param y FF instance to be squared - @param n size of FF in BIGs - */ -extern void FF_sqr(B512_60::BIG *x, B512_60::BIG *y, int n); -/** @brief Reduces a double-length FF with respect to a given modulus - * - This is slow - @param x FF instance, on exit = y mod z - @param y FF instance, of double length 2*n - @param z FF modulus - @param n size of FF in BIGs - */ -extern void FF_dmod(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); -/** @brief Invert an FF mod a prime modulus - * - @param x FF instance, on exit = 1/y mod z - @param y FF instance - @param z FF prime modulus - @param n size of FF in BIGs - */ -extern void FF_invmodp(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); -/** @brief Create an FF from a random number generator - * - @param x FF instance, on exit x is a random number of length n BIGs with most significant bit a 1 - @param R an instance of a Cryptographically Secure Random Number Generator - @param n size of FF in BIGs - */ -extern void FF_random(B512_60::BIG *x, csprng *R, int n); -/** @brief Create a random FF less than a given modulus from a random number generator - * - @param x FF instance, on exit x is a random number < y - @param y FF instance, the modulus - @param R an instance of a Cryptographically Secure Random Number Generator - @param n size of FF in BIGs - */ -extern void FF_randomnum(B512_60::BIG *x, B512_60::BIG *y, csprng *R, int n); -/** @brief Calculate r=x^e mod m, side channel resistant - * - @param r FF instance, on exit = x^e mod p - @param x FF instance - @param e FF exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_skpow(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG * e, B512_60::BIG *m, int n); -/** @brief Calculate r=x^e mod m, side channel resistant - * - For short BIG exponent - @param r FF instance, on exit = x^e mod p - @param x FF instance - @param e BIG exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_skspow(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG e, B512_60::BIG *m, int n); -/** @brief Calculate r=x^e mod m - * - For very short integer exponent - @param r FF instance, on exit = x^e mod p - @param x FF instance - @param e integer exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_power(B512_60::BIG *r, B512_60::BIG *x, int e, B512_60::BIG *m, int n); -/** @brief Calculate r=x^e mod m - * - @param r FF instance, on exit = x^e mod p - @param x FF instance - @param e FF exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_pow(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG *e, B512_60::BIG *m, int n); -/** @brief Test if an FF has factor in common with integer s - * - @param x FF instance to be tested - @param s the supplied integer - @param n size of FF in BIGs - @return 1 if gcd(x,s)!=1, else return 0 - */ -extern int FF_cfactor(B512_60::BIG *x, sign32 s, int n); -/** @brief Test if an FF is prime - * - Uses Miller-Rabin Method - @param x FF instance to be tested - @param R an instance of a Cryptographically Secure Random Number Generator - @param n size of FF in BIGs - @return 1 if x is (almost certainly) prime, else return 0 - */ -extern int FF_prime(B512_60::BIG *x, csprng *R, int n); -/** @brief Calculate r=x^e.y^f mod m - * - @param r FF instance, on exit = x^e.y^f mod p - @param x FF instance - @param e BIG exponent - @param y FF instance - @param f BIG exponent - @param m FF modulus - @param n size of FF in BIGs - */ -extern void FF_pow2(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG e, B512_60::BIG *y, B512_60::BIG f, B512_60::BIG *m, int n); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FF_RSA4096_H +#define FF_RSA4096_H + +#include "big_B512_60.h" +#include "config_ff_RSA4096.h" + +using namespace core; + +#define HFLEN_RSA4096 (FFLEN_RSA4096/2) /**< Useful for half-size RSA private key operations */ +#define P_MBITS_RSA4096 (MODBYTES_B512_60*8) +#define P_TBITS_RSA4096 (P_MBITS_RSA4096%BASEBITS_B512_60) +#define P_EXCESS_RSA4096(a) (((a[NLEN_B512_60-1])>>(P_TBITS_RSA4096))+1) +#define P_FEXCESS_RSA4096 ((chunk)1<<(BASEBITS_B512_60*NLEN_B512_60-P_MBITS_RSA4096-1)) + + +namespace RSA4096 { + +/* Finite Field Prototypes */ +/** @brief Copy one FF element of given length to another + * + @param x FF instance to be copied to, on exit = y + @param y FF instance to be copied from + @param n size of FF in BIGs + + */ +extern void FF_copy(B512_60::BIG *x, B512_60::BIG *y, int n); +/** @brief Initialize an FF element of given length from a 32-bit integer m + * + @param x FF instance to be copied to, on exit = m + @param m integer + @param n size of FF in BIGs + */ +extern void FF_init(B512_60::BIG *x, sign32 m, int n); +/** @brief Set FF element of given size to zero + * + @param x FF instance to be set to zero + @param n size of FF in BIGs + */ +extern void FF_zero(B512_60::BIG *x, int n); +/** @brief Tests for FF element equal to zero + * + @param x FF number to be tested + @param n size of FF in BIGs + @return 1 if zero, else returns 0 + */ +extern int FF_iszilch(B512_60::BIG *x, int n); +/** @brief return parity of an FF, that is the least significant bit + * + @param x FF number + @return 0 or 1 + */ +extern int FF_parity(B512_60::BIG *x); +/** @brief return least significant m bits of an FF + * + @param x FF number + @param m number of bits to return. Assumed to be less than BASEBITS. + @return least significant n bits as an integer + */ +extern int FF_lastbits(B512_60::BIG *x, int m); +/** @brief Set FF element of given size to unity + * + @param x FF instance to be set to unity + @param n size of FF in BIGs + */ +extern void FF_one(B512_60::BIG *x, int n); +/** @brief Compares two FF numbers. Inputs must be normalised externally + * + @param x first FF number to be compared + @param y second FF number to be compared + @param n size of FF in BIGs + @return -1 is xy + */ +extern int FF_comp(B512_60::BIG *x, B512_60::BIG *y, int n); +/** @brief addition of two FFs + * + @param x FF instance, on exit = y+z + @param y FF instance + @param z FF instance + @param n size of FF in BIGs + */ +extern void FF_add(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); +/** @brief subtraction of two FFs + * + @param x FF instance, on exit = y-z + @param y FF instance + @param z FF instance + @param n size of FF in BIGs + */ +extern void FF_sub(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); +/** @brief increment an FF by an integer,and normalise + * + @param x FF instance, on exit = x+m + @param m an integer to be added to x + @param n size of FF in BIGs + */ +extern void FF_inc(B512_60::BIG *x, int m, int n); +/** @brief Decrement an FF by an integer,and normalise + * + @param x FF instance, on exit = x-m + @param m an integer to be subtracted from x + @param n size of FF in BIGs + */ +extern void FF_dec(B512_60::BIG *x, int m, int n); +/** @brief Normalises the components of an FF + * + @param x FF instance to be normalised + @param n size of FF in BIGs + */ +extern void FF_norm(B512_60::BIG *x, int n); +/** @brief Shift left an FF by 1 bit + * + @param x FF instance to be shifted left + @param n size of FF in BIGs + */ +extern void FF_shl(B512_60::BIG *x, int n); +/** @brief Shift right an FF by 1 bit + * + @param x FF instance to be shifted right + @param n size of FF in BIGs + */ +extern void FF_shr(B512_60::BIG *x, int n); +/** @brief Formats and outputs an FF to the console + * + @param x FF instance to be printed + @param n size of FF in BIGs + */ +extern void FF_output(B512_60::BIG *x, int n); +/** @brief Formats and outputs an FF to the console, in raw form + * + @param x FF instance to be printed + @param n size of FF in BIGs + */ +extern void FF_rawoutput(B512_60::BIG *x, int n); +/** @brief Formats and outputs an FF instance to an octet string + * + Converts an FF to big-endian base 256 form. + @param S output octet string + @param x FF instance to be converted to an octet string + @param n size of FF in BIGs + */ +extern void FF_toOctet(octet *S, B512_60::BIG *x, int n); +/** @brief Populates an FF instance from an octet string + * + Creates FF from big-endian base 256 form. + @param x FF instance to be created from an octet string + @param S input octet string + @param n size of FF in BIGs + */ +extern void FF_fromOctet(B512_60::BIG *x, octet *S, int n); +/** @brief Multiplication of two FFs + * + Uses Karatsuba method internally + @param x FF instance, on exit = y*z + @param y FF instance + @param z FF instance + @param n size of FF in BIGs + */ +extern void FF_mul(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); +/** @brief Reduce FF mod a modulus + * + This is slow + @param x FF instance to be reduced mod m - on exit = x mod m + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_mod(B512_60::BIG *x, B512_60::BIG *m, int n); +/** @brief Square an FF + * + Uses Karatsuba method internally + @param x FF instance, on exit = y^2 + @param y FF instance to be squared + @param n size of FF in BIGs + */ +extern void FF_sqr(B512_60::BIG *x, B512_60::BIG *y, int n); +/** @brief Reduces a double-length FF with respect to a given modulus + * + This is slow + @param x FF instance, on exit = y mod z + @param y FF instance, of double length 2*n + @param z FF modulus + @param n size of FF in BIGs + */ +extern void FF_dmod(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); +/** @brief Invert an FF mod a prime modulus + * + @param x FF instance, on exit = 1/y mod z + @param y FF instance + @param z FF prime modulus + @param n size of FF in BIGs + */ +extern void FF_invmodp(B512_60::BIG *x, B512_60::BIG *y, B512_60::BIG *z, int n); +/** @brief Create an FF from a random number generator + * + @param x FF instance, on exit x is a random number of length n BIGs with most significant bit a 1 + @param R an instance of a Cryptographically Secure Random Number Generator + @param n size of FF in BIGs + */ +extern void FF_random(B512_60::BIG *x, csprng *R, int n); +/** @brief Create a random FF less than a given modulus from a random number generator + * + @param x FF instance, on exit x is a random number < y + @param y FF instance, the modulus + @param R an instance of a Cryptographically Secure Random Number Generator + @param n size of FF in BIGs + */ +extern void FF_randomnum(B512_60::BIG *x, B512_60::BIG *y, csprng *R, int n); +/** @brief Calculate r=x^e mod m, side channel resistant + * + @param r FF instance, on exit = x^e mod p + @param x FF instance + @param e FF exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_skpow(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG * e, B512_60::BIG *m, int n); +/** @brief Calculate r=x^e mod m, side channel resistant + * + For short BIG exponent + @param r FF instance, on exit = x^e mod p + @param x FF instance + @param e BIG exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_skspow(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG e, B512_60::BIG *m, int n); +/** @brief Calculate r=x^e mod m + * + For very short integer exponent + @param r FF instance, on exit = x^e mod p + @param x FF instance + @param e integer exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_power(B512_60::BIG *r, B512_60::BIG *x, int e, B512_60::BIG *m, int n); +/** @brief Calculate r=x^e mod m + * + @param r FF instance, on exit = x^e mod p + @param x FF instance + @param e FF exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_pow(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG *e, B512_60::BIG *m, int n); +/** @brief Test if an FF has factor in common with integer s + * + @param x FF instance to be tested + @param s the supplied integer + @param n size of FF in BIGs + @return 1 if gcd(x,s)!=1, else return 0 + */ +extern int FF_cfactor(B512_60::BIG *x, sign32 s, int n); +/** @brief Test if an FF is prime + * + Uses Miller-Rabin Method + @param x FF instance to be tested + @param R an instance of a Cryptographically Secure Random Number Generator + @param n size of FF in BIGs + @return 1 if x is (almost certainly) prime, else return 0 + */ +extern int FF_prime(B512_60::BIG *x, csprng *R, int n); +/** @brief Calculate r=x^e.y^f mod m + * + @param r FF instance, on exit = x^e.y^f mod p + @param x FF instance + @param e BIG exponent + @param y FF instance + @param f BIG exponent + @param m FF modulus + @param n size of FF in BIGs + */ +extern void FF_pow2(B512_60::BIG *r, B512_60::BIG *x, B512_60::BIG e, B512_60::BIG *y, B512_60::BIG f, B512_60::BIG *m, int n); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp12.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BLS12381.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BLS12381.h index 9e5135a..36bd83d 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BLS12381.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BLS12381.h @@ -1,230 +1,230 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP12_BLS12381_H -#define FP12_BLS12381_H - -#include "fp4_BLS12381.h" - -using namespace core; - -namespace BLS12381 { -/** - @brief FP12 Structure - towered over three FP4 -*/ - -typedef struct -{ - FP4 a; /**< first part of FP12 */ - FP4 b; /**< second part of FP12 */ - FP4 c; /**< third part of FP12 */ - int type; -} FP12; - -extern const B384_58::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B384_58::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP12 prototypes */ -/** @brief Tests for FP12 equal to zero - * - @param x FP12 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP12_iszilch(FP12 *x); -/** @brief Tests for FP12 equal to unity - * - @param x FP12 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP12_isunity(FP12 *x); -/** @brief Copy FP12 to another FP12 - * - @param x FP12 instance, on exit = y - @param y FP12 instance to be copied - */ -extern void FP12_copy(FP12 *x, FP12 *y); -/** @brief Set FP12 to unity - * - @param x FP12 instance to be set to one - */ -extern void FP12_one(FP12 *x); - -/** @brief Set FP12 to zero - * - @param x FP12 instance to be set to zero - */ -extern void FP12_zero(FP12 *x); - -/** @brief Tests for equality of two FP12s - * - @param x FP12 instance to be compared - @param y FP12 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP12_equals(FP12 *x, FP12 *y); -/** @brief Conjugation of FP12 - * - If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP12 instance, on exit = conj(y) - @param y FP12 instance - */ -extern void FP12_conj(FP12 *x, FP12 *y); -/** @brief Initialise FP12 from single FP4 - * - Sets first FP4 component of an FP12, other components set to zero - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP4 - */ -extern void FP12_from_FP4(FP12 *x, FP4 *a); -/** @brief Initialise FP12 from three FP4s - * - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP12 - @param b FP4 to form second part of FP12 - @param c FP4 to form third part of FP12 - */ -extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); -/** @brief Fast Squaring of an FP12 in "unitary" form - * - @param x FP12 instance, on exit = y^2 - @param y FP4 instance, must be unitary - */ -extern void FP12_usqr(FP12 *x, FP12 *y); -/** @brief Squaring an FP12 - * - @param x FP12 instance, on exit = y^2 - @param y FP12 instance - */ -extern void FP12_sqr(FP12 *x, FP12 *y); -/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_smul(FP12 *x, FP12 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_ssmul(FP12 *x, FP12 *y); - - -/** @brief Full unconditional Multiplication of two FP12s - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, the multiplier - */ -extern void FP12_mul(FP12 *x, FP12 *y); - -/** @brief Inverting an FP12 - * - @param x FP12 instance, on exit = 1/y - @param y FP12 instance - @param t D_TYPE or M_TYPE twist - */ -extern void FP12_inv(FP12 *x, FP12 *y); -/** @brief Raises an FP12 to the power of a BIG - * - @param r FP12 instance, on exit = y^b - @param x FP12 instance - @param b BIG number - */ -extern void FP12_pow(FP12 *r, FP12 *x, B384_58::BIG b); -/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant - * - @param x FP12 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP12_pinpow(FP12 *x, int i, int b); - -/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 - * - @param c FP4 instance, on exit = x^(e mod r) as FP4 - @param x FP12 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP12_compow(FP4 *c, FP12 *x, B384_58::BIG e, B384_58::BIG r); - -/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant - * - @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] - @param x FP12 array with 4 FP12s - @param b BIG array of 4 exponents - */ -extern void FP12_pow4(FP12 *r, FP12 *x, B384_58::BIG *b); -/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius - * - @param x FP12 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP12_frob(FP12 *x, FP2 *f); -/** @brief Reduces all components of possibly unreduced FP12 mod Modulus - * - @param x FP12 instance, on exit reduced mod Modulus - */ -extern void FP12_reduce(FP12 *x); -/** @brief Normalises the components of an FP12 - * - @param x FP12 instance to be normalised - */ -extern void FP12_norm(FP12 *x); -/** @brief Formats and outputs an FP12 to the console - * - @param x FP12 instance to be printed - */ -extern void FP12_output(FP12 *x); -/** @brief Formats and outputs an FP12 instance to an octet string - * - Serializes the components of an FP12 to big-endian base 256 form. - @param S output octet string - @param x FP12 instance to be converted to an octet string - */ -extern void FP12_toOctet(octet *S, FP12 *x); -/** @brief Creates an FP12 instance from an octet string - * - De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. - @param x FP12 instance to be created from an octet string - @param S input octet string - - */ -extern void FP12_fromOctet(FP12 *x, octet *S); -/** @brief Calculate the trace of an FP12 - * - @param t FP4 trace of x, on exit = tr(x) - @param x FP12 instance - - */ -extern void FP12_trace(FP4 *t, FP12 *x); - -/** @brief Conditional copy of FP12 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP12 instance, set to y if s!=0 - @param y another FP12 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP12_cmove(FP12 *x, FP12 *y, int s); - - -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP12_BLS12381_H +#define FP12_BLS12381_H + +#include "fp4_BLS12381.h" + +using namespace core; + +namespace BLS12381 { +/** + @brief FP12 Structure - towered over three FP4 +*/ + +typedef struct +{ + FP4 a; /**< first part of FP12 */ + FP4 b; /**< second part of FP12 */ + FP4 c; /**< third part of FP12 */ + int type; +} FP12; + +extern const B384_58::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B384_58::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP12 prototypes */ +/** @brief Tests for FP12 equal to zero + * + @param x FP12 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP12_iszilch(FP12 *x); +/** @brief Tests for FP12 equal to unity + * + @param x FP12 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP12_isunity(FP12 *x); +/** @brief Copy FP12 to another FP12 + * + @param x FP12 instance, on exit = y + @param y FP12 instance to be copied + */ +extern void FP12_copy(FP12 *x, FP12 *y); +/** @brief Set FP12 to unity + * + @param x FP12 instance to be set to one + */ +extern void FP12_one(FP12 *x); + +/** @brief Set FP12 to zero + * + @param x FP12 instance to be set to zero + */ +extern void FP12_zero(FP12 *x); + +/** @brief Tests for equality of two FP12s + * + @param x FP12 instance to be compared + @param y FP12 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP12_equals(FP12 *x, FP12 *y); +/** @brief Conjugation of FP12 + * + If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP12 instance, on exit = conj(y) + @param y FP12 instance + */ +extern void FP12_conj(FP12 *x, FP12 *y); +/** @brief Initialise FP12 from single FP4 + * + Sets first FP4 component of an FP12, other components set to zero + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP4 + */ +extern void FP12_from_FP4(FP12 *x, FP4 *a); +/** @brief Initialise FP12 from three FP4s + * + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP12 + @param b FP4 to form second part of FP12 + @param c FP4 to form third part of FP12 + */ +extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); +/** @brief Fast Squaring of an FP12 in "unitary" form + * + @param x FP12 instance, on exit = y^2 + @param y FP4 instance, must be unitary + */ +extern void FP12_usqr(FP12 *x, FP12 *y); +/** @brief Squaring an FP12 + * + @param x FP12 instance, on exit = y^2 + @param y FP12 instance + */ +extern void FP12_sqr(FP12 *x, FP12 *y); +/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_smul(FP12 *x, FP12 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_ssmul(FP12 *x, FP12 *y); + + +/** @brief Full unconditional Multiplication of two FP12s + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, the multiplier + */ +extern void FP12_mul(FP12 *x, FP12 *y); + +/** @brief Inverting an FP12 + * + @param x FP12 instance, on exit = 1/y + @param y FP12 instance + @param t D_TYPE or M_TYPE twist + */ +extern void FP12_inv(FP12 *x, FP12 *y); +/** @brief Raises an FP12 to the power of a BIG + * + @param r FP12 instance, on exit = y^b + @param x FP12 instance + @param b BIG number + */ +extern void FP12_pow(FP12 *r, FP12 *x, B384_58::BIG b); +/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant + * + @param x FP12 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP12_pinpow(FP12 *x, int i, int b); + +/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 + * + @param c FP4 instance, on exit = x^(e mod r) as FP4 + @param x FP12 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP12_compow(FP4 *c, FP12 *x, B384_58::BIG e, B384_58::BIG r); + +/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant + * + @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] + @param x FP12 array with 4 FP12s + @param b BIG array of 4 exponents + */ +extern void FP12_pow4(FP12 *r, FP12 *x, B384_58::BIG *b); +/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius + * + @param x FP12 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP12_frob(FP12 *x, FP2 *f); +/** @brief Reduces all components of possibly unreduced FP12 mod Modulus + * + @param x FP12 instance, on exit reduced mod Modulus + */ +extern void FP12_reduce(FP12 *x); +/** @brief Normalises the components of an FP12 + * + @param x FP12 instance to be normalised + */ +extern void FP12_norm(FP12 *x); +/** @brief Formats and outputs an FP12 to the console + * + @param x FP12 instance to be printed + */ +extern void FP12_output(FP12 *x); +/** @brief Formats and outputs an FP12 instance to an octet string + * + Serializes the components of an FP12 to big-endian base 256 form. + @param S output octet string + @param x FP12 instance to be converted to an octet string + */ +extern void FP12_toOctet(octet *S, FP12 *x); +/** @brief Creates an FP12 instance from an octet string + * + De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. + @param x FP12 instance to be created from an octet string + @param S input octet string + + */ +extern void FP12_fromOctet(FP12 *x, octet *S); +/** @brief Calculate the trace of an FP12 + * + @param t FP4 trace of x, on exit = tr(x) + @param x FP12 instance + + */ +extern void FP12_trace(FP4 *t, FP12 *x); + +/** @brief Conditional copy of FP12 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP12 instance, set to y if s!=0 + @param y another FP12 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP12_cmove(FP12 *x, FP12 *y, int s); + + +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BLS12383.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BLS12383.h index 5fd942b..be0a1d6 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BLS12383.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BLS12383.h @@ -1,230 +1,230 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP12_BLS12383_H -#define FP12_BLS12383_H - -#include "fp4_BLS12383.h" - -using namespace core; - -namespace BLS12383 { -/** - @brief FP12 Structure - towered over three FP4 -*/ - -typedef struct -{ - FP4 a; /**< first part of FP12 */ - FP4 b; /**< second part of FP12 */ - FP4 c; /**< third part of FP12 */ - int type; -} FP12; - -extern const B384_58::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B384_58::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP12 prototypes */ -/** @brief Tests for FP12 equal to zero - * - @param x FP12 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP12_iszilch(FP12 *x); -/** @brief Tests for FP12 equal to unity - * - @param x FP12 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP12_isunity(FP12 *x); -/** @brief Copy FP12 to another FP12 - * - @param x FP12 instance, on exit = y - @param y FP12 instance to be copied - */ -extern void FP12_copy(FP12 *x, FP12 *y); -/** @brief Set FP12 to unity - * - @param x FP12 instance to be set to one - */ -extern void FP12_one(FP12 *x); - -/** @brief Set FP12 to zero - * - @param x FP12 instance to be set to zero - */ -extern void FP12_zero(FP12 *x); - -/** @brief Tests for equality of two FP12s - * - @param x FP12 instance to be compared - @param y FP12 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP12_equals(FP12 *x, FP12 *y); -/** @brief Conjugation of FP12 - * - If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP12 instance, on exit = conj(y) - @param y FP12 instance - */ -extern void FP12_conj(FP12 *x, FP12 *y); -/** @brief Initialise FP12 from single FP4 - * - Sets first FP4 component of an FP12, other components set to zero - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP4 - */ -extern void FP12_from_FP4(FP12 *x, FP4 *a); -/** @brief Initialise FP12 from three FP4s - * - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP12 - @param b FP4 to form second part of FP12 - @param c FP4 to form third part of FP12 - */ -extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); -/** @brief Fast Squaring of an FP12 in "unitary" form - * - @param x FP12 instance, on exit = y^2 - @param y FP4 instance, must be unitary - */ -extern void FP12_usqr(FP12 *x, FP12 *y); -/** @brief Squaring an FP12 - * - @param x FP12 instance, on exit = y^2 - @param y FP12 instance - */ -extern void FP12_sqr(FP12 *x, FP12 *y); -/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_smul(FP12 *x, FP12 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_ssmul(FP12 *x, FP12 *y); - - -/** @brief Full unconditional Multiplication of two FP12s - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, the multiplier - */ -extern void FP12_mul(FP12 *x, FP12 *y); - -/** @brief Inverting an FP12 - * - @param x FP12 instance, on exit = 1/y - @param y FP12 instance - @param t D_TYPE or M_TYPE twist - */ -extern void FP12_inv(FP12 *x, FP12 *y); -/** @brief Raises an FP12 to the power of a BIG - * - @param r FP12 instance, on exit = y^b - @param x FP12 instance - @param b BIG number - */ -extern void FP12_pow(FP12 *r, FP12 *x, B384_58::BIG b); -/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant - * - @param x FP12 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP12_pinpow(FP12 *x, int i, int b); - -/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 - * - @param c FP4 instance, on exit = x^(e mod r) as FP4 - @param x FP12 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP12_compow(FP4 *c, FP12 *x, B384_58::BIG e, B384_58::BIG r); - -/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant - * - @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] - @param x FP12 array with 4 FP12s - @param b BIG array of 4 exponents - */ -extern void FP12_pow4(FP12 *r, FP12 *x, B384_58::BIG *b); -/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius - * - @param x FP12 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP12_frob(FP12 *x, FP2 *f); -/** @brief Reduces all components of possibly unreduced FP12 mod Modulus - * - @param x FP12 instance, on exit reduced mod Modulus - */ -extern void FP12_reduce(FP12 *x); -/** @brief Normalises the components of an FP12 - * - @param x FP12 instance to be normalised - */ -extern void FP12_norm(FP12 *x); -/** @brief Formats and outputs an FP12 to the console - * - @param x FP12 instance to be printed - */ -extern void FP12_output(FP12 *x); -/** @brief Formats and outputs an FP12 instance to an octet string - * - Serializes the components of an FP12 to big-endian base 256 form. - @param S output octet string - @param x FP12 instance to be converted to an octet string - */ -extern void FP12_toOctet(octet *S, FP12 *x); -/** @brief Creates an FP12 instance from an octet string - * - De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. - @param x FP12 instance to be created from an octet string - @param S input octet string - - */ -extern void FP12_fromOctet(FP12 *x, octet *S); -/** @brief Calculate the trace of an FP12 - * - @param t FP4 trace of x, on exit = tr(x) - @param x FP12 instance - - */ -extern void FP12_trace(FP4 *t, FP12 *x); - -/** @brief Conditional copy of FP12 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP12 instance, set to y if s!=0 - @param y another FP12 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP12_cmove(FP12 *x, FP12 *y, int s); - - -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP12_BLS12383_H +#define FP12_BLS12383_H + +#include "fp4_BLS12383.h" + +using namespace core; + +namespace BLS12383 { +/** + @brief FP12 Structure - towered over three FP4 +*/ + +typedef struct +{ + FP4 a; /**< first part of FP12 */ + FP4 b; /**< second part of FP12 */ + FP4 c; /**< third part of FP12 */ + int type; +} FP12; + +extern const B384_58::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B384_58::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP12 prototypes */ +/** @brief Tests for FP12 equal to zero + * + @param x FP12 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP12_iszilch(FP12 *x); +/** @brief Tests for FP12 equal to unity + * + @param x FP12 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP12_isunity(FP12 *x); +/** @brief Copy FP12 to another FP12 + * + @param x FP12 instance, on exit = y + @param y FP12 instance to be copied + */ +extern void FP12_copy(FP12 *x, FP12 *y); +/** @brief Set FP12 to unity + * + @param x FP12 instance to be set to one + */ +extern void FP12_one(FP12 *x); + +/** @brief Set FP12 to zero + * + @param x FP12 instance to be set to zero + */ +extern void FP12_zero(FP12 *x); + +/** @brief Tests for equality of two FP12s + * + @param x FP12 instance to be compared + @param y FP12 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP12_equals(FP12 *x, FP12 *y); +/** @brief Conjugation of FP12 + * + If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP12 instance, on exit = conj(y) + @param y FP12 instance + */ +extern void FP12_conj(FP12 *x, FP12 *y); +/** @brief Initialise FP12 from single FP4 + * + Sets first FP4 component of an FP12, other components set to zero + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP4 + */ +extern void FP12_from_FP4(FP12 *x, FP4 *a); +/** @brief Initialise FP12 from three FP4s + * + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP12 + @param b FP4 to form second part of FP12 + @param c FP4 to form third part of FP12 + */ +extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); +/** @brief Fast Squaring of an FP12 in "unitary" form + * + @param x FP12 instance, on exit = y^2 + @param y FP4 instance, must be unitary + */ +extern void FP12_usqr(FP12 *x, FP12 *y); +/** @brief Squaring an FP12 + * + @param x FP12 instance, on exit = y^2 + @param y FP12 instance + */ +extern void FP12_sqr(FP12 *x, FP12 *y); +/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_smul(FP12 *x, FP12 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_ssmul(FP12 *x, FP12 *y); + + +/** @brief Full unconditional Multiplication of two FP12s + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, the multiplier + */ +extern void FP12_mul(FP12 *x, FP12 *y); + +/** @brief Inverting an FP12 + * + @param x FP12 instance, on exit = 1/y + @param y FP12 instance + @param t D_TYPE or M_TYPE twist + */ +extern void FP12_inv(FP12 *x, FP12 *y); +/** @brief Raises an FP12 to the power of a BIG + * + @param r FP12 instance, on exit = y^b + @param x FP12 instance + @param b BIG number + */ +extern void FP12_pow(FP12 *r, FP12 *x, B384_58::BIG b); +/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant + * + @param x FP12 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP12_pinpow(FP12 *x, int i, int b); + +/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 + * + @param c FP4 instance, on exit = x^(e mod r) as FP4 + @param x FP12 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP12_compow(FP4 *c, FP12 *x, B384_58::BIG e, B384_58::BIG r); + +/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant + * + @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] + @param x FP12 array with 4 FP12s + @param b BIG array of 4 exponents + */ +extern void FP12_pow4(FP12 *r, FP12 *x, B384_58::BIG *b); +/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius + * + @param x FP12 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP12_frob(FP12 *x, FP2 *f); +/** @brief Reduces all components of possibly unreduced FP12 mod Modulus + * + @param x FP12 instance, on exit reduced mod Modulus + */ +extern void FP12_reduce(FP12 *x); +/** @brief Normalises the components of an FP12 + * + @param x FP12 instance to be normalised + */ +extern void FP12_norm(FP12 *x); +/** @brief Formats and outputs an FP12 to the console + * + @param x FP12 instance to be printed + */ +extern void FP12_output(FP12 *x); +/** @brief Formats and outputs an FP12 instance to an octet string + * + Serializes the components of an FP12 to big-endian base 256 form. + @param S output octet string + @param x FP12 instance to be converted to an octet string + */ +extern void FP12_toOctet(octet *S, FP12 *x); +/** @brief Creates an FP12 instance from an octet string + * + De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. + @param x FP12 instance to be created from an octet string + @param S input octet string + + */ +extern void FP12_fromOctet(FP12 *x, octet *S); +/** @brief Calculate the trace of an FP12 + * + @param t FP4 trace of x, on exit = tr(x) + @param x FP12 instance + + */ +extern void FP12_trace(FP4 *t, FP12 *x); + +/** @brief Conditional copy of FP12 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP12 instance, set to y if s!=0 + @param y another FP12 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP12_cmove(FP12 *x, FP12 *y, int s); + + +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BLS12443.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BLS12443.h index d2b98bd..a441462 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BLS12443.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BLS12443.h @@ -1,230 +1,230 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP12_BLS12443_H -#define FP12_BLS12443_H - -#include "fp4_BLS12443.h" - -using namespace core; - -namespace BLS12443 { -/** - @brief FP12 Structure - towered over three FP4 -*/ - -typedef struct -{ - FP4 a; /**< first part of FP12 */ - FP4 b; /**< second part of FP12 */ - FP4 c; /**< third part of FP12 */ - int type; -} FP12; - -extern const B448_60::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B448_60::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP12 prototypes */ -/** @brief Tests for FP12 equal to zero - * - @param x FP12 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP12_iszilch(FP12 *x); -/** @brief Tests for FP12 equal to unity - * - @param x FP12 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP12_isunity(FP12 *x); -/** @brief Copy FP12 to another FP12 - * - @param x FP12 instance, on exit = y - @param y FP12 instance to be copied - */ -extern void FP12_copy(FP12 *x, FP12 *y); -/** @brief Set FP12 to unity - * - @param x FP12 instance to be set to one - */ -extern void FP12_one(FP12 *x); - -/** @brief Set FP12 to zero - * - @param x FP12 instance to be set to zero - */ -extern void FP12_zero(FP12 *x); - -/** @brief Tests for equality of two FP12s - * - @param x FP12 instance to be compared - @param y FP12 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP12_equals(FP12 *x, FP12 *y); -/** @brief Conjugation of FP12 - * - If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP12 instance, on exit = conj(y) - @param y FP12 instance - */ -extern void FP12_conj(FP12 *x, FP12 *y); -/** @brief Initialise FP12 from single FP4 - * - Sets first FP4 component of an FP12, other components set to zero - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP4 - */ -extern void FP12_from_FP4(FP12 *x, FP4 *a); -/** @brief Initialise FP12 from three FP4s - * - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP12 - @param b FP4 to form second part of FP12 - @param c FP4 to form third part of FP12 - */ -extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); -/** @brief Fast Squaring of an FP12 in "unitary" form - * - @param x FP12 instance, on exit = y^2 - @param y FP4 instance, must be unitary - */ -extern void FP12_usqr(FP12 *x, FP12 *y); -/** @brief Squaring an FP12 - * - @param x FP12 instance, on exit = y^2 - @param y FP12 instance - */ -extern void FP12_sqr(FP12 *x, FP12 *y); -/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_smul(FP12 *x, FP12 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_ssmul(FP12 *x, FP12 *y); - - -/** @brief Full unconditional Multiplication of two FP12s - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, the multiplier - */ -extern void FP12_mul(FP12 *x, FP12 *y); - -/** @brief Inverting an FP12 - * - @param x FP12 instance, on exit = 1/y - @param y FP12 instance - @param t D_TYPE or M_TYPE twist - */ -extern void FP12_inv(FP12 *x, FP12 *y); -/** @brief Raises an FP12 to the power of a BIG - * - @param r FP12 instance, on exit = y^b - @param x FP12 instance - @param b BIG number - */ -extern void FP12_pow(FP12 *r, FP12 *x, B448_60::BIG b); -/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant - * - @param x FP12 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP12_pinpow(FP12 *x, int i, int b); - -/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 - * - @param c FP4 instance, on exit = x^(e mod r) as FP4 - @param x FP12 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP12_compow(FP4 *c, FP12 *x, B448_60::BIG e, B448_60::BIG r); - -/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant - * - @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] - @param x FP12 array with 4 FP12s - @param b BIG array of 4 exponents - */ -extern void FP12_pow4(FP12 *r, FP12 *x, B448_60::BIG *b); -/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius - * - @param x FP12 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP12_frob(FP12 *x, FP2 *f); -/** @brief Reduces all components of possibly unreduced FP12 mod Modulus - * - @param x FP12 instance, on exit reduced mod Modulus - */ -extern void FP12_reduce(FP12 *x); -/** @brief Normalises the components of an FP12 - * - @param x FP12 instance to be normalised - */ -extern void FP12_norm(FP12 *x); -/** @brief Formats and outputs an FP12 to the console - * - @param x FP12 instance to be printed - */ -extern void FP12_output(FP12 *x); -/** @brief Formats and outputs an FP12 instance to an octet string - * - Serializes the components of an FP12 to big-endian base 256 form. - @param S output octet string - @param x FP12 instance to be converted to an octet string - */ -extern void FP12_toOctet(octet *S, FP12 *x); -/** @brief Creates an FP12 instance from an octet string - * - De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. - @param x FP12 instance to be created from an octet string - @param S input octet string - - */ -extern void FP12_fromOctet(FP12 *x, octet *S); -/** @brief Calculate the trace of an FP12 - * - @param t FP4 trace of x, on exit = tr(x) - @param x FP12 instance - - */ -extern void FP12_trace(FP4 *t, FP12 *x); - -/** @brief Conditional copy of FP12 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP12 instance, set to y if s!=0 - @param y another FP12 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP12_cmove(FP12 *x, FP12 *y, int s); - - -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP12_BLS12443_H +#define FP12_BLS12443_H + +#include "fp4_BLS12443.h" + +using namespace core; + +namespace BLS12443 { +/** + @brief FP12 Structure - towered over three FP4 +*/ + +typedef struct +{ + FP4 a; /**< first part of FP12 */ + FP4 b; /**< second part of FP12 */ + FP4 c; /**< third part of FP12 */ + int type; +} FP12; + +extern const B448_60::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B448_60::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP12 prototypes */ +/** @brief Tests for FP12 equal to zero + * + @param x FP12 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP12_iszilch(FP12 *x); +/** @brief Tests for FP12 equal to unity + * + @param x FP12 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP12_isunity(FP12 *x); +/** @brief Copy FP12 to another FP12 + * + @param x FP12 instance, on exit = y + @param y FP12 instance to be copied + */ +extern void FP12_copy(FP12 *x, FP12 *y); +/** @brief Set FP12 to unity + * + @param x FP12 instance to be set to one + */ +extern void FP12_one(FP12 *x); + +/** @brief Set FP12 to zero + * + @param x FP12 instance to be set to zero + */ +extern void FP12_zero(FP12 *x); + +/** @brief Tests for equality of two FP12s + * + @param x FP12 instance to be compared + @param y FP12 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP12_equals(FP12 *x, FP12 *y); +/** @brief Conjugation of FP12 + * + If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP12 instance, on exit = conj(y) + @param y FP12 instance + */ +extern void FP12_conj(FP12 *x, FP12 *y); +/** @brief Initialise FP12 from single FP4 + * + Sets first FP4 component of an FP12, other components set to zero + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP4 + */ +extern void FP12_from_FP4(FP12 *x, FP4 *a); +/** @brief Initialise FP12 from three FP4s + * + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP12 + @param b FP4 to form second part of FP12 + @param c FP4 to form third part of FP12 + */ +extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); +/** @brief Fast Squaring of an FP12 in "unitary" form + * + @param x FP12 instance, on exit = y^2 + @param y FP4 instance, must be unitary + */ +extern void FP12_usqr(FP12 *x, FP12 *y); +/** @brief Squaring an FP12 + * + @param x FP12 instance, on exit = y^2 + @param y FP12 instance + */ +extern void FP12_sqr(FP12 *x, FP12 *y); +/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_smul(FP12 *x, FP12 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_ssmul(FP12 *x, FP12 *y); + + +/** @brief Full unconditional Multiplication of two FP12s + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, the multiplier + */ +extern void FP12_mul(FP12 *x, FP12 *y); + +/** @brief Inverting an FP12 + * + @param x FP12 instance, on exit = 1/y + @param y FP12 instance + @param t D_TYPE or M_TYPE twist + */ +extern void FP12_inv(FP12 *x, FP12 *y); +/** @brief Raises an FP12 to the power of a BIG + * + @param r FP12 instance, on exit = y^b + @param x FP12 instance + @param b BIG number + */ +extern void FP12_pow(FP12 *r, FP12 *x, B448_60::BIG b); +/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant + * + @param x FP12 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP12_pinpow(FP12 *x, int i, int b); + +/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 + * + @param c FP4 instance, on exit = x^(e mod r) as FP4 + @param x FP12 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP12_compow(FP4 *c, FP12 *x, B448_60::BIG e, B448_60::BIG r); + +/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant + * + @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] + @param x FP12 array with 4 FP12s + @param b BIG array of 4 exponents + */ +extern void FP12_pow4(FP12 *r, FP12 *x, B448_60::BIG *b); +/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius + * + @param x FP12 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP12_frob(FP12 *x, FP2 *f); +/** @brief Reduces all components of possibly unreduced FP12 mod Modulus + * + @param x FP12 instance, on exit reduced mod Modulus + */ +extern void FP12_reduce(FP12 *x); +/** @brief Normalises the components of an FP12 + * + @param x FP12 instance to be normalised + */ +extern void FP12_norm(FP12 *x); +/** @brief Formats and outputs an FP12 to the console + * + @param x FP12 instance to be printed + */ +extern void FP12_output(FP12 *x); +/** @brief Formats and outputs an FP12 instance to an octet string + * + Serializes the components of an FP12 to big-endian base 256 form. + @param S output octet string + @param x FP12 instance to be converted to an octet string + */ +extern void FP12_toOctet(octet *S, FP12 *x); +/** @brief Creates an FP12 instance from an octet string + * + De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. + @param x FP12 instance to be created from an octet string + @param S input octet string + + */ +extern void FP12_fromOctet(FP12 *x, octet *S); +/** @brief Calculate the trace of an FP12 + * + @param t FP4 trace of x, on exit = tr(x) + @param x FP12 instance + + */ +extern void FP12_trace(FP4 *t, FP12 *x); + +/** @brief Conditional copy of FP12 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP12 instance, set to y if s!=0 + @param y another FP12 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP12_cmove(FP12 *x, FP12 *y, int s); + + +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BLS12461.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BLS12461.h index 7717d3f..76901af 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BLS12461.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BLS12461.h @@ -1,230 +1,230 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP12_BLS12461_H -#define FP12_BLS12461_H - -#include "fp4_BLS12461.h" - -using namespace core; - -namespace BLS12461 { -/** - @brief FP12 Structure - towered over three FP4 -*/ - -typedef struct -{ - FP4 a; /**< first part of FP12 */ - FP4 b; /**< second part of FP12 */ - FP4 c; /**< third part of FP12 */ - int type; -} FP12; - -extern const B464_60::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B464_60::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP12 prototypes */ -/** @brief Tests for FP12 equal to zero - * - @param x FP12 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP12_iszilch(FP12 *x); -/** @brief Tests for FP12 equal to unity - * - @param x FP12 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP12_isunity(FP12 *x); -/** @brief Copy FP12 to another FP12 - * - @param x FP12 instance, on exit = y - @param y FP12 instance to be copied - */ -extern void FP12_copy(FP12 *x, FP12 *y); -/** @brief Set FP12 to unity - * - @param x FP12 instance to be set to one - */ -extern void FP12_one(FP12 *x); - -/** @brief Set FP12 to zero - * - @param x FP12 instance to be set to zero - */ -extern void FP12_zero(FP12 *x); - -/** @brief Tests for equality of two FP12s - * - @param x FP12 instance to be compared - @param y FP12 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP12_equals(FP12 *x, FP12 *y); -/** @brief Conjugation of FP12 - * - If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP12 instance, on exit = conj(y) - @param y FP12 instance - */ -extern void FP12_conj(FP12 *x, FP12 *y); -/** @brief Initialise FP12 from single FP4 - * - Sets first FP4 component of an FP12, other components set to zero - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP4 - */ -extern void FP12_from_FP4(FP12 *x, FP4 *a); -/** @brief Initialise FP12 from three FP4s - * - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP12 - @param b FP4 to form second part of FP12 - @param c FP4 to form third part of FP12 - */ -extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); -/** @brief Fast Squaring of an FP12 in "unitary" form - * - @param x FP12 instance, on exit = y^2 - @param y FP4 instance, must be unitary - */ -extern void FP12_usqr(FP12 *x, FP12 *y); -/** @brief Squaring an FP12 - * - @param x FP12 instance, on exit = y^2 - @param y FP12 instance - */ -extern void FP12_sqr(FP12 *x, FP12 *y); -/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_smul(FP12 *x, FP12 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_ssmul(FP12 *x, FP12 *y); - - -/** @brief Full unconditional Multiplication of two FP12s - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, the multiplier - */ -extern void FP12_mul(FP12 *x, FP12 *y); - -/** @brief Inverting an FP12 - * - @param x FP12 instance, on exit = 1/y - @param y FP12 instance - @param t D_TYPE or M_TYPE twist - */ -extern void FP12_inv(FP12 *x, FP12 *y); -/** @brief Raises an FP12 to the power of a BIG - * - @param r FP12 instance, on exit = y^b - @param x FP12 instance - @param b BIG number - */ -extern void FP12_pow(FP12 *r, FP12 *x, B464_60::BIG b); -/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant - * - @param x FP12 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP12_pinpow(FP12 *x, int i, int b); - -/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 - * - @param c FP4 instance, on exit = x^(e mod r) as FP4 - @param x FP12 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP12_compow(FP4 *c, FP12 *x, B464_60::BIG e, B464_60::BIG r); - -/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant - * - @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] - @param x FP12 array with 4 FP12s - @param b BIG array of 4 exponents - */ -extern void FP12_pow4(FP12 *r, FP12 *x, B464_60::BIG *b); -/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius - * - @param x FP12 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP12_frob(FP12 *x, FP2 *f); -/** @brief Reduces all components of possibly unreduced FP12 mod Modulus - * - @param x FP12 instance, on exit reduced mod Modulus - */ -extern void FP12_reduce(FP12 *x); -/** @brief Normalises the components of an FP12 - * - @param x FP12 instance to be normalised - */ -extern void FP12_norm(FP12 *x); -/** @brief Formats and outputs an FP12 to the console - * - @param x FP12 instance to be printed - */ -extern void FP12_output(FP12 *x); -/** @brief Formats and outputs an FP12 instance to an octet string - * - Serializes the components of an FP12 to big-endian base 256 form. - @param S output octet string - @param x FP12 instance to be converted to an octet string - */ -extern void FP12_toOctet(octet *S, FP12 *x); -/** @brief Creates an FP12 instance from an octet string - * - De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. - @param x FP12 instance to be created from an octet string - @param S input octet string - - */ -extern void FP12_fromOctet(FP12 *x, octet *S); -/** @brief Calculate the trace of an FP12 - * - @param t FP4 trace of x, on exit = tr(x) - @param x FP12 instance - - */ -extern void FP12_trace(FP4 *t, FP12 *x); - -/** @brief Conditional copy of FP12 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP12 instance, set to y if s!=0 - @param y another FP12 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP12_cmove(FP12 *x, FP12 *y, int s); - - -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP12_BLS12461_H +#define FP12_BLS12461_H + +#include "fp4_BLS12461.h" + +using namespace core; + +namespace BLS12461 { +/** + @brief FP12 Structure - towered over three FP4 +*/ + +typedef struct +{ + FP4 a; /**< first part of FP12 */ + FP4 b; /**< second part of FP12 */ + FP4 c; /**< third part of FP12 */ + int type; +} FP12; + +extern const B464_60::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B464_60::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP12 prototypes */ +/** @brief Tests for FP12 equal to zero + * + @param x FP12 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP12_iszilch(FP12 *x); +/** @brief Tests for FP12 equal to unity + * + @param x FP12 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP12_isunity(FP12 *x); +/** @brief Copy FP12 to another FP12 + * + @param x FP12 instance, on exit = y + @param y FP12 instance to be copied + */ +extern void FP12_copy(FP12 *x, FP12 *y); +/** @brief Set FP12 to unity + * + @param x FP12 instance to be set to one + */ +extern void FP12_one(FP12 *x); + +/** @brief Set FP12 to zero + * + @param x FP12 instance to be set to zero + */ +extern void FP12_zero(FP12 *x); + +/** @brief Tests for equality of two FP12s + * + @param x FP12 instance to be compared + @param y FP12 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP12_equals(FP12 *x, FP12 *y); +/** @brief Conjugation of FP12 + * + If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP12 instance, on exit = conj(y) + @param y FP12 instance + */ +extern void FP12_conj(FP12 *x, FP12 *y); +/** @brief Initialise FP12 from single FP4 + * + Sets first FP4 component of an FP12, other components set to zero + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP4 + */ +extern void FP12_from_FP4(FP12 *x, FP4 *a); +/** @brief Initialise FP12 from three FP4s + * + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP12 + @param b FP4 to form second part of FP12 + @param c FP4 to form third part of FP12 + */ +extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); +/** @brief Fast Squaring of an FP12 in "unitary" form + * + @param x FP12 instance, on exit = y^2 + @param y FP4 instance, must be unitary + */ +extern void FP12_usqr(FP12 *x, FP12 *y); +/** @brief Squaring an FP12 + * + @param x FP12 instance, on exit = y^2 + @param y FP12 instance + */ +extern void FP12_sqr(FP12 *x, FP12 *y); +/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_smul(FP12 *x, FP12 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_ssmul(FP12 *x, FP12 *y); + + +/** @brief Full unconditional Multiplication of two FP12s + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, the multiplier + */ +extern void FP12_mul(FP12 *x, FP12 *y); + +/** @brief Inverting an FP12 + * + @param x FP12 instance, on exit = 1/y + @param y FP12 instance + @param t D_TYPE or M_TYPE twist + */ +extern void FP12_inv(FP12 *x, FP12 *y); +/** @brief Raises an FP12 to the power of a BIG + * + @param r FP12 instance, on exit = y^b + @param x FP12 instance + @param b BIG number + */ +extern void FP12_pow(FP12 *r, FP12 *x, B464_60::BIG b); +/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant + * + @param x FP12 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP12_pinpow(FP12 *x, int i, int b); + +/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 + * + @param c FP4 instance, on exit = x^(e mod r) as FP4 + @param x FP12 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP12_compow(FP4 *c, FP12 *x, B464_60::BIG e, B464_60::BIG r); + +/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant + * + @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] + @param x FP12 array with 4 FP12s + @param b BIG array of 4 exponents + */ +extern void FP12_pow4(FP12 *r, FP12 *x, B464_60::BIG *b); +/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius + * + @param x FP12 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP12_frob(FP12 *x, FP2 *f); +/** @brief Reduces all components of possibly unreduced FP12 mod Modulus + * + @param x FP12 instance, on exit reduced mod Modulus + */ +extern void FP12_reduce(FP12 *x); +/** @brief Normalises the components of an FP12 + * + @param x FP12 instance to be normalised + */ +extern void FP12_norm(FP12 *x); +/** @brief Formats and outputs an FP12 to the console + * + @param x FP12 instance to be printed + */ +extern void FP12_output(FP12 *x); +/** @brief Formats and outputs an FP12 instance to an octet string + * + Serializes the components of an FP12 to big-endian base 256 form. + @param S output octet string + @param x FP12 instance to be converted to an octet string + */ +extern void FP12_toOctet(octet *S, FP12 *x); +/** @brief Creates an FP12 instance from an octet string + * + De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. + @param x FP12 instance to be created from an octet string + @param S input octet string + + */ +extern void FP12_fromOctet(FP12 *x, octet *S); +/** @brief Calculate the trace of an FP12 + * + @param t FP4 trace of x, on exit = tr(x) + @param x FP12 instance + + */ +extern void FP12_trace(FP4 *t, FP12 *x); + +/** @brief Conditional copy of FP12 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP12 instance, set to y if s!=0 + @param y another FP12 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP12_cmove(FP12 *x, FP12 *y, int s); + + +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BN158.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BN158.h index aa89990..1a68a7a 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BN158.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BN158.h @@ -1,230 +1,230 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP12_BN158_H -#define FP12_BN158_H - -#include "fp4_BN158.h" - -using namespace core; - -namespace BN158 { -/** - @brief FP12 Structure - towered over three FP4 -*/ - -typedef struct -{ - FP4 a; /**< first part of FP12 */ - FP4 b; /**< second part of FP12 */ - FP4 c; /**< third part of FP12 */ - int type; -} FP12; - -extern const B160_56::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B160_56::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP12 prototypes */ -/** @brief Tests for FP12 equal to zero - * - @param x FP12 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP12_iszilch(FP12 *x); -/** @brief Tests for FP12 equal to unity - * - @param x FP12 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP12_isunity(FP12 *x); -/** @brief Copy FP12 to another FP12 - * - @param x FP12 instance, on exit = y - @param y FP12 instance to be copied - */ -extern void FP12_copy(FP12 *x, FP12 *y); -/** @brief Set FP12 to unity - * - @param x FP12 instance to be set to one - */ -extern void FP12_one(FP12 *x); - -/** @brief Set FP12 to zero - * - @param x FP12 instance to be set to zero - */ -extern void FP12_zero(FP12 *x); - -/** @brief Tests for equality of two FP12s - * - @param x FP12 instance to be compared - @param y FP12 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP12_equals(FP12 *x, FP12 *y); -/** @brief Conjugation of FP12 - * - If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP12 instance, on exit = conj(y) - @param y FP12 instance - */ -extern void FP12_conj(FP12 *x, FP12 *y); -/** @brief Initialise FP12 from single FP4 - * - Sets first FP4 component of an FP12, other components set to zero - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP4 - */ -extern void FP12_from_FP4(FP12 *x, FP4 *a); -/** @brief Initialise FP12 from three FP4s - * - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP12 - @param b FP4 to form second part of FP12 - @param c FP4 to form third part of FP12 - */ -extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); -/** @brief Fast Squaring of an FP12 in "unitary" form - * - @param x FP12 instance, on exit = y^2 - @param y FP4 instance, must be unitary - */ -extern void FP12_usqr(FP12 *x, FP12 *y); -/** @brief Squaring an FP12 - * - @param x FP12 instance, on exit = y^2 - @param y FP12 instance - */ -extern void FP12_sqr(FP12 *x, FP12 *y); -/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_smul(FP12 *x, FP12 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_ssmul(FP12 *x, FP12 *y); - - -/** @brief Full unconditional Multiplication of two FP12s - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, the multiplier - */ -extern void FP12_mul(FP12 *x, FP12 *y); - -/** @brief Inverting an FP12 - * - @param x FP12 instance, on exit = 1/y - @param y FP12 instance - @param t D_TYPE or M_TYPE twist - */ -extern void FP12_inv(FP12 *x, FP12 *y); -/** @brief Raises an FP12 to the power of a BIG - * - @param r FP12 instance, on exit = y^b - @param x FP12 instance - @param b BIG number - */ -extern void FP12_pow(FP12 *r, FP12 *x, B160_56::BIG b); -/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant - * - @param x FP12 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP12_pinpow(FP12 *x, int i, int b); - -/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 - * - @param c FP4 instance, on exit = x^(e mod r) as FP4 - @param x FP12 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP12_compow(FP4 *c, FP12 *x, B160_56::BIG e, B160_56::BIG r); - -/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant - * - @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] - @param x FP12 array with 4 FP12s - @param b BIG array of 4 exponents - */ -extern void FP12_pow4(FP12 *r, FP12 *x, B160_56::BIG *b); -/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius - * - @param x FP12 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP12_frob(FP12 *x, FP2 *f); -/** @brief Reduces all components of possibly unreduced FP12 mod Modulus - * - @param x FP12 instance, on exit reduced mod Modulus - */ -extern void FP12_reduce(FP12 *x); -/** @brief Normalises the components of an FP12 - * - @param x FP12 instance to be normalised - */ -extern void FP12_norm(FP12 *x); -/** @brief Formats and outputs an FP12 to the console - * - @param x FP12 instance to be printed - */ -extern void FP12_output(FP12 *x); -/** @brief Formats and outputs an FP12 instance to an octet string - * - Serializes the components of an FP12 to big-endian base 256 form. - @param S output octet string - @param x FP12 instance to be converted to an octet string - */ -extern void FP12_toOctet(octet *S, FP12 *x); -/** @brief Creates an FP12 instance from an octet string - * - De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. - @param x FP12 instance to be created from an octet string - @param S input octet string - - */ -extern void FP12_fromOctet(FP12 *x, octet *S); -/** @brief Calculate the trace of an FP12 - * - @param t FP4 trace of x, on exit = tr(x) - @param x FP12 instance - - */ -extern void FP12_trace(FP4 *t, FP12 *x); - -/** @brief Conditional copy of FP12 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP12 instance, set to y if s!=0 - @param y another FP12 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP12_cmove(FP12 *x, FP12 *y, int s); - - -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP12_BN158_H +#define FP12_BN158_H + +#include "fp4_BN158.h" + +using namespace core; + +namespace BN158 { +/** + @brief FP12 Structure - towered over three FP4 +*/ + +typedef struct +{ + FP4 a; /**< first part of FP12 */ + FP4 b; /**< second part of FP12 */ + FP4 c; /**< third part of FP12 */ + int type; +} FP12; + +extern const B160_56::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B160_56::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP12 prototypes */ +/** @brief Tests for FP12 equal to zero + * + @param x FP12 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP12_iszilch(FP12 *x); +/** @brief Tests for FP12 equal to unity + * + @param x FP12 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP12_isunity(FP12 *x); +/** @brief Copy FP12 to another FP12 + * + @param x FP12 instance, on exit = y + @param y FP12 instance to be copied + */ +extern void FP12_copy(FP12 *x, FP12 *y); +/** @brief Set FP12 to unity + * + @param x FP12 instance to be set to one + */ +extern void FP12_one(FP12 *x); + +/** @brief Set FP12 to zero + * + @param x FP12 instance to be set to zero + */ +extern void FP12_zero(FP12 *x); + +/** @brief Tests for equality of two FP12s + * + @param x FP12 instance to be compared + @param y FP12 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP12_equals(FP12 *x, FP12 *y); +/** @brief Conjugation of FP12 + * + If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP12 instance, on exit = conj(y) + @param y FP12 instance + */ +extern void FP12_conj(FP12 *x, FP12 *y); +/** @brief Initialise FP12 from single FP4 + * + Sets first FP4 component of an FP12, other components set to zero + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP4 + */ +extern void FP12_from_FP4(FP12 *x, FP4 *a); +/** @brief Initialise FP12 from three FP4s + * + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP12 + @param b FP4 to form second part of FP12 + @param c FP4 to form third part of FP12 + */ +extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); +/** @brief Fast Squaring of an FP12 in "unitary" form + * + @param x FP12 instance, on exit = y^2 + @param y FP4 instance, must be unitary + */ +extern void FP12_usqr(FP12 *x, FP12 *y); +/** @brief Squaring an FP12 + * + @param x FP12 instance, on exit = y^2 + @param y FP12 instance + */ +extern void FP12_sqr(FP12 *x, FP12 *y); +/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_smul(FP12 *x, FP12 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_ssmul(FP12 *x, FP12 *y); + + +/** @brief Full unconditional Multiplication of two FP12s + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, the multiplier + */ +extern void FP12_mul(FP12 *x, FP12 *y); + +/** @brief Inverting an FP12 + * + @param x FP12 instance, on exit = 1/y + @param y FP12 instance + @param t D_TYPE or M_TYPE twist + */ +extern void FP12_inv(FP12 *x, FP12 *y); +/** @brief Raises an FP12 to the power of a BIG + * + @param r FP12 instance, on exit = y^b + @param x FP12 instance + @param b BIG number + */ +extern void FP12_pow(FP12 *r, FP12 *x, B160_56::BIG b); +/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant + * + @param x FP12 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP12_pinpow(FP12 *x, int i, int b); + +/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 + * + @param c FP4 instance, on exit = x^(e mod r) as FP4 + @param x FP12 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP12_compow(FP4 *c, FP12 *x, B160_56::BIG e, B160_56::BIG r); + +/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant + * + @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] + @param x FP12 array with 4 FP12s + @param b BIG array of 4 exponents + */ +extern void FP12_pow4(FP12 *r, FP12 *x, B160_56::BIG *b); +/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius + * + @param x FP12 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP12_frob(FP12 *x, FP2 *f); +/** @brief Reduces all components of possibly unreduced FP12 mod Modulus + * + @param x FP12 instance, on exit reduced mod Modulus + */ +extern void FP12_reduce(FP12 *x); +/** @brief Normalises the components of an FP12 + * + @param x FP12 instance to be normalised + */ +extern void FP12_norm(FP12 *x); +/** @brief Formats and outputs an FP12 to the console + * + @param x FP12 instance to be printed + */ +extern void FP12_output(FP12 *x); +/** @brief Formats and outputs an FP12 instance to an octet string + * + Serializes the components of an FP12 to big-endian base 256 form. + @param S output octet string + @param x FP12 instance to be converted to an octet string + */ +extern void FP12_toOctet(octet *S, FP12 *x); +/** @brief Creates an FP12 instance from an octet string + * + De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. + @param x FP12 instance to be created from an octet string + @param S input octet string + + */ +extern void FP12_fromOctet(FP12 *x, octet *S); +/** @brief Calculate the trace of an FP12 + * + @param t FP4 trace of x, on exit = tr(x) + @param x FP12 instance + + */ +extern void FP12_trace(FP4 *t, FP12 *x); + +/** @brief Conditional copy of FP12 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP12 instance, set to y if s!=0 + @param y another FP12 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP12_cmove(FP12 *x, FP12 *y, int s); + + +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BN254.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BN254.h index 15a03d8..9d34371 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BN254.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BN254.h @@ -1,230 +1,230 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP12_BN254_H -#define FP12_BN254_H - -#include "fp4_BN254.h" - -using namespace core; - -namespace BN254 { -/** - @brief FP12 Structure - towered over three FP4 -*/ - -typedef struct -{ - FP4 a; /**< first part of FP12 */ - FP4 b; /**< second part of FP12 */ - FP4 c; /**< third part of FP12 */ - int type; -} FP12; - -extern const B256_56::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B256_56::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP12 prototypes */ -/** @brief Tests for FP12 equal to zero - * - @param x FP12 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP12_iszilch(FP12 *x); -/** @brief Tests for FP12 equal to unity - * - @param x FP12 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP12_isunity(FP12 *x); -/** @brief Copy FP12 to another FP12 - * - @param x FP12 instance, on exit = y - @param y FP12 instance to be copied - */ -extern void FP12_copy(FP12 *x, FP12 *y); -/** @brief Set FP12 to unity - * - @param x FP12 instance to be set to one - */ -extern void FP12_one(FP12 *x); - -/** @brief Set FP12 to zero - * - @param x FP12 instance to be set to zero - */ -extern void FP12_zero(FP12 *x); - -/** @brief Tests for equality of two FP12s - * - @param x FP12 instance to be compared - @param y FP12 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP12_equals(FP12 *x, FP12 *y); -/** @brief Conjugation of FP12 - * - If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP12 instance, on exit = conj(y) - @param y FP12 instance - */ -extern void FP12_conj(FP12 *x, FP12 *y); -/** @brief Initialise FP12 from single FP4 - * - Sets first FP4 component of an FP12, other components set to zero - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP4 - */ -extern void FP12_from_FP4(FP12 *x, FP4 *a); -/** @brief Initialise FP12 from three FP4s - * - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP12 - @param b FP4 to form second part of FP12 - @param c FP4 to form third part of FP12 - */ -extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); -/** @brief Fast Squaring of an FP12 in "unitary" form - * - @param x FP12 instance, on exit = y^2 - @param y FP4 instance, must be unitary - */ -extern void FP12_usqr(FP12 *x, FP12 *y); -/** @brief Squaring an FP12 - * - @param x FP12 instance, on exit = y^2 - @param y FP12 instance - */ -extern void FP12_sqr(FP12 *x, FP12 *y); -/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_smul(FP12 *x, FP12 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_ssmul(FP12 *x, FP12 *y); - - -/** @brief Full unconditional Multiplication of two FP12s - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, the multiplier - */ -extern void FP12_mul(FP12 *x, FP12 *y); - -/** @brief Inverting an FP12 - * - @param x FP12 instance, on exit = 1/y - @param y FP12 instance - @param t D_TYPE or M_TYPE twist - */ -extern void FP12_inv(FP12 *x, FP12 *y); -/** @brief Raises an FP12 to the power of a BIG - * - @param r FP12 instance, on exit = y^b - @param x FP12 instance - @param b BIG number - */ -extern void FP12_pow(FP12 *r, FP12 *x, B256_56::BIG b); -/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant - * - @param x FP12 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP12_pinpow(FP12 *x, int i, int b); - -/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 - * - @param c FP4 instance, on exit = x^(e mod r) as FP4 - @param x FP12 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP12_compow(FP4 *c, FP12 *x, B256_56::BIG e, B256_56::BIG r); - -/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant - * - @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] - @param x FP12 array with 4 FP12s - @param b BIG array of 4 exponents - */ -extern void FP12_pow4(FP12 *r, FP12 *x, B256_56::BIG *b); -/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius - * - @param x FP12 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP12_frob(FP12 *x, FP2 *f); -/** @brief Reduces all components of possibly unreduced FP12 mod Modulus - * - @param x FP12 instance, on exit reduced mod Modulus - */ -extern void FP12_reduce(FP12 *x); -/** @brief Normalises the components of an FP12 - * - @param x FP12 instance to be normalised - */ -extern void FP12_norm(FP12 *x); -/** @brief Formats and outputs an FP12 to the console - * - @param x FP12 instance to be printed - */ -extern void FP12_output(FP12 *x); -/** @brief Formats and outputs an FP12 instance to an octet string - * - Serializes the components of an FP12 to big-endian base 256 form. - @param S output octet string - @param x FP12 instance to be converted to an octet string - */ -extern void FP12_toOctet(octet *S, FP12 *x); -/** @brief Creates an FP12 instance from an octet string - * - De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. - @param x FP12 instance to be created from an octet string - @param S input octet string - - */ -extern void FP12_fromOctet(FP12 *x, octet *S); -/** @brief Calculate the trace of an FP12 - * - @param t FP4 trace of x, on exit = tr(x) - @param x FP12 instance - - */ -extern void FP12_trace(FP4 *t, FP12 *x); - -/** @brief Conditional copy of FP12 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP12 instance, set to y if s!=0 - @param y another FP12 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP12_cmove(FP12 *x, FP12 *y, int s); - - -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP12_BN254_H +#define FP12_BN254_H + +#include "fp4_BN254.h" + +using namespace core; + +namespace BN254 { +/** + @brief FP12 Structure - towered over three FP4 +*/ + +typedef struct +{ + FP4 a; /**< first part of FP12 */ + FP4 b; /**< second part of FP12 */ + FP4 c; /**< third part of FP12 */ + int type; +} FP12; + +extern const B256_56::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B256_56::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP12 prototypes */ +/** @brief Tests for FP12 equal to zero + * + @param x FP12 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP12_iszilch(FP12 *x); +/** @brief Tests for FP12 equal to unity + * + @param x FP12 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP12_isunity(FP12 *x); +/** @brief Copy FP12 to another FP12 + * + @param x FP12 instance, on exit = y + @param y FP12 instance to be copied + */ +extern void FP12_copy(FP12 *x, FP12 *y); +/** @brief Set FP12 to unity + * + @param x FP12 instance to be set to one + */ +extern void FP12_one(FP12 *x); + +/** @brief Set FP12 to zero + * + @param x FP12 instance to be set to zero + */ +extern void FP12_zero(FP12 *x); + +/** @brief Tests for equality of two FP12s + * + @param x FP12 instance to be compared + @param y FP12 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP12_equals(FP12 *x, FP12 *y); +/** @brief Conjugation of FP12 + * + If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP12 instance, on exit = conj(y) + @param y FP12 instance + */ +extern void FP12_conj(FP12 *x, FP12 *y); +/** @brief Initialise FP12 from single FP4 + * + Sets first FP4 component of an FP12, other components set to zero + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP4 + */ +extern void FP12_from_FP4(FP12 *x, FP4 *a); +/** @brief Initialise FP12 from three FP4s + * + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP12 + @param b FP4 to form second part of FP12 + @param c FP4 to form third part of FP12 + */ +extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); +/** @brief Fast Squaring of an FP12 in "unitary" form + * + @param x FP12 instance, on exit = y^2 + @param y FP4 instance, must be unitary + */ +extern void FP12_usqr(FP12 *x, FP12 *y); +/** @brief Squaring an FP12 + * + @param x FP12 instance, on exit = y^2 + @param y FP12 instance + */ +extern void FP12_sqr(FP12 *x, FP12 *y); +/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_smul(FP12 *x, FP12 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_ssmul(FP12 *x, FP12 *y); + + +/** @brief Full unconditional Multiplication of two FP12s + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, the multiplier + */ +extern void FP12_mul(FP12 *x, FP12 *y); + +/** @brief Inverting an FP12 + * + @param x FP12 instance, on exit = 1/y + @param y FP12 instance + @param t D_TYPE or M_TYPE twist + */ +extern void FP12_inv(FP12 *x, FP12 *y); +/** @brief Raises an FP12 to the power of a BIG + * + @param r FP12 instance, on exit = y^b + @param x FP12 instance + @param b BIG number + */ +extern void FP12_pow(FP12 *r, FP12 *x, B256_56::BIG b); +/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant + * + @param x FP12 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP12_pinpow(FP12 *x, int i, int b); + +/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 + * + @param c FP4 instance, on exit = x^(e mod r) as FP4 + @param x FP12 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP12_compow(FP4 *c, FP12 *x, B256_56::BIG e, B256_56::BIG r); + +/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant + * + @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] + @param x FP12 array with 4 FP12s + @param b BIG array of 4 exponents + */ +extern void FP12_pow4(FP12 *r, FP12 *x, B256_56::BIG *b); +/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius + * + @param x FP12 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP12_frob(FP12 *x, FP2 *f); +/** @brief Reduces all components of possibly unreduced FP12 mod Modulus + * + @param x FP12 instance, on exit reduced mod Modulus + */ +extern void FP12_reduce(FP12 *x); +/** @brief Normalises the components of an FP12 + * + @param x FP12 instance to be normalised + */ +extern void FP12_norm(FP12 *x); +/** @brief Formats and outputs an FP12 to the console + * + @param x FP12 instance to be printed + */ +extern void FP12_output(FP12 *x); +/** @brief Formats and outputs an FP12 instance to an octet string + * + Serializes the components of an FP12 to big-endian base 256 form. + @param S output octet string + @param x FP12 instance to be converted to an octet string + */ +extern void FP12_toOctet(octet *S, FP12 *x); +/** @brief Creates an FP12 instance from an octet string + * + De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. + @param x FP12 instance to be created from an octet string + @param S input octet string + + */ +extern void FP12_fromOctet(FP12 *x, octet *S); +/** @brief Calculate the trace of an FP12 + * + @param t FP4 trace of x, on exit = tr(x) + @param x FP12 instance + + */ +extern void FP12_trace(FP4 *t, FP12 *x); + +/** @brief Conditional copy of FP12 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP12 instance, set to y if s!=0 + @param y another FP12 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP12_cmove(FP12 *x, FP12 *y, int s); + + +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BN254CX.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BN254CX.h index f795f5b..bcdb4b8 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BN254CX.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BN254CX.h @@ -1,230 +1,230 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP12_BN254CX_H -#define FP12_BN254CX_H - -#include "fp4_BN254CX.h" - -using namespace core; - -namespace BN254CX { -/** - @brief FP12 Structure - towered over three FP4 -*/ - -typedef struct -{ - FP4 a; /**< first part of FP12 */ - FP4 b; /**< second part of FP12 */ - FP4 c; /**< third part of FP12 */ - int type; -} FP12; - -extern const B256_56::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B256_56::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP12 prototypes */ -/** @brief Tests for FP12 equal to zero - * - @param x FP12 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP12_iszilch(FP12 *x); -/** @brief Tests for FP12 equal to unity - * - @param x FP12 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP12_isunity(FP12 *x); -/** @brief Copy FP12 to another FP12 - * - @param x FP12 instance, on exit = y - @param y FP12 instance to be copied - */ -extern void FP12_copy(FP12 *x, FP12 *y); -/** @brief Set FP12 to unity - * - @param x FP12 instance to be set to one - */ -extern void FP12_one(FP12 *x); - -/** @brief Set FP12 to zero - * - @param x FP12 instance to be set to zero - */ -extern void FP12_zero(FP12 *x); - -/** @brief Tests for equality of two FP12s - * - @param x FP12 instance to be compared - @param y FP12 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP12_equals(FP12 *x, FP12 *y); -/** @brief Conjugation of FP12 - * - If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP12 instance, on exit = conj(y) - @param y FP12 instance - */ -extern void FP12_conj(FP12 *x, FP12 *y); -/** @brief Initialise FP12 from single FP4 - * - Sets first FP4 component of an FP12, other components set to zero - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP4 - */ -extern void FP12_from_FP4(FP12 *x, FP4 *a); -/** @brief Initialise FP12 from three FP4s - * - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP12 - @param b FP4 to form second part of FP12 - @param c FP4 to form third part of FP12 - */ -extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); -/** @brief Fast Squaring of an FP12 in "unitary" form - * - @param x FP12 instance, on exit = y^2 - @param y FP4 instance, must be unitary - */ -extern void FP12_usqr(FP12 *x, FP12 *y); -/** @brief Squaring an FP12 - * - @param x FP12 instance, on exit = y^2 - @param y FP12 instance - */ -extern void FP12_sqr(FP12 *x, FP12 *y); -/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_smul(FP12 *x, FP12 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_ssmul(FP12 *x, FP12 *y); - - -/** @brief Full unconditional Multiplication of two FP12s - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, the multiplier - */ -extern void FP12_mul(FP12 *x, FP12 *y); - -/** @brief Inverting an FP12 - * - @param x FP12 instance, on exit = 1/y - @param y FP12 instance - @param t D_TYPE or M_TYPE twist - */ -extern void FP12_inv(FP12 *x, FP12 *y); -/** @brief Raises an FP12 to the power of a BIG - * - @param r FP12 instance, on exit = y^b - @param x FP12 instance - @param b BIG number - */ -extern void FP12_pow(FP12 *r, FP12 *x, B256_56::BIG b); -/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant - * - @param x FP12 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP12_pinpow(FP12 *x, int i, int b); - -/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 - * - @param c FP4 instance, on exit = x^(e mod r) as FP4 - @param x FP12 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP12_compow(FP4 *c, FP12 *x, B256_56::BIG e, B256_56::BIG r); - -/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant - * - @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] - @param x FP12 array with 4 FP12s - @param b BIG array of 4 exponents - */ -extern void FP12_pow4(FP12 *r, FP12 *x, B256_56::BIG *b); -/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius - * - @param x FP12 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP12_frob(FP12 *x, FP2 *f); -/** @brief Reduces all components of possibly unreduced FP12 mod Modulus - * - @param x FP12 instance, on exit reduced mod Modulus - */ -extern void FP12_reduce(FP12 *x); -/** @brief Normalises the components of an FP12 - * - @param x FP12 instance to be normalised - */ -extern void FP12_norm(FP12 *x); -/** @brief Formats and outputs an FP12 to the console - * - @param x FP12 instance to be printed - */ -extern void FP12_output(FP12 *x); -/** @brief Formats and outputs an FP12 instance to an octet string - * - Serializes the components of an FP12 to big-endian base 256 form. - @param S output octet string - @param x FP12 instance to be converted to an octet string - */ -extern void FP12_toOctet(octet *S, FP12 *x); -/** @brief Creates an FP12 instance from an octet string - * - De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. - @param x FP12 instance to be created from an octet string - @param S input octet string - - */ -extern void FP12_fromOctet(FP12 *x, octet *S); -/** @brief Calculate the trace of an FP12 - * - @param t FP4 trace of x, on exit = tr(x) - @param x FP12 instance - - */ -extern void FP12_trace(FP4 *t, FP12 *x); - -/** @brief Conditional copy of FP12 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP12 instance, set to y if s!=0 - @param y another FP12 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP12_cmove(FP12 *x, FP12 *y, int s); - - -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP12_BN254CX_H +#define FP12_BN254CX_H + +#include "fp4_BN254CX.h" + +using namespace core; + +namespace BN254CX { +/** + @brief FP12 Structure - towered over three FP4 +*/ + +typedef struct +{ + FP4 a; /**< first part of FP12 */ + FP4 b; /**< second part of FP12 */ + FP4 c; /**< third part of FP12 */ + int type; +} FP12; + +extern const B256_56::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B256_56::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP12 prototypes */ +/** @brief Tests for FP12 equal to zero + * + @param x FP12 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP12_iszilch(FP12 *x); +/** @brief Tests for FP12 equal to unity + * + @param x FP12 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP12_isunity(FP12 *x); +/** @brief Copy FP12 to another FP12 + * + @param x FP12 instance, on exit = y + @param y FP12 instance to be copied + */ +extern void FP12_copy(FP12 *x, FP12 *y); +/** @brief Set FP12 to unity + * + @param x FP12 instance to be set to one + */ +extern void FP12_one(FP12 *x); + +/** @brief Set FP12 to zero + * + @param x FP12 instance to be set to zero + */ +extern void FP12_zero(FP12 *x); + +/** @brief Tests for equality of two FP12s + * + @param x FP12 instance to be compared + @param y FP12 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP12_equals(FP12 *x, FP12 *y); +/** @brief Conjugation of FP12 + * + If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP12 instance, on exit = conj(y) + @param y FP12 instance + */ +extern void FP12_conj(FP12 *x, FP12 *y); +/** @brief Initialise FP12 from single FP4 + * + Sets first FP4 component of an FP12, other components set to zero + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP4 + */ +extern void FP12_from_FP4(FP12 *x, FP4 *a); +/** @brief Initialise FP12 from three FP4s + * + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP12 + @param b FP4 to form second part of FP12 + @param c FP4 to form third part of FP12 + */ +extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); +/** @brief Fast Squaring of an FP12 in "unitary" form + * + @param x FP12 instance, on exit = y^2 + @param y FP4 instance, must be unitary + */ +extern void FP12_usqr(FP12 *x, FP12 *y); +/** @brief Squaring an FP12 + * + @param x FP12 instance, on exit = y^2 + @param y FP12 instance + */ +extern void FP12_sqr(FP12 *x, FP12 *y); +/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_smul(FP12 *x, FP12 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_ssmul(FP12 *x, FP12 *y); + + +/** @brief Full unconditional Multiplication of two FP12s + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, the multiplier + */ +extern void FP12_mul(FP12 *x, FP12 *y); + +/** @brief Inverting an FP12 + * + @param x FP12 instance, on exit = 1/y + @param y FP12 instance + @param t D_TYPE or M_TYPE twist + */ +extern void FP12_inv(FP12 *x, FP12 *y); +/** @brief Raises an FP12 to the power of a BIG + * + @param r FP12 instance, on exit = y^b + @param x FP12 instance + @param b BIG number + */ +extern void FP12_pow(FP12 *r, FP12 *x, B256_56::BIG b); +/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant + * + @param x FP12 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP12_pinpow(FP12 *x, int i, int b); + +/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 + * + @param c FP4 instance, on exit = x^(e mod r) as FP4 + @param x FP12 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP12_compow(FP4 *c, FP12 *x, B256_56::BIG e, B256_56::BIG r); + +/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant + * + @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] + @param x FP12 array with 4 FP12s + @param b BIG array of 4 exponents + */ +extern void FP12_pow4(FP12 *r, FP12 *x, B256_56::BIG *b); +/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius + * + @param x FP12 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP12_frob(FP12 *x, FP2 *f); +/** @brief Reduces all components of possibly unreduced FP12 mod Modulus + * + @param x FP12 instance, on exit reduced mod Modulus + */ +extern void FP12_reduce(FP12 *x); +/** @brief Normalises the components of an FP12 + * + @param x FP12 instance to be normalised + */ +extern void FP12_norm(FP12 *x); +/** @brief Formats and outputs an FP12 to the console + * + @param x FP12 instance to be printed + */ +extern void FP12_output(FP12 *x); +/** @brief Formats and outputs an FP12 instance to an octet string + * + Serializes the components of an FP12 to big-endian base 256 form. + @param S output octet string + @param x FP12 instance to be converted to an octet string + */ +extern void FP12_toOctet(octet *S, FP12 *x); +/** @brief Creates an FP12 instance from an octet string + * + De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. + @param x FP12 instance to be created from an octet string + @param S input octet string + + */ +extern void FP12_fromOctet(FP12 *x, octet *S); +/** @brief Calculate the trace of an FP12 + * + @param t FP4 trace of x, on exit = tr(x) + @param x FP12 instance + + */ +extern void FP12_trace(FP4 *t, FP12 *x); + +/** @brief Conditional copy of FP12 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP12 instance, set to y if s!=0 + @param y another FP12 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP12_cmove(FP12 *x, FP12 *y, int s); + + +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BN462.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BN462.h index 4130fc6..2fcd719 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_BN462.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_BN462.h @@ -1,230 +1,230 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP12_BN462_H -#define FP12_BN462_H - -#include "fp4_BN462.h" - -using namespace core; - -namespace BN462 { -/** - @brief FP12 Structure - towered over three FP4 -*/ - -typedef struct -{ - FP4 a; /**< first part of FP12 */ - FP4 b; /**< second part of FP12 */ - FP4 c; /**< third part of FP12 */ - int type; -} FP12; - -extern const B464_60::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B464_60::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP12 prototypes */ -/** @brief Tests for FP12 equal to zero - * - @param x FP12 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP12_iszilch(FP12 *x); -/** @brief Tests for FP12 equal to unity - * - @param x FP12 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP12_isunity(FP12 *x); -/** @brief Copy FP12 to another FP12 - * - @param x FP12 instance, on exit = y - @param y FP12 instance to be copied - */ -extern void FP12_copy(FP12 *x, FP12 *y); -/** @brief Set FP12 to unity - * - @param x FP12 instance to be set to one - */ -extern void FP12_one(FP12 *x); - -/** @brief Set FP12 to zero - * - @param x FP12 instance to be set to zero - */ -extern void FP12_zero(FP12 *x); - -/** @brief Tests for equality of two FP12s - * - @param x FP12 instance to be compared - @param y FP12 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP12_equals(FP12 *x, FP12 *y); -/** @brief Conjugation of FP12 - * - If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP12 instance, on exit = conj(y) - @param y FP12 instance - */ -extern void FP12_conj(FP12 *x, FP12 *y); -/** @brief Initialise FP12 from single FP4 - * - Sets first FP4 component of an FP12, other components set to zero - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP4 - */ -extern void FP12_from_FP4(FP12 *x, FP4 *a); -/** @brief Initialise FP12 from three FP4s - * - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP12 - @param b FP4 to form second part of FP12 - @param c FP4 to form third part of FP12 - */ -extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); -/** @brief Fast Squaring of an FP12 in "unitary" form - * - @param x FP12 instance, on exit = y^2 - @param y FP4 instance, must be unitary - */ -extern void FP12_usqr(FP12 *x, FP12 *y); -/** @brief Squaring an FP12 - * - @param x FP12 instance, on exit = y^2 - @param y FP12 instance - */ -extern void FP12_sqr(FP12 *x, FP12 *y); -/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_smul(FP12 *x, FP12 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_ssmul(FP12 *x, FP12 *y); - - -/** @brief Full unconditional Multiplication of two FP12s - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, the multiplier - */ -extern void FP12_mul(FP12 *x, FP12 *y); - -/** @brief Inverting an FP12 - * - @param x FP12 instance, on exit = 1/y - @param y FP12 instance - @param t D_TYPE or M_TYPE twist - */ -extern void FP12_inv(FP12 *x, FP12 *y); -/** @brief Raises an FP12 to the power of a BIG - * - @param r FP12 instance, on exit = y^b - @param x FP12 instance - @param b BIG number - */ -extern void FP12_pow(FP12 *r, FP12 *x, B464_60::BIG b); -/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant - * - @param x FP12 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP12_pinpow(FP12 *x, int i, int b); - -/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 - * - @param c FP4 instance, on exit = x^(e mod r) as FP4 - @param x FP12 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP12_compow(FP4 *c, FP12 *x, B464_60::BIG e, B464_60::BIG r); - -/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant - * - @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] - @param x FP12 array with 4 FP12s - @param b BIG array of 4 exponents - */ -extern void FP12_pow4(FP12 *r, FP12 *x, B464_60::BIG *b); -/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius - * - @param x FP12 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP12_frob(FP12 *x, FP2 *f); -/** @brief Reduces all components of possibly unreduced FP12 mod Modulus - * - @param x FP12 instance, on exit reduced mod Modulus - */ -extern void FP12_reduce(FP12 *x); -/** @brief Normalises the components of an FP12 - * - @param x FP12 instance to be normalised - */ -extern void FP12_norm(FP12 *x); -/** @brief Formats and outputs an FP12 to the console - * - @param x FP12 instance to be printed - */ -extern void FP12_output(FP12 *x); -/** @brief Formats and outputs an FP12 instance to an octet string - * - Serializes the components of an FP12 to big-endian base 256 form. - @param S output octet string - @param x FP12 instance to be converted to an octet string - */ -extern void FP12_toOctet(octet *S, FP12 *x); -/** @brief Creates an FP12 instance from an octet string - * - De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. - @param x FP12 instance to be created from an octet string - @param S input octet string - - */ -extern void FP12_fromOctet(FP12 *x, octet *S); -/** @brief Calculate the trace of an FP12 - * - @param t FP4 trace of x, on exit = tr(x) - @param x FP12 instance - - */ -extern void FP12_trace(FP4 *t, FP12 *x); - -/** @brief Conditional copy of FP12 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP12 instance, set to y if s!=0 - @param y another FP12 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP12_cmove(FP12 *x, FP12 *y, int s); - - -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP12_BN462_H +#define FP12_BN462_H + +#include "fp4_BN462.h" + +using namespace core; + +namespace BN462 { +/** + @brief FP12 Structure - towered over three FP4 +*/ + +typedef struct +{ + FP4 a; /**< first part of FP12 */ + FP4 b; /**< second part of FP12 */ + FP4 c; /**< third part of FP12 */ + int type; +} FP12; + +extern const B464_60::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B464_60::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP12 prototypes */ +/** @brief Tests for FP12 equal to zero + * + @param x FP12 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP12_iszilch(FP12 *x); +/** @brief Tests for FP12 equal to unity + * + @param x FP12 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP12_isunity(FP12 *x); +/** @brief Copy FP12 to another FP12 + * + @param x FP12 instance, on exit = y + @param y FP12 instance to be copied + */ +extern void FP12_copy(FP12 *x, FP12 *y); +/** @brief Set FP12 to unity + * + @param x FP12 instance to be set to one + */ +extern void FP12_one(FP12 *x); + +/** @brief Set FP12 to zero + * + @param x FP12 instance to be set to zero + */ +extern void FP12_zero(FP12 *x); + +/** @brief Tests for equality of two FP12s + * + @param x FP12 instance to be compared + @param y FP12 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP12_equals(FP12 *x, FP12 *y); +/** @brief Conjugation of FP12 + * + If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP12 instance, on exit = conj(y) + @param y FP12 instance + */ +extern void FP12_conj(FP12 *x, FP12 *y); +/** @brief Initialise FP12 from single FP4 + * + Sets first FP4 component of an FP12, other components set to zero + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP4 + */ +extern void FP12_from_FP4(FP12 *x, FP4 *a); +/** @brief Initialise FP12 from three FP4s + * + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP12 + @param b FP4 to form second part of FP12 + @param c FP4 to form third part of FP12 + */ +extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); +/** @brief Fast Squaring of an FP12 in "unitary" form + * + @param x FP12 instance, on exit = y^2 + @param y FP4 instance, must be unitary + */ +extern void FP12_usqr(FP12 *x, FP12 *y); +/** @brief Squaring an FP12 + * + @param x FP12 instance, on exit = y^2 + @param y FP12 instance + */ +extern void FP12_sqr(FP12 *x, FP12 *y); +/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_smul(FP12 *x, FP12 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_ssmul(FP12 *x, FP12 *y); + + +/** @brief Full unconditional Multiplication of two FP12s + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, the multiplier + */ +extern void FP12_mul(FP12 *x, FP12 *y); + +/** @brief Inverting an FP12 + * + @param x FP12 instance, on exit = 1/y + @param y FP12 instance + @param t D_TYPE or M_TYPE twist + */ +extern void FP12_inv(FP12 *x, FP12 *y); +/** @brief Raises an FP12 to the power of a BIG + * + @param r FP12 instance, on exit = y^b + @param x FP12 instance + @param b BIG number + */ +extern void FP12_pow(FP12 *r, FP12 *x, B464_60::BIG b); +/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant + * + @param x FP12 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP12_pinpow(FP12 *x, int i, int b); + +/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 + * + @param c FP4 instance, on exit = x^(e mod r) as FP4 + @param x FP12 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP12_compow(FP4 *c, FP12 *x, B464_60::BIG e, B464_60::BIG r); + +/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant + * + @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] + @param x FP12 array with 4 FP12s + @param b BIG array of 4 exponents + */ +extern void FP12_pow4(FP12 *r, FP12 *x, B464_60::BIG *b); +/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius + * + @param x FP12 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP12_frob(FP12 *x, FP2 *f); +/** @brief Reduces all components of possibly unreduced FP12 mod Modulus + * + @param x FP12 instance, on exit reduced mod Modulus + */ +extern void FP12_reduce(FP12 *x); +/** @brief Normalises the components of an FP12 + * + @param x FP12 instance to be normalised + */ +extern void FP12_norm(FP12 *x); +/** @brief Formats and outputs an FP12 to the console + * + @param x FP12 instance to be printed + */ +extern void FP12_output(FP12 *x); +/** @brief Formats and outputs an FP12 instance to an octet string + * + Serializes the components of an FP12 to big-endian base 256 form. + @param S output octet string + @param x FP12 instance to be converted to an octet string + */ +extern void FP12_toOctet(octet *S, FP12 *x); +/** @brief Creates an FP12 instance from an octet string + * + De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. + @param x FP12 instance to be created from an octet string + @param S input octet string + + */ +extern void FP12_fromOctet(FP12 *x, octet *S); +/** @brief Calculate the trace of an FP12 + * + @param t FP4 trace of x, on exit = tr(x) + @param x FP12 instance + + */ +extern void FP12_trace(FP4 *t, FP12 *x); + +/** @brief Conditional copy of FP12 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP12 instance, set to y if s!=0 + @param y another FP12 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP12_cmove(FP12 *x, FP12 *y, int s); + + +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_FP256BN.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_FP256BN.h index 621f981..7fb19c8 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_FP256BN.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_FP256BN.h @@ -1,230 +1,230 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP12_FP256BN_H -#define FP12_FP256BN_H - -#include "fp4_FP256BN.h" - -using namespace core; - -namespace FP256BN { -/** - @brief FP12 Structure - towered over three FP4 -*/ - -typedef struct -{ - FP4 a; /**< first part of FP12 */ - FP4 b; /**< second part of FP12 */ - FP4 c; /**< third part of FP12 */ - int type; -} FP12; - -extern const B256_56::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B256_56::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP12 prototypes */ -/** @brief Tests for FP12 equal to zero - * - @param x FP12 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP12_iszilch(FP12 *x); -/** @brief Tests for FP12 equal to unity - * - @param x FP12 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP12_isunity(FP12 *x); -/** @brief Copy FP12 to another FP12 - * - @param x FP12 instance, on exit = y - @param y FP12 instance to be copied - */ -extern void FP12_copy(FP12 *x, FP12 *y); -/** @brief Set FP12 to unity - * - @param x FP12 instance to be set to one - */ -extern void FP12_one(FP12 *x); - -/** @brief Set FP12 to zero - * - @param x FP12 instance to be set to zero - */ -extern void FP12_zero(FP12 *x); - -/** @brief Tests for equality of two FP12s - * - @param x FP12 instance to be compared - @param y FP12 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP12_equals(FP12 *x, FP12 *y); -/** @brief Conjugation of FP12 - * - If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP12 instance, on exit = conj(y) - @param y FP12 instance - */ -extern void FP12_conj(FP12 *x, FP12 *y); -/** @brief Initialise FP12 from single FP4 - * - Sets first FP4 component of an FP12, other components set to zero - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP4 - */ -extern void FP12_from_FP4(FP12 *x, FP4 *a); -/** @brief Initialise FP12 from three FP4s - * - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP12 - @param b FP4 to form second part of FP12 - @param c FP4 to form third part of FP12 - */ -extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); -/** @brief Fast Squaring of an FP12 in "unitary" form - * - @param x FP12 instance, on exit = y^2 - @param y FP4 instance, must be unitary - */ -extern void FP12_usqr(FP12 *x, FP12 *y); -/** @brief Squaring an FP12 - * - @param x FP12 instance, on exit = y^2 - @param y FP12 instance - */ -extern void FP12_sqr(FP12 *x, FP12 *y); -/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_smul(FP12 *x, FP12 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_ssmul(FP12 *x, FP12 *y); - - -/** @brief Full unconditional Multiplication of two FP12s - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, the multiplier - */ -extern void FP12_mul(FP12 *x, FP12 *y); - -/** @brief Inverting an FP12 - * - @param x FP12 instance, on exit = 1/y - @param y FP12 instance - @param t D_TYPE or M_TYPE twist - */ -extern void FP12_inv(FP12 *x, FP12 *y); -/** @brief Raises an FP12 to the power of a BIG - * - @param r FP12 instance, on exit = y^b - @param x FP12 instance - @param b BIG number - */ -extern void FP12_pow(FP12 *r, FP12 *x, B256_56::BIG b); -/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant - * - @param x FP12 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP12_pinpow(FP12 *x, int i, int b); - -/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 - * - @param c FP4 instance, on exit = x^(e mod r) as FP4 - @param x FP12 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP12_compow(FP4 *c, FP12 *x, B256_56::BIG e, B256_56::BIG r); - -/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant - * - @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] - @param x FP12 array with 4 FP12s - @param b BIG array of 4 exponents - */ -extern void FP12_pow4(FP12 *r, FP12 *x, B256_56::BIG *b); -/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius - * - @param x FP12 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP12_frob(FP12 *x, FP2 *f); -/** @brief Reduces all components of possibly unreduced FP12 mod Modulus - * - @param x FP12 instance, on exit reduced mod Modulus - */ -extern void FP12_reduce(FP12 *x); -/** @brief Normalises the components of an FP12 - * - @param x FP12 instance to be normalised - */ -extern void FP12_norm(FP12 *x); -/** @brief Formats and outputs an FP12 to the console - * - @param x FP12 instance to be printed - */ -extern void FP12_output(FP12 *x); -/** @brief Formats and outputs an FP12 instance to an octet string - * - Serializes the components of an FP12 to big-endian base 256 form. - @param S output octet string - @param x FP12 instance to be converted to an octet string - */ -extern void FP12_toOctet(octet *S, FP12 *x); -/** @brief Creates an FP12 instance from an octet string - * - De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. - @param x FP12 instance to be created from an octet string - @param S input octet string - - */ -extern void FP12_fromOctet(FP12 *x, octet *S); -/** @brief Calculate the trace of an FP12 - * - @param t FP4 trace of x, on exit = tr(x) - @param x FP12 instance - - */ -extern void FP12_trace(FP4 *t, FP12 *x); - -/** @brief Conditional copy of FP12 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP12 instance, set to y if s!=0 - @param y another FP12 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP12_cmove(FP12 *x, FP12 *y, int s); - - -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP12_FP256BN_H +#define FP12_FP256BN_H + +#include "fp4_FP256BN.h" + +using namespace core; + +namespace FP256BN { +/** + @brief FP12 Structure - towered over three FP4 +*/ + +typedef struct +{ + FP4 a; /**< first part of FP12 */ + FP4 b; /**< second part of FP12 */ + FP4 c; /**< third part of FP12 */ + int type; +} FP12; + +extern const B256_56::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B256_56::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP12 prototypes */ +/** @brief Tests for FP12 equal to zero + * + @param x FP12 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP12_iszilch(FP12 *x); +/** @brief Tests for FP12 equal to unity + * + @param x FP12 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP12_isunity(FP12 *x); +/** @brief Copy FP12 to another FP12 + * + @param x FP12 instance, on exit = y + @param y FP12 instance to be copied + */ +extern void FP12_copy(FP12 *x, FP12 *y); +/** @brief Set FP12 to unity + * + @param x FP12 instance to be set to one + */ +extern void FP12_one(FP12 *x); + +/** @brief Set FP12 to zero + * + @param x FP12 instance to be set to zero + */ +extern void FP12_zero(FP12 *x); + +/** @brief Tests for equality of two FP12s + * + @param x FP12 instance to be compared + @param y FP12 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP12_equals(FP12 *x, FP12 *y); +/** @brief Conjugation of FP12 + * + If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP12 instance, on exit = conj(y) + @param y FP12 instance + */ +extern void FP12_conj(FP12 *x, FP12 *y); +/** @brief Initialise FP12 from single FP4 + * + Sets first FP4 component of an FP12, other components set to zero + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP4 + */ +extern void FP12_from_FP4(FP12 *x, FP4 *a); +/** @brief Initialise FP12 from three FP4s + * + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP12 + @param b FP4 to form second part of FP12 + @param c FP4 to form third part of FP12 + */ +extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); +/** @brief Fast Squaring of an FP12 in "unitary" form + * + @param x FP12 instance, on exit = y^2 + @param y FP4 instance, must be unitary + */ +extern void FP12_usqr(FP12 *x, FP12 *y); +/** @brief Squaring an FP12 + * + @param x FP12 instance, on exit = y^2 + @param y FP12 instance + */ +extern void FP12_sqr(FP12 *x, FP12 *y); +/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_smul(FP12 *x, FP12 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_ssmul(FP12 *x, FP12 *y); + + +/** @brief Full unconditional Multiplication of two FP12s + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, the multiplier + */ +extern void FP12_mul(FP12 *x, FP12 *y); + +/** @brief Inverting an FP12 + * + @param x FP12 instance, on exit = 1/y + @param y FP12 instance + @param t D_TYPE or M_TYPE twist + */ +extern void FP12_inv(FP12 *x, FP12 *y); +/** @brief Raises an FP12 to the power of a BIG + * + @param r FP12 instance, on exit = y^b + @param x FP12 instance + @param b BIG number + */ +extern void FP12_pow(FP12 *r, FP12 *x, B256_56::BIG b); +/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant + * + @param x FP12 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP12_pinpow(FP12 *x, int i, int b); + +/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 + * + @param c FP4 instance, on exit = x^(e mod r) as FP4 + @param x FP12 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP12_compow(FP4 *c, FP12 *x, B256_56::BIG e, B256_56::BIG r); + +/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant + * + @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] + @param x FP12 array with 4 FP12s + @param b BIG array of 4 exponents + */ +extern void FP12_pow4(FP12 *r, FP12 *x, B256_56::BIG *b); +/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius + * + @param x FP12 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP12_frob(FP12 *x, FP2 *f); +/** @brief Reduces all components of possibly unreduced FP12 mod Modulus + * + @param x FP12 instance, on exit reduced mod Modulus + */ +extern void FP12_reduce(FP12 *x); +/** @brief Normalises the components of an FP12 + * + @param x FP12 instance to be normalised + */ +extern void FP12_norm(FP12 *x); +/** @brief Formats and outputs an FP12 to the console + * + @param x FP12 instance to be printed + */ +extern void FP12_output(FP12 *x); +/** @brief Formats and outputs an FP12 instance to an octet string + * + Serializes the components of an FP12 to big-endian base 256 form. + @param S output octet string + @param x FP12 instance to be converted to an octet string + */ +extern void FP12_toOctet(octet *S, FP12 *x); +/** @brief Creates an FP12 instance from an octet string + * + De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. + @param x FP12 instance to be created from an octet string + @param S input octet string + + */ +extern void FP12_fromOctet(FP12 *x, octet *S); +/** @brief Calculate the trace of an FP12 + * + @param t FP4 trace of x, on exit = tr(x) + @param x FP12 instance + + */ +extern void FP12_trace(FP4 *t, FP12 *x); + +/** @brief Conditional copy of FP12 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP12 instance, set to y if s!=0 + @param y another FP12 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP12_cmove(FP12 *x, FP12 *y, int s); + + +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_FP512BN.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_FP512BN.h index 30c0522..2fc1921 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12_FP512BN.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp12_FP512BN.h @@ -1,230 +1,230 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP12_FP512BN_H -#define FP12_FP512BN_H - -#include "fp4_FP512BN.h" - -using namespace core; - -namespace FP512BN { -/** - @brief FP12 Structure - towered over three FP4 -*/ - -typedef struct -{ - FP4 a; /**< first part of FP12 */ - FP4 b; /**< second part of FP12 */ - FP4 c; /**< third part of FP12 */ - int type; -} FP12; - -extern const B512_60::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B512_60::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP12 prototypes */ -/** @brief Tests for FP12 equal to zero - * - @param x FP12 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP12_iszilch(FP12 *x); -/** @brief Tests for FP12 equal to unity - * - @param x FP12 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP12_isunity(FP12 *x); -/** @brief Copy FP12 to another FP12 - * - @param x FP12 instance, on exit = y - @param y FP12 instance to be copied - */ -extern void FP12_copy(FP12 *x, FP12 *y); -/** @brief Set FP12 to unity - * - @param x FP12 instance to be set to one - */ -extern void FP12_one(FP12 *x); - -/** @brief Set FP12 to zero - * - @param x FP12 instance to be set to zero - */ -extern void FP12_zero(FP12 *x); - -/** @brief Tests for equality of two FP12s - * - @param x FP12 instance to be compared - @param y FP12 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP12_equals(FP12 *x, FP12 *y); -/** @brief Conjugation of FP12 - * - If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP12 instance, on exit = conj(y) - @param y FP12 instance - */ -extern void FP12_conj(FP12 *x, FP12 *y); -/** @brief Initialise FP12 from single FP4 - * - Sets first FP4 component of an FP12, other components set to zero - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP4 - */ -extern void FP12_from_FP4(FP12 *x, FP4 *a); -/** @brief Initialise FP12 from three FP4s - * - @param x FP12 instance to be initialised - @param a FP4 to form first part of FP12 - @param b FP4 to form second part of FP12 - @param c FP4 to form third part of FP12 - */ -extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); -/** @brief Fast Squaring of an FP12 in "unitary" form - * - @param x FP12 instance, on exit = y^2 - @param y FP4 instance, must be unitary - */ -extern void FP12_usqr(FP12 *x, FP12 *y); -/** @brief Squaring an FP12 - * - @param x FP12 instance, on exit = y^2 - @param y FP12 instance - */ -extern void FP12_sqr(FP12 *x, FP12 *y); -/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_smul(FP12 *x, FP12 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, of special form - */ -extern void FP12_ssmul(FP12 *x, FP12 *y); - - -/** @brief Full unconditional Multiplication of two FP12s - * - @param x FP12 instance, on exit = x*y - @param y FP12 instance, the multiplier - */ -extern void FP12_mul(FP12 *x, FP12 *y); - -/** @brief Inverting an FP12 - * - @param x FP12 instance, on exit = 1/y - @param y FP12 instance - @param t D_TYPE or M_TYPE twist - */ -extern void FP12_inv(FP12 *x, FP12 *y); -/** @brief Raises an FP12 to the power of a BIG - * - @param r FP12 instance, on exit = y^b - @param x FP12 instance - @param b BIG number - */ -extern void FP12_pow(FP12 *r, FP12 *x, B512_60::BIG b); -/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant - * - @param x FP12 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP12_pinpow(FP12 *x, int i, int b); - -/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 - * - @param c FP4 instance, on exit = x^(e mod r) as FP4 - @param x FP12 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP12_compow(FP4 *c, FP12 *x, B512_60::BIG e, B512_60::BIG r); - -/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant - * - @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] - @param x FP12 array with 4 FP12s - @param b BIG array of 4 exponents - */ -extern void FP12_pow4(FP12 *r, FP12 *x, B512_60::BIG *b); -/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius - * - @param x FP12 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP12_frob(FP12 *x, FP2 *f); -/** @brief Reduces all components of possibly unreduced FP12 mod Modulus - * - @param x FP12 instance, on exit reduced mod Modulus - */ -extern void FP12_reduce(FP12 *x); -/** @brief Normalises the components of an FP12 - * - @param x FP12 instance to be normalised - */ -extern void FP12_norm(FP12 *x); -/** @brief Formats and outputs an FP12 to the console - * - @param x FP12 instance to be printed - */ -extern void FP12_output(FP12 *x); -/** @brief Formats and outputs an FP12 instance to an octet string - * - Serializes the components of an FP12 to big-endian base 256 form. - @param S output octet string - @param x FP12 instance to be converted to an octet string - */ -extern void FP12_toOctet(octet *S, FP12 *x); -/** @brief Creates an FP12 instance from an octet string - * - De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. - @param x FP12 instance to be created from an octet string - @param S input octet string - - */ -extern void FP12_fromOctet(FP12 *x, octet *S); -/** @brief Calculate the trace of an FP12 - * - @param t FP4 trace of x, on exit = tr(x) - @param x FP12 instance - - */ -extern void FP12_trace(FP4 *t, FP12 *x); - -/** @brief Conditional copy of FP12 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP12 instance, set to y if s!=0 - @param y another FP12 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP12_cmove(FP12 *x, FP12 *y, int s); - - -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP12_FP512BN_H +#define FP12_FP512BN_H + +#include "fp4_FP512BN.h" + +using namespace core; + +namespace FP512BN { +/** + @brief FP12 Structure - towered over three FP4 +*/ + +typedef struct +{ + FP4 a; /**< first part of FP12 */ + FP4 b; /**< second part of FP12 */ + FP4 c; /**< third part of FP12 */ + int type; +} FP12; + +extern const B512_60::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B512_60::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP12 prototypes */ +/** @brief Tests for FP12 equal to zero + * + @param x FP12 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP12_iszilch(FP12 *x); +/** @brief Tests for FP12 equal to unity + * + @param x FP12 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP12_isunity(FP12 *x); +/** @brief Copy FP12 to another FP12 + * + @param x FP12 instance, on exit = y + @param y FP12 instance to be copied + */ +extern void FP12_copy(FP12 *x, FP12 *y); +/** @brief Set FP12 to unity + * + @param x FP12 instance to be set to one + */ +extern void FP12_one(FP12 *x); + +/** @brief Set FP12 to zero + * + @param x FP12 instance to be set to zero + */ +extern void FP12_zero(FP12 *x); + +/** @brief Tests for equality of two FP12s + * + @param x FP12 instance to be compared + @param y FP12 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP12_equals(FP12 *x, FP12 *y); +/** @brief Conjugation of FP12 + * + If y=(a,b,c) (where a,b,c are its three FP4 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP12 instance, on exit = conj(y) + @param y FP12 instance + */ +extern void FP12_conj(FP12 *x, FP12 *y); +/** @brief Initialise FP12 from single FP4 + * + Sets first FP4 component of an FP12, other components set to zero + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP4 + */ +extern void FP12_from_FP4(FP12 *x, FP4 *a); +/** @brief Initialise FP12 from three FP4s + * + @param x FP12 instance to be initialised + @param a FP4 to form first part of FP12 + @param b FP4 to form second part of FP12 + @param c FP4 to form third part of FP12 + */ +extern void FP12_from_FP4s(FP12 *x, FP4 *a, FP4* b, FP4 *c); +/** @brief Fast Squaring of an FP12 in "unitary" form + * + @param x FP12 instance, on exit = y^2 + @param y FP4 instance, must be unitary + */ +extern void FP12_usqr(FP12 *x, FP12 *y); +/** @brief Squaring an FP12 + * + @param x FP12 instance, on exit = y^2 + @param y FP12 instance + */ +extern void FP12_sqr(FP12 *x, FP12 *y); +/** @brief Fast multiplication of two sparse FP12s that arises from ATE pairing line functions + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_smul(FP12 *x, FP12 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, of special form + */ +extern void FP12_ssmul(FP12 *x, FP12 *y); + + +/** @brief Full unconditional Multiplication of two FP12s + * + @param x FP12 instance, on exit = x*y + @param y FP12 instance, the multiplier + */ +extern void FP12_mul(FP12 *x, FP12 *y); + +/** @brief Inverting an FP12 + * + @param x FP12 instance, on exit = 1/y + @param y FP12 instance + @param t D_TYPE or M_TYPE twist + */ +extern void FP12_inv(FP12 *x, FP12 *y); +/** @brief Raises an FP12 to the power of a BIG + * + @param r FP12 instance, on exit = y^b + @param x FP12 instance + @param b BIG number + */ +extern void FP12_pow(FP12 *r, FP12 *x, B512_60::BIG b); +/** @brief Raises an FP12 instance x to a small integer power, side-channel resistant + * + @param x FP12 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP12_pinpow(FP12 *x, int i, int b); + +/** @brief Raises an FP12 instance x to a BIG power, compressed to FP4 + * + @param c FP4 instance, on exit = x^(e mod r) as FP4 + @param x FP12 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP12_compow(FP4 *c, FP12 *x, B512_60::BIG e, B512_60::BIG r); + +/** @brief Calculate x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3], side-channel resistant + * + @param r FP12 instance, on exit = x[0]^b[0].x[1]^b[1].x[2]^b[2].x[3]^b[3] + @param x FP12 array with 4 FP12s + @param b BIG array of 4 exponents + */ +extern void FP12_pow4(FP12 *r, FP12 *x, B512_60::BIG *b); +/** @brief Raises an FP12 to the power of the internal modulus p, using the Frobenius + * + @param x FP12 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP12_frob(FP12 *x, FP2 *f); +/** @brief Reduces all components of possibly unreduced FP12 mod Modulus + * + @param x FP12 instance, on exit reduced mod Modulus + */ +extern void FP12_reduce(FP12 *x); +/** @brief Normalises the components of an FP12 + * + @param x FP12 instance to be normalised + */ +extern void FP12_norm(FP12 *x); +/** @brief Formats and outputs an FP12 to the console + * + @param x FP12 instance to be printed + */ +extern void FP12_output(FP12 *x); +/** @brief Formats and outputs an FP12 instance to an octet string + * + Serializes the components of an FP12 to big-endian base 256 form. + @param S output octet string + @param x FP12 instance to be converted to an octet string + */ +extern void FP12_toOctet(octet *S, FP12 *x); +/** @brief Creates an FP12 instance from an octet string + * + De-serializes the components of an FP12 to create an FP12 from big-endian base 256 components. + @param x FP12 instance to be created from an octet string + @param S input octet string + + */ +extern void FP12_fromOctet(FP12 *x, octet *S); +/** @brief Calculate the trace of an FP12 + * + @param t FP4 trace of x, on exit = tr(x) + @param x FP12 instance + + */ +extern void FP12_trace(FP4 *t, FP12 *x); + +/** @brief Conditional copy of FP12 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP12 instance, set to y if s!=0 + @param y another FP12 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP12_cmove(FP12 *x, FP12 *y, int s); + + +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp16.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp16.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp16.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp16.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp16_BLS48286.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp16_BLS48286.h index 36a9cb9..13fcccb 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16_BLS48286.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp16_BLS48286.h @@ -1,308 +1,308 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP16_BLS48286_H -#define FP16_BLS48286_H - -#include "fp8_BLS48286.h" -#include "config_curve_BLS48286.h" - -using namespace core; - -namespace BLS48286 { - -/** - @brief FP16 Structure - towered over two FP4 -*/ - -typedef struct -{ - FP8 a; /**< real part of FP16 */ - FP8 b; /**< imaginary part of FP16 */ -} FP16; - - -/* FP16 prototypes */ -/** @brief Tests for FP16 equal to zero - * - @param x FP16 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP16_iszilch(FP16 *x); -/** @brief Tests for FP16 equal to unity - * - @param x FP16 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP16_isunity(FP16 *x); -/** @brief Tests for equality of two FP16s - * - @param x FP16 instance to be compared - @param y FP16 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP16_equals(FP16 *x, FP16 *y); - -/** @brief Serialize in FP16 - * - @param b buffer for output - @param x FP16 number to be serialized - */ -extern void FP16_toBytes(char *b,FP16 *x); -/** @brief Serialize out FP16 - * - @param x FP16 number to be serialized - @param b buffer for input - */ -extern void FP16_fromBytes(FP16 *x,char *b); - -/** @brief Tests for FP16 having only a real part and no imaginary part - * - @param x FP16 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP16_isreal(FP16 *x); -/** @brief Initialise FP16 from two FP8s - * - @param x FP16 instance to be initialised - @param a FP8 to form real part of FP16 - @param b FP8 to form imaginary part of FP16 - */ -extern void FP16_from_FP8s(FP16 *x, FP8 *a, FP8 *b); -/** @brief Initialise FP16 from single FP8 - * - Imaginary part is set to zero - @param x FP16 instance to be initialised - @param a FP8 to form real part of FP16 - */ -extern void FP16_from_FP8(FP16 *x, FP8 *a); - -/** @brief Initialise FP16 from single FP8 - * - real part is set to zero - @param x FP16 instance to be initialised - @param a FP8 to form imaginary part of FP16 - */ -extern void FP16_from_FP8H(FP16 *x, FP8 *a); - - -/** @brief Copy FP16 to another FP16 - * - @param x FP16 instance, on exit = y - @param y FP16 instance to be copied - */ -extern void FP16_copy(FP16 *x, FP16 *y); -/** @brief Set FP16 to zero - * - @param x FP16 instance to be set to zero - */ -extern void FP16_zero(FP16 *x); -/** @brief Set FP16 to unity - * - @param x FP16 instance to be set to one - */ -extern void FP16_one(FP16 *x); -/** @brief Negation of FP16 - * - @param x FP16 instance, on exit = -y - @param y FP16 instance - */ -extern void FP16_neg(FP16 *x, FP16 *y); -/** @brief Conjugation of FP16 - * - If y=(a,b) on exit x=(a,-b) - @param x FP16 instance, on exit = conj(y) - @param y FP16 instance - */ -extern void FP16_conj(FP16 *x, FP16 *y); -/** @brief Negative conjugation of FP16 - * - If y=(a,b) on exit x=(-a,b) - @param x FP16 instance, on exit = -conj(y) - @param y FP16 instance - */ -extern void FP16_nconj(FP16 *x, FP16 *y); -/** @brief addition of two FP16s - * - @param x FP16 instance, on exit = y+z - @param y FP16 instance - @param z FP16 instance - */ -extern void FP16_add(FP16 *x, FP16 *y, FP16 *z); -/** @brief subtraction of two FP16s - * - @param x FP16 instance, on exit = y-z - @param y FP16 instance - @param z FP16 instance - */ -extern void FP16_sub(FP16 *x, FP16 *y, FP16 *z); -/** @brief Multiplication of an FP16 by an FP8 - * - @param x FP16 instance, on exit = y*a - @param y FP16 instance - @param a FP4 multiplier - */ -extern void FP16_pmul(FP16 *x, FP16 *y, FP8 *a); - -/** @brief Multiplication of an FP16 by an FP2 - * - @param x FP16 instance, on exit = y*a - @param y FP16 instance - @param a FP2 multiplier - */ -extern void FP16_qmul(FP16 *x, FP16 *y, FP2 *a); - - -/** @brief Multiplication of an FP16 by an FP - * - @param x FP16 instance, on exit = y*a - @param y FP16 instance - @param a FP multiplier - */ -extern void FP16_tmul(FP16 *x, FP16 *y, FP *a); - - - -/** @brief Multiplication of an FP16 by a small integer - * - @param x FP16 instance, on exit = y*i - @param y FP16 instance - @param i an integer - */ -extern void FP16_imul(FP16 *x, FP16 *y, int i); -/** @brief Squaring an FP16 - * - @param x FP16 instance, on exit = y^2 - @param y FP16 instance - */ -extern void FP16_sqr(FP16 *x, FP16 *y); -/** @brief Multiplication of two FP16s - * - @param x FP16 instance, on exit = y*z - @param y FP16 instance - @param z FP16 instance - */ -extern void FP16_mul(FP16 *x, FP16 *y, FP16 *z); -/** @brief Inverting an FP16 - * - @param x FP16 instance, on exit = 1/y - @param y FP16 instance - */ -extern void FP16_inv(FP16 *x, FP16 *y); -/** @brief Formats and outputs an FP16 to the console - * - @param x FP16 instance to be printed - */ -extern void FP16_output(FP16 *x); -/** @brief Formats and outputs an FP16 to the console in raw form (for debugging) - * - @param x FP16 instance to be printed - */ -extern void FP16_rawoutput(FP16 *x); -/** @brief multiplies an FP16 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP16 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP16_times_i(FP16 *x); -/** @brief multiplies an FP16 instance by irreducible polynomial (1+sqrt(-1)) - * - @param x FP16 instance, on exit = sqrt(1+sqrt(-1))^2*x - */ -extern void FP16_times_i2(FP16 *x); - -/** @brief multiplies an FP16 instance by irreducible polynomial (1+sqrt(-1)) - * - @param x FP16 instance, on exit = sqrt(1+sqrt(-1))^4*x - */ -extern void FP16_times_i4(FP16 *x); - - -/** @brief Normalises the components of an FP16 - * - @param x FP16 instance to be normalised - */ -extern void FP16_norm(FP16 *x); -/** @brief Reduces all components of possibly unreduced FP16 mod Modulus - * - @param x FP16 instance, on exit reduced mod Modulus - */ -extern void FP16_reduce(FP16 *x); -/** @brief Raises an FP16 to the power of a BIG - * - @param x FP16 instance, on exit = y^b - @param y FP16 instance - @param b BIG number - */ -extern void FP16_pow(FP16 *x, FP16 *y, B288_60::BIG b); -/** @brief Raises an FP16 to the power of the internal modulus p, using the Frobenius - * - @param x FP16 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP16_frob(FP16 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP16 instance, on exit = w*x-conj(x)*y+z - @param w FP16 instance - @param x FP16 instance - @param y FP16 instance - @param z FP16 instance - */ -extern void FP16_xtr_A(FP16 *r, FP16 *w, FP16 *x, FP16 *y, FP16 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP16 instance, on exit = x^2-2*conj(x) - @param x FP16 instance - */ -extern void FP16_xtr_D(FP16 *r, FP16 *x); -/** @brief Calculates FP16 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP16 instance, on exit = trace(w^b) - @param x FP16 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP16_xtr_pow(FP16 *r, FP16 *x, B288_60::BIG b); -/** @brief Calculates FP16 trace of c^a.d^b, where c and d are derived from FP16 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP16 instance, on exit = trace(c^a.d^b) - @param c FP16 instance, trace of an FP12 - @param d FP16 instance, trace of an FP12 - @param e FP16 instance, trace of an FP12 - @param f FP16 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP16_xtr_pow2(FP16 *r, FP16 *c, FP16 *d, FP16 *e, FP16 *f, B288_60::BIG a, B288_60::BIG b); - -/** @brief Conditional copy of FP16 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP16 instance, set to y if s!=0 - @param y another FP16 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP16_cmove(FP16 *x, FP16 *y, int s); - -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP16_BLS48286_H +#define FP16_BLS48286_H + +#include "fp8_BLS48286.h" +#include "config_curve_BLS48286.h" + +using namespace core; + +namespace BLS48286 { + +/** + @brief FP16 Structure - towered over two FP4 +*/ + +typedef struct +{ + FP8 a; /**< real part of FP16 */ + FP8 b; /**< imaginary part of FP16 */ +} FP16; + + +/* FP16 prototypes */ +/** @brief Tests for FP16 equal to zero + * + @param x FP16 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP16_iszilch(FP16 *x); +/** @brief Tests for FP16 equal to unity + * + @param x FP16 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP16_isunity(FP16 *x); +/** @brief Tests for equality of two FP16s + * + @param x FP16 instance to be compared + @param y FP16 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP16_equals(FP16 *x, FP16 *y); + +/** @brief Serialize in FP16 + * + @param b buffer for output + @param x FP16 number to be serialized + */ +extern void FP16_toBytes(char *b,FP16 *x); +/** @brief Serialize out FP16 + * + @param x FP16 number to be serialized + @param b buffer for input + */ +extern void FP16_fromBytes(FP16 *x,char *b); + +/** @brief Tests for FP16 having only a real part and no imaginary part + * + @param x FP16 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP16_isreal(FP16 *x); +/** @brief Initialise FP16 from two FP8s + * + @param x FP16 instance to be initialised + @param a FP8 to form real part of FP16 + @param b FP8 to form imaginary part of FP16 + */ +extern void FP16_from_FP8s(FP16 *x, FP8 *a, FP8 *b); +/** @brief Initialise FP16 from single FP8 + * + Imaginary part is set to zero + @param x FP16 instance to be initialised + @param a FP8 to form real part of FP16 + */ +extern void FP16_from_FP8(FP16 *x, FP8 *a); + +/** @brief Initialise FP16 from single FP8 + * + real part is set to zero + @param x FP16 instance to be initialised + @param a FP8 to form imaginary part of FP16 + */ +extern void FP16_from_FP8H(FP16 *x, FP8 *a); + + +/** @brief Copy FP16 to another FP16 + * + @param x FP16 instance, on exit = y + @param y FP16 instance to be copied + */ +extern void FP16_copy(FP16 *x, FP16 *y); +/** @brief Set FP16 to zero + * + @param x FP16 instance to be set to zero + */ +extern void FP16_zero(FP16 *x); +/** @brief Set FP16 to unity + * + @param x FP16 instance to be set to one + */ +extern void FP16_one(FP16 *x); +/** @brief Negation of FP16 + * + @param x FP16 instance, on exit = -y + @param y FP16 instance + */ +extern void FP16_neg(FP16 *x, FP16 *y); +/** @brief Conjugation of FP16 + * + If y=(a,b) on exit x=(a,-b) + @param x FP16 instance, on exit = conj(y) + @param y FP16 instance + */ +extern void FP16_conj(FP16 *x, FP16 *y); +/** @brief Negative conjugation of FP16 + * + If y=(a,b) on exit x=(-a,b) + @param x FP16 instance, on exit = -conj(y) + @param y FP16 instance + */ +extern void FP16_nconj(FP16 *x, FP16 *y); +/** @brief addition of two FP16s + * + @param x FP16 instance, on exit = y+z + @param y FP16 instance + @param z FP16 instance + */ +extern void FP16_add(FP16 *x, FP16 *y, FP16 *z); +/** @brief subtraction of two FP16s + * + @param x FP16 instance, on exit = y-z + @param y FP16 instance + @param z FP16 instance + */ +extern void FP16_sub(FP16 *x, FP16 *y, FP16 *z); +/** @brief Multiplication of an FP16 by an FP8 + * + @param x FP16 instance, on exit = y*a + @param y FP16 instance + @param a FP4 multiplier + */ +extern void FP16_pmul(FP16 *x, FP16 *y, FP8 *a); + +/** @brief Multiplication of an FP16 by an FP2 + * + @param x FP16 instance, on exit = y*a + @param y FP16 instance + @param a FP2 multiplier + */ +extern void FP16_qmul(FP16 *x, FP16 *y, FP2 *a); + + +/** @brief Multiplication of an FP16 by an FP + * + @param x FP16 instance, on exit = y*a + @param y FP16 instance + @param a FP multiplier + */ +extern void FP16_tmul(FP16 *x, FP16 *y, FP *a); + + + +/** @brief Multiplication of an FP16 by a small integer + * + @param x FP16 instance, on exit = y*i + @param y FP16 instance + @param i an integer + */ +extern void FP16_imul(FP16 *x, FP16 *y, int i); +/** @brief Squaring an FP16 + * + @param x FP16 instance, on exit = y^2 + @param y FP16 instance + */ +extern void FP16_sqr(FP16 *x, FP16 *y); +/** @brief Multiplication of two FP16s + * + @param x FP16 instance, on exit = y*z + @param y FP16 instance + @param z FP16 instance + */ +extern void FP16_mul(FP16 *x, FP16 *y, FP16 *z); +/** @brief Inverting an FP16 + * + @param x FP16 instance, on exit = 1/y + @param y FP16 instance + */ +extern void FP16_inv(FP16 *x, FP16 *y); +/** @brief Formats and outputs an FP16 to the console + * + @param x FP16 instance to be printed + */ +extern void FP16_output(FP16 *x); +/** @brief Formats and outputs an FP16 to the console in raw form (for debugging) + * + @param x FP16 instance to be printed + */ +extern void FP16_rawoutput(FP16 *x); +/** @brief multiplies an FP16 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP16 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP16_times_i(FP16 *x); +/** @brief multiplies an FP16 instance by irreducible polynomial (1+sqrt(-1)) + * + @param x FP16 instance, on exit = sqrt(1+sqrt(-1))^2*x + */ +extern void FP16_times_i2(FP16 *x); + +/** @brief multiplies an FP16 instance by irreducible polynomial (1+sqrt(-1)) + * + @param x FP16 instance, on exit = sqrt(1+sqrt(-1))^4*x + */ +extern void FP16_times_i4(FP16 *x); + + +/** @brief Normalises the components of an FP16 + * + @param x FP16 instance to be normalised + */ +extern void FP16_norm(FP16 *x); +/** @brief Reduces all components of possibly unreduced FP16 mod Modulus + * + @param x FP16 instance, on exit reduced mod Modulus + */ +extern void FP16_reduce(FP16 *x); +/** @brief Raises an FP16 to the power of a BIG + * + @param x FP16 instance, on exit = y^b + @param y FP16 instance + @param b BIG number + */ +extern void FP16_pow(FP16 *x, FP16 *y, B288_60::BIG b); +/** @brief Raises an FP16 to the power of the internal modulus p, using the Frobenius + * + @param x FP16 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP16_frob(FP16 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP16 instance, on exit = w*x-conj(x)*y+z + @param w FP16 instance + @param x FP16 instance + @param y FP16 instance + @param z FP16 instance + */ +extern void FP16_xtr_A(FP16 *r, FP16 *w, FP16 *x, FP16 *y, FP16 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP16 instance, on exit = x^2-2*conj(x) + @param x FP16 instance + */ +extern void FP16_xtr_D(FP16 *r, FP16 *x); +/** @brief Calculates FP16 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP16 instance, on exit = trace(w^b) + @param x FP16 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP16_xtr_pow(FP16 *r, FP16 *x, B288_60::BIG b); +/** @brief Calculates FP16 trace of c^a.d^b, where c and d are derived from FP16 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP16 instance, on exit = trace(c^a.d^b) + @param c FP16 instance, trace of an FP12 + @param d FP16 instance, trace of an FP12 + @param e FP16 instance, trace of an FP12 + @param f FP16 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP16_xtr_pow2(FP16 *r, FP16 *c, FP16 *d, FP16 *e, FP16 *f, B288_60::BIG a, B288_60::BIG b); + +/** @brief Conditional copy of FP16 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP16 instance, set to y if s!=0 + @param y another FP16 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP16_cmove(FP16 *x, FP16 *y, int s); + +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp16_BLS48556.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp16_BLS48556.h index e3811dc..7fde212 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16_BLS48556.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp16_BLS48556.h @@ -1,308 +1,308 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP16_BLS48556_H -#define FP16_BLS48556_H - -#include "fp8_BLS48556.h" -#include "config_curve_BLS48556.h" - -using namespace core; - -namespace BLS48556 { - -/** - @brief FP16 Structure - towered over two FP4 -*/ - -typedef struct -{ - FP8 a; /**< real part of FP16 */ - FP8 b; /**< imaginary part of FP16 */ -} FP16; - - -/* FP16 prototypes */ -/** @brief Tests for FP16 equal to zero - * - @param x FP16 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP16_iszilch(FP16 *x); -/** @brief Tests for FP16 equal to unity - * - @param x FP16 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP16_isunity(FP16 *x); -/** @brief Tests for equality of two FP16s - * - @param x FP16 instance to be compared - @param y FP16 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP16_equals(FP16 *x, FP16 *y); - -/** @brief Serialize in FP16 - * - @param b buffer for output - @param x FP16 number to be serialized - */ -extern void FP16_toBytes(char *b,FP16 *x); -/** @brief Serialize out FP16 - * - @param x FP16 number to be serialized - @param b buffer for input - */ -extern void FP16_fromBytes(FP16 *x,char *b); - -/** @brief Tests for FP16 having only a real part and no imaginary part - * - @param x FP16 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP16_isreal(FP16 *x); -/** @brief Initialise FP16 from two FP8s - * - @param x FP16 instance to be initialised - @param a FP8 to form real part of FP16 - @param b FP8 to form imaginary part of FP16 - */ -extern void FP16_from_FP8s(FP16 *x, FP8 *a, FP8 *b); -/** @brief Initialise FP16 from single FP8 - * - Imaginary part is set to zero - @param x FP16 instance to be initialised - @param a FP8 to form real part of FP16 - */ -extern void FP16_from_FP8(FP16 *x, FP8 *a); - -/** @brief Initialise FP16 from single FP8 - * - real part is set to zero - @param x FP16 instance to be initialised - @param a FP8 to form imaginary part of FP16 - */ -extern void FP16_from_FP8H(FP16 *x, FP8 *a); - - -/** @brief Copy FP16 to another FP16 - * - @param x FP16 instance, on exit = y - @param y FP16 instance to be copied - */ -extern void FP16_copy(FP16 *x, FP16 *y); -/** @brief Set FP16 to zero - * - @param x FP16 instance to be set to zero - */ -extern void FP16_zero(FP16 *x); -/** @brief Set FP16 to unity - * - @param x FP16 instance to be set to one - */ -extern void FP16_one(FP16 *x); -/** @brief Negation of FP16 - * - @param x FP16 instance, on exit = -y - @param y FP16 instance - */ -extern void FP16_neg(FP16 *x, FP16 *y); -/** @brief Conjugation of FP16 - * - If y=(a,b) on exit x=(a,-b) - @param x FP16 instance, on exit = conj(y) - @param y FP16 instance - */ -extern void FP16_conj(FP16 *x, FP16 *y); -/** @brief Negative conjugation of FP16 - * - If y=(a,b) on exit x=(-a,b) - @param x FP16 instance, on exit = -conj(y) - @param y FP16 instance - */ -extern void FP16_nconj(FP16 *x, FP16 *y); -/** @brief addition of two FP16s - * - @param x FP16 instance, on exit = y+z - @param y FP16 instance - @param z FP16 instance - */ -extern void FP16_add(FP16 *x, FP16 *y, FP16 *z); -/** @brief subtraction of two FP16s - * - @param x FP16 instance, on exit = y-z - @param y FP16 instance - @param z FP16 instance - */ -extern void FP16_sub(FP16 *x, FP16 *y, FP16 *z); -/** @brief Multiplication of an FP16 by an FP8 - * - @param x FP16 instance, on exit = y*a - @param y FP16 instance - @param a FP4 multiplier - */ -extern void FP16_pmul(FP16 *x, FP16 *y, FP8 *a); - -/** @brief Multiplication of an FP16 by an FP2 - * - @param x FP16 instance, on exit = y*a - @param y FP16 instance - @param a FP2 multiplier - */ -extern void FP16_qmul(FP16 *x, FP16 *y, FP2 *a); - - -/** @brief Multiplication of an FP16 by an FP - * - @param x FP16 instance, on exit = y*a - @param y FP16 instance - @param a FP multiplier - */ -extern void FP16_tmul(FP16 *x, FP16 *y, FP *a); - - - -/** @brief Multiplication of an FP16 by a small integer - * - @param x FP16 instance, on exit = y*i - @param y FP16 instance - @param i an integer - */ -extern void FP16_imul(FP16 *x, FP16 *y, int i); -/** @brief Squaring an FP16 - * - @param x FP16 instance, on exit = y^2 - @param y FP16 instance - */ -extern void FP16_sqr(FP16 *x, FP16 *y); -/** @brief Multiplication of two FP16s - * - @param x FP16 instance, on exit = y*z - @param y FP16 instance - @param z FP16 instance - */ -extern void FP16_mul(FP16 *x, FP16 *y, FP16 *z); -/** @brief Inverting an FP16 - * - @param x FP16 instance, on exit = 1/y - @param y FP16 instance - */ -extern void FP16_inv(FP16 *x, FP16 *y); -/** @brief Formats and outputs an FP16 to the console - * - @param x FP16 instance to be printed - */ -extern void FP16_output(FP16 *x); -/** @brief Formats and outputs an FP16 to the console in raw form (for debugging) - * - @param x FP16 instance to be printed - */ -extern void FP16_rawoutput(FP16 *x); -/** @brief multiplies an FP16 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP16 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP16_times_i(FP16 *x); -/** @brief multiplies an FP16 instance by irreducible polynomial (1+sqrt(-1)) - * - @param x FP16 instance, on exit = sqrt(1+sqrt(-1))^2*x - */ -extern void FP16_times_i2(FP16 *x); - -/** @brief multiplies an FP16 instance by irreducible polynomial (1+sqrt(-1)) - * - @param x FP16 instance, on exit = sqrt(1+sqrt(-1))^4*x - */ -extern void FP16_times_i4(FP16 *x); - - -/** @brief Normalises the components of an FP16 - * - @param x FP16 instance to be normalised - */ -extern void FP16_norm(FP16 *x); -/** @brief Reduces all components of possibly unreduced FP16 mod Modulus - * - @param x FP16 instance, on exit reduced mod Modulus - */ -extern void FP16_reduce(FP16 *x); -/** @brief Raises an FP16 to the power of a BIG - * - @param x FP16 instance, on exit = y^b - @param y FP16 instance - @param b BIG number - */ -extern void FP16_pow(FP16 *x, FP16 *y, B560_58::BIG b); -/** @brief Raises an FP16 to the power of the internal modulus p, using the Frobenius - * - @param x FP16 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP16_frob(FP16 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP16 instance, on exit = w*x-conj(x)*y+z - @param w FP16 instance - @param x FP16 instance - @param y FP16 instance - @param z FP16 instance - */ -extern void FP16_xtr_A(FP16 *r, FP16 *w, FP16 *x, FP16 *y, FP16 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP16 instance, on exit = x^2-2*conj(x) - @param x FP16 instance - */ -extern void FP16_xtr_D(FP16 *r, FP16 *x); -/** @brief Calculates FP16 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP16 instance, on exit = trace(w^b) - @param x FP16 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP16_xtr_pow(FP16 *r, FP16 *x, B560_58::BIG b); -/** @brief Calculates FP16 trace of c^a.d^b, where c and d are derived from FP16 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP16 instance, on exit = trace(c^a.d^b) - @param c FP16 instance, trace of an FP12 - @param d FP16 instance, trace of an FP12 - @param e FP16 instance, trace of an FP12 - @param f FP16 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP16_xtr_pow2(FP16 *r, FP16 *c, FP16 *d, FP16 *e, FP16 *f, B560_58::BIG a, B560_58::BIG b); - -/** @brief Conditional copy of FP16 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP16 instance, set to y if s!=0 - @param y another FP16 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP16_cmove(FP16 *x, FP16 *y, int s); - -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP16_BLS48556_H +#define FP16_BLS48556_H + +#include "fp8_BLS48556.h" +#include "config_curve_BLS48556.h" + +using namespace core; + +namespace BLS48556 { + +/** + @brief FP16 Structure - towered over two FP4 +*/ + +typedef struct +{ + FP8 a; /**< real part of FP16 */ + FP8 b; /**< imaginary part of FP16 */ +} FP16; + + +/* FP16 prototypes */ +/** @brief Tests for FP16 equal to zero + * + @param x FP16 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP16_iszilch(FP16 *x); +/** @brief Tests for FP16 equal to unity + * + @param x FP16 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP16_isunity(FP16 *x); +/** @brief Tests for equality of two FP16s + * + @param x FP16 instance to be compared + @param y FP16 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP16_equals(FP16 *x, FP16 *y); + +/** @brief Serialize in FP16 + * + @param b buffer for output + @param x FP16 number to be serialized + */ +extern void FP16_toBytes(char *b,FP16 *x); +/** @brief Serialize out FP16 + * + @param x FP16 number to be serialized + @param b buffer for input + */ +extern void FP16_fromBytes(FP16 *x,char *b); + +/** @brief Tests for FP16 having only a real part and no imaginary part + * + @param x FP16 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP16_isreal(FP16 *x); +/** @brief Initialise FP16 from two FP8s + * + @param x FP16 instance to be initialised + @param a FP8 to form real part of FP16 + @param b FP8 to form imaginary part of FP16 + */ +extern void FP16_from_FP8s(FP16 *x, FP8 *a, FP8 *b); +/** @brief Initialise FP16 from single FP8 + * + Imaginary part is set to zero + @param x FP16 instance to be initialised + @param a FP8 to form real part of FP16 + */ +extern void FP16_from_FP8(FP16 *x, FP8 *a); + +/** @brief Initialise FP16 from single FP8 + * + real part is set to zero + @param x FP16 instance to be initialised + @param a FP8 to form imaginary part of FP16 + */ +extern void FP16_from_FP8H(FP16 *x, FP8 *a); + + +/** @brief Copy FP16 to another FP16 + * + @param x FP16 instance, on exit = y + @param y FP16 instance to be copied + */ +extern void FP16_copy(FP16 *x, FP16 *y); +/** @brief Set FP16 to zero + * + @param x FP16 instance to be set to zero + */ +extern void FP16_zero(FP16 *x); +/** @brief Set FP16 to unity + * + @param x FP16 instance to be set to one + */ +extern void FP16_one(FP16 *x); +/** @brief Negation of FP16 + * + @param x FP16 instance, on exit = -y + @param y FP16 instance + */ +extern void FP16_neg(FP16 *x, FP16 *y); +/** @brief Conjugation of FP16 + * + If y=(a,b) on exit x=(a,-b) + @param x FP16 instance, on exit = conj(y) + @param y FP16 instance + */ +extern void FP16_conj(FP16 *x, FP16 *y); +/** @brief Negative conjugation of FP16 + * + If y=(a,b) on exit x=(-a,b) + @param x FP16 instance, on exit = -conj(y) + @param y FP16 instance + */ +extern void FP16_nconj(FP16 *x, FP16 *y); +/** @brief addition of two FP16s + * + @param x FP16 instance, on exit = y+z + @param y FP16 instance + @param z FP16 instance + */ +extern void FP16_add(FP16 *x, FP16 *y, FP16 *z); +/** @brief subtraction of two FP16s + * + @param x FP16 instance, on exit = y-z + @param y FP16 instance + @param z FP16 instance + */ +extern void FP16_sub(FP16 *x, FP16 *y, FP16 *z); +/** @brief Multiplication of an FP16 by an FP8 + * + @param x FP16 instance, on exit = y*a + @param y FP16 instance + @param a FP4 multiplier + */ +extern void FP16_pmul(FP16 *x, FP16 *y, FP8 *a); + +/** @brief Multiplication of an FP16 by an FP2 + * + @param x FP16 instance, on exit = y*a + @param y FP16 instance + @param a FP2 multiplier + */ +extern void FP16_qmul(FP16 *x, FP16 *y, FP2 *a); + + +/** @brief Multiplication of an FP16 by an FP + * + @param x FP16 instance, on exit = y*a + @param y FP16 instance + @param a FP multiplier + */ +extern void FP16_tmul(FP16 *x, FP16 *y, FP *a); + + + +/** @brief Multiplication of an FP16 by a small integer + * + @param x FP16 instance, on exit = y*i + @param y FP16 instance + @param i an integer + */ +extern void FP16_imul(FP16 *x, FP16 *y, int i); +/** @brief Squaring an FP16 + * + @param x FP16 instance, on exit = y^2 + @param y FP16 instance + */ +extern void FP16_sqr(FP16 *x, FP16 *y); +/** @brief Multiplication of two FP16s + * + @param x FP16 instance, on exit = y*z + @param y FP16 instance + @param z FP16 instance + */ +extern void FP16_mul(FP16 *x, FP16 *y, FP16 *z); +/** @brief Inverting an FP16 + * + @param x FP16 instance, on exit = 1/y + @param y FP16 instance + */ +extern void FP16_inv(FP16 *x, FP16 *y); +/** @brief Formats and outputs an FP16 to the console + * + @param x FP16 instance to be printed + */ +extern void FP16_output(FP16 *x); +/** @brief Formats and outputs an FP16 to the console in raw form (for debugging) + * + @param x FP16 instance to be printed + */ +extern void FP16_rawoutput(FP16 *x); +/** @brief multiplies an FP16 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP16 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP16_times_i(FP16 *x); +/** @brief multiplies an FP16 instance by irreducible polynomial (1+sqrt(-1)) + * + @param x FP16 instance, on exit = sqrt(1+sqrt(-1))^2*x + */ +extern void FP16_times_i2(FP16 *x); + +/** @brief multiplies an FP16 instance by irreducible polynomial (1+sqrt(-1)) + * + @param x FP16 instance, on exit = sqrt(1+sqrt(-1))^4*x + */ +extern void FP16_times_i4(FP16 *x); + + +/** @brief Normalises the components of an FP16 + * + @param x FP16 instance to be normalised + */ +extern void FP16_norm(FP16 *x); +/** @brief Reduces all components of possibly unreduced FP16 mod Modulus + * + @param x FP16 instance, on exit reduced mod Modulus + */ +extern void FP16_reduce(FP16 *x); +/** @brief Raises an FP16 to the power of a BIG + * + @param x FP16 instance, on exit = y^b + @param y FP16 instance + @param b BIG number + */ +extern void FP16_pow(FP16 *x, FP16 *y, B560_58::BIG b); +/** @brief Raises an FP16 to the power of the internal modulus p, using the Frobenius + * + @param x FP16 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP16_frob(FP16 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP16 instance, on exit = w*x-conj(x)*y+z + @param w FP16 instance + @param x FP16 instance + @param y FP16 instance + @param z FP16 instance + */ +extern void FP16_xtr_A(FP16 *r, FP16 *w, FP16 *x, FP16 *y, FP16 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP16 instance, on exit = x^2-2*conj(x) + @param x FP16 instance + */ +extern void FP16_xtr_D(FP16 *r, FP16 *x); +/** @brief Calculates FP16 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP16 instance, on exit = trace(w^b) + @param x FP16 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP16_xtr_pow(FP16 *r, FP16 *x, B560_58::BIG b); +/** @brief Calculates FP16 trace of c^a.d^b, where c and d are derived from FP16 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP16 instance, on exit = trace(c^a.d^b) + @param c FP16 instance, trace of an FP12 + @param d FP16 instance, trace of an FP12 + @param e FP16 instance, trace of an FP12 + @param f FP16 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP16_xtr_pow2(FP16 *r, FP16 *c, FP16 *d, FP16 *e, FP16 *f, B560_58::BIG a, B560_58::BIG b); + +/** @brief Conditional copy of FP16 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP16 instance, set to y if s!=0 + @param y another FP16 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP16_cmove(FP16 *x, FP16 *y, int s); + +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp16_BLS48581.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp16_BLS48581.h index d0e7754..dbad664 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16_BLS48581.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp16_BLS48581.h @@ -1,308 +1,308 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP16_BLS48581_H -#define FP16_BLS48581_H - -#include "fp8_BLS48581.h" -#include "config_curve_BLS48581.h" - -using namespace core; - -namespace BLS48581 { - -/** - @brief FP16 Structure - towered over two FP4 -*/ - -typedef struct -{ - FP8 a; /**< real part of FP16 */ - FP8 b; /**< imaginary part of FP16 */ -} FP16; - - -/* FP16 prototypes */ -/** @brief Tests for FP16 equal to zero - * - @param x FP16 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP16_iszilch(FP16 *x); -/** @brief Tests for FP16 equal to unity - * - @param x FP16 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP16_isunity(FP16 *x); -/** @brief Tests for equality of two FP16s - * - @param x FP16 instance to be compared - @param y FP16 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP16_equals(FP16 *x, FP16 *y); - -/** @brief Serialize in FP16 - * - @param b buffer for output - @param x FP16 number to be serialized - */ -extern void FP16_toBytes(char *b,FP16 *x); -/** @brief Serialize out FP16 - * - @param x FP16 number to be serialized - @param b buffer for input - */ -extern void FP16_fromBytes(FP16 *x,char *b); - -/** @brief Tests for FP16 having only a real part and no imaginary part - * - @param x FP16 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP16_isreal(FP16 *x); -/** @brief Initialise FP16 from two FP8s - * - @param x FP16 instance to be initialised - @param a FP8 to form real part of FP16 - @param b FP8 to form imaginary part of FP16 - */ -extern void FP16_from_FP8s(FP16 *x, FP8 *a, FP8 *b); -/** @brief Initialise FP16 from single FP8 - * - Imaginary part is set to zero - @param x FP16 instance to be initialised - @param a FP8 to form real part of FP16 - */ -extern void FP16_from_FP8(FP16 *x, FP8 *a); - -/** @brief Initialise FP16 from single FP8 - * - real part is set to zero - @param x FP16 instance to be initialised - @param a FP8 to form imaginary part of FP16 - */ -extern void FP16_from_FP8H(FP16 *x, FP8 *a); - - -/** @brief Copy FP16 to another FP16 - * - @param x FP16 instance, on exit = y - @param y FP16 instance to be copied - */ -extern void FP16_copy(FP16 *x, FP16 *y); -/** @brief Set FP16 to zero - * - @param x FP16 instance to be set to zero - */ -extern void FP16_zero(FP16 *x); -/** @brief Set FP16 to unity - * - @param x FP16 instance to be set to one - */ -extern void FP16_one(FP16 *x); -/** @brief Negation of FP16 - * - @param x FP16 instance, on exit = -y - @param y FP16 instance - */ -extern void FP16_neg(FP16 *x, FP16 *y); -/** @brief Conjugation of FP16 - * - If y=(a,b) on exit x=(a,-b) - @param x FP16 instance, on exit = conj(y) - @param y FP16 instance - */ -extern void FP16_conj(FP16 *x, FP16 *y); -/** @brief Negative conjugation of FP16 - * - If y=(a,b) on exit x=(-a,b) - @param x FP16 instance, on exit = -conj(y) - @param y FP16 instance - */ -extern void FP16_nconj(FP16 *x, FP16 *y); -/** @brief addition of two FP16s - * - @param x FP16 instance, on exit = y+z - @param y FP16 instance - @param z FP16 instance - */ -extern void FP16_add(FP16 *x, FP16 *y, FP16 *z); -/** @brief subtraction of two FP16s - * - @param x FP16 instance, on exit = y-z - @param y FP16 instance - @param z FP16 instance - */ -extern void FP16_sub(FP16 *x, FP16 *y, FP16 *z); -/** @brief Multiplication of an FP16 by an FP8 - * - @param x FP16 instance, on exit = y*a - @param y FP16 instance - @param a FP4 multiplier - */ -extern void FP16_pmul(FP16 *x, FP16 *y, FP8 *a); - -/** @brief Multiplication of an FP16 by an FP2 - * - @param x FP16 instance, on exit = y*a - @param y FP16 instance - @param a FP2 multiplier - */ -extern void FP16_qmul(FP16 *x, FP16 *y, FP2 *a); - - -/** @brief Multiplication of an FP16 by an FP - * - @param x FP16 instance, on exit = y*a - @param y FP16 instance - @param a FP multiplier - */ -extern void FP16_tmul(FP16 *x, FP16 *y, FP *a); - - - -/** @brief Multiplication of an FP16 by a small integer - * - @param x FP16 instance, on exit = y*i - @param y FP16 instance - @param i an integer - */ -extern void FP16_imul(FP16 *x, FP16 *y, int i); -/** @brief Squaring an FP16 - * - @param x FP16 instance, on exit = y^2 - @param y FP16 instance - */ -extern void FP16_sqr(FP16 *x, FP16 *y); -/** @brief Multiplication of two FP16s - * - @param x FP16 instance, on exit = y*z - @param y FP16 instance - @param z FP16 instance - */ -extern void FP16_mul(FP16 *x, FP16 *y, FP16 *z); -/** @brief Inverting an FP16 - * - @param x FP16 instance, on exit = 1/y - @param y FP16 instance - */ -extern void FP16_inv(FP16 *x, FP16 *y); -/** @brief Formats and outputs an FP16 to the console - * - @param x FP16 instance to be printed - */ -extern void FP16_output(FP16 *x); -/** @brief Formats and outputs an FP16 to the console in raw form (for debugging) - * - @param x FP16 instance to be printed - */ -extern void FP16_rawoutput(FP16 *x); -/** @brief multiplies an FP16 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP16 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP16_times_i(FP16 *x); -/** @brief multiplies an FP16 instance by irreducible polynomial (1+sqrt(-1)) - * - @param x FP16 instance, on exit = sqrt(1+sqrt(-1))^2*x - */ -extern void FP16_times_i2(FP16 *x); - -/** @brief multiplies an FP16 instance by irreducible polynomial (1+sqrt(-1)) - * - @param x FP16 instance, on exit = sqrt(1+sqrt(-1))^4*x - */ -extern void FP16_times_i4(FP16 *x); - - -/** @brief Normalises the components of an FP16 - * - @param x FP16 instance to be normalised - */ -extern void FP16_norm(FP16 *x); -/** @brief Reduces all components of possibly unreduced FP16 mod Modulus - * - @param x FP16 instance, on exit reduced mod Modulus - */ -extern void FP16_reduce(FP16 *x); -/** @brief Raises an FP16 to the power of a BIG - * - @param x FP16 instance, on exit = y^b - @param y FP16 instance - @param b BIG number - */ -extern void FP16_pow(FP16 *x, FP16 *y, B584_60::BIG b); -/** @brief Raises an FP16 to the power of the internal modulus p, using the Frobenius - * - @param x FP16 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP16_frob(FP16 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP16 instance, on exit = w*x-conj(x)*y+z - @param w FP16 instance - @param x FP16 instance - @param y FP16 instance - @param z FP16 instance - */ -extern void FP16_xtr_A(FP16 *r, FP16 *w, FP16 *x, FP16 *y, FP16 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP16 instance, on exit = x^2-2*conj(x) - @param x FP16 instance - */ -extern void FP16_xtr_D(FP16 *r, FP16 *x); -/** @brief Calculates FP16 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP16 instance, on exit = trace(w^b) - @param x FP16 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP16_xtr_pow(FP16 *r, FP16 *x, B584_60::BIG b); -/** @brief Calculates FP16 trace of c^a.d^b, where c and d are derived from FP16 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP16 instance, on exit = trace(c^a.d^b) - @param c FP16 instance, trace of an FP12 - @param d FP16 instance, trace of an FP12 - @param e FP16 instance, trace of an FP12 - @param f FP16 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP16_xtr_pow2(FP16 *r, FP16 *c, FP16 *d, FP16 *e, FP16 *f, B584_60::BIG a, B584_60::BIG b); - -/** @brief Conditional copy of FP16 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP16 instance, set to y if s!=0 - @param y another FP16 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP16_cmove(FP16 *x, FP16 *y, int s); - -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP16_BLS48581_H +#define FP16_BLS48581_H + +#include "fp8_BLS48581.h" +#include "config_curve_BLS48581.h" + +using namespace core; + +namespace BLS48581 { + +/** + @brief FP16 Structure - towered over two FP4 +*/ + +typedef struct +{ + FP8 a; /**< real part of FP16 */ + FP8 b; /**< imaginary part of FP16 */ +} FP16; + + +/* FP16 prototypes */ +/** @brief Tests for FP16 equal to zero + * + @param x FP16 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP16_iszilch(FP16 *x); +/** @brief Tests for FP16 equal to unity + * + @param x FP16 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP16_isunity(FP16 *x); +/** @brief Tests for equality of two FP16s + * + @param x FP16 instance to be compared + @param y FP16 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP16_equals(FP16 *x, FP16 *y); + +/** @brief Serialize in FP16 + * + @param b buffer for output + @param x FP16 number to be serialized + */ +extern void FP16_toBytes(char *b,FP16 *x); +/** @brief Serialize out FP16 + * + @param x FP16 number to be serialized + @param b buffer for input + */ +extern void FP16_fromBytes(FP16 *x,char *b); + +/** @brief Tests for FP16 having only a real part and no imaginary part + * + @param x FP16 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP16_isreal(FP16 *x); +/** @brief Initialise FP16 from two FP8s + * + @param x FP16 instance to be initialised + @param a FP8 to form real part of FP16 + @param b FP8 to form imaginary part of FP16 + */ +extern void FP16_from_FP8s(FP16 *x, FP8 *a, FP8 *b); +/** @brief Initialise FP16 from single FP8 + * + Imaginary part is set to zero + @param x FP16 instance to be initialised + @param a FP8 to form real part of FP16 + */ +extern void FP16_from_FP8(FP16 *x, FP8 *a); + +/** @brief Initialise FP16 from single FP8 + * + real part is set to zero + @param x FP16 instance to be initialised + @param a FP8 to form imaginary part of FP16 + */ +extern void FP16_from_FP8H(FP16 *x, FP8 *a); + + +/** @brief Copy FP16 to another FP16 + * + @param x FP16 instance, on exit = y + @param y FP16 instance to be copied + */ +extern void FP16_copy(FP16 *x, FP16 *y); +/** @brief Set FP16 to zero + * + @param x FP16 instance to be set to zero + */ +extern void FP16_zero(FP16 *x); +/** @brief Set FP16 to unity + * + @param x FP16 instance to be set to one + */ +extern void FP16_one(FP16 *x); +/** @brief Negation of FP16 + * + @param x FP16 instance, on exit = -y + @param y FP16 instance + */ +extern void FP16_neg(FP16 *x, FP16 *y); +/** @brief Conjugation of FP16 + * + If y=(a,b) on exit x=(a,-b) + @param x FP16 instance, on exit = conj(y) + @param y FP16 instance + */ +extern void FP16_conj(FP16 *x, FP16 *y); +/** @brief Negative conjugation of FP16 + * + If y=(a,b) on exit x=(-a,b) + @param x FP16 instance, on exit = -conj(y) + @param y FP16 instance + */ +extern void FP16_nconj(FP16 *x, FP16 *y); +/** @brief addition of two FP16s + * + @param x FP16 instance, on exit = y+z + @param y FP16 instance + @param z FP16 instance + */ +extern void FP16_add(FP16 *x, FP16 *y, FP16 *z); +/** @brief subtraction of two FP16s + * + @param x FP16 instance, on exit = y-z + @param y FP16 instance + @param z FP16 instance + */ +extern void FP16_sub(FP16 *x, FP16 *y, FP16 *z); +/** @brief Multiplication of an FP16 by an FP8 + * + @param x FP16 instance, on exit = y*a + @param y FP16 instance + @param a FP4 multiplier + */ +extern void FP16_pmul(FP16 *x, FP16 *y, FP8 *a); + +/** @brief Multiplication of an FP16 by an FP2 + * + @param x FP16 instance, on exit = y*a + @param y FP16 instance + @param a FP2 multiplier + */ +extern void FP16_qmul(FP16 *x, FP16 *y, FP2 *a); + + +/** @brief Multiplication of an FP16 by an FP + * + @param x FP16 instance, on exit = y*a + @param y FP16 instance + @param a FP multiplier + */ +extern void FP16_tmul(FP16 *x, FP16 *y, FP *a); + + + +/** @brief Multiplication of an FP16 by a small integer + * + @param x FP16 instance, on exit = y*i + @param y FP16 instance + @param i an integer + */ +extern void FP16_imul(FP16 *x, FP16 *y, int i); +/** @brief Squaring an FP16 + * + @param x FP16 instance, on exit = y^2 + @param y FP16 instance + */ +extern void FP16_sqr(FP16 *x, FP16 *y); +/** @brief Multiplication of two FP16s + * + @param x FP16 instance, on exit = y*z + @param y FP16 instance + @param z FP16 instance + */ +extern void FP16_mul(FP16 *x, FP16 *y, FP16 *z); +/** @brief Inverting an FP16 + * + @param x FP16 instance, on exit = 1/y + @param y FP16 instance + */ +extern void FP16_inv(FP16 *x, FP16 *y); +/** @brief Formats and outputs an FP16 to the console + * + @param x FP16 instance to be printed + */ +extern void FP16_output(FP16 *x); +/** @brief Formats and outputs an FP16 to the console in raw form (for debugging) + * + @param x FP16 instance to be printed + */ +extern void FP16_rawoutput(FP16 *x); +/** @brief multiplies an FP16 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP16 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP16_times_i(FP16 *x); +/** @brief multiplies an FP16 instance by irreducible polynomial (1+sqrt(-1)) + * + @param x FP16 instance, on exit = sqrt(1+sqrt(-1))^2*x + */ +extern void FP16_times_i2(FP16 *x); + +/** @brief multiplies an FP16 instance by irreducible polynomial (1+sqrt(-1)) + * + @param x FP16 instance, on exit = sqrt(1+sqrt(-1))^4*x + */ +extern void FP16_times_i4(FP16 *x); + + +/** @brief Normalises the components of an FP16 + * + @param x FP16 instance to be normalised + */ +extern void FP16_norm(FP16 *x); +/** @brief Reduces all components of possibly unreduced FP16 mod Modulus + * + @param x FP16 instance, on exit reduced mod Modulus + */ +extern void FP16_reduce(FP16 *x); +/** @brief Raises an FP16 to the power of a BIG + * + @param x FP16 instance, on exit = y^b + @param y FP16 instance + @param b BIG number + */ +extern void FP16_pow(FP16 *x, FP16 *y, B584_60::BIG b); +/** @brief Raises an FP16 to the power of the internal modulus p, using the Frobenius + * + @param x FP16 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP16_frob(FP16 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP16 instance, on exit = w*x-conj(x)*y+z + @param w FP16 instance + @param x FP16 instance + @param y FP16 instance + @param z FP16 instance + */ +extern void FP16_xtr_A(FP16 *r, FP16 *w, FP16 *x, FP16 *y, FP16 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP16 instance, on exit = x^2-2*conj(x) + @param x FP16 instance + */ +extern void FP16_xtr_D(FP16 *r, FP16 *x); +/** @brief Calculates FP16 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP16 instance, on exit = trace(w^b) + @param x FP16 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP16_xtr_pow(FP16 *r, FP16 *x, B584_60::BIG b); +/** @brief Calculates FP16 trace of c^a.d^b, where c and d are derived from FP16 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP16 instance, on exit = trace(c^a.d^b) + @param c FP16 instance, trace of an FP12 + @param d FP16 instance, trace of an FP12 + @param e FP16 instance, trace of an FP12 + @param f FP16 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP16_xtr_pow2(FP16 *r, FP16 *c, FP16 *d, FP16 *e, FP16 *f, B584_60::BIG a, B584_60::BIG b); + +/** @brief Conditional copy of FP16 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP16 instance, set to y if s!=0 + @param y another FP16 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP16_cmove(FP16 *x, FP16 *y, int s); + +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp2.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp24.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp24.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp24.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp24.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp24_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp24_BLS24479.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp24_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp24_BLS24479.h index 1c75a26..4b62f54 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp24_BLS24479.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp24_BLS24479.h @@ -1,236 +1,236 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP24_BLS24479_H -#define FP24_BLS24479_H - -#include "fp8_BLS24479.h" - -using namespace core; - -namespace BLS24479 { -/** - @brief FP12 Structure - towered over three FP8 -*/ - - -typedef struct -{ - FP8 a; /**< first part of FP12 */ - FP8 b; /**< second part of FP12 */ - FP8 c; /**< third part of FP12 */ - int type; -} FP24; - -extern const B480_56::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B480_56::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP24 prototypes */ -/** @brief Tests for FP24 equal to zero - * - @param x FP24 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP24_iszilch(FP24 *x); -/** @brief Tests for FP24 equal to unity - * - @param x FP24 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP24_isunity(FP24 *x); -/** @brief Copy FP24 to another FP24 - * - @param x FP24 instance, on exit = y - @param y FP24 instance to be copied - */ -extern void FP24_copy(FP24 *x, FP24 *y); -/** @brief Set FP24 to unity - * - @param x FP24 instance to be set to one - */ -extern void FP24_one(FP24 *x); - -/** @brief Set FP24 to zero - * - @param x FP24 instance to be set to zero - */ -extern void FP24_zero(FP24 *x); - - -/** @brief Tests for equality of two FP24s - * - @param x FP24 instance to be compared - @param y FP24 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP24_equals(FP24 *x, FP24 *y); -/** @brief Conjugation of FP24 - * - If y=(a,b,c) (where a,b,c are its three FP8 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP24 instance, on exit = conj(y) - @param y FP24 instance - */ -extern void FP24_conj(FP24 *x, FP24 *y); -/** @brief Initialise FP24 from single FP8 - * - Sets first FP8 component of an FP24, other components set to zero - @param x FP24 instance to be initialised - @param a FP8 to form first part of FP8 - */ -extern void FP24_from_FP8(FP24 *x, FP8 *a); -/** @brief Initialise FP24 from three FP8s - * - @param x FP24 instance to be initialised - @param a FP8 to form first part of FP24 - @param b FP8 to form second part of FP24 - @param c FP8 to form third part of FP24 - */ -extern void FP24_from_FP8s(FP24 *x, FP8 *a, FP8* b, FP8 *c); -/** @brief Fast Squaring of an FP24 in "unitary" form - * - @param x FP24 instance, on exit = y^2 - @param y FP8 instance, must be unitary - */ -extern void FP24_usqr(FP24 *x, FP24 *y); -/** @brief Squaring an FP24 - * - @param x FP24 instance, on exit = y^2 - @param y FP24 instance - */ -extern void FP24_sqr(FP24 *x, FP24 *y); - -/** @brief Fast multiplication of two sparse FP24s that arises from ATE pairing line functions - * - @param x FP24 instance, on exit = x*y - @param y FP24 instance, of special form - */ -extern void FP24_smul(FP24 *x, FP24 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP24 instance, on exit = x*y - @param y FP24 instance, of special form - */ -extern void FP24_ssmul(FP24 *x, FP24 *y); -/** @brief Full unconditional Multiplication of two FP24s - * - @param x FP24 instance, on exit = x*y - @param y FP24 instance, the multiplier - */ -extern void FP24_mul(FP24 *x, FP24 *y); - -/** @brief Inverting an FP24 - * - @param x FP24 instance, on exit = 1/y - @param y FP24 instance - */ -extern void FP24_inv(FP24 *x, FP24 *y); -/** @brief Raises an FP24 to the power of a BIG - * - @param r FP24 instance, on exit = y^b - @param x FP24 instance - @param b BIG number - */ -extern void FP24_pow(FP24 *r, FP24 *x, B480_56::BIG b); - -//extern void FP24_ppow(FP24 *r,FP24 *x,B480_56::BIG b); - -/** @brief Raises an FP24 instance x to a small integer power, side-channel resistant - * - @param x FP24 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP24_pinpow(FP24 *x, int i, int b); - -/** @brief Raises an FP24 instance x to a BIG power, compressed to FP8 - * - @param c FP8 instance, on exit = x^(e mod r) as FP8 - @param x FP24 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP24_compow(FP8 *c, FP24 *x, B480_56::BIG e, B480_56::BIG r); - -/** @brief Calculate Pi x[i]^b[i] for i=0 to 7, side-channel resistant - * - @param r FP24 instance, on exit = Pi x[i]^b[i] for i=0 to 7 - @param x FP24 array with 4 FP24s - @param b BIG array of 4 exponents - */ -extern void FP24_pow8(FP24 *r, FP24 *x, B480_56::BIG *b); - - -/** @brief Raises an FP24 to the power of the internal modulus p, using the Frobenius - * - @param x FP24 instance, on exit = x^p^n - @param f FP2 precalculated Frobenius constant - @param n power of p - */ -extern void FP24_frob(FP24 *x, FP2 *f, int n); - -/** @brief Reduces all components of possibly unreduced FP24 mod Modulus - * - @param x FP24 instance, on exit reduced mod Modulus - */ -extern void FP24_reduce(FP24 *x); -/** @brief Normalises the components of an FP24 - * - @param x FP24 instance to be normalised - */ -extern void FP24_norm(FP24 *x); -/** @brief Formats and outputs an FP24 to the console - * - @param x FP24 instance to be printed - */ -extern void FP24_output(FP24 *x); -/** @brief Formats and outputs an FP24 instance to an octet string - * - Serializes the components of an FP24 to big-endian base 256 form. - @param S output octet string - @param x FP24 instance to be converted to an octet string - */ -extern void FP24_toOctet(octet *S, FP24 *x); -/** @brief Creates an FP24 instance from an octet string - * - De-serializes the components of an FP24 to create an FP24 from big-endian base 256 components. - @param x FP24 instance to be created from an octet string - @param S input octet string - - */ -extern void FP24_fromOctet(FP24 *x, octet *S); -/** @brief Calculate the trace of an FP24 - * - @param t FP8 trace of x, on exit = tr(x) - @param x FP24 instance - - */ -extern void FP24_trace(FP8 *t, FP24 *x); - -/** @brief Conditional copy of FP24 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP24 instance, set to y if s!=0 - @param y another FP24 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP24_cmove(FP24 *x, FP24 *y, int s); - -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP24_BLS24479_H +#define FP24_BLS24479_H + +#include "fp8_BLS24479.h" + +using namespace core; + +namespace BLS24479 { +/** + @brief FP12 Structure - towered over three FP8 +*/ + + +typedef struct +{ + FP8 a; /**< first part of FP12 */ + FP8 b; /**< second part of FP12 */ + FP8 c; /**< third part of FP12 */ + int type; +} FP24; + +extern const B480_56::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B480_56::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP24 prototypes */ +/** @brief Tests for FP24 equal to zero + * + @param x FP24 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP24_iszilch(FP24 *x); +/** @brief Tests for FP24 equal to unity + * + @param x FP24 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP24_isunity(FP24 *x); +/** @brief Copy FP24 to another FP24 + * + @param x FP24 instance, on exit = y + @param y FP24 instance to be copied + */ +extern void FP24_copy(FP24 *x, FP24 *y); +/** @brief Set FP24 to unity + * + @param x FP24 instance to be set to one + */ +extern void FP24_one(FP24 *x); + +/** @brief Set FP24 to zero + * + @param x FP24 instance to be set to zero + */ +extern void FP24_zero(FP24 *x); + + +/** @brief Tests for equality of two FP24s + * + @param x FP24 instance to be compared + @param y FP24 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP24_equals(FP24 *x, FP24 *y); +/** @brief Conjugation of FP24 + * + If y=(a,b,c) (where a,b,c are its three FP8 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP24 instance, on exit = conj(y) + @param y FP24 instance + */ +extern void FP24_conj(FP24 *x, FP24 *y); +/** @brief Initialise FP24 from single FP8 + * + Sets first FP8 component of an FP24, other components set to zero + @param x FP24 instance to be initialised + @param a FP8 to form first part of FP8 + */ +extern void FP24_from_FP8(FP24 *x, FP8 *a); +/** @brief Initialise FP24 from three FP8s + * + @param x FP24 instance to be initialised + @param a FP8 to form first part of FP24 + @param b FP8 to form second part of FP24 + @param c FP8 to form third part of FP24 + */ +extern void FP24_from_FP8s(FP24 *x, FP8 *a, FP8* b, FP8 *c); +/** @brief Fast Squaring of an FP24 in "unitary" form + * + @param x FP24 instance, on exit = y^2 + @param y FP8 instance, must be unitary + */ +extern void FP24_usqr(FP24 *x, FP24 *y); +/** @brief Squaring an FP24 + * + @param x FP24 instance, on exit = y^2 + @param y FP24 instance + */ +extern void FP24_sqr(FP24 *x, FP24 *y); + +/** @brief Fast multiplication of two sparse FP24s that arises from ATE pairing line functions + * + @param x FP24 instance, on exit = x*y + @param y FP24 instance, of special form + */ +extern void FP24_smul(FP24 *x, FP24 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP24 instance, on exit = x*y + @param y FP24 instance, of special form + */ +extern void FP24_ssmul(FP24 *x, FP24 *y); +/** @brief Full unconditional Multiplication of two FP24s + * + @param x FP24 instance, on exit = x*y + @param y FP24 instance, the multiplier + */ +extern void FP24_mul(FP24 *x, FP24 *y); + +/** @brief Inverting an FP24 + * + @param x FP24 instance, on exit = 1/y + @param y FP24 instance + */ +extern void FP24_inv(FP24 *x, FP24 *y); +/** @brief Raises an FP24 to the power of a BIG + * + @param r FP24 instance, on exit = y^b + @param x FP24 instance + @param b BIG number + */ +extern void FP24_pow(FP24 *r, FP24 *x, B480_56::BIG b); + +//extern void FP24_ppow(FP24 *r,FP24 *x,B480_56::BIG b); + +/** @brief Raises an FP24 instance x to a small integer power, side-channel resistant + * + @param x FP24 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP24_pinpow(FP24 *x, int i, int b); + +/** @brief Raises an FP24 instance x to a BIG power, compressed to FP8 + * + @param c FP8 instance, on exit = x^(e mod r) as FP8 + @param x FP24 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP24_compow(FP8 *c, FP24 *x, B480_56::BIG e, B480_56::BIG r); + +/** @brief Calculate Pi x[i]^b[i] for i=0 to 7, side-channel resistant + * + @param r FP24 instance, on exit = Pi x[i]^b[i] for i=0 to 7 + @param x FP24 array with 4 FP24s + @param b BIG array of 4 exponents + */ +extern void FP24_pow8(FP24 *r, FP24 *x, B480_56::BIG *b); + + +/** @brief Raises an FP24 to the power of the internal modulus p, using the Frobenius + * + @param x FP24 instance, on exit = x^p^n + @param f FP2 precalculated Frobenius constant + @param n power of p + */ +extern void FP24_frob(FP24 *x, FP2 *f, int n); + +/** @brief Reduces all components of possibly unreduced FP24 mod Modulus + * + @param x FP24 instance, on exit reduced mod Modulus + */ +extern void FP24_reduce(FP24 *x); +/** @brief Normalises the components of an FP24 + * + @param x FP24 instance to be normalised + */ +extern void FP24_norm(FP24 *x); +/** @brief Formats and outputs an FP24 to the console + * + @param x FP24 instance to be printed + */ +extern void FP24_output(FP24 *x); +/** @brief Formats and outputs an FP24 instance to an octet string + * + Serializes the components of an FP24 to big-endian base 256 form. + @param S output octet string + @param x FP24 instance to be converted to an octet string + */ +extern void FP24_toOctet(octet *S, FP24 *x); +/** @brief Creates an FP24 instance from an octet string + * + De-serializes the components of an FP24 to create an FP24 from big-endian base 256 components. + @param x FP24 instance to be created from an octet string + @param S input octet string + + */ +extern void FP24_fromOctet(FP24 *x, octet *S); +/** @brief Calculate the trace of an FP24 + * + @param t FP8 trace of x, on exit = tr(x) + @param x FP24 instance + + */ +extern void FP24_trace(FP8 *t, FP24 *x); + +/** @brief Conditional copy of FP24 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP24 instance, set to y if s!=0 + @param y another FP24 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP24_cmove(FP24 *x, FP24 *y, int s); + +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS12381.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS12381.h index 1ce1489..4843c4a 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS12381.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS12381.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_BLS12381_H -#define FP2_BLS12381_H - -#include "fp_BLS12381.h" - -using namespace core; - -namespace BLS12381 { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B384_58::BIG a, B384_58::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B384_58::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B384_58::BIG a,const B384_58::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B384_58::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_BLS12381_H +#define FP2_BLS12381_H + +#include "fp_BLS12381.h" + +using namespace core; + +namespace BLS12381 { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B384_58::BIG a, B384_58::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B384_58::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B384_58::BIG a,const B384_58::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B384_58::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS12383.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS12383.h index cc7c945..5d9f2c9 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS12383.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS12383.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_BLS12383_H -#define FP2_BLS12383_H - -#include "fp_BLS12383.h" - -using namespace core; - -namespace BLS12383 { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B384_58::BIG a, B384_58::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B384_58::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B384_58::BIG a,const B384_58::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B384_58::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_BLS12383_H +#define FP2_BLS12383_H + +#include "fp_BLS12383.h" + +using namespace core; + +namespace BLS12383 { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B384_58::BIG a, B384_58::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B384_58::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B384_58::BIG a,const B384_58::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B384_58::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS12443.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS12443.h index a4e8fd2..78f88e3 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS12443.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS12443.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_BLS12443_H -#define FP2_BLS12443_H - -#include "fp_BLS12443.h" - -using namespace core; - -namespace BLS12443 { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B448_60::BIG a, B448_60::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B448_60::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B448_60::BIG a,const B448_60::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B448_60::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_BLS12443_H +#define FP2_BLS12443_H + +#include "fp_BLS12443.h" + +using namespace core; + +namespace BLS12443 { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B448_60::BIG a, B448_60::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B448_60::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B448_60::BIG a,const B448_60::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B448_60::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS12461.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS12461.h index b1479eb..9487af4 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS12461.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS12461.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_BLS12461_H -#define FP2_BLS12461_H - -#include "fp_BLS12461.h" - -using namespace core; - -namespace BLS12461 { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B464_60::BIG a, B464_60::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B464_60::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B464_60::BIG a,const B464_60::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B464_60::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_BLS12461_H +#define FP2_BLS12461_H + +#include "fp_BLS12461.h" + +using namespace core; + +namespace BLS12461 { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B464_60::BIG a, B464_60::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B464_60::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B464_60::BIG a,const B464_60::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B464_60::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS24479.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS24479.h index a67e351..c4dde22 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS24479.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS24479.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_BLS24479_H -#define FP2_BLS24479_H - -#include "fp_BLS24479.h" - -using namespace core; - -namespace BLS24479 { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B480_56::BIG a, B480_56::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B480_56::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B480_56::BIG a,const B480_56::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B480_56::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_BLS24479_H +#define FP2_BLS24479_H + +#include "fp_BLS24479.h" + +using namespace core; + +namespace BLS24479 { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B480_56::BIG a, B480_56::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B480_56::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B480_56::BIG a,const B480_56::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B480_56::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS48286.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS48286.h index a5c6fce..7e15f39 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS48286.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS48286.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_BLS48286_H -#define FP2_BLS48286_H - -#include "fp_BLS48286.h" - -using namespace core; - -namespace BLS48286 { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B288_60::BIG a, B288_60::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B288_60::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B288_60::BIG a,const B288_60::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B288_60::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_BLS48286_H +#define FP2_BLS48286_H + +#include "fp_BLS48286.h" + +using namespace core; + +namespace BLS48286 { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B288_60::BIG a, B288_60::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B288_60::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B288_60::BIG a,const B288_60::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B288_60::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS48556.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS48556.h index a569c2d..665019b 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS48556.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS48556.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_BLS48556_H -#define FP2_BLS48556_H - -#include "fp_BLS48556.h" - -using namespace core; - -namespace BLS48556 { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B560_58::BIG a, B560_58::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B560_58::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B560_58::BIG a,const B560_58::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B560_58::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_BLS48556_H +#define FP2_BLS48556_H + +#include "fp_BLS48556.h" + +using namespace core; + +namespace BLS48556 { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B560_58::BIG a, B560_58::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B560_58::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B560_58::BIG a,const B560_58::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B560_58::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS48581.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS48581.h index ef3b7fd..b410455 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BLS48581.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BLS48581.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_BLS48581_H -#define FP2_BLS48581_H - -#include "fp_BLS48581.h" - -using namespace core; - -namespace BLS48581 { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B584_60::BIG a, B584_60::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B584_60::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B584_60::BIG a,const B584_60::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B584_60::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_BLS48581_H +#define FP2_BLS48581_H + +#include "fp_BLS48581.h" + +using namespace core; + +namespace BLS48581 { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B584_60::BIG a, B584_60::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B584_60::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B584_60::BIG a,const B584_60::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B584_60::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BN158.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BN158.h index 5904174..3a289b5 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BN158.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BN158.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_BN158_H -#define FP2_BN158_H - -#include "fp_BN158.h" - -using namespace core; - -namespace BN158 { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B160_56::BIG a, B160_56::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B160_56::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B160_56::BIG a,const B160_56::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B160_56::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_BN158_H +#define FP2_BN158_H + +#include "fp_BN158.h" + +using namespace core; + +namespace BN158 { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B160_56::BIG a, B160_56::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B160_56::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B160_56::BIG a,const B160_56::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B160_56::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BN254.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BN254.h index 2e2f476..e548c25 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BN254.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BN254.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_BN254_H -#define FP2_BN254_H - -#include "fp_BN254.h" - -using namespace core; - -namespace BN254 { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B256_56::BIG a, B256_56::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B256_56::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B256_56::BIG a,const B256_56::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B256_56::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_BN254_H +#define FP2_BN254_H + +#include "fp_BN254.h" + +using namespace core; + +namespace BN254 { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B256_56::BIG a, B256_56::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B256_56::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B256_56::BIG a,const B256_56::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B256_56::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BN254CX.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BN254CX.h index e3b65b2..3b84e46 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BN254CX.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BN254CX.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_BN254CX_H -#define FP2_BN254CX_H - -#include "fp_BN254CX.h" - -using namespace core; - -namespace BN254CX { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B256_56::BIG a, B256_56::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B256_56::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B256_56::BIG a,const B256_56::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B256_56::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_BN254CX_H +#define FP2_BN254CX_H + +#include "fp_BN254CX.h" + +using namespace core; + +namespace BN254CX { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B256_56::BIG a, B256_56::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B256_56::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B256_56::BIG a,const B256_56::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B256_56::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BN462.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BN462.h index eb096e0..b1cf3c5 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_BN462.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_BN462.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_BN462_H -#define FP2_BN462_H - -#include "fp_BN462.h" - -using namespace core; - -namespace BN462 { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B464_60::BIG a, B464_60::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B464_60::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B464_60::BIG a,const B464_60::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B464_60::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_BN462_H +#define FP2_BN462_H + +#include "fp_BN462.h" + +using namespace core; + +namespace BN462 { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B464_60::BIG a, B464_60::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B464_60::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B464_60::BIG a,const B464_60::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B464_60::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_FP256BN.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_FP256BN.h index 9b6d01f..e997b97 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_FP256BN.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_FP256BN.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_FP256BN_H -#define FP2_FP256BN_H - -#include "fp_FP256BN.h" - -using namespace core; - -namespace FP256BN { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B256_56::BIG a, B256_56::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B256_56::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B256_56::BIG a,const B256_56::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B256_56::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_FP256BN_H +#define FP2_FP256BN_H + +#include "fp_FP256BN.h" + +using namespace core; + +namespace FP256BN { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B256_56::BIG a, B256_56::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B256_56::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B256_56::BIG a,const B256_56::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B256_56::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_FP512BN.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_FP512BN.h index f7dc57d..afdd0ff 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2_FP512BN.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp2_FP512BN.h @@ -1,306 +1,306 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP2_FP512BN_H -#define FP2_FP512BN_H - -#include "fp_FP512BN.h" - -using namespace core; - -namespace FP512BN { - -/** - @brief FP2 Structure - quadratic extension field -*/ - -typedef struct -{ - FP a; /**< real part of FP2 */ - FP b; /**< imaginary part of FP2 */ -} FP2; - -/* FP2 prototypes */ - -/** @brief Tests for FP2 equal to zero - * - @param x FP2 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP2_iszilch(FP2 *x); - -/** @brief Tests for lexically larger - * - @param x FP2 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP2_islarger(FP2 *x); - - -/** @brief Serialize out FP2 - * - @param b buffer for output - @param x FP2 number to be serialized - */ -extern void FP2_toBytes(char *b,FP2 *x); - -/** @brief Serialize in FP2 - * - @param x FP2 number to be serialized - @param b buffer for input - */ -extern void FP2_fromBytes(FP2 *x,char *b); - -/** @brief Conditional copy of FP2 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP2 instance, set to y if s!=0 - @param y another FP2 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP2_cmove(FP2 *x, FP2 *y, int s); -/** @brief Tests for FP2 equal to one - * - @param x FP2 instance to be tested - @return 1 if x=1, else returns 0 - */ -extern int FP2_isunity(FP2 *x); -/** @brief Tests for equality of two FP2s - * - @param x FP2 instance to be compared - @param y FP2 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP2_equals(FP2 *x, FP2 *y); -/** @brief Initialise FP2 from two FP numbers - * - @param x FP2 instance to be initialised - @param a FP to form real part of FP2 - @param b FP to form imaginary part of FP2 - */ -extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); -/** @brief Initialise FP2 from two BIG integers - * - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - @param b BIG to form imaginary part of FP2 - */ -extern void FP2_from_BIGs(FP2 *x, B512_60::BIG a, B512_60::BIG b); - - -/** @brief Initialise FP2 from two integers - * - @param x FP2 instance to be initialised - @param a int to form real part of FP2 - @param b int to form imaginary part of FP2 - */ -extern void FP2_from_ints(FP2 *x, int a, int b); - - - -/** @brief Initialise FP2 from single FP - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param an FP to form real part of FP2 - */ -extern void FP2_from_FP(FP2 *x, FP *a); -/** @brief Initialise FP2 from single BIG - * - Imaginary part is set to zero - @param x FP2 instance to be initialised - @param a BIG to form real part of FP2 - */ -extern void FP2_from_BIG(FP2 *x, B512_60::BIG a); -/** @brief Copy FP2 to another FP2 - * - @param x FP2 instance, on exit = y - @param y FP2 instance to be copied - */ -extern void FP2_copy(FP2 *x, FP2 *y); -/** @brief Set FP2 to zero - * - @param x FP2 instance to be set to zero - */ -extern void FP2_zero(FP2 *x); -/** @brief Set FP2 to unity - * - @param x FP2 instance to be set to one - */ -extern void FP2_one(FP2 *x); - -/** @brief Copy from ROM to an FP2 - * - @param w FP2 number to be copied to - @param a BIG real part to be copied from ROM - @param b BIG imag part to be copied from ROM - */ -extern void FP2_rcopy(FP2 *w,const B512_60::BIG a,const B512_60::BIG b); - -/** @brief Sign of FP2 - * - @param x FP2 instance - @return "sign" of FP2 - */ -extern int FP2_sign(FP2 *x); - -/** @brief Negation of FP2 - * - @param x FP2 instance, on exit = -y - @param y FP2 instance - */ -extern void FP2_neg(FP2 *x, FP2 *y); - - -/** @brief Conjugation of FP2 - * - If y=(a,b) on exit x=(a,-b) - @param x FP2 instance, on exit = conj(y) - @param y FP2 instance - */ -extern void FP2_conj(FP2 *x, FP2 *y); -/** @brief addition of two FP2s - * - @param x FP2 instance, on exit = y+z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); -/** @brief subtraction of two FP2s - * - @param x FP2 instance, on exit = y-z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); -/** @brief Multiplication of an FP2 by an FP - * - @param x FP2 instance, on exit = y*b - @param y FP2 instance - @param b FP residue - */ -extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); -/** @brief Multiplication of an FP2 by a small integer - * - @param x FP2 instance, on exit = y*i - @param y FP2 instance - @param i an integer - */ -extern void FP2_imul(FP2 *x, FP2 *y, int i); -/** @brief Squaring an FP2 - * - @param x FP2 instance, on exit = y^2 - @param y FP2 instance - */ -extern void FP2_sqr(FP2 *x, FP2 *y); -/** @brief Multiplication of two FP2s - * - @param x FP2 instance, on exit = y*z - @param y FP2 instance - @param z FP2 instance - */ -extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); -/** @brief Formats and outputs an FP2 to the console - * - @param x FP2 instance - */ -extern void FP2_output(FP2 *x); -/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) - * - @param x FP2 instance - */ -extern void FP2_rawoutput(FP2 *x); -/** @brief Inverting an FP2 - * - @param x FP2 instance, on exit = 1/y - @param y FP2 instance - */ -extern void FP2_inv(FP2 *x, FP2 *y, FP *h); -/** @brief Divide an FP2 by 2 - * - @param x FP2 instance, on exit = y/2 - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_div2(FP2 *x, FP2 *y); -/** @brief Multiply an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x*(1+sqrt(-1)) - */ -extern void FP2_mul_ip(FP2 *x); - -/** @brief Divide an FP2 by (1+sqrt(-1)) - * - Note that (1+sqrt(-1)) is irreducible for FP4 - @param x FP2 instance, on exit = x/(1+sqrt(-1)) - */ -extern void FP2_div_ip(FP2 *x); -/** @brief Normalises the components of an FP2 - * - @param x FP2 instance to be normalised - */ -extern void FP2_norm(FP2 *x); -/** @brief Reduces all components of possibly unreduced FP2 mod Modulus - * - @param x FP2 instance, on exit reduced mod Modulus - */ -extern void FP2_reduce(FP2 *x); -/** @brief Raises an FP2 to the power of a BIG - * - @param x FP2 instance, on exit = y^b - @param y FP2 instance - @param b BIG number - */ -extern void FP2_pow(FP2 *x, FP2 *y, B512_60::BIG b); - -/** @brief Test FP2 for QR - * - @param x FP2 instance - @param h optional generated hint - @return true or false - */ -extern int FP2_qr(FP2 *x,FP *h); - - -/** @brief Square root of an FP2 - * - @param x FP2 instance, on exit = sqrt(y) - @param y FP2 instance - @param h optional input hint - */ -extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); - -/** @brief Multiply an FP2 by sqrt(-1) - * - Note that -1 is QNR - @param x FP2 instance, on exit = x*sqrt(-1) - */ -extern void FP2_times_i(FP2 *x); - -/** @brief Generate random FP2 - * - @param x random FP2 number - @param rng random number generator - */ -extern void FP2_rand(FP2 *x, core::csprng *rng); - -} - -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP2_FP512BN_H +#define FP2_FP512BN_H + +#include "fp_FP512BN.h" + +using namespace core; + +namespace FP512BN { + +/** + @brief FP2 Structure - quadratic extension field +*/ + +typedef struct +{ + FP a; /**< real part of FP2 */ + FP b; /**< imaginary part of FP2 */ +} FP2; + +/* FP2 prototypes */ + +/** @brief Tests for FP2 equal to zero + * + @param x FP2 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP2_iszilch(FP2 *x); + +/** @brief Tests for lexically larger + * + @param x FP2 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP2_islarger(FP2 *x); + + +/** @brief Serialize out FP2 + * + @param b buffer for output + @param x FP2 number to be serialized + */ +extern void FP2_toBytes(char *b,FP2 *x); + +/** @brief Serialize in FP2 + * + @param x FP2 number to be serialized + @param b buffer for input + */ +extern void FP2_fromBytes(FP2 *x,char *b); + +/** @brief Conditional copy of FP2 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP2 instance, set to y if s!=0 + @param y another FP2 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP2_cmove(FP2 *x, FP2 *y, int s); +/** @brief Tests for FP2 equal to one + * + @param x FP2 instance to be tested + @return 1 if x=1, else returns 0 + */ +extern int FP2_isunity(FP2 *x); +/** @brief Tests for equality of two FP2s + * + @param x FP2 instance to be compared + @param y FP2 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP2_equals(FP2 *x, FP2 *y); +/** @brief Initialise FP2 from two FP numbers + * + @param x FP2 instance to be initialised + @param a FP to form real part of FP2 + @param b FP to form imaginary part of FP2 + */ +extern void FP2_from_FPs(FP2 *x, FP *a, FP *b); +/** @brief Initialise FP2 from two BIG integers + * + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + @param b BIG to form imaginary part of FP2 + */ +extern void FP2_from_BIGs(FP2 *x, B512_60::BIG a, B512_60::BIG b); + + +/** @brief Initialise FP2 from two integers + * + @param x FP2 instance to be initialised + @param a int to form real part of FP2 + @param b int to form imaginary part of FP2 + */ +extern void FP2_from_ints(FP2 *x, int a, int b); + + + +/** @brief Initialise FP2 from single FP + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param an FP to form real part of FP2 + */ +extern void FP2_from_FP(FP2 *x, FP *a); +/** @brief Initialise FP2 from single BIG + * + Imaginary part is set to zero + @param x FP2 instance to be initialised + @param a BIG to form real part of FP2 + */ +extern void FP2_from_BIG(FP2 *x, B512_60::BIG a); +/** @brief Copy FP2 to another FP2 + * + @param x FP2 instance, on exit = y + @param y FP2 instance to be copied + */ +extern void FP2_copy(FP2 *x, FP2 *y); +/** @brief Set FP2 to zero + * + @param x FP2 instance to be set to zero + */ +extern void FP2_zero(FP2 *x); +/** @brief Set FP2 to unity + * + @param x FP2 instance to be set to one + */ +extern void FP2_one(FP2 *x); + +/** @brief Copy from ROM to an FP2 + * + @param w FP2 number to be copied to + @param a BIG real part to be copied from ROM + @param b BIG imag part to be copied from ROM + */ +extern void FP2_rcopy(FP2 *w,const B512_60::BIG a,const B512_60::BIG b); + +/** @brief Sign of FP2 + * + @param x FP2 instance + @return "sign" of FP2 + */ +extern int FP2_sign(FP2 *x); + +/** @brief Negation of FP2 + * + @param x FP2 instance, on exit = -y + @param y FP2 instance + */ +extern void FP2_neg(FP2 *x, FP2 *y); + + +/** @brief Conjugation of FP2 + * + If y=(a,b) on exit x=(a,-b) + @param x FP2 instance, on exit = conj(y) + @param y FP2 instance + */ +extern void FP2_conj(FP2 *x, FP2 *y); +/** @brief addition of two FP2s + * + @param x FP2 instance, on exit = y+z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_add(FP2 *x, FP2 *y, FP2 *z); +/** @brief subtraction of two FP2s + * + @param x FP2 instance, on exit = y-z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_sub(FP2 *x, FP2 *y, FP2 *z); +/** @brief Multiplication of an FP2 by an FP + * + @param x FP2 instance, on exit = y*b + @param y FP2 instance + @param b FP residue + */ +extern void FP2_pmul(FP2 *x, FP2 *y, FP *b); +/** @brief Multiplication of an FP2 by a small integer + * + @param x FP2 instance, on exit = y*i + @param y FP2 instance + @param i an integer + */ +extern void FP2_imul(FP2 *x, FP2 *y, int i); +/** @brief Squaring an FP2 + * + @param x FP2 instance, on exit = y^2 + @param y FP2 instance + */ +extern void FP2_sqr(FP2 *x, FP2 *y); +/** @brief Multiplication of two FP2s + * + @param x FP2 instance, on exit = y*z + @param y FP2 instance + @param z FP2 instance + */ +extern void FP2_mul(FP2 *x, FP2 *y, FP2 *z); +/** @brief Formats and outputs an FP2 to the console + * + @param x FP2 instance + */ +extern void FP2_output(FP2 *x); +/** @brief Formats and outputs an FP2 to the console in raw form (for debugging) + * + @param x FP2 instance + */ +extern void FP2_rawoutput(FP2 *x); +/** @brief Inverting an FP2 + * + @param x FP2 instance, on exit = 1/y + @param y FP2 instance + */ +extern void FP2_inv(FP2 *x, FP2 *y, FP *h); +/** @brief Divide an FP2 by 2 + * + @param x FP2 instance, on exit = y/2 + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_div2(FP2 *x, FP2 *y); +/** @brief Multiply an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x*(1+sqrt(-1)) + */ +extern void FP2_mul_ip(FP2 *x); + +/** @brief Divide an FP2 by (1+sqrt(-1)) + * + Note that (1+sqrt(-1)) is irreducible for FP4 + @param x FP2 instance, on exit = x/(1+sqrt(-1)) + */ +extern void FP2_div_ip(FP2 *x); +/** @brief Normalises the components of an FP2 + * + @param x FP2 instance to be normalised + */ +extern void FP2_norm(FP2 *x); +/** @brief Reduces all components of possibly unreduced FP2 mod Modulus + * + @param x FP2 instance, on exit reduced mod Modulus + */ +extern void FP2_reduce(FP2 *x); +/** @brief Raises an FP2 to the power of a BIG + * + @param x FP2 instance, on exit = y^b + @param y FP2 instance + @param b BIG number + */ +extern void FP2_pow(FP2 *x, FP2 *y, B512_60::BIG b); + +/** @brief Test FP2 for QR + * + @param x FP2 instance + @param h optional generated hint + @return true or false + */ +extern int FP2_qr(FP2 *x,FP *h); + + +/** @brief Square root of an FP2 + * + @param x FP2 instance, on exit = sqrt(y) + @param y FP2 instance + @param h optional input hint + */ +extern void FP2_sqrt(FP2 *x, FP2 *y, FP *h); + +/** @brief Multiply an FP2 by sqrt(-1) + * + Note that -1 is QNR + @param x FP2 instance, on exit = x*sqrt(-1) + */ +extern void FP2_times_i(FP2 *x); + +/** @brief Generate random FP2 + * + @param x random FP2 number + @param rng random number generator + */ +extern void FP2_rand(FP2 *x, core::csprng *rng); + +} + +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp4.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp48.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp48.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp48.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp48.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp48_BLS48286.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp48_BLS48286.h index 3179845..194fcb0 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48_BLS48286.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp48_BLS48286.h @@ -1,231 +1,231 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP48_BLS48286_H -#define FP48_BLS48286_H - -#include "fp16_BLS48286.h" - -using namespace core; - -namespace BLS48286 { -/** - @brief FP12 Structure - towered over three FP16 -*/ - -typedef struct -{ - FP16 a; /**< first part of FP12 */ - FP16 b; /**< second part of FP12 */ - FP16 c; /**< third part of FP12 */ - int type; -} FP48; - -extern const B288_60::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B288_60::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP48 prototypes */ -/** @brief Tests for FP48 equal to zero - * - @param x FP48 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP48_iszilch(FP48 *x); -/** @brief Tests for FP48 equal to unity - * - @param x FP48 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP48_isunity(FP48 *x); -/** @brief Copy FP48 to another FP48 - * - @param x FP48 instance, on exit = y - @param y FP48 instance to be copied - */ -extern void FP48_copy(FP48 *x, FP48 *y); -/** @brief Set FP48 to unity - * - @param x FP48 instance to be set to one - */ -extern void FP48_one(FP48 *x); - -/** @brief Set FP48 to zero - * - @param x FP48 instance to be set to zero - */ -extern void FP48_zero(FP48 *x); - -/** @brief Tests for equality of two FP48s - * - @param x FP48 instance to be compared - @param y FP48 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP48_equals(FP48 *x, FP48 *y); -/** @brief Conjugation of FP48 - * - If y=(a,b,c) (where a,b,c are its three FP16 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP48 instance, on exit = conj(y) - @param y FP48 instance - */ -extern void FP48_conj(FP48 *x, FP48 *y); -/** @brief Initialise FP48 from single FP16 - * - Sets first FP16 component of an FP48, other components set to zero - @param x FP48 instance to be initialised - @param a FP16 to form first part of FP48 - */ -extern void FP48_from_FP16(FP48 *x, FP16 *a); -/** @brief Initialise FP48 from three FP16s - * - @param x FP48 instance to be initialised - @param a FP16 to form first part of FP48 - @param b FP16 to form second part of FP48 - @param c FP16 to form third part of FP48 - */ -extern void FP48_from_FP16s(FP48 *x, FP16 *a, FP16* b, FP16 *c); -/** @brief Fast Squaring of an FP48 in "unitary" form - * - @param x FP48 instance, on exit = y^2 - @param y FP16 instance, must be unitary - */ -extern void FP48_usqr(FP48 *x, FP48 *y); -/** @brief Squaring an FP48 - * - @param x FP48 instance, on exit = y^2 - @param y FP48 instance - */ -extern void FP48_sqr(FP48 *x, FP48 *y); -/** @brief Fast multiplication of two sparse FP24s that arises from ATE pairing line functions - * - @param x FP48 instance, on exit = x*y - @param y FP48 instance, of special form - */ -extern void FP48_smul(FP48 *x, FP48 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP48 instance, on exit = x*y - @param y FP48 instance, of special form - */ -extern void FP48_ssmul(FP48 *x, FP48 *y); -/** @brief Full unconditional Multiplication of two FP24s - * - @param x FP48 instance, on exit = x*y - @param y FP48 instance, the multiplier - */ -extern void FP48_mul(FP48 *x, FP48 *y); -/** @brief Inverting an FP48 - * - @param x FP48 instance, on exit = 1/y - @param y FP48 instance - */ -extern void FP48_inv(FP48 *x, FP48 *y); -/** @brief Raises an FP48 to the power of a BIG - * - @param r FP48 instance, on exit = y^b - @param x FP48 instance - @param b BIG number - */ -extern void FP48_pow(FP48 *r, FP48 *x, B288_60::BIG b); - -//extern void FP48_ppow(FP48 *r,FP48 *x,B288_60::BIG b); - -/** @brief Raises an FP48 instance x to a small integer power, side-channel resistant - * - @param x FP48 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP48_pinpow(FP48 *x, int i, int b); - -/** @brief Raises an FP48 instance x to a BIG power, compressed to FP16 - * - @param c FP16 instance, on exit = x^(e mod r) as FP16 - @param x FP48 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP48_compow(FP16 *c, FP48 *x, B288_60::BIG e, B288_60::BIG r); - -/** @brief Calculate Pi x[i]^b[i] for i=0 to 15, side-channel resistant - * - @param r FP48 instance, on exit = Pi x[i]^b[i] for i=0 to 15 - @param x FP48 array with 16 FP48s - @param b BIG array of 16 exponents - */ -extern void FP48_pow16(FP48 *r, FP48 *x, B288_60::BIG *b); - - -/** @brief Raises an FP48 to the power of the internal modulus p, using the Frobenius - * - @param x FP48 instance, on exit = x^p^n - @param f FP2 precalculated Frobenius constant - @param n power of p - */ -extern void FP48_frob(FP48 *x, FP2 *f, int n); - -/** @brief Reduces all components of possibly unreduced FP48 mod Modulus - * - @param x FP48 instance, on exit reduced mod Modulus - */ -extern void FP48_reduce(FP48 *x); -/** @brief Normalises the components of an FP48 - * - @param x FP48 instance to be normalised - */ -extern void FP48_norm(FP48 *x); -/** @brief Formats and outputs an FP48 to the console - * - @param x FP48 instance to be printed - */ -extern void FP48_output(FP48 *x); -/** @brief Formats and outputs an FP48 instance to an octet string - * - Serializes the components of an FP48 to big-endian base 256 form. - @param S output octet string - @param x FP48 instance to be converted to an octet string - */ -extern void FP48_toOctet(octet *S, FP48 *x); -/** @brief Creates an FP48 instance from an octet string - * - De-serializes the components of an FP48 to create an FP48 from big-endian base 256 components. - @param x FP48 instance to be created from an octet string - @param S input octet string - - */ -extern void FP48_fromOctet(FP48 *x, octet *S); -/** @brief Calculate the trace of an FP48 - * - @param t FP16 trace of x, on exit = tr(x) - @param x FP48 instance - - */ -extern void FP48_trace(FP16 *t, FP48 *x); - -/** @brief Conditional copy of FP48 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP48 instance, set to y if s!=0 - @param y another FP48 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP48_cmove(FP48 *x, FP48 *y, int s); -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP48_BLS48286_H +#define FP48_BLS48286_H + +#include "fp16_BLS48286.h" + +using namespace core; + +namespace BLS48286 { +/** + @brief FP12 Structure - towered over three FP16 +*/ + +typedef struct +{ + FP16 a; /**< first part of FP12 */ + FP16 b; /**< second part of FP12 */ + FP16 c; /**< third part of FP12 */ + int type; +} FP48; + +extern const B288_60::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B288_60::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP48 prototypes */ +/** @brief Tests for FP48 equal to zero + * + @param x FP48 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP48_iszilch(FP48 *x); +/** @brief Tests for FP48 equal to unity + * + @param x FP48 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP48_isunity(FP48 *x); +/** @brief Copy FP48 to another FP48 + * + @param x FP48 instance, on exit = y + @param y FP48 instance to be copied + */ +extern void FP48_copy(FP48 *x, FP48 *y); +/** @brief Set FP48 to unity + * + @param x FP48 instance to be set to one + */ +extern void FP48_one(FP48 *x); + +/** @brief Set FP48 to zero + * + @param x FP48 instance to be set to zero + */ +extern void FP48_zero(FP48 *x); + +/** @brief Tests for equality of two FP48s + * + @param x FP48 instance to be compared + @param y FP48 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP48_equals(FP48 *x, FP48 *y); +/** @brief Conjugation of FP48 + * + If y=(a,b,c) (where a,b,c are its three FP16 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP48 instance, on exit = conj(y) + @param y FP48 instance + */ +extern void FP48_conj(FP48 *x, FP48 *y); +/** @brief Initialise FP48 from single FP16 + * + Sets first FP16 component of an FP48, other components set to zero + @param x FP48 instance to be initialised + @param a FP16 to form first part of FP48 + */ +extern void FP48_from_FP16(FP48 *x, FP16 *a); +/** @brief Initialise FP48 from three FP16s + * + @param x FP48 instance to be initialised + @param a FP16 to form first part of FP48 + @param b FP16 to form second part of FP48 + @param c FP16 to form third part of FP48 + */ +extern void FP48_from_FP16s(FP48 *x, FP16 *a, FP16* b, FP16 *c); +/** @brief Fast Squaring of an FP48 in "unitary" form + * + @param x FP48 instance, on exit = y^2 + @param y FP16 instance, must be unitary + */ +extern void FP48_usqr(FP48 *x, FP48 *y); +/** @brief Squaring an FP48 + * + @param x FP48 instance, on exit = y^2 + @param y FP48 instance + */ +extern void FP48_sqr(FP48 *x, FP48 *y); +/** @brief Fast multiplication of two sparse FP24s that arises from ATE pairing line functions + * + @param x FP48 instance, on exit = x*y + @param y FP48 instance, of special form + */ +extern void FP48_smul(FP48 *x, FP48 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP48 instance, on exit = x*y + @param y FP48 instance, of special form + */ +extern void FP48_ssmul(FP48 *x, FP48 *y); +/** @brief Full unconditional Multiplication of two FP24s + * + @param x FP48 instance, on exit = x*y + @param y FP48 instance, the multiplier + */ +extern void FP48_mul(FP48 *x, FP48 *y); +/** @brief Inverting an FP48 + * + @param x FP48 instance, on exit = 1/y + @param y FP48 instance + */ +extern void FP48_inv(FP48 *x, FP48 *y); +/** @brief Raises an FP48 to the power of a BIG + * + @param r FP48 instance, on exit = y^b + @param x FP48 instance + @param b BIG number + */ +extern void FP48_pow(FP48 *r, FP48 *x, B288_60::BIG b); + +//extern void FP48_ppow(FP48 *r,FP48 *x,B288_60::BIG b); + +/** @brief Raises an FP48 instance x to a small integer power, side-channel resistant + * + @param x FP48 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP48_pinpow(FP48 *x, int i, int b); + +/** @brief Raises an FP48 instance x to a BIG power, compressed to FP16 + * + @param c FP16 instance, on exit = x^(e mod r) as FP16 + @param x FP48 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP48_compow(FP16 *c, FP48 *x, B288_60::BIG e, B288_60::BIG r); + +/** @brief Calculate Pi x[i]^b[i] for i=0 to 15, side-channel resistant + * + @param r FP48 instance, on exit = Pi x[i]^b[i] for i=0 to 15 + @param x FP48 array with 16 FP48s + @param b BIG array of 16 exponents + */ +extern void FP48_pow16(FP48 *r, FP48 *x, B288_60::BIG *b); + + +/** @brief Raises an FP48 to the power of the internal modulus p, using the Frobenius + * + @param x FP48 instance, on exit = x^p^n + @param f FP2 precalculated Frobenius constant + @param n power of p + */ +extern void FP48_frob(FP48 *x, FP2 *f, int n); + +/** @brief Reduces all components of possibly unreduced FP48 mod Modulus + * + @param x FP48 instance, on exit reduced mod Modulus + */ +extern void FP48_reduce(FP48 *x); +/** @brief Normalises the components of an FP48 + * + @param x FP48 instance to be normalised + */ +extern void FP48_norm(FP48 *x); +/** @brief Formats and outputs an FP48 to the console + * + @param x FP48 instance to be printed + */ +extern void FP48_output(FP48 *x); +/** @brief Formats and outputs an FP48 instance to an octet string + * + Serializes the components of an FP48 to big-endian base 256 form. + @param S output octet string + @param x FP48 instance to be converted to an octet string + */ +extern void FP48_toOctet(octet *S, FP48 *x); +/** @brief Creates an FP48 instance from an octet string + * + De-serializes the components of an FP48 to create an FP48 from big-endian base 256 components. + @param x FP48 instance to be created from an octet string + @param S input octet string + + */ +extern void FP48_fromOctet(FP48 *x, octet *S); +/** @brief Calculate the trace of an FP48 + * + @param t FP16 trace of x, on exit = tr(x) + @param x FP48 instance + + */ +extern void FP48_trace(FP16 *t, FP48 *x); + +/** @brief Conditional copy of FP48 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP48 instance, set to y if s!=0 + @param y another FP48 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP48_cmove(FP48 *x, FP48 *y, int s); +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp48_BLS48556.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp48_BLS48556.h index c473883..cca9e44 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48_BLS48556.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp48_BLS48556.h @@ -1,231 +1,231 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP48_BLS48556_H -#define FP48_BLS48556_H - -#include "fp16_BLS48556.h" - -using namespace core; - -namespace BLS48556 { -/** - @brief FP12 Structure - towered over three FP16 -*/ - -typedef struct -{ - FP16 a; /**< first part of FP12 */ - FP16 b; /**< second part of FP12 */ - FP16 c; /**< third part of FP12 */ - int type; -} FP48; - -extern const B560_58::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B560_58::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP48 prototypes */ -/** @brief Tests for FP48 equal to zero - * - @param x FP48 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP48_iszilch(FP48 *x); -/** @brief Tests for FP48 equal to unity - * - @param x FP48 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP48_isunity(FP48 *x); -/** @brief Copy FP48 to another FP48 - * - @param x FP48 instance, on exit = y - @param y FP48 instance to be copied - */ -extern void FP48_copy(FP48 *x, FP48 *y); -/** @brief Set FP48 to unity - * - @param x FP48 instance to be set to one - */ -extern void FP48_one(FP48 *x); - -/** @brief Set FP48 to zero - * - @param x FP48 instance to be set to zero - */ -extern void FP48_zero(FP48 *x); - -/** @brief Tests for equality of two FP48s - * - @param x FP48 instance to be compared - @param y FP48 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP48_equals(FP48 *x, FP48 *y); -/** @brief Conjugation of FP48 - * - If y=(a,b,c) (where a,b,c are its three FP16 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP48 instance, on exit = conj(y) - @param y FP48 instance - */ -extern void FP48_conj(FP48 *x, FP48 *y); -/** @brief Initialise FP48 from single FP16 - * - Sets first FP16 component of an FP48, other components set to zero - @param x FP48 instance to be initialised - @param a FP16 to form first part of FP48 - */ -extern void FP48_from_FP16(FP48 *x, FP16 *a); -/** @brief Initialise FP48 from three FP16s - * - @param x FP48 instance to be initialised - @param a FP16 to form first part of FP48 - @param b FP16 to form second part of FP48 - @param c FP16 to form third part of FP48 - */ -extern void FP48_from_FP16s(FP48 *x, FP16 *a, FP16* b, FP16 *c); -/** @brief Fast Squaring of an FP48 in "unitary" form - * - @param x FP48 instance, on exit = y^2 - @param y FP16 instance, must be unitary - */ -extern void FP48_usqr(FP48 *x, FP48 *y); -/** @brief Squaring an FP48 - * - @param x FP48 instance, on exit = y^2 - @param y FP48 instance - */ -extern void FP48_sqr(FP48 *x, FP48 *y); -/** @brief Fast multiplication of two sparse FP24s that arises from ATE pairing line functions - * - @param x FP48 instance, on exit = x*y - @param y FP48 instance, of special form - */ -extern void FP48_smul(FP48 *x, FP48 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP48 instance, on exit = x*y - @param y FP48 instance, of special form - */ -extern void FP48_ssmul(FP48 *x, FP48 *y); -/** @brief Full unconditional Multiplication of two FP24s - * - @param x FP48 instance, on exit = x*y - @param y FP48 instance, the multiplier - */ -extern void FP48_mul(FP48 *x, FP48 *y); -/** @brief Inverting an FP48 - * - @param x FP48 instance, on exit = 1/y - @param y FP48 instance - */ -extern void FP48_inv(FP48 *x, FP48 *y); -/** @brief Raises an FP48 to the power of a BIG - * - @param r FP48 instance, on exit = y^b - @param x FP48 instance - @param b BIG number - */ -extern void FP48_pow(FP48 *r, FP48 *x, B560_58::BIG b); - -//extern void FP48_ppow(FP48 *r,FP48 *x,B560_58::BIG b); - -/** @brief Raises an FP48 instance x to a small integer power, side-channel resistant - * - @param x FP48 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP48_pinpow(FP48 *x, int i, int b); - -/** @brief Raises an FP48 instance x to a BIG power, compressed to FP16 - * - @param c FP16 instance, on exit = x^(e mod r) as FP16 - @param x FP48 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP48_compow(FP16 *c, FP48 *x, B560_58::BIG e, B560_58::BIG r); - -/** @brief Calculate Pi x[i]^b[i] for i=0 to 15, side-channel resistant - * - @param r FP48 instance, on exit = Pi x[i]^b[i] for i=0 to 15 - @param x FP48 array with 16 FP48s - @param b BIG array of 16 exponents - */ -extern void FP48_pow16(FP48 *r, FP48 *x, B560_58::BIG *b); - - -/** @brief Raises an FP48 to the power of the internal modulus p, using the Frobenius - * - @param x FP48 instance, on exit = x^p^n - @param f FP2 precalculated Frobenius constant - @param n power of p - */ -extern void FP48_frob(FP48 *x, FP2 *f, int n); - -/** @brief Reduces all components of possibly unreduced FP48 mod Modulus - * - @param x FP48 instance, on exit reduced mod Modulus - */ -extern void FP48_reduce(FP48 *x); -/** @brief Normalises the components of an FP48 - * - @param x FP48 instance to be normalised - */ -extern void FP48_norm(FP48 *x); -/** @brief Formats and outputs an FP48 to the console - * - @param x FP48 instance to be printed - */ -extern void FP48_output(FP48 *x); -/** @brief Formats and outputs an FP48 instance to an octet string - * - Serializes the components of an FP48 to big-endian base 256 form. - @param S output octet string - @param x FP48 instance to be converted to an octet string - */ -extern void FP48_toOctet(octet *S, FP48 *x); -/** @brief Creates an FP48 instance from an octet string - * - De-serializes the components of an FP48 to create an FP48 from big-endian base 256 components. - @param x FP48 instance to be created from an octet string - @param S input octet string - - */ -extern void FP48_fromOctet(FP48 *x, octet *S); -/** @brief Calculate the trace of an FP48 - * - @param t FP16 trace of x, on exit = tr(x) - @param x FP48 instance - - */ -extern void FP48_trace(FP16 *t, FP48 *x); - -/** @brief Conditional copy of FP48 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP48 instance, set to y if s!=0 - @param y another FP48 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP48_cmove(FP48 *x, FP48 *y, int s); -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP48_BLS48556_H +#define FP48_BLS48556_H + +#include "fp16_BLS48556.h" + +using namespace core; + +namespace BLS48556 { +/** + @brief FP12 Structure - towered over three FP16 +*/ + +typedef struct +{ + FP16 a; /**< first part of FP12 */ + FP16 b; /**< second part of FP12 */ + FP16 c; /**< third part of FP12 */ + int type; +} FP48; + +extern const B560_58::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B560_58::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP48 prototypes */ +/** @brief Tests for FP48 equal to zero + * + @param x FP48 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP48_iszilch(FP48 *x); +/** @brief Tests for FP48 equal to unity + * + @param x FP48 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP48_isunity(FP48 *x); +/** @brief Copy FP48 to another FP48 + * + @param x FP48 instance, on exit = y + @param y FP48 instance to be copied + */ +extern void FP48_copy(FP48 *x, FP48 *y); +/** @brief Set FP48 to unity + * + @param x FP48 instance to be set to one + */ +extern void FP48_one(FP48 *x); + +/** @brief Set FP48 to zero + * + @param x FP48 instance to be set to zero + */ +extern void FP48_zero(FP48 *x); + +/** @brief Tests for equality of two FP48s + * + @param x FP48 instance to be compared + @param y FP48 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP48_equals(FP48 *x, FP48 *y); +/** @brief Conjugation of FP48 + * + If y=(a,b,c) (where a,b,c are its three FP16 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP48 instance, on exit = conj(y) + @param y FP48 instance + */ +extern void FP48_conj(FP48 *x, FP48 *y); +/** @brief Initialise FP48 from single FP16 + * + Sets first FP16 component of an FP48, other components set to zero + @param x FP48 instance to be initialised + @param a FP16 to form first part of FP48 + */ +extern void FP48_from_FP16(FP48 *x, FP16 *a); +/** @brief Initialise FP48 from three FP16s + * + @param x FP48 instance to be initialised + @param a FP16 to form first part of FP48 + @param b FP16 to form second part of FP48 + @param c FP16 to form third part of FP48 + */ +extern void FP48_from_FP16s(FP48 *x, FP16 *a, FP16* b, FP16 *c); +/** @brief Fast Squaring of an FP48 in "unitary" form + * + @param x FP48 instance, on exit = y^2 + @param y FP16 instance, must be unitary + */ +extern void FP48_usqr(FP48 *x, FP48 *y); +/** @brief Squaring an FP48 + * + @param x FP48 instance, on exit = y^2 + @param y FP48 instance + */ +extern void FP48_sqr(FP48 *x, FP48 *y); +/** @brief Fast multiplication of two sparse FP24s that arises from ATE pairing line functions + * + @param x FP48 instance, on exit = x*y + @param y FP48 instance, of special form + */ +extern void FP48_smul(FP48 *x, FP48 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP48 instance, on exit = x*y + @param y FP48 instance, of special form + */ +extern void FP48_ssmul(FP48 *x, FP48 *y); +/** @brief Full unconditional Multiplication of two FP24s + * + @param x FP48 instance, on exit = x*y + @param y FP48 instance, the multiplier + */ +extern void FP48_mul(FP48 *x, FP48 *y); +/** @brief Inverting an FP48 + * + @param x FP48 instance, on exit = 1/y + @param y FP48 instance + */ +extern void FP48_inv(FP48 *x, FP48 *y); +/** @brief Raises an FP48 to the power of a BIG + * + @param r FP48 instance, on exit = y^b + @param x FP48 instance + @param b BIG number + */ +extern void FP48_pow(FP48 *r, FP48 *x, B560_58::BIG b); + +//extern void FP48_ppow(FP48 *r,FP48 *x,B560_58::BIG b); + +/** @brief Raises an FP48 instance x to a small integer power, side-channel resistant + * + @param x FP48 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP48_pinpow(FP48 *x, int i, int b); + +/** @brief Raises an FP48 instance x to a BIG power, compressed to FP16 + * + @param c FP16 instance, on exit = x^(e mod r) as FP16 + @param x FP48 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP48_compow(FP16 *c, FP48 *x, B560_58::BIG e, B560_58::BIG r); + +/** @brief Calculate Pi x[i]^b[i] for i=0 to 15, side-channel resistant + * + @param r FP48 instance, on exit = Pi x[i]^b[i] for i=0 to 15 + @param x FP48 array with 16 FP48s + @param b BIG array of 16 exponents + */ +extern void FP48_pow16(FP48 *r, FP48 *x, B560_58::BIG *b); + + +/** @brief Raises an FP48 to the power of the internal modulus p, using the Frobenius + * + @param x FP48 instance, on exit = x^p^n + @param f FP2 precalculated Frobenius constant + @param n power of p + */ +extern void FP48_frob(FP48 *x, FP2 *f, int n); + +/** @brief Reduces all components of possibly unreduced FP48 mod Modulus + * + @param x FP48 instance, on exit reduced mod Modulus + */ +extern void FP48_reduce(FP48 *x); +/** @brief Normalises the components of an FP48 + * + @param x FP48 instance to be normalised + */ +extern void FP48_norm(FP48 *x); +/** @brief Formats and outputs an FP48 to the console + * + @param x FP48 instance to be printed + */ +extern void FP48_output(FP48 *x); +/** @brief Formats and outputs an FP48 instance to an octet string + * + Serializes the components of an FP48 to big-endian base 256 form. + @param S output octet string + @param x FP48 instance to be converted to an octet string + */ +extern void FP48_toOctet(octet *S, FP48 *x); +/** @brief Creates an FP48 instance from an octet string + * + De-serializes the components of an FP48 to create an FP48 from big-endian base 256 components. + @param x FP48 instance to be created from an octet string + @param S input octet string + + */ +extern void FP48_fromOctet(FP48 *x, octet *S); +/** @brief Calculate the trace of an FP48 + * + @param t FP16 trace of x, on exit = tr(x) + @param x FP48 instance + + */ +extern void FP48_trace(FP16 *t, FP48 *x); + +/** @brief Conditional copy of FP48 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP48 instance, set to y if s!=0 + @param y another FP48 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP48_cmove(FP48 *x, FP48 *y, int s); +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp48_BLS48581.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp48_BLS48581.h index c00bcd1..fdf7627 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48_BLS48581.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp48_BLS48581.h @@ -1,231 +1,231 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP48_BLS48581_H -#define FP48_BLS48581_H - -#include "fp16_BLS48581.h" - -using namespace core; - -namespace BLS48581 { -/** - @brief FP12 Structure - towered over three FP16 -*/ - -typedef struct -{ - FP16 a; /**< first part of FP12 */ - FP16 b; /**< second part of FP12 */ - FP16 c; /**< third part of FP12 */ - int type; -} FP48; - -extern const B584_60::BIG Fra; /**< real part of BN curve Frobenius Constant */ -extern const B584_60::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ - -/* FP48 prototypes */ -/** @brief Tests for FP48 equal to zero - * - @param x FP48 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP48_iszilch(FP48 *x); -/** @brief Tests for FP48 equal to unity - * - @param x FP48 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP48_isunity(FP48 *x); -/** @brief Copy FP48 to another FP48 - * - @param x FP48 instance, on exit = y - @param y FP48 instance to be copied - */ -extern void FP48_copy(FP48 *x, FP48 *y); -/** @brief Set FP48 to unity - * - @param x FP48 instance to be set to one - */ -extern void FP48_one(FP48 *x); - -/** @brief Set FP48 to zero - * - @param x FP48 instance to be set to zero - */ -extern void FP48_zero(FP48 *x); - -/** @brief Tests for equality of two FP48s - * - @param x FP48 instance to be compared - @param y FP48 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP48_equals(FP48 *x, FP48 *y); -/** @brief Conjugation of FP48 - * - If y=(a,b,c) (where a,b,c are its three FP16 components) on exit x=(conj(a),-conj(b),conj(c)) - @param x FP48 instance, on exit = conj(y) - @param y FP48 instance - */ -extern void FP48_conj(FP48 *x, FP48 *y); -/** @brief Initialise FP48 from single FP16 - * - Sets first FP16 component of an FP48, other components set to zero - @param x FP48 instance to be initialised - @param a FP16 to form first part of FP48 - */ -extern void FP48_from_FP16(FP48 *x, FP16 *a); -/** @brief Initialise FP48 from three FP16s - * - @param x FP48 instance to be initialised - @param a FP16 to form first part of FP48 - @param b FP16 to form second part of FP48 - @param c FP16 to form third part of FP48 - */ -extern void FP48_from_FP16s(FP48 *x, FP16 *a, FP16* b, FP16 *c); -/** @brief Fast Squaring of an FP48 in "unitary" form - * - @param x FP48 instance, on exit = y^2 - @param y FP16 instance, must be unitary - */ -extern void FP48_usqr(FP48 *x, FP48 *y); -/** @brief Squaring an FP48 - * - @param x FP48 instance, on exit = y^2 - @param y FP48 instance - */ -extern void FP48_sqr(FP48 *x, FP48 *y); -/** @brief Fast multiplication of two sparse FP24s that arises from ATE pairing line functions - * - @param x FP48 instance, on exit = x*y - @param y FP48 instance, of special form - */ -extern void FP48_smul(FP48 *x, FP48 *y); - -/** @brief Fast multiplication of what may be sparse multiplicands - * - @param x FP48 instance, on exit = x*y - @param y FP48 instance, of special form - */ -extern void FP48_ssmul(FP48 *x, FP48 *y); -/** @brief Full unconditional Multiplication of two FP24s - * - @param x FP48 instance, on exit = x*y - @param y FP48 instance, the multiplier - */ -extern void FP48_mul(FP48 *x, FP48 *y); -/** @brief Inverting an FP48 - * - @param x FP48 instance, on exit = 1/y - @param y FP48 instance - */ -extern void FP48_inv(FP48 *x, FP48 *y); -/** @brief Raises an FP48 to the power of a BIG - * - @param r FP48 instance, on exit = y^b - @param x FP48 instance - @param b BIG number - */ -extern void FP48_pow(FP48 *r, FP48 *x, B584_60::BIG b); - -//extern void FP48_ppow(FP48 *r,FP48 *x,B584_60::BIG b); - -/** @brief Raises an FP48 instance x to a small integer power, side-channel resistant - * - @param x FP48 instance, on exit = x^i - @param i small integer exponent - @param b maximum number of bits in exponent - */ -extern void FP48_pinpow(FP48 *x, int i, int b); - -/** @brief Raises an FP48 instance x to a BIG power, compressed to FP16 - * - @param c FP16 instance, on exit = x^(e mod r) as FP16 - @param x FP48 input - @param e BIG exponent - @param r BIG group order - */ -extern void FP48_compow(FP16 *c, FP48 *x, B584_60::BIG e, B584_60::BIG r); - -/** @brief Calculate Pi x[i]^b[i] for i=0 to 15, side-channel resistant - * - @param r FP48 instance, on exit = Pi x[i]^b[i] for i=0 to 15 - @param x FP48 array with 16 FP48s - @param b BIG array of 16 exponents - */ -extern void FP48_pow16(FP48 *r, FP48 *x, B584_60::BIG *b); - - -/** @brief Raises an FP48 to the power of the internal modulus p, using the Frobenius - * - @param x FP48 instance, on exit = x^p^n - @param f FP2 precalculated Frobenius constant - @param n power of p - */ -extern void FP48_frob(FP48 *x, FP2 *f, int n); - -/** @brief Reduces all components of possibly unreduced FP48 mod Modulus - * - @param x FP48 instance, on exit reduced mod Modulus - */ -extern void FP48_reduce(FP48 *x); -/** @brief Normalises the components of an FP48 - * - @param x FP48 instance to be normalised - */ -extern void FP48_norm(FP48 *x); -/** @brief Formats and outputs an FP48 to the console - * - @param x FP48 instance to be printed - */ -extern void FP48_output(FP48 *x); -/** @brief Formats and outputs an FP48 instance to an octet string - * - Serializes the components of an FP48 to big-endian base 256 form. - @param S output octet string - @param x FP48 instance to be converted to an octet string - */ -extern void FP48_toOctet(octet *S, FP48 *x); -/** @brief Creates an FP48 instance from an octet string - * - De-serializes the components of an FP48 to create an FP48 from big-endian base 256 components. - @param x FP48 instance to be created from an octet string - @param S input octet string - - */ -extern void FP48_fromOctet(FP48 *x, octet *S); -/** @brief Calculate the trace of an FP48 - * - @param t FP16 trace of x, on exit = tr(x) - @param x FP48 instance - - */ -extern void FP48_trace(FP16 *t, FP48 *x); - -/** @brief Conditional copy of FP48 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP48 instance, set to y if s!=0 - @param y another FP48 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP48_cmove(FP48 *x, FP48 *y, int s); -} -#endif +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP48_BLS48581_H +#define FP48_BLS48581_H + +#include "fp16_BLS48581.h" + +using namespace core; + +namespace BLS48581 { +/** + @brief FP12 Structure - towered over three FP16 +*/ + +typedef struct +{ + FP16 a; /**< first part of FP12 */ + FP16 b; /**< second part of FP12 */ + FP16 c; /**< third part of FP12 */ + int type; +} FP48; + +extern const B584_60::BIG Fra; /**< real part of BN curve Frobenius Constant */ +extern const B584_60::BIG Frb; /**< imaginary part of BN curve Frobenius Constant */ + +/* FP48 prototypes */ +/** @brief Tests for FP48 equal to zero + * + @param x FP48 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP48_iszilch(FP48 *x); +/** @brief Tests for FP48 equal to unity + * + @param x FP48 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP48_isunity(FP48 *x); +/** @brief Copy FP48 to another FP48 + * + @param x FP48 instance, on exit = y + @param y FP48 instance to be copied + */ +extern void FP48_copy(FP48 *x, FP48 *y); +/** @brief Set FP48 to unity + * + @param x FP48 instance to be set to one + */ +extern void FP48_one(FP48 *x); + +/** @brief Set FP48 to zero + * + @param x FP48 instance to be set to zero + */ +extern void FP48_zero(FP48 *x); + +/** @brief Tests for equality of two FP48s + * + @param x FP48 instance to be compared + @param y FP48 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP48_equals(FP48 *x, FP48 *y); +/** @brief Conjugation of FP48 + * + If y=(a,b,c) (where a,b,c are its three FP16 components) on exit x=(conj(a),-conj(b),conj(c)) + @param x FP48 instance, on exit = conj(y) + @param y FP48 instance + */ +extern void FP48_conj(FP48 *x, FP48 *y); +/** @brief Initialise FP48 from single FP16 + * + Sets first FP16 component of an FP48, other components set to zero + @param x FP48 instance to be initialised + @param a FP16 to form first part of FP48 + */ +extern void FP48_from_FP16(FP48 *x, FP16 *a); +/** @brief Initialise FP48 from three FP16s + * + @param x FP48 instance to be initialised + @param a FP16 to form first part of FP48 + @param b FP16 to form second part of FP48 + @param c FP16 to form third part of FP48 + */ +extern void FP48_from_FP16s(FP48 *x, FP16 *a, FP16* b, FP16 *c); +/** @brief Fast Squaring of an FP48 in "unitary" form + * + @param x FP48 instance, on exit = y^2 + @param y FP16 instance, must be unitary + */ +extern void FP48_usqr(FP48 *x, FP48 *y); +/** @brief Squaring an FP48 + * + @param x FP48 instance, on exit = y^2 + @param y FP48 instance + */ +extern void FP48_sqr(FP48 *x, FP48 *y); +/** @brief Fast multiplication of two sparse FP24s that arises from ATE pairing line functions + * + @param x FP48 instance, on exit = x*y + @param y FP48 instance, of special form + */ +extern void FP48_smul(FP48 *x, FP48 *y); + +/** @brief Fast multiplication of what may be sparse multiplicands + * + @param x FP48 instance, on exit = x*y + @param y FP48 instance, of special form + */ +extern void FP48_ssmul(FP48 *x, FP48 *y); +/** @brief Full unconditional Multiplication of two FP24s + * + @param x FP48 instance, on exit = x*y + @param y FP48 instance, the multiplier + */ +extern void FP48_mul(FP48 *x, FP48 *y); +/** @brief Inverting an FP48 + * + @param x FP48 instance, on exit = 1/y + @param y FP48 instance + */ +extern void FP48_inv(FP48 *x, FP48 *y); +/** @brief Raises an FP48 to the power of a BIG + * + @param r FP48 instance, on exit = y^b + @param x FP48 instance + @param b BIG number + */ +extern void FP48_pow(FP48 *r, FP48 *x, B584_60::BIG b); + +//extern void FP48_ppow(FP48 *r,FP48 *x,B584_60::BIG b); + +/** @brief Raises an FP48 instance x to a small integer power, side-channel resistant + * + @param x FP48 instance, on exit = x^i + @param i small integer exponent + @param b maximum number of bits in exponent + */ +extern void FP48_pinpow(FP48 *x, int i, int b); + +/** @brief Raises an FP48 instance x to a BIG power, compressed to FP16 + * + @param c FP16 instance, on exit = x^(e mod r) as FP16 + @param x FP48 input + @param e BIG exponent + @param r BIG group order + */ +extern void FP48_compow(FP16 *c, FP48 *x, B584_60::BIG e, B584_60::BIG r); + +/** @brief Calculate Pi x[i]^b[i] for i=0 to 15, side-channel resistant + * + @param r FP48 instance, on exit = Pi x[i]^b[i] for i=0 to 15 + @param x FP48 array with 16 FP48s + @param b BIG array of 16 exponents + */ +extern void FP48_pow16(FP48 *r, FP48 *x, B584_60::BIG *b); + + +/** @brief Raises an FP48 to the power of the internal modulus p, using the Frobenius + * + @param x FP48 instance, on exit = x^p^n + @param f FP2 precalculated Frobenius constant + @param n power of p + */ +extern void FP48_frob(FP48 *x, FP2 *f, int n); + +/** @brief Reduces all components of possibly unreduced FP48 mod Modulus + * + @param x FP48 instance, on exit reduced mod Modulus + */ +extern void FP48_reduce(FP48 *x); +/** @brief Normalises the components of an FP48 + * + @param x FP48 instance to be normalised + */ +extern void FP48_norm(FP48 *x); +/** @brief Formats and outputs an FP48 to the console + * + @param x FP48 instance to be printed + */ +extern void FP48_output(FP48 *x); +/** @brief Formats and outputs an FP48 instance to an octet string + * + Serializes the components of an FP48 to big-endian base 256 form. + @param S output octet string + @param x FP48 instance to be converted to an octet string + */ +extern void FP48_toOctet(octet *S, FP48 *x); +/** @brief Creates an FP48 instance from an octet string + * + De-serializes the components of an FP48 to create an FP48 from big-endian base 256 components. + @param x FP48 instance to be created from an octet string + @param S input octet string + + */ +extern void FP48_fromOctet(FP48 *x, octet *S); +/** @brief Calculate the trace of an FP48 + * + @param t FP16 trace of x, on exit = tr(x) + @param x FP48 instance + + */ +extern void FP48_trace(FP16 *t, FP48 *x); + +/** @brief Conditional copy of FP48 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP48 instance, set to y if s!=0 + @param y another FP48 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP48_cmove(FP48 *x, FP48 *y, int s); +} +#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS12381.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS12381.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS12381.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS12381.h index 2397117..7d84be6 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS12381.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS12381.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_BLS12381_H -#define FP4_BLS12381_H - -#include "fp2_BLS12381.h" -#include "config_curve_BLS12381.h" - -using namespace core; - -namespace BLS12381 { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B384_58::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B384_58::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B384_58::BIG a, B384_58::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_BLS12381_H +#define FP4_BLS12381_H + +#include "fp2_BLS12381.h" +#include "config_curve_BLS12381.h" + +using namespace core; + +namespace BLS12381 { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B384_58::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B384_58::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B384_58::BIG a, B384_58::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS12383.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS12383.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS12383.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS12383.h index 0a944fe..d8c77ca 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS12383.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS12383.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_BLS12383_H -#define FP4_BLS12383_H - -#include "fp2_BLS12383.h" -#include "config_curve_BLS12383.h" - -using namespace core; - -namespace BLS12383 { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B384_58::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B384_58::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B384_58::BIG a, B384_58::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_BLS12383_H +#define FP4_BLS12383_H + +#include "fp2_BLS12383.h" +#include "config_curve_BLS12383.h" + +using namespace core; + +namespace BLS12383 { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B384_58::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B384_58::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B384_58::BIG a, B384_58::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS12443.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS12443.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS12443.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS12443.h index 51b5803..34dee30 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS12443.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS12443.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_BLS12443_H -#define FP4_BLS12443_H - -#include "fp2_BLS12443.h" -#include "config_curve_BLS12443.h" - -using namespace core; - -namespace BLS12443 { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B448_60::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B448_60::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B448_60::BIG a, B448_60::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_BLS12443_H +#define FP4_BLS12443_H + +#include "fp2_BLS12443.h" +#include "config_curve_BLS12443.h" + +using namespace core; + +namespace BLS12443 { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B448_60::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B448_60::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B448_60::BIG a, B448_60::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS12461.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS12461.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS12461.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS12461.h index 68244fc..203a67c 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS12461.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS12461.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_BLS12461_H -#define FP4_BLS12461_H - -#include "fp2_BLS12461.h" -#include "config_curve_BLS12461.h" - -using namespace core; - -namespace BLS12461 { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B464_60::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B464_60::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B464_60::BIG a, B464_60::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_BLS12461_H +#define FP4_BLS12461_H + +#include "fp2_BLS12461.h" +#include "config_curve_BLS12461.h" + +using namespace core; + +namespace BLS12461 { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B464_60::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B464_60::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B464_60::BIG a, B464_60::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS24479.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS24479.h index eb8af81..e6a193c 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS24479.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS24479.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_BLS24479_H -#define FP4_BLS24479_H - -#include "fp2_BLS24479.h" -#include "config_curve_BLS24479.h" - -using namespace core; - -namespace BLS24479 { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B480_56::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B480_56::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B480_56::BIG a, B480_56::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_BLS24479_H +#define FP4_BLS24479_H + +#include "fp2_BLS24479.h" +#include "config_curve_BLS24479.h" + +using namespace core; + +namespace BLS24479 { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B480_56::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B480_56::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B480_56::BIG a, B480_56::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS48286.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS48286.h index bd2be86..aad06f8 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS48286.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS48286.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_BLS48286_H -#define FP4_BLS48286_H - -#include "fp2_BLS48286.h" -#include "config_curve_BLS48286.h" - -using namespace core; - -namespace BLS48286 { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B288_60::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B288_60::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B288_60::BIG a, B288_60::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_BLS48286_H +#define FP4_BLS48286_H + +#include "fp2_BLS48286.h" +#include "config_curve_BLS48286.h" + +using namespace core; + +namespace BLS48286 { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B288_60::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B288_60::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B288_60::BIG a, B288_60::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS48556.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS48556.h index 673d738..1f6d4f9 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS48556.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS48556.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_BLS48556_H -#define FP4_BLS48556_H - -#include "fp2_BLS48556.h" -#include "config_curve_BLS48556.h" - -using namespace core; - -namespace BLS48556 { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B560_58::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B560_58::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B560_58::BIG a, B560_58::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_BLS48556_H +#define FP4_BLS48556_H + +#include "fp2_BLS48556.h" +#include "config_curve_BLS48556.h" + +using namespace core; + +namespace BLS48556 { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B560_58::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B560_58::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B560_58::BIG a, B560_58::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS48581.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS48581.h index 775f4b5..181ffb4 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BLS48581.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BLS48581.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_BLS48581_H -#define FP4_BLS48581_H - -#include "fp2_BLS48581.h" -#include "config_curve_BLS48581.h" - -using namespace core; - -namespace BLS48581 { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B584_60::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B584_60::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B584_60::BIG a, B584_60::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_BLS48581_H +#define FP4_BLS48581_H + +#include "fp2_BLS48581.h" +#include "config_curve_BLS48581.h" + +using namespace core; + +namespace BLS48581 { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B584_60::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B584_60::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B584_60::BIG a, B584_60::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BN158.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BN158.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BN158.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BN158.h index c1f625c..a60edb5 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BN158.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BN158.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_BN158_H -#define FP4_BN158_H - -#include "fp2_BN158.h" -#include "config_curve_BN158.h" - -using namespace core; - -namespace BN158 { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B160_56::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B160_56::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B160_56::BIG a, B160_56::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_BN158_H +#define FP4_BN158_H + +#include "fp2_BN158.h" +#include "config_curve_BN158.h" + +using namespace core; + +namespace BN158 { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B160_56::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B160_56::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B160_56::BIG a, B160_56::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BN254.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BN254.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BN254.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BN254.h index dfcf3b6..f5ef40b 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BN254.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BN254.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_BN254_H -#define FP4_BN254_H - -#include "fp2_BN254.h" -#include "config_curve_BN254.h" - -using namespace core; - -namespace BN254 { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B256_56::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B256_56::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B256_56::BIG a, B256_56::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_BN254_H +#define FP4_BN254_H + +#include "fp2_BN254.h" +#include "config_curve_BN254.h" + +using namespace core; + +namespace BN254 { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B256_56::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B256_56::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B256_56::BIG a, B256_56::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BN254CX.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BN254CX.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BN254CX.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BN254CX.h index 005dc0a..f3b36de 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BN254CX.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BN254CX.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_BN254CX_H -#define FP4_BN254CX_H - -#include "fp2_BN254CX.h" -#include "config_curve_BN254CX.h" - -using namespace core; - -namespace BN254CX { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B256_56::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B256_56::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B256_56::BIG a, B256_56::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_BN254CX_H +#define FP4_BN254CX_H + +#include "fp2_BN254CX.h" +#include "config_curve_BN254CX.h" + +using namespace core; + +namespace BN254CX { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B256_56::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B256_56::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B256_56::BIG a, B256_56::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BN462.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BN462.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BN462.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BN462.h index f6726b6..4d81f9f 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_BN462.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_BN462.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_BN462_H -#define FP4_BN462_H - -#include "fp2_BN462.h" -#include "config_curve_BN462.h" - -using namespace core; - -namespace BN462 { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B464_60::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B464_60::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B464_60::BIG a, B464_60::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_BN462_H +#define FP4_BN462_H + +#include "fp2_BN462.h" +#include "config_curve_BN462.h" + +using namespace core; + +namespace BN462 { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B464_60::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B464_60::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B464_60::BIG a, B464_60::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_FP256BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_FP256BN.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_FP256BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_FP256BN.h index b53223a..0b0ddb1 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_FP256BN.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_FP256BN.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_FP256BN_H -#define FP4_FP256BN_H - -#include "fp2_FP256BN.h" -#include "config_curve_FP256BN.h" - -using namespace core; - -namespace FP256BN { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B256_56::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B256_56::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B256_56::BIG a, B256_56::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_FP256BN_H +#define FP4_FP256BN_H + +#include "fp2_FP256BN.h" +#include "config_curve_FP256BN.h" + +using namespace core; + +namespace FP256BN { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B256_56::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B256_56::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B256_56::BIG a, B256_56::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_FP512BN.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_FP512BN.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_FP512BN.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_FP512BN.h index b3d88c0..d266dc7 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4_FP512BN.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp4_FP512BN.h @@ -1,349 +1,349 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP4_FP512BN_H -#define FP4_FP512BN_H - -#include "fp2_FP512BN.h" -#include "config_curve_FP512BN.h" - -using namespace core; - -namespace FP512BN { - -/** - @brief FP4 Structure - towered over two FP2 -*/ - -typedef struct -{ - FP2 a; /**< real part of FP4 */ - FP2 b; /**< imaginary part of FP4 */ -} FP4; - - -/* FP4 prototypes */ -/** @brief Tests for FP4 equal to zero - * - @param x FP4 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP4_iszilch(FP4 *x); - -/** @brief Tests for lexically larger - * - @param x FP4 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP4_islarger(FP4 *x); - -/** @brief Serialize out FP4 - * - @param b buffer for output - @param x FP4 number to be serialized - */ -extern void FP4_toBytes(char *b,FP4 *x); - -/** @brief Serialize in FP4 - * - @param x FP4 number to be serialized - @param b buffer for input - */ -extern void FP4_fromBytes(FP4 *x,char *b); - -/** @brief Tests for FP4 equal to unity - * - @param x FP4 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP4_isunity(FP4 *x); -/** @brief Tests for equality of two FP4s - * - @param x FP4 instance to be compared - @param y FP4 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP4_equals(FP4 *x, FP4 *y); -/** @brief Tests for FP4 having only a real part and no imaginary part - * - @param x FP4 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP4_isreal(FP4 *x); -/** @brief Initialise FP4 from two FP2s - * - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - @param b FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); -/** @brief Initialise FP4 from single FP2 - * - Imaginary part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form real part of FP4 - */ -extern void FP4_from_FP2(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP2 - * - real part is set to zero - @param x FP4 instance to be initialised - @param a FP2 to form imaginary part of FP4 - */ -extern void FP4_from_FP2H(FP4 *x, FP2 *a); - -/** @brief Initialise FP4 from single FP - * - @param x FP4 instance to be initialised - @param a FP to form real part of FP4 - */ -extern void FP4_from_FP(FP4 *x, FP *a); - -/** @brief Copy FP4 to another FP4 - * - @param x FP4 instance, on exit = y - @param y FP4 instance to be copied - */ -extern void FP4_copy(FP4 *x, FP4 *y); -/** @brief Set FP4 to zero - * - @param x FP4 instance to be set to zero - */ -extern void FP4_zero(FP4 *x); -/** @brief Set FP4 to unity - * - @param x FP4 instance to be set to one - */ -extern void FP4_one(FP4 *x); - -/** @brief Sign of FP4 - * - @param x FP4 instance - @return "sign" of FP4 - */ -extern int FP4_sign(FP4 *x); - -/** @brief Negation of FP4 - * - @param x FP4 instance, on exit = -y - @param y FP4 instance - */ -extern void FP4_neg(FP4 *x, FP4 *y); -/** @brief Conjugation of FP4 - * - If y=(a,b) on exit x=(a,-b) - @param x FP4 instance, on exit = conj(y) - @param y FP4 instance - */ -extern void FP4_conj(FP4 *x, FP4 *y); -/** @brief Negative conjugation of FP4 - * - If y=(a,b) on exit x=(-a,b) - @param x FP4 instance, on exit = -conj(y) - @param y FP4 instance - */ -extern void FP4_nconj(FP4 *x, FP4 *y); -/** @brief addition of two FP4s - * - @param x FP4 instance, on exit = y+z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); -/** @brief subtraction of two FP4s - * - @param x FP4 instance, on exit = y-z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); -/** @brief Multiplication of an FP4 by an FP2 - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP2 multiplier - */ -extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); - - -/** @brief Multiplication of an FP4 by an FP - * - @param x FP4 instance, on exit = y*a - @param y FP4 instance - @param a FP multiplier - */ -extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); - -/** @brief Multiplication of an FP4 by a small integer - * - @param x FP4 instance, on exit = y*i - @param y FP4 instance - @param i an integer - */ -extern void FP4_imul(FP4 *x, FP4 *y, int i); -/** @brief Squaring an FP4 - * - @param x FP4 instance, on exit = y^2 - @param y FP4 instance - */ -extern void FP4_sqr(FP4 *x, FP4 *y); -/** @brief Multiplication of two FP4s - * - @param x FP4 instance, on exit = y*z - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); -/** @brief Inverting an FP4 - * - @param x FP4 instance, on exit = 1/y - @param y FP4 instance - @param h optional input hint - */ -extern void FP4_inv(FP4 *x, FP4 *y, FP *h); - -/** @brief Divide an FP4 by 2 - * - @param x FP4 instance, on exit = y/2 - @param y FP4 instance - */ -extern void FP4_div2(FP4 *x, FP4 *y); - - -/** @brief Formats and outputs an FP4 to the console - * - @param x FP4 instance to be printed - */ -extern void FP4_output(FP4 *x); -/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) - * - @param x FP4 instance to be printed - */ -extern void FP4_rawoutput(FP4 *x); -/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP4_times_i(FP4 *x); -/** @brief Normalises the components of an FP4 - * - @param x FP4 instance to be normalised - */ -extern void FP4_norm(FP4 *x); -/** @brief Reduces all components of possibly unreduced FP4 mod Modulus - * - @param x FP4 instance, on exit reduced mod Modulus - */ -extern void FP4_reduce(FP4 *x); -/** @brief Raises an FP4 to the power of a BIG - * - @param x FP4 instance, on exit = y^b - @param y FP4 instance - @param b BIG number - */ -extern void FP4_pow(FP4 *x, FP4 *y, B512_60::BIG b); -/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius - * - @param x FP4 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP4_frob(FP4 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP4 instance, on exit = w*x-conj(x)*y+z - @param w FP4 instance - @param x FP4 instance - @param y FP4 instance - @param z FP4 instance - */ -extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP4 instance, on exit = x^2-2*conj(x) - @param x FP4 instance - */ -extern void FP4_xtr_D(FP4 *r, FP4 *x); -/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP4 instance, on exit = trace(w^b) - @param x FP4 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP4_xtr_pow(FP4 *r, FP4 *x, B512_60::BIG b); -/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP4 instance, on exit = trace(c^a.d^b) - @param c FP4 instance, trace of an FP12 - @param d FP4 instance, trace of an FP12 - @param e FP4 instance, trace of an FP12 - @param f FP4 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B512_60::BIG a, B512_60::BIG b); - -/** @brief Test FP4 for QR - * - @param r FP4 instance - @param h optional generated hint - @return 1 x is a QR, otherwise 0 - */ -extern int FP4_qr(FP4 *r, FP *h); - -/** @brief Calculate square root of an FP4 - * - Square root - @param r FP4 instance, on exit = sqrt(x) - @param x FP4 instance - @param h optional input hint - */ -extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); - - -/** @brief Conditional copy of FP4 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP4 instance, set to y if s!=0 - @param y another FP4 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP4_cmove(FP4 *x, FP4 *y, int s); - - -/** @brief Divide FP4 number by QNR - * - Divide FP4 by the QNR - @param x FP4 instance - */ -extern void FP4_div_i(FP4 *x); - -/** @brief Generate random FP4 - * - @param x random FP4 number - @param rng random number generator - */ -extern void FP4_rand(FP4 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP4_FP512BN_H +#define FP4_FP512BN_H + +#include "fp2_FP512BN.h" +#include "config_curve_FP512BN.h" + +using namespace core; + +namespace FP512BN { + +/** + @brief FP4 Structure - towered over two FP2 +*/ + +typedef struct +{ + FP2 a; /**< real part of FP4 */ + FP2 b; /**< imaginary part of FP4 */ +} FP4; + + +/* FP4 prototypes */ +/** @brief Tests for FP4 equal to zero + * + @param x FP4 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP4_iszilch(FP4 *x); + +/** @brief Tests for lexically larger + * + @param x FP4 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP4_islarger(FP4 *x); + +/** @brief Serialize out FP4 + * + @param b buffer for output + @param x FP4 number to be serialized + */ +extern void FP4_toBytes(char *b,FP4 *x); + +/** @brief Serialize in FP4 + * + @param x FP4 number to be serialized + @param b buffer for input + */ +extern void FP4_fromBytes(FP4 *x,char *b); + +/** @brief Tests for FP4 equal to unity + * + @param x FP4 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP4_isunity(FP4 *x); +/** @brief Tests for equality of two FP4s + * + @param x FP4 instance to be compared + @param y FP4 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP4_equals(FP4 *x, FP4 *y); +/** @brief Tests for FP4 having only a real part and no imaginary part + * + @param x FP4 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP4_isreal(FP4 *x); +/** @brief Initialise FP4 from two FP2s + * + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + @param b FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2s(FP4 *x, FP2 *a, FP2 *b); +/** @brief Initialise FP4 from single FP2 + * + Imaginary part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form real part of FP4 + */ +extern void FP4_from_FP2(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP2 + * + real part is set to zero + @param x FP4 instance to be initialised + @param a FP2 to form imaginary part of FP4 + */ +extern void FP4_from_FP2H(FP4 *x, FP2 *a); + +/** @brief Initialise FP4 from single FP + * + @param x FP4 instance to be initialised + @param a FP to form real part of FP4 + */ +extern void FP4_from_FP(FP4 *x, FP *a); + +/** @brief Copy FP4 to another FP4 + * + @param x FP4 instance, on exit = y + @param y FP4 instance to be copied + */ +extern void FP4_copy(FP4 *x, FP4 *y); +/** @brief Set FP4 to zero + * + @param x FP4 instance to be set to zero + */ +extern void FP4_zero(FP4 *x); +/** @brief Set FP4 to unity + * + @param x FP4 instance to be set to one + */ +extern void FP4_one(FP4 *x); + +/** @brief Sign of FP4 + * + @param x FP4 instance + @return "sign" of FP4 + */ +extern int FP4_sign(FP4 *x); + +/** @brief Negation of FP4 + * + @param x FP4 instance, on exit = -y + @param y FP4 instance + */ +extern void FP4_neg(FP4 *x, FP4 *y); +/** @brief Conjugation of FP4 + * + If y=(a,b) on exit x=(a,-b) + @param x FP4 instance, on exit = conj(y) + @param y FP4 instance + */ +extern void FP4_conj(FP4 *x, FP4 *y); +/** @brief Negative conjugation of FP4 + * + If y=(a,b) on exit x=(-a,b) + @param x FP4 instance, on exit = -conj(y) + @param y FP4 instance + */ +extern void FP4_nconj(FP4 *x, FP4 *y); +/** @brief addition of two FP4s + * + @param x FP4 instance, on exit = y+z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_add(FP4 *x, FP4 *y, FP4 *z); +/** @brief subtraction of two FP4s + * + @param x FP4 instance, on exit = y-z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_sub(FP4 *x, FP4 *y, FP4 *z); +/** @brief Multiplication of an FP4 by an FP2 + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP2 multiplier + */ +extern void FP4_pmul(FP4 *x, FP4 *y, FP2 *a); + + +/** @brief Multiplication of an FP4 by an FP + * + @param x FP4 instance, on exit = y*a + @param y FP4 instance + @param a FP multiplier + */ +extern void FP4_qmul(FP4 *x, FP4 *y, FP *a); + +/** @brief Multiplication of an FP4 by a small integer + * + @param x FP4 instance, on exit = y*i + @param y FP4 instance + @param i an integer + */ +extern void FP4_imul(FP4 *x, FP4 *y, int i); +/** @brief Squaring an FP4 + * + @param x FP4 instance, on exit = y^2 + @param y FP4 instance + */ +extern void FP4_sqr(FP4 *x, FP4 *y); +/** @brief Multiplication of two FP4s + * + @param x FP4 instance, on exit = y*z + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_mul(FP4 *x, FP4 *y, FP4 *z); +/** @brief Inverting an FP4 + * + @param x FP4 instance, on exit = 1/y + @param y FP4 instance + @param h optional input hint + */ +extern void FP4_inv(FP4 *x, FP4 *y, FP *h); + +/** @brief Divide an FP4 by 2 + * + @param x FP4 instance, on exit = y/2 + @param y FP4 instance + */ +extern void FP4_div2(FP4 *x, FP4 *y); + + +/** @brief Formats and outputs an FP4 to the console + * + @param x FP4 instance to be printed + */ +extern void FP4_output(FP4 *x); +/** @brief Formats and outputs an FP4 to the console in raw form (for debugging) + * + @param x FP4 instance to be printed + */ +extern void FP4_rawoutput(FP4 *x); +/** @brief multiplies an FP4 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP4 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP4_times_i(FP4 *x); +/** @brief Normalises the components of an FP4 + * + @param x FP4 instance to be normalised + */ +extern void FP4_norm(FP4 *x); +/** @brief Reduces all components of possibly unreduced FP4 mod Modulus + * + @param x FP4 instance, on exit reduced mod Modulus + */ +extern void FP4_reduce(FP4 *x); +/** @brief Raises an FP4 to the power of a BIG + * + @param x FP4 instance, on exit = y^b + @param y FP4 instance + @param b BIG number + */ +extern void FP4_pow(FP4 *x, FP4 *y, B512_60::BIG b); +/** @brief Raises an FP4 to the power of the internal modulus p, using the Frobenius + * + @param x FP4 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP4_frob(FP4 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP4 instance, on exit = w*x-conj(x)*y+z + @param w FP4 instance + @param x FP4 instance + @param y FP4 instance + @param z FP4 instance + */ +extern void FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP4 instance, on exit = x^2-2*conj(x) + @param x FP4 instance + */ +extern void FP4_xtr_D(FP4 *r, FP4 *x); +/** @brief Calculates FP4 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP4 instance, on exit = trace(w^b) + @param x FP4 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP4_xtr_pow(FP4 *r, FP4 *x, B512_60::BIG b); +/** @brief Calculates FP4 trace of c^a.d^b, where c and d are derived from FP4 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP4 instance, on exit = trace(c^a.d^b) + @param c FP4 instance, trace of an FP12 + @param d FP4 instance, trace of an FP12 + @param e FP4 instance, trace of an FP12 + @param f FP4 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP4_xtr_pow2(FP4 *r, FP4 *c, FP4 *d, FP4 *e, FP4 *f, B512_60::BIG a, B512_60::BIG b); + +/** @brief Test FP4 for QR + * + @param r FP4 instance + @param h optional generated hint + @return 1 x is a QR, otherwise 0 + */ +extern int FP4_qr(FP4 *r, FP *h); + +/** @brief Calculate square root of an FP4 + * + Square root + @param r FP4 instance, on exit = sqrt(x) + @param x FP4 instance + @param h optional input hint + */ +extern void FP4_sqrt(FP4 *r, FP4 *x, FP *h); + + +/** @brief Conditional copy of FP4 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP4 instance, set to y if s!=0 + @param y another FP4 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP4_cmove(FP4 *x, FP4 *y, int s); + + +/** @brief Divide FP4 number by QNR + * + Divide FP4 by the QNR + @param x FP4 instance + */ +extern void FP4_div_i(FP4 *x); + +/** @brief Generate random FP4 + * + @param x random FP4 number + @param rng random number generator + */ +extern void FP4_rand(FP4 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp8.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8.h similarity index 100% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miracllll/includes/fp8.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8.h diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8_BLS24479.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8_BLS24479.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8_BLS24479.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8_BLS24479.h index 03ebc33..d383a0f 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8_BLS24479.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8_BLS24479.h @@ -1,365 +1,365 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP8_BLS24479_H -#define FP8_BLS24479_H - -#include "fp4_BLS24479.h" -#include "config_curve_BLS24479.h" - -using namespace core; - -namespace BLS24479 { - -/** - @brief FP8 Structure - towered over two FP4 -*/ - -typedef struct -{ - FP4 a; /**< real part of FP8 */ - FP4 b; /**< imaginary part of FP8 */ -} FP8; - - -/* FP8 prototypes */ -/** @brief Tests for FP8 equal to zero - * - @param x FP8 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP8_iszilch(FP8 *x); - -/** @brief Tests for lexically larger - * - @param x FP8 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP8_islarger(FP8 *x); - -/** @brief Serialize in FP8 - * - @param b buffer for output - @param x FP8 number to be serialized - */ -extern void FP8_toBytes(char *b,FP8 *x); -/** @brief Serialize out FP8 - * - @param x FP8 number to be serialized - @param b buffer for input - */ -extern void FP8_fromBytes(FP8 *x,char *b); - - -/** @brief Tests for FP8 equal to unity - * - @param x FP8 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP8_isunity(FP8 *x); -/** @brief Tests for equality of two FP8s - * - @param x FP8 instance to be compared - @param y FP8 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP8_equals(FP8 *x, FP8 *y); -/** @brief Tests for FP8 having only a real part and no imaginary part - * - @param x FP8 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP8_isreal(FP8 *x); -/** @brief Initialise FP8 from two FP4s - * - @param x FP8 instance to be initialised - @param a FP4 to form real part of FP8 - @param b FP4 to form imaginary part of FP8 - */ -extern void FP8_from_FP4s(FP8 *x, FP4 *a, FP4 *b); -/** @brief Initialise FP8 from single FP4 - * - Imaginary part is set to zero - @param x FP8 instance to be initialised - @param a FP4 to form real part of FP8 - */ -extern void FP8_from_FP4(FP8 *x, FP4 *a); - -/** @brief Initialise FP8 from single FP4 - * - real part is set to zero - @param x FP8 instance to be initialised - @param a FP4 to form imaginary part of FP8 - */ -extern void FP8_from_FP4H(FP8 *x, FP4 *a); - -/** @brief Initialise FP8 from single FP - * - @param x FP8 instance to be initialised - @param a FP to form real part of FP8 - */ -extern void FP8_from_FP(FP8 *x, FP *a); - -/** @brief Copy FP8 to another FP8 - * - @param x FP8 instance, on exit = y - @param y FP8 instance to be copied - */ -extern void FP8_copy(FP8 *x, FP8 *y); - -/** @brief Set FP8 to zero - * - @param x FP8 instance to be set to zero - */ -extern void FP8_zero(FP8 *x); -/** @brief Set FP8 to unity - * - @param x FP8 instance to be set to one - */ -extern void FP8_one(FP8 *x); - -/** @brief Sign of FP8 - * - @param x FP8 instance - @return "sign" of FP8 - */ -extern int FP8_sign(FP8 *x); - -/** @brief Negation of FP8 - * - @param x FP8 instance, on exit = -y - @param y FP8 instance - */ -extern void FP8_neg(FP8 *x, FP8 *y); -/** @brief Conjugation of FP8 - * - If y=(a,b) on exit x=(a,-b) - @param x FP8 instance, on exit = conj(y) - @param y FP8 instance - */ -extern void FP8_conj(FP8 *x, FP8 *y); -/** @brief Negative conjugation of FP8 - * - If y=(a,b) on exit x=(-a,b) - @param x FP8 instance, on exit = -conj(y) - @param y FP8 instance - */ -extern void FP8_nconj(FP8 *x, FP8 *y); -/** @brief addition of two FP8s - * - @param x FP8 instance, on exit = y+z - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_add(FP8 *x, FP8 *y, FP8 *z); -/** @brief subtraction of two FP8s - * - @param x FP8 instance, on exit = y-z - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_sub(FP8 *x, FP8 *y, FP8 *z); -/** @brief Multiplication of an FP8 by an FP4 - * - @param x FP8 instance, on exit = y*a - @param y FP8 instance - @param a FP4 multiplier - */ -extern void FP8_pmul(FP8 *x, FP8 *y, FP4 *a); - -/** @brief Multiplication of an FP8 by an FP2 - * - @param x FP8 instance, on exit = y*a - @param y FP8 instance - @param a FP2 multiplier - */ -extern void FP8_qmul(FP8 *x, FP8 *y, FP2 *a); - -/** @brief Multiplication of an FP8 by an FP - * - @param x FP8 instance, on exit = y*a - @param y FP8 instance - @param a FP multiplier - */ -extern void FP8_tmul(FP8 *x, FP8 *y, FP *a); - - - -/** @brief Multiplication of an FP8 by a small integer - * - @param x FP8 instance, on exit = y*i - @param y FP8 instance - @param i an integer - */ -extern void FP8_imul(FP8 *x, FP8 *y, int i); -/** @brief Squaring an FP8 - * - @param x FP8 instance, on exit = y^2 - @param y FP8 instance - */ -extern void FP8_sqr(FP8 *x, FP8 *y); -/** @brief Multiplication of two FP8s - * - @param x FP8 instance, on exit = y*z - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_mul(FP8 *x, FP8 *y, FP8 *z); -/** @brief Inverting an FP8 - * - @param x FP8 instance, on exit = 1/y - @param y FP8 instance - @param h optional input hint - */ -extern void FP8_inv(FP8 *x, FP8 *y, FP *h); -/** @brief Formats and outputs an FP8 to the console - * - @param x FP8 instance to be printed - */ -extern void FP8_output(FP8 *x); -/** @brief Divide an FP8 by 2 - * - @param x FP8 instance, on exit = y/2 - @param y FP8 instance - */ -extern void FP8_div2(FP8 *x, FP8 *y); - -/** @brief Formats and outputs an FP8 to the console in raw form (for debugging) - * - @param x FP8 instance to be printed - */ -extern void FP8_rawoutput(FP8 *x); -/** @brief multiplies an FP8 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP8 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP8_times_i(FP8 *x); -/** @brief multiplies an FP8 instance by irreducible polynomial (1+sqrt(-1)) - * - @param x FP8 instance, on exit = (1+sqrt(-1)*x - */ -extern void FP8_times_i2(FP8 *x); - -/** @brief Normalises the components of an FP8 - * - @param x FP8 instance to be normalised - */ -extern void FP8_norm(FP8 *x); -/** @brief Reduces all components of possibly unreduced FP8 mod Modulus - * - @param x FP8 instance, on exit reduced mod Modulus - */ -extern void FP8_reduce(FP8 *x); -/** @brief Raises an FP8 to the power of a BIG - * - @param x FP8 instance, on exit = y^b - @param y FP8 instance - @param b BIG number - */ -extern void FP8_pow(FP8 *x, FP8 *y, B480_56::BIG b); -/** @brief Raises an FP8 to the power of the internal modulus p, using the Frobenius - * - @param x FP8 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP8_frob(FP8 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP8 instance, on exit = w*x-conj(x)*y+z - @param w FP8 instance - @param x FP8 instance - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_xtr_A(FP8 *r, FP8 *w, FP8 *x, FP8 *y, FP8 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP8 instance, on exit = x^2-2*conj(x) - @param x FP8 instance - */ -extern void FP8_xtr_D(FP8 *r, FP8 *x); -/** @brief Calculates FP8 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP8 instance, on exit = trace(w^b) - @param x FP8 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP8_xtr_pow(FP8 *r, FP8 *x, B480_56::BIG b); -/** @brief Calculates FP8 trace of c^a.d^b, where c and d are derived from FP8 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP8 instance, on exit = trace(c^a.d^b) - @param c FP8 instance, trace of an FP12 - @param d FP8 instance, trace of an FP12 - @param e FP8 instance, trace of an FP12 - @param f FP8 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP8_xtr_pow2(FP8 *r, FP8 *c, FP8 *d, FP8 *e, FP8 *f, B480_56::BIG a, B480_56::BIG b); - -/** @brief Test FP8 for QR - * - Square root - @param r FP8 instance - @param h optional generated hint - @return 1 r is a QR, otherwise 0 - */ -extern int FP8_qr(FP8 *r, FP *h); - - -/** @brief Calculate square root of an FP8 - * - Square root - @param r FP8 instance, on exit = sqrt(x) - @param x FP8 instance - @param h optional input hint - */ -extern void FP8_sqrt(FP8 *r, FP8 *x, FP *h); - - -/** @brief Conditional copy of FP8 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP8 instance, set to y if s!=0 - @param y another FP8 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP8_cmove(FP8 *x, FP8 *y, int s); - - -/** @brief Divide FP8 number by QNR - * - Divide FP8 by the QNR - @param x FP8 instance - */ -extern void FP8_div_i(FP8 *x); - -/** @brief Generate random FP8 - * - @param x random FP8 number - @param rng random number generator - */ -extern void FP8_rand(FP8 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP8_BLS24479_H +#define FP8_BLS24479_H + +#include "fp4_BLS24479.h" +#include "config_curve_BLS24479.h" + +using namespace core; + +namespace BLS24479 { + +/** + @brief FP8 Structure - towered over two FP4 +*/ + +typedef struct +{ + FP4 a; /**< real part of FP8 */ + FP4 b; /**< imaginary part of FP8 */ +} FP8; + + +/* FP8 prototypes */ +/** @brief Tests for FP8 equal to zero + * + @param x FP8 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP8_iszilch(FP8 *x); + +/** @brief Tests for lexically larger + * + @param x FP8 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP8_islarger(FP8 *x); + +/** @brief Serialize in FP8 + * + @param b buffer for output + @param x FP8 number to be serialized + */ +extern void FP8_toBytes(char *b,FP8 *x); +/** @brief Serialize out FP8 + * + @param x FP8 number to be serialized + @param b buffer for input + */ +extern void FP8_fromBytes(FP8 *x,char *b); + + +/** @brief Tests for FP8 equal to unity + * + @param x FP8 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP8_isunity(FP8 *x); +/** @brief Tests for equality of two FP8s + * + @param x FP8 instance to be compared + @param y FP8 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP8_equals(FP8 *x, FP8 *y); +/** @brief Tests for FP8 having only a real part and no imaginary part + * + @param x FP8 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP8_isreal(FP8 *x); +/** @brief Initialise FP8 from two FP4s + * + @param x FP8 instance to be initialised + @param a FP4 to form real part of FP8 + @param b FP4 to form imaginary part of FP8 + */ +extern void FP8_from_FP4s(FP8 *x, FP4 *a, FP4 *b); +/** @brief Initialise FP8 from single FP4 + * + Imaginary part is set to zero + @param x FP8 instance to be initialised + @param a FP4 to form real part of FP8 + */ +extern void FP8_from_FP4(FP8 *x, FP4 *a); + +/** @brief Initialise FP8 from single FP4 + * + real part is set to zero + @param x FP8 instance to be initialised + @param a FP4 to form imaginary part of FP8 + */ +extern void FP8_from_FP4H(FP8 *x, FP4 *a); + +/** @brief Initialise FP8 from single FP + * + @param x FP8 instance to be initialised + @param a FP to form real part of FP8 + */ +extern void FP8_from_FP(FP8 *x, FP *a); + +/** @brief Copy FP8 to another FP8 + * + @param x FP8 instance, on exit = y + @param y FP8 instance to be copied + */ +extern void FP8_copy(FP8 *x, FP8 *y); + +/** @brief Set FP8 to zero + * + @param x FP8 instance to be set to zero + */ +extern void FP8_zero(FP8 *x); +/** @brief Set FP8 to unity + * + @param x FP8 instance to be set to one + */ +extern void FP8_one(FP8 *x); + +/** @brief Sign of FP8 + * + @param x FP8 instance + @return "sign" of FP8 + */ +extern int FP8_sign(FP8 *x); + +/** @brief Negation of FP8 + * + @param x FP8 instance, on exit = -y + @param y FP8 instance + */ +extern void FP8_neg(FP8 *x, FP8 *y); +/** @brief Conjugation of FP8 + * + If y=(a,b) on exit x=(a,-b) + @param x FP8 instance, on exit = conj(y) + @param y FP8 instance + */ +extern void FP8_conj(FP8 *x, FP8 *y); +/** @brief Negative conjugation of FP8 + * + If y=(a,b) on exit x=(-a,b) + @param x FP8 instance, on exit = -conj(y) + @param y FP8 instance + */ +extern void FP8_nconj(FP8 *x, FP8 *y); +/** @brief addition of two FP8s + * + @param x FP8 instance, on exit = y+z + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_add(FP8 *x, FP8 *y, FP8 *z); +/** @brief subtraction of two FP8s + * + @param x FP8 instance, on exit = y-z + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_sub(FP8 *x, FP8 *y, FP8 *z); +/** @brief Multiplication of an FP8 by an FP4 + * + @param x FP8 instance, on exit = y*a + @param y FP8 instance + @param a FP4 multiplier + */ +extern void FP8_pmul(FP8 *x, FP8 *y, FP4 *a); + +/** @brief Multiplication of an FP8 by an FP2 + * + @param x FP8 instance, on exit = y*a + @param y FP8 instance + @param a FP2 multiplier + */ +extern void FP8_qmul(FP8 *x, FP8 *y, FP2 *a); + +/** @brief Multiplication of an FP8 by an FP + * + @param x FP8 instance, on exit = y*a + @param y FP8 instance + @param a FP multiplier + */ +extern void FP8_tmul(FP8 *x, FP8 *y, FP *a); + + + +/** @brief Multiplication of an FP8 by a small integer + * + @param x FP8 instance, on exit = y*i + @param y FP8 instance + @param i an integer + */ +extern void FP8_imul(FP8 *x, FP8 *y, int i); +/** @brief Squaring an FP8 + * + @param x FP8 instance, on exit = y^2 + @param y FP8 instance + */ +extern void FP8_sqr(FP8 *x, FP8 *y); +/** @brief Multiplication of two FP8s + * + @param x FP8 instance, on exit = y*z + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_mul(FP8 *x, FP8 *y, FP8 *z); +/** @brief Inverting an FP8 + * + @param x FP8 instance, on exit = 1/y + @param y FP8 instance + @param h optional input hint + */ +extern void FP8_inv(FP8 *x, FP8 *y, FP *h); +/** @brief Formats and outputs an FP8 to the console + * + @param x FP8 instance to be printed + */ +extern void FP8_output(FP8 *x); +/** @brief Divide an FP8 by 2 + * + @param x FP8 instance, on exit = y/2 + @param y FP8 instance + */ +extern void FP8_div2(FP8 *x, FP8 *y); + +/** @brief Formats and outputs an FP8 to the console in raw form (for debugging) + * + @param x FP8 instance to be printed + */ +extern void FP8_rawoutput(FP8 *x); +/** @brief multiplies an FP8 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP8 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP8_times_i(FP8 *x); +/** @brief multiplies an FP8 instance by irreducible polynomial (1+sqrt(-1)) + * + @param x FP8 instance, on exit = (1+sqrt(-1)*x + */ +extern void FP8_times_i2(FP8 *x); + +/** @brief Normalises the components of an FP8 + * + @param x FP8 instance to be normalised + */ +extern void FP8_norm(FP8 *x); +/** @brief Reduces all components of possibly unreduced FP8 mod Modulus + * + @param x FP8 instance, on exit reduced mod Modulus + */ +extern void FP8_reduce(FP8 *x); +/** @brief Raises an FP8 to the power of a BIG + * + @param x FP8 instance, on exit = y^b + @param y FP8 instance + @param b BIG number + */ +extern void FP8_pow(FP8 *x, FP8 *y, B480_56::BIG b); +/** @brief Raises an FP8 to the power of the internal modulus p, using the Frobenius + * + @param x FP8 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP8_frob(FP8 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP8 instance, on exit = w*x-conj(x)*y+z + @param w FP8 instance + @param x FP8 instance + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_xtr_A(FP8 *r, FP8 *w, FP8 *x, FP8 *y, FP8 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP8 instance, on exit = x^2-2*conj(x) + @param x FP8 instance + */ +extern void FP8_xtr_D(FP8 *r, FP8 *x); +/** @brief Calculates FP8 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP8 instance, on exit = trace(w^b) + @param x FP8 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP8_xtr_pow(FP8 *r, FP8 *x, B480_56::BIG b); +/** @brief Calculates FP8 trace of c^a.d^b, where c and d are derived from FP8 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP8 instance, on exit = trace(c^a.d^b) + @param c FP8 instance, trace of an FP12 + @param d FP8 instance, trace of an FP12 + @param e FP8 instance, trace of an FP12 + @param f FP8 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP8_xtr_pow2(FP8 *r, FP8 *c, FP8 *d, FP8 *e, FP8 *f, B480_56::BIG a, B480_56::BIG b); + +/** @brief Test FP8 for QR + * + Square root + @param r FP8 instance + @param h optional generated hint + @return 1 r is a QR, otherwise 0 + */ +extern int FP8_qr(FP8 *r, FP *h); + + +/** @brief Calculate square root of an FP8 + * + Square root + @param r FP8 instance, on exit = sqrt(x) + @param x FP8 instance + @param h optional input hint + */ +extern void FP8_sqrt(FP8 *r, FP8 *x, FP *h); + + +/** @brief Conditional copy of FP8 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP8 instance, set to y if s!=0 + @param y another FP8 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP8_cmove(FP8 *x, FP8 *y, int s); + + +/** @brief Divide FP8 number by QNR + * + Divide FP8 by the QNR + @param x FP8 instance + */ +extern void FP8_div_i(FP8 *x); + +/** @brief Generate random FP8 + * + @param x random FP8 number + @param rng random number generator + */ +extern void FP8_rand(FP8 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8_BLS48286.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8_BLS48286.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8_BLS48286.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8_BLS48286.h index 36279fb..f68fe7a 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8_BLS48286.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8_BLS48286.h @@ -1,365 +1,365 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP8_BLS48286_H -#define FP8_BLS48286_H - -#include "fp4_BLS48286.h" -#include "config_curve_BLS48286.h" - -using namespace core; - -namespace BLS48286 { - -/** - @brief FP8 Structure - towered over two FP4 -*/ - -typedef struct -{ - FP4 a; /**< real part of FP8 */ - FP4 b; /**< imaginary part of FP8 */ -} FP8; - - -/* FP8 prototypes */ -/** @brief Tests for FP8 equal to zero - * - @param x FP8 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP8_iszilch(FP8 *x); - -/** @brief Tests for lexically larger - * - @param x FP8 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP8_islarger(FP8 *x); - -/** @brief Serialize in FP8 - * - @param b buffer for output - @param x FP8 number to be serialized - */ -extern void FP8_toBytes(char *b,FP8 *x); -/** @brief Serialize out FP8 - * - @param x FP8 number to be serialized - @param b buffer for input - */ -extern void FP8_fromBytes(FP8 *x,char *b); - - -/** @brief Tests for FP8 equal to unity - * - @param x FP8 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP8_isunity(FP8 *x); -/** @brief Tests for equality of two FP8s - * - @param x FP8 instance to be compared - @param y FP8 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP8_equals(FP8 *x, FP8 *y); -/** @brief Tests for FP8 having only a real part and no imaginary part - * - @param x FP8 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP8_isreal(FP8 *x); -/** @brief Initialise FP8 from two FP4s - * - @param x FP8 instance to be initialised - @param a FP4 to form real part of FP8 - @param b FP4 to form imaginary part of FP8 - */ -extern void FP8_from_FP4s(FP8 *x, FP4 *a, FP4 *b); -/** @brief Initialise FP8 from single FP4 - * - Imaginary part is set to zero - @param x FP8 instance to be initialised - @param a FP4 to form real part of FP8 - */ -extern void FP8_from_FP4(FP8 *x, FP4 *a); - -/** @brief Initialise FP8 from single FP4 - * - real part is set to zero - @param x FP8 instance to be initialised - @param a FP4 to form imaginary part of FP8 - */ -extern void FP8_from_FP4H(FP8 *x, FP4 *a); - -/** @brief Initialise FP8 from single FP - * - @param x FP8 instance to be initialised - @param a FP to form real part of FP8 - */ -extern void FP8_from_FP(FP8 *x, FP *a); - -/** @brief Copy FP8 to another FP8 - * - @param x FP8 instance, on exit = y - @param y FP8 instance to be copied - */ -extern void FP8_copy(FP8 *x, FP8 *y); - -/** @brief Set FP8 to zero - * - @param x FP8 instance to be set to zero - */ -extern void FP8_zero(FP8 *x); -/** @brief Set FP8 to unity - * - @param x FP8 instance to be set to one - */ -extern void FP8_one(FP8 *x); - -/** @brief Sign of FP8 - * - @param x FP8 instance - @return "sign" of FP8 - */ -extern int FP8_sign(FP8 *x); - -/** @brief Negation of FP8 - * - @param x FP8 instance, on exit = -y - @param y FP8 instance - */ -extern void FP8_neg(FP8 *x, FP8 *y); -/** @brief Conjugation of FP8 - * - If y=(a,b) on exit x=(a,-b) - @param x FP8 instance, on exit = conj(y) - @param y FP8 instance - */ -extern void FP8_conj(FP8 *x, FP8 *y); -/** @brief Negative conjugation of FP8 - * - If y=(a,b) on exit x=(-a,b) - @param x FP8 instance, on exit = -conj(y) - @param y FP8 instance - */ -extern void FP8_nconj(FP8 *x, FP8 *y); -/** @brief addition of two FP8s - * - @param x FP8 instance, on exit = y+z - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_add(FP8 *x, FP8 *y, FP8 *z); -/** @brief subtraction of two FP8s - * - @param x FP8 instance, on exit = y-z - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_sub(FP8 *x, FP8 *y, FP8 *z); -/** @brief Multiplication of an FP8 by an FP4 - * - @param x FP8 instance, on exit = y*a - @param y FP8 instance - @param a FP4 multiplier - */ -extern void FP8_pmul(FP8 *x, FP8 *y, FP4 *a); - -/** @brief Multiplication of an FP8 by an FP2 - * - @param x FP8 instance, on exit = y*a - @param y FP8 instance - @param a FP2 multiplier - */ -extern void FP8_qmul(FP8 *x, FP8 *y, FP2 *a); - -/** @brief Multiplication of an FP8 by an FP - * - @param x FP8 instance, on exit = y*a - @param y FP8 instance - @param a FP multiplier - */ -extern void FP8_tmul(FP8 *x, FP8 *y, FP *a); - - - -/** @brief Multiplication of an FP8 by a small integer - * - @param x FP8 instance, on exit = y*i - @param y FP8 instance - @param i an integer - */ -extern void FP8_imul(FP8 *x, FP8 *y, int i); -/** @brief Squaring an FP8 - * - @param x FP8 instance, on exit = y^2 - @param y FP8 instance - */ -extern void FP8_sqr(FP8 *x, FP8 *y); -/** @brief Multiplication of two FP8s - * - @param x FP8 instance, on exit = y*z - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_mul(FP8 *x, FP8 *y, FP8 *z); -/** @brief Inverting an FP8 - * - @param x FP8 instance, on exit = 1/y - @param y FP8 instance - @param h optional input hint - */ -extern void FP8_inv(FP8 *x, FP8 *y, FP *h); -/** @brief Formats and outputs an FP8 to the console - * - @param x FP8 instance to be printed - */ -extern void FP8_output(FP8 *x); -/** @brief Divide an FP8 by 2 - * - @param x FP8 instance, on exit = y/2 - @param y FP8 instance - */ -extern void FP8_div2(FP8 *x, FP8 *y); - -/** @brief Formats and outputs an FP8 to the console in raw form (for debugging) - * - @param x FP8 instance to be printed - */ -extern void FP8_rawoutput(FP8 *x); -/** @brief multiplies an FP8 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP8 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP8_times_i(FP8 *x); -/** @brief multiplies an FP8 instance by irreducible polynomial (1+sqrt(-1)) - * - @param x FP8 instance, on exit = (1+sqrt(-1)*x - */ -extern void FP8_times_i2(FP8 *x); - -/** @brief Normalises the components of an FP8 - * - @param x FP8 instance to be normalised - */ -extern void FP8_norm(FP8 *x); -/** @brief Reduces all components of possibly unreduced FP8 mod Modulus - * - @param x FP8 instance, on exit reduced mod Modulus - */ -extern void FP8_reduce(FP8 *x); -/** @brief Raises an FP8 to the power of a BIG - * - @param x FP8 instance, on exit = y^b - @param y FP8 instance - @param b BIG number - */ -extern void FP8_pow(FP8 *x, FP8 *y, B288_60::BIG b); -/** @brief Raises an FP8 to the power of the internal modulus p, using the Frobenius - * - @param x FP8 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP8_frob(FP8 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP8 instance, on exit = w*x-conj(x)*y+z - @param w FP8 instance - @param x FP8 instance - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_xtr_A(FP8 *r, FP8 *w, FP8 *x, FP8 *y, FP8 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP8 instance, on exit = x^2-2*conj(x) - @param x FP8 instance - */ -extern void FP8_xtr_D(FP8 *r, FP8 *x); -/** @brief Calculates FP8 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP8 instance, on exit = trace(w^b) - @param x FP8 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP8_xtr_pow(FP8 *r, FP8 *x, B288_60::BIG b); -/** @brief Calculates FP8 trace of c^a.d^b, where c and d are derived from FP8 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP8 instance, on exit = trace(c^a.d^b) - @param c FP8 instance, trace of an FP12 - @param d FP8 instance, trace of an FP12 - @param e FP8 instance, trace of an FP12 - @param f FP8 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP8_xtr_pow2(FP8 *r, FP8 *c, FP8 *d, FP8 *e, FP8 *f, B288_60::BIG a, B288_60::BIG b); - -/** @brief Test FP8 for QR - * - Square root - @param r FP8 instance - @param h optional generated hint - @return 1 r is a QR, otherwise 0 - */ -extern int FP8_qr(FP8 *r, FP *h); - - -/** @brief Calculate square root of an FP8 - * - Square root - @param r FP8 instance, on exit = sqrt(x) - @param x FP8 instance - @param h optional input hint - */ -extern void FP8_sqrt(FP8 *r, FP8 *x, FP *h); - - -/** @brief Conditional copy of FP8 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP8 instance, set to y if s!=0 - @param y another FP8 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP8_cmove(FP8 *x, FP8 *y, int s); - - -/** @brief Divide FP8 number by QNR - * - Divide FP8 by the QNR - @param x FP8 instance - */ -extern void FP8_div_i(FP8 *x); - -/** @brief Generate random FP8 - * - @param x random FP8 number - @param rng random number generator - */ -extern void FP8_rand(FP8 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP8_BLS48286_H +#define FP8_BLS48286_H + +#include "fp4_BLS48286.h" +#include "config_curve_BLS48286.h" + +using namespace core; + +namespace BLS48286 { + +/** + @brief FP8 Structure - towered over two FP4 +*/ + +typedef struct +{ + FP4 a; /**< real part of FP8 */ + FP4 b; /**< imaginary part of FP8 */ +} FP8; + + +/* FP8 prototypes */ +/** @brief Tests for FP8 equal to zero + * + @param x FP8 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP8_iszilch(FP8 *x); + +/** @brief Tests for lexically larger + * + @param x FP8 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP8_islarger(FP8 *x); + +/** @brief Serialize in FP8 + * + @param b buffer for output + @param x FP8 number to be serialized + */ +extern void FP8_toBytes(char *b,FP8 *x); +/** @brief Serialize out FP8 + * + @param x FP8 number to be serialized + @param b buffer for input + */ +extern void FP8_fromBytes(FP8 *x,char *b); + + +/** @brief Tests for FP8 equal to unity + * + @param x FP8 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP8_isunity(FP8 *x); +/** @brief Tests for equality of two FP8s + * + @param x FP8 instance to be compared + @param y FP8 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP8_equals(FP8 *x, FP8 *y); +/** @brief Tests for FP8 having only a real part and no imaginary part + * + @param x FP8 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP8_isreal(FP8 *x); +/** @brief Initialise FP8 from two FP4s + * + @param x FP8 instance to be initialised + @param a FP4 to form real part of FP8 + @param b FP4 to form imaginary part of FP8 + */ +extern void FP8_from_FP4s(FP8 *x, FP4 *a, FP4 *b); +/** @brief Initialise FP8 from single FP4 + * + Imaginary part is set to zero + @param x FP8 instance to be initialised + @param a FP4 to form real part of FP8 + */ +extern void FP8_from_FP4(FP8 *x, FP4 *a); + +/** @brief Initialise FP8 from single FP4 + * + real part is set to zero + @param x FP8 instance to be initialised + @param a FP4 to form imaginary part of FP8 + */ +extern void FP8_from_FP4H(FP8 *x, FP4 *a); + +/** @brief Initialise FP8 from single FP + * + @param x FP8 instance to be initialised + @param a FP to form real part of FP8 + */ +extern void FP8_from_FP(FP8 *x, FP *a); + +/** @brief Copy FP8 to another FP8 + * + @param x FP8 instance, on exit = y + @param y FP8 instance to be copied + */ +extern void FP8_copy(FP8 *x, FP8 *y); + +/** @brief Set FP8 to zero + * + @param x FP8 instance to be set to zero + */ +extern void FP8_zero(FP8 *x); +/** @brief Set FP8 to unity + * + @param x FP8 instance to be set to one + */ +extern void FP8_one(FP8 *x); + +/** @brief Sign of FP8 + * + @param x FP8 instance + @return "sign" of FP8 + */ +extern int FP8_sign(FP8 *x); + +/** @brief Negation of FP8 + * + @param x FP8 instance, on exit = -y + @param y FP8 instance + */ +extern void FP8_neg(FP8 *x, FP8 *y); +/** @brief Conjugation of FP8 + * + If y=(a,b) on exit x=(a,-b) + @param x FP8 instance, on exit = conj(y) + @param y FP8 instance + */ +extern void FP8_conj(FP8 *x, FP8 *y); +/** @brief Negative conjugation of FP8 + * + If y=(a,b) on exit x=(-a,b) + @param x FP8 instance, on exit = -conj(y) + @param y FP8 instance + */ +extern void FP8_nconj(FP8 *x, FP8 *y); +/** @brief addition of two FP8s + * + @param x FP8 instance, on exit = y+z + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_add(FP8 *x, FP8 *y, FP8 *z); +/** @brief subtraction of two FP8s + * + @param x FP8 instance, on exit = y-z + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_sub(FP8 *x, FP8 *y, FP8 *z); +/** @brief Multiplication of an FP8 by an FP4 + * + @param x FP8 instance, on exit = y*a + @param y FP8 instance + @param a FP4 multiplier + */ +extern void FP8_pmul(FP8 *x, FP8 *y, FP4 *a); + +/** @brief Multiplication of an FP8 by an FP2 + * + @param x FP8 instance, on exit = y*a + @param y FP8 instance + @param a FP2 multiplier + */ +extern void FP8_qmul(FP8 *x, FP8 *y, FP2 *a); + +/** @brief Multiplication of an FP8 by an FP + * + @param x FP8 instance, on exit = y*a + @param y FP8 instance + @param a FP multiplier + */ +extern void FP8_tmul(FP8 *x, FP8 *y, FP *a); + + + +/** @brief Multiplication of an FP8 by a small integer + * + @param x FP8 instance, on exit = y*i + @param y FP8 instance + @param i an integer + */ +extern void FP8_imul(FP8 *x, FP8 *y, int i); +/** @brief Squaring an FP8 + * + @param x FP8 instance, on exit = y^2 + @param y FP8 instance + */ +extern void FP8_sqr(FP8 *x, FP8 *y); +/** @brief Multiplication of two FP8s + * + @param x FP8 instance, on exit = y*z + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_mul(FP8 *x, FP8 *y, FP8 *z); +/** @brief Inverting an FP8 + * + @param x FP8 instance, on exit = 1/y + @param y FP8 instance + @param h optional input hint + */ +extern void FP8_inv(FP8 *x, FP8 *y, FP *h); +/** @brief Formats and outputs an FP8 to the console + * + @param x FP8 instance to be printed + */ +extern void FP8_output(FP8 *x); +/** @brief Divide an FP8 by 2 + * + @param x FP8 instance, on exit = y/2 + @param y FP8 instance + */ +extern void FP8_div2(FP8 *x, FP8 *y); + +/** @brief Formats and outputs an FP8 to the console in raw form (for debugging) + * + @param x FP8 instance to be printed + */ +extern void FP8_rawoutput(FP8 *x); +/** @brief multiplies an FP8 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP8 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP8_times_i(FP8 *x); +/** @brief multiplies an FP8 instance by irreducible polynomial (1+sqrt(-1)) + * + @param x FP8 instance, on exit = (1+sqrt(-1)*x + */ +extern void FP8_times_i2(FP8 *x); + +/** @brief Normalises the components of an FP8 + * + @param x FP8 instance to be normalised + */ +extern void FP8_norm(FP8 *x); +/** @brief Reduces all components of possibly unreduced FP8 mod Modulus + * + @param x FP8 instance, on exit reduced mod Modulus + */ +extern void FP8_reduce(FP8 *x); +/** @brief Raises an FP8 to the power of a BIG + * + @param x FP8 instance, on exit = y^b + @param y FP8 instance + @param b BIG number + */ +extern void FP8_pow(FP8 *x, FP8 *y, B288_60::BIG b); +/** @brief Raises an FP8 to the power of the internal modulus p, using the Frobenius + * + @param x FP8 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP8_frob(FP8 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP8 instance, on exit = w*x-conj(x)*y+z + @param w FP8 instance + @param x FP8 instance + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_xtr_A(FP8 *r, FP8 *w, FP8 *x, FP8 *y, FP8 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP8 instance, on exit = x^2-2*conj(x) + @param x FP8 instance + */ +extern void FP8_xtr_D(FP8 *r, FP8 *x); +/** @brief Calculates FP8 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP8 instance, on exit = trace(w^b) + @param x FP8 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP8_xtr_pow(FP8 *r, FP8 *x, B288_60::BIG b); +/** @brief Calculates FP8 trace of c^a.d^b, where c and d are derived from FP8 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP8 instance, on exit = trace(c^a.d^b) + @param c FP8 instance, trace of an FP12 + @param d FP8 instance, trace of an FP12 + @param e FP8 instance, trace of an FP12 + @param f FP8 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP8_xtr_pow2(FP8 *r, FP8 *c, FP8 *d, FP8 *e, FP8 *f, B288_60::BIG a, B288_60::BIG b); + +/** @brief Test FP8 for QR + * + Square root + @param r FP8 instance + @param h optional generated hint + @return 1 r is a QR, otherwise 0 + */ +extern int FP8_qr(FP8 *r, FP *h); + + +/** @brief Calculate square root of an FP8 + * + Square root + @param r FP8 instance, on exit = sqrt(x) + @param x FP8 instance + @param h optional input hint + */ +extern void FP8_sqrt(FP8 *r, FP8 *x, FP *h); + + +/** @brief Conditional copy of FP8 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP8 instance, set to y if s!=0 + @param y another FP8 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP8_cmove(FP8 *x, FP8 *y, int s); + + +/** @brief Divide FP8 number by QNR + * + Divide FP8 by the QNR + @param x FP8 instance + */ +extern void FP8_div_i(FP8 *x); + +/** @brief Generate random FP8 + * + @param x random FP8 number + @param rng random number generator + */ +extern void FP8_rand(FP8 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8_BLS48556.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8_BLS48556.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8_BLS48556.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8_BLS48556.h index c6d00fe..30eda14 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8_BLS48556.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8_BLS48556.h @@ -1,365 +1,365 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP8_BLS48556_H -#define FP8_BLS48556_H - -#include "fp4_BLS48556.h" -#include "config_curve_BLS48556.h" - -using namespace core; - -namespace BLS48556 { - -/** - @brief FP8 Structure - towered over two FP4 -*/ - -typedef struct -{ - FP4 a; /**< real part of FP8 */ - FP4 b; /**< imaginary part of FP8 */ -} FP8; - - -/* FP8 prototypes */ -/** @brief Tests for FP8 equal to zero - * - @param x FP8 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP8_iszilch(FP8 *x); - -/** @brief Tests for lexically larger - * - @param x FP8 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP8_islarger(FP8 *x); - -/** @brief Serialize in FP8 - * - @param b buffer for output - @param x FP8 number to be serialized - */ -extern void FP8_toBytes(char *b,FP8 *x); -/** @brief Serialize out FP8 - * - @param x FP8 number to be serialized - @param b buffer for input - */ -extern void FP8_fromBytes(FP8 *x,char *b); - - -/** @brief Tests for FP8 equal to unity - * - @param x FP8 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP8_isunity(FP8 *x); -/** @brief Tests for equality of two FP8s - * - @param x FP8 instance to be compared - @param y FP8 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP8_equals(FP8 *x, FP8 *y); -/** @brief Tests for FP8 having only a real part and no imaginary part - * - @param x FP8 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP8_isreal(FP8 *x); -/** @brief Initialise FP8 from two FP4s - * - @param x FP8 instance to be initialised - @param a FP4 to form real part of FP8 - @param b FP4 to form imaginary part of FP8 - */ -extern void FP8_from_FP4s(FP8 *x, FP4 *a, FP4 *b); -/** @brief Initialise FP8 from single FP4 - * - Imaginary part is set to zero - @param x FP8 instance to be initialised - @param a FP4 to form real part of FP8 - */ -extern void FP8_from_FP4(FP8 *x, FP4 *a); - -/** @brief Initialise FP8 from single FP4 - * - real part is set to zero - @param x FP8 instance to be initialised - @param a FP4 to form imaginary part of FP8 - */ -extern void FP8_from_FP4H(FP8 *x, FP4 *a); - -/** @brief Initialise FP8 from single FP - * - @param x FP8 instance to be initialised - @param a FP to form real part of FP8 - */ -extern void FP8_from_FP(FP8 *x, FP *a); - -/** @brief Copy FP8 to another FP8 - * - @param x FP8 instance, on exit = y - @param y FP8 instance to be copied - */ -extern void FP8_copy(FP8 *x, FP8 *y); - -/** @brief Set FP8 to zero - * - @param x FP8 instance to be set to zero - */ -extern void FP8_zero(FP8 *x); -/** @brief Set FP8 to unity - * - @param x FP8 instance to be set to one - */ -extern void FP8_one(FP8 *x); - -/** @brief Sign of FP8 - * - @param x FP8 instance - @return "sign" of FP8 - */ -extern int FP8_sign(FP8 *x); - -/** @brief Negation of FP8 - * - @param x FP8 instance, on exit = -y - @param y FP8 instance - */ -extern void FP8_neg(FP8 *x, FP8 *y); -/** @brief Conjugation of FP8 - * - If y=(a,b) on exit x=(a,-b) - @param x FP8 instance, on exit = conj(y) - @param y FP8 instance - */ -extern void FP8_conj(FP8 *x, FP8 *y); -/** @brief Negative conjugation of FP8 - * - If y=(a,b) on exit x=(-a,b) - @param x FP8 instance, on exit = -conj(y) - @param y FP8 instance - */ -extern void FP8_nconj(FP8 *x, FP8 *y); -/** @brief addition of two FP8s - * - @param x FP8 instance, on exit = y+z - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_add(FP8 *x, FP8 *y, FP8 *z); -/** @brief subtraction of two FP8s - * - @param x FP8 instance, on exit = y-z - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_sub(FP8 *x, FP8 *y, FP8 *z); -/** @brief Multiplication of an FP8 by an FP4 - * - @param x FP8 instance, on exit = y*a - @param y FP8 instance - @param a FP4 multiplier - */ -extern void FP8_pmul(FP8 *x, FP8 *y, FP4 *a); - -/** @brief Multiplication of an FP8 by an FP2 - * - @param x FP8 instance, on exit = y*a - @param y FP8 instance - @param a FP2 multiplier - */ -extern void FP8_qmul(FP8 *x, FP8 *y, FP2 *a); - -/** @brief Multiplication of an FP8 by an FP - * - @param x FP8 instance, on exit = y*a - @param y FP8 instance - @param a FP multiplier - */ -extern void FP8_tmul(FP8 *x, FP8 *y, FP *a); - - - -/** @brief Multiplication of an FP8 by a small integer - * - @param x FP8 instance, on exit = y*i - @param y FP8 instance - @param i an integer - */ -extern void FP8_imul(FP8 *x, FP8 *y, int i); -/** @brief Squaring an FP8 - * - @param x FP8 instance, on exit = y^2 - @param y FP8 instance - */ -extern void FP8_sqr(FP8 *x, FP8 *y); -/** @brief Multiplication of two FP8s - * - @param x FP8 instance, on exit = y*z - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_mul(FP8 *x, FP8 *y, FP8 *z); -/** @brief Inverting an FP8 - * - @param x FP8 instance, on exit = 1/y - @param y FP8 instance - @param h optional input hint - */ -extern void FP8_inv(FP8 *x, FP8 *y, FP *h); -/** @brief Formats and outputs an FP8 to the console - * - @param x FP8 instance to be printed - */ -extern void FP8_output(FP8 *x); -/** @brief Divide an FP8 by 2 - * - @param x FP8 instance, on exit = y/2 - @param y FP8 instance - */ -extern void FP8_div2(FP8 *x, FP8 *y); - -/** @brief Formats and outputs an FP8 to the console in raw form (for debugging) - * - @param x FP8 instance to be printed - */ -extern void FP8_rawoutput(FP8 *x); -/** @brief multiplies an FP8 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP8 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP8_times_i(FP8 *x); -/** @brief multiplies an FP8 instance by irreducible polynomial (1+sqrt(-1)) - * - @param x FP8 instance, on exit = (1+sqrt(-1)*x - */ -extern void FP8_times_i2(FP8 *x); - -/** @brief Normalises the components of an FP8 - * - @param x FP8 instance to be normalised - */ -extern void FP8_norm(FP8 *x); -/** @brief Reduces all components of possibly unreduced FP8 mod Modulus - * - @param x FP8 instance, on exit reduced mod Modulus - */ -extern void FP8_reduce(FP8 *x); -/** @brief Raises an FP8 to the power of a BIG - * - @param x FP8 instance, on exit = y^b - @param y FP8 instance - @param b BIG number - */ -extern void FP8_pow(FP8 *x, FP8 *y, B560_58::BIG b); -/** @brief Raises an FP8 to the power of the internal modulus p, using the Frobenius - * - @param x FP8 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP8_frob(FP8 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP8 instance, on exit = w*x-conj(x)*y+z - @param w FP8 instance - @param x FP8 instance - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_xtr_A(FP8 *r, FP8 *w, FP8 *x, FP8 *y, FP8 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP8 instance, on exit = x^2-2*conj(x) - @param x FP8 instance - */ -extern void FP8_xtr_D(FP8 *r, FP8 *x); -/** @brief Calculates FP8 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP8 instance, on exit = trace(w^b) - @param x FP8 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP8_xtr_pow(FP8 *r, FP8 *x, B560_58::BIG b); -/** @brief Calculates FP8 trace of c^a.d^b, where c and d are derived from FP8 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP8 instance, on exit = trace(c^a.d^b) - @param c FP8 instance, trace of an FP12 - @param d FP8 instance, trace of an FP12 - @param e FP8 instance, trace of an FP12 - @param f FP8 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP8_xtr_pow2(FP8 *r, FP8 *c, FP8 *d, FP8 *e, FP8 *f, B560_58::BIG a, B560_58::BIG b); - -/** @brief Test FP8 for QR - * - Square root - @param r FP8 instance - @param h optional generated hint - @return 1 r is a QR, otherwise 0 - */ -extern int FP8_qr(FP8 *r, FP *h); - - -/** @brief Calculate square root of an FP8 - * - Square root - @param r FP8 instance, on exit = sqrt(x) - @param x FP8 instance - @param h optional input hint - */ -extern void FP8_sqrt(FP8 *r, FP8 *x, FP *h); - - -/** @brief Conditional copy of FP8 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP8 instance, set to y if s!=0 - @param y another FP8 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP8_cmove(FP8 *x, FP8 *y, int s); - - -/** @brief Divide FP8 number by QNR - * - Divide FP8 by the QNR - @param x FP8 instance - */ -extern void FP8_div_i(FP8 *x); - -/** @brief Generate random FP8 - * - @param x random FP8 number - @param rng random number generator - */ -extern void FP8_rand(FP8 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP8_BLS48556_H +#define FP8_BLS48556_H + +#include "fp4_BLS48556.h" +#include "config_curve_BLS48556.h" + +using namespace core; + +namespace BLS48556 { + +/** + @brief FP8 Structure - towered over two FP4 +*/ + +typedef struct +{ + FP4 a; /**< real part of FP8 */ + FP4 b; /**< imaginary part of FP8 */ +} FP8; + + +/* FP8 prototypes */ +/** @brief Tests for FP8 equal to zero + * + @param x FP8 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP8_iszilch(FP8 *x); + +/** @brief Tests for lexically larger + * + @param x FP8 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP8_islarger(FP8 *x); + +/** @brief Serialize in FP8 + * + @param b buffer for output + @param x FP8 number to be serialized + */ +extern void FP8_toBytes(char *b,FP8 *x); +/** @brief Serialize out FP8 + * + @param x FP8 number to be serialized + @param b buffer for input + */ +extern void FP8_fromBytes(FP8 *x,char *b); + + +/** @brief Tests for FP8 equal to unity + * + @param x FP8 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP8_isunity(FP8 *x); +/** @brief Tests for equality of two FP8s + * + @param x FP8 instance to be compared + @param y FP8 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP8_equals(FP8 *x, FP8 *y); +/** @brief Tests for FP8 having only a real part and no imaginary part + * + @param x FP8 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP8_isreal(FP8 *x); +/** @brief Initialise FP8 from two FP4s + * + @param x FP8 instance to be initialised + @param a FP4 to form real part of FP8 + @param b FP4 to form imaginary part of FP8 + */ +extern void FP8_from_FP4s(FP8 *x, FP4 *a, FP4 *b); +/** @brief Initialise FP8 from single FP4 + * + Imaginary part is set to zero + @param x FP8 instance to be initialised + @param a FP4 to form real part of FP8 + */ +extern void FP8_from_FP4(FP8 *x, FP4 *a); + +/** @brief Initialise FP8 from single FP4 + * + real part is set to zero + @param x FP8 instance to be initialised + @param a FP4 to form imaginary part of FP8 + */ +extern void FP8_from_FP4H(FP8 *x, FP4 *a); + +/** @brief Initialise FP8 from single FP + * + @param x FP8 instance to be initialised + @param a FP to form real part of FP8 + */ +extern void FP8_from_FP(FP8 *x, FP *a); + +/** @brief Copy FP8 to another FP8 + * + @param x FP8 instance, on exit = y + @param y FP8 instance to be copied + */ +extern void FP8_copy(FP8 *x, FP8 *y); + +/** @brief Set FP8 to zero + * + @param x FP8 instance to be set to zero + */ +extern void FP8_zero(FP8 *x); +/** @brief Set FP8 to unity + * + @param x FP8 instance to be set to one + */ +extern void FP8_one(FP8 *x); + +/** @brief Sign of FP8 + * + @param x FP8 instance + @return "sign" of FP8 + */ +extern int FP8_sign(FP8 *x); + +/** @brief Negation of FP8 + * + @param x FP8 instance, on exit = -y + @param y FP8 instance + */ +extern void FP8_neg(FP8 *x, FP8 *y); +/** @brief Conjugation of FP8 + * + If y=(a,b) on exit x=(a,-b) + @param x FP8 instance, on exit = conj(y) + @param y FP8 instance + */ +extern void FP8_conj(FP8 *x, FP8 *y); +/** @brief Negative conjugation of FP8 + * + If y=(a,b) on exit x=(-a,b) + @param x FP8 instance, on exit = -conj(y) + @param y FP8 instance + */ +extern void FP8_nconj(FP8 *x, FP8 *y); +/** @brief addition of two FP8s + * + @param x FP8 instance, on exit = y+z + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_add(FP8 *x, FP8 *y, FP8 *z); +/** @brief subtraction of two FP8s + * + @param x FP8 instance, on exit = y-z + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_sub(FP8 *x, FP8 *y, FP8 *z); +/** @brief Multiplication of an FP8 by an FP4 + * + @param x FP8 instance, on exit = y*a + @param y FP8 instance + @param a FP4 multiplier + */ +extern void FP8_pmul(FP8 *x, FP8 *y, FP4 *a); + +/** @brief Multiplication of an FP8 by an FP2 + * + @param x FP8 instance, on exit = y*a + @param y FP8 instance + @param a FP2 multiplier + */ +extern void FP8_qmul(FP8 *x, FP8 *y, FP2 *a); + +/** @brief Multiplication of an FP8 by an FP + * + @param x FP8 instance, on exit = y*a + @param y FP8 instance + @param a FP multiplier + */ +extern void FP8_tmul(FP8 *x, FP8 *y, FP *a); + + + +/** @brief Multiplication of an FP8 by a small integer + * + @param x FP8 instance, on exit = y*i + @param y FP8 instance + @param i an integer + */ +extern void FP8_imul(FP8 *x, FP8 *y, int i); +/** @brief Squaring an FP8 + * + @param x FP8 instance, on exit = y^2 + @param y FP8 instance + */ +extern void FP8_sqr(FP8 *x, FP8 *y); +/** @brief Multiplication of two FP8s + * + @param x FP8 instance, on exit = y*z + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_mul(FP8 *x, FP8 *y, FP8 *z); +/** @brief Inverting an FP8 + * + @param x FP8 instance, on exit = 1/y + @param y FP8 instance + @param h optional input hint + */ +extern void FP8_inv(FP8 *x, FP8 *y, FP *h); +/** @brief Formats and outputs an FP8 to the console + * + @param x FP8 instance to be printed + */ +extern void FP8_output(FP8 *x); +/** @brief Divide an FP8 by 2 + * + @param x FP8 instance, on exit = y/2 + @param y FP8 instance + */ +extern void FP8_div2(FP8 *x, FP8 *y); + +/** @brief Formats and outputs an FP8 to the console in raw form (for debugging) + * + @param x FP8 instance to be printed + */ +extern void FP8_rawoutput(FP8 *x); +/** @brief multiplies an FP8 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP8 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP8_times_i(FP8 *x); +/** @brief multiplies an FP8 instance by irreducible polynomial (1+sqrt(-1)) + * + @param x FP8 instance, on exit = (1+sqrt(-1)*x + */ +extern void FP8_times_i2(FP8 *x); + +/** @brief Normalises the components of an FP8 + * + @param x FP8 instance to be normalised + */ +extern void FP8_norm(FP8 *x); +/** @brief Reduces all components of possibly unreduced FP8 mod Modulus + * + @param x FP8 instance, on exit reduced mod Modulus + */ +extern void FP8_reduce(FP8 *x); +/** @brief Raises an FP8 to the power of a BIG + * + @param x FP8 instance, on exit = y^b + @param y FP8 instance + @param b BIG number + */ +extern void FP8_pow(FP8 *x, FP8 *y, B560_58::BIG b); +/** @brief Raises an FP8 to the power of the internal modulus p, using the Frobenius + * + @param x FP8 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP8_frob(FP8 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP8 instance, on exit = w*x-conj(x)*y+z + @param w FP8 instance + @param x FP8 instance + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_xtr_A(FP8 *r, FP8 *w, FP8 *x, FP8 *y, FP8 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP8 instance, on exit = x^2-2*conj(x) + @param x FP8 instance + */ +extern void FP8_xtr_D(FP8 *r, FP8 *x); +/** @brief Calculates FP8 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP8 instance, on exit = trace(w^b) + @param x FP8 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP8_xtr_pow(FP8 *r, FP8 *x, B560_58::BIG b); +/** @brief Calculates FP8 trace of c^a.d^b, where c and d are derived from FP8 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP8 instance, on exit = trace(c^a.d^b) + @param c FP8 instance, trace of an FP12 + @param d FP8 instance, trace of an FP12 + @param e FP8 instance, trace of an FP12 + @param f FP8 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP8_xtr_pow2(FP8 *r, FP8 *c, FP8 *d, FP8 *e, FP8 *f, B560_58::BIG a, B560_58::BIG b); + +/** @brief Test FP8 for QR + * + Square root + @param r FP8 instance + @param h optional generated hint + @return 1 r is a QR, otherwise 0 + */ +extern int FP8_qr(FP8 *r, FP *h); + + +/** @brief Calculate square root of an FP8 + * + Square root + @param r FP8 instance, on exit = sqrt(x) + @param x FP8 instance + @param h optional input hint + */ +extern void FP8_sqrt(FP8 *r, FP8 *x, FP *h); + + +/** @brief Conditional copy of FP8 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP8 instance, set to y if s!=0 + @param y another FP8 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP8_cmove(FP8 *x, FP8 *y, int s); + + +/** @brief Divide FP8 number by QNR + * + Divide FP8 by the QNR + @param x FP8 instance + */ +extern void FP8_div_i(FP8 *x); + +/** @brief Generate random FP8 + * + @param x random FP8 number + @param rng random number generator + */ +extern void FP8_rand(FP8 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8_BLS48581.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8_BLS48581.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8_BLS48581.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8_BLS48581.h index 91c6ff6..3a56ea4 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8_BLS48581.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp8_BLS48581.h @@ -1,365 +1,365 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP8_BLS48581_H -#define FP8_BLS48581_H - -#include "fp4_BLS48581.h" -#include "config_curve_BLS48581.h" - -using namespace core; - -namespace BLS48581 { - -/** - @brief FP8 Structure - towered over two FP4 -*/ - -typedef struct -{ - FP4 a; /**< real part of FP8 */ - FP4 b; /**< imaginary part of FP8 */ -} FP8; - - -/* FP8 prototypes */ -/** @brief Tests for FP8 equal to zero - * - @param x FP8 number to be tested - @return 1 if zero, else returns 0 - */ -extern int FP8_iszilch(FP8 *x); - -/** @brief Tests for lexically larger - * - @param x FP8 number to be tested if larger than -x - @return 1 if larger, else returns 0 - */ -extern int FP8_islarger(FP8 *x); - -/** @brief Serialize in FP8 - * - @param b buffer for output - @param x FP8 number to be serialized - */ -extern void FP8_toBytes(char *b,FP8 *x); -/** @brief Serialize out FP8 - * - @param x FP8 number to be serialized - @param b buffer for input - */ -extern void FP8_fromBytes(FP8 *x,char *b); - - -/** @brief Tests for FP8 equal to unity - * - @param x FP8 number to be tested - @return 1 if unity, else returns 0 - */ -extern int FP8_isunity(FP8 *x); -/** @brief Tests for equality of two FP8s - * - @param x FP8 instance to be compared - @param y FP8 instance to be compared - @return 1 if x=y, else returns 0 - */ -extern int FP8_equals(FP8 *x, FP8 *y); -/** @brief Tests for FP8 having only a real part and no imaginary part - * - @param x FP8 number to be tested - @return 1 if real, else returns 0 - */ -extern int FP8_isreal(FP8 *x); -/** @brief Initialise FP8 from two FP4s - * - @param x FP8 instance to be initialised - @param a FP4 to form real part of FP8 - @param b FP4 to form imaginary part of FP8 - */ -extern void FP8_from_FP4s(FP8 *x, FP4 *a, FP4 *b); -/** @brief Initialise FP8 from single FP4 - * - Imaginary part is set to zero - @param x FP8 instance to be initialised - @param a FP4 to form real part of FP8 - */ -extern void FP8_from_FP4(FP8 *x, FP4 *a); - -/** @brief Initialise FP8 from single FP4 - * - real part is set to zero - @param x FP8 instance to be initialised - @param a FP4 to form imaginary part of FP8 - */ -extern void FP8_from_FP4H(FP8 *x, FP4 *a); - -/** @brief Initialise FP8 from single FP - * - @param x FP8 instance to be initialised - @param a FP to form real part of FP8 - */ -extern void FP8_from_FP(FP8 *x, FP *a); - -/** @brief Copy FP8 to another FP8 - * - @param x FP8 instance, on exit = y - @param y FP8 instance to be copied - */ -extern void FP8_copy(FP8 *x, FP8 *y); - -/** @brief Set FP8 to zero - * - @param x FP8 instance to be set to zero - */ -extern void FP8_zero(FP8 *x); -/** @brief Set FP8 to unity - * - @param x FP8 instance to be set to one - */ -extern void FP8_one(FP8 *x); - -/** @brief Sign of FP8 - * - @param x FP8 instance - @return "sign" of FP8 - */ -extern int FP8_sign(FP8 *x); - -/** @brief Negation of FP8 - * - @param x FP8 instance, on exit = -y - @param y FP8 instance - */ -extern void FP8_neg(FP8 *x, FP8 *y); -/** @brief Conjugation of FP8 - * - If y=(a,b) on exit x=(a,-b) - @param x FP8 instance, on exit = conj(y) - @param y FP8 instance - */ -extern void FP8_conj(FP8 *x, FP8 *y); -/** @brief Negative conjugation of FP8 - * - If y=(a,b) on exit x=(-a,b) - @param x FP8 instance, on exit = -conj(y) - @param y FP8 instance - */ -extern void FP8_nconj(FP8 *x, FP8 *y); -/** @brief addition of two FP8s - * - @param x FP8 instance, on exit = y+z - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_add(FP8 *x, FP8 *y, FP8 *z); -/** @brief subtraction of two FP8s - * - @param x FP8 instance, on exit = y-z - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_sub(FP8 *x, FP8 *y, FP8 *z); -/** @brief Multiplication of an FP8 by an FP4 - * - @param x FP8 instance, on exit = y*a - @param y FP8 instance - @param a FP4 multiplier - */ -extern void FP8_pmul(FP8 *x, FP8 *y, FP4 *a); - -/** @brief Multiplication of an FP8 by an FP2 - * - @param x FP8 instance, on exit = y*a - @param y FP8 instance - @param a FP2 multiplier - */ -extern void FP8_qmul(FP8 *x, FP8 *y, FP2 *a); - -/** @brief Multiplication of an FP8 by an FP - * - @param x FP8 instance, on exit = y*a - @param y FP8 instance - @param a FP multiplier - */ -extern void FP8_tmul(FP8 *x, FP8 *y, FP *a); - - - -/** @brief Multiplication of an FP8 by a small integer - * - @param x FP8 instance, on exit = y*i - @param y FP8 instance - @param i an integer - */ -extern void FP8_imul(FP8 *x, FP8 *y, int i); -/** @brief Squaring an FP8 - * - @param x FP8 instance, on exit = y^2 - @param y FP8 instance - */ -extern void FP8_sqr(FP8 *x, FP8 *y); -/** @brief Multiplication of two FP8s - * - @param x FP8 instance, on exit = y*z - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_mul(FP8 *x, FP8 *y, FP8 *z); -/** @brief Inverting an FP8 - * - @param x FP8 instance, on exit = 1/y - @param y FP8 instance - @param h optional input hint - */ -extern void FP8_inv(FP8 *x, FP8 *y, FP *h); -/** @brief Formats and outputs an FP8 to the console - * - @param x FP8 instance to be printed - */ -extern void FP8_output(FP8 *x); -/** @brief Divide an FP8 by 2 - * - @param x FP8 instance, on exit = y/2 - @param y FP8 instance - */ -extern void FP8_div2(FP8 *x, FP8 *y); - -/** @brief Formats and outputs an FP8 to the console in raw form (for debugging) - * - @param x FP8 instance to be printed - */ -extern void FP8_rawoutput(FP8 *x); -/** @brief multiplies an FP8 instance by irreducible polynomial sqrt(1+sqrt(-1)) - * - @param x FP8 instance, on exit = sqrt(1+sqrt(-1)*x - */ -extern void FP8_times_i(FP8 *x); -/** @brief multiplies an FP8 instance by irreducible polynomial (1+sqrt(-1)) - * - @param x FP8 instance, on exit = (1+sqrt(-1)*x - */ -extern void FP8_times_i2(FP8 *x); - -/** @brief Normalises the components of an FP8 - * - @param x FP8 instance to be normalised - */ -extern void FP8_norm(FP8 *x); -/** @brief Reduces all components of possibly unreduced FP8 mod Modulus - * - @param x FP8 instance, on exit reduced mod Modulus - */ -extern void FP8_reduce(FP8 *x); -/** @brief Raises an FP8 to the power of a BIG - * - @param x FP8 instance, on exit = y^b - @param y FP8 instance - @param b BIG number - */ -extern void FP8_pow(FP8 *x, FP8 *y, B584_60::BIG b); -/** @brief Raises an FP8 to the power of the internal modulus p, using the Frobenius - * - @param x FP8 instance, on exit = x^p - @param f FP2 precalculated Frobenius constant - */ -extern void FP8_frob(FP8 *x, FP2 *f); -/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z - * - @param r FP8 instance, on exit = w*x-conj(x)*y+z - @param w FP8 instance - @param x FP8 instance - @param y FP8 instance - @param z FP8 instance - */ -extern void FP8_xtr_A(FP8 *r, FP8 *w, FP8 *x, FP8 *y, FP8 *z); -/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) - * - @param r FP8 instance, on exit = x^2-2*conj(x) - @param x FP8 instance - */ -extern void FP8_xtr_D(FP8 *r, FP8 *x); -/** @brief Calculates FP8 trace of an FP12 raised to the power of a BIG number - * - XTR single exponentiation - @param r FP8 instance, on exit = trace(w^b) - @param x FP8 instance, trace of an FP12 w - @param b BIG number - */ -extern void FP8_xtr_pow(FP8 *r, FP8 *x, B584_60::BIG b); -/** @brief Calculates FP8 trace of c^a.d^b, where c and d are derived from FP8 traces of FP12s - * - XTR double exponentiation - Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) - @param r FP8 instance, on exit = trace(c^a.d^b) - @param c FP8 instance, trace of an FP12 - @param d FP8 instance, trace of an FP12 - @param e FP8 instance, trace of an FP12 - @param f FP8 instance, trace of an FP12 - @param a BIG number - @param b BIG number - */ -extern void FP8_xtr_pow2(FP8 *r, FP8 *c, FP8 *d, FP8 *e, FP8 *f, B584_60::BIG a, B584_60::BIG b); - -/** @brief Test FP8 for QR - * - Square root - @param r FP8 instance - @param h optional generated hint - @return 1 r is a QR, otherwise 0 - */ -extern int FP8_qr(FP8 *r, FP *h); - - -/** @brief Calculate square root of an FP8 - * - Square root - @param r FP8 instance, on exit = sqrt(x) - @param x FP8 instance - @param h optional input hint - */ -extern void FP8_sqrt(FP8 *r, FP8 *x, FP *h); - - -/** @brief Conditional copy of FP8 number - * - Conditionally copies second parameter to the first (without branching) - @param x FP8 instance, set to y if s!=0 - @param y another FP8 instance - @param s copy only takes place if not equal to 0 - */ -extern void FP8_cmove(FP8 *x, FP8 *y, int s); - - -/** @brief Divide FP8 number by QNR - * - Divide FP8 by the QNR - @param x FP8 instance - */ -extern void FP8_div_i(FP8 *x); - -/** @brief Generate random FP8 - * - @param x random FP8 number - @param rng random number generator - */ -extern void FP8_rand(FP8 *x, core::csprng *rng); -} - -#endif - +/* + * Copyright (c) 2012-2020 MIRACL UK Ltd. + * + * This file is part of MIRACL Core + * (see https://github.com/miracl/core). + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FP8_BLS48581_H +#define FP8_BLS48581_H + +#include "fp4_BLS48581.h" +#include "config_curve_BLS48581.h" + +using namespace core; + +namespace BLS48581 { + +/** + @brief FP8 Structure - towered over two FP4 +*/ + +typedef struct +{ + FP4 a; /**< real part of FP8 */ + FP4 b; /**< imaginary part of FP8 */ +} FP8; + + +/* FP8 prototypes */ +/** @brief Tests for FP8 equal to zero + * + @param x FP8 number to be tested + @return 1 if zero, else returns 0 + */ +extern int FP8_iszilch(FP8 *x); + +/** @brief Tests for lexically larger + * + @param x FP8 number to be tested if larger than -x + @return 1 if larger, else returns 0 + */ +extern int FP8_islarger(FP8 *x); + +/** @brief Serialize in FP8 + * + @param b buffer for output + @param x FP8 number to be serialized + */ +extern void FP8_toBytes(char *b,FP8 *x); +/** @brief Serialize out FP8 + * + @param x FP8 number to be serialized + @param b buffer for input + */ +extern void FP8_fromBytes(FP8 *x,char *b); + + +/** @brief Tests for FP8 equal to unity + * + @param x FP8 number to be tested + @return 1 if unity, else returns 0 + */ +extern int FP8_isunity(FP8 *x); +/** @brief Tests for equality of two FP8s + * + @param x FP8 instance to be compared + @param y FP8 instance to be compared + @return 1 if x=y, else returns 0 + */ +extern int FP8_equals(FP8 *x, FP8 *y); +/** @brief Tests for FP8 having only a real part and no imaginary part + * + @param x FP8 number to be tested + @return 1 if real, else returns 0 + */ +extern int FP8_isreal(FP8 *x); +/** @brief Initialise FP8 from two FP4s + * + @param x FP8 instance to be initialised + @param a FP4 to form real part of FP8 + @param b FP4 to form imaginary part of FP8 + */ +extern void FP8_from_FP4s(FP8 *x, FP4 *a, FP4 *b); +/** @brief Initialise FP8 from single FP4 + * + Imaginary part is set to zero + @param x FP8 instance to be initialised + @param a FP4 to form real part of FP8 + */ +extern void FP8_from_FP4(FP8 *x, FP4 *a); + +/** @brief Initialise FP8 from single FP4 + * + real part is set to zero + @param x FP8 instance to be initialised + @param a FP4 to form imaginary part of FP8 + */ +extern void FP8_from_FP4H(FP8 *x, FP4 *a); + +/** @brief Initialise FP8 from single FP + * + @param x FP8 instance to be initialised + @param a FP to form real part of FP8 + */ +extern void FP8_from_FP(FP8 *x, FP *a); + +/** @brief Copy FP8 to another FP8 + * + @param x FP8 instance, on exit = y + @param y FP8 instance to be copied + */ +extern void FP8_copy(FP8 *x, FP8 *y); + +/** @brief Set FP8 to zero + * + @param x FP8 instance to be set to zero + */ +extern void FP8_zero(FP8 *x); +/** @brief Set FP8 to unity + * + @param x FP8 instance to be set to one + */ +extern void FP8_one(FP8 *x); + +/** @brief Sign of FP8 + * + @param x FP8 instance + @return "sign" of FP8 + */ +extern int FP8_sign(FP8 *x); + +/** @brief Negation of FP8 + * + @param x FP8 instance, on exit = -y + @param y FP8 instance + */ +extern void FP8_neg(FP8 *x, FP8 *y); +/** @brief Conjugation of FP8 + * + If y=(a,b) on exit x=(a,-b) + @param x FP8 instance, on exit = conj(y) + @param y FP8 instance + */ +extern void FP8_conj(FP8 *x, FP8 *y); +/** @brief Negative conjugation of FP8 + * + If y=(a,b) on exit x=(-a,b) + @param x FP8 instance, on exit = -conj(y) + @param y FP8 instance + */ +extern void FP8_nconj(FP8 *x, FP8 *y); +/** @brief addition of two FP8s + * + @param x FP8 instance, on exit = y+z + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_add(FP8 *x, FP8 *y, FP8 *z); +/** @brief subtraction of two FP8s + * + @param x FP8 instance, on exit = y-z + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_sub(FP8 *x, FP8 *y, FP8 *z); +/** @brief Multiplication of an FP8 by an FP4 + * + @param x FP8 instance, on exit = y*a + @param y FP8 instance + @param a FP4 multiplier + */ +extern void FP8_pmul(FP8 *x, FP8 *y, FP4 *a); + +/** @brief Multiplication of an FP8 by an FP2 + * + @param x FP8 instance, on exit = y*a + @param y FP8 instance + @param a FP2 multiplier + */ +extern void FP8_qmul(FP8 *x, FP8 *y, FP2 *a); + +/** @brief Multiplication of an FP8 by an FP + * + @param x FP8 instance, on exit = y*a + @param y FP8 instance + @param a FP multiplier + */ +extern void FP8_tmul(FP8 *x, FP8 *y, FP *a); + + + +/** @brief Multiplication of an FP8 by a small integer + * + @param x FP8 instance, on exit = y*i + @param y FP8 instance + @param i an integer + */ +extern void FP8_imul(FP8 *x, FP8 *y, int i); +/** @brief Squaring an FP8 + * + @param x FP8 instance, on exit = y^2 + @param y FP8 instance + */ +extern void FP8_sqr(FP8 *x, FP8 *y); +/** @brief Multiplication of two FP8s + * + @param x FP8 instance, on exit = y*z + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_mul(FP8 *x, FP8 *y, FP8 *z); +/** @brief Inverting an FP8 + * + @param x FP8 instance, on exit = 1/y + @param y FP8 instance + @param h optional input hint + */ +extern void FP8_inv(FP8 *x, FP8 *y, FP *h); +/** @brief Formats and outputs an FP8 to the console + * + @param x FP8 instance to be printed + */ +extern void FP8_output(FP8 *x); +/** @brief Divide an FP8 by 2 + * + @param x FP8 instance, on exit = y/2 + @param y FP8 instance + */ +extern void FP8_div2(FP8 *x, FP8 *y); + +/** @brief Formats and outputs an FP8 to the console in raw form (for debugging) + * + @param x FP8 instance to be printed + */ +extern void FP8_rawoutput(FP8 *x); +/** @brief multiplies an FP8 instance by irreducible polynomial sqrt(1+sqrt(-1)) + * + @param x FP8 instance, on exit = sqrt(1+sqrt(-1)*x + */ +extern void FP8_times_i(FP8 *x); +/** @brief multiplies an FP8 instance by irreducible polynomial (1+sqrt(-1)) + * + @param x FP8 instance, on exit = (1+sqrt(-1)*x + */ +extern void FP8_times_i2(FP8 *x); + +/** @brief Normalises the components of an FP8 + * + @param x FP8 instance to be normalised + */ +extern void FP8_norm(FP8 *x); +/** @brief Reduces all components of possibly unreduced FP8 mod Modulus + * + @param x FP8 instance, on exit reduced mod Modulus + */ +extern void FP8_reduce(FP8 *x); +/** @brief Raises an FP8 to the power of a BIG + * + @param x FP8 instance, on exit = y^b + @param y FP8 instance + @param b BIG number + */ +extern void FP8_pow(FP8 *x, FP8 *y, B584_60::BIG b); +/** @brief Raises an FP8 to the power of the internal modulus p, using the Frobenius + * + @param x FP8 instance, on exit = x^p + @param f FP2 precalculated Frobenius constant + */ +extern void FP8_frob(FP8 *x, FP2 *f); +/** @brief Calculates the XTR addition function r=w*x-conj(x)*y+z + * + @param r FP8 instance, on exit = w*x-conj(x)*y+z + @param w FP8 instance + @param x FP8 instance + @param y FP8 instance + @param z FP8 instance + */ +extern void FP8_xtr_A(FP8 *r, FP8 *w, FP8 *x, FP8 *y, FP8 *z); +/** @brief Calculates the XTR doubling function r=x^2-2*conj(x) + * + @param r FP8 instance, on exit = x^2-2*conj(x) + @param x FP8 instance + */ +extern void FP8_xtr_D(FP8 *r, FP8 *x); +/** @brief Calculates FP8 trace of an FP12 raised to the power of a BIG number + * + XTR single exponentiation + @param r FP8 instance, on exit = trace(w^b) + @param x FP8 instance, trace of an FP12 w + @param b BIG number + */ +extern void FP8_xtr_pow(FP8 *r, FP8 *x, B584_60::BIG b); +/** @brief Calculates FP8 trace of c^a.d^b, where c and d are derived from FP8 traces of FP12s + * + XTR double exponentiation + Assumes c=tr(x^m), d=tr(x^n), e=tr(x^(m-n)), f=tr(x^(m-2n)) + @param r FP8 instance, on exit = trace(c^a.d^b) + @param c FP8 instance, trace of an FP12 + @param d FP8 instance, trace of an FP12 + @param e FP8 instance, trace of an FP12 + @param f FP8 instance, trace of an FP12 + @param a BIG number + @param b BIG number + */ +extern void FP8_xtr_pow2(FP8 *r, FP8 *c, FP8 *d, FP8 *e, FP8 *f, B584_60::BIG a, B584_60::BIG b); + +/** @brief Test FP8 for QR + * + Square root + @param r FP8 instance + @param h optional generated hint + @return 1 r is a QR, otherwise 0 + */ +extern int FP8_qr(FP8 *r, FP *h); + + +/** @brief Calculate square root of an FP8 + * + Square root + @param r FP8 instance, on exit = sqrt(x) + @param x FP8 instance + @param h optional input hint + */ +extern void FP8_sqrt(FP8 *r, FP8 *x, FP *h); + + +/** @brief Conditional copy of FP8 number + * + Conditionally copies second parameter to the first (without branching) + @param x FP8 instance, set to y if s!=0 + @param y another FP8 instance + @param s copy only takes place if not equal to 0 + */ +extern void FP8_cmove(FP8 *x, FP8 *y, int s); + + +/** @brief Divide FP8 number by QNR + * + Divide FP8 by the QNR + @param x FP8 instance + */ +extern void FP8_div_i(FP8 *x); + +/** @brief Generate random FP8 + * + @param x random FP8 number + @param rng random number generator + */ +extern void FP8_rand(FP8 *x, core::csprng *rng); +} + +#endif + diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp_ANSSI.h b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp_ANSSI.h similarity index 96% rename from TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp_ANSSI.h rename to TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp_ANSSI.h index 05670eb..f5731e5 100644 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp_ANSSI.h +++ b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miracl-winx64-15-04-24/includes/fp_ANSSI.h @@ -1,334 +1,334 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FP_ANSSI_H -#define FP_ANSSI_H - -#include "big_B256_56.h" -#include "config_field_ANSSI.h" - -using namespace core; - -#define MODBITS_ANSSI MBITS_ANSSI -#define TBITS_ANSSI (MBITS_ANSSI%BASEBITS_B256_56) /**< Number of active bits in top word */ -#define TMASK_ANSSI (((chunk)1< - - -#include "arch.h" -#include "core.h" - -using namespace core; - -/* this is fixed */ -#define NB 4 - -/* Rotates 32-bit word left by 1, 2 or 3 byte */ - -#define ROTL8(x) (((x)<<8)|((x)>>24)) -#define ROTL16(x) (((x)<<16)|((x)>>16)) -#define ROTL24(x) (((x)<<24)|((x)>>8)) - -static const uchar InCo[4] = {0xB, 0xD, 0x9, 0xE}; /* Inverse Coefficients */ - -static const uchar ptab[] = -{ - 1, 3, 5, 15, 17, 51, 85, 255, 26, 46, 114, 150, 161, 248, 19, 53, - 95, 225, 56, 72, 216, 115, 149, 164, 247, 2, 6, 10, 30, 34, 102, 170, - 229, 52, 92, 228, 55, 89, 235, 38, 106, 190, 217, 112, 144, 171, 230, 49, - 83, 245, 4, 12, 20, 60, 68, 204, 79, 209, 104, 184, 211, 110, 178, 205, - 76, 212, 103, 169, 224, 59, 77, 215, 98, 166, 241, 8, 24, 40, 120, 136, - 131, 158, 185, 208, 107, 189, 220, 127, 129, 152, 179, 206, 73, 219, 118, 154, - 181, 196, 87, 249, 16, 48, 80, 240, 11, 29, 39, 105, 187, 214, 97, 163, - 254, 25, 43, 125, 135, 146, 173, 236, 47, 113, 147, 174, 233, 32, 96, 160, - 251, 22, 58, 78, 210, 109, 183, 194, 93, 231, 50, 86, 250, 21, 63, 65, - 195, 94, 226, 61, 71, 201, 64, 192, 91, 237, 44, 116, 156, 191, 218, 117, - 159, 186, 213, 100, 172, 239, 42, 126, 130, 157, 188, 223, 122, 142, 137, 128, - 155, 182, 193, 88, 232, 35, 101, 175, 234, 37, 111, 177, 200, 67, 197, 84, - 252, 31, 33, 99, 165, 244, 7, 9, 27, 45, 119, 153, 176, 203, 70, 202, - 69, 207, 74, 222, 121, 139, 134, 145, 168, 227, 62, 66, 198, 81, 243, 14, - 18, 54, 90, 238, 41, 123, 141, 140, 143, 138, 133, 148, 167, 242, 13, 23, - 57, 75, 221, 124, 132, 151, 162, 253, 28, 36, 108, 180, 199, 82, 246, 1 -}; - -static const uchar ltab[] = -{ - 0, 255, 25, 1, 50, 2, 26, 198, 75, 199, 27, 104, 51, 238, 223, 3, - 100, 4, 224, 14, 52, 141, 129, 239, 76, 113, 8, 200, 248, 105, 28, 193, - 125, 194, 29, 181, 249, 185, 39, 106, 77, 228, 166, 114, 154, 201, 9, 120, - 101, 47, 138, 5, 33, 15, 225, 36, 18, 240, 130, 69, 53, 147, 218, 142, - 150, 143, 219, 189, 54, 208, 206, 148, 19, 92, 210, 241, 64, 70, 131, 56, - 102, 221, 253, 48, 191, 6, 139, 98, 179, 37, 226, 152, 34, 136, 145, 16, - 126, 110, 72, 195, 163, 182, 30, 66, 58, 107, 40, 84, 250, 133, 61, 186, - 43, 121, 10, 21, 155, 159, 94, 202, 78, 212, 172, 229, 243, 115, 167, 87, - 175, 88, 168, 80, 244, 234, 214, 116, 79, 174, 233, 213, 231, 230, 173, 232, - 44, 215, 117, 122, 235, 22, 11, 245, 89, 203, 95, 176, 156, 169, 81, 160, - 127, 12, 246, 111, 23, 196, 73, 236, 216, 67, 31, 45, 164, 118, 123, 183, - 204, 187, 62, 90, 251, 96, 177, 134, 59, 82, 161, 108, 170, 85, 41, 157, - 151, 178, 135, 144, 97, 190, 220, 252, 188, 149, 207, 205, 55, 63, 91, 209, - 83, 57, 132, 60, 65, 162, 109, 71, 20, 42, 158, 93, 86, 242, 211, 171, - 68, 17, 146, 217, 35, 32, 46, 137, 180, 124, 184, 38, 119, 153, 227, 165, - 103, 74, 237, 222, 197, 49, 254, 24, 13, 99, 140, 128, 192, 247, 112, 7 -}; - -static const uchar fbsub[] = -{ - 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, - 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, - 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, - 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, - 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, - 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, - 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, - 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, - 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, - 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, - 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, - 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, - 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, - 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, - 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, - 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22 -}; - -static const uchar rbsub[] = -{ - 82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, - 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, - 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, - 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, - 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, - 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, - 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, - 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, - 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, - 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, - 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, - 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, - 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, - 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, - 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, - 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125 -}; - -static const unsign32 rco[] = -{1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47}; - -static const unsign32 ftable[] = -{ - 0xa56363c6, 0x847c7cf8, 0x997777ee, 0x8d7b7bf6, 0xdf2f2ff, 0xbd6b6bd6, - 0xb16f6fde, 0x54c5c591, 0x50303060, 0x3010102, 0xa96767ce, 0x7d2b2b56, - 0x19fefee7, 0x62d7d7b5, 0xe6abab4d, 0x9a7676ec, 0x45caca8f, 0x9d82821f, - 0x40c9c989, 0x877d7dfa, 0x15fafaef, 0xeb5959b2, 0xc947478e, 0xbf0f0fb, - 0xecadad41, 0x67d4d4b3, 0xfda2a25f, 0xeaafaf45, 0xbf9c9c23, 0xf7a4a453, - 0x967272e4, 0x5bc0c09b, 0xc2b7b775, 0x1cfdfde1, 0xae93933d, 0x6a26264c, - 0x5a36366c, 0x413f3f7e, 0x2f7f7f5, 0x4fcccc83, 0x5c343468, 0xf4a5a551, - 0x34e5e5d1, 0x8f1f1f9, 0x937171e2, 0x73d8d8ab, 0x53313162, 0x3f15152a, - 0xc040408, 0x52c7c795, 0x65232346, 0x5ec3c39d, 0x28181830, 0xa1969637, - 0xf05050a, 0xb59a9a2f, 0x907070e, 0x36121224, 0x9b80801b, 0x3de2e2df, - 0x26ebebcd, 0x6927274e, 0xcdb2b27f, 0x9f7575ea, 0x1b090912, 0x9e83831d, - 0x742c2c58, 0x2e1a1a34, 0x2d1b1b36, 0xb26e6edc, 0xee5a5ab4, 0xfba0a05b, - 0xf65252a4, 0x4d3b3b76, 0x61d6d6b7, 0xceb3b37d, 0x7b292952, 0x3ee3e3dd, - 0x712f2f5e, 0x97848413, 0xf55353a6, 0x68d1d1b9, 0x0, 0x2cededc1, - 0x60202040, 0x1ffcfce3, 0xc8b1b179, 0xed5b5bb6, 0xbe6a6ad4, 0x46cbcb8d, - 0xd9bebe67, 0x4b393972, 0xde4a4a94, 0xd44c4c98, 0xe85858b0, 0x4acfcf85, - 0x6bd0d0bb, 0x2aefefc5, 0xe5aaaa4f, 0x16fbfbed, 0xc5434386, 0xd74d4d9a, - 0x55333366, 0x94858511, 0xcf45458a, 0x10f9f9e9, 0x6020204, 0x817f7ffe, - 0xf05050a0, 0x443c3c78, 0xba9f9f25, 0xe3a8a84b, 0xf35151a2, 0xfea3a35d, - 0xc0404080, 0x8a8f8f05, 0xad92923f, 0xbc9d9d21, 0x48383870, 0x4f5f5f1, - 0xdfbcbc63, 0xc1b6b677, 0x75dadaaf, 0x63212142, 0x30101020, 0x1affffe5, - 0xef3f3fd, 0x6dd2d2bf, 0x4ccdcd81, 0x140c0c18, 0x35131326, 0x2fececc3, - 0xe15f5fbe, 0xa2979735, 0xcc444488, 0x3917172e, 0x57c4c493, 0xf2a7a755, - 0x827e7efc, 0x473d3d7a, 0xac6464c8, 0xe75d5dba, 0x2b191932, 0x957373e6, - 0xa06060c0, 0x98818119, 0xd14f4f9e, 0x7fdcdca3, 0x66222244, 0x7e2a2a54, - 0xab90903b, 0x8388880b, 0xca46468c, 0x29eeeec7, 0xd3b8b86b, 0x3c141428, - 0x79dedea7, 0xe25e5ebc, 0x1d0b0b16, 0x76dbdbad, 0x3be0e0db, 0x56323264, - 0x4e3a3a74, 0x1e0a0a14, 0xdb494992, 0xa06060c, 0x6c242448, 0xe45c5cb8, - 0x5dc2c29f, 0x6ed3d3bd, 0xefacac43, 0xa66262c4, 0xa8919139, 0xa4959531, - 0x37e4e4d3, 0x8b7979f2, 0x32e7e7d5, 0x43c8c88b, 0x5937376e, 0xb76d6dda, - 0x8c8d8d01, 0x64d5d5b1, 0xd24e4e9c, 0xe0a9a949, 0xb46c6cd8, 0xfa5656ac, - 0x7f4f4f3, 0x25eaeacf, 0xaf6565ca, 0x8e7a7af4, 0xe9aeae47, 0x18080810, - 0xd5baba6f, 0x887878f0, 0x6f25254a, 0x722e2e5c, 0x241c1c38, 0xf1a6a657, - 0xc7b4b473, 0x51c6c697, 0x23e8e8cb, 0x7cdddda1, 0x9c7474e8, 0x211f1f3e, - 0xdd4b4b96, 0xdcbdbd61, 0x868b8b0d, 0x858a8a0f, 0x907070e0, 0x423e3e7c, - 0xc4b5b571, 0xaa6666cc, 0xd8484890, 0x5030306, 0x1f6f6f7, 0x120e0e1c, - 0xa36161c2, 0x5f35356a, 0xf95757ae, 0xd0b9b969, 0x91868617, 0x58c1c199, - 0x271d1d3a, 0xb99e9e27, 0x38e1e1d9, 0x13f8f8eb, 0xb398982b, 0x33111122, - 0xbb6969d2, 0x70d9d9a9, 0x898e8e07, 0xa7949433, 0xb69b9b2d, 0x221e1e3c, - 0x92878715, 0x20e9e9c9, 0x49cece87, 0xff5555aa, 0x78282850, 0x7adfdfa5, - 0x8f8c8c03, 0xf8a1a159, 0x80898909, 0x170d0d1a, 0xdabfbf65, 0x31e6e6d7, - 0xc6424284, 0xb86868d0, 0xc3414182, 0xb0999929, 0x772d2d5a, 0x110f0f1e, - 0xcbb0b07b, 0xfc5454a8, 0xd6bbbb6d, 0x3a16162c -}; - -static const unsign32 rtable[] = -{ - 0x50a7f451, 0x5365417e, 0xc3a4171a, 0x965e273a, 0xcb6bab3b, 0xf1459d1f, - 0xab58faac, 0x9303e34b, 0x55fa3020, 0xf66d76ad, 0x9176cc88, 0x254c02f5, - 0xfcd7e54f, 0xd7cb2ac5, 0x80443526, 0x8fa362b5, 0x495ab1de, 0x671bba25, - 0x980eea45, 0xe1c0fe5d, 0x2752fc3, 0x12f04c81, 0xa397468d, 0xc6f9d36b, - 0xe75f8f03, 0x959c9215, 0xeb7a6dbf, 0xda595295, 0x2d83bed4, 0xd3217458, - 0x2969e049, 0x44c8c98e, 0x6a89c275, 0x78798ef4, 0x6b3e5899, 0xdd71b927, - 0xb64fe1be, 0x17ad88f0, 0x66ac20c9, 0xb43ace7d, 0x184adf63, 0x82311ae5, - 0x60335197, 0x457f5362, 0xe07764b1, 0x84ae6bbb, 0x1ca081fe, 0x942b08f9, - 0x58684870, 0x19fd458f, 0x876cde94, 0xb7f87b52, 0x23d373ab, 0xe2024b72, - 0x578f1fe3, 0x2aab5566, 0x728ebb2, 0x3c2b52f, 0x9a7bc586, 0xa50837d3, - 0xf2872830, 0xb2a5bf23, 0xba6a0302, 0x5c8216ed, 0x2b1ccf8a, 0x92b479a7, - 0xf0f207f3, 0xa1e2694e, 0xcdf4da65, 0xd5be0506, 0x1f6234d1, 0x8afea6c4, - 0x9d532e34, 0xa055f3a2, 0x32e18a05, 0x75ebf6a4, 0x39ec830b, 0xaaef6040, - 0x69f715e, 0x51106ebd, 0xf98a213e, 0x3d06dd96, 0xae053edd, 0x46bde64d, - 0xb58d5491, 0x55dc471, 0x6fd40604, 0xff155060, 0x24fb9819, 0x97e9bdd6, - 0xcc434089, 0x779ed967, 0xbd42e8b0, 0x888b8907, 0x385b19e7, 0xdbeec879, - 0x470a7ca1, 0xe90f427c, 0xc91e84f8, 0x0, 0x83868009, 0x48ed2b32, - 0xac70111e, 0x4e725a6c, 0xfbff0efd, 0x5638850f, 0x1ed5ae3d, 0x27392d36, - 0x64d90f0a, 0x21a65c68, 0xd1545b9b, 0x3a2e3624, 0xb1670a0c, 0xfe75793, - 0xd296eeb4, 0x9e919b1b, 0x4fc5c080, 0xa220dc61, 0x694b775a, 0x161a121c, - 0xaba93e2, 0xe52aa0c0, 0x43e0223c, 0x1d171b12, 0xb0d090e, 0xadc78bf2, - 0xb9a8b62d, 0xc8a91e14, 0x8519f157, 0x4c0775af, 0xbbdd99ee, 0xfd607fa3, - 0x9f2601f7, 0xbcf5725c, 0xc53b6644, 0x347efb5b, 0x7629438b, 0xdcc623cb, - 0x68fcedb6, 0x63f1e4b8, 0xcadc31d7, 0x10856342, 0x40229713, 0x2011c684, - 0x7d244a85, 0xf83dbbd2, 0x1132f9ae, 0x6da129c7, 0x4b2f9e1d, 0xf330b2dc, - 0xec52860d, 0xd0e3c177, 0x6c16b32b, 0x99b970a9, 0xfa489411, 0x2264e947, - 0xc48cfca8, 0x1a3ff0a0, 0xd82c7d56, 0xef903322, 0xc74e4987, 0xc1d138d9, - 0xfea2ca8c, 0x360bd498, 0xcf81f5a6, 0x28de7aa5, 0x268eb7da, 0xa4bfad3f, - 0xe49d3a2c, 0xd927850, 0x9bcc5f6a, 0x62467e54, 0xc2138df6, 0xe8b8d890, - 0x5ef7392e, 0xf5afc382, 0xbe805d9f, 0x7c93d069, 0xa92dd56f, 0xb31225cf, - 0x3b99acc8, 0xa77d1810, 0x6e639ce8, 0x7bbb3bdb, 0x97826cd, 0xf418596e, - 0x1b79aec, 0xa89a4f83, 0x656e95e6, 0x7ee6ffaa, 0x8cfbc21, 0xe6e815ef, - 0xd99be7ba, 0xce366f4a, 0xd4099fea, 0xd67cb029, 0xafb2a431, 0x31233f2a, - 0x3094a5c6, 0xc066a235, 0x37bc4e74, 0xa6ca82fc, 0xb0d090e0, 0x15d8a733, - 0x4a9804f1, 0xf7daec41, 0xe50cd7f, 0x2ff69117, 0x8dd64d76, 0x4db0ef43, - 0x544daacc, 0xdf0496e4, 0xe3b5d19e, 0x1b886a4c, 0xb81f2cc1, 0x7f516546, - 0x4ea5e9d, 0x5d358c01, 0x737487fa, 0x2e410bfb, 0x5a1d67b3, 0x52d2db92, - 0x335610e9, 0x1347d66d, 0x8c61d79a, 0x7a0ca137, 0x8e14f859, 0x893c13eb, - 0xee27a9ce, 0x35c961b7, 0xede51ce1, 0x3cb1477a, 0x59dfd29c, 0x3f73f255, - 0x79ce1418, 0xbf37c773, 0xeacdf753, 0x5baafd5f, 0x146f3ddf, 0x86db4478, - 0x81f3afca, 0x3ec468b9, 0x2c342438, 0x5f40a3c2, 0x72c31d16, 0xc25e2bc, - 0x8b493c28, 0x41950dff, 0x7101a839, 0xdeb30c08, 0x9ce4b4d8, 0x90c15664, - 0x6184cb7b, 0x70b632d5, 0x745c6c48, 0x4257b8d0 -}; - -#define MR_TOBYTE(x) ((uchar)((x))) - -static unsign32 pack(const uchar *b) -{ - /* pack bytes into a 32-bit Word */ - return ((unsign32)b[3] << 24) | ((unsign32)b[2] << 16) | ((unsign32)b[1] << 8) | (unsign32)b[0]; -} - -static void unpack(unsign32 a, uchar *b) -{ - /* unpack bytes from a word */ - b[0] = MR_TOBYTE(a); - b[1] = MR_TOBYTE(a >> 8); - b[2] = MR_TOBYTE(a >> 16); - b[3] = MR_TOBYTE(a >> 24); -} - -/* SU= 8 */ -static uchar bmul(uchar x, uchar y) -{ - /* x.y= AntiLog(Log(x) + Log(y)) */ - if (x && y) return ptab[(ltab[x] + ltab[y]) % 255]; - else return 0; -} - -static unsign32 SubByte(unsign32 a) -{ - uchar b[4]; - unpack(a, b); - b[0] = fbsub[b[0]]; - b[1] = fbsub[b[1]]; - b[2] = fbsub[b[2]]; - b[3] = fbsub[b[3]]; - return pack(b); -} - -/* SU= 16 */ -static uchar product(unsign32 x, unsign32 y) -{ - /* dot product of two 4-byte arrays */ - uchar xb[4], yb[4]; - unpack(x, xb); - unpack(y, yb); - return bmul(xb[0], yb[0])^bmul(xb[1], yb[1])^bmul(xb[2], yb[2])^bmul(xb[3], yb[3]); -} - -static unsign32 InvMixCol(unsign32 x) -{ - /* matrix Multiplication */ - unsign32 y, m; - uchar b[4]; - - m = pack(InCo); - b[3] = product(m, x); - m = ROTL24(m); - b[2] = product(m, x); - m = ROTL24(m); - b[1] = product(m, x); - m = ROTL24(m); - b[0] = product(m, x); - y = pack(b); - return y; -} - -/* SU= 8 */ -/* reset cipher */ -void core::AES_reset(core::aes *a, int mode, char *iv) -{ - /* reset mode, or reset iv */ - int i; - a->mode = mode; - for (i = 0; i < 4 * NB; i++) - a->f[i] = 0; - if (mode != ECB && iv != NULL) - { - for (i = 0; i < 4 * NB; i++) - a->f[i] = iv[i]; - } -} - -void core::AES_getreg(core::aes *a, char *ir) -{ - int i; - for (i = 0; i < 4 * NB; i++) ir[i] = a->f[i]; -} - -/* SU= 72 */ -/* Initialise cipher */ -int core::AES_init(core::aes* a, int mode, int nk, char *key, char *iv) -{ - /* Key length Nk=16, 24 or 32 bytes */ - /* Key Scheduler. Create expanded encryption key */ - int i, j, k, N, nr; - unsign32 CipherKey[8]; - - nk /= 4; - - if (nk != 4 && nk != 6 && nk != 8) return 0; - - nr = 6 + nk; - - a->Nk = nk; - a->Nr = nr; - - AES_reset(a, mode, iv); - - N = NB * (nr + 1); - - for (i = j = 0; i < nk; i++, j += 4) - { - CipherKey[i] = pack((uchar *)&key[j]); - } - for (i = 0; i < nk; i++) a->fkey[i] = CipherKey[i]; - for (j = nk, k = 0; j < N; j += nk, k++) - { - a->fkey[j] = a->fkey[j - nk] ^ SubByte(ROTL24(a->fkey[j - 1]))^rco[k]; - if (nk <= 6) - { - for (i = 1; i < nk && (i + j) < N; i++) - a->fkey[i + j] = a->fkey[i + j - nk] ^ a->fkey[i + j - 1]; - } - else - { - for (i = 1; i < 4 && (i + j) < N; i++) - a->fkey[i + j] = a->fkey[i + j - nk] ^ a->fkey[i + j - 1]; - if ((j + 4) < N) a->fkey[j + 4] = a->fkey[j + 4 - nk] ^ SubByte(a->fkey[j + 3]); - for (i = 5; i < nk && (i + j) < N; i++) - a->fkey[i + j] = a->fkey[i + j - nk] ^ a->fkey[i + j - 1]; - } - - } - /* now for the expanded decrypt key in reverse order */ - - for (j = 0; j < NB; j++) a->rkey[j + N - NB] = a->fkey[j]; - for (i = NB; i < N - NB; i += NB) - { - k = N - NB - i; - for (j = 0; j < NB; j++) a->rkey[k + j] = InvMixCol(a->fkey[i + j]); - } - for (j = N - NB; j < N; j++) a->rkey[j - N + NB] = a->fkey[j]; - return 1; -} - -/* SU= 80 */ -/* Encrypt a single block */ -void core::AES_ecb_encrypt(core::aes *a, uchar *buff) -{ - int i, j, k; - unsign32 p[4], q[4], *x, *y, *t; - - for (i = j = 0; i < NB; i++, j += 4) - { - p[i] = pack((uchar *)&buff[j]); - p[i] ^= a->fkey[i]; - } - - k = NB; - x = p; - y = q; - - /* State alternates between x and y */ - for (i = 1; i < a->Nr; i++) - { - - y[0] = a->fkey[k] ^ ftable[MR_TOBYTE(x[0])] ^ - ROTL8(ftable[MR_TOBYTE(x[1] >> 8)])^ - ROTL16(ftable[MR_TOBYTE(x[2] >> 16)])^ - ROTL24(ftable[x[3] >> 24]); - y[1] = a->fkey[k + 1] ^ ftable[MR_TOBYTE(x[1])] ^ - ROTL8(ftable[MR_TOBYTE(x[2] >> 8)])^ - ROTL16(ftable[MR_TOBYTE(x[3] >> 16)])^ - ROTL24(ftable[x[0] >> 24]); - y[2] = a->fkey[k + 2] ^ ftable[MR_TOBYTE(x[2])] ^ - ROTL8(ftable[MR_TOBYTE(x[3] >> 8)])^ - ROTL16(ftable[MR_TOBYTE(x[0] >> 16)])^ - ROTL24(ftable[x[1] >> 24]); - y[3] = a->fkey[k + 3] ^ ftable[MR_TOBYTE(x[3])] ^ - ROTL8(ftable[MR_TOBYTE(x[0] >> 8)])^ - ROTL16(ftable[MR_TOBYTE(x[1] >> 16)])^ - ROTL24(ftable[x[2] >> 24]); - - k += 4; - t = x; - x = y; - y = t; /* swap pointers */ - } - - /* Last Round */ - - y[0] = a->fkey[k] ^ (unsign32)fbsub[MR_TOBYTE(x[0])] ^ - ROTL8((unsign32)fbsub[MR_TOBYTE(x[1] >> 8)])^ - ROTL16((unsign32)fbsub[MR_TOBYTE(x[2] >> 16)])^ - ROTL24((unsign32)fbsub[x[3] >> 24]); - y[1] = a->fkey[k + 1] ^ (unsign32)fbsub[MR_TOBYTE(x[1])] ^ - ROTL8((unsign32)fbsub[MR_TOBYTE(x[2] >> 8)])^ - ROTL16((unsign32)fbsub[MR_TOBYTE(x[3] >> 16)])^ - ROTL24((unsign32)fbsub[x[0] >> 24]); - y[2] = a->fkey[k + 2] ^ (unsign32)fbsub[MR_TOBYTE(x[2])] ^ - ROTL8((unsign32)fbsub[MR_TOBYTE(x[3] >> 8)])^ - ROTL16((unsign32)fbsub[MR_TOBYTE(x[0] >> 16)])^ - ROTL24((unsign32)fbsub[x[1] >> 24]); - y[3] = a->fkey[k + 3] ^ (unsign32)fbsub[MR_TOBYTE(x[3])] ^ - ROTL8((unsign32)fbsub[MR_TOBYTE(x[0] >> 8)])^ - ROTL16((unsign32)fbsub[MR_TOBYTE(x[1] >> 16)])^ - ROTL24((unsign32)fbsub[x[2] >> 24]); - - for (i = j = 0; i < NB; i++, j += 4) - { - unpack(y[i], (uchar *)&buff[j]); - x[i] = y[i] = 0; /* clean up stack */ - } -} - -/* SU= 80 */ -/* Decrypt a single block */ -void core::AES_ecb_decrypt(core::aes *a, uchar *buff) -{ - int i, j, k; - unsign32 p[4], q[4], *x, *y, *t; - - for (i = j = 0; i < NB; i++, j += 4) - { - p[i] = pack((uchar *)&buff[j]); - p[i] ^= a->rkey[i]; - } - - k = NB; - x = p; - y = q; - - /* State alternates between x and y */ - for (i = 1; i < a->Nr; i++) - { - /* Nr is number of rounds. May be odd. */ - - y[0] = a->rkey[k] ^ rtable[MR_TOBYTE(x[0])] ^ - ROTL8(rtable[MR_TOBYTE(x[3] >> 8)])^ - ROTL16(rtable[MR_TOBYTE(x[2] >> 16)])^ - ROTL24(rtable[x[1] >> 24]); - y[1] = a->rkey[k + 1] ^ rtable[MR_TOBYTE(x[1])] ^ - ROTL8(rtable[MR_TOBYTE(x[0] >> 8)])^ - ROTL16(rtable[MR_TOBYTE(x[3] >> 16)])^ - ROTL24(rtable[x[2] >> 24]); - y[2] = a->rkey[k + 2] ^ rtable[MR_TOBYTE(x[2])] ^ - ROTL8(rtable[MR_TOBYTE(x[1] >> 8)])^ - ROTL16(rtable[MR_TOBYTE(x[0] >> 16)])^ - ROTL24(rtable[x[3] >> 24]); - y[3] = a->rkey[k + 3] ^ rtable[MR_TOBYTE(x[3])] ^ - ROTL8(rtable[MR_TOBYTE(x[2] >> 8)])^ - ROTL16(rtable[MR_TOBYTE(x[1] >> 16)])^ - ROTL24(rtable[x[0] >> 24]); - - k += 4; - t = x; - x = y; - y = t; /* swap pointers */ - } - - - /* Last Round */ - y[0] = a->rkey[k] ^ (unsign32)rbsub[MR_TOBYTE(x[0])] ^ - ROTL8((unsign32)rbsub[MR_TOBYTE(x[3] >> 8)])^ - ROTL16((unsign32)rbsub[MR_TOBYTE(x[2] >> 16)])^ - ROTL24((unsign32)rbsub[x[1] >> 24]); - y[1] = a->rkey[k + 1] ^ (unsign32)rbsub[MR_TOBYTE(x[1])] ^ - ROTL8((unsign32)rbsub[MR_TOBYTE(x[0] >> 8)])^ - ROTL16((unsign32)rbsub[MR_TOBYTE(x[3] >> 16)])^ - ROTL24((unsign32)rbsub[x[2] >> 24]); - y[2] = a->rkey[k + 2] ^ (unsign32)rbsub[MR_TOBYTE(x[2])] ^ - ROTL8((unsign32)rbsub[MR_TOBYTE(x[1] >> 8)])^ - ROTL16((unsign32)rbsub[MR_TOBYTE(x[0] >> 16)])^ - ROTL24((unsign32)rbsub[x[3] >> 24]); - y[3] = a->rkey[k + 3] ^ (unsign32)rbsub[MR_TOBYTE(x[3])] ^ - ROTL8((unsign32)rbsub[MR_TOBYTE(x[2] >> 8)])^ - ROTL16((unsign32)rbsub[MR_TOBYTE(x[1] >> 16)])^ - ROTL24((unsign32)rbsub[x[0] >> 24]); - - for (i = j = 0; i < NB; i++, j += 4) - { - unpack(y[i], (uchar *)&buff[j]); - x[i] = y[i] = 0; /* clean up stack */ - } - -} - -/* simple default increment function */ -static void increment(char *f) -{ - int i; - for (i = 0; i < 16; i++) - { - f[i]++; - if (f[i] != 0) break; - } -} - -/* SU= 40 */ -/* Encrypt using selected mode of operation */ -unsign32 core::AES_encrypt(core::aes* a, char *buff) -{ - int j, bytes; - char st[16]; - unsign32 fell_off; - - /* Supported Modes of Operation */ - - fell_off = 0; - switch (a->mode) - { - case ECB: - AES_ecb_encrypt(a, (uchar *)buff); - return 0; - case CBC: - for (j = 0; j < 4 * NB; j++) buff[j] ^= a->f[j]; - AES_ecb_encrypt(a, (uchar *)buff); - for (j = 0; j < 4 * NB; j++) a->f[j] = buff[j]; - return 0; - - case CFB1: - case CFB2: - case CFB4: - bytes = a->mode - CFB1 + 1; - for (j = 0; j < bytes; j++) fell_off = (fell_off << 8) | a->f[j]; - for (j = 0; j < 4 * NB; j++) st[j] = a->f[j]; - for (j = bytes; j < 4 * NB; j++) a->f[j - bytes] = a->f[j]; - AES_ecb_encrypt(a, (uchar *)st); - for (j = 0; j < bytes; j++) - { - buff[j] ^= st[j]; - a->f[16 - bytes + j] = buff[j]; - } - return fell_off; - - case OFB1: - case OFB2: - case OFB4: - case OFB8: - case OFB16: - - bytes = a->mode - OFB1 + 1; - AES_ecb_encrypt(a, (uchar *)(a->f)); - for (j = 0; j < bytes; j++) buff[j] ^= a->f[j]; - return 0; - - case CTR1: - case CTR2: - case CTR4: - case CTR8: - case CTR16: - - bytes = a->mode - CTR1 + 1; - for (j = 0; j < 4 * NB; j++) st[j] = a->f[j]; - AES_ecb_encrypt(a, (uchar *)st); - for (j = 0; j < bytes; j++) buff[j] ^= st[j]; - increment(a->f); - return 0; - - default: - return 0; - } -} - -/* SU= 40 */ -/* Decrypt using selected mode of operation */ -unsign32 core::AES_decrypt(core::aes *a, char *buff) -{ - int j, bytes; - char st[16]; - unsign32 fell_off; - - /* Supported modes of operation */ - fell_off = 0; - switch (a->mode) - { - case ECB: - AES_ecb_decrypt(a, (uchar *)buff); - return 0; - case CBC: - for (j = 0; j < 4 * NB; j++) - { - st[j] = a->f[j]; - a->f[j] = buff[j]; - } - AES_ecb_decrypt(a, (uchar *)buff); - for (j = 0; j < 4 * NB; j++) - { - buff[j] ^= st[j]; - st[j] = 0; - } - return 0; - case CFB1: - case CFB2: - case CFB4: - bytes = a->mode - CFB1 + 1; - for (j = 0; j < bytes; j++) fell_off = (fell_off << 8) | a->f[j]; - for (j = 0; j < 4 * NB; j++) st[j] = a->f[j]; - for (j = bytes; j < 4 * NB; j++) a->f[j - bytes] = a->f[j]; - AES_ecb_encrypt(a, (uchar *)st); - for (j = 0; j < bytes; j++) - { - a->f[16 - bytes + j] = buff[j]; - buff[j] ^= st[j]; - } - return fell_off; - case OFB1: - case OFB2: - case OFB4: - case OFB8: - case OFB16: - bytes = a->mode - OFB1 + 1; - AES_ecb_encrypt(a, (uchar *)(a->f)); - for (j = 0; j < bytes; j++) buff[j] ^= a->f[j]; - return 0; - - case CTR1: - case CTR2: - case CTR4: - case CTR8: - case CTR16: - - bytes = a->mode - CTR1 + 1; - for (j = 0; j < 4 * NB; j++) st[j] = a->f[j]; - AES_ecb_encrypt(a, (uchar *)st); - for (j = 0; j < bytes; j++) buff[j] ^= st[j]; - increment(a->f); - return 0; - - default: - return 0; - } -} - -/* Clean up and delete left-overs */ -void core::AES_end(core::aes *a) -{ - /* clean up */ - int i; - for (i = 0; i < NB * (a->Nr + 1); i++) - a->fkey[i] = a->rkey[i] = 0; - for (i = 0; i < 4 * NB; i++) - a->f[i] = 0; -} - -/* AES encryption/decryption. Encrypt byte array M using key K and returns ciphertext */ -void core::AES_CBC_IV0_ENCRYPT(octet *k, octet *m, octet *c) -{ - /* AES CBC encryption, with Null IV and key k */ - /* Input is from an octet string m, output is to an octet string c */ - /* Input is padded as necessary to make up a full final block */ - aes a; - int fin; - int i, j, ipt, opt; - char buff[16]; - int padlen; - - OCT_clear(c); - if (m->len == 0) return; - AES_init(&a, CBC, k->len, k->val, NULL); - - ipt = opt = 0; - fin = 0; - for (;;) - { - for (i = 0; i < 16; i++) - { - if (ipt < m->len) buff[i] = m->val[ipt++]; - else - { - fin = 1; - break; - } - } - if (fin) break; - AES_encrypt(&a, buff); - for (i = 0; i < 16; i++) - if (opt < c->max) c->val[opt++] = buff[i]; - } - - /* last block, filled up to i-th index */ - - padlen = 16 - i; - for (j = i; j < 16; j++) buff[j] = padlen; - AES_encrypt(&a, buff); - for (i = 0; i < 16; i++) - if (opt < c->max) c->val[opt++] = buff[i]; - AES_end(&a); - c->len = opt; -} - -/* decrypts and returns TRUE if all consistent, else returns FALSE */ -int core::AES_CBC_IV0_DECRYPT(octet *k, octet *c, octet *m) -{ - /* padding is removed */ - aes a; - int i, ipt, opt, ch; - char buff[16]; - int fin, bad; - int padlen; - ipt = opt = 0; - - OCT_clear(m); - if (c->len == 0) return 1; - ch = c->val[ipt++]; - - AES_init(&a, CBC, k->len, k->val, NULL); - fin = 0; - - for (;;) - { - for (i = 0; i < 16; i++) - { - buff[i] = ch; - if (ipt >= c->len) - { - fin = 1; - break; - } - else ch = c->val[ipt++]; - } - AES_decrypt(&a, buff); - if (fin) break; - for (i = 0; i < 16; i++) - if (opt < m->max) m->val[opt++] = buff[i]; - } - AES_end(&a); - bad = 0; - padlen = buff[15]; - if (i != 15 || padlen < 1 || padlen > 16) bad = 1; - if (padlen >= 2 && padlen <= 16) - for (i = 16 - padlen; i < 16; i++) if (buff[i] != padlen) bad = 1; - - if (!bad) for (i = 0; i < 16 - padlen; i++) - if (opt < m->max) m->val[opt++] = buff[i]; - - m->len = opt; - if (bad) return 0; - return 1; -} - -/* -#include - -#define KK 32 - -int main() -{ - int i; - aes a; - unsign32 t; - uchar x,y; - - char key[KK]; - char block[16]; - char iv[16]; - for (i=0;i -#include -#include - -#include "rsa_RSA2048.h" -#include "ecp_Ed25519.h" -#include "pair_BN254.h" - -#if CHUNK==32 || CHUNK==64 -#include "ecp_NIST256.h" -#include "ecp_Ed448.h" -#include "pair_BLS12383.h" -#include "pair4_BLS24479.h" -#include "pair8_BLS48556.h" -#endif - -#define MIN_TIME 10.0 -#define MIN_ITERS 10 - -using namespace core; - -int ed25519(csprng *RNG) -{ - using namespace Ed25519; - using namespace Ed25519_BIG; - using namespace Ed25519_FP; - - int i, iterations; - clock_t start; - double elapsed; - ECP EP, EG; - BIG s, r, x, y; - FP rw; - printf("\nTesting/Timing Ed25519 ECC\n"); - -#if CURVETYPE_Ed25519==WEIERSTRASS - printf("Weierstrass parameterization\n"); -#endif -#if CURVETYPE_Ed25519==EDWARDS - printf("Edwards parameterization\n"); -#endif -#if CURVETYPE_Ed25519==MONTGOMERY - printf("Montgomery parameterization\n"); -#endif - - -#if MODTYPE_F25519 == PSEUDO_MERSENNE - printf("Pseudo-Mersenne Modulus\n"); -#endif - -#if MODTYPE_F25519 == GENERALISED_MERSENNE - printf("Generalised-Mersenne Modulus\n"); -#endif - -#if MODTYPE_F25519 == MONTGOMERY_FRIENDLY - printf("Montgomery Friendly Modulus\n"); -#endif - -#if MODTYPE_F25519 == NOT_SPECIAL - printf("Not special Modulus\n"); -#endif - - -#if CHUNK==16 - printf("16-bit Build\n"); -#endif -#if CHUNK==32 - printf("32-bit Build\n"); -#endif -#if CHUNK==64 - printf("64-bit Build\n"); -#endif - - ECP_generator(&EG); - BIG_rcopy(r, CURVE_Order); - - FP_rand(&rw,RNG); - - ECP_map2point(&EP,&rw); - ECP_cfp(&EP); - - if (ECP_isinf(&EP)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - - ECP_mul(&EP,r); - if (!ECP_isinf(&EP)) - { - printf("EP= "); ECP_output(&EP); printf("\n"); - printf("HASHING FAILURE - P=O\n"); - return 0; - } - - BIG_randtrunc(s, r, 2 * CURVE_SECURITY_Ed25519, RNG); - - ECP_copy(&EP, &EG); - ECP_mul(&EP, r); - - if (!ECP_isinf(&EP)) - { - printf("FAILURE - rG!=O\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - ECP_copy(&EP, &EG); - ECP_mul(&EP, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("EC mul - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - return 0; -} - -#if CHUNK==32 || CHUNK==64 -int nist256(csprng *RNG) -{ - using namespace NIST256; - using namespace NIST256_BIG; - using namespace NIST256_FP; - - int i, iterations; - clock_t start; - double elapsed; - ECP EP, EG; - BIG s, r, x, y; - FP rw; - printf("\nTesting/Timing NIST256 ECC\n"); - -#if CURVETYPE_NIST256==WEIERSTRASS - printf("Weierstrass parameterization\n"); -#endif -#if CURVETYPE_NIST256==EDWARDS - printf("Edwards parameterization\n"); -#endif -#if CURVETYPE_NIST256==MONTGOMERY - printf("Montgomery parameterization\n"); -#endif - - -#if MODTYPE_NIST256 == PSEUDO_MERSENNE - printf("Pseudo-Mersenne Modulus\n"); -#endif - -#if MODTYPE_NIST256 == GENERALISED_MERSENNE - printf("Generalised-Mersenne Modulus\n"); -#endif - -#if MODTYPE_NIST256 == MONTGOMERY_FRIENDLY - printf("Montgomery Friendly Modulus\n"); -#endif - -#if MODTYPE_NIST256 == NOT_SPECIAL - printf("Not special Modulus\n"); -#endif - -#if CHUNK==16 - printf("16-bit Build\n"); -#endif -#if CHUNK==32 - printf("32-bit Build\n"); -#endif -#if CHUNK==64 - printf("64-bit Build\n"); -#endif - - ECP_generator(&EG); - - BIG_rcopy(r, CURVE_Order); - - FP_rand(&rw,RNG); - ECP_map2point(&EP,&rw); - ECP_cfp(&EP); - - if (ECP_isinf(&EP)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - ECP_mul(&EP,r); - if (!ECP_isinf(&EP)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - - BIG_randtrunc(s, r, 2 * CURVE_SECURITY_NIST256, RNG); - - ECP_copy(&EP, &EG); - ECP_mul(&EP, r); - - if (!ECP_isinf(&EP)) - { - printf("FAILURE - rG!=O\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - ECP_copy(&EP, &EG); - ECP_mul(&EP, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("EC mul - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - return 0; -} - -int ed448(csprng *RNG) -{ - using namespace Ed448; - using namespace Ed448_BIG; - using namespace Ed448_FP; - - int i, iterations; - clock_t start; - double elapsed; - ECP EP, EG; - BIG s, r, x, y; - FP rw; - printf("\nTesting/Timing Ed448 ECC\n"); - -#if CURVETYPE_Ed448==WEIERSTRASS - printf("Weierstrass parameterization\n"); -#endif -#if CURVETYPE_Ed448==EDWARDS - printf("Edwards parameterization\n"); -#endif -#if CURVETYPE_Ed448==MONTGOMERY - printf("Montgomery parameterization\n"); -#endif - -#if MODTYPE_F448 == PSEUDO_MERSENNE - printf("Pseudo-Mersenne Modulus\n"); -#endif - -#if MODTYPE_F448 == GENERALISED_MERSENNE - printf("Generalised-Mersenne Modulus\n"); -#endif - -#if MODTYPE_F448 == MONTGOMERY_FRIENDLY - printf("Montgomery Friendly Modulus\n"); -#endif - -#if MODTYPE_F448 == NOT_SPECIAL - printf("Not special Modulus\n"); -#endif - -#if CHUNK==16 - printf("16-bit Build\n"); -#endif -#if CHUNK==32 - printf("32-bit Build\n"); -#endif -#if CHUNK==64 - printf("64-bit Build\n"); -#endif - - ECP_generator(&EG); - BIG_rcopy(r, CURVE_Order); - FP_rand(&rw,RNG); - ECP_map2point(&EP,&rw); - ECP_cfp(&EP); - - if (ECP_isinf(&EP)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - ECP_mul(&EP,r); - if (!ECP_isinf(&EP)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - - BIG_randtrunc(s, r, 2 * CURVE_SECURITY_Ed448, RNG); - - ECP_copy(&EP, &EG); - ECP_mul(&EP, r); - - if (!ECP_isinf(&EP)) - { - printf("FAILURE - rG!=O\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - ECP_copy(&EP, &EG); - ECP_mul(&EP, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("EC mul - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - return 0; -} -#endif - -int bn254(csprng *RNG) -{ - using namespace BN254; - using namespace BN254_FP; - using namespace BN254_BIG; - - int i, iterations; - clock_t start; - double elapsed; - - ECP P, G; - ECP2 Q, W; - FP12 g, w; - FP4 cm; - FP2 rz2; - FP rz; - - BIG s, r, x, y; - printf("\nTesting/Timing BN254 Pairings\n"); - - ECP_generator(&G); - BIG_rcopy(r, CURVE_Order); - FP_rand(&rz,RNG); - ECP_map2point(&P,&rz); - ECP_cfp(&P); - - if (ECP_isinf(&P)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - ECP_mul(&P,r); - if (!ECP_isinf(&P)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - - BIG_randtrunc(s, r, 2 * CURVE_SECURITY_BN254, RNG); - - ECP_copy(&P, &G); - PAIR_G1mul(&P, r); - - if (!ECP_isinf(&P)) - { - printf("FAILURE - rG!=O\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - ECP_copy(&P, &G); - PAIR_G1mul(&P, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("G1 mul - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - ECP2_generator(&W); - - FP2_rand(&rz2,RNG); - ECP2_map2point(&Q,&rz2); - ECP2_cfp(&Q); - - if (ECP2_isinf(&Q)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - - //printf("Q= "); ECP2_output(&Q); printf("\n"); - ECP2_mul(&Q,r); - if (!ECP2_isinf(&Q)) - { - printf("FAILURE - rQ!=O\n"); - return 0; - } - - ECP2_copy(&Q, &W); - ECP2_mul(&Q, r); - - if (!ECP2_isinf(&Q)) - { - printf("FAILURE - rQ!=O\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - ECP2_copy(&Q, &W); - PAIR_G2mul(&Q, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("G2 mul - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - PAIR_ate(&w, &Q, &P); - PAIR_fexp(&w); - -//printf("pairing= ");FP12_output(&w); printf("\n"); - - FP12_copy(&g, &w); - - PAIR_GTpow(&g, r); - - if (!FP12_isunity(&g)) - { - printf("FAILURE - g^r!=1\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - FP12_copy(&g, &w); - PAIR_GTpow(&g, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("GT pow - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - FP12_copy(&g, &w); - - iterations = 0; - start = clock(); - do { - FP12_compow(&cm, &g, s, r); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("GT pow (compressed) - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - iterations = 0; - start = clock(); - do { - PAIR_ate(&w, &Q, &P); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("PAIRing ATE - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - iterations = 0; - start = clock(); - do { - FP12_copy(&g, &w); - PAIR_fexp(&g); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("PAIRing FEXP - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - ECP_copy(&P, &G); - ECP2_copy(&Q, &W); - - PAIR_G1mul(&P, s); - PAIR_ate(&g, &Q, &P); - PAIR_fexp(&g); - - ECP_copy(&P, &G); - - PAIR_G2mul(&Q, s); - PAIR_ate(&w, &Q, &P); - PAIR_fexp(&w); - - if (!PAIR_G1member(&P)) - { - printf("FAILURE - P not in G1\n"); - return 0; - } - - if (!PAIR_G2member(&Q)) - { - printf("FAILURE - Q not in G2\n"); - return 0; - } - - if (!PAIR_GTmember(&w)) - { - printf("FAILURE - e(Q,P) not in GT\n"); - return 0; - } - - if (!FP12_equals(&g, &w)) - { - printf("FAILURE - e(sQ,p)!=e(Q,sP) \n"); - return 0; - } - - ECP2_copy(&Q, &W); - PAIR_ate(&g, &Q, &P); - PAIR_fexp(&g); - - PAIR_GTpow(&g, s); - - if (!FP12_equals(&g, &w)) - { - printf("FAILURE - e(sQ,p)!=e(Q,P)^s \n"); - return 0; - } - - ECP N1; - ECP2 N2; - - ECP_inf(&N1); - ECP2_inf(&N2); - - PAIR_ate(&g, &N2, &P); - PAIR_fexp(&g); - - if (!FP12_isunity(&g)) - { - printf("FAILURE - e(O,P) !=1 \n"); - return 0; - } - - PAIR_ate(&g, &Q, &N1); - PAIR_fexp(&g); - - if (!FP12_isunity(&g)) - { - printf("FAILURE - e(Q,O) !=1 \n"); - return 0; - } - - - - return 0; -} - -#if CHUNK==32 || CHUNK==64 -int bls383(csprng *RNG) -{ - using namespace BLS12383; - using namespace BLS12383_FP; - using namespace BLS12383_BIG; - - int i, iterations; - clock_t start; - double elapsed; - - ECP P, G; - ECP2 Q, W; - FP12 g, w; - FP4 cm; - FP2 rz2; - FP rz; - - BIG s, r, x, y; - printf("\nTesting/Timing BLS12383 Pairings\n"); - - ECP_generator(&G); - - BIG_rcopy(r, CURVE_Order); - FP_rand(&rz,RNG); - -/* - iterations = 0; - start = clock(); - do { - BIG_randomnum(s,r,RNG); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("BIG_randomnum - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - printf("nbits(r)= %d\n",BIG_nbits(r)); -*/ -// iterations = 0; -// start = clock(); -// do { - ECP_map2point(&P,&rz); - ECP_cfp(&P); -// iterations++; -// elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; -// } while (elapsed < MIN_TIME || iterations < MIN_ITERS); -// elapsed = 1000.0 * elapsed / iterations; -// printf("G1 hash to point - %8d iterations ", iterations); -// printf(" %8.2lf ms per iteration\n", elapsed); - - - if (ECP_isinf(&P)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - ECP_mul(&P,r); - if (!ECP_isinf(&P)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - - BIG_randtrunc(s, r, 2 * CURVE_SECURITY_BLS12383, RNG); - - - ECP_copy(&P, &G); - PAIR_G1mul(&P, r); - - if (!ECP_isinf(&P)) - { - printf("FAILURE - rG!=O\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - ECP_copy(&P, &G); - PAIR_G1mul(&P, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("G1 mul - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - ECP2_generator(&W); - - FP2_rand(&rz2,RNG); - ECP2_map2point(&Q,&rz2); - ECP2_cfp(&Q); - - if (ECP2_isinf(&Q)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - - ECP2_mul(&Q,r); - if (!ECP2_isinf(&Q)) - { - printf("FAILURE - rQ!=O\n"); - return 0; - } - - - ECP2_copy(&Q, &W); - ECP2_mul(&Q, r); - - if (!ECP2_isinf(&Q)) - { - printf("FAILURE - rQ!=O\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - ECP2_copy(&Q, &W); - PAIR_G2mul(&Q, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("G2 mul - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - PAIR_ate(&w, &Q, &P); - PAIR_fexp(&w); - - FP12_copy(&g, &w); - - PAIR_GTpow(&g, r); - - if (!FP12_isunity(&g)) - { - printf("FAILURE - g^r!=1\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - FP12_copy(&g, &w); - PAIR_GTpow(&g, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("GT pow - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - FP12_copy(&g, &w); - - iterations = 0; - start = clock(); - do { - FP12_compow(&cm, &g, s, r); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("GT pow (compressed) - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - iterations = 0; - start = clock(); - do { - PAIR_ate(&w, &Q, &P); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("PAIRing ATE - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - iterations = 0; - start = clock(); - do { - FP12_copy(&g, &w); - PAIR_fexp(&g); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("PAIRing FEXP - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - ECP_copy(&P, &G); - ECP2_copy(&Q, &W); - - PAIR_G1mul(&P, s); - PAIR_ate(&g, &Q, &P); - PAIR_fexp(&g); - - ECP_copy(&P, &G); - - PAIR_G2mul(&Q, s); - PAIR_ate(&w, &Q, &P); - PAIR_fexp(&w); - - if (!PAIR_G1member(&P)) - { - printf("FAILURE - P not in G1\n"); - return 0; - } - - if (!PAIR_G2member(&Q)) - { - printf("FAILURE - Q not in G2\n"); - return 0; - } - - if (!PAIR_GTmember(&w)) - { - printf("FAILURE - e(Q,P) not in GT\n"); - return 0; - } - - if (!FP12_equals(&g, &w)) - { - printf("FAILURE - e(sQ,p)!=e(Q,sP) \n"); - return 0; - } - - ECP2_copy(&Q, &W); - PAIR_ate(&g, &Q, &P); - PAIR_fexp(&g); - - PAIR_GTpow(&g, s); - - if (!FP12_equals(&g, &w)) - { - printf("FAILURE - e(sQ,p)!=e(Q,P)^s \n"); - return 0; - } - - ECP N1; - ECP2 N2; - - ECP_inf(&N1); - ECP2_inf(&N2); - - PAIR_ate(&g, &N2, &P); - PAIR_fexp(&g); - - if (!FP12_isunity(&g)) - { - printf("FAILURE - e(O,P) !=1 \n"); - return 0; - } - - PAIR_ate(&g, &Q, &N1); - PAIR_fexp(&g); - - if (!FP12_isunity(&g)) - { - printf("FAILURE - e(Q,O) !=1 \n"); - return 0; - } - - return 0; -} - -int bls24(csprng *RNG) -{ - using namespace BLS24479; - using namespace BLS24479_FP; - using namespace BLS24479_BIG; - - int i, iterations; - clock_t start; - double elapsed; - - ECP P, G; - ECP4 Q, W; - FP24 g, w; - FP rz; - FP4 rz4; - - FP8 cm; - BIG a, b, s, r; - - printf("\nTesting/Timing BLS24479 Pairings\n"); - - ECP_generator(&G); - BIG_rcopy(r, CURVE_Order); - FP_rand(&rz,RNG); - ECP_map2point(&P,&rz); - ECP_cfp(&P); - - if (ECP_isinf(&P)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - ECP_mul(&P,r); - if (!ECP_isinf(&P)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - - BIG_randtrunc(s, r, 2 * CURVE_SECURITY_BLS24479, RNG); - - ECP_copy(&P, &G); - PAIR_G1mul(&P, r); - - if (!ECP_isinf(&P)) - { - printf("FAILURE - rG!=O\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - ECP_copy(&P, &G); - PAIR_G1mul(&P, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("G1 mul - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - ECP4_generator(&W); - - FP4_rand(&rz4,RNG); - ECP4_map2point(&Q,&rz4); - ECP4_cfp(&Q); - - if (ECP4_isinf(&Q)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - - ECP4_mul(&Q,r); - if (!ECP4_isinf(&Q)) - { - printf("FAILURE - rQ!=O\n"); - return 0; - } - ECP4_copy(&Q, &W); - ECP4_mul(&Q, r); - - if (!ECP4_isinf(&Q)) - { - printf("FAILURE - rQ!=O\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - ECP4_copy(&Q, &W); - PAIR_G2mul(&Q, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("G2 mul - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - PAIR_ate(&w, &Q, &P); - PAIR_fexp(&w); - - FP24_copy(&g, &w); - - PAIR_GTpow(&g, r); - - if (!FP24_isunity(&g)) - { - printf("FAILURE - g^r!=1\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - FP24_copy(&g, &w); - PAIR_GTpow(&g, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("GT pow - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); -/* - FP24_copy(&g, &w); - - iterations = 0; - start = clock(); - do { - FP24_compow(&cm, &g, s, r); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("GT pow (compressed) - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); -*/ - iterations = 0; - start = clock(); - do { - PAIR_ate(&w, &Q, &P); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("PAIRing ATE - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - iterations = 0; - start = clock(); - do { - FP24_copy(&g, &w); - PAIR_fexp(&g); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("PAIRing FEXP - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - ECP_copy(&P, &G); - ECP4_copy(&Q, &W); - - PAIR_G1mul(&P, s); - PAIR_ate(&g, &Q, &P); - PAIR_fexp(&g); - - ECP_copy(&P, &G); - - PAIR_G2mul(&Q, s); - PAIR_ate(&w, &Q, &P); - PAIR_fexp(&w); - - if (!PAIR_G1member(&P)) - { - printf("FAILURE - P not in G1\n"); - return 0; - } - - if (!PAIR_G2member(&Q)) - { - printf("FAILURE - Q not in G2\n"); - return 0; - } - - if (!PAIR_GTmember(&w)) - { - printf("FAILURE - e(Q,P) not in GT\n"); - return 0; - } - - if (!FP24_equals(&g, &w)) - { - printf("FAILURE - e(sQ,p)!=e(Q,sP) \n"); - return 0; - } - - ECP4_copy(&Q, &W); - PAIR_ate(&g, &Q, &P); - PAIR_fexp(&g); - - PAIR_GTpow(&g, s); - - if (!FP24_equals(&g, &w)) - { - printf("FAILURE - e(sQ,p)!=e(Q,P)^s \n"); - return 0; - } - - ECP N1; - ECP4 N2; - - ECP_inf(&N1); - ECP4_inf(&N2); - - PAIR_ate(&g, &N2, &P); - PAIR_fexp(&g); - - if (!FP24_isunity(&g)) - { - printf("FAILURE - e(O,P) !=1 \n"); - return 0; - } - - PAIR_ate(&g, &Q, &N1); - PAIR_fexp(&g); - - if (!FP24_isunity(&g)) - { - printf("FAILURE - e(Q,O) !=1 \n"); - return 0; - } - /* - PAIR_ate(&g,&N2,&N1); - PAIR_fexp(&g); - - if (!FP24_isunity(&g)) - { - printf("FAILURE - e(O,O) !=1 \n"); - return 0; - } - */ - return 0; -} - -int bls48(csprng *RNG) -{ - using namespace BLS48556; - using namespace BLS48556_FP; - using namespace BLS48556_BIG; - - int i, iterations; - clock_t start; - double elapsed; - - ECP P, G; - ECP8 Q, W; - FP48 g, w; - FP rz; - FP8 rz8; - - FP16 cm; - BIG a, b, s, r; - - printf("\nTesting/Timing BLS48556 Pairings\n"); - - ECP_generator(&G); - BIG_rcopy(r, CURVE_Order); - FP_rand(&rz,RNG); - ECP_map2point(&P,&rz); - ECP_cfp(&P); - - if (ECP_isinf(&P)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - ECP_mul(&P,r); - if (!ECP_isinf(&P)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - - BIG_randtrunc(s, r, 2 * CURVE_SECURITY_BLS48556, RNG); - - ECP_copy(&P, &G); - PAIR_G1mul(&P, r); - - if (!ECP_isinf(&P)) - { - printf("FAILURE - rG!=O\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - ECP_copy(&P, &G); - PAIR_G1mul(&P, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("G1 mul - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - - ECP8_generator(&W); - - FP8_rand(&rz8,RNG); - ECP8_map2point(&Q,&rz8); - ECP8_cfp(&Q); - - if (ECP8_isinf(&Q)) - { - printf("HASHING FAILURE - P=O\n"); - return 0; - } - - ECP8_mul(&Q,r); - if (!ECP8_isinf(&Q)) - { - printf("FAILURE - rQ!=O\n"); - return 0; - } - ECP8_copy(&Q, &W); - - //ECP8_mul(&Q,r); - PAIR_G2mul(&Q, r); - - if (!ECP8_isinf(&Q)) - { - printf("FAILURE - rQ!=O\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - ECP8_copy(&Q, &W); - PAIR_G2mul(&Q, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("G2 mul - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - - PAIR_ate(&w, &Q, &P); - PAIR_fexp(&w); - - FP48_copy(&g, &w); - - PAIR_GTpow(&g, r); - - if (!FP48_isunity(&g)) - { - printf("FAILURE - g^r!=1\n"); - return 0; - } - - iterations = 0; - start = clock(); - do { - FP48_copy(&g, &w); - PAIR_GTpow(&g, s); - - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("GT pow - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); -/* - FP48_copy(&g, &w); - - iterations = 0; - start = clock(); - do { - FP48_compow(&cm, &g, s, r); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("GT pow (compressed) - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); -*/ - iterations = 0; - start = clock(); - do { - PAIR_ate(&w, &Q, &P); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("PAIRing ATE - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - iterations = 0; - start = clock(); - do { - FP48_copy(&g, &w); - PAIR_fexp(&g); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("PAIRing FEXP - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - ECP_copy(&P, &G); - ECP8_copy(&Q, &W); - - PAIR_G1mul(&P, s); - PAIR_ate(&g, &Q, &P); - PAIR_fexp(&g); - - ECP_copy(&P, &G); - - PAIR_G2mul(&Q, s); - //ECP8_mul(&Q,s); - PAIR_ate(&w, &Q, &P); - PAIR_fexp(&w); - - if (!PAIR_G1member(&P)) - { - printf("FAILURE - P not in G1\n"); - return 0; - } - - if (!PAIR_G2member(&Q)) - { - printf("FAILURE - Q not in G2\n"); - return 0; - } - - if (!PAIR_GTmember(&w)) - { - printf("FAILURE - e(Q,P) not in GT\n"); - return 0; - } - - if (!FP48_equals(&g, &w)) - { - printf("FAILURE - e(sQ,p)!=e(Q,sP) \n"); - return 0; - } - - ECP8_copy(&Q, &W); - PAIR_ate(&g, &Q, &P); - PAIR_fexp(&g); - - PAIR_GTpow(&g, s); - - if (!FP48_equals(&g, &w)) - { - printf("FAILURE - e(sQ,p)!=e(Q,P)^s \n"); - return 0; - } - - ECP N1; - ECP8 N2; - - ECP_inf(&N1); - ECP8_inf(&N2); - - PAIR_ate(&g, &N2, &P); - PAIR_fexp(&g); - - if (!FP48_isunity(&g)) - { - printf("FAILURE - e(O,P) !=1 \n"); - return 0; - } - - PAIR_ate(&g, &Q, &N1); - PAIR_fexp(&g); - - if (!FP48_isunity(&g)) - { - printf("FAILURE - e(Q,O) !=1 \n"); - return 0; - } - /* - PAIR_ate(&g,&N2,&N1); - PAIR_fexp(&g); - - if (!FP48_isunity(&g)) - { - printf("FAILURE - e(O,O) !=1 \n"); - return 0; - } - */ - return 0; -} -#endif - -int rsa2048(csprng *RNG) -{ - using namespace RSA2048; - - rsa_public_key pub; - rsa_private_key priv; - - int i, iterations; - clock_t start; - double elapsed; - - char m[RFS_RSA2048], d[RFS_RSA2048], c[RFS_RSA2048]; - octet M = {0, sizeof(m), m}; - octet D = {0, sizeof(d), d}; - octet C = {0, sizeof(c), c}; - - printf("\nTesting/Timing 2048-bit RSA\n"); - - printf("Generating 2048-bit RSA public/private key pair\n"); - - iterations = 0; - start = clock(); - do { - RSA_KEY_PAIR(RNG, 65537, &priv, &pub, NULL, NULL); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < 1); - elapsed = 1000.0 * elapsed / iterations; - printf("RSA gen - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - M.len = RFS_RSA2048; - for (i = 0; i < RFS_RSA2048; i++) M.val[i] = i % 128; - - iterations = 0; - start = clock(); - do { - RSA_ENCRYPT(&pub, &M, &C); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("RSA enc - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - iterations = 0; - start = clock(); - do { - RSA_DECRYPT(&priv, &C, &D); - iterations++; - elapsed = (clock() - start) / (double)CLOCKS_PER_SEC; - } while (elapsed < MIN_TIME || iterations < MIN_ITERS); - elapsed = 1000.0 * elapsed / iterations; - printf("RSA dec - %8d iterations ", iterations); - printf(" %8.2lf ms per iteration\n", elapsed); - - for (i = 0; i < RFS_RSA2048; i++) - { - if (M.val[i] != D.val[i]) - { - printf("FAILURE - RSA decryption\n"); - return 0; - } - } - - printf("All tests pass\n"); - - return 0; -} - -int main() -{ - csprng RNG; - int i; - char pr[10]; - unsigned long ran; - - time((time_t *)&ran); - pr[0] = ran; - pr[1] = ran >> 8; - pr[2] = ran >> 16; - pr[3] = ran >> 24; - for (i = 4; i < 10; i++) pr[i] = i; /*****4****/ - RAND_seed(&RNG, 10, pr); - - ed25519(&RNG); -#if CHUNK==32 || CHUNK==64 - nist256(&RNG); - ed448(&RNG); -#endif - bn254(&RNG); -#if CHUNK==32 || CHUNK==64 - bls383(&RNG); - bls24(&RNG); - bls48(&RNG); -#endif - rsa2048(&RNG); - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big.cpp deleted file mode 100644 index 3009e4d..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/big.cpp +++ /dev/null @@ -1,1830 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE basic functions for BIG type */ -/* SU=m, SU is Stack Usage */ - -#include "big_XXX.h" - -//int XXX::BIGMULS=0; -//int XXX::BIGSQRS=0; - -/* test a=0? */ -int XXX::BIG_iszilch(BIG a) -{ - int i; - chunk d=0; - for (i = 0; i < NLEN_XXX; i++) - d|=a[i]; - return (1 & ((d-1)>>BASEBITS_XXX)); -} - -/* test a=1? */ -int XXX::BIG_isunity(BIG a) -{ - int i; - chunk d=0; - for (i = 1; i < NLEN_XXX; i++) - d|=a[i]; - return (1 & ((d-1)>>BASEBITS_XXX) & (((a[0]^1)-1)>>BASEBITS_XXX)); -} - -/* test a=0? */ -int XXX::BIG_diszilch(DBIG a) -{ - int i; - chunk d=0; - for (i = 0; i < DNLEN_XXX; i++) - d|=a[i]; - return (1 & ((d-1)>>BASEBITS_XXX)); -} - -/* SU= 56 */ -/* output a */ -void XXX::BIG_output(BIG a) -{ - BIG b; - int i, len; - len = BIG_nbits(a); - if (len % 4 == 0) len /= 4; - else - { - len /= 4; - len++; - } - if (len < MODBYTES_XXX * 2) len = MODBYTES_XXX * 2; - - for (i = len - 1; i >= 0; i--) - { - BIG_copy(b, a); - BIG_shr(b, i * 4); - printf("%01x", (unsigned int) b[0] & 15); - } -} - -/* SU= 16 */ -void XXX::BIG_rawoutput(BIG a) -{ - int i; - printf("("); - for (i = 0; i < NLEN_XXX - 1; i++) -#if CHUNK==64 - printf("%jx,", (uintmax_t) a[i]); - printf("%jx)", (uintmax_t) a[NLEN_XXX - 1]); -#else - printf("%x,", (unsigned int) a[i]); - printf("%x)", (unsigned int) a[NLEN_XXX - 1]); -#endif -} - -// modified to prevent Nonce@Once side channel attack -// Two tricks to thwart compiler optimization -// 1. Prevent mask removal by performing transformation that might change the mask, but in fact does not -// 2. Force the code to calculate an intermediate value, by making it part of (an unused) return value -// problem is XORing with all zeros or XORing with "random" shows up in side-channel, and reveals d - -/* Swap a and b if d=1 */ -chunk XXX::BIG_cswap(BIG a, BIG b, int d) -{ - int i; - chunk e, r, ra, w, t, c = (chunk) - d; - w=0; - r=a[0]^b[1]; // sort of random - ra=r+r; ra>>=1; // I know this doesn't change r, but the compiler doesn't! -#ifdef DEBUG_NORM - for (i = 0; i < NLEN_XXX + 2; i++) -#else - for (i = 0; i < NLEN_XXX; i++) -#endif - { - t = c & (a[i] ^ b[i]); - t^=r; - e=a[i]^t; w^=e; // to force calculation of e - a[i]=e^ra; - e=b[i]^t; w^=e; - b[i]=e^ra; - } - return w; // to bewilder optimizer -} - -/* Move g to f if d=1 */ -chunk XXX::BIG_cmove(BIG f, BIG g, int d) -{ - int i; - chunk e,w,r,ra,t,b = (chunk) - d; - w=0; - r=f[0]^g[1]; - ra=r+r; ra>>=1; // I know this doesn't change r, but the compiler doesn't! -#ifdef DEBUG_NORM - for (i = 0; i < NLEN_XXX + 2; i++) -#else - for (i = 0; i < NLEN_XXX; i++) -#endif - { - t=(f[i]^g[i])&b; - t^=r; - e=f[i]^t; w^=e; // to force calculation of e - f[i]=e^ra; - } - return w; // to bewilder optimizer -} - -/* Move g to f if d=1 */ -chunk XXX::BIG_dcmove(DBIG f, DBIG g, int d) -{ - int i; - chunk e,w,r,ra,t,b = (chunk) - d; - w=0; - r=f[0]^g[1]; - ra=r+r; ra>>=1; // I know this doesn't change r, but the compiler doesn't! -#ifdef DEBUG_NORM - for (i = 0; i < DNLEN_XXX + 2; i++) -#else - for (i = 0; i < DNLEN_XXX; i++) -#endif - { - t=(f[i]^g[i])&b; - t^=r; - e=f[i]^t; w^=e; - f[i]=e^ra; - } - return w; -} - -/* convert BIG to/from bytes */ -/* SU= 64 */ -void XXX::BIG_toBytes(char *b, BIG a) -{ - int i; - BIG c; - BIG_copy(c, a); - BIG_norm(c); - for (i = MODBYTES_XXX - 1; i >= 0; i--) - { - b[i] = c[0] & 0xff; - BIG_fshr(c, 8); - } -} - -/* SU= 16 */ -void XXX::BIG_fromBytes(BIG a, char *b) -{ - int i; - BIG_zero(a); - for (i = 0; i < MODBYTES_XXX; i++) - { - BIG_fshl(a, 8); - a[0] += (int)(unsigned char)b[i]; - } -#ifdef DEBUG_NORM - a[MPV_XXX] = 1; a[MNV_XXX] = 0; -#endif -} - -void XXX::BIG_fromBytesLen(BIG a, char *b, int s) -{ - int i, len = s; - BIG_zero(a); - - if (len > MODBYTES_XXX) len = MODBYTES_XXX; - for (i = 0; i < len; i++) - { - BIG_fshl(a, 8); - a[0] += (int)(unsigned char)b[i]; - } -#ifdef DEBUG_NORM - a[MPV_XXX] = 1; a[MNV_XXX] = 0; -#endif -} - - - -/* SU= 88 */ -void XXX::BIG_doutput(DBIG a) -{ - DBIG b; - int i, len; - BIG_dnorm(a); - len = BIG_dnbits(a); - if (len % 4 == 0) len /= 4; - else - { - len /= 4; - len++; - } - - for (i = len - 1; i >= 0; i--) - { - BIG_dcopy(b, a); - BIG_dshr(b, i * 4); - printf("%01x", (unsigned int) b[0] & 15); - } -} - - -void XXX::BIG_drawoutput(DBIG a) -{ - int i; - printf("("); - for (i = 0; i < DNLEN_XXX - 1; i++) -#if CHUNK==64 - printf("%jx,", (uintmax_t) a[i]); - printf("%jx)", (uintmax_t) a[DNLEN_XXX - 1]); -#else - printf("%x,", (unsigned int) a[i]); - printf("%x)", (unsigned int) a[DNLEN_XXX - 1]); -#endif -} - -/* Copy b=a */ -void XXX::BIG_copy(BIG b, BIG a) -{ - int i; - for (i = 0; i < NLEN_XXX; i++) - b[i] = a[i]; -#ifdef DEBUG_NORM - b[MPV_XXX] = a[MPV_XXX]; - b[MNV_XXX] = a[MNV_XXX]; -#endif -} - -/* Copy from ROM b=a */ -void XXX::BIG_rcopy(BIG b, const BIG a) -{ - int i; - for (i = 0; i < NLEN_XXX; i++) - b[i] = a[i]; -#ifdef DEBUG_NORM - b[MPV_XXX] = 1; b[MNV_XXX] = 0; -#endif -} - -/* double length DBIG copy b=a */ -void XXX::BIG_dcopy(DBIG b, DBIG a) -{ - int i; - for (i = 0; i < DNLEN_XXX; i++) - b[i] = a[i]; -#ifdef DEBUG_NORM - b[DMPV_XXX] = a[DMPV_XXX]; - b[DMNV_XXX] = a[DMNV_XXX]; -#endif -} - -/* Copy BIG to bottom half of DBIG */ -void XXX::BIG_dscopy(DBIG b, BIG a) -{ - int i; - for (i = 0; i < NLEN_XXX - 1; i++) - b[i] = a[i]; - - b[NLEN_XXX - 1] = a[NLEN_XXX - 1] & BMASK_XXX; /* top word normalized */ - b[NLEN_XXX] = a[NLEN_XXX - 1] >> BASEBITS_XXX; - - for (i = NLEN_XXX + 1; i < DNLEN_XXX; i++) b[i] = 0; -#ifdef DEBUG_NORM - b[DMPV_XXX] = a[MPV_XXX]; - b[DMNV_XXX] = a[MNV_XXX]; -#endif -} - -/* Copy BIG to top half of DBIG */ -void XXX::BIG_dsucopy(DBIG b, BIG a) -{ - int i; - for (i = 0; i < NLEN_XXX; i++) - b[i] = 0; - for (i = NLEN_XXX; i < DNLEN_XXX; i++) - b[i] = a[i - NLEN_XXX]; -#ifdef DEBUG_NORM - b[DMPV_XXX] = a[MPV_XXX]; - b[DMNV_XXX] = a[MNV_XXX]; -#endif -} - -/* Copy bottom half of DBIG to BIG */ -void XXX::BIG_sdcopy(BIG b, DBIG a) -{ - int i; - for (i = 0; i < NLEN_XXX; i++) - b[i] = a[i]; -#ifdef DEBUG_NORM - b[MPV_XXX] = a[DMPV_XXX]; - b[MNV_XXX] = a[DMNV_XXX]; -#endif -} - -/* Copy top half of DBIG to BIG */ -void XXX::BIG_sducopy(BIG b, DBIG a) -{ - int i; - for (i = 0; i < NLEN_XXX; i++) - b[i] = a[i + NLEN_XXX]; -#ifdef DEBUG_NORM - b[MPV_XXX] = a[DMPV_XXX]; - b[MNV_XXX] = a[DMNV_XXX]; - -#endif -} - -/* Set a=0 */ -void XXX::BIG_zero(BIG a) -{ - int i; - for (i = 0; i < NLEN_XXX; i++) - a[i] = 0; -#ifdef DEBUG_NORM - a[MPV_XXX] = a[MNV_XXX] = 0; -#endif -} - -void XXX::BIG_dzero(DBIG a) -{ - int i; - for (i = 0; i < DNLEN_XXX; i++) - a[i] = 0; -#ifdef DEBUG_NORM - a[DMPV_XXX] = a[DMNV_XXX] = 0; -#endif -} - -/* set a=1 */ -void XXX::BIG_one(BIG a) -{ - int i; - a[0] = 1; - for (i = 1; i < NLEN_XXX; i++) - a[i] = 0; -#ifdef DEBUG_NORM - a[MPV_XXX] = 1; - a[MNV_XXX] = 0; -#endif -} - -/* Set c=a+b */ -/* SU= 8 */ -void XXX::BIG_add(BIG c, BIG a, BIG b) -{ - int i; - for (i = 0; i < NLEN_XXX; i++) - c[i] = a[i] + b[i]; -#ifdef DEBUG_NORM - c[MPV_XXX] = a[MPV_XXX] + b[MPV_XXX]; - c[MNV_XXX] = a[MNV_XXX] + b[MNV_XXX]; - if (c[MPV_XXX] > NEXCESS_XXX) printf("add problem - positive digit overflow %d\n", (int)c[MPV_XXX]); - if (c[MNV_XXX] > NEXCESS_XXX) printf("add problem - negative digit overflow %d\n", (int)c[MNV_XXX]); - -#endif -} - -/* Set c=a or b */ -/* SU= 8 */ -void XXX::BIG_or(BIG c, BIG a, BIG b) -{ - int i; - BIG_norm(a); - BIG_norm(b); - for (i = 0; i < NLEN_XXX; i++) - c[i] = a[i] | b[i]; -#ifdef DEBUG_NORM - c[MPV_XXX] = 1; - c[MNV_XXX] = 0; -#endif - -} - - -/* Set c=c+d */ -void XXX::BIG_inc(BIG c, int d) -{ - BIG_norm(c); - c[0] += (chunk)d; -#ifdef DEBUG_NORM - c[MPV_XXX] += 1; -#endif -} - -/* Set c=a-b */ -/* SU= 8 */ -void XXX::BIG_sub(BIG c, BIG a, BIG b) -{ - int i; - for (i = 0; i < NLEN_XXX; i++) - c[i] = a[i] - b[i]; -#ifdef DEBUG_NORM - c[MPV_XXX] = a[MPV_XXX] + b[MNV_XXX]; - c[MNV_XXX] = a[MNV_XXX] + b[MPV_XXX]; - if (c[MPV_XXX] > NEXCESS_XXX) printf("sub problem - positive digit overflow %d\n", (int)c[MPV_XXX]); - if (c[MNV_XXX] > NEXCESS_XXX) printf("sub problem - negative digit overflow %d\n", (int)c[MNV_XXX]); - -#endif -} - -/* SU= 8 */ - -void XXX::BIG_dsub(DBIG c, DBIG a, DBIG b) -{ - int i; - for (i = 0; i < DNLEN_XXX; i++) - c[i] = a[i] - b[i]; -#ifdef DEBUG_NORM - c[DMPV_XXX] = a[DMPV_XXX] + b[DMNV_XXX]; - c[DMNV_XXX] = a[DMNV_XXX] + b[DMPV_XXX]; - if (c[DMPV_XXX] > NEXCESS_XXX) printf("double sub problem - positive digit overflow %d\n", (int)c[DMPV_XXX]); - if (c[DMNV_XXX] > NEXCESS_XXX) printf("double sub problem - negative digit overflow %d\n", (int)c[DMNV_XXX]); -#endif -} - -void XXX::BIG_dadd(DBIG c, DBIG a, DBIG b) -{ - int i; - for (i = 0; i < DNLEN_XXX; i++) - c[i] = a[i] + b[i]; -#ifdef DEBUG_NORM - c[DMPV_XXX] = a[DMPV_XXX] + b[DMNV_XXX]; - c[DMNV_XXX] = a[DMNV_XXX] + b[DMPV_XXX]; - if (c[DMPV_XXX] > NEXCESS_XXX) printf("double add problem - positive digit overflow %d\n", (int)c[DMPV_XXX]); - if (c[DMNV_XXX] > NEXCESS_XXX) printf("double add problem - negative digit overflow %d\n", (int)c[DMNV_XXX]); -#endif -} - -/* Set c=c-1 */ -void XXX::BIG_dec(BIG c, int d) -{ - BIG_norm(c); - c[0] -= (chunk)d; -#ifdef DEBUG_NORM - c[MNV_XXX] += 1; -#endif -} - -/* multiplication r=a*c by c<=NEXCESS_XXX */ -void XXX::BIG_imul(BIG r, BIG a, int c) -{ - int i; - for (i = 0; i < NLEN_XXX; i++) r[i] = a[i] * c; -#ifdef DEBUG_NORM - r[MPV_XXX] = a[MPV_XXX] * c; - r[MNV_XXX] = a[MNV_XXX] * c; - if (r[MPV_XXX] > NEXCESS_XXX) printf("int mul problem - positive digit overflow %d\n", (int)r[MPV_XXX]); - if (r[MNV_XXX] > NEXCESS_XXX) printf("int mul problem - negative digit overflow %d\n", (int)r[MNV_XXX]); - -#endif -} - -/* multiplication r=a*c by larger integer - c<=FEXCESS */ -/* SU= 24 */ -chunk XXX::BIG_pmul(BIG r, BIG a, int c) -{ - int i; - chunk ak, carry = 0; - for (i = 0; i < NLEN_XXX; i++) - { - ak = a[i]; - r[i] = 0; - carry = muladd(ak, (chunk)c, carry, &r[i]); - } -#ifdef DEBUG_NORM - r[MPV_XXX] = 1; - r[MNV_XXX] = 0; -#endif - return carry; -} - -/* r/=3 */ -/* SU= 16 */ -/* -int XXX::BIG_div3(BIG r) -{ - int i; - chunk ak,base,carry=0; - BIG_norm(r); - base=((chunk)1<=0; i--) - { - ak=(carry*base+r[i]); - r[i]=ak/3; - carry=ak%3; - } - return (int)carry; -} -*/ -/* multiplication c=a*b by even larger integer b>FEXCESS, resulting in DBIG */ -/* SU= 24 */ -void XXX::BIG_pxmul(DBIG c, BIG a, int b) -{ - int j; - chunk carry; - BIG_dzero(c); - carry = 0; - for (j = 0; j < NLEN_XXX; j++) - carry = muladd(a[j], (chunk)b, carry, &c[j]); - c[NLEN_XXX] = carry; -#ifdef DEBUG_NORM - c[DMPV_XXX] = 1; - c[DMNV_XXX] = 0; -#endif -} - -/* .. if you know the result will fit in a BIG, c must be distinct from a and b */ -/* SU= 40 */ -void XXX::BIG_smul(BIG c, BIG a, BIG b) -{ - int i, j; - chunk carry; - - BIG_zero(c); - for (i = 0; i < NLEN_XXX; i++) - { - carry = 0; - for (j = 0; j < NLEN_XXX; j++) - { - if (i + j < NLEN_XXX) - carry = muladd(a[i], b[j], carry, &c[i + j]); - } - } -#ifdef DEBUG_NORM - c[MPV_XXX] = 1; - c[MNV_XXX] = 0; -#endif - -} - -/* Set c=a*b */ -/* SU= 72 */ -void XXX::BIG_mul(DBIG c, BIG a, BIG b) -{ - int i,k; -#ifdef dchunk - dchunk co,t; - dchunk s; - dchunk d[NLEN_XXX]; - int m; -#endif - -//XXX::BIGMULS++; - -#ifdef DEBUG_NORM - if ((a[MPV_XXX] != 1 && a[MPV_XXX] != 0) || a[MNV_XXX] != 0) printf("First input to mul not normed\n"); - if ((b[MPV_XXX] != 1 && b[MPV_XXX] != 0) || b[MNV_XXX] != 0) printf("Second input to mul not normed\n"); -#endif - - /* Faster to Combafy it.. Let the compiler unroll the loops! */ - -#ifdef COMBA - - /* faster psuedo-Karatsuba method */ -#ifdef UNWOUND - -#ifdef USE_KARATSUBA - - INLINE_MUL2 - -#else - - INLINE_MUL1 - -#endif - -#else - -#ifndef USE_KARATSUBA - - t=(dchunk)a[0]*b[0]; - c[0]=(chunk)t & BMASK_XXX; - t = t >> BASEBITS_XXX; - for (i=1;i> BASEBITS_XXX; - } - - for (i=NLEN_XXX;i<2*NLEN_XXX-1;i++) - { - k=i-(NLEN_XXX-1); - while (k<=NLEN_XXX-1) {t+=(dchunk)a[k]*b[i-k]; k++;} - c[i]=(chunk)t & BMASK_XXX; - t = t >> BASEBITS_XXX; - } - - c[2 * NLEN_XXX - 1] = (chunk)t; -#else - - for (i = 0; i < NLEN_XXX; i++) - d[i] = (dchunk)a[i] * b[i]; - - s = d[0]; - t = s; - c[0] = (chunk)t & BMASK_XXX; - t = t >> BASEBITS_XXX; - - for (k = 1; k < NLEN_XXX; k++) - { - s += d[k]; - t += s; - /*for (i = k; i >= 1 + k / 2; i--) This causes a huge slow down! gcc/g++ optimizer problem (I think) */ - for (i=1+k/2;i<=k;i++) t += (dchunk)(a[i] - a[k - i]) * (b[k - i] - b[i]); - c[k] = (chunk)t & BMASK_XXX; - t = t >> BASEBITS_XXX; - } - for (k = NLEN_XXX; k < 2 * NLEN_XXX - 1; k++) - { - s -= d[k - NLEN_XXX]; - t += s; - for (i=1+k/2;i> BASEBITS_XXX; - } - c[2 * NLEN_XXX - 1] = (chunk)t; -#endif -#endif - -#else - int j; - chunk carry; - BIG_dzero(c); - for (i = 0; i < NLEN_XXX; i++) - { - carry = 0; - for (j = 0; j < NLEN_XXX; j++) - carry = muladd(a[i], b[j], carry, &c[i + j]); - - c[NLEN_XXX + i] = carry; - } - -#endif - -#ifdef DEBUG_NORM - c[DMPV_XXX] = 1; - c[DMNV_XXX] = 0; -#endif -} - -/* Set c=a*a */ -/* SU= 80 */ -void XXX::BIG_sqr(DBIG c, BIG a) -{ - int i, j; -#ifdef dchunk - dchunk t, co; -#endif -//XXX::BIGSQRS++; -#ifdef DEBUG_NORM - if ((a[MPV_XXX] != 1 && a[MPV_XXX] != 0) || a[MNV_XXX] != 0) printf("Input to sqr not normed\n"); -#endif - /* Note 2*a[i] in loop below and extra addition */ - -#ifdef COMBA - -#ifdef UNWOUND - - INLINE_SQR - -#else - - - t = (dchunk)a[0] * a[0]; - c[0] = (chunk)t & BMASK_XXX; - co = t >> BASEBITS_XXX; - - for (j = 1; j < NLEN_XXX - 1; ) - { - t = (dchunk)a[j] * a[0]; - for (i = 1; i < (j + 1) / 2; i++) {t += (dchunk)a[j - i] * a[i]; } - t += t; t += co; - c[j] = (chunk)t & BMASK_XXX; - co = t >> BASEBITS_XXX; - j++; - t = (dchunk)a[j] * a[0]; - for (i = 1; i < (j + 1) / 2; i++) {t += (dchunk)a[j - i] * a[i]; } - t += t; t += co; - t += (dchunk)a[j / 2] * a[j / 2]; - c[j] = (chunk)t & BMASK_XXX; - co = t >> BASEBITS_XXX; - j++; - } - - for (j = NLEN_XXX - 1 + NLEN_XXX % 2; j < DNLEN_XXX - 3; ) - { - t = (dchunk)a[NLEN_XXX - 1] * a[j - NLEN_XXX + 1]; - for (i = j - NLEN_XXX + 2; i < (j + 1) / 2; i++) {t += (dchunk)a[j - i] * a[i]; } - t += t; t += co; - c[j] = (chunk)t & BMASK_XXX; - co = t >> BASEBITS_XXX; - j++; - t = (dchunk)a[NLEN_XXX - 1] * a[j - NLEN_XXX + 1]; - for (i = j - NLEN_XXX + 2; i < (j + 1) / 2; i++) {t += (dchunk)a[j - i] * a[i]; } - t += t; t += co; - t += (dchunk)a[j / 2] * a[j / 2]; - c[j] = (chunk)t & BMASK_XXX; - co = t >> BASEBITS_XXX; - j++; - } - - t = (dchunk)a[NLEN_XXX - 2] * a[NLEN_XXX - 1]; - t += t; t += co; - c[DNLEN_XXX - 3] = (chunk)t & BMASK_XXX; - co = t >> BASEBITS_XXX; - - t = (dchunk)a[NLEN_XXX - 1] * a[NLEN_XXX - 1] + co; - c[DNLEN_XXX - 2] = (chunk)t & BMASK_XXX; - co = t >> BASEBITS_XXX; - c[DNLEN_XXX - 1] = (chunk)co; - - -#endif - -#else - chunk carry; - BIG_dzero(c); - for (i = 0; i < NLEN_XXX; i++) - { - carry = 0; - for (j = i + 1; j < NLEN_XXX; j++) - carry = muladd(a[i], a[j], carry, &c[i + j]); - c[NLEN_XXX + i] = carry; - } - - for (i = 0; i < DNLEN_XXX; i++) c[i] *= 2; - - for (i = 0; i < NLEN_XXX; i++) - c[2 * i + 1] += muladd(a[i], a[i], 0, &c[2 * i]); - - BIG_dnorm(c); -#endif - - -#ifdef DEBUG_NORM - c[DMPV_XXX] = 1; - c[DMNV_XXX] = 0; -#endif - -} - -/* Montgomery reduction */ -void XXX::BIG_monty(BIG a, BIG md, chunk MC, DBIG d) -{ - int i, k; - -#ifdef dchunk - dchunk c,t,s; - dchunk dd[NLEN_XXX]; - chunk v[NLEN_XXX]; -#endif - - -#ifdef DEBUG_NORM - if ((d[DMPV_XXX] != 1 && d[DMPV_XXX] != 0) || d[DMNV_XXX] != 0) printf("Input to redc not normed\n"); -#endif - -#ifdef COMBA - -#ifdef UNWOUND - -#ifdef USE_KARATSUBA - - INLINE_REDC2 - -#else - - INLINE_REDC1 - -#endif - -#else - -#ifndef USE_KARATSUBA - t = d[0]; - v[0] = ((chunk)t * MC)&BMASK_XXX; - t += (dchunk)v[0] * md[0]; - t = (t >> BASEBITS_XXX) + d[1]; - - for (i = 1; i < NLEN_XXX; i++) - { - k=1; - t += (dchunk)v[0] * md[i]; - while (k> BASEBITS_XXX) + d[i + 1]; - } - for (i = NLEN_XXX; i < 2 * NLEN_XXX - 1; i++) - { - k=i-(NLEN_XXX-1); - while (k<=NLEN_XXX-1) {t += (dchunk)v[k]*md[i-k]; k++;} - a[i - NLEN_XXX] = (chunk)t & BMASK_XXX; - t = (t >> BASEBITS_XXX) + d[i + 1]; - } - a[NLEN_XXX - 1] = (chunk)t & BMASK_XXX; -#else - - t = d[0]; - v[0] = ((chunk)t * MC)&BMASK_XXX; - t += (dchunk)v[0] * md[0]; - t = (t >> BASEBITS_XXX) + d[1]; - s = 0; - - for (k = 1; k < NLEN_XXX; k++) - { - t = t + s + (dchunk)v[0] * md[k]; - - for (i=1+k/2;i> BASEBITS_XXX) + d[k + 1]; - dd[k] = (dchunk)v[k] * md[k]; - s += dd[k]; - } - for (k = NLEN_XXX; k < 2 * NLEN_XXX - 1; k++) - { - t = t + s; - for (i=1+k/2;i> BASEBITS_XXX) + d[k + 1]; - s -= dd[k - NLEN_XXX + 1]; - } - a[NLEN_XXX - 1] = (chunk)t & BMASK_XXX; -#endif - -#endif - - - -#else - int j; - chunk m, carry; - for (i = 0; i < NLEN_XXX; i++) - { - if (MC == -1) m = (-d[i])&BMASK_XXX; - else - { - if (MC == 1) m = d[i]; - else m = (MC * d[i])&BMASK_XXX; - } - carry = 0; - for (j = 0; j < NLEN_XXX; j++) - carry = muladd(m, md[j], carry, &d[i + j]); - d[NLEN_XXX + i] += carry; - } - BIG_sducopy(a, d); - BIG_norm(a); - -#endif - -#ifdef DEBUG_NORM - a[MPV_XXX] = 1; a[MNV_XXX] = 0; -#endif -} - -/* General shift left of a by n bits */ -/* a MUST be normalised */ -/* SU= 32 */ -void XXX::BIG_shl(BIG a, int k) -{ - int i; - int n = k % BASEBITS_XXX; - int m = k / BASEBITS_XXX; - - a[NLEN_XXX - 1] = ((a[NLEN_XXX - 1 - m] << n)); - if (NLEN_XXX >= m + 2) a[NLEN_XXX - 1] |= (a[NLEN_XXX - m - 2] >> (BASEBITS_XXX - n)); - - for (i = NLEN_XXX - 2; i > m; i--) - a[i] = ((a[i - m] << n)&BMASK_XXX) | (a[i - m - 1] >> (BASEBITS_XXX - n)); - a[m] = (a[0] << n)&BMASK_XXX; - for (i = 0; i < m; i++) a[i] = 0; - -} - -/* Fast shift left of a by n bits, where n less than a word, Return excess (but store it as well) */ -/* a MUST be normalised */ -/* SU= 16 */ -int XXX::BIG_fshl(BIG a, int n) -{ - int i; - - a[NLEN_XXX - 1] = ((a[NLEN_XXX - 1] << n)) | (a[NLEN_XXX - 2] >> (BASEBITS_XXX - n)); /* top word not masked */ - for (i = NLEN_XXX - 2; i > 0; i--) - a[i] = ((a[i] << n)&BMASK_XXX) | (a[i - 1] >> (BASEBITS_XXX - n)); - a[0] = (a[0] << n)&BMASK_XXX; - - return (int)(a[NLEN_XXX - 1] >> ((8 * MODBYTES_XXX) % BASEBITS_XXX)); /* return excess - only used in ff.c */ -} - -/* double length left shift of a by k bits - k can be > BASEBITS_XXX , a MUST be normalised */ -/* SU= 32 */ -void XXX::BIG_dshl(DBIG a, int k) -{ - int i; - int n = k % BASEBITS_XXX; - int m = k / BASEBITS_XXX; - - a[DNLEN_XXX - 1] = ((a[DNLEN_XXX - 1 - m] << n)) | (a[DNLEN_XXX - m - 2] >> (BASEBITS_XXX - n)); - - for (i = DNLEN_XXX - 2; i > m; i--) - a[i] = ((a[i - m] << n)&BMASK_XXX) | (a[i - m - 1] >> (BASEBITS_XXX - n)); - a[m] = (a[0] << n)&BMASK_XXX; - for (i = 0; i < m; i++) a[i] = 0; - -} - -/* General shift right of a by k bits */ -/* a MUST be normalised */ -/* SU= 32 */ -void XXX::BIG_shr(BIG a, int k) -{ - int i; - int n = k % BASEBITS_XXX; - int m = k / BASEBITS_XXX; - for (i = 0; i < NLEN_XXX - m - 1; i++) - a[i] = (a[m + i] >> n) | ((a[m + i + 1] << (BASEBITS_XXX - n))&BMASK_XXX); - if (NLEN_XXX > m) a[NLEN_XXX - m - 1] = a[NLEN_XXX - 1] >> n; - for (i = NLEN_XXX - m; i < NLEN_XXX; i++) a[i] = 0; - -} - -/* Fast combined shift, subtract and norm. Return sign of result */ -int XXX::BIG_ssn(BIG r, BIG a, BIG m) -{ - int i, n = NLEN_XXX - 1; - chunk carry; - m[0] = (m[0] >> 1) | ((m[1] << (BASEBITS_XXX - 1))&BMASK_XXX); - r[0] = a[0] - m[0]; - carry = r[0] >> BASEBITS_XXX; - r[0] &= BMASK_XXX; - - for (i = 1; i < n; i++) - { - m[i] = (m[i] >> 1) | ((m[i + 1] << (BASEBITS_XXX - 1))&BMASK_XXX); - r[i] = a[i] - m[i] + carry; - carry = r[i] >> BASEBITS_XXX; - r[i] &= BMASK_XXX; - } - - m[n] >>= 1; - r[n] = a[n] - m[n] + carry; -#ifdef DEBUG_NORM - r[MPV_XXX] = 1; r[MNV_XXX] = 0; -#endif - return ((r[n] >> (CHUNK - 1)) & 1); -} - -/* Faster shift right of a by k bits. Return shifted out part */ -/* a MUST be normalised */ -/* SU= 16 */ -int XXX::BIG_fshr(BIG a, int k) -{ - int i; - chunk r = a[0] & (((chunk)1 << k) - 1); /* shifted out part */ - for (i = 0; i < NLEN_XXX - 1; i++) - a[i] = (a[i] >> k) | ((a[i + 1] << (BASEBITS_XXX - k))&BMASK_XXX); - a[NLEN_XXX - 1] = a[NLEN_XXX - 1] >> k; - return (int)r; -} - -/* double length right shift of a by k bits - can be > BASEBITS_XXX */ -/* SU= 32 */ -void XXX::BIG_dshr(DBIG a, int k) -{ - int i; - int n = k % BASEBITS_XXX; - int m = k / BASEBITS_XXX; - for (i = 0; i < DNLEN_XXX - m - 1; i++) - a[i] = (a[m + i] >> n) | ((a[m + i + 1] << (BASEBITS_XXX - n))&BMASK_XXX); - a[DNLEN_XXX - m - 1] = a[DNLEN_XXX - 1] >> n; - for (i = DNLEN_XXX - m; i < DNLEN_XXX; i++ ) a[i] = 0; -} - -/* Split DBIG d into two BIGs t|b. Split happens at n bits, where n falls into NLEN_XXX word */ -/* d MUST be normalised */ -/* SU= 24 */ -chunk XXX::BIG_split(BIG t, BIG b, DBIG d, int n) -{ - int i; - chunk nw, carry = 0; - int m = n % BASEBITS_XXX; - - if (m == 0) - { - for (i = 0; i < NLEN_XXX; i++) b[i] = d[i]; - if (t != b) - { - for (i = NLEN_XXX; i < 2 * NLEN_XXX; i++) t[i - NLEN_XXX] = d[i]; - carry = t[NLEN_XXX - 1] >> BASEBITS_XXX; - t[NLEN_XXX - 1] = t[NLEN_XXX - 1] & BMASK_XXX; /* top word normalized */ - } - return carry; - } - - for (i = 0; i < NLEN_XXX - 1; i++) b[i] = d[i]; - - b[NLEN_XXX - 1] = d[NLEN_XXX - 1] & (((chunk)1 << m) - 1); - - if (t != b) - { - carry = (d[DNLEN_XXX - 1] << (BASEBITS_XXX - m)); - for (i = DNLEN_XXX - 2; i >= NLEN_XXX - 1; i--) - { - nw = (d[i] >> m) | carry; - carry = (d[i] << (BASEBITS_XXX - m))&BMASK_XXX; - t[i - NLEN_XXX + 1] = nw; - } - } -#ifdef DEBUG_NORM - t[MPV_XXX] = 1; t[MNV_XXX] = 0; - b[MPV_XXX] = 1; b[MNV_XXX] = 0; -#endif - return carry; -} - -/* you gotta keep the sign of carry! Look - no branching! */ -/* Note that sign bit is needed to disambiguate between +ve and -ve values */ -/* normalise BIG - force all digits < 2^BASEBITS_XXX */ -chunk XXX::BIG_norm(BIG a) -{ - int i; - chunk d, carry; - - carry=a[0]>>BASEBITS_XXX; - a[0]&=BMASK_XXX; - - for (i = 1; i < NLEN_XXX - 1; i++) - { - d = a[i] + carry; - a[i] = d & BMASK_XXX; - carry = d >> BASEBITS_XXX; - } - a[NLEN_XXX - 1] = (a[NLEN_XXX - 1] + carry); - -#ifdef DEBUG_NORM - a[MPV_XXX] = 1; a[MNV_XXX] = 0; -#endif - return (a[NLEN_XXX - 1] >> ((8 * MODBYTES_XXX) % BASEBITS_XXX)); /* only used in ff.c */ -} - -void XXX::BIG_dnorm(DBIG a) -{ - int i; - chunk d, carry; - - carry=a[0]>>BASEBITS_XXX; - a[0]&=BMASK_XXX; - - for (i = 1; i < DNLEN_XXX - 1; i++) - { - d = a[i] + carry; - a[i] = d & BMASK_XXX; - carry = d >> BASEBITS_XXX; - } - a[DNLEN_XXX - 1] = (a[DNLEN_XXX - 1] + carry); -#ifdef DEBUG_NORM - a[DMPV_XXX] = 1; a[DMNV_XXX] = 0; -#endif -} - -/* Compare a and b. Return 1 for a>b, -1 for a=0; i--) - { - gt |= ((b[i]-a[i]) >> BASEBITS_XXX) & eq; - eq &= ((b[i]^a[i])-1) >> BASEBITS_XXX; - } - return (int)(gt+gt+eq-1); -} - -int XXX::BIG_dcomp(DBIG a, DBIG b) -{ - int i; - chunk gt=0; chunk eq=1; - for (i = DNLEN_XXX-1; i>=0; i--) - { - gt |= ((b[i]-a[i]) >> BASEBITS_XXX) & eq; - eq &= ((b[i]^a[i])-1) >> BASEBITS_XXX; - } - return (int)(gt+gt+eq-1); -} - -/* return number of bits in a */ -/* SU= 8 */ -int XXX::BIG_nbits(BIG a) -{ - int bts, k = NLEN_XXX - 1; - BIG t; - chunk c; - BIG_copy(t, a); - BIG_norm(t); - while (k >= 0 && t[k] == 0) k--; - if (k < 0) return 0; - bts = BASEBITS_XXX * k; - c = t[k]; - while (c != 0) - { - c /= 2; - bts++; - } - return bts; -} - -/* SU= 8, Calculate number of bits in a DBIG - output normalised */ -int XXX::BIG_dnbits(DBIG a) -{ - int bts, k = DNLEN_XXX - 1; - DBIG t; - chunk c; - BIG_dcopy(t, a); - BIG_dnorm(t); - while (k >= 0 && t[k] == 0) k--; - if (k < 0) return 0; - bts = BASEBITS_XXX * k; - c = t[k]; - while (c != 0) - { - c /= 2; - bts++; - } - return bts; -} - -// Set b=b mod m in constant time (if bd is known at compile time) -// bd is Max number of bits in b - Actual number of bits in m -void XXX::BIG_ctmod(BIG b, BIG m, int bd) -{ - int k=bd; - BIG r,c; - BIG_copy(c,m); - BIG_norm(b); - - BIG_shl(c,k); - while (k>=0) - { - BIG_sub(r, b, c); - BIG_norm(r); - BIG_cmove(b, r, 1 - ((r[NLEN_XXX - 1] >> (CHUNK - 1)) & 1)); - BIG_fshr(c, 1); - k--; - } -} - -/* Set b=b mod m */ -/* SU= 16 */ -void XXX::BIG_mod(BIG b, BIG m) -{ - int k=BIG_nbits(b)-BIG_nbits(m); - if (k<0) k=0; - BIG_ctmod(b,m,k); -/* - int k = 0; - BIG r; - BIG c; - BIG_copy(c, m); - - BIG_norm(b); - if (BIG_comp(b, c) < 0) - return; - do - { - BIG_fshl(c, 1); - k++; - } - while (BIG_comp(b, c) >= 0); - - while (k > 0) - { - BIG_fshr(c, 1); - -// constant time... - BIG_sub(r, b, c); - BIG_norm(r); - BIG_cmove(b, r, 1 - ((r[NLEN_XXX - 1] >> (CHUNK - 1)) & 1)); - k--; - } */ -} - - -// Set a=b mod m in constant time (if bd is known at compile time) -// bd is Max number of bits in b - Actual number of bits in m -void XXX::BIG_ctdmod(BIG a, DBIG b, BIG m, int bd) -{ - int k=bd; - DBIG c,r; - BIG_dscopy(c,m); - BIG_dnorm(b); - - BIG_dshl(c,k); - while (k>=0) - { - BIG_dsub(r, b, c); - BIG_dnorm(r); - BIG_dcmove(b, r, 1 - ((r[DNLEN_XXX - 1] >> (CHUNK - 1)) & 1)); - BIG_dshr(c, 1); - k--; - } - BIG_sdcopy(a,b); -} - -/* Set a=b mod c, b is destroyed. Slow but rarely used. */ -/* SU= 96 */ -void XXX::BIG_dmod(BIG a, DBIG b, BIG m) -{ - int k=BIG_dnbits(b)-BIG_nbits(m); - if (k<0) k=0; - BIG_ctdmod(a,b,m,k); - -/* - int k = 0; - DBIG c, r; - BIG_dnorm(b); - BIG_dscopy(c,m); - - if (BIG_dcomp(b, c) < 0) - { - BIG_sdcopy(a, b); - return; - } - - do - { - BIG_dshl(c, 1); - k++; - } - while (BIG_dcomp(b, c) >= 0); - - while (k > 0) - { - BIG_dshr(c, 1); -// constant time... - BIG_dsub(r, b, c); - BIG_dnorm(r); - BIG_dcmove(b, r, 1 - ((r[DNLEN_XXX - 1] >> (CHUNK - 1)) & 1)); - - k--; - } - BIG_sdcopy(a, b); */ -} - -// a=b/m in constant time (if bd is known at compile time) -// bd is Max number of bits in b - Actual number of bits in m -void XXX::BIG_ctddiv(BIG a,DBIG b,BIG m,int bd) -{ - int d,k=bd; - DBIG c,dr; - BIG e,r; - BIG_dscopy(c,m); - BIG_dnorm(b); - - BIG_zero(a); - BIG_zero(e); - BIG_inc(e, 1); - - BIG_shl(e,k); - BIG_dshl(c,k); - - while (k >= 0) - { - BIG_dsub(dr, b, c); - BIG_dnorm(dr); - d = 1 - ((dr[DNLEN_XXX - 1] >> (CHUNK - 1)) & 1); - BIG_dcmove(b, dr, d); - - BIG_add(r, a, e); - BIG_norm(r); - BIG_cmove(a, r, d); - - BIG_dshr(c, 1); - BIG_fshr(e, 1); - k--; - } -} - -/* Set a=b/c, b is destroyed. Slow but rarely used. */ -/* SU= 136 */ -void XXX::BIG_ddiv(BIG a, DBIG b, BIG m) -{ - int k=BIG_dnbits(b)-BIG_nbits(m); - if (k<0) k=0; - BIG_ctddiv(a,b,m,k); -/* - int d, k = 0; - DBIG c, dr; - BIG e, r; - BIG_dnorm(b); - BIG_dscopy(c,m); - - BIG_zero(a); - BIG_zero(e); - BIG_inc(e, 1); - - while (BIG_dcomp(b, c) >= 0) - { - BIG_fshl(e, 1); - BIG_dshl(c, 1); - k++; - } - - while (k > 0) - { - BIG_dshr(c, 1); - BIG_fshr(e, 1); - - BIG_dsub(dr, b, c); - BIG_dnorm(dr); - d = 1 - ((dr[DNLEN_XXX - 1] >> (CHUNK - 1)) & 1); - BIG_dcmove(b, dr, d); - - BIG_add(r, a, e); - BIG_norm(r); - BIG_cmove(a, r, d); - - k--; - } */ -} - -// a=a/m in constant time (if bd is known at compile time) -// bd is Max number of bits in b - Actual number of bits in m -void XXX::BIG_ctsdiv(BIG b,BIG m,int bd) -{ - int d, k=bd; - BIG e,a,r,c; - BIG_norm(b); - BIG_copy(a,b); - BIG_copy(c,m); - BIG_zero(b); - BIG_zero(e); - BIG_inc(e, 1); - - BIG_shl(c,k); - BIG_shl(e,k); - - while (k >= 0) - { - BIG_sub(r, a, c); - BIG_norm(r); - d = 1 - ((r[NLEN_XXX - 1] >> (CHUNK - 1)) & 1); - BIG_cmove(a, r, d); - - BIG_add(r, b, e); - BIG_norm(r); - BIG_cmove(b, r, d); - - BIG_fshr(c, 1); - BIG_fshr(e, 1); - - k--; - } -} - -void XXX::BIG_sdiv(BIG b, BIG m) -{ - int k=BIG_nbits(b)-BIG_nbits(m); - if (k<0) k=0; - BIG_ctsdiv(b,m,k); -/* - int d, k = 0; - BIG c, e, a, r; - BIG_norm(b); - BIG_copy(a,b); - BIG_copy(c, m); - - BIG_zero(b); - BIG_zero(e); - BIG_inc(e, 1); - - while (BIG_comp(a, c) >= 0) - { - BIG_fshl(e, 1); - BIG_fshl(c, 1); - k++; - } - - while (k > 0) - { - BIG_fshr(c, 1); - BIG_fshr(e, 1); - - BIG_sub(r, a, c); - BIG_norm(r); - d = 1 - ((r[NLEN_XXX - 1] >> (CHUNK - 1)) & 1); - BIG_cmove(a, r, d); - - BIG_add(r, b, e); - BIG_norm(r); - BIG_cmove(b, r, d); - k--; - } */ -} - -/* return LSB of a */ -int XXX::BIG_parity(BIG a) -{ - return a[0] % 2; -} - -/* return n-th bit of a */ -/* SU= 16 */ -int XXX::BIG_bit(BIG a, int n) -{ - return (int)((a[n / BASEBITS_XXX] & ((chunk)1 << (n % BASEBITS_XXX))) >> (n%BASEBITS_XXX)); -} - -/* return last n bits of a, where n is small < BASEBITS_XXX */ -/* SU= 16 */ -int XXX::BIG_lastbits(BIG a, int n) -{ - int msk = (1 << n) - 1; - BIG_norm(a); - return ((int)a[0])&msk; -} - -/* get 8*MODBYTES_XXX size random number */ -void XXX::BIG_random(BIG m, csprng *rng) -{ - int i, b, j = 0, r = 0; - int len = 8 * MODBYTES_XXX; - - BIG_zero(m); - /* generate random BIG */ - for (i = 0; i < len; i++) - { - if (j == 0) r = RAND_byte(rng); - else r >>= 1; - b = r & 1; - BIG_shl(m, 1); - m[0] += b; - j++; - j &= 7; - } - -#ifdef DEBUG_NORM - m[MPV_XXX] = 1; m[MNV_XXX] = 0; -#endif -} - -/* get random BIG from rng, modulo q. Done one bit at a time, so its portable */ - -extern int NFILLPOOL; - -void XXX::BIG_randomnum(BIG m, BIG q, csprng *rng) -{ - int i, b, j = 0, r = 0; - int n=2 * BIG_nbits(q); - DBIG d; - BIG_dzero(d); - - /* generate random DBIG */ - for (i = 0; i < n; i++) - { - if (j == 0) r = RAND_byte(rng); - else r >>= 1; - b = r & 1; - BIG_dshl(d, 1); - d[0] += b; - j++; - j &= 7; - } - /* reduce modulo a BIG. Removes bias */ - BIG_dmod(m, d, q); -#ifdef DEBUG_NORM - m[MPV_XXX] = 1; m[MNV_XXX] = 0; -#endif -} - -/* create randum BIG less than r and less than trunc bits */ -void XXX::BIG_randtrunc(BIG s, BIG r, int trunc, csprng *rng) -{ - BIG_randomnum(s, r, rng); - if (BIG_nbits(r) > trunc) - BIG_mod2m(s, trunc); -} - -/* Set r=a*b mod m */ -/* SU= 96 */ -void XXX::BIG_modmul(BIG r, BIG a1, BIG b1, BIG m) -{ - DBIG d; - BIG a, b; - BIG_copy(a, a1); - BIG_copy(b, b1); - BIG_mod(a, m); - BIG_mod(b, m); - - BIG_mul(d, a, b); - BIG_ctdmod(r, d, m,BIG_nbits(m)); -} - -/* Set a=a*a mod m */ -/* SU= 88 */ -void XXX::BIG_modsqr(BIG r, BIG a1, BIG m) -{ - DBIG d; - BIG a; - BIG_copy(a, a1); - BIG_mod(a, m); - BIG_sqr(d, a); - BIG_ctdmod(r, d, m, BIG_nbits(m)); -} - -/* Set r=-a mod m */ -/* SU= 16 */ -void XXX::BIG_modneg(BIG r, BIG a1, BIG m) -{ - BIG a; - BIG_copy(a, a1); - BIG_mod(a, m); - BIG_sub(r, m, a); BIG_norm(r); -} - -/* Set r=a+b mod m */ -void XXX::BIG_modadd(BIG r, BIG a1, BIG b1, BIG m) -{ - BIG a, b; - BIG_copy(a, a1); - BIG_copy(b, b1); - BIG_mod(a, m); - BIG_mod(b, m); - BIG_add(r,a,b); BIG_norm(r); - BIG_ctmod(r,m,1); -} - -/* Set a=a/b mod m */ -/* SU= 136 */ -void XXX::BIG_moddiv(BIG r, BIG a1, BIG b1, BIG m) -{ - DBIG d; - BIG z; - BIG a, b; - BIG_copy(a, a1); - BIG_copy(b, b1); - BIG_mod(a, m); - BIG_invmodp(z, b, m); - - BIG_mul(d, a, z); - BIG_ctdmod(r, d, m, BIG_nbits(m)); -} - -/* Get jacobi Symbol (a/p). Returns 0, 1 or -1 */ -/* SU= 216 */ -int XXX::BIG_jacobi(BIG a, BIG p) -{ - int n8, k, m = 0; - BIG t, x, n, zilch, one; - BIG_one(one); - BIG_zero(zilch); - if (BIG_parity(p) == 0 || BIG_comp(a, zilch) == 0 || BIG_comp(p, one) <= 0) return 0; - BIG_norm(a); - BIG_copy(x, a); - BIG_copy(n, p); - BIG_mod(x, p); - - while (BIG_comp(n, one) > 0) - { - if (BIG_comp(x, zilch) == 0) return 0; - n8 = BIG_lastbits(n, 3); - k = 0; - while (BIG_parity(x) == 0) - { - k++; - BIG_shr(x, 1); - } - if (k % 2 == 1) m += (n8 * n8 - 1) / 8; - m += (n8 - 1) * (BIG_lastbits(x, 2) - 1) / 4; - BIG_copy(t, n); - - BIG_mod(t, x); - BIG_copy(n, x); - BIG_copy(x, t); - m %= 2; - - } - if (m == 0) return 1; - else return -1; -} - -/* - -int XXX::step1(BIG u,BIG x,BIG p) -{ - int k=0; - BIG t; - while (BIG_bit(u,k)==0) - { - BIG_add(t,x,p); - BIG_cmove(x,t,BIG_parity(x)); - BIG_norm(x); - BIG_fshr(x,1); - k++; - } - return k; -} - -void XXX::step2(BIG xf,BIG xs,BIG p) -{ - BIG t; - BIG_add(t,xf,p); - BIG_cmove(xf,t,(BIG_comp(xf,xs)>>1)&1); // move if x1> 1) & 1; - t1 += c; - t1 &= 1; - t1 = 2 - t1; - t1 <<= 1; - U = t1 + 1; - -// i=2 - b = a & 3; - t1 = U * b; - t1 >>= 2; - c = (a >> 2) & 3; - t2 = (U * c) & 3; - t1 += t2; - t1 *= U; - t1 &= 3; - t1 = 4 - t1; - t1 <<= 2; - U += t1; - -// i=4 - b = a & 15; - t1 = U * b; - t1 >>= 4; - c = (a >> 4) & 15; - t2 = (U * c) & 15; - t1 += t2; - t1 *= U; - t1 &= 15; - t1 = 16 - t1; - t1 <<= 4; - U += t1; - - return U; -} - -/* a=1/a mod 2^BIGBITS_XXX. This is very fast! */ -void XXX::BIG_invmod2m(BIG a) -{ - int i; - BIG U, t1, b, c; - BIG_zero(U); - BIG_inc(U, invmod256(BIG_lastbits(a, 8))); - for (i = 8; i < BIGBITS_XXX; i <<= 1) - { - BIG_norm(U); - BIG_copy(b, a); - BIG_mod2m(b, i); // bottom i bits of a - - BIG_smul(t1, U, b); - BIG_shr(t1, i); // top i bits of U*b - - BIG_copy(c, a); - BIG_shr(c, i); - BIG_mod2m(c, i); // top i bits of a - - BIG_smul(b, U, c); - BIG_mod2m(b, i); // bottom i bits of U*c - - BIG_add(t1, t1, b); - BIG_norm(t1); - BIG_smul(b, t1, U); - BIG_copy(t1, b); // (t1+b)*U - BIG_mod2m(t1, i); // bottom i bits of (t1+b)*U - - BIG_one(b); - BIG_shl(b, i); - BIG_sub(t1, b, t1); - BIG_norm(t1); - - BIG_shl(t1, i); - - BIG_add(U, U, t1); - } - BIG_copy(a, U); - BIG_norm(a); - BIG_mod2m(a, BIGBITS_XXX); -} - -// Set r=1/a mod p. Binary method -// NOTE: This function is NOT side-channel safe -// If a is a secret then ALWAYS calculate 1/a = m*(1/am) mod p -// where m is a random masking value -void XXX::BIG_invmodp(BIG r, BIG a, BIG p) -{ - BIG u, v, x1, x2, t, one; - int par,s; - - BIG_mod(a, p); - if (BIG_iszilch(a)) - { - BIG_zero(r); - return; - } - - BIG_copy(u, a); - BIG_copy(v, p); - BIG_one(one); - BIG_copy(x1, one); - BIG_zero(x2); - - while (BIG_comp(u, one) != 0 && BIG_comp(v, one) != 0) - { - while (BIG_parity(u) == 0) - { - BIG_fshr(u, 1); - BIG_add(t,x1,p); - BIG_cmove(x1,t,BIG_parity(x1)); - BIG_norm(x1); - BIG_fshr(x1,1); - } - while (BIG_parity(v) == 0) - { - BIG_fshr(v, 1); - BIG_add(t,x2,p); - BIG_cmove(x2,t,BIG_parity(x2)); - BIG_norm(x2); - BIG_fshr(x2,1); - } - if (BIG_comp(u, v) >= 0) - { - BIG_sub(u, u, v); - BIG_norm(u); - BIG_add(t,x1,p); - BIG_cmove(x1,t,(BIG_comp(x1,x2)>>1)&1); // move if x1>1)&1); // move if x2 -#include -#include -#include "bls_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -#ifndef CORE_ARDUINO -static FP4 G2_TAB[G2_TABLE_ZZZ]; // space for precomputation on fixed G2 parameter -#endif - -#define CEIL(a,b) (((a)-1)/(b)+1) - -/* output u[i] \in F_p */ -/* https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/ */ -static void hash_to_field(int hash,int hlen,FP *u,octet *DST,octet *M, int ctr) -{ - int i,j,L,nbq; - BIG q,w; - DBIG dx; - char okm[256],fd[128]; - octet OKM = {0,sizeof(okm),okm}; - - BIG_rcopy(q, Modulus); - nbq=BIG_nbits(q); - L=CEIL(nbq+CURVE_SECURITY_ZZZ,8); - - XMD_Expand(hash,hlen,&OKM,L*ctr,DST,M); - for (i=0;ival, s); - S->len = MODBYTES_XXX; - -// SkToPk - - PAIR_G2mul(&G, s); - ECP2_toOctet(W, &G, true); - return BLS_OK; -} - - -/* Sign message M using private key S to produce signature SIG */ - -int ZZZ::BLS_CORE_SIGN(octet *SIG, octet *M, octet *S) -{ - BIG s; - ECP D; - BLS_HASH_TO_POINT(&D, M); - BIG_fromBytes(s, S->val); - PAIR_G1mul(&D, s); - ECP_toOctet(SIG, &D, true); /* compress output */ - return BLS_OK; -} - -/* Verify signature given message M, the signature SIG, and the public key W */ -int ZZZ::BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W) -{ - FP12 v; - ECP2 G, PK; - ECP D, HM; - BLS_HASH_TO_POINT(&HM, M); - - ECP_fromOctet(&D, SIG); - if (!PAIR_G1member(&D)) return BLS_FAIL; - ECP_neg(&D); - - ECP2_fromOctet(&PK, W); - if (!PAIR_G2member(&PK)) return BLS_FAIL; - -// Use multi-pairing mechanism and precomputation on G2 -#ifndef CORE_ARDUINO - FP12 r[ATE_BITS_ZZZ]; // space for accumulated line functions - - PAIR_initmp(r); - PAIR_another_pc(r, G2_TAB, &D); - PAIR_another(r, &PK, &HM); - PAIR_miller(&v, r); -#else -//.. or alternatively just - if (!ECP2_generator(&G)) return BLS_FAIL; - PAIR_double_ate(&v, &G, &D, &PK, &HM); -#endif - PAIR_fexp(&v); - - if (FP12_isunity(&v)) return BLS_OK; - return BLS_FAIL; -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls192.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls192.cpp deleted file mode 100644 index e9c48ed..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls192.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Boneh-Lynn-Shacham signature 192-bit API */ - -/* Loosely (for now) following https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-02 */ - -// Minimal-signature-size variant - - -#include -#include -#include -#include "bls192_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -#ifndef CORE_ARDUINO -static FP8 G2_TAB[G2_TABLE_ZZZ]; // space for precomputation on fixed G2 parameter -#endif - -#define CEIL(a,b) (((a)-1)/(b)+1) - -/* output u[i] \in F_p */ -/* https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/ */ -static void hash_to_field(int hash,int hlen,FP *u,octet *DST,octet *M, int ctr) -{ - int i,j,L,nbq; - BIG q,w; - DBIG dx; - char okm[256],fd[128]; - octet OKM = {0,sizeof(okm),okm}; - - BIG_rcopy(q, Modulus); - nbq=BIG_nbits(q); - L=CEIL(nbq+CURVE_SECURITY_ZZZ,8); - - XMD_Expand(hash,hlen,&OKM,L*ctr,DST,M); - for (i=0;ival, s); - S->len = MODBYTES_XXX; - -// SkToPk - - PAIR_G2mul(&G, s); - ECP4_toOctet(W, &G, true); - return BLS_OK; -} - - -/* Sign message m using private key S to produce signature SIG */ - -int ZZZ::BLS_CORE_SIGN(octet *SIG, octet *M, octet *S) -{ - BIG s; - ECP D; - BLS_HASH_TO_POINT(&D, M); - BIG_fromBytes(s, S->val); - PAIR_G1mul(&D, s); - ECP_toOctet(SIG, &D, true); /* compress output */ - return BLS_OK; -} - -/* Verify signature given message M, the signature SIG, and the public key W */ -int ZZZ::BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W) -{ - FP24 v; - ECP4 G, PK; - ECP D, HM; - BLS_HASH_TO_POINT(&HM, M); - - ECP_fromOctet(&D, SIG); - if (!PAIR_G1member(&D)) return BLS_FAIL; - ECP_neg(&D); - - ECP4_fromOctet(&PK, W); - if (!PAIR_G2member(&PK)) return BLS_FAIL; - -// Use new multi-pairing mechanism -#ifndef CORE_ARDUINO - FP24 r[ATE_BITS_ZZZ]; - - PAIR_initmp(r); - PAIR_another_pc(r, G2_TAB, &D); - PAIR_another(r, &PK, &HM); - PAIR_miller(&v, r); -#else -//.. or alternatively - if (!ECP4_generator(&G)) return BLS_FAIL; - PAIR_double_ate(&v, &G, &D, &PK, &HM); -#endif - PAIR_fexp(&v); - - if (FP24_isunity(&v)) return BLS_OK; - return BLS_FAIL; -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256.cpp deleted file mode 100644 index ba36355..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/bls256.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Boneh-Lynn-Shacham signature 256-bit API */ - -/* Loosely (for now) following https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-02 */ - -// Minimal-signature-size variant - -#include -#include -#include -#include "bls256_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -#ifndef CORE_ARDUINO -static FP16 G2_TAB[G2_TABLE_ZZZ]; // space for precomputation on fixed G2 parameter -#endif - -#define CEIL(a,b) (((a)-1)/(b)+1) - -/* output u[i] \in F_p */ -/* https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/ */ -static void hash_to_field(int hash,int hlen,FP *u,octet *DST,octet *M, int ctr) -{ - int i,j,L,nbq; - BIG q,w; - DBIG dx; - char okm[256],fd[128]; - octet OKM = {0,sizeof(okm),okm}; - - BIG_rcopy(q, Modulus); - nbq=BIG_nbits(q); - L=CEIL(nbq+CURVE_SECURITY_ZZZ,8); - - XMD_Expand(hash,hlen,&OKM,L*ctr,DST,M); - for (i=0;ival, s); - S->len = MODBYTES_XXX; - -// SkToPk - - PAIR_G2mul(&G, s); - ECP8_toOctet(W, &G, true); - return BLS_OK; -} -/* Sign message m using private key S to produce signature SIG */ - -int ZZZ::BLS_CORE_SIGN(octet *SIG, octet *M, octet *S) -{ - BIG s; - ECP D; - BLS_HASH_TO_POINT(&D, M); - BIG_fromBytes(s, S->val); - PAIR_G1mul(&D, s); - ECP_toOctet(SIG, &D, true); /* compress output */ - return BLS_OK; -} - -/* Verify signature of message M, the signature SIG, and the public key W */ -int ZZZ::BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W) -{ - FP48 v; - ECP8 G, PK; - ECP D, HM; - BLS_HASH_TO_POINT(&HM, M); - - ECP_fromOctet(&D, SIG); - if (!PAIR_G1member(&D)) return BLS_FAIL; - ECP_neg(&D); - - ECP8_fromOctet(&PK, W); - if (!PAIR_G2member(&PK)) return BLS_FAIL; - -// Use new multi-pairing mechanism -#ifndef CORE_ARDUINO - FP48 r[ATE_BITS_ZZZ]; - PAIR_initmp(r); - PAIR_another_pc(r, G2_TAB, &D); - PAIR_another(r, &PK, &HM); - PAIR_miller(&v, r); -#else -//.. or alternatively - if (!ECP8_generator(&G)) return BLS_FAIL; - PAIR_double_ate(&v, &G, &D, &PK, &HM); -#endif - - PAIR_fexp(&v); - if (FP48_isunity(&v)) return BLS_OK; - return BLS_FAIL; -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/blsrev.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/blsrev.cpp deleted file mode 100644 index 0f449f5..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/blsrev.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Boneh-Lynn-Shacham signature 128-bit API */ - -/* Loosely (for now) following https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-00 */ - -// Minimal-pubkey-size variant - -#include -#include -#include -#include "bls_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -#define CEIL(a,b) (((a)-1)/(b)+1) - -/* output u[i] \in F_p */ -/* https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/ */ -static void hash_to_field(int hash,int hlen,FP2 *u,octet *DST,octet *M, int ctr) -{ - int i,j,k,L,nbq; - BIG q,a[2]; - DBIG dx; - char okm[512],fd[128]; - octet OKM = {0,sizeof(okm),okm}; - - BIG_rcopy(q, Modulus); - nbq=BIG_nbits(q); - L=CEIL(nbq+CURVE_SECURITY_ZZZ,8); - - XMD_Expand(hash,hlen,&OKM,L*ctr*2,DST,M); - for (i=0;ival, s); - S->len = MODBYTES_XXX; - -// SkToPk - - PAIR_G1mul(&G, s); - ECP_toOctet(W, &G, true); - return BLS_OK; -} - -/* Sign message M using private key S to produce signature SIG */ - -int ZZZ::BLS_CORE_SIGN(octet *SIG, octet *M, octet *S) -{ - BIG s; - ECP2 D; - BLS_HASH_TO_POINT(&D, M); - BIG_fromBytes(s, S->val); - PAIR_G2mul(&D, s); - - ECP2_toOctet(SIG, &D, true); /* compress output */ - return BLS_OK; -} - -/* Verify signature given message m, the signature SIG, and the public key W */ -int ZZZ::BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W) -{ - FP12 v; - ECP G, PK; - ECP2 D, HM; - BLS_HASH_TO_POINT(&HM, M); - - ECP2_fromOctet(&D, SIG); - if (!PAIR_G2member(&D)) return BLS_FAIL; - ECP2_neg(&D); - - ECP_fromOctet(&PK, W); - - if (!ECP_generator(&G)) return BLS_FAIL; - PAIR_double_ate(&v, &D, &G, &HM, &PK); - - PAIR_fexp(&v); - - if (FP12_isunity(&v)) return BLS_OK; - return BLS_FAIL; -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/blsrev192.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/blsrev192.cpp deleted file mode 100644 index 1a4cd90..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/blsrev192.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Boneh-Lynn-Shacham signature 192-bit API */ - -/* Loosely (for now) following https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-00 */ - -// Minimal-pubkey-size variant - -#include -#include -#include -#include "bls192_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -#define CEIL(a,b) (((a)-1)/(b)+1) - -/* output u[i] \in F_p */ -/* https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/ */ -static void hash_to_field(int hash,int hlen,FP4 *u,octet *DST,octet *M, int ctr) -{ - int i,j,k,L,nbq; - BIG q,a[4]; - FP2 c,d; - DBIG dx; - char okm[1024],fd[128]; - octet OKM = {0,sizeof(okm),okm}; - - BIG_rcopy(q, Modulus); - nbq=BIG_nbits(q); - L=CEIL(nbq+CURVE_SECURITY_ZZZ,8); - - XMD_Expand(hash,hlen,&OKM,L*ctr*4,DST,M); - for (i=0;ival, s); - S->len = MODBYTES_XXX; - -// SkToPk - - PAIR_G1mul(&G, s); - ECP_toOctet(W, &G, true); - return BLS_OK; -} - -/* Sign message M using private key S to produce signature SIG */ - -int ZZZ::BLS_CORE_SIGN(octet *SIG, octet *M, octet *S) -{ - BIG s; - ECP4 D; - BLS_HASH_TO_POINT(&D, M); - BIG_fromBytes(s, S->val); - PAIR_G2mul(&D, s); - - ECP4_toOctet(SIG, &D, true); /* compress output */ - return BLS_OK; -} - -/* Verify signature given message m, the signature SIG, and the public key W */ -int ZZZ::BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W) -{ - FP24 v; - ECP G, PK; - ECP4 D, HM; - - BLS_HASH_TO_POINT(&HM, M); - - ECP4_fromOctet(&D, SIG); - if (!PAIR_G2member(&D)) return BLS_FAIL; - ECP4_neg(&D); - - ECP_fromOctet(&PK, W); - if (!ECP_generator(&G)) return BLS_FAIL; - PAIR_double_ate(&v, &D, &G, &HM, &PK); - - PAIR_fexp(&v); - if (FP24_isunity(&v)) return BLS_OK; - return BLS_FAIL; -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/blsrev256.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/blsrev256.cpp deleted file mode 100644 index a6a2f59..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/blsrev256.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Boneh-Lynn-Shacham signature 256-bit API */ - -/* Loosely (for now) following https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-00 */ - -// Minimal-pubkey-size variant - -#include -#include -#include -#include "bls256_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -#define CEIL(a,b) (((a)-1)/(b)+1) - -/* output u[i] \in F_p */ -/* https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/ */ -static void hash_to_field(int hash,int hlen,FP8 *u,octet *DST,octet *M, int ctr) -{ - int i,j,k,L,nbq; - BIG q,a[8]; - FP2 c,d; - FP4 e,f; - DBIG dx; - char okm[2048],fd[128]; - octet OKM = {0,sizeof(okm),okm}; - - BIG_rcopy(q, Modulus); - nbq=BIG_nbits(q); - L=CEIL(nbq+CURVE_SECURITY_ZZZ,8); - - XMD_Expand(hash,hlen,&OKM,L*ctr*8,DST,M); - for (i=0;ival, s); - S->len = MODBYTES_XXX; - -// SkToPk - - PAIR_G1mul(&G, s); - ECP_toOctet(W, &G, true); - return BLS_OK; -} - -/* Sign message M using private key S to produce signature SIG */ - -int ZZZ::BLS_CORE_SIGN(octet *SIG, octet *M, octet *S) -{ - BIG s; - ECP8 D; - BLS_HASH_TO_POINT(&D, M); - BIG_fromBytes(s, S->val); - PAIR_G2mul(&D, s); - ECP8_toOctet(SIG, &D, true); /* compress output */ - return BLS_OK; -} - -/* Verify signature of message m, the signature SIG, and the public key W */ -int ZZZ::BLS_CORE_VERIFY(octet *SIG, octet *M, octet *W) -{ - FP48 v; - ECP G, PK; - ECP8 D, HM; - BLS_HASH_TO_POINT(&HM, M); - - ECP8_fromOctet(&D, SIG); - if (!PAIR_G2member(&D)) return BLS_FAIL; - ECP8_neg(&D); - - ECP_fromOctet(&PK, W); - - if (!ECP_generator(&G)) return BLS_FAIL; - PAIR_double_ate(&v, &D, &G, &HM, &PK); - - PAIR_fexp(&v); - if (FP48_isunity(&v)) return BLS_OK; - return BLS_FAIL; -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config16.py b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config16.py deleted file mode 100644 index 94f2564..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config16.py +++ /dev/null @@ -1,744 +0,0 @@ -#!/usr/bin/env python3 - -# -# Copyright (c) 2012-2020 MIRACL UK Ltd. -# -# This file is part of MIRACL Core -# (see https://github.com/miracl/core). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import os -import sys -import shutil -import fnmatch - -testing=False -keep_querying=True - -if len(sys.argv)==2 : - if sys.argv[1]=="test": - testing=True - -my_compiler = "g++" -generated_files = [] - -def copy_keep_file(file, target): - shutil.copyfile(file, target) - -def copy_temp_file(file, target): - shutil.copyfile(file, target) - generated_files.append(target) - -def delete_file(expression): - for root, dirs, files in os.walk(os.path.abspath(os.path.dirname(__file__))): - for name in files: - if fnmatch.fnmatch(name, expression): - os.remove(os.path.join(root, name)) - -class miracl_compile: - def compile_file(optim, file): - print("Processing " + file + "..", end = "", flush=True) - if optim != 0: - flags = " -O%d -c %s" % (optim, file) - else: - flags = " -c %s" % (file) - os.system(my_compiler + flags) - print(". [DONE]") - - def compile_binary(optim, file, lib, bin): - print("Processing " + file + "..", end = "", flush=True) - if sys.platform.startswith("win"): - bin += ".exe" - if optim != 0: - flags = " -O%d %s %s -o %s" % (optim, file, lib, bin) - else: - flags = " %s %s -o %s" % (file, lib, bin) - os.system(my_compiler + flags) - print(". [DONE]") - -def inline_mul1(N,base) : - str="" - str+="\tt=(dchunk)a[0]*b[0]; c[0]=(chunk)t & BMASK_XXX; t=t>>BASEBITS_XXX;\n" - - for i in range(1,N) : - k=0; - str+="\tt=t" - while (k<=i) : - str+="+(dchunk)a[{}]*b[{}]".format(k,i-k) - k+=1 - str+="; c[{}]=(chunk)t & BMASK_XXX; ".format(i) - str+="t=t>>BASEBITS_XXX;\n" - - for i in range(N,2*N-1) : - k=i-(N-1) - str+="\tt=t" - while (k<=N-1) : - str+="+(dchunk)a[{}]*b[{}]".format(k,i-k) - k+=1 - str+="; c[{}]=(chunk)t & BMASK_XXX; ".format(i) - str+="t=t>>BASEBITS_XXX;\n" - - str+="\tc[{}]=(chunk)t;\n".format(2*N-1) - - return str.replace("XXX",base) - -def inline_mul2(N,base) : - str="" - for i in range(0,N) : - str+="\td[{}]=(dchunk)a[{}]*b[{}];\n".format(i, i, i) - str+="\n\ts=d[0];\n\tt = s; c[0]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX;\n" - for k in range(1,N) : - str+="\ts+=d[{}]; t=co+s ".format(k) - for i in range(k,int(k/2),-1) : - str+="+(dchunk)(a[{}]-a[{}])*(b[{}]-b[{}])".format(i,k - i, k - i, i) - str+="; c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n".format(k) - str+="\n" - for k in range(N,2 * N - 1) : - str+="\ts-=d[{}]; t=co+s ".format(k - N) - for i in range(N-1,int(k/2),-1) : - str+="+(dchunk)(a[{}]-a[{}])*(b[{}]-b[{}])".format(i, k - i, k - i, i) - str+="; c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n".format(k) - - str+="\tc[{}]=(chunk)co;\n".format(2 * N - 1) - return str.replace("XXX",base) - -def inline_sqr(N,base) : - str="" - str+="\n\tt=(dchunk)a[0]*a[0]; c[0]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX;\n" - - for k in range(1,N) : - str+="\tt= " - for i in range(k,int(k/2),-1) : - str+="+(dchunk)a[{}]*a[{}]".format(i, k - i) - str+="; t+=t; t+=co;" - if k % 2 == 0 : - str+=" t+=(dchunk)a[{}]*a[{}];".format(int(k/2), int(k/2)) - str+=" c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n".format(k) - str+="\n" - - for k in range(N,2*N-2) : - str+="\tt= " - for i in range(N-1,int(k/2),-1) : - str+="+(dchunk)a[{}]*a[{}]".format(i, k - i) - str+="; t+=t; t+=co;" - if k % 2 == 0 : - str+=" t+=(dchunk)a[{}]*a[{}];".format(int(k/2),int(k/2)) - str+=" c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n".format(k) - - str+="\tt=co; t+=(dchunk)a[{}]*a[{}]; c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n ".format(N-1,N-1,2*N-2) - - str+="\tc[{}]=(chunk)co;\n".format(2 * N - 1) - return str.replace("XXX",base) - -def inline_redc2(N,base) : - str="" - str+="\tt=d[0]; v[0]=((chunk)t*MC)&BMASK_XXX; t+=(dchunk)v[0]*md[0]; s=0; c=(t>>BASEBITS_XXX);\n\n" - - for k in range(1,N) : - str+="\tt=d[{}]+c+s+(dchunk)v[0]*md[{}]".format(k, k) - for i in range(k-1,int(k/2),-1) : - str+="+(dchunk)(v[{}]-v[{}])*(md[{}]-md[{}])".format(k - i, i, i, k - i) - str+="; v[{}]=((chunk)t*MC)&BMASK_XXX; t+=(dchunk)v[{}]*md[0]; ".format(k, k) - str+=" dd[{}]=(dchunk)v[{}]*md[{}]; s+=dd[{}]; c=(t>>BASEBITS_XXX); \n".format(k, k, k, k) - - str+="\n" - for k in range(N,2*N-1) : - str+="\tt=d[{}]+c+s".format(k) - for i in range(N-1,int(k/2),-1) : - str+="+(dchunk)(v[{}]-v[{}])*(md[{}]-md[{}])".format(k - i, i, i, k - i) - str+="; a[{}]=(chunk)t&BMASK_XXX; s-=dd[{}]; c=(t>>BASEBITS_XXX); \n".format(k - N, k - N + 1) - - str+="\ta[{}]=d[{}]+((chunk)c&BMASK_XXX);\n".format(N-1,2*N-1) - return str.replace("XXX",base) - -def inline_redc1(N,base) : - str="" - - str+="\tt = d[0];\n" - str+="\tv[0] = ((chunk)t * MC)&BMASK_XXX;\n" - str+="\tt += (dchunk)v[0] * md[0];\n" - str+="\tt = (t >> BASEBITS_XXX) + d[1];\n" - - for i in range(1,N) : - k=1 - str+="\tt += (dchunk)v[0] * md[{}] ".format(i) - while k 0 : - replace(fnameh,"@TW@","POSITOWER") - else : - replace(fnameh,"@TW@","NEGATOWER") - - ib=int(base) - inb=int(nb) - inbt=int(nbt) - nlen=(1+((8*inb-1)//ib)) - sh=ib*nlen-inbt - - if sh > 6 : - sh=6 - replace(fnameh,"@SH@",str(sh)) - - fnameh="config_curve_"+tc+".h" - copy_keep_file("config_curve.h", fnameh) - - replace(fnameh,"XXX",bd) - replace(fnameh,"YYY",tf) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"@CT@",ct) - replace(fnameh,"@CA@",ca) - replace(fnameh,"@PF@",pf) - - replace(fnameh,"@ST@",stw) - replace(fnameh,"@SX@",sx) - replace(fnameh,"@CS@",cs) - replace(fnameh,"@AB@",ab) - replace(fnameh,"@G2@",g2) - - replace(fnameh,"@HC@",hc) - replace(fnameh,"@HC2@",hc2) - - fnamec="big_"+bd+".cpp" - fnameh="big_"+bd+".h" - - copy_temp_file("big.cpp", fnamec) - copy_keep_file("big.h", fnameh) - - replace(fnamec,"XXX",bd) - replace(fnameh,"XXX",bd) - - replace(fnamec,"INLINE_MUL1",inline_mul1(nlen,bd)) - replace(fnamec,"INLINE_MUL2",inline_mul2(nlen,bd)) - replace(fnamec,"INLINE_SQR",inline_sqr(nlen,bd)) - replace(fnamec,"INLINE_REDC1",inline_redc1(nlen,bd)) - replace(fnamec,"INLINE_REDC2",inline_redc2(nlen,bd)) - - miracl_compile.compile_file(3, fnamec) - - fnamec="fp_"+tf+".cpp" - fnameh="fp_"+tf+".h" - - copy_temp_file("fp.cpp", fnamec) - copy_keep_file("fp.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - miracl_compile.compile_file(3, "rom_field_"+tf+".cpp"); - - fnamec="ecp_"+tc+".cpp" - fnameh="ecp_"+tc+".h" - - copy_temp_file("ecp.cpp", fnamec) - copy_keep_file("ecp.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="ecdh_"+tc+".cpp" - fnameh="ecdh_"+tc+".h" - - copy_temp_file("ecdh.cpp", fnamec) - copy_keep_file("ecdh.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - miracl_compile.compile_file(3, "rom_curve_"+tc+".cpp"); - - if pf != "NOT_PF" : - fnamec="fp2_"+tf+".cpp" - fnameh="fp2_"+tf+".h" - - copy_temp_file("fp2.cpp", fnamec) - copy_keep_file("fp2.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="fp4_"+tf+".cpp" - fnameh="fp4_"+tf+".h" - - copy_temp_file("fp4.cpp", fnamec) - copy_keep_file("fp4.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - fnamec="fp12_"+tf+".cpp" - fnameh="fp12_"+tf+".h" - - copy_temp_file("fp12.cpp", fnamec) - copy_keep_file("fp12.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - fnamec="ecp2_"+tc+".cpp" - fnameh="ecp2_"+tc+".h" - - copy_temp_file("ecp2.cpp", fnamec) - copy_keep_file("ecp2.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="pair_"+tc+".cpp" - fnameh="pair_"+tc+".h" - - copy_temp_file("pair.cpp", fnamec) - copy_keep_file("pair.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="mpin_"+tc+".cpp" - fnameh="mpin_"+tc+".h" - - copy_temp_file("mpin.cpp", fnamec) - copy_keep_file("mpin.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="bls_"+tc+".cpp" - fnameh="bls_"+tc+".h" - - copy_temp_file("bls.cpp", fnamec) - copy_keep_file("bls.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - -replace("arch.h","@WL@","16") - -class miracl_crypto: - np_curves = ( - ( "255", "F25519", "Ed25519", "13", "2", "1", "PSEUDO_MERSENNE", "0", "EDWARDS", "-1", "NOT_PF", "", "", "", "", "128"), - ( "256", "F256PME", "NUMS256E", "13", "1", "1", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "128"), - ( "160", "SECP160R1", "SECP160R1", "13", "1", "3", "NOT_SPECIAL", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128") - ) - - pf_curves = ( - ( "254", "BN254", "BN254", "13", "1",["-1", "-1", "0"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BN_CURVE", "D_TYPE", "NEGATIVEX", "71", "66", "128"), - ( "254", "BN254CX", "BN254CX", "13", "1",["-1", "-1", "0"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BN_CURVE", "D_TYPE", "NEGATIVEX", "76", "66", "128") - ) - - # There are choices here, different ways of getting the same result, but some faster than others - rsa_params = ( - # 256 is slower but may allow reuse of 256-bit BIGs used for elliptic curve - # 512 is faster.. but best is 1024 - ( "256", "RSA2048", "13", "8") - ) - - total_entries = len(np_curves)+len(pf_curves)+len(rsa_params) - - def valid_query(number): - return number >= 0 and number <= miracl_crypto.total_entries - -def interactive_prompt_print(): - index = 1 - print("Elliptic Curves") - for tuple in miracl_crypto.np_curves: - print(str(index) + ".", tuple[2]) - index += 1 - - print("\nPairing-Friendly Elliptic Curves") - for tuple in miracl_crypto.pf_curves: - print(str(index) + ".", tuple[2]) - index += 1 - - print("\nRSA") - # Python interprets the singular RSA entry in a way - # that doesn't allow for nested tuples if there aren't - # more than one entry, the original code has been commented - # out and replaced with a subpar fix - # - # If you are adding more RSA curves, it will error out - # Uncomment the original code if you intend to do so and - # comment out the patch - # - # for tuple in miracl_crypto.rsa_params: - # print(str(index) + ".", "RSA" + str(tuple[1])) - # index += 1 - # ----BEGIN PATCH------------- - print(str(index) + ".", miracl_crypto.rsa_params[1]) - index += 1 - # ----END PATCH-------------- - -def interactive_prompt_exect(index): - index -= 1 # Python internally is zero-indexed - if index < len(miracl_crypto.np_curves): - tuple = miracl_crypto.np_curves[index] - curveset( - tuple[0], tuple[1], tuple[2], tuple[3], tuple[4], - tuple[5], tuple[6], tuple[7], tuple[8], tuple[9], - tuple[10], tuple[11], tuple[12], - tuple[13], tuple[14], tuple[15] - ) - elif index < len(miracl_crypto.np_curves) + len(miracl_crypto.pf_curves): - tuple = miracl_crypto.pf_curves[index-len(miracl_crypto.np_curves)] - curveset( - tuple[0], tuple[1], tuple[2], tuple[3], tuple[4], - tuple[5], tuple[6], tuple[7], tuple[8], tuple[9], - tuple[10], tuple[11], tuple[12], - tuple[13], tuple[14], tuple[15] - ) - else: - # Python interprets the singular RSA entry in a way - # that doesn't allow for nested tuples if there aren't - # more than one entry, the original code has been commented - # out and replaced with a subpar fix - # - # If you are adding more RSA curves, it will error out - # Uncomment the original code if you intend to do so and - # comment out the patch - # - # tuple = miracl_crypto.rsa_params[index-(len(miracl_crypto.np_curves)+len(miracl_crypto.pf_curves))] - # rsaset( - # tuple[0], tuple[1], tuple[2], tuple[3] - # ) - # ----BEGIN PATCH------------- - rsaset( - miracl_crypto.rsa_params[0], miracl_crypto.rsa_params[1], miracl_crypto.rsa_params[2], miracl_crypto.rsa_params[3] - ) - # ----END PATCH-------------- - -def interactive_prompt_input(): - while True: - userInput = input("\nChoose schemes to support (select 0 to finish): ") - try: - return int(userInput) - except: - if (userInput == ''): - return 0 - print("Non-integer input, select values between 1 and " + str(miracl_crypto.total_entries)) - interactive_prompt_input() - -interactive_prompt_print() -while keep_querying and not testing: - query_val = -1 - while not miracl_crypto.valid_query(query_val): - query_val = interactive_prompt_input() - if not miracl_crypto.valid_query(query_val): - print("Number out of range, select values between 1 and " + str(miracl_crypto.total_entries)) - elif query_val == 0: - keep_querying = False - else: - interactive_prompt_exect(query_val) - -if testing: - for i in range(0, miracl_crypto.total_entries): - interactive_prompt_exect(i+1) - -# create library -miracl_compile.compile_file(3, "randapi.cpp") -miracl_compile.compile_file(3, "hash.cpp") -miracl_compile.compile_file(3, "hmac.cpp") -miracl_compile.compile_file(3, "rand.cpp") -miracl_compile.compile_file(3, "oct.cpp") -miracl_compile.compile_file(3, "share.cpp") -miracl_compile.compile_file(3, "aes.cpp") -miracl_compile.compile_file(3, "gcm.cpp") -miracl_compile.compile_file(3, "newhope.cpp") -miracl_compile.compile_file(3, "dilithium.cpp") -miracl_compile.compile_file(3, "kyber.cpp") -miracl_compile.compile_file(3, "x509.cpp") - -if sys.platform.startswith("win") : - os.system("for %i in (*.o) do @echo %~nxi >> f.list") - os.system("ar rc core.a @f.list") - delete_file("f.list") -else : - os.system("ar rc core.a *.o") - -if testing : - miracl_compile.compile_binary(2, "testecc.cpp", "core.a", "testecc") - miracl_compile.compile_binary(2, "testmpin.cpp", "core.a", "testmpin") - miracl_compile.compile_binary(2, "testbls.cpp", "core.a", "testbls") - miracl_compile.compile_binary(2, "benchtest_all.cpp", "core.a", "benchtest_all") - -#clean up -for file in generated_files: - delete_file(file) - -delete_file("*.o") -delete_file("big.*") -delete_file("fp.*") -delete_file("ecp.*") -delete_file("ecdh.*") -delete_file("hpke.*") -delete_file("ff.*") -delete_file("rsa.*") -delete_file("config_big.h") -delete_file("config_field.h") -delete_file("config_curve.h") -delete_file("config_ff.h") -delete_file("fp2.*") -delete_file("fp4.*") -delete_file("fp8.*") -delete_file("fp16.*") -delete_file("share.cpp") -delete_file("x509.cpp") -delete_file("gcm.cpp") -delete_file("hash.cpp") -delete_file("hmac.cpp") -delete_file("aes.cpp") -delete_file("oct.cpp"); -delete_file("newhope.cpp") -delete_file("dilithium.cpp") -delete_file("kyber.cpp") -delete_file("Doxyfile") -delete_file("refman.pdf") -delete_file("readme.md") -delete_file("rand.cpp") -delete_file("randapi.cpp") -delete_file("config*.py") - -delete_file("fp12.*") -delete_file("fp24.*") -delete_file("fp48.*") - -delete_file("ecp2.*") -delete_file("ecp4.*") -delete_file("ecp8.*") - -delete_file("pair.*") -delete_file("mpin.*") -delete_file("bls.*") - -delete_file("pair4.*") -delete_file("mpin192.*") -delete_file("bls192.*") - -delete_file("pair8.*") -delete_file("mpin256.*") -delete_file("bls256.*") - -delete_file("rom_field*.cpp") -delete_file("rom_curve*.cpp") - - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config32.py b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config32.py deleted file mode 100644 index 38e83a1..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config32.py +++ /dev/null @@ -1,983 +0,0 @@ -#!/usr/bin/env python3 - -# -# Copyright (c) 2012-2020 MIRACL UK Ltd. -# -# This file is part of MIRACL Core -# (see https://github.com/miracl/core). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import os -import sys -import shutil -import fnmatch - -testing=False -keep_querying=True - -if len(sys.argv)==2 : - if sys.argv[1]=="test": - testing=True - -my_compiler = "g++" -generated_files = [] - -def copy_keep_file(file, target): - shutil.copyfile(file, target) - -def copy_temp_file(file, target): - shutil.copyfile(file, target) - generated_files.append(target) - -def delete_file(expression): - for root, dirs, files in os.walk(os.path.abspath(os.path.dirname(__file__))): - for name in files: - if fnmatch.fnmatch(name, expression): - os.remove(os.path.join(root, name)) - -class miracl_compile: - def compile_file(optim, file): - print("Processing " + file + "..", end = "", flush=True) - if optim != 0: - flags = " -O%d -c %s" % (optim, file) - else: - flags = " -c %s" % (file) - os.system(my_compiler + flags) - print(". [DONE]") - - def compile_binary(optim, file, lib, bin): - print("Processing " + file + "..", end = "", flush=True) - if sys.platform.startswith("win"): - bin += ".exe" - if optim != 0: - flags = " -O%d %s %s -o %s" % (optim, file, lib, bin) - else: - flags = " %s %s -o %s" % (file, lib, bin) - os.system(my_compiler + flags) - print(". [DONE]") - -def inline_mul1(N,base) : - str="" - str+="\tt=(dchunk)a[0]*b[0]; c[0]=(chunk)t & BMASK_XXX; t=t>>BASEBITS_XXX;\n" - - for i in range(1,N) : - k=0; - str+="\tt=t" - while (k<=i) : - str+="+(dchunk)a[{}]*b[{}]".format(k,i-k) - k+=1 - str+="; c[{}]=(chunk)t & BMASK_XXX; ".format(i) - str+="t=t>>BASEBITS_XXX;\n" - - for i in range(N,2*N-1) : - k=i-(N-1) - str+="\tt=t" - while (k<=N-1) : - str+="+(dchunk)a[{}]*b[{}]".format(k,i-k) - k+=1 - str+="; c[{}]=(chunk)t & BMASK_XXX; ".format(i) - str+="t=t>>BASEBITS_XXX;\n" - - str+="\tc[{}]=(chunk)t;\n".format(2*N-1) - - return str.replace("XXX",base) - -def inline_mul2(N,base) : - str="" - for i in range(0,N) : - str+="\td[{}]=(dchunk)a[{}]*b[{}];\n".format(i, i, i) - str+="\n\ts=d[0];\n\tt = s; c[0]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX;\n" - for k in range(1,N) : - str+="\ts+=d[{}]; t=co+s ".format(k) - for i in range(k,int(k/2),-1) : - str+="+(dchunk)(a[{}]-a[{}])*(b[{}]-b[{}])".format(i,k - i, k - i, i) - str+="; c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n".format(k) - str+="\n" - for k in range(N,2 * N - 1) : - str+="\ts-=d[{}]; t=co+s ".format(k - N) - for i in range(N-1,int(k/2),-1) : - str+="+(dchunk)(a[{}]-a[{}])*(b[{}]-b[{}])".format(i, k - i, k - i, i) - str+="; c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n".format(k) - - str+="\tc[{}]=(chunk)co;\n".format(2 * N - 1) - return str.replace("XXX",base) - -def inline_sqr(N,base) : - str="" - str+="\n\tt=(dchunk)a[0]*a[0]; c[0]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX;\n" - - for k in range(1,N) : - str+="\tt= " - for i in range(k,int(k/2),-1) : - str+="+(dchunk)a[{}]*a[{}]".format(i, k - i) - str+="; t+=t; t+=co;" - if k % 2 == 0 : - str+=" t+=(dchunk)a[{}]*a[{}];".format(int(k/2), int(k/2)) - str+=" c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n".format(k) - str+="\n" - - for k in range(N,2*N-2) : - str+="\tt= " - for i in range(N-1,int(k/2),-1) : - str+="+(dchunk)a[{}]*a[{}]".format(i, k - i) - str+="; t+=t; t+=co;" - if k % 2 == 0 : - str+=" t+=(dchunk)a[{}]*a[{}];".format(int(k/2),int(k/2)) - str+=" c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n".format(k) - - str+="\tt=co; t+=(dchunk)a[{}]*a[{}]; c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n ".format(N-1,N-1,2*N-2) - - str+="\tc[{}]=(chunk)co;\n".format(2 * N - 1) - return str.replace("XXX",base) - -def inline_redc2(N,base) : - str="" - str+="\tt=d[0]; v[0]=((chunk)t*MC)&BMASK_XXX; t+=(dchunk)v[0]*md[0]; s=0; c=(t>>BASEBITS_XXX);\n\n" - - for k in range(1,N) : - str+="\tt=d[{}]+c+s+(dchunk)v[0]*md[{}]".format(k, k) - for i in range(k-1,int(k/2),-1) : - str+="+(dchunk)(v[{}]-v[{}])*(md[{}]-md[{}])".format(k - i, i, i, k - i) - str+="; v[{}]=((chunk)t*MC)&BMASK_XXX; t+=(dchunk)v[{}]*md[0]; ".format(k, k) - str+=" dd[{}]=(dchunk)v[{}]*md[{}]; s+=dd[{}]; c=(t>>BASEBITS_XXX); \n".format(k, k, k, k) - - str+="\n" - for k in range(N,2*N-1) : - str+="\tt=d[{}]+c+s".format(k) - for i in range(N-1,int(k/2),-1) : - str+="+(dchunk)(v[{}]-v[{}])*(md[{}]-md[{}])".format(k - i, i, i, k - i) - str+="; a[{}]=(chunk)t&BMASK_XXX; s-=dd[{}]; c=(t>>BASEBITS_XXX); \n".format(k - N, k - N + 1) - - str+="\ta[{}]=d[{}]+((chunk)c&BMASK_XXX);\n".format(N-1,2*N-1) - return str.replace("XXX",base) - -def inline_redc1(N,base) : - str="" - - str+="\tt = d[0];\n" - str+="\tv[0] = ((chunk)t * MC)&BMASK_XXX;\n" - str+="\tt += (dchunk)v[0] * md[0];\n" - str+="\tt = (t >> BASEBITS_XXX) + d[1];\n" - - for i in range(1,N) : - k=1 - str+="\tt += (dchunk)v[0] * md[{}] ".format(i) - while k 0 : - replace(fnameh,"@TW@","POSITOWER") - else : - replace(fnameh,"@TW@","NEGATOWER") - - ib=int(base) - inb=int(nb) - inbt=int(nbt) - nlen=(1+((8*inb-1)//ib)) - sh=ib*nlen-inbt - - if sh > 14 : - sh=14 - replace(fnameh,"@SH@",str(sh)) - - fnameh="config_curve_"+tc+".h" - copy_keep_file("config_curve.h", fnameh) - - replace(fnameh,"XXX",bd) - replace(fnameh,"YYY",tf) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"@CT@",ct) - replace(fnameh,"@CA@",ca) - replace(fnameh,"@PF@",pf) - - replace(fnameh,"@ST@",stw) - replace(fnameh,"@SX@",sx) - replace(fnameh,"@CS@",cs) - replace(fnameh,"@AB@",ab) - replace(fnameh,"@G2@",g2) - - replace(fnameh,"@HC@",hc) - replace(fnameh,"@HC2@",hc2) - - fnamec="big_"+bd+".cpp" - fnameh="big_"+bd+".h" - - copy_temp_file("big.cpp", fnamec) - copy_keep_file("big.h", fnameh) - - replace(fnamec,"XXX",bd) - replace(fnameh,"XXX",bd) - - replace(fnamec,"INLINE_MUL1",inline_mul1(nlen,bd)) - replace(fnamec,"INLINE_MUL2",inline_mul2(nlen,bd)) - replace(fnamec,"INLINE_SQR",inline_sqr(nlen,bd)) - replace(fnamec,"INLINE_REDC1",inline_redc1(nlen,bd)) - replace(fnamec,"INLINE_REDC2",inline_redc2(nlen,bd)) - - miracl_compile.compile_file(3, fnamec) - - fnamec="fp_"+tf+".cpp" - fnameh="fp_"+tf+".h" - - copy_temp_file("fp.cpp", fnamec) - copy_keep_file("fp.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - miracl_compile.compile_file(3, "rom_field_"+tf+".cpp"); - - fnamec="ecp_"+tc+".cpp" - fnameh="ecp_"+tc+".h" - - copy_temp_file("ecp.cpp", fnamec) - copy_keep_file("ecp.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="ecdh_"+tc+".cpp" - fnameh="ecdh_"+tc+".h" - - copy_temp_file("ecdh.cpp", fnamec) - copy_keep_file("ecdh.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - - fnamec="eddsa_"+tc+".cpp" - fnameh="eddsa_"+tc+".h" - - copy_temp_file("eddsa.cpp", fnamec) - copy_keep_file("eddsa.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - - fnamec="hpke_"+tc+".cpp" - fnameh="hpke_"+tc+".h" - - copy_temp_file("hpke.cpp", fnamec) - copy_keep_file("hpke.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - miracl_compile.compile_file(3, "rom_curve_"+tc+".cpp"); - - if pf != "NOT_PF" : - fnamec="fp2_"+tf+".cpp" - fnameh="fp2_"+tf+".h" - - copy_temp_file("fp2.cpp", fnamec) - copy_keep_file("fp2.h", fnameh) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="fp4_"+tf+".cpp" - fnameh="fp4_"+tf+".h" - - copy_temp_file("fp4.cpp", fnamec) - copy_keep_file("fp4.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - - if pf == "BN_CURVE" or pf == "BLS12_CURVE" : - fnamec="fp12_"+tf+".cpp" - fnameh="fp12_"+tf+".h" - - copy_temp_file("fp12.cpp", fnamec) - copy_keep_file("fp12.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - fnamec="ecp2_"+tc+".cpp" - fnameh="ecp2_"+tc+".h" - - copy_temp_file("ecp2.cpp", fnamec) - copy_keep_file("ecp2.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="pair_"+tc+".cpp" - fnameh="pair_"+tc+".h" - - copy_temp_file("pair.cpp", fnamec) - copy_keep_file("pair.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="mpin_"+tc+".cpp" - fnameh="mpin_"+tc+".h" - - copy_temp_file("mpin.cpp", fnamec) - copy_keep_file("mpin.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="bls_"+tc+".cpp" - fnameh="bls_"+tc+".h" - - copy_temp_file("bls.cpp", fnamec) - copy_keep_file("bls.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - if pf == "BLS24_CURVE" : - fnamec="fp8_"+tf+".cpp" - fnameh="fp8_"+tf+".h" - - copy_temp_file("fp8.cpp", fnamec) - copy_keep_file("fp8.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - - fnamec="fp24_"+tf+".cpp" - fnameh="fp24_"+tf+".h" - - copy_temp_file("fp24.cpp", fnamec) - copy_keep_file("fp24.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - fnamec="ecp4_"+tc+".cpp" - fnameh="ecp4_"+tc+".h" - - copy_temp_file("ecp4.cpp", fnamec) - copy_keep_file("ecp4.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="pair4_"+tc+".cpp" - fnameh="pair4_"+tc+".h" - - copy_temp_file("pair4.cpp", fnamec) - copy_keep_file("pair4.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="mpin192_"+tc+".cpp" - fnameh="mpin192_"+tc+".h" - - copy_temp_file("mpin192.cpp", fnamec) - copy_keep_file("mpin192.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="bls192_"+tc+".cpp" - fnameh="bls192_"+tc+".h" - - copy_temp_file("bls192.cpp", fnamec) - copy_keep_file("bls192.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - if pf == "BLS48_CURVE" : - - fnamec="fp8_"+tf+".cpp" - fnameh="fp8_"+tf+".h" - - copy_temp_file("fp8.cpp", fnamec) - copy_keep_file("fp8.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - - fnamec="ecp8_"+tc+".cpp" - fnameh="ecp8_"+tc+".h" - - copy_temp_file("ecp8.cpp", fnamec) - copy_keep_file("ecp8.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - - fnamec="fp16_"+tf+".cpp" - fnameh="fp16_"+tf+".h" - - copy_temp_file("fp16.cpp", fnamec) - copy_keep_file("fp16.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - - fnamec="fp48_"+tf+".cpp" - fnameh="fp48_"+tf+".h" - - copy_temp_file("fp48.cpp", fnamec) - copy_keep_file("fp48.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - - fnamec="pair8_"+tc+".cpp" - fnameh="pair8_"+tc+".h" - - copy_temp_file("pair8.cpp", fnamec) - copy_keep_file("pair8.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="mpin256_"+tc+".cpp" - fnameh="mpin256_"+tc+".h" - - copy_temp_file("mpin256.cpp", fnamec) - copy_keep_file("mpin256.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="bls256_"+tc+".cpp" - fnameh="bls256_"+tc+".h" - - copy_temp_file("bls256.cpp", fnamec) - copy_keep_file("bls256.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - -replace("arch.h","@WL@","32") - -class miracl_crypto: - np_curves = ( - ( "255", "F25519", "Ed25519", "29", "2", "1", "PSEUDO_MERSENNE", "0", "EDWARDS", "-1", "NOT_PF", "", "", "", "", "128"), - ( "255", "F25519", "C25519", "29", "2", "1", "PSEUDO_MERSENNE", "0", "MONTGOMERY", "486662", "NOT_PF", "", "", "", "", "128"), - ( "256", "NIST256", "NIST256", "28", "1", "-10", "NOT_SPECIAL", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128"), - ( "256", "BRAINPOOL", "BRAINPOOL", "28", "1", "-3", "NOT_SPECIAL", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128"), - ( "256", "ANSSI", "ANSSI", "28", "1", "-5", "NOT_SPECIAL", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128"), - ( "336", "HIFIVE", "HIFIVE", "29", "2", "1", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "192"), - ( "448", "F448", "Ed448", "29", "1", "0", "GENERALISED_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "256"), - ( "384", "NIST384", "NIST384", "29", "1", "-12", "NOT_SPECIAL", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "192"), - ( "414", "C41417", "C41417", "29", "1", "1", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "256"), - ( "521", "NIST521", "NIST521", "28", "1", "-4", "PSEUDO_MERSENNE", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "256"), - ( "256", "F256PMW", "NUMS256W", "28", "1", "7", "PSEUDO_MERSENNE", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128"), - ( "256", "F256PME", "NUMS256E", "29", "1", "0", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "128"), - ( "384", "F384PM", "NUMS384W", "29", "1", "-4", "PSEUDO_MERSENNE", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "192"), - ( "384", "F384PM", "NUMS384E", "29", "1", "0", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "192"), - ( "512", "F512PM", "NUMS512W", "29", "1", "-4", "PSEUDO_MERSENNE", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "256"), - ( "512", "F512PM", "NUMS512E", "29", "1", "0", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "256"), - # ,"1", for SVDW - # set for SSWU plus isogenies - ( "256", "SECP256K1", "SECP256K1", "28", "1",["-11", "3"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "NOT_PF", "", "", "", "", "128"), - ( "256", "SM2", "SM2", "28", "1", "-9", "NOT_SPECIAL", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128"), - ( "255", "F25519", "C13318", "29", "2", "2", "PSEUDO_MERSENNE", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128"), - ( "255", "JUBJUB", "JUBJUB", "29", "32", "1", "NOT_SPECIAL", "5", "EDWARDS", "-1", "NOT_PF", "", "", "", "", "128"), - ( "448", "F448", "X448", "29", "1", "0", "GENERALISED_MERSENNE", "0", "MONTGOMERY", "156326", "NOT_PF", "", "", "", "", "256"), - ( "160", "SECP160R1", "SECP160R1", "29", "1", "3", "NOT_SPECIAL", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128"), - ( "251", "C1174", "C1174", "29", "1", "0", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "128"), - ( "166", "C1665", "C1665", "29", "1", "0", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "128"), - ( "256", "MDC", "MDC", "28", "1", "0", "NOT_SPECIAL", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "128"), - ( "255", "TWEEDLEDUM", "TWEEDLEDUM", "29", "33", "1", "NOT_SPECIAL", "5", "WEIERSTRASS", "0", "NOT_PF", "", "", "", "", "128"), - ( "255", "TWEEDLEDEE", "TWEEDLEDEE", "29", "34", "1", "NOT_SPECIAL", "5", "WEIERSTRASS", "0", "NOT_PF", "", "", "", "", "128") - ) - - pf_curves = ( - ( "254", "BN254", "BN254", "28", "1",["-1", "-1", "0"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BN_CURVE", "D_TYPE", "NEGATIVEX", "71", "66", "128"), - ( "254", "BN254CX", "BN254CX", "28", "1",["-1", "-1", "0"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BN_CURVE", "D_TYPE", "NEGATIVEX", "76", "66", "128"), - ( "383", "BLS12383", "BLS12383", "29", "1",["1", "1", "0"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS12_CURVE", "M_TYPE", "POSITIVEX", "68", "65", "128"), - # ["-3" ,"-1", "0"] for SVDW - # set for SSWU plus isogenies - ( "381", "BLS12381", "BLS12381", "29", "1",["11", "-2", "-1", "11", "3"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS12_CURVE", "M_TYPE", "NEGATIVEX", "69", "65", "128"), - ( "256", "FP256BN", "FP256BN", "28", "1",["1", "1", "0"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BN_CURVE", "M_TYPE", "NEGATIVEX", "83", "66", "128"), - ( "512", "FP512BN", "FP512BN", "29", "1",["1", "1", "0"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BN_CURVE", "M_TYPE", "POSITIVEX", "172", "130", "128"), - ( "443", "BLS12443", "BLS12443", "29", "1",["-7", "1", "1", "11", "3"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS12_CURVE", "M_TYPE", "POSITIVEX", "78", "75", "128"), - # https://eprint.iacr.org/2017/334.pdf - ( "461", "BLS12461", "BLS12461", "28", "1",["1", "4", "0"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS12_CURVE", "M_TYPE", "NEGATIVEX", "79", "78", "128"), - ( "462", "BN462", "BN462", "28", "1",["1","1","0"],"NOT_SPECIAL", "1", "WEIERSTRASS", "0", "BN_CURVE", "D_TYPE", "POSITIVEX", "125", "118", "128"), - ( "479", "BLS24479", "BLS24479", "29", "1",["1", "4", "0"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS24_CURVE", "M_TYPE", "POSITIVEX", "52", "49", "192"), - ( "556", "BLS48556", "BLS48556", "29", "1",["-1", "2", "0"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS48_CURVE", "M_TYPE", "POSITIVEX", "35", "32", "256"), - ( "581", "BLS48581", "BLS48581", "29", "1",["2", "2", "0"],"NOT_SPECIAL", "10", "WEIERSTRASS", "0", "BLS48_CURVE", "D_TYPE", "NEGATIVEX", "36", "33", "256"), - ( "286", "BLS48286", "BLS48286", "29", "1",["1", "1", "0"],"NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS48_CURVE", "M_TYPE", "POSITIVEX", "20", "17", "128"), - ( "158", "BN158", "BN158", "28","1",["1", "1", "0"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0","BN_CURVE","M_TYPE","NEGATIVEX","49","42","128") - ) - - # There are choices here, different ways of getting the same result, but some faster than others - rsa_params = ( - # 256 is slower but may allow reuse of 256-bit BIGs used for elliptic curve - # 512 is faster.. but best is 1024 - #("1024", "RSA2048", "28", "2"), - ("512","RSA2048","29","4"), - #("256","RSA2048","29","8"), - ("384", "RSA3072", "28", "8"), - #("256","RSA4096","29","16"), - ("512", "RSA4096", "29", "8") - ) - - total_entries = len(np_curves)+len(pf_curves)+len(rsa_params) - - def valid_query(number): - return number >= 0 and number <= miracl_crypto.total_entries - -def interactive_prompt_print(): - index = 1 - print("Elliptic Curves") - for tuple in miracl_crypto.np_curves: - print(str(index) + ".", tuple[2]) - index += 1 - - print("\nPairing-Friendly Elliptic Curves") - for tuple in miracl_crypto.pf_curves: - print(str(index) + ".", tuple[2]) - index += 1 - - print("\nRSA") - for tuple in miracl_crypto.rsa_params: - print(str(index) + ".", tuple[1]) - index += 1 - -def interactive_prompt_exect(index): - index -= 1 # Python internally is zero-indexed - if index < len(miracl_crypto.np_curves): - tuple = miracl_crypto.np_curves[index] - curveset( - tuple[0], tuple[1], tuple[2], tuple[3], tuple[4], - tuple[5], tuple[6], tuple[7], tuple[8], tuple[9], - tuple[10], tuple[11], tuple[12], - tuple[13], tuple[14], tuple[15] - ) - elif index < len(miracl_crypto.np_curves) + len(miracl_crypto.pf_curves): - tuple = miracl_crypto.pf_curves[index-len(miracl_crypto.np_curves)] - curveset( - tuple[0], tuple[1], tuple[2], tuple[3], tuple[4], - tuple[5], tuple[6], tuple[7], tuple[8], tuple[9], - tuple[10], tuple[11], tuple[12], - tuple[13], tuple[14], tuple[15] - ) - else: - tuple = miracl_crypto.rsa_params[index-(len(miracl_crypto.np_curves)+len(miracl_crypto.pf_curves))] - rsaset( - tuple[0], tuple[1], tuple[2], tuple[3] - ) - -def interactive_prompt_input(): - while True: - userInput = input("\nChoose schemes to support (select 0 to finish): ") - try: - return int(userInput) - except: - if (userInput == ''): - return 0 - print("Non-integer input, select values between 1 and " + str(miracl_crypto.total_entries)) - interactive_prompt_input() - -interactive_prompt_print() -while keep_querying and not testing: - query_val = -1 - while not miracl_crypto.valid_query(query_val): - query_val = interactive_prompt_input() - if not miracl_crypto.valid_query(query_val): - print("Number out of range, select values between 1 and " + str(miracl_crypto.total_entries)) - elif query_val == 0: - keep_querying = False - else: - interactive_prompt_exect(query_val) - -if testing: - for i in range(0, miracl_crypto.total_entries): - interactive_prompt_exect(i+1) - -# create library -miracl_compile.compile_file(3, "randapi.cpp") -miracl_compile.compile_file(3, "hash.cpp") -miracl_compile.compile_file(3, "hmac.cpp") -miracl_compile.compile_file(3, "rand.cpp") -miracl_compile.compile_file(3, "oct.cpp") -miracl_compile.compile_file(3, "share.cpp") -miracl_compile.compile_file(3, "aes.cpp") -miracl_compile.compile_file(3, "gcm.cpp") -miracl_compile.compile_file(3, "newhope.cpp") -miracl_compile.compile_file(3, "dilithium.cpp") -miracl_compile.compile_file(3, "kyber.cpp") -miracl_compile.compile_file(3, "x509.cpp") - -if sys.platform.startswith("win") : - os.system("for %i in (*.o) do @echo %~nxi >> f.list") - os.system("ar rc core.a @f.list") - delete_file("f.list") -else : - os.system("ar rc core.a *.o") - -if testing : - miracl_compile.compile_binary(2, "testecc.cpp", "core.a", "testecc") - miracl_compile.compile_binary(2, "testeddsa.cpp", "core.a", "testeddsa") - miracl_compile.compile_binary(2, "testmpin.cpp", "core.a", "testmpin") - miracl_compile.compile_binary(2, "testbls.cpp", "core.a", "testbls") - miracl_compile.compile_binary(2, "benchtest_all.cpp", "core.a", "benchtest_all") - miracl_compile.compile_binary(2, "testnhs.cpp", "core.a", "testnhs") - miracl_compile.compile_binary(2, "testdlthm.cpp", "core.a", "testdlthm") - miracl_compile.compile_binary(2, "testkyber.cpp", "core.a", "testkyber") - -#clean up -for file in generated_files: - delete_file(file) - -delete_file("*.o") -delete_file("big.*") -delete_file("fp.*") -delete_file("ecp.*") -delete_file("ecdh.*") -delete_file("hpke.*") -delete_file("ff.*") -delete_file("rsa.*") -delete_file("config_big.h") -delete_file("config_field.h") -delete_file("config_curve.h") -delete_file("config_ff.h") -delete_file("fp2.*") -delete_file("fp4.*") -delete_file("fp8.*") -delete_file("fp16.*") -delete_file("share.cpp") -delete_file("x509.cpp") -delete_file("gcm.cpp") -delete_file("hash.cpp") -delete_file("hmac.cpp") -delete_file("aes.cpp") -delete_file("oct.cpp"); -delete_file("newhope.cpp") -delete_file("dilithium.cpp") -delete_file("kyber.cpp") -delete_file("Doxyfile") -delete_file("refman.pdf") -delete_file("readme.md") -delete_file("rand.cpp") -delete_file("randapi.cpp") -delete_file("config*.py") - -delete_file("fp12.*") -delete_file("fp24.*") -delete_file("fp48.*") - -delete_file("ecp2.*") -delete_file("ecp4.*") -delete_file("ecp8.*") - -delete_file("pair.*") -delete_file("mpin.*") -delete_file("bls.*") - -delete_file("pair4.*") -delete_file("mpin192.*") -delete_file("bls192.*") - -delete_file("pair8.*") -delete_file("mpin256.*") -delete_file("bls256.*") - -delete_file("rom_field*.cpp") -delete_file("rom_curve*.cpp") - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config64.py b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config64.py deleted file mode 100644 index b25021b..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/config64.py +++ /dev/null @@ -1,1036 +0,0 @@ -#!/usr/bin/env python3 - -# -# Copyright (c) 2012-2020 MIRACL UK Ltd. -# -# This file is part of MIRACL Core -# (see https://github.com/miracl/core). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import os -import sys -import getopt -import shutil -import fnmatch - -intr=False -arg_options=False -testing=False -fast_fail=True -keep_querying=True -ignore_variables=False - -my_compiler = "g++" -generated_files = [] - -def copy_keep_file(file, target): - shutil.copyfile(file, target) - -def copy_temp_file(file, target): - shutil.copyfile(file, target) - generated_files.append(target) - -def delete_file(expression): - for root, dirs, files in os.walk(os.path.abspath(os.path.dirname(__file__))): - for name in files: - if fnmatch.fnmatch(name, expression): - os.remove(os.path.join(root, name)) - -def request_compile(compiler_path, cflags, optim, file, lib, bin): - flags = " -std=c++11" - if optim != 0: - flags += " -O%d" % optim - if cflags != None: - flags += " %s" % cflags - if lib == None and bin == None: - flags += " -c %s" % (file) - else: - if sys.platform.startswith("win"): - bin += ".exe" - flags += " %s %s -o %s" % (file, lib, bin) - print("Processing " + file + "..", end = "", flush=True) - if sys.platform.startswith("win") : - os.system(compiler_path + flags) - print(". [DONE]") - else : - if os.WEXITSTATUS(os.system(compiler_path + flags)) == 0: - print(". [DONE]") - elif fast_fail: - print("unable to process. Fast-fail enabled, quitting!") - sys.exit(1) - else: - print(". [ERROR]") - -class miracl_compile: - def compile_file(optim, file): - if (os.environ.get('CXX') != None and not ignore_variables): - request_compile(os.environ.get('CXX'), os.environ.get('CXXFLAGS'), optim, file, None, None) - else: - request_compile(my_compiler, None, optim, file, None, None) - - def compile_binary(optim, file, lib, bin): - if (os.environ.get('CXX') != None and not ignore_variables): - request_compile(os.environ.get('CXX'), os.environ.get('CXXFLAGS'), optim, file, lib, bin) - else: - request_compile(my_compiler, None, optim, file, lib, bin) - - -def inline_mul1(N,base) : - str="" - str+="\tt=(dchunk)a[0]*b[0]; c[0]=(chunk)t & BMASK_XXX; t=t>>BASEBITS_XXX;\n" - - for i in range(1,N) : - k=0; - str+="\tt=t" - while (k<=i) : - str+="+(dchunk)a[{}]*b[{}]".format(k,i-k) - k+=1 - str+="; c[{}]=(chunk)t & BMASK_XXX; ".format(i) - str+="t=t>>BASEBITS_XXX;\n" - - for i in range(N,2*N-1) : - k=i-(N-1) - str+="\tt=t" - while (k<=N-1) : - str+="+(dchunk)a[{}]*b[{}]".format(k,i-k) - k+=1 - str+="; c[{}]=(chunk)t & BMASK_XXX; ".format(i) - str+="t=t>>BASEBITS_XXX;\n" - - str+="\tc[{}]=(chunk)t;\n".format(2*N-1) - - return str.replace("XXX",base) - -def inline_mul2(N,base) : - str="" - for i in range(0,N) : - str+="\td[{}]=(dchunk)a[{}]*b[{}];\n".format(i, i, i) - str+="\n\ts=d[0];\n\tt = s; c[0]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX;\n" - for k in range(1,N) : - str+="\ts+=d[{}]; t=co+s ".format(k) - for i in range(k,int(k/2),-1) : - str+="+(dchunk)(a[{}]-a[{}])*(b[{}]-b[{}])".format(i,k - i, k - i, i) - str+="; c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n".format(k) - str+="\n" - for k in range(N,2 * N - 1) : - str+="\ts-=d[{}]; t=co+s ".format(k - N) - for i in range(N-1,int(k/2),-1) : - str+="+(dchunk)(a[{}]-a[{}])*(b[{}]-b[{}])".format(i, k - i, k - i, i) - str+="; c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n".format(k) - - str+="\tc[{}]=(chunk)co;\n".format(2 * N - 1) - return str.replace("XXX",base) - -def inline_sqr(N,base) : - str="" - str+="\n\tt=(dchunk)a[0]*a[0]; c[0]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX;\n" - - for k in range(1,N) : - str+="\tt= " - for i in range(k,int(k/2),-1) : - str+="+(dchunk)a[{}]*a[{}]".format(i, k - i) - str+="; t+=t; t+=co;" - if k % 2 == 0 : - str+=" t+=(dchunk)a[{}]*a[{}];".format(int(k/2), int(k/2)) - str+=" c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n".format(k) - str+="\n" - - for k in range(N,2*N-2) : - str+="\tt= " - for i in range(N-1,int(k/2),-1) : - str+="+(dchunk)a[{}]*a[{}]".format(i, k - i) - str+="; t+=t; t+=co;" - if k % 2 == 0 : - str+=" t+=(dchunk)a[{}]*a[{}];".format(int(k/2),int(k/2)) - str+=" c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n".format(k) - - str+="\tt=co; t+=(dchunk)a[{}]*a[{}]; c[{}]=(chunk)t&BMASK_XXX; co=t>>BASEBITS_XXX; \n ".format(N-1,N-1,2*N-2) - - str+="\tc[{}]=(chunk)co;\n".format(2 * N - 1) - return str.replace("XXX",base) - -def inline_redc2(N,base) : - str="" - str+="\tt=d[0]; v[0]=((chunk)t*MC)&BMASK_XXX; t+=(dchunk)v[0]*md[0]; s=0; c=(t>>BASEBITS_XXX);\n\n" - - for k in range(1,N) : - str+="\tt=d[{}]+c+s+(dchunk)v[0]*md[{}]".format(k, k) - for i in range(k-1,int(k/2),-1) : - str+="+(dchunk)(v[{}]-v[{}])*(md[{}]-md[{}])".format(k - i, i, i, k - i) - str+="; v[{}]=((chunk)t*MC)&BMASK_XXX; t+=(dchunk)v[{}]*md[0]; ".format(k, k) - str+=" dd[{}]=(dchunk)v[{}]*md[{}]; s+=dd[{}]; c=(t>>BASEBITS_XXX); \n".format(k, k, k, k) - - str+="\n" - for k in range(N,2*N-1) : - str+="\tt=d[{}]+c+s".format(k) - for i in range(N-1,int(k/2),-1) : - str+="+(dchunk)(v[{}]-v[{}])*(md[{}]-md[{}])".format(k - i, i, i, k - i) - str+="; a[{}]=(chunk)t&BMASK_XXX; s-=dd[{}]; c=(t>>BASEBITS_XXX); \n".format(k - N, k - N + 1) - - str+="\ta[{}]=d[{}]+((chunk)c&BMASK_XXX);\n".format(N-1,2*N-1) - return str.replace("XXX",base) - -def inline_redc1(N,base) : - str="" - - str+="\tt = d[0];\n" - str+="\tv[0] = ((chunk)t * MC)&BMASK_XXX;\n" - str+="\tt += (dchunk)v[0] * md[0];\n" - str+="\tt = (t >> BASEBITS_XXX) + d[1];\n" - - for i in range(1,N) : - k=1 - str+="\tt += (dchunk)v[0] * md[{}] ".format(i) - while k 0 : - replace(fnameh,"@TW@","POSITOWER") - else : - replace(fnameh,"@TW@","NEGATOWER") - - ib=int(base) - inb=int(nb) - inbt=int(nbt) - nlen=(1+((8*inb-1)//ib)) - sh=ib*nlen-inbt - - if sh > 30 : - sh=30 - replace(fnameh,"@SH@",str(sh)) - - fnameh="config_curve_"+tc+".h" - copy_keep_file("config_curve.h", fnameh) - - replace(fnameh,"XXX",bd) - replace(fnameh,"YYY",tf) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"@CT@",ct) - replace(fnameh,"@CA@",ca) - replace(fnameh,"@PF@",pf) - - replace(fnameh,"@ST@",stw) - replace(fnameh,"@SX@",sx) - replace(fnameh,"@CS@",cs) - replace(fnameh,"@AB@",ab) - replace(fnameh,"@G2@",g2) - - replace(fnameh,"@HC@",hc) - replace(fnameh,"@HC2@",hc2) - - fnamec="big_"+bd+".cpp" - fnameh="big_"+bd+".h" - - copy_temp_file("big.cpp", fnamec) - copy_keep_file("big.h", fnameh) - - replace(fnamec,"XXX",bd) - replace(fnameh,"XXX",bd) - - replace(fnamec,"INLINE_MUL1",inline_mul1(nlen,bd)) - replace(fnamec,"INLINE_MUL2",inline_mul2(nlen,bd)) - replace(fnamec,"INLINE_SQR",inline_sqr(nlen,bd)) - replace(fnamec,"INLINE_REDC1",inline_redc1(nlen,bd)) - replace(fnamec,"INLINE_REDC2",inline_redc2(nlen,bd)) - - - miracl_compile.compile_file(3, fnamec) - - fnamec="fp_"+tf+".cpp" - fnameh="fp_"+tf+".h" - - copy_temp_file("fp.cpp", fnamec) - copy_keep_file("fp.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - miracl_compile.compile_file(3, "rom_field_"+tf+".cpp"); - - fnamec="ecp_"+tc+".cpp" - fnameh="ecp_"+tc+".h" - - copy_temp_file("ecp.cpp", fnamec) - copy_keep_file("ecp.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="ecdh_"+tc+".cpp" - fnameh="ecdh_"+tc+".h" - - copy_temp_file("ecdh.cpp", fnamec) - copy_keep_file("ecdh.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="eddsa_"+tc+".cpp" - fnameh="eddsa_"+tc+".h" - - copy_temp_file("eddsa.cpp", fnamec) - copy_keep_file("eddsa.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - - fnamec="hpke_"+tc+".cpp" - fnameh="hpke_"+tc+".h" - - copy_temp_file("hpke.cpp", fnamec) - copy_keep_file("hpke.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - miracl_compile.compile_file(3, "rom_curve_"+tc+".cpp"); - - if pf != "NOT_PF" : - fnamec="fp2_"+tf+".cpp" - fnameh="fp2_"+tf+".h" - - copy_temp_file("fp2.cpp", fnamec) - copy_keep_file("fp2.h", fnameh) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="fp4_"+tf+".cpp" - fnameh="fp4_"+tf+".h" - - copy_temp_file("fp4.cpp", fnamec) - copy_keep_file("fp4.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - if pf == "BN_CURVE" or pf == "BLS12_CURVE" : - fnamec="fp12_"+tf+".cpp" - fnameh="fp12_"+tf+".h" - - copy_temp_file("fp12.cpp", fnamec) - copy_keep_file("fp12.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - fnamec="ecp2_"+tc+".cpp" - fnameh="ecp2_"+tc+".h" - - copy_temp_file("ecp2.cpp", fnamec) - copy_keep_file("ecp2.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="pair_"+tc+".cpp" - fnameh="pair_"+tc+".h" - - copy_temp_file("pair.cpp", fnamec) - copy_keep_file("pair.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="mpin_"+tc+".cpp" - fnameh="mpin_"+tc+".h" - - copy_temp_file("mpin.cpp", fnamec) - copy_keep_file("mpin.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="bls_"+tc+".cpp" - fnameh="bls_"+tc+".h" - - copy_temp_file("bls.cpp", fnamec) - copy_keep_file("bls.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - if pf == "BLS24_CURVE" : - fnamec="fp8_"+tf+".cpp" - fnameh="fp8_"+tf+".h" - - copy_temp_file("fp8.cpp", fnamec) - copy_keep_file("fp8.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - - fnamec="fp24_"+tf+".cpp" - fnameh="fp24_"+tf+".h" - - copy_temp_file("fp24.cpp", fnamec) - copy_keep_file("fp24.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - fnamec="ecp4_"+tc+".cpp" - fnameh="ecp4_"+tc+".h" - - copy_temp_file("ecp4.cpp", fnamec) - copy_keep_file("ecp4.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="pair4_"+tc+".cpp" - fnameh="pair4_"+tc+".h" - - copy_temp_file("pair4.cpp", fnamec) - copy_keep_file("pair4.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="mpin192_"+tc+".cpp" - fnameh="mpin192_"+tc+".h" - - copy_temp_file("mpin192.cpp", fnamec) - copy_keep_file("mpin192.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="bls192_"+tc+".cpp" - fnameh="bls192_"+tc+".h" - - copy_temp_file("bls192.cpp", fnamec) - copy_keep_file("bls192.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - if pf == "BLS48_CURVE" : - - fnamec="fp8_"+tf+".cpp" - fnameh="fp8_"+tf+".h" - - copy_temp_file("fp8.cpp", fnamec) - copy_keep_file("fp8.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - - fnamec="ecp8_"+tc+".cpp" - fnameh="ecp8_"+tc+".h" - - copy_temp_file("ecp8.cpp", fnamec) - copy_keep_file("ecp8.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - - fnamec="fp16_"+tf+".cpp" - fnameh="fp16_"+tf+".h" - - copy_temp_file("fp16.cpp", fnamec) - copy_keep_file("fp16.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - - fnamec="fp48_"+tf+".cpp" - fnameh="fp48_"+tf+".h" - - copy_temp_file("fp48.cpp", fnamec) - copy_keep_file("fp48.h", fnameh) - - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnamec,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - replace(fnameh,"ZZZ",tc) - miracl_compile.compile_file(3, fnamec) - - - fnamec="pair8_"+tc+".cpp" - fnameh="pair8_"+tc+".h" - - copy_temp_file("pair8.cpp", fnamec) - copy_keep_file("pair8.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="mpin256_"+tc+".cpp" - fnameh="mpin256_"+tc+".h" - - copy_temp_file("mpin256.cpp", fnamec) - copy_keep_file("mpin256.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - - fnamec="bls256_"+tc+".cpp" - fnameh="bls256_"+tc+".h" - - copy_temp_file("bls256.cpp", fnamec) - copy_keep_file("bls256.h", fnameh) - - replace(fnamec,"ZZZ",tc) - replace(fnamec,"YYY",tf) - replace(fnamec,"XXX",bd) - replace(fnameh,"ZZZ",tc) - replace(fnameh,"YYY",tf) - replace(fnameh,"XXX",bd) - miracl_compile.compile_file(3, fnamec) - -class miracl_crypto: - np_curves = ( - ( "255", "F25519", "Ed25519", "56", "2", "1", "PSEUDO_MERSENNE", "0", "EDWARDS", "-1", "NOT_PF", "", "", "", "", "128" ), - ( "255", "F25519", "C25519", "56", "2", "1", "PSEUDO_MERSENNE", "0", "MONTGOMERY", "486662", "NOT_PF", "", "", "", "", "128" ), - ( "256", "NIST256", "NIST256", "56", "1", "-10", "NOT_SPECIAL", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128" ), - ( "256", "BRAINPOOL", "BRAINPOOL", "56", "1", "-3", "NOT_SPECIAL", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128" ), - ( "256", "ANSSI", "ANSSI", "56", "1", "-5", "NOT_SPECIAL", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128" ), - ( "336", "HIFIVE", "HIFIVE", "60", "2", "1", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "192" ), - ( "448", "F448", "Ed448", "58", "1", "0", "GENERALISED_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "256" ), - ( "384", "NIST384", "NIST384", "56", "1", "-12", "NOT_SPECIAL", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "192" ), - ( "414", "C41417", "C41417", "60", "1", "1", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "256" ), - ( "521", "NIST521", "NIST521", "60", "1", "-4", "PSEUDO_MERSENNE", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "256" ), - ( "256", "F256PMW", "NUMS256W", "56", "1", "7", "PSEUDO_MERSENNE", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128" ), - ( "256", "F256PME", "NUMS256E", "56", "1", "0", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "128" ), - ( "384", "F384PM", "NUMS384W", "58", "1", "-4", "PSEUDO_MERSENNE", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "192" ), - ( "384", "F384PM", "NUMS384E", "58", "1", "0", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "192" ), - ( "512", "F512PM", "NUMS512W", "60", "1", "-4", "PSEUDO_MERSENNE", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "256" ), - ( "512", "F512PM", "NUMS512E", "60", "1", "0", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "256" ), - # ,"1", for SVDW - # set for SSWU plus isogenies - ( "256", "SECP256K1", "SECP256K1", "56", "1",["-11", "3"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0", "NOT_PF", "", "", "", "", "128" ), - ( "256", "SM2", "SM2", "56", "1", "-9", "NOT_SPECIAL", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128" ), - ( "255", "F25519", "C13318", "56", "2", "2", "PSEUDO_MERSENNE", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128" ), - ( "255", "JUBJUB", "JUBJUB", "56", "32", "1", "NOT_SPECIAL", "5", "EDWARDS", "-1", "NOT_PF", "", "", "", "", "128" ), - ( "448", "F448", "X448", "58", "1", "0", "GENERALISED_MERSENNE", "0", "MONTGOMERY", "156326", "NOT_PF", "", "", "", "", "256" ), - ( "160", "SECP160R1", "SECP160R1", "56", "1", "3", "NOT_SPECIAL", "0", "WEIERSTRASS", "-3", "NOT_PF", "", "", "", "", "128" ), - ( "251", "C1174", "C1174", "56", "1", "0", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "128" ), - ( "166", "C1665", "C1665", "60", "1", "0", "PSEUDO_MERSENNE", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "128" ), - ( "256", "MDC", "MDC", "56", "1", "0", "NOT_SPECIAL", "0", "EDWARDS", "1", "NOT_PF", "", "", "", "", "128" ), - ( "255", "TWEEDLEDUM", "TWEEDLEDUM", "56", "33", "1", "NOT_SPECIAL", "5", "WEIERSTRASS", "0", "NOT_PF", "", "", "", "", "128" ), - ( "255", "TWEEDLEDEE", "TWEEDLEDEE", "56", "34", "1", "NOT_SPECIAL", "5", "WEIERSTRASS", "0", "NOT_PF", "", "", "", "", "128" ) - ) - - pf_curves = ( - ( "254", "BN254", "BN254", "56", "1",["-1", "-1", "0"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BN_CURVE", "D_TYPE", "NEGATIVEX", "71", "66", "128" ), - ( "254", "BN254CX", "BN254CX", "56", "1",["-1", "-1", "0"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BN_CURVE", "D_TYPE", "NEGATIVEX", "76", "66", "128" ), - ( "383", "BLS12383", "BLS12383", "58", "1",["1", "1", "0"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS12_CURVE", "M_TYPE", "POSITIVEX", "68", "65", "128" ), - # ["-3" ,"-1", "0"] for SVDW - # set for SSWU plus isogenies - ( "381", "BLS12381", "BLS12381", "58", "1",["11", "-2", "-1", "11", "3"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS12_CURVE", "M_TYPE", "NEGATIVEX", "69", "65", "128" ), - ( "256", "FP256BN", "FP256BN", "56", "1",["1", "1", "0"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BN_CURVE", "M_TYPE", "NEGATIVEX", "83", "66", "128" ), - ( "512", "FP512BN", "FP512BN", "60", "1",["1", "1", "0"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BN_CURVE", "M_TYPE", "POSITIVEX", "172", "130", "128" ), - ( "443", "BLS12443", "BLS12443", "60", "1",["-7", "1", "1", "11", "3"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS12_CURVE", "M_TYPE", "POSITIVEX", "78", "75", "128" ), - # https://eprint.iacr.org/2017/334.pdf - ( "461", "BLS12461", "BLS12461", "60", "1",["1", "4", "0"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS12_CURVE", "M_TYPE", "NEGATIVEX", "79", "78", "128" ), - ( "462", "BN462", "BN462", "60", "1",["1", "1", "0"], "NOT_SPECIAL", "1", "WEIERSTRASS", "0", "BN_CURVE", "D_TYPE", "POSITIVEX", "125", "118", "128" ), - ( "479", "BLS24479", "BLS24479", "56", "1",["1", "4", "0"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS24_CURVE", "M_TYPE", "POSITIVEX", "52", "49", "192" ), - ( "556", "BLS48556", "BLS48556", "58", "1",["-1", "2", "0"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS48_CURVE", "M_TYPE", "POSITIVEX", "35", "32", "256" ), - ( "581", "BLS48581", "BLS48581", "60", "1",["2", "2", "0"], "NOT_SPECIAL", "10", "WEIERSTRASS", "0", "BLS48_CURVE", "D_TYPE", "NEGATIVEX", "36", "33", "256" ), - ( "286", "BLS48286", "BLS48286", "60", "1",["1", "1", "0"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0", "BLS48_CURVE", "M_TYPE", "POSITIVEX", "20", "17", "128" ), - ( "158", "BN158", "BN158", "56","1",["1", "1", "0"], "NOT_SPECIAL", "0", "WEIERSTRASS", "0","BN_CURVE","M_TYPE","NEGATIVEX","49","42","128") - ) - - # There are choices here, different ways of getting the same result, but some faster than others - rsa_params = ( - # 256 is slower but may allow reuse of 256-bit BIGs used for elliptic curve - # 512 is faster.. but best is 1024 - #("1024", "RSA2048", "58", "2"), - ("512", "RSA2048", "60", "4"), - #("256", "RSA2048", "56", "8"), - ("384", "RSA3072", "56", "8"), - #("256", "RSA4096", "56", "16"), - ("512", "RSA4096", "60", "8") - ) - - min_core_library = ( - "randapi.cpp", - "hash.cpp", - "hmac.cpp", - "rand.cpp", - "oct.cpp", - "share.cpp", - "aes.cpp", - "gcm.cpp", - "newhope.cpp", - "dilithium.cpp", - "kyber.cpp", - "x509.cpp" - ) - - total_entries = len(np_curves)+len(pf_curves)+len(rsa_params) - - def valid_query(number): - return number >= 0 and number <= miracl_crypto.total_entries - -def interactive_prompt_print(): - index = 1 - print("Elliptic Curves") - for tuple in miracl_crypto.np_curves: - print(str(index) + ".", tuple[2]) - index += 1 - - print("\nPairing-Friendly Elliptic Curves") - for tuple in miracl_crypto.pf_curves: - print(str(index) + ".", tuple[2]) - index += 1 - - print("\nRSA") - for tuple in miracl_crypto.rsa_params: - print(str(index) + ".", tuple[1]) - index += 1 - -def interactive_prompt_exect(index): - index -= 1 # Python internally is zero-indexed - if index < len(miracl_crypto.np_curves): - tuple = miracl_crypto.np_curves[index] - curveset( - tuple[0], tuple[1], tuple[2], tuple[3], tuple[4], - tuple[5], tuple[6], tuple[7], tuple[8], tuple[9], - tuple[10], tuple[11], tuple[12], - tuple[13], tuple[14], tuple[15] - ) - #curve_selected=True - elif index < len(miracl_crypto.np_curves) + len(miracl_crypto.pf_curves): - tuple = miracl_crypto.pf_curves[index-len(miracl_crypto.np_curves)] - curveset( - tuple[0], tuple[1], tuple[2], tuple[3], tuple[4], - tuple[5], tuple[6], tuple[7], tuple[8], tuple[9], - tuple[10], tuple[11], tuple[12], - tuple[13], tuple[14], tuple[15] - ) - #pfcurve_selected=True - else: - tuple = miracl_crypto.rsa_params[index-(len(miracl_crypto.np_curves)+len(miracl_crypto.pf_curves))] - rsaset( - tuple[0], tuple[1], tuple[2], tuple[3] - ) - #rsa_selected=True - -def interactive_prompt_input(): - while True: - userInput = input("\nChoose schemes to support (select 0 to finish): ") - try: - return int(userInput) - except: - if (userInput == ''): - return 0 - print("Non-integer input, select values between 1 and " + str(miracl_crypto.total_entries)) - interactive_prompt_input() - -def usage(): - print("Usage: ./config64.py [OPTIONS] [ARGUMENTS]\n") - print("Option Long Option Action") - print(" -h, -? --help Shows this message\n") - print("Script Behaviour:") - print(" -d --disable-fastfail Disable script termination if build fails (default: false)") - print(" -i --ignore-environment Do not read environment variables, rely on shell instead (default: false)\n") - print("Build Configuration:") - print(" -o --options=1 --options=64 Disable interactive mode and select specific options") - print(" -r --run-tests Disable interactive mode, select all options, build and run tests") - print(" (implies --disable-fastfail, --ignore-environment)\n") - -def arg_manager(argv, build_options): - global testing, arg_options, fast_fail, intr, ignore_variables - # Account for legacy behaviour - # Should be removed in future releases - if len(argv) == 0: - intr = True - return False - if len(argv) == 1: - if (argv[0] == "test"): - testing = True - return False - # Now let's try to actually make sense of arguments - try: - opts, args = getopt.getopt( - argv, - "hdiro:", - ["help", "disable-fastfail", "ignore-environment", "run-tests", "options="] - ) - except getopt.GetoptError as err: - print(err) - usage() - sys.exit(2) - - for opt, arg in opts: - if opt in ['-h', '--help']: - usage() - sys.exit(0) - elif opt in ['-d', '--disable-fastfail']: - fast_fail = False - elif opt in ['-i', '--ignore-environment']: - ignore_variables = True - elif opt in ['-r', '--run-tests']: - testing = True - fast_fail = False - ignore_variables = True - elif opt in ['-o', '--options']: - arg_options = True - try: - intarg = int(arg) - if (intarg <= miracl_crypto.total_entries and intarg > 0): - build_options.append(intarg) - else: - raise ValueError("Value too low or too high!") - except: - print("config64.py: Error! You have passed an invalid option, exiting.") - print(" If you are trying to select multiple options, please repeat the flag\n") - print(" e.g. ") - print(" ./config64.py -o 1 -o 23 -o 25") - sys.exit(1) - return len(opts) > 0 and not testing and arg_options - -def main(argv): - global testing, keep_querying, my_compiler, generated_files, arg_options, intr - options_list = [] - - replace("arch.h","@WL@","64") - - if not arg_manager(argv, options_list): - if intr: - if not testing: - interactive_prompt_print() - while keep_querying and not testing: - query_val = -1 - while not miracl_crypto.valid_query(query_val): - query_val = interactive_prompt_input() - if not miracl_crypto.valid_query(query_val): - print("Number out of range, select values between 1 and " + str(miracl_crypto.total_entries)) - elif query_val == 0: - keep_querying = False - else: - interactive_prompt_exect(query_val) - elif not arg_options and not testing: - print("config64.py: Invalid input, program terminating") - sys.exit(2) - else: - for i in options_list: - interactive_prompt_exect(i) - - if testing: - for i in range(0, miracl_crypto.total_entries): - interactive_prompt_exect(i+1) - - # create library - for f in miracl_crypto.min_core_library: - miracl_compile.compile_file(3, f) - - if sys.platform.startswith("win") : - os.system("for %i in (*.o) do @echo %~nxi >> f.list") - os.system("ar rc core.a @f.list") - delete_file("f.list") - else : - os.system("ar rc core.a *.o") - - if testing : - miracl_compile.compile_binary(2, "testecc.cpp", "core.a", "testecc") - miracl_compile.compile_binary(2, "testeddsa.cpp", "core.a", "testeddsa") - miracl_compile.compile_binary(2, "testmpin.cpp", "core.a", "testmpin") - miracl_compile.compile_binary(2, "testbls.cpp", "core.a", "testbls") - miracl_compile.compile_binary(2, "benchtest_all.cpp", "core.a", "benchtest_all") - miracl_compile.compile_binary(2, "testnhs.cpp", "core.a", "testnhs") - miracl_compile.compile_binary(2, "testdlthm.cpp", "core.a", "testdlthm") - miracl_compile.compile_binary(2, "testkyber.cpp", "core.a", "testkyber") - - #clean up - for file in generated_files: - delete_file(file) - delete_file("*.o") - sys.exit(0) - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/dilithium.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/dilithium.cpp deleted file mode 100644 index dfa9849..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/dilithium.cpp +++ /dev/null @@ -1,1224 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Dilithium API implementation. Constant time where it matters. Spends nearly all of its time running SHA3. Small. - -The Matrix A is calculated on-the-fly to keep memory requirement minimal -Note that -1. A precalculated A can be included in the public key, for use by signature and verification (which blows up public key size) -2. Precalculating A for signature calculation means that the A does not have to re-calculated for each attempt to find a good signature - -Might be simpler to wait for hardware support for SHA3 before attempting further optimization! - - M.Scott 30/09/2021 -*/ - -#include "dilithium.h" - -using namespace core; - -#define round(a,b) (((a)+((b)/2))/(b)) - -// parameters for each security level -// tau,gamma1,gamma2,K,L,eta,lg(2*eta+1),omega -const int PARAMS_2[8]={39,17,88,4,4,2,3,80}; -const int PARAMS_3[8]={49,19,32,6,5,4,4,55}; -const int PARAMS_5[8]={60,19,32,8,7,2,3,75}; - -const sign32 roots[] = {0x3ffe00,0x64f7,0x581103,0x77f504,0x39e44,0x740119,0x728129,0x71e24,0x1bde2b,0x23e92b,0x7a64ae,0x5ff480,0x2f9a75,0x53db0a,0x2f7a49,0x28e527,0x299658,0xfa070,0x6f65a5,0x36b788,0x777d91,0x6ecaa1,0x27f968,0x5fb37c,0x5f8dd7,0x44fae8,0x6a84f8,0x4ddc99,0x1ad035,0x7f9423,0x3d3201,0x445c5,0x294a67,0x17620,0x2ef4cd,0x35dec5,0x668504,0x49102d,0x5927d5,0x3bbeaf,0x44f586,0x516e7d,0x368a96,0x541e42,0x360400,0x7b4a4e,0x23d69c,0x77a55e,0x65f23e,0x66cad7,0x357e1e,0x458f5a,0x35843f,0x5f3618,0x67745d,0x38738c,0xc63a8,0x81b9a,0xe8f76,0x3b3853,0x3b8534,0x58dc31,0x1f9d54,0x552f2e,0x43e6e6,0x688c82,0x47c1d0,0x51781a,0x69b65e,0x3509ee,0x2135c7,0x67afbc,0x6caf76,0x1d9772,0x419073,0x709cf7,0x4f3281,0x4fb2af,0x4870e1,0x1efca,0x3410f2,0x70de86,0x20c638,0x296e9f,0x5297a4,0x47844c,0x799a6e,0x5a140a,0x75a283,0x6d2114,0x7f863c,0x6be9f8,0x7a0bde,0x1495d4,0x1c4563,0x6a0c63,0x4cdbea,0x40af0,0x7c417,0x2f4588,0xad00,0x6f16bf,0xdcd44,0x3c675a,0x470bcb,0x7fbe7f,0x193948,0x4e49c1,0x24756c,0x7ca7e0,0xb98a1,0x6bc809,0x2e46c,0x49a809,0x3036c2,0x639ff7,0x5b1c94,0x7d2ae1,0x141305,0x147792,0x139e25,0x67b0e1,0x737945,0x69e803,0x51cea3,0x44a79d,0x488058,0x3a97d9,0x1fea93,0x33ff5a,0x2358d4,0x3a41f8,0x4cdf73,0x223dfb,0x5a8ba0,0x498423,0x412f5,0x252587,0x6d04f1,0x359b5d,0x4a28a1,0x4682fd,0x6d9b57,0x4f25df,0xdbe5e,0x1c5e1a,0xde0e6,0xc7f5a,0x78f83,0x67428b,0x7f3705,0x77e6fd,0x75e022,0x503af7,0x1f0084,0x30ef86,0x49997e,0x77dcd7,0x742593,0x4901c3,0x53919,0x4610c,0x5aad42,0x3eb01b,0x3472e7,0x4ce03c,0x1a7cc7,0x31924,0x2b5ee5,0x291199,0x585a3b,0x134d71,0x3de11c,0x130984,0x25f051,0x185a46,0x466519,0x1314be,0x283891,0x49bb91,0x52308a,0x1c853f,0x1d0b4b,0x6fd6a7,0x6b88bf,0x12e11b,0x4d3e3f,0x6a0d30,0x78fde5,0x1406c7,0x327283,0x61ed6f,0x6c5954,0x1d4099,0x590579,0x6ae5ae,0x16e405,0xbdbe7,0x221de8,0x33f8cf,0x779935,0x54aa0d,0x665ff9,0x63b158,0x58711c,0x470c13,0x910d8,0x463e20,0x612659,0x251d8b,0x2573b7,0x7d5c90,0x1ddd98,0x336898,0x2d4bb,0x6d73a8,0x4f4cbf,0x27c1c,0x18aa08,0x2dfd71,0xc5ca5,0x19379a,0x478168,0x646c3e,0x51813d,0x35c539,0x3b0115,0x41dc0,0x21c4f7,0x70fbf5,0x1a35e7,0x7340e,0x795d46,0x1a4cd0,0x645caf,0x1d2668,0x666e99,0x6f0634,0x7be5db,0x455fdc,0x530765,0x5dc1b0,0x7973de,0x5cfd0a,0x2cc93,0x70f806,0x189c2a,0x49c5aa,0x776a51,0x3bcf2c,0x7f234f,0x6b16e0,0x3c15ca,0x155e68,0x72f6b7,0x1e29ce}; -const sign32 iroots[] = {0x3ffe00,0x7f7b0a,0x7eafd,0x27cefe,0x78c1dd,0xd5ed8,0xbdee8,0x7c41bd,0x56fada,0x5065b8,0x2c04f7,0x50458c,0x1feb81,0x57b53,0x5bf6d6,0x6401d6,0x7b9a3c,0x42ae00,0x4bde,0x650fcc,0x320368,0x155b09,0x3ae519,0x20522a,0x202c85,0x57e699,0x111560,0x86270,0x492879,0x107a5c,0x703f91,0x5649a9,0x2ab0d3,0x6042ad,0x2703d0,0x445acd,0x44a7ae,0x71508b,0x77c467,0x737c59,0x476c75,0x186ba4,0x20a9e9,0x4a5bc2,0x3a50a7,0x4a61e3,0x19152a,0x19edc3,0x83aa3,0x5c0965,0x495b3,0x49dc01,0x2bc1bf,0x49556b,0x2e7184,0x3aea7b,0x442152,0x26b82c,0x36cfd4,0x195afd,0x4a013c,0x50eb34,0x7e69e1,0x56959a,0x454828,0x375fa9,0x3b3864,0x2e115e,0x15f7fe,0xc66bc,0x182f20,0x6c41dc,0x6b686f,0x6bccfc,0x2b520,0x24c36d,0x1c400a,0x4fa93f,0x3637f8,0x7cfb95,0x1417f8,0x744760,0x33821,0x5b6a95,0x319640,0x66a6b9,0x2182,0x38d436,0x4378a7,0x7212bd,0x10c942,0x7f3301,0x509a79,0x781bea,0x7bd511,0x330417,0x15d39e,0x639a9e,0x6b4a2d,0x5d423,0x13f609,0x59c5,0x12beed,0xa3d7e,0x25cbf7,0x64593,0x385bb5,0x2d485d,0x567162,0x5f19c9,0xf017b,0x4bcf0f,0x7df037,0x376f20,0x302d52,0x30ad80,0xf430a,0x3e4f8e,0x62488f,0x13308b,0x183045,0x5eaa3a,0x4ad613,0x1629a3,0x2e67e7,0x381e31,0x17537f,0x3bf91b,0x61b633,0xce94a,0x6a8199,0x43ca37,0x14c921,0xbcb2,0x4410d5,0x875b0,0x361a57,0x6743d7,0xee7fb,0x7d136e,0x22e2f7,0x66c23,0x221e51,0x2cd89c,0x3a8025,0x3fa26,0x10d9cd,0x197168,0x62b999,0x1b8352,0x659331,0x682bb,0x78abf3,0x65aa1a,0xee40c,0x5e1b0a,0x7bc241,0x44deec,0x4a1ac8,0x2e5ec4,0x1b73c3,0x385e99,0x66a867,0x73835c,0x51e290,0x6735f9,0x7d63e5,0x309342,0x126c59,0x7d0b46,0x4c7769,0x620269,0x28371,0x5a6c4a,0x5ac276,0x1eb9a8,0x39a1e1,0x76cf29,0x38d3ee,0x276ee5,0x1c2ea9,0x198008,0x2b35f4,0x846cc,0x4be732,0x5dc219,0x74041a,0x68fbfc,0x14fa53,0x26da88,0x629f68,0x1386ad,0x1df292,0x4d6d7e,0x6bd93a,0x6e21c,0x15d2d1,0x32a1c2,0x6cfee6,0x145742,0x10095a,0x62d4b6,0x635ac2,0x2daf77,0x362470,0x57a770,0x6ccb43,0x397ae8,0x6785bb,0x59efb0,0x6cd67d,0x41fee5,0x6c9290,0x2785c6,0x56ce68,0x54811c,0x7cc6dd,0x65633a,0x32ffc5,0x4b6d1a,0x412fe6,0x2532bf,0x7b7ef5,0x7aa6e8,0x36de3e,0xbba6e,0x8032a,0x364683,0x4ef07b,0x60df7d,0x2fa50a,0x9ffdf,0x7f904,0xa8fc,0x189d76,0x78507e,0x7360a7,0x71ff1b,0x6381e7,0x7221a3,0x30ba22,0x1244aa,0x395d04,0x35b760,0x4a44a4,0x12db10,0x5aba7a,0x7bcd0c,0x365bde,0x255461,0x5da206,0x33008e,0x459e09,0x5c872d,0x4be0a7,0x5ff56e}; - -/* Montgomery stuff */ - -static sign32 redc(unsign64 T) -{ - unsign32 m = (unsign32)T * (unsign32)DL_ND; - return ((unsign64)m * DL_PRIME + T) >> 32; -} - -static sign32 nres(unsign32 x) -{ - return redc((unsign64)x * DL_R2MODP); -} - -static sign32 modmul(unsign32 a, unsign32 b) -{ - return redc((unsign64)a * b); -} - -// make all elements +ve -static void poly_pos(sign32 *p) -{ - int i; - for (i=0;i>31)&DL_PRIME; -} - -// NTT code - -// Important! -// nres(x); ntt(x) -// nres(y); ntt(y) -// z=x*y -// intt(z); -// redc(z); - -// is equivalent to (note that nres() and redc() cancel out) - -// ntt(x); -// nres(y); ntt(y); -// z=x*y -// intt(z) - -// is equivalent to - -// ntt(x) -// ntt(y) -// z=x*y -// intt(z) -// nres(z) - -// In all cases z ends up in normal (non-Montgomery) form! -// So the conversion to Montgomery form can be "pushed" through the calculation. - -// Here intt(z) <- intt(z);nres(z); -// Combining is more efficient -// note that ntt() and intt() are not mutually inverse - -/* NTT code */ -/* Cooley-Tukey NTT */ -/* Excess of 2 allowed on input - coefficients must be < 2*PRIME */ - -static void ntt(sign32 *x) -{ - int m, i, j, start, len = DL_DEGREE / 2; - sign32 S, V, q = DL_PRIME; - - /* Make positive */ - poly_pos(x); - m = 1; - while (m < DL_DEGREE) - { - start = 0; - for (i = 0; i < m; i++) - { - S = roots[m + i]; - for (j = start; j < start + len; j++) - { - V = modmul(x[j + len], S); - x[j + len] = x[j] + 2 * q - V; - x[j] = x[j] + V; - } - start += 2 * len; - } - len /= 2; - m *= 2; - } -} - -/* Gentleman-Sande INTT */ -/* Excess of 2 allowed on input - coefficients must be < 2*PRIME */ -/* Output fully reduced */ -#define NTTL 1 // maybe should be 2? - -static void intt(sign32 *x) -{ - int m, i, j, k, n,lim,t = 1; - sign32 S, U, V, W, q = DL_PRIME; - - m = DL_DEGREE/2; - n=DL_LGN; - while (m >= 1) - { - lim=NTTL>>n; - n--; - k = 0; - for (i = 0; i < m; i++) - { - S = iroots[m + i]; - for (j = k; j < k + t; j++) - { -#if NTTL>1 - if (m> 31)&q; - } -} - -static void nres_it(sign32 *p) -{ - int i; - for (i = 0; i < DL_DEGREE; i++) - p[i] = nres(p[i]); -} - -static void redc_it(sign32 *p) -{ - int i; - for (i = 0; i < DL_DEGREE; i++) - p[i] = redc(p[i]); -} - -// copy polynomial -static void poly_copy(sign32 *p1, sign32 *p2) -{ - int i; - for (i = 0; i < DL_DEGREE; i++) - p1[i] = p2[i]; -} - -// copy from small polynomial -static void poly_scopy(sign32 *p1, sign8 *p2) -{ - int i; - for (i = 0; i < DL_DEGREE; i++) - p1[i] = (sign32)p2[i]; -} - -// copy from medium polynomial -static void poly_mcopy(sign32 *p1, sign16 *p2) -{ - int i; - for (i = 0; i < DL_DEGREE; i++) - p1[i] = (sign32)p2[i]; -} - -static void poly_zero(sign32 *p1) -{ - int i; - for (i = 0; i < DL_DEGREE; i++) - p1[i] = 0; -} - -static void poly_negate(sign32 *p1,sign32 *p2) -{ - int i; - for (i = 0; i < DL_DEGREE; i++) - p1[i] = DL_PRIME-p2[i]; -} - -static void poly_mul(sign32 *p1, sign32 *p2, sign32 *p3) -{ - int i; - for (i = 0; i < DL_DEGREE; i++) - p1[i] = modmul(p2[i], p3[i]); -} - -static void poly_add(sign32 *p1, sign32 *p2, sign32 *p3) -{ - int i; - for (i = 0; i < DL_DEGREE; i++) - p1[i] = (p2[i] + p3[i]); -} - -static void poly_sub(sign32 *p1, sign32 *p2, sign32 *p3) -{ - int i; - for (i = 0; i < DL_DEGREE; i++) - p1[i] = (p2[i] + DL_PRIME - p3[i]); -} - -/* reduces inputs that are already < 2q */ -static void poly_soft_reduce(sign32 *poly) -{ - int i; - sign32 e; - for (i = 0; i < DL_DEGREE; i++) - { - e = poly[i] - DL_PRIME; - poly[i] = e + ((e >> 31)&DL_PRIME); - } -} - -/* fully reduces modulo q */ -static void poly_hard_reduce(sign32 *poly) -{ - int i; - sign32 e; - for (i = 0; i < DL_DEGREE; i++) - { - e = modmul(poly[i], DL_ONE); // reduces to < 2q - e = e - DL_PRIME; - poly[i] = e + ((e >> 31)&DL_PRIME); // finishes it off - } -} - -// Generate A[i][j] from rho -static void ExpandAij(byte rho[32],sign32 Aij[],int i,int j) -{ - sha3 sh; - int m,n; - unsign32 b0,b1,b2; - sign32 cf; - SHA3_init(&sh, SHAKE128); - byte buff[840]; // should be plenty - for (m=0;m<32;m++) - SHA3_process(&sh,rho[m]); - SHA3_process(&sh,j&0xff); - SHA3_process(&sh,i&0xff); - SHA3_shake(&sh,(char *)buff,840); - m=n=0; - while (m=DL_PRIME) continue; - Aij[m++]=cf; - } -} - -// array t has ab active bits per word -// extract bytes from array of words -// if max!=0 then -max<=t[i]<=+max -static byte nextbyte32(int ab,int max,sign32 t[],int &ptr, int &bts) -{ - sign32 r,w; - int left=ab-bts; // number of bits left in this word - int i=0; - w=t[ptr]; - if (max!=0) - w=max-w; - r=w>>bts; - while (left<8) - { - i++; - w=t[ptr+i]; - if (max!=0) - w=max-w; - r|=w<=ab) - { - bts-=ab; - ptr++; - } - return (byte)r&0xff; -} - -// array t has ab active bits per word -// extract dense bytes from array of words -// if max!=0 then -max<=t[i]<=+max -static byte nextbyte16(int ab,int max,sign16 t[],int &ptr, int &bts) -{ - sign32 r,w; - int left=ab-bts; // number of bits left in this word - int i=0; - w=t[ptr]; - if (max!=0) - w=max-w; - r=w>>bts; - while (left<8) - { - i++; - w=t[ptr+i]; - if (max!=0) - w=max-w; - r|=w<=ab) - { - bts-=ab; - ptr++; - } - return (byte)r&0xff; -} - -// array t has ab active bits per word -// extract dense bytes from array of words -// if max!=0 then -max<=t[i]<=+max -static byte nextbyte8(int ab,int max,sign8 t[],int &ptr, int &bts) -{ - sign32 r,w; - int left=ab-bts; // number of bits left in this word - int i=0; - w=t[ptr]; - if (max!=0) - w=max-w; - r=w>>bts; - while (left<8) - { - i++; - w=t[ptr+i]; - if (max!=0) - w=max-w; - r|=w<=ab) - { - bts-=ab; - ptr++; - } - return (byte)r&0xff; -} - -// extract ab bits into word from dense byte stream -static sign32 nextword(const int ab,int max,byte t[],int &ptr, int &bts) -{ - sign32 r=t[ptr]>>bts; - sign32 mask=(1<=8) - { - bts-=8; - ptr++; - } - w=r&mask; - if (max!=0) - w=max-w; - return w; -} - -// pack public key -static int pack_pk(const int *params,byte pk[],byte rho[32],sign16 t1[]) -{ - int ptr,bts,i,n=0; - int ck=params[3]; - for (i=0;i<32;i++) - pk[i]=rho[i]; - n=32; ptr=bts=0; - for (i=0;i<(ck*DL_DEGREE*DL_TD)/8;i++ ) - pk[n++]=nextbyte16(DL_TD,0,t1,ptr,bts); - return n; -} - -// unpack public key -static void unpack_pk(const int *params,byte rho[32],sign16 t1[],byte pk[]) -{ - int ptr,bts,i; - int ck=params[3]; - for (i=0;i<32;i++) - rho[i]=pk[i]; - ptr=bts=0; - for (i=0;iDL_PRIME/2) t-=DL_PRIME; - t=gamma1-t; - z[row+m]=t; - } - } - for (i=0;i>8)&0xff); - SHA3_shake(&sh,(char *)buff,272); - ptr=bts=0; - for (m=0;m2*eta); - s[m]=eta-s[m]; - } -} - -// uniform random sampling -static void sample_Y(const int *params,int k,byte rhod[64],sign32 y[]) -{ - int i,j,m,ki,row,ptr,bts; // 2^n-1 - int lg=params[1]; - int gamma1=1<>8); - SHA3_shake(&sh,(char *)buff,DL_YBYTES); - - ptr=bts=0; - for (m=0;m>31; - y[row+m]=w+(DL_PRIME&t); - } - } -} - -// CRH(rho,t1) -static void CRH1(const int *params,byte H[32],byte rho[32],sign16 t1[]) -{ - int i; - int ptr,bts; - int ck=params[3]; - sha3 sh; - SHA3_init(&sh, SHAKE256); - for (i=0;i<32;i++) - SHA3_process(&sh,rho[i]); - ptr=bts=0; - for (i=0;i<(ck*DL_DEGREE*DL_TD)/8;i++) - SHA3_process(&sh,nextbyte16(DL_TD,0,t1,ptr,bts)); - SHA3_shake(&sh,(char *)H,32); -} - -// CRH(tr,M) -static void CRH2(byte H[64],byte tr[32],byte mess[],int mlen) -{ - int i; - sha3 sh; - SHA3_init(&sh, SHAKE256); - for (i=0;i<32;i++) - SHA3_process(&sh,tr[i]); - for (i=0;ii); - c[i]=c[j]; - c[j]=1-2*((sign32)sn&1); - sn>>=1; b++; - if (b==8) { - sn=signs[n++]; b=0; - } - } -} - -static sign16 p2r(sign32 *r0) -{ - sign32 d=(1<>DL_D; - *r0-=(r1 << DL_D); - return (sign16)r1; -} - -static void Power2Round(sign32 t[],sign16 t0[],sign16 t1[]) -{ - int m; - sign32 w; - for (m=0;m> 7; - - if (dv==32) - { - a1 = (a1*1025 + (1 << 21)) >> 22; - a1 &= 15; - gamma2=(DL_PRIME-1)/32; - } else { // 88 - a1 = (a1*11275 + (1 << 23)) >> 24; - a1 ^= ((43 - a1) >> 31) & a1; - gamma2=(DL_PRIME-1)/88; - } - - a0 = a - a1*2*gamma2; // (Q-1)/2R=alpha - a0 -= (((DL_PRIME-1)/2 - a0) >> 31) & DL_PRIME; - a0 += (a0>>31)&DL_PRIME; - return a0; -} - -// ALPHA = (Q-1)/16 -static sign8 decompose_hi(const int *params,sign32 a) { - int dv=params[2]; - sign32 a1; - a1 = (a + 127) >> 7; - if (dv==32) { - a1 = (a1*1025 + (1 << 21)) >> 22; - a1 &= 15; - } else { - a1 = (a1*11275 + (1 << 23)) >> 24; - a1 ^= ((43 - a1) >> 31) & a1; - } - return (sign8)a1; -} - -static void lobits(const int *params,sign32 r0[],sign32 r[]) -{ - int m; - for (m=0;m>31)&DL_PRIME); - a1=decompose_hi(params,rz); - if (a0!=a1) { - if (hptr>=omega) return omega+1; - h[hptr++]=m&0xff; - } - } - return hptr; -} - -static int UsePartialHint(const int *params,sign8 r[],byte h[],int hptr,int i,sign32 w[]) -{ - int dv=(sign8)params[2]; - int omega=params[7]; - sign8 a1,md=dv/2; - sign32 a0; - int m; - for (m=0;m=md) a1-=md; - } else { - a1--; - if (a1<0) a1+=md; - } - } - r[m]=a1; - } - return hptr; -} - -static sign32 infinity_norm(sign32 w[]) -{ - int m; - sign32 az,n=0; - for (m=0;mDL_PRIME/2) az=DL_PRIME-az; - if (az>n) n=az; - } - return n; -} - -// Dilithium API - -static void keypair(const int *params,byte *tau,octet *sk,octet *pk) -{ - int i,row,j; - sha3 sh; - byte buff[128]; - byte rho[32]; - byte rhod[64]; - byte bK[32]; - byte tr[32]; // 320 bytes - sign32 Aij[DL_DEGREE]; // 1024 bytes - sign32 w[DL_DEGREE]; // work space 1024 bytes - sign32 r[DL_DEGREE]; // work space 1024 bytes total = 12352 - - int ck=params[3]; - int el=params[4]; - -#ifdef USE_VLAS - sign8 s1[el*DL_DEGREE]; // 1280 bytes - sign8 s2[ck*DL_DEGREE]; // 1536 bytes - sign16 t0[ck*DL_DEGREE]; // 3072 bytes - sign16 t1[ck*DL_DEGREE]; // 3072 bytes -#else - sign8 s1[DL_MAXL*DL_DEGREE]; // 1280 bytes - sign8 s2[DL_MAXK*DL_DEGREE]; // 1536 bytes - sign16 t0[DL_MAXK*DL_DEGREE]; // 3072 bytes - sign16 t1[DL_MAXK*DL_DEGREE]; // 3072 bytes -#endif - SHA3_init(&sh, SHAKE256); - - for (i=0;i<32;i++) - SHA3_process(&sh,tau[i]); - SHA3_shake(&sh,(char *)buff,128); - for (i=0;i<32;i++) - { - rho[i]=buff[i]; - bK[i]=buff[i+96]; - } - for (i=0;i<64;i++) - rhod[i]=buff[32+i]; - - for (i=0;ilen=pack_pk(params,(byte *)pk->val,rho,t1); - sk->len=pack_sk(params,(byte *)sk->val,rho,bK,tr,s1,s2,t0); -} - -static int signature(const int *params,octet *sk,octet *M,octet *sig) -{ - int i,k,nh,fk,row,j; - bool badone; - byte rho[32]; - byte bK[32]; - byte ct[32]; - byte tr[32]; - byte mu[64]; - byte rhod[64]; // 288 bytes - byte hint[100]; // 61 bytes - - sign32 c[DL_DEGREE]; // 1024 bytes - sign32 w[DL_DEGREE]; // work space 1024 bytes - sign32 r[DL_DEGREE]; // work space 1024 bytes total= 21673 bytes - //sign32 Aij[DL_DEGREE]; // 1024 bytes - - int ck=params[3]; - int el=params[4]; - -#ifdef USE_VLAS - sign8 s1[el*DL_DEGREE]; // 1280 bytes - sign8 s2[ck*DL_DEGREE]; // 1536 bytes - sign16 t0[ck*DL_DEGREE]; // 3072 bytes - sign32 y[el*DL_DEGREE]; // 5120 bytes - sign32 Ay[ck*DL_DEGREE]; // 6144 bytes - sign8 w1[ck*DL_DEGREE]; // 1280 bytes -#else - sign8 s1[DL_MAXL*DL_DEGREE]; // 1280 bytes - sign8 s2[DL_MAXK*DL_DEGREE]; // 1536 bytes - sign16 t0[DL_MAXK*DL_DEGREE]; // 3072 bytes - sign32 y[DL_MAXL*DL_DEGREE]; // 5120 bytes - sign32 Ay[DL_MAXK*DL_DEGREE]; // 6144 bytes - sign8 w1[DL_MAXK*DL_DEGREE]; // 1280 bytes -#endif - int tau=params[0]; - int lg=params[1]; - int gamma1=(sign32)(1<val); - -// signature - CRH2(mu,tr,(byte*)M->val,M->len); - CRH3(rhod,bK,mu); - - for (k=0; ;k++ ) - { - fk=k*el; - sample_Y(params,fk,rhod,y); - -// NTT y - for (i=0;i=gamma1-beta) - { - badone=true; - break; - } - } - - if (badone) continue; - -// Calculate Ay=w-c.s2 and r0=lobits(w-c.s2) - nh=0; - for (i=0;i=gamma2-beta) - { - badone=true; - break; - } - poly_mcopy(w,&t0[row]); - ntt(w); - poly_mul(w,w,c); - - intt(w); - poly_negate(r,w); // -ct0 - if (infinity_norm(r)>=gamma2) - { - badone=true; - break; - } - poly_sub(&Ay[row],&Ay[row],r); - poly_soft_reduce(&Ay[row]); - - nh=MakePartialHint(params,hint,nh,r,&Ay[row]); - if (nh>omega) - { - badone=true; - break; - } - hint[omega+i]=nh; - } - if (badone) continue; - break; - } - sig->len=pack_sig(params,(byte *)sig->val,y,ct,hint); - return k+1; -} - -static bool verify(const int *params,octet *pk,octet *M,octet *sig) -{ - int i,row,j,m,hints; - byte rho[32]; - byte mu[64]; - byte ct[32]; - byte cct[32]; - byte tr[32]; // 192 bytes - byte hint[100]; // 61 bytes - - - sign32 Aij[DL_DEGREE]; // 1024 bytes - sign32 c[DL_DEGREE]; // 1024 bytes - sign32 w[DL_DEGREE]; // work space // 1024 bytes - sign32 r[DL_DEGREE]; // work space // 1024 bytes total=14077 bytes - - int ck=params[3]; - int el=params[4]; - -#ifdef USE_VLAS - sign32 z[el*DL_DEGREE]; // 5120 bytes - sign16 t1[ck*DL_DEGREE]; // 3072 bytes - sign8 w1d[ck*DL_DEGREE]; // 1536 bytes -#else - sign32 z[DL_MAXL*DL_DEGREE]; // 5120 bytes - sign16 t1[DL_MAXK*DL_DEGREE]; // 3072 bytes - sign8 w1d[DL_MAXK*DL_DEGREE]; // 1536 bytes -#endif - int tau=params[0]; - int lg=params[1]; - int gamma1=(sign32)(1<val); - unpack_sig(params,z,ct,hint,(byte *)sig->val); - - for (i=0;i=gamma1-beta) - return false; - ntt(&z[row]); // convert to ntt form - } - - CRH1(params,tr,rho,t1); - CRH2(mu,tr,(byte *)M->val,M->len); - SampleInBall(params,ct,c); - ntt(c); - -// Calculate Az - hints=0; - for (i=0;iomega) return false; - } - - H4(params,cct,mu,w1d); - - for (i=0;i<32;i++) - if (ct[i]!=cct[i]) - return false; - return true; -} - -void core::DLTHM_keypair_2(byte *tau,octet *sk,octet *pk) -{ - keypair(PARAMS_2,tau,sk,pk); -} - -int core::DLTHM_signature_2(octet *sk,octet *M,octet *sig) -{ - return signature(PARAMS_2,sk,M,sig); -} - -bool core::DLTHM_verify_2(octet *pk,octet *M,octet *sig) -{ - return verify(PARAMS_2,pk,M,sig); -} - - -void core::DLTHM_keypair_3(byte *tau,octet *sk,octet *pk) -{ - keypair(PARAMS_3,tau,sk,pk); -} - -int core::DLTHM_signature_3(octet *sk,octet *M,octet *sig) -{ - return signature(PARAMS_3,sk,M,sig); -} - -bool core::DLTHM_verify_3(octet *pk,octet *M,octet *sig) -{ - return verify(PARAMS_3,pk,M,sig); -} - -void core::DLTHM_keypair_5(byte *tau,octet *sk,octet *pk) -{ - keypair(PARAMS_5,tau,sk,pk); -} - -int core::DLTHM_signature_5(octet *sk,octet *M,octet *sig) -{ - return signature(PARAMS_5,sk,M,sig); -} - -bool core::DLTHM_verify_5(octet *pk,octet *M,octet *sig) -{ - return verify(PARAMS_5,pk,M,sig); -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecdh.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecdh.cpp deleted file mode 100644 index dcba8b4..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecdh.cpp +++ /dev/null @@ -1,394 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ECDH/ECIES/ECDSA API Functions */ - -#include -#include -#include -#include - -#include "ecdh_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -#if CURVETYPE_ZZZ!=WEIERSTRASS -// Process a random BIG r by RFC7748 (for Montgomery & Edwards curves only) -static void RFC7748(BIG r) -{ - int c,lg=0; - BIG t; - c=ZZZ::CURVE_Cof_I; - while (c!=1) - { - lg++; - c/=2; - } - int n=8*EGS_ZZZ-lg+1; - BIG_mod2m(r,n); - BIG_zero(t); BIG_inc(t,1); BIG_shl(t,n); - BIG_add(r,r,t); - c=BIG_lastbits(r,lg); - BIG_dec(r,c); -// printf("lg= %d n=%d\n",lg,n); -} -#endif - -/* return 1 if S is in ranger 0 < S < order , else return 0 */ -int ZZZ::ECP_IN_RANGE(octet* S) -{ - BIG r,s; - BIG_rcopy(r, CURVE_Order); - BIG_fromBytes(s,S->val); - if (BIG_iszilch(s)) return 0; - if (BIG_comp(s,r)>=0) return 0; - return 1; -} - -/* Calculate a public/private EC GF(p) key pair. W=S.G mod EC(p), - * where S is the secret key and W is the public key - * and G is fixed generator. - * If RNG is NULL then the private key is provided externally in S - * otherwise it is generated randomly internally */ -int ZZZ::ECP_KEY_PAIR_GENERATE(csprng *RNG, octet* S, octet *W) -{ - BIG r, gx, gy, s; - ECP G; - int res = 0; - - ECP_generator(&G); - BIG_rcopy(r, CURVE_Order); - - if (RNG != NULL) - { -#if CURVETYPE_ZZZ!=WEIERSTRASS - BIG_random(s,RNG); // from random bytes -#else - BIG_randomnum(s, r, RNG); // Removes biases -#endif - } - else - { - BIG_fromBytes(s, S->val); - } - -#if CURVETYPE_ZZZ!=WEIERSTRASS - RFC7748(s); // For Montgomery or Edwards, apply RFC7748 transformation -#endif - S->len = EGS_ZZZ; - BIG_toBytes(S->val, s); - - ECP_clmul(&G, s, r); - ECP_toOctet(W, &G, false); // To use point compression on public keys, change to true - - return res; -} - -/* Validate public key */ -int ZZZ::ECP_PUBLIC_KEY_VALIDATE(octet *W) -{ - BIG q, r, wx, k; - ECP WP; - int valid, nb; - int res = 0; - - BIG_rcopy(q, Modulus); - BIG_rcopy(r, CURVE_Order); - - valid = ECP_fromOctet(&WP, W); - if (!valid) res = ECDH_INVALID_PUBLIC_KEY; - - if (res == 0) - { - - nb = BIG_nbits(q); - BIG_one(k); - BIG_shl(k, (nb + 4) / 2); - BIG_add(k, q, k); - BIG_sdiv(k, r); /* get co-factor */ - while (BIG_parity(k) == 0) - { - ECP_dbl(&WP); - BIG_fshr(k, 1); - } - - if (!BIG_isunity(k)) ECP_mul(&WP, k); - if (ECP_isinf(&WP)) res = ECDH_INVALID_PUBLIC_KEY; - } - - return res; -} - -/* IEEE-1363 Diffie-Hellman online calculation Z=S.WD */ -// type = 0 is just x coordinate output -// type = 1 for standard compressed output -// type = 2 for standard uncompress output 04|x|y -int ZZZ::ECP_SVDP_DH(octet *S, octet *WD, octet *Z,int type) -{ - BIG r, s, wx; - int valid; - ECP W; - int res = 0; - - BIG_fromBytes(s, S->val); - valid = ECP_fromOctet(&W, WD); - - if (!valid) res = ECDH_ERROR; - if (res == 0) - { - BIG_rcopy(r, CURVE_Order); - ECP_clmul(&W, s, r); - if (ECP_isinf(&W)) res = ECDH_ERROR; - else - { -#if CURVETYPE_ZZZ!=MONTGOMERY - if (type>0) - { - if (type==1) ECP_toOctet(Z,&W,true); - else ECP_toOctet(Z,&W,false); - return res; - } - else - ECP_get(wx, wx, &W); -#else - ECP_get(wx, &W); -#endif - } - Z->len = EFS_ZZZ; - BIG_toBytes(Z->val, wx); - } - return res; -} - -#if CURVETYPE_ZZZ!=MONTGOMERY - -/* IEEE ECDSA Signature, C and D are signature on F using private key S */ -int ZZZ::ECP_SP_DSA(int hlen, csprng *RNG, octet *K, octet *S, octet *F, octet *C, octet *D) -{ - char h[128]; - octet H = {0, sizeof(h), h}; - - BIG r, s, f, c, d, u, vx, w; - ECP G, V; - - SPhash(MC_SHA2, hlen, &H, F); - - ECP_generator(&G); - BIG_rcopy(r, CURVE_Order); - - BIG_fromBytes(s, S->val); - - int blen = H.len; - if (H.len > EGS_ZZZ) blen = EGS_ZZZ; - BIG_fromBytesLen(f, H.val, blen); - - if (RNG != NULL) - { - do - { - BIG_randomnum(u, r, RNG); - BIG_randomnum(w, r, RNG); /* IMPORTANT - side channel masking to protect invmodp() */ - - ECP_copy(&V, &G); - ECP_clmul(&V, u, r); - - ECP_get(vx, vx, &V); - - BIG_copy(c, vx); - BIG_mod(c, r); - if (BIG_iszilch(c)) continue; - - BIG_modmul(u, u, w, r); - - BIG_invmodp(u, u, r); - BIG_modmul(d, s, c, r); - - BIG_modadd(d, f, d, r); - BIG_modmul(d, d, w, r); - BIG_modmul(d, u, d, r); - - } - while (BIG_iszilch(d)); - } - else - { - BIG_fromBytes(u, K->val); - - ECP_copy(&V, &G); - ECP_clmul(&V, u, r); - - ECP_get(vx, vx, &V); - - BIG_copy(c, vx); - BIG_mod(c, r); - if (BIG_iszilch(c)) return ECDH_ERROR; - - BIG_invmodp(u, u, r); - BIG_modmul(d, s, c, r); - - BIG_modadd(d, f, d, r); - BIG_modmul(d, u, d, r); - if (BIG_iszilch(d)) return ECDH_ERROR; - } - - C->len = D->len = EGS_ZZZ; - - BIG_toBytes(C->val, c); - BIG_toBytes(D->val, d); - - return 0; -} - -/* IEEE1363 ECDSA Signature Verification. Signature C and D on F is verified using public key W */ -int ZZZ::ECP_VP_DSA(int hlen, octet *W, octet *F, octet *C, octet *D) -{ - char h[128]; - octet H = {0, sizeof(h), h}; - - BIG r, wx, wy, f, c, d, h2; - int res = 0; - ECP G, WP; - int valid; - - SPhash(MC_SHA2, hlen, &H, F); - - ECP_generator(&G); - BIG_rcopy(r, CURVE_Order); - - BIG_fromBytes(c, C->val); - BIG_fromBytes(d, D->val); - - int blen = H.len; - if (blen > EGS_ZZZ) blen = EGS_ZZZ; - - BIG_fromBytesLen(f, H.val, blen); - - if (BIG_iszilch(c) || BIG_comp(c, r) >= 0 || BIG_iszilch(d) || BIG_comp(d, r) >= 0) - res = ECDH_ERROR; - - if (res == 0) - { - BIG_invmodp(d, d, r); - BIG_modmul(f, f, d, r); - BIG_modmul(h2, c, d, r); - - valid = ECP_fromOctet(&WP, W); - if (!valid) res = ECDH_ERROR; - else - { - ECP_mul2(&WP, &G, h2, f); - if (ECP_isinf(&WP)) res = ECDH_ERROR; - else - { - ECP_get(d, d, &WP); - BIG_mod(d, r); - if (BIG_comp(d, c) != 0) res = ECDH_ERROR; - } - } - } - - return res; -} - -/* IEEE1363 ECIES encryption. Encryption of plaintext M uses public key W and produces ciphertext V,C,T */ -void ZZZ::ECP_ECIES_ENCRYPT(int hlen, octet *P1, octet *P2, csprng *RNG, octet *W, octet *M, int tlen, octet *V, octet *C, octet *T) -{ - - int i, len; - char z[EFS_ZZZ], vz[3 * EFS_ZZZ + 1], k[2 * AESKEY_ZZZ], k1[AESKEY_ZZZ], k2[AESKEY_ZZZ], l2[8], u[EFS_ZZZ]; - octet Z = {0, sizeof(z), z}; - octet VZ = {0, sizeof(vz), vz}; - octet K = {0, sizeof(k), k}; - octet K1 = {0, sizeof(k1), k1}; - octet K2 = {0, sizeof(k2), k2}; - octet L2 = {0, sizeof(l2), l2}; - octet U = {0, sizeof(u), u}; - - if (ECP_KEY_PAIR_GENERATE(RNG, &U, V) != 0) return; - if (ECP_SVDP_DH(&U, W, &Z,0) != 0) return; - - OCT_copy(&VZ, V); - OCT_joctet(&VZ, &Z); - - KDF2(MC_SHA2, hlen, &K, 2 * AESKEY_ZZZ, &VZ, P1); - - K1.len = K2.len = AESKEY_ZZZ; - for (i = 0; i < AESKEY_ZZZ; i++) - { - K1.val[i] = K.val[i]; - K2.val[i] = K.val[AESKEY_ZZZ + i]; - } - - AES_CBC_IV0_ENCRYPT(&K1, M, C); - - OCT_jint(&L2, P2->len, 8); - - len = C->len; - OCT_joctet(C, P2); - OCT_joctet(C, &L2); - HMAC(MC_SHA2, hlen, T, tlen, &K2, C); - C->len = len; -} - -/* IEEE1363 ECIES decryption. Decryption of ciphertext V,C,T using private key U outputs plaintext M */ -int ZZZ::ECP_ECIES_DECRYPT(int hlen, octet *P1, octet *P2, octet *V, octet *C, octet *T, octet *U, octet *M) -{ - - int i, len; - char z[EFS_ZZZ], vz[3 * EFS_ZZZ + 1], k[2 * AESKEY_ZZZ], k1[AESKEY_ZZZ], k2[AESKEY_ZZZ], l2[8], tag[32]; - octet Z = {0, sizeof(z), z}; - octet VZ = {0, sizeof(vz), vz}; - octet K = {0, sizeof(k), k}; - octet K1 = {0, sizeof(k1), k1}; - octet K2 = {0, sizeof(k2), k2}; - octet L2 = {0, sizeof(l2), l2}; - octet TAG = {0, sizeof(tag), tag}; - - if (ECP_SVDP_DH(U, V, &Z,0) != 0) return 0; - - OCT_copy(&VZ, V); - OCT_joctet(&VZ, &Z); - - KDF2(MC_SHA2, hlen, &K, 2 * AESKEY_ZZZ, &VZ, P1); - - K1.len = K2.len = AESKEY_ZZZ; - for (i = 0; i < AESKEY_ZZZ; i++) - { - K1.val[i] = K.val[i]; - K2.val[i] = K.val[AESKEY_ZZZ + i]; - } - - if (!AES_CBC_IV0_DECRYPT(&K1, C, M)) return 0; - - OCT_jint(&L2, P2->len, 8); - - len = C->len; - OCT_joctet(C, P2); - OCT_joctet(C, &L2); - HMAC(MC_SHA2, hlen, &TAG, T->len, &K2, C); - C->len = len; - - if (!OCT_ncomp(T, &TAG, T->len)) return 0; - - return 1; - -} - -#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp.cpp deleted file mode 100644 index 1ea8a2d..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp.cpp +++ /dev/null @@ -1,1798 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE Elliptic Curve Functions */ -/* SU=m, SU is Stack Usage (Weierstrass Curves) */ - -//#define HAS_MAIN - -#include "ecp_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -/* test for P=O point-at-infinity */ -int ZZZ::ECP_isinf(ECP *P) -{ - -#if CURVETYPE_ZZZ==EDWARDS - return (FP_iszilch(&(P->x)) && FP_equals(&(P->y), &(P->z))); -#endif -#if CURVETYPE_ZZZ==WEIERSTRASS - return (FP_iszilch(&(P->x)) && FP_iszilch(&(P->z))); -#endif -#if CURVETYPE_ZZZ==MONTGOMERY - return FP_iszilch(&(P->z)); -#endif - -} - -/* Conditional swap of P and Q dependant on d */ -static void ECP_cswap(ZZZ::ECP *P, ZZZ::ECP *Q, int d) -{ - FP_cswap(&(P->x), &(Q->x), d); -#if CURVETYPE_ZZZ!=MONTGOMERY - FP_cswap(&(P->y), &(Q->y), d); -#endif - FP_cswap(&(P->z), &(Q->z), d); - -} - -#if CURVETYPE_ZZZ!=MONTGOMERY -/* Conditional move Q to P dependant on d */ -static void ECP_cmove(ZZZ::ECP *P, ZZZ::ECP *Q, int d) -{ - FP_cmove(&(P->x), &(Q->x), d); -#if CURVETYPE_ZZZ!=MONTGOMERY - FP_cmove(&(P->y), &(Q->y), d); -#endif - FP_cmove(&(P->z), &(Q->z), d); - -} - -/* return 1 if b==c, no branching */ -static int teq(sign32 b, sign32 c) -{ - sign32 x = b ^ c; - x -= 1; // if x=0, x now -1 - return (int)((x >> 31) & 1); -} -#endif // CURVETYPE_ZZZ!=MONTGOMERY - -#if CURVETYPE_ZZZ!=MONTGOMERY -/* Constant time select from pre-computed table */ -static void ECP_select(ZZZ::ECP *P, ZZZ::ECP W[], sign32 b) -{ - ZZZ::ECP MP; - sign32 m = b >> 31; - sign32 babs = (b ^ m) - m; - - babs = (babs - 1) / 2; - - ECP_cmove(P, &W[0], teq(babs, 0)); // conditional move - ECP_cmove(P, &W[1], teq(babs, 1)); - ECP_cmove(P, &W[2], teq(babs, 2)); - ECP_cmove(P, &W[3], teq(babs, 3)); - ECP_cmove(P, &W[4], teq(babs, 4)); - ECP_cmove(P, &W[5], teq(babs, 5)); - ECP_cmove(P, &W[6], teq(babs, 6)); - ECP_cmove(P, &W[7], teq(babs, 7)); - - ECP_copy(&MP, P); - ECP_neg(&MP); // minus P - ECP_cmove(P, &MP, (int)(m & 1)); -} -#endif - -/* Test P == Q */ -/* SU=168 */ -int ZZZ::ECP_equals(ECP *P, ECP *Q) -{ - FP a, b; - FP_mul(&a, &(P->x), &(Q->z)); - FP_mul(&b, &(Q->x), &(P->z)); - if (!FP_equals(&a, &b)) return 0; - -#if CURVETYPE_ZZZ!=MONTGOMERY - FP_mul(&a, &(P->y), &(Q->z)); - FP_mul(&b, &(Q->y), &(P->z)); - if (!FP_equals(&a, &b)) return 0; -#endif - - return 1; -} - -/* Set P=Q */ -/* SU=16 */ -void ZZZ::ECP_copy(ECP *P, ECP *Q) -{ - FP_copy(&(P->x), &(Q->x)); -#if CURVETYPE_ZZZ!=MONTGOMERY - FP_copy(&(P->y), &(Q->y)); -#endif - FP_copy(&(P->z), &(Q->z)); -} - -/* Set P=-Q */ -#if CURVETYPE_ZZZ!=MONTGOMERY -/* SU=8 */ -void ZZZ::ECP_neg(ECP *P) -{ -#if CURVETYPE_ZZZ==WEIERSTRASS - FP_neg(&(P->y), &(P->y)); - FP_norm(&(P->y)); -#else - FP_neg(&(P->x), &(P->x)); - FP_norm(&(P->x)); -#endif - -} -#endif - -/* Set P=O */ -void ZZZ::ECP_inf(ECP *P) -{ - FP_zero(&(P->x)); -#if CURVETYPE_ZZZ!=MONTGOMERY - FP_one(&(P->y)); -#endif -#if CURVETYPE_ZZZ!=EDWARDS - FP_zero(&(P->z)); -#else - FP_one(&(P->z)); -#endif -} - -/* Calculate right Hand Side of curve equation y^2=RHS */ -/* SU=56 */ -void ZZZ::ECP_rhs(FP *v, FP *x) -{ -#if CURVETYPE_ZZZ==WEIERSTRASS - /* x^3+Ax+B */ - FP t; - FP_sqr(&t, x); - FP_mul(&t, &t, x); - -#if CURVE_A_ZZZ == -3 - - FP_neg(v, x); - FP_norm(v); - FP_imul(v, v, -CURVE_A_ZZZ); - FP_norm(v); - FP_add(v, &t, v); -#else - FP_copy(v, &t); -#endif - FP_rcopy(&t, CURVE_B); - - FP_add(v, &t, v); - FP_reduce(v); -#endif - -#if CURVETYPE_ZZZ==EDWARDS - /* (Ax^2-1)/(Bx^2-1) */ - FP t, one; - FP_sqr(v, x); - FP_one(&one); - FP_rcopy(&t, CURVE_B); - - FP_mul(&t, v, &t); - FP_sub(&t, &t, &one); - FP_norm(&t); -#if CURVE_A_ZZZ == 1 - FP_sub(v, v, &one); -#endif -#if CURVE_A_ZZZ == -1 - FP_add(v, v, &one); - FP_norm(v); - FP_neg(v, v); -#endif - FP_norm(v); - FP_inv(&t, &t, NULL); - FP_mul(v, v, &t); - FP_reduce(v); -#endif - -#if CURVETYPE_ZZZ==MONTGOMERY - /* x^3+Ax^2+x */ - FP x2, x3; - FP_sqr(&x2, x); - FP_mul(&x3, &x2, x); - FP_copy(v, x); - FP_imul(&x2, &x2, CURVE_A_ZZZ); - FP_add(v, v, &x2); - FP_add(v, v, &x3); - FP_reduce(v); -#endif -} - -/* Set P=(x,y) */ - -#if CURVETYPE_ZZZ==MONTGOMERY - -/* Set P=(x,{y}) */ - -int ZZZ::ECP_set(ECP *P, BIG x) -{ - FP rhs; - FP_nres(&rhs, x); - - ECP_rhs(&rhs, &rhs); - - if (!FP_qr(&rhs,NULL)) - { - ECP_inf(P); - return 0; - } - - FP_nres(&(P->x), x); - FP_one(&(P->z)); - return 1; -} - -/* Extract x coordinate as BIG */ -int ZZZ::ECP_get(BIG x, ECP *P) -{ - ECP W; - ECP_copy(&W, P); - ECP_affine(&W); - if (ECP_isinf(&W)) return -1; - FP_redc(x, &(W.x)); - return 0; -} - - -#else -/* Extract (x,y) and return sign of y. If x and y are the same return only x */ -/* SU=16 */ -int ZZZ::ECP_get(BIG x, BIG y, ECP *P) -{ - ECP W; - ECP_copy(&W, P); - ECP_affine(&W); - if (ECP_isinf(&W)) return -1; - FP_redc(y, &(W.y)); - FP_redc(x, &(W.x)); - return FP_sign(&(W.y)); -} - -/* Set P=(x,{y}) */ -/* SU=96 */ -int ZZZ::ECP_set(ECP *P, BIG x, BIG y) -{ - FP rhs, y2; - - FP_nres(&y2, y); - FP_sqr(&y2, &y2); - FP_reduce(&y2); - - FP_nres(&rhs, x); - ECP_rhs(&rhs, &rhs); - - if (!FP_equals(&y2, &rhs)) - { - ECP_inf(P); - return 0; - } - - FP_nres(&(P->x), x); - FP_nres(&(P->y), y); - FP_one(&(P->z)); - return 1; -} - -/* Set P=(x,y), where y is calculated from x with sign s */ -/* SU=136 */ -int ZZZ::ECP_setx(ECP *P, BIG x, int s) -{ - FP rhs,hint; - FP_nres(&rhs, x); - - ECP_rhs(&rhs, &rhs); - - if (!FP_qr(&rhs,&hint)) - { - ECP_inf(P); - return 0; - } - - FP_nres(&(P->x), x); - FP_sqrt(&(P->y), &rhs, &hint); - - if (FP_sign(&(P->y))!=s) - FP_neg(&(P->y), &(P->y)); - FP_reduce(&(P->y)); - FP_one(&(P->z)); - return 1; -} - -#endif - -/* Convert P to Affine, from (x,y,z) to (x,y) */ -/* SU=160 */ -void ZZZ::ECP_affine(ECP *P) -{ - FP one, iz; - if (ECP_isinf(P)) return; - FP_one(&one); - if (FP_equals(&(P->z), &one)) return; - - FP_inv(&iz, &(P->z), NULL); - FP_mul(&(P->x), &(P->x), &iz); - -#if CURVETYPE_ZZZ==EDWARDS || CURVETYPE_ZZZ==WEIERSTRASS - - FP_mul(&(P->y), &(P->y), &iz); - FP_reduce(&(P->y)); - -#endif - - FP_reduce(&(P->x)); - FP_copy(&(P->z), &one); -} - -/* SU=120 */ -void ZZZ::ECP_outputxyz(ECP *P) -{ - BIG x, z; - if (ECP_isinf(P)) - { - printf("Infinity\n"); - return; - } - FP_reduce(&(P->x)); - FP_redc(x, &(P->x)); - FP_reduce(&(P->z)); - FP_redc(z, &(P->z)); - -#if CURVETYPE_ZZZ!=MONTGOMERY - BIG y; - FP_reduce(&(P->y)); - FP_redc(y, &(P->y)); - printf("("); - BIG_output(x); - printf(","); - BIG_output(y); - printf(","); - BIG_output(z); - printf(")\n"); - -#else - printf("("); - BIG_output(x); - printf(","); - BIG_output(z); - printf(")\n"); -#endif -} - -/* SU=16 */ -/* Output point P */ -void ZZZ::ECP_output(ECP *P) -{ - BIG x, y; - if (ECP_isinf(P)) - { - printf("Infinity\n"); - return; - } - ECP_affine(P); -#if CURVETYPE_ZZZ!=MONTGOMERY - FP_reduce(&(P->x)); - FP_reduce(&(P->y)); - FP_redc(x, &(P->x)); - FP_redc(y, &(P->y)); - printf("("); - BIG_output(x); - printf(","); - BIG_output(y); - printf(")\n"); -#else - FP_reduce(&(P->x)); - FP_redc(x, &(P->x)); - printf("("); - BIG_output(x); - printf(")\n"); -#endif -} - -/* SU=16 */ -/* Output point P */ -void ZZZ::ECP_rawoutput(ECP *P) -{ - BIG x, y, z; - -#if CURVETYPE_ZZZ!=MONTGOMERY - FP_redc(x, &(P->x)); - FP_redc(y, &(P->y)); - FP_redc(z, &(P->z)); - printf("("); - BIG_output(x); - printf(","); - BIG_output(y); - printf(","); - BIG_output(z); - printf(")\n"); -#else - FP_redc(x, &(P->x)); - FP_redc(z, &(P->z)); - printf("("); - BIG_output(x); - printf(","); - BIG_output(z); - printf(")\n"); -#endif -} - -/* SU=88 */ -/* Convert P to octet string, compressing if desired */ -void ZZZ::ECP_toOctet(octet *W, ECP *P, bool compress) -{ -#if CURVETYPE_ZZZ==MONTGOMERY - BIG x; - ECP_get(x, P); - W->len = MODBYTES_XXX; // + 1; - BIG_toBytes(&(W->val[0]), x); -#else - BIG x, y; - bool alt=false; - ECP_affine(P); - ECP_get(x, y, P); - -#if (MBITS-1)%8 <= 4 -#ifdef ALLOW_ALT_COMPRESS_ZZZ - alt=true; -#endif -#endif - - if (alt) - { - BIG_toBytes(&(W->val[0]), x); - if (compress) - { - W->len = MODBYTES_XXX; - W->val[0]|=0x80; - if (FP_islarger(&(P->y))==1) W->val[0]|=0x20; - } else { - W->len = 2 * MODBYTES_XXX; - BIG_toBytes(&(W->val[MODBYTES_XXX]), y); - } - } else { - BIG_toBytes(&(W->val[1]), x); - if (compress) - { - W->val[0] = 0x02; - if (FP_sign(&(P->y)) == 1) W->val[0] = 0x03; - W->len = MODBYTES_XXX + 1; - } else { - W->val[0] = 0x04; - W->len = 2 * MODBYTES_XXX + 1; - BIG_toBytes(&(W->val[MODBYTES_XXX + 1]), y); - } - } -#endif -} - -/* SU=88 */ -/* Restore P from octet string */ -int ZZZ::ECP_fromOctet(ECP *P, octet *W) -{ -#if CURVETYPE_ZZZ==MONTGOMERY - BIG x; - BIG_fromBytes(x, &(W->val[0])); - if (ECP_set(P, x)) return 1; - return 0; -#else - BIG x, y; - bool alt=false; - int sgn,cmp,typ = W->val[0]; - -#if (MBITS-1)%8 <= 4 -#ifdef ALLOW_ALT_COMPRESS_ZZZ - alt=true; -#endif -#endif - - if (alt) - { - W->val[0]&=0x1f; - BIG_fromBytes(x, &(W->val[0])); - W->val[0]=typ; - if ((typ&0x80)==0) - { - BIG_fromBytes(y, &(W->val[MODBYTES_XXX])); - if (ECP_set(P, x, y)) return 1; - return 0; - } else { - if (!ECP_setx(P,x,0)) return 0; - sgn=(typ&0x20)>>5; - cmp=FP_islarger(&(P->y)); - if ((sgn==1 && cmp!=1) || (sgn==0 && cmp==1)) ECP_neg(P); - return 1; - } - - } else { - BIG_fromBytes(x, &(W->val[1])); - if (typ == 0x04) - { - BIG_fromBytes(y, &(W->val[MODBYTES_XXX + 1])); - if (ECP_set(P, x, y)) return 1; - } - if (typ == 0x02 || typ == 0x03) - { - if (ECP_setx(P, x, typ & 1)) return 1; - } - } - return 0; -#endif -} - - -/* Set P=2P */ -/* SU=272 */ -void ZZZ::ECP_dbl(ECP *P) -{ -#if CURVETYPE_ZZZ==WEIERSTRASS - FP t0, t1, t2, t3, x3, y3, z3, b; - -#if CURVE_A_ZZZ == 0 - - FP_sqr(&t0, &(P->y)); //t0.sqr(); - FP_mul(&t1, &(P->y), &(P->z)); //t1.mul(z); - - FP_sqr(&t2, &(P->z)); //t2.sqr(); - - FP_add(&(P->z), &t0, &t0); //z.add(t0); - FP_norm(&(P->z)); //z.norm(); - FP_add(&(P->z), &(P->z), &(P->z)); //z.add(z); - FP_add(&(P->z), &(P->z), &(P->z)); //z.add(z); - FP_norm(&(P->z)); //z.norm(); - - FP_imul(&t2, &t2, 3 * CURVE_B_I); //t2.imul(3*ROM.CURVE_B_I); - FP_mul(&x3, &t2, &(P->z)); //x3.mul(z); - - FP_add(&y3, &t0, &t2); //y3.add(t2); - FP_norm(&y3); //y3.norm(); - FP_mul(&(P->z), &(P->z), &t1); //z.mul(t1); - - FP_add(&t1, &t2, &t2); //t1.add(t2); - FP_add(&t2, &t2, &t1); //t2.add(t1); - FP_sub(&t0, &t0, &t2); //t0.sub(t2); - FP_norm(&t0); //t0.norm(); - FP_mul(&y3, &y3, &t0); //y3.mul(t0); - FP_add(&y3, &y3, &x3); //y3.add(x3); - - FP_mul(&t1, &(P->x), &(P->y)); //t1.mul(y); - FP_norm(&t0); //x.norm(); - FP_mul(&(P->x), &t0, &t1); //x.mul(t1); - FP_add(&(P->x), &(P->x), &(P->x)); //x.add(x); - FP_norm(&(P->x)); //x.norm(); - FP_copy(&(P->y), &y3); //y.copy(y3); - FP_norm(&(P->y)); //y.norm(); -#else - - if (CURVE_B_I == 0) //if (ROM.CURVE_B_I==0) - FP_rcopy(&b, CURVE_B); //b.copy(new FP(new BIG(ROM.CURVE_B))); - - FP_sqr(&t0, &(P->x)); //t0.sqr(); //1 x^2 - FP_sqr(&t1, &(P->y)); //t1.sqr(); //2 y^2 - FP_sqr(&t2, &(P->z)); //t2.sqr(); //3 - - FP_mul(&t3, &(P->x), &(P->y)); //t3.mul(y); //4 - FP_add(&t3, &t3, &t3); //t3.add(t3); - FP_norm(&t3); //t3.norm();//5 - - FP_mul(&z3, &(P->z), &(P->x)); //z3.mul(x); //6 - FP_add(&z3, &z3, &z3); //z3.add(z3); - FP_norm(&z3); //z3.norm();//7 - - if (CURVE_B_I == 0) //if (ROM.CURVE_B_I==0) - FP_mul(&y3, &t2, &b); //y3.mul(b); //8 - else - FP_imul(&y3, &t2, CURVE_B_I); //y3.imul(ROM.CURVE_B_I); - - FP_sub(&y3, &y3, &z3); //y3.sub(z3); //y3.norm(); //9 *** - FP_add(&x3, &y3, &y3); //x3.add(y3); - FP_norm(&x3); //x3.norm();//10 - - FP_add(&y3, &y3, &x3); //y3.add(x3); //y3.norm();//11 - FP_sub(&x3, &t1, &y3); //x3.sub(y3); - FP_norm(&x3); //x3.norm();//12 - FP_add(&y3, &y3, &t1); //y3.add(t1); - FP_norm(&y3); //y3.norm();//13 - FP_mul(&y3, &y3, &x3); //y3.mul(x3); //14 - FP_mul(&x3, &x3, &t3); //x3.mul(t3); //15 - FP_add(&t3, &t2, &t2); //t3.add(t2); //16 - FP_add(&t2, &t2, &t3); //t2.add(t3); //17 - - if (CURVE_B_I == 0) //if (ROM.CURVE_B_I==0) - FP_mul(&z3, &z3, &b); //z3.mul(b); //18 - else - FP_imul(&z3, &z3, CURVE_B_I); //z3.imul(ROM.CURVE_B_I); - - FP_sub(&z3, &z3, &t2); //z3.sub(t2); //z3.norm();//19 - FP_sub(&z3, &z3, &t0); //z3.sub(t0); - FP_norm(&z3); //z3.norm();//20 *** - FP_add(&t3, &z3, &z3); //t3.add(z3); //t3.norm();//21 - - FP_add(&z3, &z3, &t3); //z3.add(t3); - FP_norm(&z3); //z3.norm(); //22 - FP_add(&t3, &t0, &t0); //t3.add(t0); //t3.norm(); //23 - FP_add(&t0, &t0, &t3); //t0.add(t3); //t0.norm();//24 - FP_sub(&t0, &t0, &t2); //t0.sub(t2); - FP_norm(&t0); //t0.norm();//25 - - FP_mul(&t0, &t0, &z3); //t0.mul(z3);//26 - FP_add(&y3, &y3, &t0); //y3.add(t0); //y3.norm();//27 - FP_mul(&t0, &(P->y), &(P->z)); //t0.mul(z);//28 - FP_add(&t0, &t0, &t0); //t0.add(t0); - FP_norm(&t0); //t0.norm(); //29 - FP_mul(&z3, &z3, &t0); //z3.mul(t0);//30 - FP_sub(&(P->x), &x3, &z3); //x3.sub(z3); //x3.norm();//31 - FP_add(&t0, &t0, &t0); //t0.add(t0); - FP_norm(&t0); //t0.norm();//32 - FP_add(&t1, &t1, &t1); //t1.add(t1); - FP_norm(&t1); //t1.norm();//33 - FP_mul(&(P->z), &t0, &t1); //z3.mul(t1);//34 - - FP_norm(&(P->x)); //x.norm(); - FP_copy(&(P->y), &y3); //y.copy(y3); - FP_norm(&(P->y)); //y.norm(); - FP_norm(&(P->z)); //z.norm(); -#endif -#endif - -#if CURVETYPE_ZZZ==EDWARDS - /* Not using square for multiplication swap, as (1) it needs more adds, and (2) it triggers more reductions */ - - FP C, D, H, J; - FP_sqr(&C, &(P->x)); //C.sqr(); - FP_mul(&(P->x), &(P->x), &(P->y)); //x.mul(y); - FP_add(&(P->x), &(P->x), &(P->x)); //x.add(x); - FP_norm(&(P->x)); //x.norm(); - - FP_sqr(&D, &(P->y)); //D.sqr(); - -#if CURVE_A_ZZZ == -1 - FP_neg(&C, &C); // C.neg(); -#endif - FP_add(&(P->y), &C, &D); //y.add(D); - FP_norm(&(P->y)); //y.norm(); - FP_sqr(&H, &(P->z)); //H.sqr(); - FP_add(&H, &H, &H); //H.add(H); - - FP_sub(&J, &(P->y), &H); //J.sub(H); - FP_norm(&J); //J.norm(); - - FP_mul(&(P->x), &(P->x), &J); //x.mul(J); - FP_sub(&C, &C, &D); //C.sub(D); - FP_norm(&C); //C.norm(); - FP_mul(&(P->z), &(P->y), &J); //z.mul(J); - FP_mul(&(P->y), &(P->y), &C); //y.mul(C); - - -#endif - -#if CURVETYPE_ZZZ==MONTGOMERY - FP A, B, AA, BB, C; - - FP_add(&A, &(P->x), &(P->z)); //A.add(z); - FP_norm(&A); //A.norm(); - FP_sqr(&AA, &A); //AA.sqr(); - FP_sub(&B, &(P->x), &(P->z)); //B.sub(z); - FP_norm(&B); //B.norm(); - FP_sqr(&BB, &B); //BB.sqr(); - FP_sub(&C, &AA, &BB); //C.sub(BB); - FP_norm(&C); //C.norm(); - FP_mul(&(P->x), &AA, &BB); //x.mul(BB); - - FP_imul(&A, &C, (CURVE_A_ZZZ + 2) / 4); //A.imul((ROM.CURVE_A+2)/4); - - FP_add(&BB, &BB, &A); //BB.add(A); - FP_norm(&BB); //BB.norm(); - FP_mul(&(P->z), &BB, &C); //z.mul(C); - -#endif -} - -#if CURVETYPE_ZZZ==MONTGOMERY - -/* Set P+=Q. W is difference between P and Q and is affine */ -void ZZZ::ECP_add(ECP *P, ECP *Q, ECP *W) -{ - FP A, B, C, D, DA, CB; - - FP_add(&A, &(P->x), &(P->z)); //A.add(z); - FP_sub(&B, &(P->x), &(P->z)); //B.sub(z); - - FP_add(&C, &(Q->x), &(Q->z)); //C.add(Q.z); - FP_sub(&D, &(Q->x), &(Q->z)); //D.sub(Q.z); - - FP_norm(&A); //A.norm(); - FP_norm(&D); //D.norm(); - FP_mul(&DA, &D, &A); //DA.mul(A); - - FP_norm(&C); //C.norm(); - FP_norm(&B); //B.norm(); - FP_mul(&CB, &C, &B); //CB.mul(B); - - FP_add(&A, &DA, &CB); //A.add(CB); - FP_norm(&A); //A.norm(); - FP_sqr(&(P->x), &A); //A.sqr(); - FP_sub(&B, &DA, &CB); //B.sub(CB); - FP_norm(&B); //B.norm(); - FP_sqr(&B, &B); //B.sqr(); - - FP_mul(&(P->z), &(W->x), &B); //z.mul(B); -} - -#else - -/* Set P+=Q */ -/* SU=248 */ -void ZZZ::ECP_add(ECP *P, ECP *Q) -{ -#if CURVETYPE_ZZZ==WEIERSTRASS - - int b3; - FP t0, t1, t2, t3, t4, x3, y3, z3, b; - -#if CURVE_A_ZZZ == 0 - b3 = 3 * CURVE_B_I; //int b=3*ROM.CURVE_B_I; - FP_mul(&t0, &(P->x), &(Q->x)); //t0.mul(Q.x); - FP_mul(&t1, &(P->y), &(Q->y)); //t1.mul(Q.y); - FP_mul(&t2, &(P->z), &(Q->z)); //t2.mul(Q.z); - FP_add(&t3, &(P->x), &(P->y)); //t3.add(y); - FP_norm(&t3); //t3.norm(); - FP_add(&t4, &(Q->x), &(Q->y)); //t4.add(Q.y); - FP_norm(&t4); //t4.norm(); - FP_mul(&t3, &t3, &t4); //t3.mul(t4); - FP_add(&t4, &t0, &t1); //t4.add(t1); - - FP_sub(&t3, &t3, &t4); //t3.sub(t4); - FP_norm(&t3); //t3.norm(); - FP_add(&t4, &(P->y), &(P->z)); //t4.add(z); - FP_norm(&t4); //t4.norm(); - FP_add(&x3, &(Q->y), &(Q->z)); //x3.add(Q.z); - FP_norm(&x3); //x3.norm(); - - FP_mul(&t4, &t4, &x3); //t4.mul(x3); - FP_add(&x3, &t1, &t2); //x3.add(t2); - - FP_sub(&t4, &t4, &x3); //t4.sub(x3); - FP_norm(&t4); //t4.norm(); - FP_add(&x3, &(P->x), &(P->z)); //x3.add(z); - FP_norm(&x3); //x3.norm(); - FP_add(&y3, &(Q->x), &(Q->z)); //y3.add(Q.z); - FP_norm(&y3); //y3.norm(); - FP_mul(&x3, &x3, &y3); //x3.mul(y3); - FP_add(&y3, &t0, &t2); //y3.add(t2); - FP_sub(&y3, &x3, &y3); //y3.rsub(x3); - FP_norm(&y3); //y3.norm(); - FP_add(&x3, &t0, &t0); //x3.add(t0); - FP_add(&t0, &t0, &x3); //t0.add(x3); - FP_norm(&t0); //t0.norm(); - FP_imul(&t2, &t2, b3); //t2.imul(b); - - FP_add(&z3, &t1, &t2); //z3.add(t2); - FP_norm(&z3); //z3.norm(); - FP_sub(&t1, &t1, &t2); //t1.sub(t2); - FP_norm(&t1); //t1.norm(); - FP_imul(&y3, &y3, b3); //y3.imul(b); - - FP_mul(&x3, &y3, &t4); //x3.mul(t4); - FP_mul(&t2, &t3, &t1); //t2.mul(t1); - FP_sub(&(P->x), &t2, &x3); //x3.rsub(t2); - FP_mul(&y3, &y3, &t0); //y3.mul(t0); - FP_mul(&t1, &t1, &z3); //t1.mul(z3); - FP_add(&(P->y), &y3, &t1); //y3.add(t1); - FP_mul(&t0, &t0, &t3); //t0.mul(t3); - FP_mul(&z3, &z3, &t4); //z3.mul(t4); - FP_add(&(P->z), &z3, &t0); //z3.add(t0); - - FP_norm(&(P->x)); //x.norm(); - FP_norm(&(P->y)); //y.norm(); - FP_norm(&(P->z)); //z.norm(); -#else - - if (CURVE_B_I == 0) //if (ROM.CURVE_B_I==0) - FP_rcopy(&b, CURVE_B); //b.copy(new FP(new BIG(ROM.CURVE_B))); - - FP_mul(&t0, &(P->x), &(Q->x)); //t0.mul(Q.x); //1 - FP_mul(&t1, &(P->y), &(Q->y)); //t1.mul(Q.y); //2 - FP_mul(&t2, &(P->z), &(Q->z)); //t2.mul(Q.z); //3 - - FP_add(&t3, &(P->x), &(P->y)); //t3.add(y); - FP_norm(&t3); //t3.norm(); //4 - FP_add(&t4, &(Q->x), &(Q->y)); //t4.add(Q.y); - FP_norm(&t4); //t4.norm();//5 - FP_mul(&t3, &t3, &t4); //t3.mul(t4);//6 - FP_add(&t4, &t0, &t1); //t4.add(t1); //t4.norm(); //7 - FP_sub(&t3, &t3, &t4); //t3.sub(t4); - FP_norm(&t3); //t3.norm(); //8 - FP_add(&t4, &(P->y), &(P->z)); //t4.add(z); - FP_norm(&t4); //t4.norm();//9 - FP_add(&x3, &(Q->y), &(Q->z)); //x3.add(Q.z); - FP_norm(&x3); //x3.norm();//10 - FP_mul(&t4, &t4, &x3); //t4.mul(x3); //11 - FP_add(&x3, &t1, &t2); //x3.add(t2); //x3.norm();//12 - - FP_sub(&t4, &t4, &x3); //t4.sub(x3); - FP_norm(&t4); //t4.norm();//13 - FP_add(&x3, &(P->x), &(P->z)); //x3.add(z); - FP_norm(&x3); //x3.norm(); //14 - FP_add(&y3, &(Q->x), &(Q->z)); //y3.add(Q.z); - FP_norm(&y3); //y3.norm();//15 - - FP_mul(&x3, &x3, &y3); //x3.mul(y3); //16 - FP_add(&y3, &t0, &t2); //y3.add(t2); //y3.norm();//17 - - FP_sub(&y3, &x3, &y3); //y3.rsub(x3); - FP_norm(&y3); //y3.norm(); //18 - - if (CURVE_B_I == 0) //if (ROM.CURVE_B_I==0) - FP_mul(&z3, &t2, &b); //z3.mul(b); //18 - else - FP_imul(&z3, &t2, CURVE_B_I); //z3.imul(ROM.CURVE_B_I); - - FP_sub(&x3, &y3, &z3); //x3.sub(z3); - FP_norm(&x3); //x3.norm(); //20 - FP_add(&z3, &x3, &x3); //z3.add(x3); //z3.norm(); //21 - - FP_add(&x3, &x3, &z3); //x3.add(z3); //x3.norm(); //22 - FP_sub(&z3, &t1, &x3); //z3.sub(x3); - FP_norm(&z3); //z3.norm(); //23 - FP_add(&x3, &x3, &t1); //x3.add(t1); - FP_norm(&x3); //x3.norm(); //24 - - if (CURVE_B_I == 0) //if (ROM.CURVE_B_I==0) - FP_mul(&y3, &y3, &b); //y3.mul(b); //18 - else - FP_imul(&y3, &y3, CURVE_B_I); //y3.imul(ROM.CURVE_B_I); - - FP_add(&t1, &t2, &t2); //t1.add(t2); //t1.norm();//26 - FP_add(&t2, &t2, &t1); //t2.add(t1); //t2.norm();//27 - - FP_sub(&y3, &y3, &t2); //y3.sub(t2); //y3.norm(); //28 - - FP_sub(&y3, &y3, &t0); //y3.sub(t0); - FP_norm(&y3); //y3.norm(); //29 - FP_add(&t1, &y3, &y3); //t1.add(y3); //t1.norm();//30 - FP_add(&y3, &y3, &t1); //y3.add(t1); - FP_norm(&y3); //y3.norm(); //31 - - FP_add(&t1, &t0, &t0); //t1.add(t0); //t1.norm(); //32 - FP_add(&t0, &t0, &t1); //t0.add(t1); //t0.norm();//33 - FP_sub(&t0, &t0, &t2); //t0.sub(t2); - FP_norm(&t0); //t0.norm();//34 - FP_mul(&t1, &t4, &y3); //t1.mul(y3);//35 - FP_mul(&t2, &t0, &y3); //t2.mul(y3);//36 - FP_mul(&y3, &x3, &z3); //y3.mul(z3);//37 - FP_add(&(P->y), &y3, &t2); //y3.add(t2); //y3.norm();//38 - FP_mul(&x3, &x3, &t3); //x3.mul(t3);//39 - FP_sub(&(P->x), &x3, &t1); //x3.sub(t1);//40 - FP_mul(&z3, &z3, &t4); //z3.mul(t4);//41 - - FP_mul(&t1, &t3, &t0); //t1.mul(t0);//42 - FP_add(&(P->z), &z3, &t1); //z3.add(t1); - FP_norm(&(P->x)); //x.norm(); - FP_norm(&(P->y)); //y.norm(); - FP_norm(&(P->z)); //z.norm(); -#endif - -#else - FP A, B, C, D, E, F, G, b; - - FP_mul(&A, &(P->z), &(Q->z)); //A.mul(Q.z); - FP_sqr(&B, &A); //B.sqr(); - FP_mul(&C, &(P->x), &(Q->x)); //C.mul(Q.x); - FP_mul(&D, &(P->y), &(Q->y)); //D.mul(Q.y); - - FP_mul(&E, &C, &D); //E.mul(D); - - if (CURVE_B_I == 0) //if (ROM.CURVE_B_I==0) - { - FP_rcopy(&b, CURVE_B); //FP b=new FP(new BIG(ROM.CURVE_B)); - FP_mul(&E, &E, &b); //E.mul(b); - } - else - FP_imul(&E, &E, CURVE_B_I); //E.imul(ROM.CURVE_B_I); - - FP_sub(&F, &B, &E); //F.sub(E); - FP_add(&G, &B, &E); //G.add(E); - -#if CURVE_A_ZZZ == 1 - FP_sub(&E, &D, &C); //E.sub(C); -#endif - FP_add(&C, &C, &D); //C.add(D); - - FP_add(&B, &(P->x), &(P->y)); //B.add(y); - FP_add(&D, &(Q->x), &(Q->y)); //D.add(Q.y); - FP_norm(&B); //B.norm(); - FP_norm(&D); //D.norm(); - FP_mul(&B, &B, &D); //B.mul(D); - FP_sub(&B, &B, &C); //B.sub(C); - FP_norm(&B); //B.norm(); - FP_norm(&F); //F.norm(); - FP_mul(&B, &B, &F); //B.mul(F); - FP_mul(&(P->x), &A, &B); //x.mul(B); - FP_norm(&G); //G.norm(); - -#if CURVE_A_ZZZ == 1 - FP_norm(&E); //E.norm(); - FP_mul(&C, &E, &G); //C.mul(G); -#endif - -#if CURVE_A_ZZZ == -1 - FP_norm(&C); //C.norm(); - FP_mul(&C, &C, &G); //C.mul(G); -#endif - FP_mul(&(P->y), &A, &C); //y.mul(C); - FP_mul(&(P->z), &F, &G); //z.mul(G); - -#endif -} - -/* Set P-=Q */ -/* SU=16 */ -void ZZZ::ECP_sub(ECP *P, ECP *Q) -{ - ECP NQ; - ECP_copy(&NQ, Q); - ECP_neg(&NQ); - ECP_add(P, &NQ); -} - -#endif - -#if CURVETYPE_ZZZ!=MONTGOMERY -/* constant time multiply by small integer of length bts - use ladder */ -void ZZZ::ECP_pinmul(ECP *P, int e, int bts) -{ - int i, b; - ECP R0, R1; - - ECP_affine(P); - ECP_inf(&R0); - ECP_copy(&R1, P); - - for (i = bts - 1; i >= 0; i--) - { - b = (e >> i) & 1; - ECP_copy(P, &R1); - ECP_add(P, &R0); - ECP_cswap(&R0, &R1, b); - ECP_copy(&R1, P); - ECP_dbl(&R0); - ECP_cswap(&R0, &R1, b); - } - ECP_copy(P, &R0); -} -#endif - -// Point multiplication, multiplies a point P by a scalar e -// This code has no inherent awareness of the order of the curve, or the order of the point. -// The order of the curve will be h.r, where h is a cofactor, and r is a large prime -// Typically P will be of order r (but not always), and typically e will be less than r (but not always) -// A problem can arise if a secret e is a few bits less than r, as the leading zeros in e will leak via a timing attack -// The secret e may however be greater than r (see RFC7748 which combines elimination of a small cofactor h with the point multiplication, using an e>r) -// Our solution is to use as a multiplier an e, whose length in bits is that of the logical OR of e and r, hence allowing e>r while forcing inclusion of leading zeros if e= 0; i--) - { - b = BIG_bit(e, i); - ECP_copy(P, &R1); - ECP_add(P, &R0, &D); - ECP_cswap(&R0, &R1, b); - ECP_copy(&R1, P); - ECP_dbl(&R0); - - ECP_cswap(&R0, &R1, b); - } - - ECP_copy(P, &R0); - -#else - /* fixed size windows */ - int i, nb, s, ns; - BIG mt, t; - ECP Q, W[8], C; - sign8 w[1 + (NLEN_XXX * BASEBITS_XXX + 3) / 4]; - - if (ECP_isinf(P)) return; - if (BIG_iszilch(e)) - { - ECP_inf(P); - return; - } - - /* precompute table */ - ECP_copy(&Q, P); - ECP_dbl(&Q); - ECP_copy(&W[0], P); - - for (i = 1; i < 8; i++) - { - ECP_copy(&W[i], &W[i - 1]); - ECP_add(&W[i], &Q); - } - - /* make exponent odd - add 2P if even, P if odd */ - BIG_copy(t, e); - s = BIG_parity(t); - BIG_inc(t, 1); - BIG_norm(t); - ns = BIG_parity(t); - BIG_copy(mt, t); - BIG_inc(mt, 1); - BIG_norm(mt); - BIG_cmove(t, mt, s); - ECP_cmove(&Q, P, ns); - ECP_copy(&C, &Q); - - nb = 1 + (max + 3) / 4; - /* convert exponent to signed 4-bit window */ - for (i = 0; i < nb; i++) - { - w[i] = BIG_lastbits(t, 5) - 16; - BIG_dec(t, w[i]); - BIG_norm(t); - BIG_fshr(t, 4); - } - w[nb] = BIG_lastbits(t, 5); - - ECP_select(P, W, w[nb]); - for (i = nb - 1; i >= 0; i--) - { - ECP_select(&Q, W, w[i]); - ECP_dbl(P); - ECP_dbl(P); - ECP_dbl(P); - ECP_dbl(P); - ECP_add(P, &Q); - } - ECP_sub(P, &C); /* apply correction */ -#endif -} - -#if CURVETYPE_ZZZ!=MONTGOMERY - -// Generic multi-multiplication, fixed 4-bit window, P=Sigma e_i*X_i -// m point doublings -void ZZZ::ECP_muln(ECP *P,int n,ECP X[],BIG e[]) -{ - int i,j,k,nb; - BIG t,mt; - ECP S,R,B[16]; - ECP_inf(P); - - BIG_copy(mt,e[0]); BIG_norm(mt); - for (i=1;i=0;i--) - { // Pippenger's algorithm - for (j=0;j<16;j++) - ECP_inf(&B[j]); - for (j=0;j=1;j--) - { - ECP_add(&R,&B[j]); - ECP_add(&S,&R); - } - for (j=0;j<4;j++) - ECP_dbl(P); - ECP_add(P,&S); - } -} - -void ZZZ::ECP_mul2(ECP *P, ECP *Q, BIG e, BIG f) -{ - ECP_clmul2(P,Q,e,f,e); -} - -/* Set P=eP+fQ double multiplication */ -/* constant time - as useful for GLV method in pairings */ -/* SU=456 */ - -void ZZZ::ECP_clmul2(ECP *P, ECP *Q, BIG e, BIG f, BIG maxe) -{ - BIG cm; - BIG te, tf, mt; - ECP S, T, W[8], C; - sign8 w[1 + (NLEN_XXX * BASEBITS_XXX + 1) / 2]; - int i, a, b, s, ns, nb; - - BIG_copy(cm,maxe); BIG_or(cm,cm,e); BIG_or(cm,cm,f); - int max=BIG_nbits(cm); - - BIG_copy(te, e); - BIG_copy(tf, f); - - /* precompute table */ - ECP_copy(&W[1], P); - ECP_sub(&W[1], Q); /* P+Q */ - ECP_copy(&W[2], P); - ECP_add(&W[2], Q); /* P-Q */ - ECP_copy(&S, Q); - ECP_dbl(&S); /* S=2Q */ - ECP_copy(&W[0], &W[1]); - ECP_sub(&W[0], &S); - ECP_copy(&W[3], &W[2]); - ECP_add(&W[3], &S); - ECP_copy(&T, P); - ECP_dbl(&T); /* T=2P */ - ECP_copy(&W[5], &W[1]); - ECP_add(&W[5], &T); - ECP_copy(&W[6], &W[2]); - ECP_add(&W[6], &T); - ECP_copy(&W[4], &W[5]); - ECP_sub(&W[4], &S); - ECP_copy(&W[7], &W[6]); - ECP_add(&W[7], &S); - - /* if multiplier is odd, add 2, else add 1 to multiplier, and add 2P or P to correction */ - - s = BIG_parity(te); - BIG_inc(te, 1); - BIG_norm(te); - ns = BIG_parity(te); - BIG_copy(mt, te); - BIG_inc(mt, 1); - BIG_norm(mt); - BIG_cmove(te, mt, s); - ECP_cmove(&T, P, ns); - ECP_copy(&C, &T); - - s = BIG_parity(tf); - BIG_inc(tf, 1); - BIG_norm(tf); - ns = BIG_parity(tf); - BIG_copy(mt, tf); - BIG_inc(mt, 1); - BIG_norm(mt); - BIG_cmove(tf, mt, s); - ECP_cmove(&S, Q, ns); - ECP_add(&C, &S); - - //BIG_add(mt, te, tf); - //BIG_norm(mt); - nb = 1 + (max + 1) / 2; - - /* convert exponent to signed 2-bit window */ - for (i = 0; i < nb; i++) - { - a = BIG_lastbits(te, 3) - 4; - BIG_dec(te, a); - BIG_norm(te); - BIG_fshr(te, 2); - b = BIG_lastbits(tf, 3) - 4; - BIG_dec(tf, b); - BIG_norm(tf); - BIG_fshr(tf, 2); - w[i] = 4 * a + b; - } - w[nb] = (4 * BIG_lastbits(te, 3) + BIG_lastbits(tf, 3)); - - //ECP_copy(P, &W[(w[nb] - 1) / 2]); - ECP_select(P, W, w[nb]); - for (i = nb - 1; i >= 0; i--) - { - ECP_select(&T, W, w[i]); - ECP_dbl(P); - ECP_dbl(P); - ECP_add(P, &T); - } - ECP_sub(P, &C); /* apply correction */ -} - -#endif - -void ZZZ::ECP_cfp(ECP *P) -{ /* multiply point by curves cofactor */ - BIG c; - int cf = CURVE_Cof_I; - if (cf == 1) return; - if (cf == 4) - { - ECP_dbl(P); - ECP_dbl(P); - return; - } - if (cf == 8) - { - ECP_dbl(P); - ECP_dbl(P); - ECP_dbl(P); - return; - } - BIG_rcopy(c, CURVE_Cof); - ECP_mul(P, c); - return; -} - -/* Constant time Map to Point */ -void ZZZ::ECP_map2point(ECP *P,FP *h) -{ -#if CURVETYPE_ZZZ==MONTGOMERY -// Elligator 2 - int qres; - BIG a; - FP X1,X2,w,N,t,one,A,D,hint; - //BIG_zero(a); BIG_inc(a,CURVE_A); BIG_norm(a); FP_nres(&A,a); - FP_from_int(&A,CURVE_A_ZZZ); - FP_copy(&t,h); - FP_sqr(&t,&t); // t^2 - - if (PM1D2_YYY == 2) - FP_add(&t,&t,&t); // 2t^2 - if (PM1D2_YYY == 1) - FP_neg(&t,&t); // -t^2 - if (PM1D2_YYY > 2) - FP_imul(&t,&t,QNRI_YYY); // precomputed QNR - FP_norm(&t); // z.t^2 - - FP_one(&one); - FP_add(&D,&t,&one); FP_norm(&D); // Denominator D=1+z.t^2 - - FP_copy(&X1,&A); - FP_neg(&X1,&X1); FP_norm(&X1); // X1 = -A/D - FP_copy(&X2,&X1); - FP_mul(&X2,&X2,&t); // X2 = -At/D - - FP_sqr(&w,&X1); FP_mul(&N,&w,&X1); // w=X1^2, N=X1^3 - FP_mul(&w,&w,&A); FP_mul(&w,&w,&D); FP_add(&N,&N,&w); // N = X1^3+ADX1^2 - FP_sqr(&t,&D); - FP_mul(&t,&t,&X1); - FP_add(&N,&N,&t); // N=X1^3+ADX1^2+D^2X1 // Numerator of gx = N/D^3 - FP_norm(&N); - - FP_mul(&t,&N,&D); // N.D - qres=FP_qr(&t,&hint); // *** exp - FP_inv(&w,&t,&hint); - FP_mul(&D,&w,&N); // 1/D - FP_mul(&X1,&X1,&D); // get X1 - FP_mul(&X2,&X2,&D); // get X2 - FP_cmove(&X1,&X2,1-qres); - FP_redc(a,&X1); - - ECP_set(P,a); - return; -#endif -#if CURVETYPE_ZZZ==EDWARDS -// Elligator 2 - map to Montgomery, place point, map back - int qres,ne,rfc,qnr; - BIG x,y; - FP X1,X2,t,w,one,A,w1,w2,B,Y,K,D,hint; - FP_one(&one); - -#if MODTYPE_YYY != GENERALISED_MERSENNE -// its NOT ed448! -// Figure out the Montgomery curve parameters - - FP_rcopy(&B,CURVE_B); - -#if CURVE_A_ZZZ == 1 - FP_add(&A,&B,&one); // A=B+1 // A = a+d - FP_sub(&B,&B,&one); // B=B-1 // B = -a+d -#else - FP_sub(&A,&B,&one); // A=B-1 - FP_add(&B,&B,&one); // B=B+1 -#endif - FP_norm(&A); FP_norm(&B); - - FP_div2(&A,&A); // (A+B)/2 // (a+d)/2 = J/K - FP_div2(&B,&B); // (B-A)/2 // (-a+d)/2 - FP_div2(&B,&B); // (B-A)/4 // (-a+d)/4 = -1/K - - FP_neg(&K,&B); FP_norm(&K); - //FP_inv(&K,&K,NULL); // K - FP_invsqrt(&K,&w1,&K); // *** return K, w1=sqrt(1/K) - - could be precalculated! - - rfc=RIADZ_YYY; - if (rfc) - { // RFC7748 method applies - FP_mul(&A,&A,&K); // = J - FP_mul(&K,&K,&w1); -// FP_sqrt(&K,&K,NULL); - } else { // generic method - FP_sqr(&B,&B); - } -#else - FP_from_int(&A,156326); - rfc=1; -#endif -// Map to this Montgomery curve X^2=X^3+AX^2+BX - - FP_copy(&t,h); - FP_sqr(&t,&t); // t^2 - - if (PM1D2_YYY == 2) - { - FP_add(&t,&t,&t); // 2t^2 - qnr=2; - } - if (PM1D2_YYY == 1) - { - FP_neg(&t,&t); // -t^2 - qnr=-1; - } - if (PM1D2_YYY > 2) - { - FP_imul(&t,&t,QNRI_YYY); // precomputed QNR - qnr=QNRI_YYY; - } - FP_norm(&t); - FP_add(&D,&t,&one); FP_norm(&D); // Denominator=(1+z.u^2) - - FP_copy(&X1,&A); - FP_neg(&X1,&X1); FP_norm(&X1); // X1=-(J/K).inv(1+z.u^2) - FP_mul(&X2,&X1,&t); // X2=X1*z.u^2 - -// Figure out RHS of Montgomery curve in rational form gx1/d^3 - - FP_sqr(&w,&X1); FP_mul(&w1,&w,&X1); // w=X1^2, w1=X1^3 - FP_mul(&w,&w,&A); FP_mul(&w,&w,&D); FP_add(&w1,&w1,&w); // w1 = X1^3+ADX1^2 - FP_sqr(&w2,&D); - if (!rfc) - { - FP_mul(&w,&X1,&B); - FP_mul(&w2,&w2,&w); // - FP_add(&w1,&w1,&w2); // w1=X1^3+ADX1^2+BD^2X1 - } else { - FP_mul(&w2,&w2,&X1); - FP_add(&w1,&w1,&w2); // w1=X1^3+ADX1^2+D^2X1 // was &X1 - } - FP_norm(&w1); - - FP_mul(&B,&w1,&D); // gx1=num/den^3 - is_qr num*den (same as num/den, same as num/den^3) - qres=FP_qr(&B,&hint); // *** - FP_inv(&w,&B,&hint); - FP_mul(&D,&w,&w1); // 1/D - FP_mul(&X1,&X1,&D); // get X1 - FP_mul(&X2,&X2,&D); // get X2 - FP_sqr(&D,&D); - - FP_imul(&w1,&B,qnr); // now for gx2 = Z.u^2.gx1 - FP_rcopy(&w,CURVE_HTPC); // qnr^C3 - FP_mul(&w,&w,&hint); // modify hint for gx2 - FP_mul(&w2,&D,h); - - FP_cmove(&X1,&X2,1-qres); // pick correct one - FP_cmove(&B,&w1,1-qres); - FP_cmove(&hint,&w,1-qres); - FP_cmove(&D,&w2,1-qres); - - FP_sqrt(&Y,&B,&hint); // sqrt(num*den) - FP_mul(&Y,&Y,&D); // sqrt(num/den^3) - -// correct sign of Y - FP_neg(&w,&Y); FP_norm(&w); - FP_cmove(&Y,&w,qres^FP_sign(&Y)); - - if (!rfc) - { - FP_mul(&X1,&X1,&K); - FP_mul(&Y,&Y,&K); - } - -#if MODTYPE_YYY == GENERALISED_MERSENNE -// Ed448 isogeny - FP_sqr(&t,&X1); // t=u^2 - FP_add(&w,&t,&one); // w=u^2+1 - FP_norm(&w); - FP_sub(&t,&t,&one); // t=u^2-1 - FP_norm(&t); - FP_mul(&w1,&t,&Y); // w1=v(u^2-1) - FP_add(&w1,&w1,&w1); - FP_add(&X2,&w1,&w1); - FP_norm(&X2); // w1=4v(u^2-1) - FP_sqr(&t,&t); // t=(u^2-1)^2 - FP_sqr(&Y,&Y); // v^2 - FP_add(&Y,&Y,&Y); - FP_add(&Y,&Y,&Y); - FP_norm(&Y); // 4v^2 - FP_add(&B,&t,&Y); // w2=(u^2-1)^2+4v^2 - FP_norm(&B); // X1=w1/w2 - X2=w1, B=w2 - - FP_sub(&w2,&Y,&t); // w2=4v^2-(u^2-1)^2 - FP_norm(&w2); - FP_mul(&w2,&w2,&X1); // w2=u(4v^2-(u^2-1)^2) - FP_mul(&t,&t,&X1); // t=u(u^2-1)^2 - FP_div2(&Y,&Y); // 2v^2 - FP_mul(&w1,&Y,&w); // w1=2v^2(u^2+1) - FP_sub(&w1,&t,&w1); // w1=u(u^2-1)^2 - 2v^2(u^2+1) - FP_norm(&w1); // Y=w2/w1 - - FP_mul(&t,&X2,&w1); // output in projective to avoid inversion - FP_copy(&(P->x),&t); - FP_mul(&t,&w2,&B); - FP_copy(&(P->y),&t); - FP_mul(&t,&w1,&B); - FP_copy(&(P->z),&t); - - return; - -#else - FP_add(&w1,&X1,&one); FP_norm(&w1); // (s+1) - FP_sub(&w2,&X1,&one); FP_norm(&w2); // (s-1) - FP_mul(&t,&w1,&Y); - FP_mul(&X1,&X1,&w1); - - if (rfc) - FP_mul(&X1,&X1,&K); - - FP_mul(&Y,&Y,&w2); // output in projective to avoid inversion - FP_copy(&(P->x),&X1); - FP_copy(&(P->y),&Y); - FP_copy(&(P->z),&t); - return; -#endif - -#endif - -#if CURVETYPE_ZZZ==WEIERSTRASS -// SSWU or SVDW method - int sgn,ne; - BIG a,x,y; - FP X1,X2,X3,t,w,one,A,B,Y,D; - FP D2,hint,GX1; - -#if HTC_ISO_ZZZ != 0 -// Map to point on isogenous curve - int i,k,isox,isoy,iso=HTC_ISO_ZZZ; - FP xnum,xden,ynum,yden; - BIG z; - FP_rcopy(&A,CURVE_Ad); - FP_rcopy(&B,CURVE_Bd); -#else - FP_from_int(&A,CURVE_A_ZZZ); - FP_rcopy(&B,CURVE_B); -#endif - - FP_one(&one); - FP_copy(&t,h); - sgn=FP_sign(&t); - -#if CURVE_A_ZZZ != 0 || HTC_ISO_ZZZ != 0 - - FP_sqr(&t,&t); - FP_imul(&t,&t,RIADZ_YYY); // Z from hash-to-point draft standard - FP_add(&w,&t,&one); // w=Zt^2+1 - FP_norm(&w); - - FP_mul(&w,&w,&t); // w=Z^2*t^4+Zt^2 - FP_mul(&D,&A,&w); // A=Aw - - FP_add(&w,&w,&one); FP_norm(&w); - FP_mul(&w,&w,&B); - FP_neg(&w,&w); // -B(w+1) - FP_norm(&w); - - FP_copy(&X2,&w); // Numerators - FP_mul(&X3,&t,&X2); - -// x^3+Ad^2x+Bd^3 - FP_sqr(&GX1,&X2); - FP_sqr(&D2,&D); FP_mul(&w,&A,&D2); FP_add(&GX1,&GX1,&w); FP_norm(&GX1); FP_mul(&GX1,&GX1,&X2); FP_mul(&D2,&D2,&D); FP_mul(&w,&B,&D2); FP_add(&GX1,&GX1,&w); FP_norm(&GX1); - - FP_mul(&w,&GX1,&D); - int qr=FP_qr(&w,&hint); // qr(ad) - only exp happens here - FP_inv(&D,&w,&hint); // d=1/(ad) - FP_mul(&D,&D,&GX1); // 1/d - FP_mul(&X2,&X2,&D); // X2/=D - FP_mul(&X3,&X3,&D); // X3/=D - FP_mul(&t,&t,h); // t=Z.u^3 - FP_sqr(&D2,&D); - - FP_mul(&D,&D2,&t); - FP_imul(&t,&w,RIADZ_YYY); - FP_rcopy(&X1,CURVE_HTPC); - FP_mul(&X1,&X1,&hint); // modify hint - - FP_cmove(&X2,&X3,1-qr); - FP_cmove(&D2,&D,1-qr); - FP_cmove(&w,&t,1-qr); - FP_cmove(&hint,&X1,1-qr); - - FP_sqrt(&Y,&w,&hint); // first candidate if X2 is correct - FP_mul(&Y,&Y,&D2); - - ne=FP_sign(&Y)^sgn; - FP_neg(&w,&Y); FP_norm(&w); - FP_cmove(&Y,&w,ne); - -#if HTC_ISO_ZZZ != 0 - -// (X2,Y) is on isogenous curve - k=0; - isox=iso; - isoy=3*(iso-1)/2; - -// xnum - FP_rcopy(&xnum,PC[k++]); - for (i=0;ix),&t); - - FP_mul(&t,&ynum,&xden); - FP_copy(&(P->y),&t); - - FP_mul(&t,&xden,&yden); - FP_copy(&(P->z),&t); - return; -#else - - FP_redc(x,&X2); - FP_redc(y,&Y); - ECP_set(P,x,y); - return; -#endif -#else -// SVDW - Shallue and van de Woestijne - FP_from_int(&Y,RIADZ_YYY); - ECP_rhs(&A,&Y); // A=g(Z) - FP_rcopy(&B,SQRTm3); - FP_imul(&B,&B,RIADZ_YYY); // B=Z*sqrt(-3) - - FP_sqr(&t,&t); - FP_mul(&Y,&A,&t); // Y=tv1=u^2*g(Z) - FP_add(&t,&one,&Y); FP_norm(&t); // t=tv2=1+tv1 - FP_sub(&Y,&one,&Y); FP_norm(&Y); // Y=tv1=1-tv1 - FP_mul(&D,&t,&Y); - FP_mul(&D,&D,&B); - - FP_copy(&w,&A); - FP_tpo(&D,&w); // D=tv3=inv0(tv1*tv2*Z*sqrt(-3)) and w=sqrt(g(Z)) // *** - - FP_mul(&w,&w,&B); // w=tv4=Z.sqrt(-3).sqrt(g(Z)) - if (FP_sign(&w)==1) - { // depends only on sign of constant RIADZ - FP_neg(&w,&w); - FP_norm(&w); - } - FP_mul(&w,&w,&B); // Z.sqrt(-3) - FP_mul(&w,&w,h); // u - FP_mul(&w,&w,&Y); // tv1 - FP_mul(&w,&w,&D); // tv3 // tv5=u*tv1*tv3*tv4*Z*sqrt(-3) - - FP_from_int(&X1,RIADZ_YYY); - FP_copy(&X3,&X1); - FP_neg(&X1,&X1); FP_norm(&X1); FP_div2(&X1,&X1); // -Z/2 - FP_copy(&X2,&X1); - FP_sub(&X1,&X1,&w); FP_norm(&X1); - FP_add(&X2,&X2,&w); FP_norm(&X2); - FP_add(&A,&A,&A); - FP_add(&A,&A,&A); - FP_norm(&A); // 4*g(Z) - FP_sqr(&t,&t); - FP_mul(&t,&t,&D); - FP_sqr(&t,&t); // (tv2^2*tv3)^2 - FP_mul(&A,&A,&t); // 4*g(Z)*(tv2^2*tv3)^2 - FP_add(&X3,&X3,&A); FP_norm(&X3); - - ECP_rhs(&w,&X2); - FP_cmove(&X3,&X2,FP_qr(&w,NULL)); // *** - ECP_rhs(&w,&X1); - FP_cmove(&X3,&X1,FP_qr(&w,NULL)); // *** - ECP_rhs(&w,&X3); - FP_sqrt(&Y,&w,NULL); // *** - - ne=FP_sign(&Y)^sgn; - FP_neg(&w,&Y); FP_norm(&w); - FP_cmove(&Y,&w,ne); - - FP_redc(x,&X3); - FP_redc(y,&Y); - ECP_set(P,x,y); - return; -#endif - -#endif -} - -/* Hunt and Peck a BIG to a curve point */ -/* -void ZZZ::ECP_hap2point(ECP *P,BIG h) -{ - BIG x; - BIG_copy(x,h); - for (;;) - { -#if CURVETYPE_ZZZ!=MONTGOMERY - ECP_setx(P,x,0); -#else - ECP_set(P,x); -#endif - BIG_inc(x,1); BIG_norm(x); - if (!ECP_isinf(P)) break; - } -} -*/ -/* Map octet to point */ -/* -void ZZZ::ECP_mapit(ECP *P, octet *W) -{ - BIG q, x; - DBIG dx; - BIG_rcopy(q, Modulus); - - BIG_dfromBytesLen(dx,W->val,W->len); - BIG_dmod(x,dx,q); - - ECP_hap2point(P,x); - ECP_cfp(P); -} -*/ -int ZZZ::ECP_generator(ECP *G) -{ - BIG x, y; - BIG_rcopy(x, CURVE_Gx); -#if CURVETYPE_ZZZ!=MONTGOMERY - BIG_rcopy(y, CURVE_Gy); - return ECP_set(G, x, y); -#else - return ECP_set(G, x); -#endif -} - -#ifdef HAS_MAIN - -using namespace ZZZ; - -int main() -{ - int i; - ECP G, P; - csprng RNG; - BIG r, s, x, y, b, m, w, q; - BIG_rcopy(x, CURVE_Gx); -#if CURVETYPE_ZZZ!=MONTGOMERY - BIG_rcopy(y, CURVE_Gy); -#endif - BIG_rcopy(m, Modulus); - - printf("x= "); - BIG_output(x); - printf("\n"); -#if CURVETYPE_ZZZ!=MONTGOMERY - printf("y= "); - BIG_output(y); - printf("\n"); -#endif - RNG_seed(&RNG, 3, "abc"); - -#if CURVETYPE_ZZZ!=MONTGOMERY - ECP_set(&G, x, y); -#else - ECP_set(&G, x); -#endif - if (ECP_isinf(&G)) printf("Failed to set - point not on curve\n"); - else printf("set success\n"); - - ECP_output(&G); - - BIG_rcopy(r, CURVE_Order); //BIG_dec(r,7); - printf("r= "); - BIG_output(r); - printf("\n"); - - ECP_copy(&P, &G); - - ECP_mul(&P, r); - - ECP_output(&P); - BIG_randomnum(w, &RNG); - BIG_mod(w, r); - - ECP_copy(&P, &G); - ECP_mul(&P, w); - - ECP_output(&P); - - return 0; -} - -#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp2.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp2.cpp deleted file mode 100644 index c76094a..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp2.cpp +++ /dev/null @@ -1,998 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE Weierstrass elliptic curve functions over FP2 */ -/* SU=m, m is Stack Usage */ - -#include "ecp2_ZZZ.h" -#include "ecp_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -int ZZZ::ECP2_isinf(ECP2 *P) -{ - return (FP2_iszilch(&(P->x)) & FP2_iszilch(&(P->z))); -} - -/* Set P=Q */ -/* SU= 16 */ -void ZZZ::ECP2_copy(ECP2 *P, ECP2 *Q) -{ - FP2_copy(&(P->x), &(Q->x)); - FP2_copy(&(P->y), &(Q->y)); - FP2_copy(&(P->z), &(Q->z)); -} - -/* set P to Infinity */ -/* SU= 8 */ -void ZZZ::ECP2_inf(ECP2 *P) -{ - FP2_zero(&(P->x)); - FP2_one(&(P->y)); - FP2_zero(&(P->z)); -} - -/* Conditional move Q to P dependant on d */ -static void ECP2_cmove(ZZZ::ECP2 *P, ZZZ::ECP2 *Q, int d) -{ - FP2_cmove(&(P->x), &(Q->x), d); - FP2_cmove(&(P->y), &(Q->y), d); - FP2_cmove(&(P->z), &(Q->z), d); -} - -/* return 1 if b==c, no branching */ -static int teq(sign32 b, sign32 c) -{ - sign32 x = b ^ c; - x -= 1; // if x=0, x now -1 - return (int)((x >> 31) & 1); -} - -/* Constant time select from pre-computed table */ -static void ECP2_select(ZZZ::ECP2 *P, ZZZ::ECP2 W[], sign32 b) -{ - ZZZ::ECP2 MP; - sign32 m = b >> 31; - sign32 babs = (b ^ m) - m; - - babs = (babs - 1) / 2; - - ECP2_cmove(P, &W[0], teq(babs, 0)); // conditional move - ECP2_cmove(P, &W[1], teq(babs, 1)); - ECP2_cmove(P, &W[2], teq(babs, 2)); - ECP2_cmove(P, &W[3], teq(babs, 3)); - ECP2_cmove(P, &W[4], teq(babs, 4)); - ECP2_cmove(P, &W[5], teq(babs, 5)); - ECP2_cmove(P, &W[6], teq(babs, 6)); - ECP2_cmove(P, &W[7], teq(babs, 7)); - - ECP2_copy(&MP, P); - ECP2_neg(&MP); // minus P - ECP2_cmove(P, &MP, (int)(m & 1)); -} - -/* return 1 if P==Q, else 0 */ -/* SU= 312 */ -int ZZZ::ECP2_equals(ECP2 *P, ECP2 *Q) -{ - FP2 a, b; - - FP2_mul(&a, &(P->x), &(Q->z)); - FP2_mul(&b, &(Q->x), &(P->z)); - if (!FP2_equals(&a, &b)) return 0; - - FP2_mul(&a, &(P->y), &(Q->z)); - FP2_mul(&b, &(Q->y), &(P->z)); - if (!FP2_equals(&a, &b)) return 0; - return 1; -} - -/* Make P affine (so z=1) */ -/* SU= 232 */ -void ZZZ::ECP2_affine(ECP2 *P) -{ - FP2 one, iz; - if (ECP2_isinf(P)) return; - - FP2_one(&one); - if (FP2_isunity(&(P->z))) - { - FP2_reduce(&(P->x)); - FP2_reduce(&(P->y)); - return; - } - - FP2_inv(&iz, &(P->z), NULL); - FP2_mul(&(P->x), &(P->x), &iz); - FP2_mul(&(P->y), &(P->y), &iz); - - FP2_reduce(&(P->x)); - FP2_reduce(&(P->y)); - FP2_copy(&(P->z), &one); -} - -/* extract x, y from point P */ -/* SU= 16 */ -int ZZZ::ECP2_get(FP2 *x, FP2 *y, ECP2 *P) -{ - ECP2 W; - ECP2_copy(&W, P); - ECP2_affine(&W); - if (ECP2_isinf(&W)) return -1; - - FP2_copy(y, &(W.y)); - FP2_copy(x, &(W.x)); - return 0; -} - -/* SU= 152 */ -/* Output point P */ -void ZZZ::ECP2_output(ECP2 *P) -{ - FP2 x, y; - if (ECP2_isinf(P)) - { - printf("Infinity\n"); - return; - } - ECP2_get(&x, &y, P); - printf("("); - FP2_output(&x); - printf(","); - FP2_output(&y); - printf(")\n"); -} - -/* SU= 232 */ -void ZZZ::ECP2_outputxyz(ECP2 *P) -{ - ECP2 Q; - if (ECP2_isinf(P)) - { - printf("Infinity\n"); - return; - } - ECP2_copy(&Q, P); - printf("("); - FP2_output(&(Q.x)); - printf(","); - FP2_output(&(Q.y)); - printf(","); - FP2_output(&(Q.z)); - printf(")\n"); -} - -/* SU= 168 */ -/* Convert Q to octet string */ -void ZZZ::ECP2_toOctet(octet *W, ECP2 *Q, bool compress) -{ - FP2 qx, qy; - bool alt=false; - ECP2_get(&qx, &qy, Q); - -#if (MBITS-1)%8 <= 4 -#ifdef ALLOW_ALT_COMPRESS_ZZZ - alt=true; -#endif -#endif - - if (alt) - { - FP2_toBytes(&(W->val[0]),&qx); - if (!compress) - { - W->len=4*MODBYTES_XXX; - FP2_toBytes(&(W->val[2*MODBYTES_XXX]), &qy); - } else { - W->val[0]|=0x80; - if (FP2_islarger(&qy)==1) W->val[0]|=0x20; - W->len=2*MODBYTES_XXX; - } - } else { - FP2_toBytes(&(W->val[1]),&qx); - if (!compress) - { - W->val[0] = 0x04; - FP2_toBytes(&(W->val[2 * MODBYTES_XXX+1]), &qy); - W->len = 4 * MODBYTES_XXX + 1; - } else { - W->val[0]=0x02; - if (FP2_sign(&qy)==1) W->val[0] = 0x03; - W->len = 2 * MODBYTES_XXX + 1; - } - } -} -/* SU= 176 */ -/* restore Q from octet string */ -int ZZZ::ECP2_fromOctet(ECP2 *Q, octet *W) -{ - FP2 qx, qy; - bool alt=false; - int sgn,cmp,typ = W->val[0]; - -#if (MBITS-1)%8 <= 4 -#ifdef ALLOW_ALT_COMPRESS_ZZZ - alt=true; -#endif -#endif - - if (alt) - { - W->val[0]&=0x1f; - FP2_fromBytes(&qx,&(W->val[0])); - W->val[0]=typ; - if ((typ&0x80)==0) - { - FP2_fromBytes(&qy,&(W->val[2*MODBYTES_XXX])); - if (ECP2_set(Q, &qx, &qy)) return 1; - return 0; - } else { - if (!ECP2_setx(Q,&qx,0)) return 0; - sgn=(typ&0x20)>>5; - cmp=FP2_islarger(&(Q->y)); - if ((sgn==1 && cmp!=1) || (sgn==0 && cmp==1)) ECP2_neg(Q); - return 1; - } - - } else { - FP2_fromBytes(&qx,&(W->val[1])); - if (typ == 0x04) - { - FP2_fromBytes(&qy,&(W->val[2 * MODBYTES_XXX+1])); - if (ECP2_set(Q, &qx, &qy)) return 1; - } else { - if (ECP2_setx(Q, &qx, typ&1)) return 1; - } - } - return 0; -} - -/* SU= 128 */ -/* Calculate RHS of twisted curve equation x^3+B/i or x^3+Bi*/ -void ZZZ::ECP2_rhs(FP2 *rhs, FP2 *x) -{ - /* calculate RHS of elliptic curve equation */ - FP2 t; - BIG b; - - FP2_sqr(&t, x); - FP2_mul(rhs, &t, x); - - /* Assuming CURVE_A=0 */ - - BIG_rcopy(b, CURVE_B); - FP2_from_BIG(&t, b); -#if SEXTIC_TWIST_ZZZ == D_TYPE - FP2_div_ip(&t); /* IMPORTANT - here we use the correct SEXTIC twist of the curve */ -#endif - -#if SEXTIC_TWIST_ZZZ == M_TYPE - FP2_norm(&t); - FP2_mul_ip(&t); /* IMPORTANT - here we use the correct SEXTIC twist of the curve */ - FP2_norm(&t); - -#endif - - FP2_add(rhs, &t, rhs); - FP2_reduce(rhs); -} - - -/* Set P=(x,y). Return 1 if (x,y) is on the curve, else return 0*/ -/* SU= 232 */ -int ZZZ::ECP2_set(ECP2 *P, FP2 *x, FP2 *y) -{ - FP2 rhs, y2; - FP2_sqr(&y2, y); - ECP2_rhs(&rhs, x); - - if (!FP2_equals(&y2, &rhs)) - { - ECP2_inf(P); - return 0; - } - - FP2_copy(&(P->x), x); - FP2_copy(&(P->y), y); - - FP2_one(&(P->z)); - return 1; -} - -/* Set P=(x,y). Return 1 if (x,.) is on the curve, else return 0 */ -/* SU= 232 */ -int ZZZ::ECP2_setx(ECP2 *P, FP2 *x, int s) -{ - FP2 y; - FP hint; - ECP2_rhs(&y, x); - - if (!FP2_qr(&y,&hint)) - { - ECP2_inf(P); - return 0; - } - - FP2_sqrt(&y,&y,&hint); - - FP2_copy(&(P->x), x); - FP2_copy(&(P->y), &y); - FP2_one(&(P->z)); - - if (FP2_sign(&(P->y)) != s) - FP2_neg(&(P->y),&(P->y)); - FP2_reduce(&(P->y)); - return 1; -} - -/* Set P=-P */ -/* SU= 8 */ -void ZZZ::ECP2_neg(ECP2 *P) -{ - FP2_norm(&(P->y)); - FP2_neg(&(P->y), &(P->y)); - FP2_norm(&(P->y)); -} - -/* R+=R */ -/* return -1 for Infinity, 0 for addition, 1 for doubling */ -/* SU= 448 */ -int ZZZ::ECP2_dbl(ECP2 *P) -{ - FP2 t0, t1, t2, iy, x3, y3; - - FP2_copy(&iy, &(P->y)); //FP2 iy=new FP2(y); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP2_mul_ip(&iy); //iy.mul_ip(); - FP2_norm(&iy); //iy.norm(); -#endif - FP2_sqr(&t0, &(P->y)); //t0.sqr(); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP2_mul_ip(&t0); //t0.mul_ip(); -#endif - FP2_mul(&t1, &iy, &(P->z)); //t1.mul(z); - FP2_sqr(&t2, &(P->z)); //t2.sqr(); - - FP2_add(&(P->z), &t0, &t0); //z.add(t0); - FP2_norm(&(P->z)); //z.norm(); - FP2_add(&(P->z), &(P->z), &(P->z)); //z.add(z); - FP2_add(&(P->z), &(P->z), &(P->z)); //z.add(z); - FP2_norm(&(P->z)); //z.norm(); - - FP2_imul(&t2, &t2, 3 * CURVE_B_I); //t2.imul(3*ROM.CURVE_B_I); -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP2_mul_ip(&t2); - FP2_norm(&t2); -#endif - - FP2_mul(&x3, &t2, &(P->z)); //x3.mul(z); - - FP2_add(&y3, &t0, &t2); //y3.add(t2); - FP2_norm(&y3); //y3.norm(); - FP2_mul(&(P->z), &(P->z), &t1); //z.mul(t1); - - FP2_add(&t1, &t2, &t2); //t1.add(t2); - FP2_add(&t2, &t2, &t1); //t2.add(t1); - FP2_norm(&t2); //t2.norm(); - FP2_sub(&t0, &t0, &t2); //t0.sub(t2); - FP2_norm(&t0); //t0.norm(); //y^2-9bz^2 - FP2_mul(&y3, &y3, &t0); //y3.mul(t0); - FP2_add(&(P->y), &y3, &x3); //y3.add(x3); //(y^2+3z*2)(y^2-9z^2)+3b.z^2.8y^2 - FP2_mul(&t1, &(P->x), &iy); //t1.mul(iy); - - FP2_norm(&t0); //x.norm(); - FP2_mul(&(P->x), &t0, &t1); //x.mul(t1); - FP2_add(&(P->x), &(P->x), &(P->x)); //x.add(x); //(y^2-9bz^2)xy2 - - FP2_norm(&(P->x)); //x.norm(); - FP2_norm(&(P->y)); //y.norm(); - - return 1; -} - -/* Set P+=Q */ -/* SU= 400 */ -int ZZZ::ECP2_add(ECP2 *P, ECP2 *Q) -{ - FP2 t0, t1, t2, t3, t4, x3, y3, z3; - int b3 = 3 * CURVE_B_I; - - FP2_mul(&t0, &(P->x), &(Q->x)); //t0.mul(Q.x); // x.Q.x - FP2_mul(&t1, &(P->y), &(Q->y)); //t1.mul(Q.y); // y.Q.y - - FP2_mul(&t2, &(P->z), &(Q->z)); //t2.mul(Q.z); - - FP2_add(&t3, &(P->x), &(P->y)); //t3.add(y); - FP2_norm(&t3); //t3.norm(); //t3=X1+Y1 - FP2_add(&t4, &(Q->x), &(Q->y)); //t4.add(Q.y); - FP2_norm(&t4); //t4.norm(); //t4=X2+Y2 - FP2_mul(&t3, &t3, &t4); //t3.mul(t4); //t3=(X1+Y1)(X2+Y2) - - FP2_add(&t4, &t0, &t1); //t4.add(t1); //t4=X1.X2+Y1.Y2 - - FP2_sub(&t3, &t3, &t4); //t3.sub(t4); - FP2_norm(&t3); //t3.norm(); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP2_mul_ip(&t3); //t3.mul_ip(); - FP2_norm(&t3); //t3.norm(); //t3=(X1+Y1)(X2+Y2)-(X1.X2+Y1.Y2) = X1.Y2+X2.Y1 -#endif - FP2_add(&t4, &(P->y), &(P->z)); //t4.add(z); - FP2_norm(&t4); //t4.norm(); //t4=Y1+Z1 - FP2_add(&x3, &(Q->y), &(Q->z)); //x3.add(Q.z); - FP2_norm(&x3); //x3.norm(); //x3=Y2+Z2 - - FP2_mul(&t4, &t4, &x3); //t4.mul(x3); //t4=(Y1+Z1)(Y2+Z2) - FP2_add(&x3, &t1, &t2); //x3.add(t2); //X3=Y1.Y2+Z1.Z2 - - FP2_sub(&t4, &t4, &x3); //t4.sub(x3); - FP2_norm(&t4); //t4.norm(); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP2_mul_ip(&t4); //t4.mul_ip(); - FP2_norm(&t4); //t4.norm(); //t4=(Y1+Z1)(Y2+Z2) - (Y1.Y2+Z1.Z2) = Y1.Z2+Y2.Z1 -#endif - FP2_add(&x3, &(P->x), &(P->z)); //x3.add(z); - FP2_norm(&x3); //x3.norm(); // x3=X1+Z1 - FP2_add(&y3, &(Q->x), &(Q->z)); //y3.add(Q.z); - FP2_norm(&y3); //y3.norm(); // y3=X2+Z2 - FP2_mul(&x3, &x3, &y3); //x3.mul(y3); // x3=(X1+Z1)(X2+Z2) - FP2_add(&y3, &t0, &t2); //y3.add(t2); // y3=X1.X2+Z1+Z2 - FP2_sub(&y3, &x3, &y3); //y3.rsub(x3); - FP2_norm(&y3); //y3.norm(); // y3=(X1+Z1)(X2+Z2) - (X1.X2+Z1.Z2) = X1.Z2+X2.Z1 -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP2_mul_ip(&t0); //t0.mul_ip(); - FP2_norm(&t0); //t0.norm(); // x.Q.x - FP2_mul_ip(&t1); //t1.mul_ip(); - FP2_norm(&t1); //t1.norm(); // y.Q.y -#endif - - FP2_add(&x3, &t0, &t0); //x3.add(t0); - FP2_add(&t0, &t0, &x3); //t0.add(x3); - FP2_norm(&t0); //t0.norm(); - FP2_imul(&t2, &t2, b3); //t2.imul(b); -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP2_mul_ip(&t2); - FP2_norm(&t2); -#endif - - FP2_add(&z3, &t1, &t2); //z3.add(t2); - FP2_norm(&z3); //z3.norm(); - FP2_sub(&t1, &t1, &t2); //t1.sub(t2); - FP2_norm(&t1); //t1.norm(); - - FP2_imul(&y3, &y3, b3); //y3.imul(b); -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP2_mul_ip(&y3); - FP2_norm(&y3); -#endif - - FP2_mul(&x3, &y3, &t4); //x3.mul(t4); - FP2_mul(&t2, &t3, &t1); //t2.mul(t1); - FP2_sub(&(P->x), &t2, &x3); //x3.rsub(t2); - FP2_mul(&y3, &y3, &t0); //y3.mul(t0); - FP2_mul(&t1, &t1, &z3); //t1.mul(z3); - FP2_add(&(P->y), &y3, &t1); //y3.add(t1); - - FP2_mul(&t0, &t0, &t3); //t0.mul(t3); - FP2_mul(&z3, &z3, &t4); //z3.mul(t4); - FP2_add(&(P->z), &z3, &t0); //z3.add(t0); - - FP2_norm(&(P->x)); //x.norm(); - FP2_norm(&(P->y)); //y.norm(); - FP2_norm(&(P->z)); //z.norm(); - - return 0; -} - -/* Set P-=Q */ -/* SU= 16 */ -void ZZZ::ECP2_sub(ECP2 *P, ECP2 *Q) -{ - ECP2 NQ; - ECP2_copy(&NQ, Q); - ECP2_neg(&NQ); - ECP2_add(P, &NQ); -} - -/* P*=e */ -/* SU= 280 */ -void ZZZ::ECP2_mul(ECP2 *P, BIG e) -{ - /* fixed size windows */ - int i, nb, s, ns; - BIG mt, t; - ECP2 Q, W[8], C; - sign8 w[1 + (NLEN_XXX * BASEBITS_XXX + 3) / 4]; - - if (ECP2_isinf(P)) return; - - /* precompute table */ - - ECP2_copy(&Q, P); - ECP2_dbl(&Q); - ECP2_copy(&W[0], P); - - for (i = 1; i < 8; i++) - { - ECP2_copy(&W[i], &W[i - 1]); - ECP2_add(&W[i], &Q); - } - - /* make exponent odd - add 2P if even, P if odd */ - BIG_copy(t, e); - s = BIG_parity(t); - BIG_inc(t, 1); - BIG_norm(t); - ns = BIG_parity(t); - BIG_copy(mt, t); - BIG_inc(mt, 1); - BIG_norm(mt); - BIG_cmove(t, mt, s); - ECP2_cmove(&Q, P, ns); - ECP2_copy(&C, &Q); - - nb = 1 + (BIG_nbits(t) + 3) / 4; - - /* convert exponent to signed 4-bit window */ - for (i = 0; i < nb; i++) - { - w[i] = BIG_lastbits(t, 5) - 16; - BIG_dec(t, w[i]); - BIG_norm(t); - BIG_fshr(t, 4); - } - w[nb] = BIG_lastbits(t, 5); - - //ECP2_copy(P, &W[(w[nb] - 1) / 2]); - ECP2_select(P, W, w[nb]); - for (i = nb - 1; i >= 0; i--) - { - ECP2_select(&Q, W, w[i]); - ECP2_dbl(P); - ECP2_dbl(P); - ECP2_dbl(P); - ECP2_dbl(P); - ECP2_add(P, &Q); - } - ECP2_sub(P, &C); /* apply correction */ -} - -/* Calculates q.P using Frobenius constant X */ -/* SU= 96 */ -void ZZZ::ECP2_frob(ECP2 *P, FP2 *X) -{ - FP2 X2; - FP2_sqr(&X2, X); - FP2_conj(&(P->x), &(P->x)); - FP2_conj(&(P->y), &(P->y)); - FP2_conj(&(P->z), &(P->z)); - FP2_reduce(&(P->z)); - FP2_mul(&(P->x), &X2, &(P->x)); - FP2_mul(&(P->y), &X2, &(P->y)); - FP2_mul(&(P->y), X, &(P->y)); -} - -// Bos & Costello https://eprint.iacr.org/2013/458.pdf -// Faz-Hernandez & Longa & Sanchez https://eprint.iacr.org/2013/158.pdf -// Side channel attack secure - -void ZZZ::ECP2_mul4(ECP2 *P, ECP2 Q[4], BIG u[4]) -{ - int i, j, k, nb, pb, bt; - ECP2 T[8], W; - BIG t[4], mt; - sign8 w[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s[NLEN_XXX * BASEBITS_XXX + 1]; - - for (i = 0; i < 4; i++) - { - BIG_copy(t[i], u[i]); - } - -// Precomputed table - ECP2_copy(&T[0], &Q[0]); // Q[0] - ECP2_copy(&T[1], &T[0]); - ECP2_add(&T[1], &Q[1]); // Q[0]+Q[1] - ECP2_copy(&T[2], &T[0]); - ECP2_add(&T[2], &Q[2]); // Q[0]+Q[2] - ECP2_copy(&T[3], &T[1]); - ECP2_add(&T[3], &Q[2]); // Q[0]+Q[1]+Q[2] - ECP2_copy(&T[4], &T[0]); - ECP2_add(&T[4], &Q[3]); // Q[0]+Q[3] - ECP2_copy(&T[5], &T[1]); - ECP2_add(&T[5], &Q[3]); // Q[0]+Q[1]+Q[3] - ECP2_copy(&T[6], &T[2]); - ECP2_add(&T[6], &Q[3]); // Q[0]+Q[2]+Q[3] - ECP2_copy(&T[7], &T[3]); - ECP2_add(&T[7], &Q[3]); // Q[0]+Q[1]+Q[2]+Q[3] - -// Make it odd - pb = 1 - BIG_parity(t[0]); - BIG_inc(t[0], pb); - BIG_norm(t[0]); - -// Number of bits - BIG_zero(mt); - for (i = 0; i < 4; i++) - { - BIG_or(mt, mt, t[i]); - } - nb = 1 + BIG_nbits(mt); - -// Sign pivot - s[nb - 1] = 1; - for (i = 0; i < nb - 1; i++) - { - BIG_fshr(t[0], 1); - s[i] = 2 * BIG_parity(t[0]) - 1; - } - -// Recoded exponent - for (i = 0; i < nb; i++) - { - w[i] = 0; - k = 1; - for (j = 1; j < 4; j++) - { - bt = s[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w[i] += bt * k; - k *= 2; - } - } - -// Main loop - ECP2_select(P, T, 2 * w[nb - 1] + 1); - for (i = nb - 2; i >= 0; i--) - { - ECP2_select(&W, T, 2 * w[i] + s[i]); - ECP2_dbl(P); - ECP2_add(P, &W); - } - -// apply correction - ECP2_copy(&W, P); - ECP2_sub(&W, &Q[0]); - ECP2_cmove(P, &W, pb); -} - -/* Hunt and Peck a BIG to G2 curve point */ -/* -void ZZZ::ECP2_hap2point(ECP2 *Q,BIG h) -{ - BIG one,hv; - FP2 X; - BIG_one(one); - BIG_copy(hv,h); - for (;;) - { - FP2_from_BIGs(&X,one,hv); - if (ECP2_setx(Q,&X,0)) break; - BIG_inc(hv,1); - BIG_norm(hv); - } -} -*/ - -/* Constant time Map FP2 to Point in G2 */ -void ZZZ::ECP2_map2point(ECP2 *Q,FP2 *H) -{ -// SSWU plus isogenies method - int i,k,sgn,ne,isox,isoy,iso=HTC_ISO_G2_ZZZ; - FP2 X1,X2,X3,W,Y,T,A,NY; - FP s; -#if HTC_ISO_G2_ZZZ != 0 - FP hint; - FP2 ZZ,Ad,Bd,D,D2,GX1; - FP2 xnum,xden,ynum,yden; - FP2_from_ints(&ZZ,RIADZG2A_ZZZ,RIADZG2B_ZZZ); - - FP2_rcopy(&Ad,CURVE_Adr,CURVE_Adi); - FP2_rcopy(&Bd,CURVE_Bdr,CURVE_Bdi); - - FP2_one(&NY); - FP2_copy(&T,H); - sgn=FP2_sign(&T); - - FP2_sqr(&T,&T); - FP2_mul(&T,&T,&ZZ); - FP2_add(&W,&T,&NY); - FP2_norm(&W); - - FP2_mul(&W,&W,&T); - FP2_mul(&D,&Ad,&W); - - FP2_add(&W,&W,&NY); - FP2_norm(&W); - FP2_mul(&W,&W,&Bd); - FP2_neg(&W,&W); - FP2_norm(&W); - - FP2_copy(&X2,&W); // Numerators - FP2_mul(&X3,&T,&X2); - -// x^3+Ad^2x+Bd^3 - FP2_sqr(&GX1,&X2); - FP2_sqr(&D2,&D); FP2_mul(&W,&Ad,&D2); FP2_add(&GX1,&GX1,&W); FP2_norm(&GX1); FP2_mul(&GX1,&GX1,&X2); FP2_mul(&D2,&D2,&D); FP2_mul(&W,&Bd,&D2); FP2_add(&GX1,&GX1,&W); FP2_norm(&GX1); - - FP2_mul(&W,&GX1,&D); - int qr=FP2_qr(&W,&hint); // qr(ad) - only exp happens here - FP2_inv(&D,&W,&hint); // d=1/(ad) - FP2_mul(&D,&D,&GX1); // 1/d - FP2_mul(&X2,&X2,&D); // X2/=D - FP2_mul(&X3,&X3,&D); // X3/=D - FP2_mul(&T,&T,H); // t=Z.u^3 - FP2_sqr(&D2,&D); - -// first solution - X2, W, hint, D2 - - FP2_mul(&D,&D2,&T); // second candidate if X3 is correct - FP2_mul(&T,&W,&ZZ); - - FP_rcopy(&s,CURVE_HTPC2); - FP_mul(&s,&s,&hint); // modify hint - - FP2_cmove(&X2,&X3,1-qr); - FP2_cmove(&W,&T,1-qr); - FP2_cmove(&D2,&D,1-qr); - FP_cmove(&hint,&s,1-qr); - - FP2_sqrt(&Y,&W,&hint); // first candidate if X2 is correct - FP2_mul(&Y,&Y,&D2); - - ne=FP2_sign(&Y)^sgn; - FP2_neg(&NY,&Y); FP2_norm(&NY); - FP2_cmove(&Y,&NY,ne); - -// (X2,Y) is on isogenous curve - - k=0; - isox=iso; - isoy=3*(iso-1)/2; - -// xnum - FP2_rcopy(&xnum,PCR[k],PCI[k]); k++; - for (i=0;ix),&T); - - FP2_mul(&T,&ynum,&xden); - FP2_copy(&(Q->y),&T); - - FP2_mul(&T,&xden,&yden); - FP2_copy(&(Q->z),&T); - -#else -// SVDW - Shallue and van de Woestijne method. - FP Z; - FP2_one(&NY); - FP2_copy(&T,H); - sgn=FP2_sign(&T); - - FP_from_int(&Z,RIADZG2A_YYY); - FP2_from_FP(&A,&Z); - ECP2_rhs(&A,&A); // A=g(Z) - - if (CURVE_B_I==4 && SEXTIC_TWIST_ZZZ==M_TYPE && RIADZG2A_YYY==-1 && RIADZG2B_YYY==0) - { // special case for BLS12381 - FP2_from_ints(&W,2,1); - } else { - FP2_sqrt(&W,&A,NULL); // sqrt(g(Z)) - } - FP_rcopy(&s,SQRTm3); - - FP_mul(&Z,&Z,&s); // Z.sqrt(-3) - - FP2_sqr(&T,&T); - FP2_mul(&Y,&A,&T); // tv1=u^2*g(Z) - FP2_add(&T,&NY,&Y); FP2_norm(&T); // tv2=1+tv1 - FP2_sub(&Y,&NY,&Y); FP2_norm(&Y); // tv1=1-tv1 - FP2_mul(&NY,&T,&Y); - - FP2_pmul(&NY,&NY,&Z); - FP2_inv(&NY,&NY,NULL); // tv3=inv0(tv1*tv2*Z*sqrt(-3)) - - FP2_pmul(&W,&W,&Z); // tv4=Z*sqrt(-3).sqrt(g(Z)) - if (FP2_sign(&W)==1) - { - FP2_neg(&W,&W); - FP2_norm(&W); - } - FP2_pmul(&W,&W,&Z); - FP2_mul(&W,&W,H); - FP2_mul(&W,&W,&Y); - FP2_mul(&W,&W,&NY); // tv5=u*tv1*tv3*tv4*Z*sqrt(-3) - - FP2_from_ints(&X1,RIADZG2A_YYY,RIADZG2B_YYY); - FP2_copy(&X3,&X1); - FP2_neg(&X1,&X1); FP2_norm(&X1); FP2_div2(&X1,&X1); // -Z/2 - FP2_copy(&X2,&X1); - FP2_sub(&X1,&X1,&W); FP2_norm(&X1); - FP2_add(&X2,&X2,&W); FP2_norm(&X2); - FP2_add(&A,&A,&A); - FP2_add(&A,&A,&A); - FP2_norm(&A); // 4*g(Z) - FP2_sqr(&T,&T); - FP2_mul(&T,&T,&NY); - FP2_sqr(&T,&T); // (tv2^2*tv3)^2 - FP2_mul(&A,&A,&T); // 4*g(Z)*(tv2^2*tv3)^2 - FP2_add(&X3,&X3,&A); FP2_norm(&X3); - - ECP2_rhs(&W,&X2); - FP2_cmove(&X3,&X2,FP2_qr(&W,NULL)); - ECP2_rhs(&W,&X1); - FP2_cmove(&X3,&X1,FP2_qr(&W,NULL)); - ECP2_rhs(&W,&X3); - FP2_sqrt(&Y,&W,NULL); - - ne=FP2_sign(&Y)^sgn; - FP2_neg(&W,&Y); FP2_norm(&W); - FP2_cmove(&Y,&W,ne); - - ECP2_set(Q,&X3,&Y); -#endif -} - -/* Map octet to point on G2 */ -/* -void ZZZ::ECP2_mapit(ECP2 *Q, octet *W) -{ - BIG q, x; - DBIG dx; - BIG_rcopy(q, Modulus); - - BIG_dfromBytesLen(dx,W->val,W->len); - BIG_dmod(x,dx,q); - - ECP2_hap2point(Q,x); - ECP2_cfp(Q); -} -*/ -/* cofactor product */ -void ZZZ::ECP2_cfp(ECP2 *Q) -{ -// FP Fx, Fy; - FP2 X; - BIG x; -#if (PAIRING_FRIENDLY_ZZZ == BN_CURVE) - ECP2 T, K; -#elif (PAIRING_FRIENDLY_ZZZ > BN_CURVE) - ECP2 xQ, x2Q; -#endif -// FP_rcopy(&Fx, Fra); -// FP_rcopy(&Fy, Frb); -// FP2_from_FPs(&X, &Fx, &Fy); - - FP2_rcopy(&X,Fra,Frb); - -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP2_inv(&X, &X,NULL); - FP2_norm(&X); -#endif - - BIG_rcopy(x, CURVE_Bnx); - -#if (PAIRING_FRIENDLY_ZZZ == BN_CURVE) - - // Faster Hashing to G2 - Fuentes-Castaneda, Knapp and Rodriguez-Henriquez - // Q -> xQ + F(3xQ) + F(F(xQ)) + F(F(F(Q))). - ECP2_copy(&T, Q); - ECP2_mul(&T, x); -#if SIGN_OF_X_ZZZ==NEGATIVEX - ECP2_neg(&T); // our x is negative -#endif - ECP2_copy(&K, &T); - ECP2_dbl(&K); - ECP2_add(&K, &T); - - ECP2_frob(&K, &X); - ECP2_frob(Q, &X); - ECP2_frob(Q, &X); - ECP2_frob(Q, &X); - ECP2_add(Q, &T); - ECP2_add(Q, &K); - ECP2_frob(&T, &X); - ECP2_frob(&T, &X); - ECP2_add(Q, &T); -#elif (PAIRING_FRIENDLY_ZZZ > BN_CURVE) - - // Efficient hash maps to G2 on BLS curves - Budroni, Pintore - // Q -> x2Q -xQ -Q +F(xQ -Q) +F(F(2Q)) - - ECP2_copy(&xQ, Q); - ECP2_mul(&xQ, x); - ECP2_copy(&x2Q, &xQ); - ECP2_mul(&x2Q, x); - -#if SIGN_OF_X_ZZZ==NEGATIVEX - ECP2_neg(&xQ); -#endif - - ECP2_sub(&x2Q, &xQ); - ECP2_sub(&x2Q, Q); - - ECP2_sub(&xQ, Q); - ECP2_frob(&xQ, &X); - - ECP2_dbl(Q); - ECP2_frob(Q, &X); - ECP2_frob(Q, &X); - - ECP2_add(Q, &x2Q); - ECP2_add(Q, &xQ); - -#endif -} - -int ZZZ::ECP2_generator(ECP2 *G) -{ - FP2 wx, wy; - FP2_rcopy(&wx,CURVE_Pxa,CURVE_Pxb); - FP2_rcopy(&wy,CURVE_Pya,CURVE_Pyb); -// FP_rcopy(&(wx.a), CURVE_Pxa); -// FP_rcopy(&(wx.b), CURVE_Pxb); -// FP_rcopy(&(wy.a), CURVE_Pya); -// FP_rcopy(&(wy.b), CURVE_Pyb); - return ECP2_set(G, &wx, &wy); -} - - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp4.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp4.cpp deleted file mode 100644 index cdcfd15..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp4.cpp +++ /dev/null @@ -1,952 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE Weierstrass elliptic curve functions over FP2 */ - -//#include -#include "ecp4_ZZZ.h" - -using namespace std; -using namespace XXX; -using namespace YYY; - -int ZZZ::ECP4_isinf(ECP4 *P) -{ - return (FP4_iszilch(&(P->x)) & FP4_iszilch(&(P->z))); -} - -/* Set P=Q */ -void ZZZ::ECP4_copy(ECP4 *P, ECP4 *Q) -{ - FP4_copy(&(P->x), &(Q->x)); - FP4_copy(&(P->y), &(Q->y)); - FP4_copy(&(P->z), &(Q->z)); -} - -/* set P to Infinity */ -void ZZZ::ECP4_inf(ECP4 *P) -{ - FP4_zero(&(P->x)); - FP4_one(&(P->y)); - FP4_zero(&(P->z)); -} - -/* Conditional move Q to P dependant on d */ -static void ECP4_cmove(ZZZ::ECP4 *P, ZZZ::ECP4 *Q, int d) -{ - FP4_cmove(&(P->x), &(Q->x), d); - FP4_cmove(&(P->y), &(Q->y), d); - FP4_cmove(&(P->z), &(Q->z), d); -} - -/* return 1 if b==c, no branching */ -static int teq(sign32 b, sign32 c) -{ - sign32 x = b ^ c; - x -= 1; // if x=0, x now -1 - return (int)((x >> 31) & 1); -} - -/* Constant time select from pre-computed table */ -static void ECP4_select(ZZZ::ECP4 *P, ZZZ::ECP4 W[], sign32 b) -{ - ZZZ::ECP4 MP; - sign32 m = b >> 31; - sign32 babs = (b ^ m) - m; - - babs = (babs - 1) / 2; - - ECP4_cmove(P, &W[0], teq(babs, 0)); // conditional move - ECP4_cmove(P, &W[1], teq(babs, 1)); - ECP4_cmove(P, &W[2], teq(babs, 2)); - ECP4_cmove(P, &W[3], teq(babs, 3)); - ECP4_cmove(P, &W[4], teq(babs, 4)); - ECP4_cmove(P, &W[5], teq(babs, 5)); - ECP4_cmove(P, &W[6], teq(babs, 6)); - ECP4_cmove(P, &W[7], teq(babs, 7)); - - ECP4_copy(&MP, P); - ECP4_neg(&MP); // minus P - ECP4_cmove(P, &MP, (int)(m & 1)); -} - -/* Make P affine (so z=1) */ -void ZZZ::ECP4_affine(ECP4 *P) -{ - FP4 one, iz; - if (ECP4_isinf(P)) return; - - FP4_one(&one); - if (FP4_isunity(&(P->z))) - { - FP4_reduce(&(P->x)); - FP4_reduce(&(P->y)); - return; - } - - FP4_inv(&iz, &(P->z),NULL); - FP4_mul(&(P->x), &(P->x), &iz); - FP4_mul(&(P->y), &(P->y), &iz); - - FP4_reduce(&(P->x)); - FP4_reduce(&(P->y)); - FP4_copy(&(P->z), &one); -} - -/* return 1 if P==Q, else 0 */ -/* SU= 312 */ -int ZZZ::ECP4_equals(ECP4 *P, ECP4 *Q) -{ - FP4 a, b; - - FP4_mul(&a, &(P->x), &(Q->z)); - FP4_mul(&b, &(Q->x), &(P->z)); - if (!FP4_equals(&a, &b)) return 0; - - FP4_mul(&a, &(P->y), &(Q->z)); - FP4_mul(&b, &(Q->y), &(P->z)); - if (!FP4_equals(&a, &b)) return 0; - return 1; - -} - -/* extract x, y from point P */ -int ZZZ::ECP4_get(FP4 *x, FP4 *y, ECP4 *P) -{ - ECP4 W; - ECP4_copy(&W, P); - ECP4_affine(&W); - if (ECP4_isinf(&W)) return -1; - FP4_copy(y, &(W.y)); - FP4_copy(x, &(W.x)); - return 0; -} - -/* Output point P */ -void ZZZ::ECP4_output(ECP4 *P) -{ - FP4 x, y; - if (ECP4_isinf(P)) - { - printf("Infinity\n"); - return; - } - ECP4_get(&x, &y, P); - printf("("); - FP4_output(&x); - printf(","); - FP4_output(&y); - printf(")\n"); -} - -/* Convert Q to octet string */ -void ZZZ::ECP4_toOctet(octet *W, ECP4 *Q,bool compress) -{ - FP4 qx, qy; - bool alt=false; - ECP4_get(&qx, &qy, Q); - -#if (MBITS-1)%8 <= 4 -#ifdef ALLOW_ALT_COMPRESS_ZZZ - alt=true; -#endif -#endif - - if (alt) - { - FP4_toBytes(&(W->val[0]),&qx); - if (!compress) - { - W->len=8*MODBYTES_XXX; - FP4_toBytes(&(W->val[4*MODBYTES_XXX]), &qy); - } else { - W->val[0]|=0x80; - if (FP4_islarger(&qy)==1) W->val[0]|=0x20; - W->len=4*MODBYTES_XXX; - } - } else { - FP4_toBytes(&(W->val[1]),&qx); - if (!compress) - { - W->val[0] = 0x04; - FP4_toBytes(&(W->val[4 * MODBYTES_XXX+1]), &qy); - W->len = 8 * MODBYTES_XXX+1; - } else { - W->val[0]=0x02; - if (FP4_sign(&qy)==1) W->val[0] = 0x03; - W->len = 4 * MODBYTES_XXX+1; - } - } -} - -/* restore Q from octet string */ -int ZZZ::ECP4_fromOctet(ECP4 *Q, octet *W) -{ - FP4 qx, qy; - bool alt=false; - int sgn,cmp,typ = W->val[0]; - -#if (MBITS-1)%8 <= 4 -#ifdef ALLOW_ALT_COMPRESS_ZZZ - alt=true; -#endif -#endif - - if (alt) - { - W->val[0]&=0x1f; - FP4_fromBytes(&qx,&(W->val[0])); - W->val[0]=typ; - if ((typ&0x80)==0) - { - FP4_fromBytes(&qy,&(W->val[4*MODBYTES_XXX])); - if (ECP4_set(Q, &qx, &qy)) return 1; - return 0; - } else { - if (!ECP4_setx(Q,&qx,0)) return 0; - sgn=(typ&0x20)>>5; - cmp=FP4_islarger(&(Q->y)); - if ((sgn==1 && cmp!=1) || (sgn==0 && cmp==1)) ECP4_neg(Q); - return 1; - } - } else { - FP4_fromBytes(&qx,&(W->val[1])); - if (typ == 0x04) - { - FP4_fromBytes(&qy,&(W->val[4 * MODBYTES_XXX+1])); - if (ECP4_set(Q, &qx, &qy)) return 1; - } else { - if (ECP4_setx(Q, &qx, typ&1)) return 1; - } - } - return 0; -} - -/* Calculate RHS of twisted curve equation x^3+B/i or x^3+Bi*/ -void ZZZ::ECP4_rhs(FP4 *rhs, FP4 *x) -{ - /* calculate RHS of elliptic curve equation */ - FP4 t; - FP2 t2; - BIG b; - FP4_sqr(&t, x); - - FP4_mul(rhs, &t, x); - - /* Assuming CURVE_A=0 */ - - BIG_rcopy(b, CURVE_B); - - FP2_from_BIG(&t2, b); - FP4_from_FP2(&t, &t2); - -#if SEXTIC_TWIST_ZZZ == D_TYPE - FP4_div_i(&t); /* IMPORTANT - here we use the correct SEXTIC twist of the curve */ -#endif - -#if SEXTIC_TWIST_ZZZ == M_TYPE - FP4_times_i(&t); /* IMPORTANT - here we use the correct SEXTIC twist of the curve */ -#endif - - FP4_add(rhs, &t, rhs); - FP4_reduce(rhs); -} - -/* Set P=(x,y). Return 1 if (x,y) is on the curve, else return 0*/ -/* SU= 232 */ -int ZZZ::ECP4_set(ECP4 *P, FP4 *x, FP4 *y) -{ - FP4 rhs, y2; - - FP4_sqr(&y2, y); - ECP4_rhs(&rhs, x); - - if (!FP4_equals(&y2, &rhs)) - { - ECP4_inf(P); - return 0; - } - - FP4_copy(&(P->x), x); - FP4_copy(&(P->y), y); - - FP4_one(&(P->z)); - return 1; -} - -/* Set P=(x,y). Return 1 if (x,.) is on the curve, else return 0 */ -/* SU= 232 */ -int ZZZ::ECP4_setx(ECP4 *P, FP4 *x, int s) -{ - FP4 y; - FP hint; - ECP4_rhs(&y, x); - - if (!FP4_qr(&y,&hint)) - { - ECP4_inf(P); - return 0; - } - FP4_sqrt(&y, &y, &hint); - - FP4_copy(&(P->x), x); - FP4_copy(&(P->y), &y); - FP4_one(&(P->z)); - - if (FP4_sign(&(P->y)) != s) - FP4_neg(&(P->y),&(P->y)); - FP4_reduce(&(P->y)); - - return 1; -} - -/* Set P=-P */ -/* SU= 8 */ -void ZZZ::ECP4_neg(ECP4 *P) -{ - FP4_norm(&(P->y)); - FP4_neg(&(P->y), &(P->y)); - FP4_norm(&(P->y)); -} - -/* R+=R */ -/* return -1 for Infinity, 0 for addition, 1 for doubling */ -int ZZZ::ECP4_dbl(ECP4 *P) -{ - FP4 t0, t1, t2, t3, iy, x3, y3; - - FP4_copy(&iy, &(P->y)); //FP4 iy=new FP4(y); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP4_times_i(&iy); //iy.mul_ip(); -#endif - - FP4_sqr(&t0, &(P->y)); //t0.sqr(); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP4_times_i(&t0); //t0.mul_ip(); -#endif - - FP4_mul(&t1, &iy, &(P->z)); //t1.mul(z); - FP4_sqr(&t2, &(P->z)); //t2.sqr(); - - FP4_add(&(P->z), &t0, &t0); //z.add(t0); - FP4_norm(&(P->z)); //z.norm(); - FP4_add(&(P->z), &(P->z), &(P->z)); //z.add(z); - FP4_add(&(P->z), &(P->z), &(P->z)); //z.add(z); - FP4_norm(&(P->z)); //z.norm(); - - FP4_imul(&t2, &t2, 3 * CURVE_B_I); //t2.imul(3*ROM.CURVE_B_I); -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP4_times_i(&t2); -#endif - - FP4_mul(&x3, &t2, &(P->z)); //x3.mul(z); - - FP4_add(&y3, &t0, &t2); //y3.add(t2); - FP4_norm(&y3); //y3.norm(); - FP4_mul(&(P->z), &(P->z), &t1); //z.mul(t1); - - FP4_add(&t1, &t2, &t2); //t1.add(t2); - FP4_add(&t2, &t2, &t1); //t2.add(t1); - FP4_norm(&t2); //t2.norm(); - FP4_sub(&t0, &t0, &t2); //t0.sub(t2); - FP4_norm(&t0); //t0.norm(); //y^2-9bz^2 - FP4_mul(&y3, &y3, &t0); //y3.mul(t0); - FP4_add(&(P->y), &y3, &x3); //y3.add(x3); //(y^2+3z*2)(y^2-9z^2)+3b.z^2.8y^2 - - FP4_mul(&t1, &(P->x), &iy); //t1.mul(iy); // - - FP4_norm(&t0); //x.norm(); - FP4_mul(&(P->x), &t0, &t1); //x.mul(t1); - FP4_add(&(P->x), &(P->x), &(P->x)); //x.add(x); //(y^2-9bz^2)xy2 - - FP4_norm(&(P->x)); //x.norm(); - - FP4_norm(&(P->y)); //y.norm(); - - return 1; -} - -/* Set P+=Q */ - -int ZZZ::ECP4_add(ECP4 *P, ECP4 *Q) -{ - FP4 t0, t1, t2, t3, t4, x3, y3, z3; - int b3 = 3 * CURVE_B_I; - - FP4_mul(&t0, &(P->x), &(Q->x)); //t0.mul(Q.x); // x.Q.x - FP4_mul(&t1, &(P->y), &(Q->y)); //t1.mul(Q.y); // y.Q.y - - FP4_mul(&t2, &(P->z), &(Q->z)); //t2.mul(Q.z); - FP4_add(&t3, &(P->x), &(P->y)); //t3.add(y); - FP4_norm(&t3); //t3.norm(); //t3=X1+Y1 - FP4_add(&t4, &(Q->x), &(Q->y)); //t4.add(Q.y); - FP4_norm(&t4); //t4.norm(); //t4=X2+Y2 - FP4_mul(&t3, &t3, &t4); //t3.mul(t4); //t3=(X1+Y1)(X2+Y2) - FP4_add(&t4, &t0, &t1); //t4.add(t1); //t4=X1.X2+Y1.Y2 - - FP4_sub(&t3, &t3, &t4); //t3.sub(t4); - FP4_norm(&t3); //t3.norm(); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP4_times_i(&t3); //t3.mul_ip(); -#endif - - FP4_add(&t4, &(P->y), &(P->z)); //t4.add(z); - FP4_norm(&t4); //t4.norm(); //t4=Y1+Z1 - - FP4_add(&x3, &(Q->y), &(Q->z)); //x3.add(Q.z); - FP4_norm(&x3); //x3.norm(); //x3=Y2+Z2 - - FP4_mul(&t4, &t4, &x3); //t4.mul(x3); //t4=(Y1+Z1)(Y2+Z2) - - FP4_add(&x3, &t1, &t2); //x3.add(t2); //X3=Y1.Y2+Z1.Z2 - - FP4_sub(&t4, &t4, &x3); //t4.sub(x3); - FP4_norm(&t4); //t4.norm(); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP4_times_i(&t4); //t4.mul_ip(); -#endif - - FP4_add(&x3, &(P->x), &(P->z)); //x3.add(z); - FP4_norm(&x3); //x3.norm(); // x3=X1+Z1 - - FP4_add(&y3, &(Q->x), &(Q->z)); //y3.add(Q.z); - FP4_norm(&y3); //y3.norm(); // y3=X2+Z2 - FP4_mul(&x3, &x3, &y3); //x3.mul(y3); // x3=(X1+Z1)(X2+Z2) - - FP4_add(&y3, &t0, &t2); //y3.add(t2); // y3=X1.X2+Z1+Z2 - FP4_sub(&y3, &x3, &y3); //y3.rsub(x3); - FP4_norm(&y3); //y3.norm(); // y3=(X1+Z1)(X2+Z2) - (X1.X2+Z1.Z2) = X1.Z2+X2.Z1 -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP4_times_i(&t0); //t0.mul_ip(); - FP4_times_i(&t1); //t1.mul_ip(); -#endif - - FP4_add(&x3, &t0, &t0); //x3.add(t0); - FP4_add(&t0, &t0, &x3); //t0.add(x3); - FP4_norm(&t0); //t0.norm(); - FP4_imul(&t2, &t2, b3); //t2.imul(b); -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP4_times_i(&t2); -#endif - - FP4_add(&z3, &t1, &t2); //z3.add(t2); - FP4_norm(&z3); //z3.norm(); - FP4_sub(&t1, &t1, &t2); //t1.sub(t2); - FP4_norm(&t1); //t1.norm(); - FP4_imul(&y3, &y3, b3); //y3.imul(b); -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP4_times_i(&y3); -#endif - - FP4_mul(&x3, &y3, &t4); //x3.mul(t4); - - FP4_mul(&t2, &t3, &t1); //t2.mul(t1); - FP4_sub(&(P->x), &t2, &x3); //x3.rsub(t2); - FP4_mul(&y3, &y3, &t0); //y3.mul(t0); - FP4_mul(&t1, &t1, &z3); //t1.mul(z3); - FP4_add(&(P->y), &y3, &t1); //y3.add(t1); - FP4_mul(&t0, &t0, &t3); //t0.mul(t3); - FP4_mul(&z3, &z3, &t4); //z3.mul(t4); - FP4_add(&(P->z), &z3, &t0); //z3.add(t0); - - FP4_norm(&(P->x)); //x.norm(); - FP4_norm(&(P->y)); //y.norm(); - FP4_norm(&(P->z)); //z.norm(); - - return 0; -} - -/* Set P-=Q */ -/* SU= 16 */ -void ZZZ::ECP4_sub(ECP4 *P, ECP4 *Q) -{ - ECP4 NQ; - ECP4_copy(&NQ, Q); - ECP4_neg(&NQ); - ECP4_add(P, &NQ); -} - - -void ZZZ::ECP4_reduce(ECP4 *P) -{ - FP4_reduce(&(P->x)); - FP4_reduce(&(P->y)); - FP4_reduce(&(P->z)); -} - -/* P*=e */ -/* SU= 280 */ -void ZZZ::ECP4_mul(ECP4 *P, BIG e) -{ - /* fixed size windows */ - int i, nb, s, ns; - BIG mt, t; - ECP4 Q, W[8], C; - sign8 w[1 + (NLEN_XXX * BASEBITS_XXX + 3) / 4]; - - if (ECP4_isinf(P)) return; - - /* precompute table */ - - ECP4_copy(&Q, P); - ECP4_dbl(&Q); - ECP4_copy(&W[0], P); - - for (i = 1; i < 8; i++) - { - ECP4_copy(&W[i], &W[i - 1]); - ECP4_add(&W[i], &Q); - } - - /* make exponent odd - add 2P if even, P if odd */ - BIG_copy(t, e); - s = BIG_parity(t); - BIG_inc(t, 1); - BIG_norm(t); - ns = BIG_parity(t); - BIG_copy(mt, t); - BIG_inc(mt, 1); - BIG_norm(mt); - BIG_cmove(t, mt, s); - ECP4_cmove(&Q, P, ns); - ECP4_copy(&C, &Q); - - nb = 1 + (BIG_nbits(t) + 3) / 4; - - /* convert exponent to signed 4-bit window */ - for (i = 0; i < nb; i++) - { - w[i] = BIG_lastbits(t, 5) - 16; - BIG_dec(t, w[i]); - BIG_norm(t); - BIG_fshr(t, 4); - } - w[nb] = BIG_lastbits(t, 5); - - //ECP4_copy(P, &W[(w[nb] - 1) / 2]); - ECP4_select(P, W, w[nb]); - for (i = nb - 1; i >= 0; i--) - { - ECP4_select(&Q, W, w[i]); - ECP4_dbl(P); - ECP4_dbl(P); - ECP4_dbl(P); - ECP4_dbl(P); - ECP4_add(P, &Q); - } - ECP4_sub(P, &C); /* apply correction */ - ECP4_affine(P); -} - -// calculate frobenius constants -void ZZZ::ECP4_frob_constants(FP2 F[3]) -{ - FP fx, fy; - FP2 X; - - FP_rcopy(&fx, Fra); - FP_rcopy(&fy, Frb); - FP2_from_FPs(&X, &fx, &fy); - - FP2_sqr(&F[0], &X); // FF=F^2=(1+i)^(p-7)/6 - FP2_copy(&F[2], &F[0]); - FP2_mul_ip(&F[2]); // W=(1+i)^6/6.(1+i)^(p-7)/6 = (1+i)^(p-1)/6 - FP2_norm(&F[2]); - FP2_sqr(&F[1], &F[2]); - FP2_mul(&F[2], &F[2], &F[1]); // W=(1+i)^(p-1)/2 - - FP2_copy(&F[1], &X); - -#if SEXTIC_TWIST_ZZZ == M_TYPE - FP2_mul_ip(&F[1]); // (1+i)^12/12.(1+i)^(p-7)/12 = (1+i)^(p+5)/12 - FP2_inv(&F[1], &F[1], NULL); // (1+i)^-(p+5)/12 - FP2_sqr(&F[0], &F[1]); // (1+i)^-(p+5)/6 -#endif - - FP2_mul_ip(&F[0]); // FF=(1+i)^(p-7)/6.(1+i) = (1+i)^(p-1)/6 // (1+i)^6/6.(1+i)^-(p+5)/6 = (1+i)^-(p-1)/6 - FP2_norm(&F[0]); - FP2_mul(&F[1], &F[1], &F[0]); // FFF = (1+i)^(p-7)/12 . (1+i)^(p-1)/6 = (1+i)^(p-3)/4 // (1+i)^-(p+5)/12 . (1+i)^-(p-1)/6 = (1+i)^-(p+1)/4 - -} - -/* Calculates q^n.P using Frobenius constants */ -void ZZZ::ECP4_frob(ECP4 *P, FP2 F[3], int n) -{ - int i; - FP4 X, Y, Z; - - FP4_copy(&X, &(P->x)); - FP4_copy(&Y, &(P->y)); - FP4_copy(&Z, &(P->z)); - - for (i = 0; i < n; i++) - { - FP4_frob(&X, &F[2]); // X^p - FP4_pmul(&X, &X, &F[0]); // X^p.(1+i)^(p-1)/6 // X^p.(1+i)^-(p-1)/6 - - FP4_frob(&Y, &F[2]); // Y^p - FP4_pmul(&Y, &Y, &F[1]); - FP4_times_i(&Y); // Y.p.(1+i)^(p-3)/4.(1+i)^(2/4) = Y^p.(1+i)^(p-1)/4 // (1+i)^-(p+1)/4 .(1+i)^2/4 = Y^p.(1+i)^-(p-1)/4 - - FP4_frob(&Z, &F[2]); - } - - FP4_copy(&(P->x), &X); - FP4_copy(&(P->y), &Y); - FP4_copy(&(P->z), &Z); - - - //ECP4_set(P,&X,&Y); -} - -/* Side channel attack secure */ -// Bos & Costello https://eprint.iacr.org/2013/458.pdf -// Faz-Hernandez & Longa & Sanchez https://eprint.iacr.org/2013/158.pdf - -void ZZZ::ECP4_mul8(ECP4 *P, ECP4 Q[8], BIG u[8]) -{ - int i, j, k, nb, pb1, pb2, bt; - ECP4 T1[8], T2[8], W; - BIG mt, t[8]; - sign8 w1[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s1[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 w2[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s2[NLEN_XXX * BASEBITS_XXX + 1]; -// FP2 X[3]; - /* - ECP4_frob_constants(X); - */ - for (i = 0; i < 8; i++) - { - BIG_copy(t[i], u[i]); - } -// Precomputed tables - ECP4_copy(&T1[0], &Q[0]); // Q[0] - ECP4_copy(&T1[1], &T1[0]); - ECP4_add(&T1[1], &Q[1]); // Q[0]+Q[1] - ECP4_copy(&T1[2], &T1[0]); - ECP4_add(&T1[2], &Q[2]); // Q[0]+Q[2] - ECP4_copy(&T1[3], &T1[1]); - ECP4_add(&T1[3], &Q[2]); // Q[0]+Q[1]+Q[2] - ECP4_copy(&T1[4], &T1[0]); - ECP4_add(&T1[4], &Q[3]); // Q[0]+Q[3] - ECP4_copy(&T1[5], &T1[1]); - ECP4_add(&T1[5], &Q[3]); // Q[0]+Q[1]+Q[3] - ECP4_copy(&T1[6], &T1[2]); - ECP4_add(&T1[6], &Q[3]); // Q[0]+Q[2]+Q[3] - ECP4_copy(&T1[7], &T1[3]); - ECP4_add(&T1[7], &Q[3]); // Q[0]+Q[1]+Q[2]+Q[3] - - ECP4_copy(&T2[0], &Q[4]); // Q[0] - ECP4_copy(&T2[1], &T2[0]); - ECP4_add(&T2[1], &Q[5]); // Q[0]+Q[1] - ECP4_copy(&T2[2], &T2[0]); - ECP4_add(&T2[2], &Q[6]); // Q[0]+Q[2] - ECP4_copy(&T2[3], &T2[1]); - ECP4_add(&T2[3], &Q[6]); // Q[0]+Q[1]+Q[2] - ECP4_copy(&T2[4], &T2[0]); - ECP4_add(&T2[4], &Q[7]); // Q[0]+Q[3] - ECP4_copy(&T2[5], &T2[1]); - ECP4_add(&T2[5], &Q[7]); // Q[0]+Q[1]+Q[3] - ECP4_copy(&T2[6], &T2[2]); - ECP4_add(&T2[6], &Q[7]); // Q[0]+Q[2]+Q[3] - ECP4_copy(&T2[7], &T2[3]); - ECP4_add(&T2[7], &Q[7]); // Q[0]+Q[1]+Q[2]+Q[3] - -// Use Frobenius - /* - for (i=0;i<8;i++) - { - ECP4_copy(&T2[i],&T1[i]); - ECP4_frob(&T2[i],X,4); - } - */ -// Make them odd - pb1 = 1 - BIG_parity(t[0]); - BIG_inc(t[0], pb1); - BIG_norm(t[0]); - - pb2 = 1 - BIG_parity(t[4]); - BIG_inc(t[4], pb2); - BIG_norm(t[4]); - -// Number of bits - BIG_zero(mt); - for (i = 0; i < 8; i++) - { - BIG_or(mt, mt, t[i]); - } - nb = 1 + BIG_nbits(mt); - -// Sign pivot - s1[nb - 1] = 1; - s2[nb - 1] = 1; - for (i = 0; i < nb - 1; i++) - { - BIG_fshr(t[0], 1); - s1[i] = 2 * BIG_parity(t[0]) - 1; - BIG_fshr(t[4], 1); - s2[i] = 2 * BIG_parity(t[4]) - 1; - } - - -// Recoded exponents - for (i = 0; i < nb; i++) - { - w1[i] = 0; - k = 1; - for (j = 1; j < 4; j++) - { - bt = s1[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w1[i] += bt * k; - k *= 2; - } - - w2[i] = 0; - k = 1; - for (j = 5; j < 8; j++) - { - bt = s2[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w2[i] += bt * k; - k *= 2; - } - } - -// Main loop - ECP4_select(P, T1, 2 * w1[nb - 1] + 1); - ECP4_select(&W, T2, 2 * w2[nb - 1] + 1); - ECP4_add(P, &W); - for (i = nb - 2; i >= 0; i--) - { - ECP4_dbl(P); - ECP4_select(&W, T1, 2 * w1[i] + s1[i]); - ECP4_add(P, &W); - ECP4_select(&W, T2, 2 * w2[i] + s2[i]); - ECP4_add(P, &W); - } - -// apply corrections - ECP4_copy(&W, P); - ECP4_sub(&W, &Q[0]); - ECP4_cmove(P, &W, pb1); - ECP4_copy(&W, P); - ECP4_sub(&W, &Q[4]); - ECP4_cmove(P, &W, pb2); - - ECP4_affine(P); -} - -/* Hunt and Peck a BIG to G2 curve point */ -/* -void ZZZ::ECP4_hap2point(ECP4 *Q,BIG h) -{ - BIG one,hv; - FP2 X2; - FP4 X4; - BIG_one(one); - BIG_copy(hv,h); - - for (;;) - { - FP2_from_BIGs(&X2,one,hv); - FP4_from_FP2(&X4,&X2); - if (ECP4_setx(Q,&X4,0)) break; - BIG_inc(hv,1); - BIG_norm(hv); - } -} -*/ -/* Constant time Map BIG to Point in G2 */ -void ZZZ::ECP4_map2point(ECP4 *Q,FP4 *H) -{ - int sgn,ne; - FP4 X1,X2,X3,W,Y,T,A,NY; - FP Z,s; - - FP4_one(&NY); - FP4_copy(&T,H); - sgn=FP4_sign(&T); - - FP_from_int(&Z,RIADZG2A_YYY); - FP4_from_FP(&A,&Z); - ECP4_rhs(&A,&A); // A=g(Z) - - FP4_sqrt(&W,&A,NULL); - FP_rcopy(&s,SQRTm3); - - FP_mul(&Z,&Z,&s); - - FP4_sqr(&T,&T); - FP4_mul(&Y,&A,&T); // tv1=u^2*g(Z) - FP4_add(&T,&NY,&Y); FP4_norm(&T); // tv2=1+tv1 - FP4_sub(&Y,&NY,&Y); FP4_norm(&Y); // tv1=1-tv1 - FP4_mul(&NY,&T,&Y); - - FP4_qmul(&NY,&NY,&Z); - - FP4_inv(&NY,&NY,NULL); // tv3=inv0(tv1*tv2*Z*sqrt(-3)) - FP4_qmul(&W,&W,&Z); // tv4=Z*sqrt(-3).sqrt(g(Z)) - if (FP4_sign(&W)==1) - { - FP4_neg(&W,&W); - FP4_norm(&W); - } - FP4_qmul(&W,&W,&Z); - FP4_mul(&W,&W,H); - FP4_mul(&W,&W,&Y); - FP4_mul(&W,&W,&NY); // tv5=u*tv1*tv3*tv4*Z*sqrt(-3) - - FP_from_int(&s,RIADZG2A_YYY); - FP4_from_FP(&X1,&s); - - FP4_copy(&X3,&X1); - FP4_neg(&X1,&X1); FP4_norm(&X1); FP4_div2(&X1,&X1); // -Z/2 - FP4_copy(&X2,&X1); - FP4_sub(&X1,&X1,&W); FP4_norm(&X1); - FP4_add(&X2,&X2,&W); FP4_norm(&X2); - FP4_add(&A,&A,&A); - FP4_add(&A,&A,&A); - FP4_norm(&A); // 4*g(Z) - FP4_sqr(&T,&T); - FP4_mul(&T,&T,&NY); - FP4_sqr(&T,&T); // (tv2^2*tv3)^2 - FP4_mul(&A,&A,&T); // -4*g(Z)*(tv2^2*tv3)^2 - - FP4_add(&X3,&X3,&A); FP4_norm(&X3); - - ECP4_rhs(&W,&X2); - FP4_cmove(&X3,&X2,FP4_qr(&W,NULL)); - ECP4_rhs(&W,&X1); - FP4_cmove(&X3,&X1,FP4_qr(&W,NULL)); - ECP4_rhs(&W,&X3); - FP4_sqrt(&Y,&W,NULL); - - ne=FP4_sign(&Y)^sgn; - FP4_neg(&W,&Y); FP4_norm(&W); - FP4_cmove(&Y,&W,ne); - - ECP4_set(Q,&X3,&Y); -} - -/* Map octet to point on G2 */ -/* -void ZZZ::ECP4_mapit(ECP4 *Q, octet *W) -{ - BIG q, x; - DBIG dx; - BIG_rcopy(q, Modulus); - - BIG_dfromBytesLen(dx,W->val,W->len); - BIG_dmod(x,dx,q); - - ECP4_hap2point(Q,x); - ECP4_cfp(Q); -} -*/ -/* cofactor product */ -void ZZZ::ECP4_cfp(ECP4 *Q) -{ - FP2 X[3]; - ECP4 xQ, x2Q, x3Q, x4Q; - BIG x; - - ECP4_frob_constants(X); - - BIG_rcopy(x, CURVE_Bnx); - - // Efficient hash maps to G2 on BLS24 curves - Budroni, Pintore - // Q -> x4Q -x3Q -Q + F(x3Q-x2Q) + F(F(x2Q-xQ)) + F(F(F(xQ-Q))) +F(F(F(F(2Q)))) - - ECP4_copy(&xQ, Q); - ECP4_mul(&xQ, x); - ECP4_copy(&x2Q, &xQ); - ECP4_mul(&x2Q, x); - ECP4_copy(&x3Q, &x2Q); - ECP4_mul(&x3Q, x); - ECP4_copy(&x4Q, &x3Q); - ECP4_mul(&x4Q, x); - -#if SIGN_OF_X_ZZZ==NEGATIVEX - ECP4_neg(&xQ); - ECP4_neg(&x3Q); -#endif - - ECP4_sub(&x4Q, &x3Q); - ECP4_sub(&x4Q, Q); - - ECP4_sub(&x3Q, &x2Q); - ECP4_frob(&x3Q, X, 1); - - ECP4_sub(&x2Q, &xQ); - ECP4_frob(&x2Q, X, 2); - - ECP4_sub(&xQ, Q); - ECP4_frob(&xQ, X, 3); - - ECP4_dbl(Q); - ECP4_frob(Q, X, 4); - - ECP4_add(Q, &x4Q); - ECP4_add(Q, &x3Q); - ECP4_add(Q, &x2Q); - ECP4_add(Q, &xQ); - - ECP4_affine(Q); - -} - -// ECP$ Get Group Generator - -int ZZZ::ECP4_generator(ECP4 *G) -{ - BIG a, b; - FP2 Aa, Bb; - FP4 X, Y; - - BIG_rcopy(a, CURVE_Pxaa); - BIG_rcopy(b, CURVE_Pxab); - FP2_from_BIGs(&Aa, a, b); - - BIG_rcopy(a, CURVE_Pxba); - BIG_rcopy(b, CURVE_Pxbb); - FP2_from_BIGs(&Bb, a, b); - - FP4_from_FP2s(&X, &Aa, &Bb); - - BIG_rcopy(a, CURVE_Pyaa); - BIG_rcopy(b, CURVE_Pyab); - FP2_from_BIGs(&Aa, a, b); - - BIG_rcopy(a, CURVE_Pyba); - BIG_rcopy(b, CURVE_Pybb); - FP2_from_BIGs(&Bb, a, b); - - FP4_from_FP2s(&Y, &Aa, &Bb); - - return ECP4_set(G, &X, &Y); -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp8.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp8.cpp deleted file mode 100644 index 17de76a..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/ecp8.cpp +++ /dev/null @@ -1,1118 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE Weierstrass elliptic curve functions over FP2 */ - -//#include -#include "ecp8_ZZZ.h" - -using namespace std; -using namespace XXX; -using namespace YYY; - -int ZZZ::ECP8_isinf(ECP8 *P) -{ - return (FP8_iszilch(&(P->x)) & FP8_iszilch(&(P->z))); -} - -/* Set P=Q */ -void ZZZ::ECP8_copy(ECP8 *P, ECP8 *Q) -{ - FP8_copy(&(P->x), &(Q->x)); - FP8_copy(&(P->y), &(Q->y)); - FP8_copy(&(P->z), &(Q->z)); -} - -/* set P to Infinity */ -void ZZZ::ECP8_inf(ECP8 *P) -{ - FP8_zero(&(P->x)); - FP8_one(&(P->y)); - FP8_zero(&(P->z)); -} - -/* Conditional move Q to P dependant on d */ -static void ECP8_cmove(ZZZ::ECP8 *P, ZZZ::ECP8 *Q, int d) -{ - FP8_cmove(&(P->x), &(Q->x), d); - FP8_cmove(&(P->y), &(Q->y), d); - FP8_cmove(&(P->z), &(Q->z), d); -} - -/* return 1 if b==c, no branching */ -static int teq(sign32 b, sign32 c) -{ - sign32 x = b ^ c; - x -= 1; // if x=0, x now -1 - return (int)((x >> 31) & 1); -} - -/* Constant time select from pre-computed table */ -static void ECP8_select(ZZZ::ECP8 *P, ZZZ::ECP8 W[], sign32 b) -{ - ZZZ::ECP8 MP; - sign32 m = b >> 31; - sign32 babs = (b ^ m) - m; - - babs = (babs - 1) / 2; - - ECP8_cmove(P, &W[0], teq(babs, 0)); // conditional move - ECP8_cmove(P, &W[1], teq(babs, 1)); - ECP8_cmove(P, &W[2], teq(babs, 2)); - ECP8_cmove(P, &W[3], teq(babs, 3)); - ECP8_cmove(P, &W[4], teq(babs, 4)); - ECP8_cmove(P, &W[5], teq(babs, 5)); - ECP8_cmove(P, &W[6], teq(babs, 6)); - ECP8_cmove(P, &W[7], teq(babs, 7)); - - ECP8_copy(&MP, P); - ECP8_neg(&MP); // minus P - ECP8_cmove(P, &MP, (int)(m & 1)); -} - -/* Make P affine (so z=1) */ -void ZZZ::ECP8_affine(ECP8 *P) -{ - FP8 one, iz; - if (ECP8_isinf(P)) return; - - FP8_one(&one); - if (FP8_isunity(&(P->z))) - { - FP8_reduce(&(P->x)); - FP8_reduce(&(P->y)); - return; - } - - FP8_inv(&iz, &(P->z),NULL); - FP8_mul(&(P->x), &(P->x), &iz); - FP8_mul(&(P->y), &(P->y), &iz); - - FP8_reduce(&(P->x)); - FP8_reduce(&(P->y)); - FP8_copy(&(P->z), &one); -} - -/* return 1 if P==Q, else 0 */ -/* SU= 312 */ -int ZZZ::ECP8_equals(ECP8 *P, ECP8 *Q) -{ - FP8 a, b; - - FP8_mul(&a, &(P->x), &(Q->z)); - FP8_mul(&b, &(Q->x), &(P->z)); - if (!FP8_equals(&a, &b)) return 0; - - FP8_mul(&a, &(P->y), &(Q->z)); - FP8_mul(&b, &(Q->y), &(P->z)); - if (!FP8_equals(&a, &b)) return 0; - return 1; -} - -/* extract x, y from point P */ -int ZZZ::ECP8_get(FP8 *x, FP8 *y, ECP8 *P) -{ - ECP8 W; - ECP8_copy(&W, P); - ECP8_affine(&W); - if (ECP8_isinf(&W)) return -1; - FP8_copy(y, &(W.y)); - FP8_copy(x, &(W.x)); - return 0; -} - -/* Output point P */ -void ZZZ::ECP8_output(ECP8 *P) -{ - FP8 x, y; - if (ECP8_isinf(P)) - { - printf("Infinity\n"); - return; - } - ECP8_get(&x, &y, P); - printf("("); - FP8_output(&x); - printf(","); - FP8_output(&y); - printf(")\n"); -} - -/* Convert Q to octet string */ -void ZZZ::ECP8_toOctet(octet *W, ECP8 *Q,bool compress) -{ - FP8 qx, qy; - bool alt=false; - ECP8_get(&qx, &qy, Q); - -#if (MBITS-1)%8 <= 4 -#ifdef ALLOW_ALT_COMPRESS_ZZZ - alt=true; -#endif -#endif - - if (alt) - { - FP8_toBytes(&(W->val[0]),&qx); - if (!compress) - { - W->len=16*MODBYTES_XXX; - FP8_toBytes(&(W->val[8*MODBYTES_XXX]), &qy); - } else { - W->val[0]|=0x80; - if (FP8_islarger(&qy)==1) W->val[0]|=0x20; - W->len=8*MODBYTES_XXX; - } - } else { - FP8_toBytes(&(W->val[1]),&qx); - if (!compress) - { - W->val[0] = 0x04; - - FP8_toBytes(&(W->val[8 * MODBYTES_XXX+1]), &qy); - W->len = 16 * MODBYTES_XXX+1; - } else { - W->val[0]=0x02; - if (FP8_sign(&qy)==1) W->val[0] = 0x03; - W->len = 8 * MODBYTES_XXX+1; - } - } -} - -/* restore Q from octet string */ -int ZZZ::ECP8_fromOctet(ECP8 *Q, octet *W) -{ - FP8 qx, qy; - bool alt=false; - int sgn,cmp,typ = W->val[0]; - -#if (MBITS-1)%8 <= 4 -#ifdef ALLOW_ALT_COMPRESS_ZZZ - alt=true; -#endif -#endif - - if (alt) - { - W->val[0]&=0x1f; - FP8_fromBytes(&qx,&(W->val[0])); - W->val[0]=typ; - if ((typ&0x80)==0) - { - FP8_fromBytes(&qy,&(W->val[8*MODBYTES_XXX])); - if (ECP8_set(Q, &qx, &qy)) return 1; - return 0; - } else { - if (!ECP8_setx(Q,&qx,0)) return 0; - sgn=(typ&0x20)>>5; - cmp=FP8_islarger(&(Q->y)); - if ((sgn==1 && cmp!=1) || (sgn==0 && cmp==1)) ECP8_neg(Q); - return 1; - } - } else { - FP8_fromBytes(&qx,&(W->val[1])); - - if (typ == 0x04) - { - FP8_fromBytes(&qy,&(W->val[8 * MODBYTES_XXX+1])); - if (ECP8_set(Q, &qx, &qy)) return 1; - } else { - if (ECP8_setx(Q, &qx, typ&1)) return 1; - } - } - return 0; -} - -/* Calculate RHS of twisted curve equation x^3+B/i or x^3+Bi*/ -void ZZZ::ECP8_rhs(FP8 *rhs, FP8 *x) -{ - /* calculate RHS of elliptic curve equation */ - FP8 t; - FP4 t4; - FP2 t2; - BIG b; - FP8_sqr(&t, x); - - FP8_mul(rhs, &t, x); - - /* Assuming CURVE_A=0 */ - - BIG_rcopy(b, CURVE_B); - - FP2_from_BIG(&t2, b); - FP4_from_FP2(&t4, &t2); - FP8_from_FP4(&t, &t4); - -#if SEXTIC_TWIST_ZZZ == D_TYPE - FP8_div_i(&t); /* IMPORTANT - here we use the correct SEXTIC twist of the curve */ -#endif - -#if SEXTIC_TWIST_ZZZ == M_TYPE - FP8_times_i(&t); /* IMPORTANT - here we use the correct SEXTIC twist of the curve */ -#endif - - FP8_add(rhs, &t, rhs); - FP8_reduce(rhs); -} - -/* Set P=(x,y). Return 1 if (x,y) is on the curve, else return 0*/ -/* SU= 232 */ -int ZZZ::ECP8_set(ECP8 *P, FP8 *x, FP8 *y) -{ - FP8 rhs, y2; - - FP8_sqr(&y2, y); - ECP8_rhs(&rhs, x); - - if (!FP8_equals(&y2, &rhs)) - { - ECP8_inf(P); - return 0; - } - - FP8_copy(&(P->x), x); - FP8_copy(&(P->y), y); - FP8_one(&(P->z)); - return 1; -} - -/* Set P=(x,y). Return 1 if (x,.) is on the curve, else return 0 */ -/* SU= 232 */ -int ZZZ::ECP8_setx(ECP8 *P, FP8 *x, int s) -{ - FP8 y; - FP hint; - ECP8_rhs(&y, x); - - if (!FP8_qr(&y,&hint)) - { - ECP8_inf(P); - return 0; - } - FP8_sqrt(&y,&y,&hint); - - FP8_copy(&(P->x), x); - FP8_copy(&(P->y), &y); - FP8_one(&(P->z)); - - if (FP8_sign(&(P->y)) != s) - FP8_neg(&(P->y),&(P->y)); - FP8_reduce(&(P->y)); - - return 1; -} - -/* Set P=-P */ -/* SU= 8 */ -void ZZZ::ECP8_neg(ECP8 *P) -{ - FP8_norm(&(P->y)); - FP8_neg(&(P->y), &(P->y)); - FP8_norm(&(P->y)); -} - - -/* R+=R */ -/* return -1 for Infinity, 0 for addition, 1 for doubling */ -int ZZZ::ECP8_dbl(ECP8 *P) -{ - FP8 t0, t1, t2, t3, iy, x3, y3; - - FP8_copy(&iy, &(P->y)); //FP8 iy=new FP8(y); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP8_times_i(&iy); //iy.mul_ip(); -#endif - - FP8_sqr(&t0, &(P->y)); //t0.sqr(); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP8_times_i(&t0); //t0.mul_ip(); -#endif - - FP8_mul(&t1, &iy, &(P->z)); //t1.mul(z); - FP8_sqr(&t2, &(P->z)); //t2.sqr(); - - FP8_add(&(P->z), &t0, &t0); //z.add(t0); - FP8_norm(&(P->z)); //z.norm(); - FP8_add(&(P->z), &(P->z), &(P->z)); //z.add(z); - FP8_add(&(P->z), &(P->z), &(P->z)); //z.add(z); - FP8_norm(&(P->z)); //z.norm(); - - FP8_imul(&t2, &t2, 3 * CURVE_B_I); //t2.imul(3*ROM.CURVE_B_I); -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP8_times_i(&t2); -#endif - - FP8_mul(&x3, &t2, &(P->z)); //x3.mul(z); - - FP8_add(&y3, &t0, &t2); //y3.add(t2); - FP8_norm(&y3); //y3.norm(); - FP8_mul(&(P->z), &(P->z), &t1); //z.mul(t1); - - FP8_add(&t1, &t2, &t2); //t1.add(t2); - FP8_add(&t2, &t2, &t1); //t2.add(t1); - FP8_norm(&t2); //t2.norm(); - FP8_sub(&t0, &t0, &t2); //t0.sub(t2); - FP8_norm(&t0); //t0.norm(); //y^2-9bz^2 - FP8_mul(&y3, &y3, &t0); //y3.mul(t0); - FP8_add(&(P->y), &y3, &x3); //y3.add(x3); //(y^2+3z*2)(y^2-9z^2)+3b.z^2.8y^2 - - FP8_mul(&t1, &(P->x), &iy); //t1.mul(iy); // - - FP8_norm(&t0); //x.norm(); - FP8_mul(&(P->x), &t0, &t1); //x.mul(t1); - FP8_add(&(P->x), &(P->x), &(P->x)); //x.add(x); //(y^2-9bz^2)xy2 - - FP8_norm(&(P->x)); //x.norm(); - - FP8_norm(&(P->y)); //y.norm(); - - return 1; -} - -/* Set P+=Q */ - -int ZZZ::ECP8_add(ECP8 *P, ECP8 *Q) -{ - FP8 t0, t1, t2, t3, t4, x3, y3, z3; - int b3 = 3 * CURVE_B_I; - - FP8_mul(&t0, &(P->x), &(Q->x)); //t0.mul(Q.x); // x.Q.x - FP8_mul(&t1, &(P->y), &(Q->y)); //t1.mul(Q.y); // y.Q.y - - FP8_mul(&t2, &(P->z), &(Q->z)); //t2.mul(Q.z); - FP8_add(&t3, &(P->x), &(P->y)); //t3.add(y); - FP8_norm(&t3); //t3.norm(); //t3=X1+Y1 - FP8_add(&t4, &(Q->x), &(Q->y)); //t4.add(Q.y); - FP8_norm(&t4); //t4.norm(); //t4=X2+Y2 - FP8_mul(&t3, &t3, &t4); //t3.mul(t4); //t3=(X1+Y1)(X2+Y2) - FP8_add(&t4, &t0, &t1); //t4.add(t1); //t4=X1.X2+Y1.Y2 - - FP8_sub(&t3, &t3, &t4); //t3.sub(t4); - FP8_norm(&t3); //t3.norm(); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP8_times_i(&t3); //t3.mul_ip(); -#endif - - FP8_add(&t4, &(P->y), &(P->z)); //t4.add(z); - FP8_norm(&t4); //t4.norm(); //t4=Y1+Z1 - - FP8_add(&x3, &(Q->y), &(Q->z)); //x3.add(Q.z); - FP8_norm(&x3); //x3.norm(); //x3=Y2+Z2 - - FP8_mul(&t4, &t4, &x3); //t4.mul(x3); //t4=(Y1+Z1)(Y2+Z2) - - FP8_add(&x3, &t1, &t2); //x3.add(t2); //X3=Y1.Y2+Z1.Z2 - - FP8_sub(&t4, &t4, &x3); //t4.sub(x3); - FP8_norm(&t4); //t4.norm(); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP8_times_i(&t4); //t4.mul_ip(); //t4=(Y1+Z1)(Y2+Z2) - (Y1.Y2+Z1.Z2) = Y1.Z2+Y2.Z1 -#endif - - FP8_add(&x3, &(P->x), &(P->z)); //x3.add(z); - FP8_norm(&x3); //x3.norm(); // x3=X1+Z1 - - FP8_add(&y3, &(Q->x), &(Q->z)); //y3.add(Q.z); - FP8_norm(&y3); //y3.norm(); // y3=X2+Z2 - FP8_mul(&x3, &x3, &y3); //x3.mul(y3); // x3=(X1+Z1)(X2+Z2) - - FP8_add(&y3, &t0, &t2); //y3.add(t2); // y3=X1.X2+Z1+Z2 - FP8_sub(&y3, &x3, &y3); //y3.rsub(x3); - FP8_norm(&y3); //y3.norm(); // y3=(X1+Z1)(X2+Z2) - (X1.X2+Z1.Z2) = X1.Z2+X2.Z1 -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP8_times_i(&t0); //t0.mul_ip(); - FP8_times_i(&t1); //t1.mul_ip(); -#endif - - FP8_add(&x3, &t0, &t0); //x3.add(t0); - FP8_add(&t0, &t0, &x3); //t0.add(x3); - FP8_norm(&t0); //t0.norm(); - FP8_imul(&t2, &t2, b3); //t2.imul(b); -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP8_times_i(&t2); -#endif - - FP8_add(&z3, &t1, &t2); //z3.add(t2); - FP8_norm(&z3); //z3.norm(); - FP8_sub(&t1, &t1, &t2); //t1.sub(t2); - FP8_norm(&t1); //t1.norm(); - FP8_imul(&y3, &y3, b3); //y3.imul(b); -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP8_times_i(&y3); -#endif - - FP8_mul(&x3, &y3, &t4); //x3.mul(t4); - - FP8_mul(&t2, &t3, &t1); //t2.mul(t1); - FP8_sub(&(P->x), &t2, &x3); //x3.rsub(t2); - FP8_mul(&y3, &y3, &t0); //y3.mul(t0); - FP8_mul(&t1, &t1, &z3); //t1.mul(z3); - FP8_add(&(P->y), &y3, &t1); //y3.add(t1); - FP8_mul(&t0, &t0, &t3); //t0.mul(t3); - FP8_mul(&z3, &z3, &t4); //z3.mul(t4); - FP8_add(&(P->z), &z3, &t0); //z3.add(t0); - - - FP8_norm(&(P->x)); //x.norm(); - FP8_norm(&(P->y)); //y.norm(); - FP8_norm(&(P->z)); //z.norm(); - - return 0; -} - -/* Set P-=Q */ -/* SU= 16 */ -void ZZZ::ECP8_sub(ECP8 *P, ECP8 *Q) -{ - ECP8 NQ; - ECP8_copy(&NQ, Q); - ECP8_neg(&NQ); - ECP8_add(P, &NQ); -} - - -void ZZZ::ECP8_reduce(ECP8 *P) -{ - FP8_reduce(&(P->x)); - FP8_reduce(&(P->y)); -} - -/* P*=e */ -/* SU= 280 */ -void ZZZ::ECP8_mul(ECP8 *P, BIG e) -{ - /* fixed size windows */ - int i, nb, s, ns; - BIG mt, t; - ECP8 Q, W[8], C; - sign8 w[1 + (NLEN_XXX * BASEBITS_XXX + 3) / 4]; - - if (ECP8_isinf(P)) return; - - /* precompute table */ - - ECP8_copy(&Q, P); - ECP8_dbl(&Q); - ECP8_copy(&W[0], P); - - for (i = 1; i < 8; i++) - { - ECP8_copy(&W[i], &W[i - 1]); - ECP8_add(&W[i], &Q); - } - - /* make exponent odd - add 2P if even, P if odd */ - BIG_copy(t, e); - s = BIG_parity(t); - BIG_inc(t, 1); - BIG_norm(t); - ns = BIG_parity(t); - BIG_copy(mt, t); - BIG_inc(mt, 1); - BIG_norm(mt); - BIG_cmove(t, mt, s); - ECP8_cmove(&Q, P, ns); - ECP8_copy(&C, &Q); - - nb = 1 + (BIG_nbits(t) + 3) / 4; - - /* convert exponent to signed 4-bit window */ - for (i = 0; i < nb; i++) - { - w[i] = BIG_lastbits(t, 5) - 16; - BIG_dec(t, w[i]); - BIG_norm(t); - BIG_fshr(t, 4); - } - w[nb] = BIG_lastbits(t, 5); - - //ECP8_copy(P, &W[(w[nb] - 1) / 2]); - ECP8_select(P, W, w[nb]); - for (i = nb - 1; i >= 0; i--) - { - ECP8_select(&Q, W, w[i]); - ECP8_dbl(P); - ECP8_dbl(P); - ECP8_dbl(P); - ECP8_dbl(P); - ECP8_add(P, &Q); - } - ECP8_sub(P, &C); /* apply correction */ - ECP8_affine(P); -} - -void ZZZ::ECP8_frob_constants(FP2 F[3]) -{ - FP fx, fy; - FP2 X; - - FP_rcopy(&fx, Fra); - FP_rcopy(&fy, Frb); - FP2_from_FPs(&X, &fx, &fy); // u^(p-19)/24 - - FP2_sqr(&F[0], &X); // F[0]=u^(p-19)/12 - FP2_copy(&F[2], &F[0]); - FP2_mul_ip(&F[2]); // W=u^12/12.u^(p-19)/12 = u^(p-7)/12 - FP2_norm(&F[2]); - FP2_sqr(&F[1], &F[2]); - FP2_mul(&F[2], &F[2], &F[1]); // W=u^(p-7)/4 - - FP2_mul_ip(&F[2]); // W=u^4/4.W=u^(p-7)/4 = u^(p-3)/4 - FP2_norm(&F[2]); - - FP2_copy(&F[1], &X); - -#if SEXTIC_TWIST_ZZZ == M_TYPE - FP2_mul_ip(&F[1]); // u^24/24.u^(p-19)/24 = u^(p+5)/24 - FP2_norm(&F[1]); - FP2_inv(&F[1], &F[1], NULL); // u^-(p+5)/24 - FP2_sqr(&F[0], &F[1]); // u^-(p+5)/12 - *** - FP2_mul(&F[1], &F[1], &F[0]); // u^-(p+5)/8 - *** -#endif - -#if SEXTIC_TWIST_ZZZ == D_TYPE - FP2_sqr(&F[0], &F[1]); // u^(p-19)/12 - FP2_mul(&F[1], &F[1], &F[0]); // u^(p-19)/8 - FP2_mul_ip(&F[0]); // u^(p-7)/12 - *** - FP2_norm(&F[0]); - FP2_mul_ip(&F[1]); // u^(p-11)/8 - FP2_norm(&F[1]); - FP2_mul_ip(&F[1]); // u^(p-3)/8 - *** - FP2_norm(&F[1]); -#endif - -} - -/* Calculates q^n.P using Frobenius constant X */ -void ZZZ::ECP8_frob(ECP8 *P, FP2 F[3], int n) -{ - int i; - FP8 X, Y, Z; -// F=u^(p-19)/24 - - FP8_copy(&X, &(P->x)); - FP8_copy(&Y, &(P->y)); - FP8_copy(&Z, &(P->z)); - - for (i = 0; i < n; i++) - { - FP8_frob(&X, &F[2]); // X^p - -#if SEXTIC_TWIST_ZZZ == M_TYPE - FP8_qmul(&X, &X, &F[0]); // X^p.u^-(p+5)/12 - FP8_times_i2(&X); // X^p.u^{1/2}.u^-(p+5)/12 = X^p.u^-(p-1)/12 -#endif -#if SEXTIC_TWIST_ZZZ == D_TYPE - FP8_qmul(&X, &X, &F[0]); // X^p.u^(p-7)/12 - FP8_times_i2(&X); // X^p.u^{1/2}.u^(p-7)/12 = X^p.u^(p-1)/12 -#endif - - FP8_frob(&Y, &F[2]); // Y^p - - -#if SEXTIC_TWIST_ZZZ == M_TYPE - FP8_qmul(&Y, &Y, &F[1]); // Y^p.u^-(p+5)/8 - FP8_times_i2(&Y); - FP8_times_i(&Y); // Y^p.u^(3/4}.u^-(p+5)/8 = Y.p.u^(p-1)/8 - -#endif -#if SEXTIC_TWIST_ZZZ == D_TYPE - FP8_qmul(&Y, &Y, &F[1]); // Y^p.u^(p-3)/8 - FP8_times_i(&Y); // Y^p.u^(1/4}.u^(p-3)/8 = Y^p.u^(p-1)/8 -#endif - FP8_frob(&Z, &F[2]); - } - - FP8_copy(&(P->x), &X); - FP8_copy(&(P->y), &Y); - FP8_copy(&(P->z), &Z); - -} - -/* Side channel attack secure */ -// Bos & Costello https://eprint.iacr.org/2013/458.pdf -// Faz-Hernandez & Longa & Sanchez https://eprint.iacr.org/2013/158.pdf - -void ZZZ::ECP8_mul16(ECP8 *P, ECP8 Q[16], BIG u[16]) -{ - int i, j, k, nb, pb1, pb2, pb3, pb4, bt; - ECP8 T1[8], T2[8], T3[8], T4[8], W; - BIG mt, t[16]; - sign8 w1[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s1[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 w2[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s2[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 w3[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s3[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 w4[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s4[NLEN_XXX * BASEBITS_XXX + 1]; - - for (i = 0; i < 16; i++) - { - BIG_copy(t[i], u[i]); - } -// Precomputed tables - ECP8_copy(&T1[0], &Q[0]); // Q[0] - ECP8_copy(&T1[1], &T1[0]); - ECP8_add(&T1[1], &Q[1]); // Q[0]+Q[1] - ECP8_copy(&T1[2], &T1[0]); - ECP8_add(&T1[2], &Q[2]); // Q[0]+Q[2] - ECP8_copy(&T1[3], &T1[1]); - ECP8_add(&T1[3], &Q[2]); // Q[0]+Q[1]+Q[2] - ECP8_copy(&T1[4], &T1[0]); - ECP8_add(&T1[4], &Q[3]); // Q[0]+Q[3] - ECP8_copy(&T1[5], &T1[1]); - ECP8_add(&T1[5], &Q[3]); // Q[0]+Q[1]+Q[3] - ECP8_copy(&T1[6], &T1[2]); - ECP8_add(&T1[6], &Q[3]); // Q[0]+Q[2]+Q[3] - ECP8_copy(&T1[7], &T1[3]); - ECP8_add(&T1[7], &Q[3]); // Q[0]+Q[1]+Q[2]+Q[3] - - ECP8_copy(&T2[0], &Q[4]); // Q[0] - ECP8_copy(&T2[1], &T2[0]); - ECP8_add(&T2[1], &Q[5]); // Q[0]+Q[1] - ECP8_copy(&T2[2], &T2[0]); - ECP8_add(&T2[2], &Q[6]); // Q[0]+Q[2] - ECP8_copy(&T2[3], &T2[1]); - ECP8_add(&T2[3], &Q[6]); // Q[0]+Q[1]+Q[2] - ECP8_copy(&T2[4], &T2[0]); - ECP8_add(&T2[4], &Q[7]); // Q[0]+Q[3] - ECP8_copy(&T2[5], &T2[1]); - ECP8_add(&T2[5], &Q[7]); // Q[0]+Q[1]+Q[3] - ECP8_copy(&T2[6], &T2[2]); - ECP8_add(&T2[6], &Q[7]); // Q[0]+Q[2]+Q[3] - ECP8_copy(&T2[7], &T2[3]); - ECP8_add(&T2[7], &Q[7]); // Q[0]+Q[1]+Q[2]+Q[3] - - ECP8_copy(&T3[0], &Q[8]); // Q[0] - ECP8_copy(&T3[1], &T3[0]); - ECP8_add(&T3[1], &Q[9]); // Q[0]+Q[1] - ECP8_copy(&T3[2], &T3[0]); - ECP8_add(&T3[2], &Q[10]); // Q[0]+Q[2] - ECP8_copy(&T3[3], &T3[1]); - ECP8_add(&T3[3], &Q[10]); // Q[0]+Q[1]+Q[2] - ECP8_copy(&T3[4], &T3[0]); - ECP8_add(&T3[4], &Q[11]); // Q[0]+Q[3] - ECP8_copy(&T3[5], &T3[1]); - ECP8_add(&T3[5], &Q[11]); // Q[0]+Q[1]+Q[3] - ECP8_copy(&T3[6], &T3[2]); - ECP8_add(&T3[6], &Q[11]); // Q[0]+Q[2]+Q[3] - ECP8_copy(&T3[7], &T3[3]); - ECP8_add(&T3[7], &Q[11]); // Q[0]+Q[1]+Q[2]+Q[3] - - ECP8_copy(&T4[0], &Q[12]); // Q[0] - ECP8_copy(&T4[1], &T4[0]); - ECP8_add(&T4[1], &Q[13]); // Q[0]+Q[1] - ECP8_copy(&T4[2], &T4[0]); - ECP8_add(&T4[2], &Q[14]); // Q[0]+Q[2] - ECP8_copy(&T4[3], &T4[1]); - ECP8_add(&T4[3], &Q[14]); // Q[0]+Q[1]+Q[2] - ECP8_copy(&T4[4], &T4[0]); - ECP8_add(&T4[4], &Q[15]); // Q[0]+Q[3] - ECP8_copy(&T4[5], &T4[1]); - ECP8_add(&T4[5], &Q[15]); // Q[0]+Q[1]+Q[3] - ECP8_copy(&T4[6], &T4[2]); - ECP8_add(&T4[6], &Q[15]); // Q[0]+Q[2]+Q[3] - ECP8_copy(&T4[7], &T4[3]); - ECP8_add(&T4[7], &Q[15]); // Q[0]+Q[1]+Q[2]+Q[3] - -// Make them odd - pb1 = 1 - BIG_parity(t[0]); - BIG_inc(t[0], pb1); - BIG_norm(t[0]); - - pb2 = 1 - BIG_parity(t[4]); - BIG_inc(t[4], pb2); - BIG_norm(t[4]); - - pb3 = 1 - BIG_parity(t[8]); - BIG_inc(t[8], pb3); - BIG_norm(t[8]); - - pb4 = 1 - BIG_parity(t[12]); - BIG_inc(t[12], pb4); - BIG_norm(t[12]); - -// Number of bits - BIG_zero(mt); - for (i = 0; i < 16; i++) - { - BIG_or(mt, mt, t[i]); - } - nb = 1 + BIG_nbits(mt); - -// Sign pivot - s1[nb - 1] = 1; - s2[nb - 1] = 1; - s3[nb - 1] = 1; - s4[nb - 1] = 1; - for (i = 0; i < nb - 1; i++) - { - BIG_fshr(t[0], 1); - s1[i] = 2 * BIG_parity(t[0]) - 1; - BIG_fshr(t[4], 1); - s2[i] = 2 * BIG_parity(t[4]) - 1; - BIG_fshr(t[8], 1); - s3[i] = 2 * BIG_parity(t[8]) - 1; - BIG_fshr(t[12], 1); - s4[i] = 2 * BIG_parity(t[12]) - 1; - } - -// Recoded exponents - for (i = 0; i < nb; i++) - { - w1[i] = 0; - k = 1; - for (j = 1; j < 4; j++) - { - bt = s1[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w1[i] += bt * k; - k *= 2; - } - - w2[i] = 0; - k = 1; - for (j = 5; j < 8; j++) - { - bt = s2[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w2[i] += bt * k; - k *= 2; - } - - w3[i] = 0; - k = 1; - for (j = 9; j < 12; j++) - { - bt = s3[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w3[i] += bt * k; - k *= 2; - } - - w4[i] = 0; - k = 1; - for (j = 13; j < 16; j++) - { - bt = s4[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w4[i] += bt * k; - k *= 2; - } - } - -// Main loop - - ECP8_select(P, T1, 2 * w1[nb - 1] + 1); - ECP8_select(&W, T2, 2 * w2[nb - 1] + 1); - ECP8_add(P, &W); - ECP8_select(&W, T3, 2 * w3[nb - 1] + 1); - ECP8_add(P, &W); - ECP8_select(&W, T4, 2 * w4[nb - 1] + 1); - ECP8_add(P, &W); - - for (i = nb - 2; i >= 0; i--) - { - ECP8_dbl(P); - ECP8_select(&W, T1, 2 * w1[i] + s1[i]); - ECP8_add(P, &W); - ECP8_select(&W, T2, 2 * w2[i] + s2[i]); - ECP8_add(P, &W); - ECP8_select(&W, T3, 2 * w3[i] + s3[i]); - ECP8_add(P, &W); - ECP8_select(&W, T4, 2 * w4[i] + s4[i]); - ECP8_add(P, &W); - } - -// apply corrections - ECP8_copy(&W, P); - ECP8_sub(&W, &Q[0]); - ECP8_cmove(P, &W, pb1); - ECP8_copy(&W, P); - ECP8_sub(&W, &Q[4]); - ECP8_cmove(P, &W, pb2); - - ECP8_copy(&W, P); - ECP8_sub(&W, &Q[8]); - ECP8_cmove(P, &W, pb3); - ECP8_copy(&W, P); - ECP8_sub(&W, &Q[12]); - ECP8_cmove(P, &W, pb4); - - ECP8_affine(P); -} - -/* Hunt and Peck a BIG to G2 curve point */ -/* -void ZZZ::ECP8_hap2point(ECP8 *Q,BIG h) -{ - BIG one,hv; - FP2 X2; - FP4 X4; - FP8 X8; - BIG_one(one); - BIG_copy(hv,h); - - for (;;) - { - FP2_from_BIGs(&X2,one,hv); - FP4_from_FP2(&X4,&X2); - FP8_from_FP4(&X8,&X4); - if (ECP8_setx(Q,&X8,0)) break; - BIG_inc(hv,1); - BIG_norm(hv); - } -} -*/ -/* Constant time Map BIG to Point in G2 */ -void ZZZ::ECP8_map2point(ECP8 *Q,FP8 *H) -{ - int sgn,ne; - FP8 X1,X2,X3,W,Y,T,A,NY; - FP Z,s; - - FP8_one(&NY); - FP8_copy(&T,H); - sgn=FP8_sign(&T); - - FP_from_int(&Z,RIADZG2A_YYY); - FP8_from_FP(&A,&Z); - ECP8_rhs(&A,&A); // A=g(Z) - - FP8_sqrt(&W,&A,NULL); - FP_rcopy(&s,SQRTm3); - - FP_mul(&Z,&Z,&s); - - FP8_sqr(&T,&T); - FP8_mul(&Y,&A,&T); // tv1=u^2*g(Z) - FP8_add(&T,&NY,&Y); FP8_norm(&T); // tv2=1+tv1 - FP8_sub(&Y,&NY,&Y); FP8_norm(&Y); // tv1=1-tv1 - FP8_mul(&NY,&T,&Y); - - FP8_tmul(&NY,&NY,&Z); - - FP8_inv(&NY,&NY,NULL); // tv3=inv0(tv1*tv2*Z*sqrt(-3)) - FP8_tmul(&W,&W,&Z); // tv4=Z*sqrt(-3).sqrt(g(Z)) - if (FP8_sign(&W)==1) - { - FP8_neg(&W,&W); - FP8_norm(&W); - } - FP8_tmul(&W,&W,&Z); - FP8_mul(&W,&W,H); - FP8_mul(&W,&W,&Y); - FP8_mul(&W,&W,&NY); // tv5=u*tv1*tv3*tv4 - - FP_from_int(&s,RIADZG2A_YYY); - FP8_from_FP(&X1,&s); - - FP8_copy(&X3,&X1); - FP8_neg(&X1,&X1); FP8_norm(&X1); FP8_div2(&X1,&X1); // -Z/2 - FP8_copy(&X2,&X1); - FP8_sub(&X1,&X1,&W); FP8_norm(&X1); - FP8_add(&X2,&X2,&W); FP8_norm(&X2); - FP8_add(&A,&A,&A); - FP8_add(&A,&A,&A); - FP8_norm(&A); // 4*g(Z) - FP8_sqr(&T,&T); - FP8_mul(&T,&T,&NY); - FP8_sqr(&T,&T); // (tv2^2*tv3)^2 - FP8_mul(&A,&A,&T); // -4*g(Z)*(tv2^2*tv3)^2 - - FP8_add(&X3,&X3,&A); FP8_norm(&X3); - - ECP8_rhs(&W,&X2); - FP8_cmove(&X3,&X2,FP8_qr(&W,NULL)); - ECP8_rhs(&W,&X1); - FP8_cmove(&X3,&X1,FP8_qr(&W,NULL)); - ECP8_rhs(&W,&X3); - FP8_sqrt(&Y,&W,NULL); - - ne=FP8_sign(&Y)^sgn; - FP8_neg(&W,&Y); FP8_norm(&W); - FP8_cmove(&Y,&W,ne); - - ECP8_set(Q,&X3,&Y); -} - -/* Map octet to point on G2 */ -/* -void ZZZ::ECP8_mapit(ECP8 *Q, octet *W) -{ - BIG q, x; - DBIG dx; - BIG_rcopy(q, Modulus); - - BIG_dfromBytesLen(dx,W->val,W->len); - BIG_dmod(x,dx,q); - - ECP8_hap2point(Q,x); - ECP8_cfp(Q); -} -*/ -/* cofactor product */ -void ZZZ::ECP8_cfp(ECP8 *Q) -{ - FP2 X[3]; - ECP8 xQ, x2Q, x3Q, x4Q , x5Q, x6Q, x7Q, x8Q; - BIG x; - - ECP8_frob_constants(X); - - BIG_rcopy(x, CURVE_Bnx); - - // Efficient hash maps to G2 on BLS48 curves - Budroni, Pintore - // Q -> x8Q -x7Q -Q + F(x7Q-x6Q) + F(F(x6Q-x5Q)) +F(F(F(x5Q-x4Q))) +F(F(F(F(x4Q-x3Q)))) + F(F(F(F(F(x3Q-x2Q))))) + F(F(F(F(F(F(x2Q-xQ)))))) + F(F(F(F(F(F(F(xQ-Q))))))) +F(F(F(F(F(F(F(F(2Q)))))))) - - ECP8_copy(&xQ, Q); - ECP8_mul(&xQ, x); - ECP8_copy(&x2Q, &xQ); - ECP8_mul(&x2Q, x); - ECP8_copy(&x3Q, &x2Q); - ECP8_mul(&x3Q, x); - ECP8_copy(&x4Q, &x3Q); - - ECP8_mul(&x4Q, x); - ECP8_copy(&x5Q, &x4Q); - ECP8_mul(&x5Q, x); - ECP8_copy(&x6Q, &x5Q); - ECP8_mul(&x6Q, x); - ECP8_copy(&x7Q, &x6Q); - ECP8_mul(&x7Q, x); - ECP8_copy(&x8Q, &x7Q); - ECP8_mul(&x8Q, x); - -#if SIGN_OF_X_ZZZ==NEGATIVEX - ECP8_neg(&xQ); - ECP8_neg(&x3Q); - ECP8_neg(&x5Q); - ECP8_neg(&x7Q); -#endif - - ECP8_sub(&x8Q, &x7Q); - ECP8_sub(&x8Q, Q); - - ECP8_sub(&x7Q, &x6Q); - ECP8_frob(&x7Q, X, 1); - - ECP8_sub(&x6Q, &x5Q); - ECP8_frob(&x6Q, X, 2); - - ECP8_sub(&x5Q, &x4Q); - ECP8_frob(&x5Q, X, 3); - - ECP8_sub(&x4Q, &x3Q); - ECP8_frob(&x4Q, X, 4); - - ECP8_sub(&x3Q, &x2Q); - ECP8_frob(&x3Q, X, 5); - - ECP8_sub(&x2Q, &xQ); - ECP8_frob(&x2Q, X, 6); - - ECP8_sub(&xQ, Q); - ECP8_frob(&xQ, X, 7); - - ECP8_dbl(Q); - ECP8_frob(Q, X, 8); - - - ECP8_add(Q, &x8Q); - ECP8_add(Q, &x7Q); - ECP8_add(Q, &x6Q); - ECP8_add(Q, &x5Q); - - ECP8_add(Q, &x4Q); - ECP8_add(Q, &x3Q); - ECP8_add(Q, &x2Q); - ECP8_add(Q, &xQ); - - ECP8_affine(Q); - -} - -// ECP$ Get Group Generator - -int ZZZ::ECP8_generator(ECP8 *G) -{ - BIG a, b; - FP2 Aa, Bb; - FP4 A, B; - FP8 X, Y; - - BIG_rcopy(a, CURVE_Pxaaa); - BIG_rcopy(b, CURVE_Pxaab); - FP2_from_BIGs(&Aa, a, b); - - BIG_rcopy(a, CURVE_Pxaba); - BIG_rcopy(b, CURVE_Pxabb); - FP2_from_BIGs(&Bb, a, b); - - FP4_from_FP2s(&A, &Aa, &Bb); - - BIG_rcopy(a, CURVE_Pxbaa); - BIG_rcopy(b, CURVE_Pxbab); - FP2_from_BIGs(&Aa, a, b); - - BIG_rcopy(a, CURVE_Pxbba); - BIG_rcopy(b, CURVE_Pxbbb); - FP2_from_BIGs(&Bb, a, b); - - FP4_from_FP2s(&B, &Aa, &Bb); - - FP8_from_FP4s(&X, &A, &B); - - BIG_rcopy(a, CURVE_Pyaaa); - BIG_rcopy(b, CURVE_Pyaab); - FP2_from_BIGs(&Aa, a, b); - - BIG_rcopy(a, CURVE_Pyaba); - BIG_rcopy(b, CURVE_Pyabb); - FP2_from_BIGs(&Bb, a, b); - - FP4_from_FP2s(&A, &Aa, &Bb); - - BIG_rcopy(a, CURVE_Pybaa); - BIG_rcopy(b, CURVE_Pybab); - FP2_from_BIGs(&Aa, a, b); - - BIG_rcopy(a, CURVE_Pybba); - BIG_rcopy(b, CURVE_Pybbb); - FP2_from_BIGs(&Bb, a, b); - - FP4_from_FP2s(&B, &Aa, &Bb); - - FP8_from_FP4s(&Y, &A, &B); - - return ECP8_set(G, &X, &Y); -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/eddsa.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/eddsa.cpp deleted file mode 100644 index 22b890b..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/eddsa.cpp +++ /dev/null @@ -1,409 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// EDDSA API functions - -// see https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf - -#include -#include -#include - -#include "eddsa_ZZZ.h" - -#if CURVETYPE_ZZZ == EDWARDS - -using namespace XXX; -using namespace YYY; - -// Process a random BIG r by RFC7748 (for Montgomery & Edwards curves only) -static void RFC7748(BIG r) -{ - int c,lg=0; - BIG t; - c=ZZZ::CURVE_Cof_I; - while (c!=1) - { - lg++; - c/=2; - } - int n=8*MODBYTES_XXX-lg+1; - BIG_mod2m(r,n); - BIG_zero(t); BIG_inc(t,1); BIG_shl(t,n); - BIG_add(r,r,t); - c=BIG_lastbits(r,lg); - BIG_dec(r,c); -// printf("lg= %d n=%d\n",lg,n); -} - -// reverse first n bytes of buff - for little endian -static void reverse(int n,char *buff) { - for (int i = 0; i < n/2; i++) { - char ch = buff[i]; - buff[i] = buff[n - i - 1]; - buff[n - i - 1] = ch; - } -} - -// dom2 - context still needs to be appended -static void dom2(bool ph,int cl,octet *DOM) { - OCT_jstring(DOM,(char *)"SigZZZ no ZZZ collisions"); - if (ph) - OCT_jbyte(DOM,1,1); - else - OCT_jbyte(DOM,0,1); - OCT_jbyte(DOM,cl,1); // context length -} - -// dom4 - context still needs to be appended -static void dom4(bool ph,int cl,octet *DOM) { - OCT_jstring(DOM,(char *)"SigZZZ"); - if (ph) - OCT_jbyte(DOM,1,1); - else - OCT_jbyte(DOM,0,1); - OCT_jbyte(DOM,cl,1); // context length -} - -static void H(octet *S,char *digest) -{ -#if CURVE_SECURITY_ZZZ <= 128 // for ed25519? - hash512 sh512; - HASH512_init(&sh512); - for (int i=0;ilen;i++ ) - HASH512_process(&sh512,S->val[i]); - HASH512_hash(&sh512,digest); -#else // for ed448? - sha3 SHA3; - SHA3_init(&SHA3,SHAKE256); - for (int i=0;ilen;i++) - SHA3_process(&SHA3,S->val[i]); - SHA3_shake(&SHA3,digest,2*S->len); -#endif -} - -static int H2(bool ph,octet *context,octet *R,octet *Q,octet *M,DBIG dr) -{ - char h[128]; - int b=Q->len; - char dom[64]; - octet DOM={0,sizeof(dom),dom}; - int cl; - if (context==NULL) cl=0; - else cl=context->len&0xff; -#if CURVE_SECURITY_ZZZ <= 128 // for ed25519? - hash512 sh512; - HASH512_init(&sh512); - if (ph || cl>0) - { // if not prehash and no context, omit dom2() - dom2(ph,cl,&DOM); - for (int i=0;ival[i]); - } - for (int i=0;ival[i]); - for (int i=0;ival[i]); - for (int i=0;ilen;i++ ) - HASH512_process(&sh512,M->val[i]); - HASH512_hash(&sh512,h); -#else // for ed448? - dom4(ph,cl,&DOM); - sha3 SHA3; - SHA3_init(&SHA3,SHAKE256); - for (int i=0;ival[i]); - for (int i=0;ival[i]); - for (int i=0;ival[i]); - for (int i=0;ilen;i++) - SHA3_process(&SHA3,M->val[i]); - SHA3_shake(&SHA3,h,2*b); -#endif - reverse(2*b,h); - BIG_dfromBytesLen(dr,h,2*b); - return 2*b; -} - -static void getR(bool ph,int b,char *digest,octet *context,octet *M,DBIG dr) { - char h[128]; - char dom[64]; - octet DOM={0,sizeof(dom),dom}; - int cl; - if (context==NULL) cl=0; - else cl=context->len&0xff; - -#if CURVE_SECURITY_ZZZ <= 128 // for ed25519? - hash512 sh512; - HASH512_init(&sh512); - if (ph || cl>0) - { // if not prehash and no context, omit dom2() - dom2(ph,cl,&DOM); - for (int i=0;ival[i]); - } - for (int i=b;i<2*b;i++ ) - HASH512_process(&sh512,digest[i]); - for (int i=0;ilen;i++) - HASH512_process(&sh512,M->val[i]); - HASH512_hash(&sh512,h); - -#else // for ed448? - dom4(ph,cl,&DOM); - sha3 SHA3; - SHA3_init(&SHA3,SHAKE256); - for (int i=0;ival[i]); - for (int i=b;i<2*b;i++ ) - SHA3_process(&SHA3,digest[i]); - for (int i=0;ilen;i++) - SHA3_process(&SHA3,M->val[i]); - SHA3_shake(&SHA3,h,2*b); -#endif - - reverse(2*b,h); - BIG_dfromBytesLen(dr,h,2*b); -} -// encode integer (little endian) -static int encode_int(XXX::BIG x,char *ei) { - int b,index=0; - - if (8*MODBYTES_XXX==MBITS_YYY) index=1; // extra byte needed for compression - b=MODBYTES_XXX+index; - - ei[0]=0; - BIG_toBytes(&ei[index],x); - reverse(b,ei); - return b; -} - -// encode point -static void encode(ZZZ::ECP *P,octet *W) { - BIG x,y; - int b,index=0; - - if (8*MODBYTES_XXX==MBITS_YYY) index=1; // extra byte needed for compression - b=MODBYTES_XXX+index; - - ECP_get(x, y, P); - b=encode_int(y,W->val); - W->val[b-1]|=BIG_parity(x)<<7; - W->len=b; -} - -// decode integer (little endian) -static int decode_int(bool strip_sign,char *ei,XXX::BIG x) { - int b,index=0; - int sign=0; - char r[MODBYTES_XXX+1]; - - if (8*MODBYTES_XXX==MBITS_YYY) index=1; // extra byte needed for compression - b=MODBYTES_XXX+index; - - for (int i=0;ival,Y); // LSB of x - FP_nres(&x,Y); - FP_sqr(&x,&x); - FP_copy(&d,&x); FP_one(&one); - FP_sub(&x,&x,&one); - FP_norm(&x); - FP_rcopy(&t, ZZZ::CURVE_B); - - FP_mul(&d,&d,&t); -#if CURVE_A_ZZZ == 1 - FP_sub(&d,&d,&one); -#else - FP_add(&d,&d,&one); -#endif - FP_norm(&d); -// inverse square root trick for sqrt(x/d) - FP_sqr(&t,&x); - FP_mul(&x,&x,&t); - FP_mul(&x,&x,&d); - if (!FP_qr(&x,&hint)) - { - ECP_inf(P); - return; - } - FP_sqrt(&d,&x,&hint); - FP_inv(&x,&x,&hint); - FP_mul(&x,&x,&d); - FP_mul(&x,&x,&t); - - FP_reduce(&x); - FP_redc(X,&x); - if (BIG_parity(X)!=sign) - FP_neg(&x,&x); - FP_norm(&x); - FP_redc(X,&x); - ECP_set(P,X,Y); -} - -/* Calculate a public/private EC GF(p) key pair. Q=D.G mod EC(p), - * where D is the secret key and Q is the public key - * and G is fixed generator. - * RNG is a cryptographically strong RNG - * If RNG==NULL, D is generated externally - */ -int ZZZ::EDDSA_KEY_PAIR_GENERATE(csprng *RNG,octet* D,octet *Q) -{ - BIG r, x, y, s; - ECP G; - char digest[128]; - int res = EDDSA_OK; - int b,index=0; - - if (8*MODBYTES_XXX==MBITS_YYY) index=1; // extra byte needed for compression - b=MODBYTES_XXX+index; - - ECP_generator(&G); - - if (RNG != NULL) - OCT_rand(D, RNG, b); // create random private key - - H(D,digest); - -// reverse bytes for little endian - reverse(b,digest); - BIG_fromBytes(s,&digest[index]); - RFC7748(s); - ECP_mul(&G, s); - - encode(&G,Q); - return res; -} - -// Generate a signature using key pair (D,Q) on message M -// Set ph=true if message has already been pre-hashed -// if ph=false, then context should be NULL for ed25519. However RFC8032 mode ed25519ctx is supported by supplying a non-NULL or non-empty context -int ZZZ::EDDSA_SIGNATURE(bool ph,octet *D, octet *context,octet *M,octet *SIG) -{ - DBIG dr; - BIG s,sr,sd,q; - ECP R; - char digest[128]; - char pq[MODBYTES_XXX+1]; - octet Q={0,sizeof(pq),pq}; - H(D,digest); // hash of private key - int res = EDDSA_OK; - int b,index=0; - if (8*MODBYTES_XXX==MBITS_YYY) index=1; // extra byte needed for compression - b=MODBYTES_XXX+index; - - EDDSA_KEY_PAIR_GENERATE(NULL,D,&Q); - - BIG_rcopy(q, CURVE_Order); - ECP_generator(&R); - - if (D->len!=Q.len || D->len!=b) - res=EDDSA_INVALID_PUBLIC_KEY; - if (res==EDDSA_OK) - { - getR(ph,b,digest,context,M,dr); - BIG_dmod(sr,dr,q); - ECP_mul(&R,sr); - encode(&R,SIG); -// reverse bytes for little endian - reverse(b,digest); - BIG_fromBytes(s,&digest[index]); - RFC7748(s); - H2(ph,context,SIG,&Q,M,dr); - BIG_dmod(sd,dr,q); - BIG_modmul(s,s,sd,q); - BIG_modadd(s,s,sr,q); - encode_int(s,&SIG->val[b]); - SIG->len=2*b; - } - return res; -} - -// verify a signature using public key Q -// same context (if any) as used for signature -bool ZZZ::EDDSA_VERIFY(bool ph,octet *Q,octet *context,octet *M,octet *SIG) -{ - DBIG du; - BIG q,t,su; - ECP R,QD,G; - int res = EDDSA_OK; - bool dr,dq; - int lg=0; - int c,b,index=0; - if (8*MODBYTES_XXX==MBITS_YYY) index=1; // extra byte needed for compression - b=MODBYTES_XXX+index; - - c=ZZZ::CURVE_Cof_I; - while (c!=1) - { - lg++; - c/=2; - } - BIG_rcopy(q, CURVE_Order); - - decode(SIG,&R); - if (ECP_isinf(&R)) return false; - decode_int(false,&SIG->val[b],t); - if (BIG_comp(t,q)>=0) return false; - decode(Q,&QD); - if (ECP_isinf(&QD)) return false; - - H2(ph,context,SIG,Q,M,du); - BIG_dmod(su,du,q); - ECP_generator(&G); - for (int i=0;i>n */ -static void WWW::FF_sducopy(BIG x[], BIG y[], int n) -{ - int i; - for (i = 0; i < n; i++) - BIG_copy(x[i], y[n + i]); -} - -/* set to zero */ -void WWW::FF_zero(BIG x[], int n) -{ - int i; - for (i = 0; i < n; i++) - BIG_zero(x[i]); -} - -/* test equals 0 */ -int WWW::FF_iszilch(BIG x[], int n) -{ - int i; - for (i = 0; i < n; i++) - if (!BIG_iszilch(x[i])) return 0; - return 1; -} - -/* shift right by BIGBITS_XXX-bit words */ -static void WWW::FF_shrw(BIG a[], int n) -{ - int i; - for (i = 0; i < n; i++) - { - BIG_copy(a[i], a[i + n]); - BIG_zero(a[i + n]); - } -} - -/* shift left by BIGBITS_XXX-bit words */ -static void WWW::FF_shlw(BIG a[], int n) -{ - int i; - for (i = 0; i < n; i++) - { - BIG_copy(a[i + n], a[i]); - BIG_zero(a[i]); - } -} - -/* extract last bit */ -int WWW::FF_parity(BIG x[]) -{ - return BIG_parity(x[0]); -} - -/* extract last m bits */ -int WWW::FF_lastbits(BIG x[], int m) -{ - return BIG_lastbits(x[0], m); -} - -/* x=1 */ -void WWW::FF_one(BIG x[], int n) -{ - int i; - BIG_one(x[0]); - for (i = 1; i < n; i++) - BIG_zero(x[i]); -} - -/* x=m, where m is 32-bit int */ -void WWW::FF_init(BIG x[], sign32 m, int n) -{ - int i; - BIG_zero(x[0]); -#if CHUNK<64 - x[0][0] = (chunk)(m & BMASK_XXX); - x[0][1] = (chunk)(m >> BASEBITS_XXX); -#else - x[0][0] = (chunk)m; -#endif - for (i = 1; i < n; i++) - BIG_zero(x[i]); -} - -/* compare x and y - must be normalised */ -int WWW::FF_comp(BIG x[], BIG y[], int n) -{ - int i, j; - for (i = n - 1; i >= 0; i--) - { - j = BIG_comp(x[i], y[i]); - if (j != 0) return j; - } - return 0; -} - -/* recursive add */ -static void WWW::FF_radd(BIG z[], int zp, BIG x[], int xp, BIG y[], int yp, int n) -{ - int i; - for (i = 0; i < n; i++) - BIG_add(z[zp + i], x[xp + i], y[yp + i]); -} - -/* recursive inc */ -static void WWW::FF_rinc(BIG z[], int zp, BIG y[], int yp, int n) -{ - int i; - for (i = 0; i < n; i++) - BIG_add(z[zp + i], z[zp + i], y[yp + i]); -} - -/* recursive dec */ -static void WWW::FF_rdec(BIG z[], int zp, BIG y[], int yp, int n) -{ - int i; - for (i = 0; i < n; i++) - BIG_sub(z[zp + i], z[zp + i], y[yp + i]); -} - -/* simple add */ -void WWW::FF_add(BIG z[], BIG x[], BIG y[], int n) -{ - int i; - for (i = 0; i < n; i++) - BIG_add(z[i], x[i], y[i]); -} - -/* simple sub */ -void WWW::FF_sub(BIG z[], BIG x[], BIG y[], int n) -{ - int i; - for (i = 0; i < n; i++) - BIG_sub(z[i], x[i], y[i]); -} - -/* increment/decrement by a small integer */ -void WWW::FF_inc(BIG x[], int m, int n) -{ - BIG_inc(x[0], m); - FF_norm(x, n); -} - -void WWW::FF_dec(BIG x[], int m, int n) -{ - BIG_dec(x[0], m); - FF_norm(x, n); -} - -/* normalise - but hold any overflow in top part unless n<0 */ -static void WWW::FF_rnorm(BIG z[], int zp, int n) -{ - int i, trunc = 0; - chunk carry; - if (n < 0) - { - /* -v n signals to do truncation */ - n = -n; - trunc = 1; - } - for (i = 0; i < n - 1; i++) - { - carry = BIG_norm(z[zp + i]); - - z[zp + i][NLEN_XXX - 1] ^= carry << P_TBITS_WWW; /* remove it */ - z[zp + i + 1][0] += carry; - } - carry = BIG_norm(z[zp + n - 1]); - if (trunc) z[zp + n - 1][NLEN_XXX - 1] ^= carry << P_TBITS_WWW; -} - -void WWW::FF_norm(BIG z[], int n) -{ - FF_rnorm(z, 0, n); -} - -/* shift left by one bit */ -void WWW::FF_shl(BIG x[], int n) -{ - int i; - int carry, delay_carry = 0; - for (i = 0; i < n - 1; i++) - { - carry = BIG_fshl(x[i], 1); - x[i][0] |= delay_carry; - x[i][NLEN_XXX - 1] ^= (chunk)carry << P_TBITS_WWW; - delay_carry = carry; - } - BIG_fshl(x[n - 1], 1); - x[n - 1][0] |= delay_carry; -} - -/* shift right by one bit */ -void WWW::FF_shr(BIG x[], int n) -{ - int i; - int carry; - for (i = n - 1; i > 0; i--) - { - carry = BIG_fshr(x[i], 1); - x[i - 1][NLEN_XXX - 1] |= (chunk)carry << P_TBITS_WWW; - } - BIG_fshr(x[0], 1); -} - -void WWW::FF_output(BIG x[], int n) -{ - int i; - FF_norm(x, n); - for (i = n - 1; i >= 0; i--) - { - BIG_output(x[i]); - printf(" "); - } -} - -void WWW::FF_rawoutput(BIG x[], int n) -{ - int i; - for (i = n - 1; i >= 0; i--) - { - BIG_rawoutput(x[i]); - printf(" "); - } -} - -/* Convert FFs to/from octet strings */ -void WWW::FF_toOctet(octet *w, BIG x[], int n) -{ - int i; - w->len = n * MODBYTES_XXX; - for (i = 0; i < n; i++) - { - BIG_toBytes(&(w->val[(n - i - 1)*MODBYTES_XXX]), x[i]); - } -} - -void WWW::FF_fromOctet(BIG x[], octet *w, int n) -{ - int i; - for (i = 0; i < n; i++) - { - BIG_fromBytes(x[i], &(w->val[(n - i - 1)*MODBYTES_XXX])); - } -} - -/* in-place swapping using xor - side channel resistant */ -static void WWW::FF_cswap(BIG a[], BIG b[], int d, int n) -{ - int i; - for (i = 0; i < n; i++) - BIG_cswap(a[i], b[i], d); - return; -} - -/* z=x*y, t is workspace */ -static void WWW::FF_karmul(BIG z[], int zp, BIG x[], int xp, BIG y[], int yp, BIG t[], int tp, int n) -{ - int nd2; - if (n == 1) - { - BIG_norm(x[xp]); - BIG_norm(y[yp]); - BIG_mul(t[tp], x[xp], y[yp]); - BIG_split(z[zp + 1], z[zp], t[tp], BIGBITS_XXX); - return; - } - - nd2 = n / 2; - FF_radd(z, zp, x, xp, x, xp + nd2, nd2); - FF_rnorm(z, zp, nd2); /* needs this if recursion level too deep */ - - FF_radd(z, zp + nd2, y, yp, y, yp + nd2, nd2); - FF_rnorm(z, zp + nd2, nd2); - FF_karmul(t, tp, z, zp, z, zp + nd2, t, tp + n, nd2); - FF_karmul(z, zp, x, xp, y, yp, t, tp + n, nd2); - FF_karmul(z, zp + n, x, xp + nd2, y, yp + nd2, t, tp + n, nd2); - FF_rdec(t, tp, z, zp, n); - FF_rdec(t, tp, z, zp + n, n); - FF_rinc(z, zp + nd2, t, tp, n); - FF_rnorm(z, zp, 2 * n); -} - -static void WWW::FF_karsqr(BIG z[], int zp, BIG x[], int xp, BIG t[], int tp, int n) -{ - int nd2; - if (n == 1) - { - BIG_norm(x[xp]); - BIG_sqr(t[tp], x[xp]); - BIG_split(z[zp + 1], z[zp], t[tp], BIGBITS_XXX); - return; - } - nd2 = n / 2; - FF_karsqr(z, zp, x, xp, t, tp + n, nd2); - FF_karsqr(z, zp + n, x, xp + nd2, t, tp + n, nd2); - FF_karmul(t, tp, x, xp, x, xp + nd2, t, tp + n, nd2); - FF_rinc(z, zp + nd2, t, tp, n); - FF_rinc(z, zp + nd2, t, tp, n); - - FF_rnorm(z, zp + nd2, n); /* was FF_rnorm(z,zp,2*n) */ -} - -static void WWW::FF_karmul_lower(BIG z[], int zp, BIG x[], int xp, BIG y[], int yp, BIG t[], int tp, int n) -{ - /* Calculates Least Significant bottom half of x*y */ - int nd2; - if (n == 1) - { - /* only calculate bottom half of product */ - BIG_norm(x[xp]); - BIG_norm(y[yp]); - BIG_smul(z[zp], x[xp], y[yp]); - return; - } - nd2 = n / 2; - FF_karmul(z, zp, x, xp, y, yp, t, tp + n, nd2); - FF_karmul_lower(t, tp, x, xp + nd2, y, yp, t, tp + n, nd2); - FF_rinc(z, zp + nd2, t, tp, nd2); - FF_karmul_lower(t, tp, x, xp, y, yp + nd2, t, tp + n, nd2); - FF_rinc(z, zp + nd2, t, tp, nd2); - FF_rnorm(z, zp + nd2, -nd2); /* truncate it */ -} - -static void WWW::FF_karmul_upper(BIG z[], BIG x[], BIG y[], BIG t[], int n) -{ - /* Calculates Most Significant upper half of x*y, given lower part */ - int nd2; - - nd2 = n / 2; - FF_radd(z, n, x, 0, x, nd2, nd2); - FF_radd(z, n + nd2, y, 0, y, nd2, nd2); - FF_rnorm(z, n, nd2); - FF_rnorm(z, n + nd2, nd2); - - FF_karmul(t, 0, z, n + nd2, z, n, t, n, nd2); /* t = (a0+a1)(b0+b1) */ - FF_karmul(z, n, x, nd2, y, nd2, t, n, nd2); /* z[n]= a1*b1 */ - /* z[0-nd2]=l(a0b0) z[nd2-n]= h(a0b0)+l(t)-l(a0b0)-l(a1b1) */ - FF_rdec(t, 0, z, n, n); /* t=t-a1b1 */ - FF_rinc(z, nd2, z, 0, nd2); /* z[nd2-n]+=l(a0b0) = h(a0b0)+l(t)-l(a1b1) */ - FF_rdec(z, nd2, t, 0, nd2); /* z[nd2-n]=h(a0b0)+l(t)-l(a1b1)-l(t-a1b1)=h(a0b0) */ - FF_rnorm(z, 0, -n); /* a0b0 now in z - truncate it */ - FF_rdec(t, 0, z, 0, n); /* (a0+a1)(b0+b1) - a0b0 */ - FF_rinc(z, nd2, t, 0, n); - - FF_rnorm(z, nd2, n); -} - -/* z=x*y */ -void WWW::FF_mul(BIG z[], BIG x[], BIG y[], int n) -{ -#ifndef USE_VLAS - BIG t[2 * FFLEN_WWW]; -#else - BIG t[2 * n]; -#endif - FF_karmul(z, 0, x, 0, y, 0, t, 0, n); -} - -/* return low part of product */ -static void WWW::FF_lmul(BIG z[], BIG x[], BIG y[], int n) -{ -#ifndef USE_VLAS - BIG t[2 * FFLEN_WWW]; -#else - BIG t[2 * n]; -#endif - FF_karmul_lower(z, 0, x, 0, y, 0, t, 0, n); -} - -/* Set b=b mod c */ -void WWW::FF_mod(BIG b[], BIG c[], int n) -{ - int k = 0; - - FF_norm(b, n); - if (FF_comp(b, c, n) < 0) - return; - do - { - FF_shl(c, n); - k++; - } - while (FF_comp(b, c, n) >= 0); - - while (k > 0) - { - FF_shr(c, n); - if (FF_comp(b, c, n) >= 0) - { - FF_sub(b, b, c, n); - FF_norm(b, n); - } - k--; - } -} - -/* z=x^2 */ -void WWW::FF_sqr(BIG z[], BIG x[], int n) -{ -#ifndef USE_VLAS - BIG t[2 * FFLEN_WWW]; -#else - BIG t[2 * n]; -#endif - FF_karsqr(z, 0, x, 0, t, 0, n); -} - -/* r=t mod modulus, N is modulus, ND is Montgomery Constant */ -static void WWW::FF_reduce(BIG r[], BIG T[], BIG N[], BIG ND[], int n) -{ - /* fast karatsuba Montgomery reduction */ -#ifndef USE_VLAS - BIG t[2 * FFLEN_WWW]; - BIG m[FFLEN_WWW]; -#else - BIG t[2 * n]; - BIG m[n]; -#endif - WWW::FF_sducopy(r, T, n); /* keep top half of T */ - FF_karmul_lower(m, 0, T, 0, ND, 0, t, 0, n); /* m=T.(1/N) mod R */ - - FF_karmul_upper(T, N, m, t, n); /* T=mN */ - FF_sducopy(m, T, n); - - FF_add(r, r, N, n); - FF_sub(r, r, m, n); - FF_norm(r, n); -} - - -/* Set r=a mod b */ -/* a is of length - 2*n */ -/* r,b is of length - n */ -void WWW::FF_dmod(BIG r[], BIG a[], BIG b[], int n) -{ - int k; -#ifndef USE_VLAS - BIG m[2 * FFLEN_WWW]; - BIG x[2 * FFLEN_WWW]; -#else - BIG m[2 * n]; - BIG x[2 * n]; -#endif - FF_copy(x, a, 2 * n); - FF_norm(x, 2 * n); - FF_dsucopy(m, b, n); - k = BIGBITS_XXX * n; - - while (FF_comp(x, m, 2 * n) >= 0) - { - FF_sub(x, x, m, 2 * n); - FF_norm(x, 2 * n); - } - - while (k > 0) - { - FF_shr(m, 2 * n); - - if (FF_comp(x, m, 2 * n) >= 0) - { - FF_sub(x, x, m, 2 * n); - FF_norm(x, 2 * n); - } - - k--; - } - FF_copy(r, x, n); - FF_mod(r, b, n); -} - -/* Set r=1/a mod p. Binary method - a

= 0) - { - - FF_sub(u, u, v, n); - FF_norm(u, n); - if (FF_comp(x1, x2, n) >= 0) FF_sub(x1, x1, x2, n); - else - { - FF_sub(t, p, x2, n); - FF_add(x1, x1, t, n); - } - FF_norm(x1, n); - } - else - { - FF_sub(v, v, u, n); - FF_norm(v, n); - if (FF_comp(x2, x1, n) >= 0) FF_sub(x2, x2, x1, n); - else - { - FF_sub(t, p, x1, n); - FF_add(x2, x2, t, n); - } - FF_norm(x2, n); - } - } - if (FF_comp(u, one, n) == 0) - FF_copy(r, x1, n); - else - FF_copy(r, x2, n); -} - -/* nesidue mod m */ -static void WWW::FF_nres(BIG a[], BIG m[], int n) -{ -#ifndef USE_VLAS - BIG d[2 * FFLEN_WWW]; -#else - BIG d[2 * n]; -#endif - if (n == 1) - { - BIG_dscopy(d[0], a[0]); - BIG_dshl(d[0], NLEN_XXX * BASEBITS_XXX); - BIG_dmod(a[0], d[0], m[0]); - } - else - { - FF_dsucopy(d, a, n); - FF_dmod(a, d, m, n); - } -} - -static void WWW::FF_redc(BIG a[], BIG m[], BIG ND[], int n) -{ -#ifndef USE_VLAS - BIG d[2 * FFLEN_WWW]; -#else - BIG d[2 * n]; -#endif - if (n == 1) - { - BIG_dzero(d[0]); - BIG_dscopy(d[0], a[0]); - BIG_monty(a[0], m[0], ((chunk)1 << BASEBITS_XXX) - ND[0][0], d[0]); - } - else - { - FF_mod(a, m, n); - FF_dscopy(d, a, n); - FF_reduce(a, d, m, ND, n); - FF_mod(a, m, n); - } -} - -/* U=1/a mod 2^m - Arazi & Qi */ -static void WWW::FF_invmod2m(BIG U[], BIG a[], int n) -{ - int i; -#ifndef USE_VLAS - BIG t1[2*FFLEN_WWW], b[FFLEN_WWW], c[FFLEN_WWW]; -#else - BIG t1[2 * n], b[n], c[n]; -#endif - - FF_zero(U, n); - FF_zero(b, n); - FF_zero(c, n); - FF_zero(t1, 2 * n); - - BIG_copy(U[0], a[0]); - BIG_invmod2m(U[0]); - for (i = 1; i < n; i <<= 1) - { - FF_copy(b, a, i); - FF_mul(t1, U, b, i); - FF_shrw(t1, i); // top half to bottom half, top half=0 - - FF_copy(c, a, 2 * i); - FF_shrw(c, i); // top half of c - FF_lmul(b, U, c, i); // should set top half of b=0 - FF_add(t1, t1, b, i); - FF_norm(t1, 2 * i); - FF_lmul(b, t1, U, i); - FF_copy(t1, b, i); - FF_one(b, i); - FF_shlw(b, i); - FF_sub(t1, b, t1, 2 * i); - FF_norm(t1, 2 * i); - FF_shlw(t1, i); - FF_add(U, U, t1, 2 * i); - } - - FF_norm(U, n); -} - -void WWW::FF_random(BIG x[], csprng *rng, int n) -{ - int i; - for (i = 0; i < n; i++) - { - BIG_random(x[i], rng); - } - /* make sure top bit is 1 */ - while (BIG_nbits(x[n - 1]) < MODBYTES_XXX * 8) BIG_random(x[n - 1], rng); -} - -/* generate random x mod p */ -void WWW::FF_randomnum(BIG x[], BIG p[], csprng *rng, int n) -{ - int i; -#ifndef USE_VLAS - BIG d[2 * FFLEN_WWW]; -#else - BIG d[2 * n]; -#endif - for (i = 0; i < 2 * n; i++) - { - BIG_random(d[i], rng); - } - FF_dmod(x, d, p, n); -} - -static void WWW::FF_modmul(BIG z[], BIG x[], BIG y[], BIG p[], BIG ND[], int n) -{ -#ifndef USE_VLAS - BIG d[2 * FFLEN_WWW]; -#else - BIG d[2 * n]; -#endif - chunk ex = P_EXCESS_WWW(x[n - 1]); - chunk ey = P_EXCESS_WWW(y[n - 1]); -#ifdef dchunk - if ((dchunk)(ex + 1) * (ey + 1) > (dchunk)P_FEXCESS_WWW) -#else - if ((ex + 1) > P_FEXCESS_WWW / (ey + 1)) -#endif - { -#ifdef DEBUG_REDUCE - printf("Product too large - reducing it %d %d\n", ex, ey); -#endif - FF_mod(x, p, n); - } - - if (n == 1) - { - BIG_mul(d[0], x[0], y[0]); - BIG_monty(z[0], p[0], ((chunk)1 << BASEBITS_XXX) - ND[0][0], d[0]); - } - else - { - FF_mul(d, x, y, n); - FF_reduce(z, d, p, ND, n); - } -} - -static void WWW::FF_modsqr(BIG z[], BIG x[], BIG p[], BIG ND[], int n) -{ -#ifndef USE_VLAS - BIG d[2 * FFLEN_WWW]; -#else - BIG d[2 * n]; -#endif - chunk ex = P_EXCESS_WWW(x[n - 1]); -#ifdef dchunk - if ((dchunk)(ex + 1) * (ex + 1) > (dchunk)P_FEXCESS_WWW) -#else - if ((ex + 1) > P_FEXCESS_WWW / (ex + 1)) -#endif - { -#ifdef DEBUG_REDUCE - printf("Product too large - reducing it %d\n", ex); -#endif - FF_mod(x, p, n); - } - if (n == 1) - { - BIG_sqr(d[0], x[0]); - BIG_monty(z[0], p[0], ((chunk)1 << BASEBITS_XXX) - ND[0][0], d[0]); - } - else - { - FF_sqr(d, x, n); - FF_reduce(z, d, p, ND, n); - } -} - -/* r=x^e mod p using side-channel resistant Montgomery Ladder, for large e */ -void WWW::FF_skpow(BIG r[], BIG x[], BIG e[], BIG p[], int n) -{ - int i, b; -#ifndef USE_VLAS - BIG R0[FFLEN_WWW], R1[FFLEN_WWW], ND[FFLEN_WWW]; -#else - BIG R0[n], R1[n], ND[n]; -#endif - FF_invmod2m(ND, p, n); - - FF_one(R0, n); - FF_copy(R1, x, n); - FF_nres(R0, p, n); - FF_nres(R1, p, n); - - for (i = 8 * MODBYTES_XXX * n - 1; i >= 0; i--) - { - b = BIG_bit(e[i / BIGBITS_XXX], i % BIGBITS_XXX); - FF_modmul(r, R0, R1, p, ND, n); - - FF_cswap(R0, R1, b, n); - FF_modsqr(R0, R0, p, ND, n); - - FF_copy(R1, r, n); - FF_cswap(R0, R1, b, n); - } - FF_copy(r, R0, n); - FF_redc(r, p, ND, n); -} - -/* r=x^e mod p using side-channel resistant Montgomery Ladder, for short e */ -void WWW::FF_skspow(BIG r[], BIG x[], BIG e, BIG p[], int n) -{ - int i, b; -#ifndef USE_VLAS - BIG R0[FFLEN_WWW], R1[FFLEN_WWW], ND[FFLEN_WWW]; -#else - BIG R0[n], R1[n], ND[n]; -#endif - FF_invmod2m(ND, p, n); - FF_one(R0, n); - FF_copy(R1, x, n); - FF_nres(R0, p, n); - FF_nres(R1, p, n); - for (i = 8 * MODBYTES_XXX - 1; i >= 0; i--) - { - b = BIG_bit(e, i); - FF_modmul(r, R0, R1, p, ND, n); - FF_cswap(R0, R1, b, n); - FF_modsqr(R0, R0, p, ND, n); - FF_copy(R1, r, n); - FF_cswap(R0, R1, b, n); - } - FF_copy(r, R0, n); - FF_redc(r, p, ND, n); -} - -/* raise to an integer power - right-to-left method */ -void WWW::FF_power(BIG r[], BIG x[], int e, BIG p[], int n) -{ - int f = 1; -#ifndef USE_VLAS - BIG w[FFLEN_WWW], ND[FFLEN_WWW]; -#else - BIG w[n], ND[n]; -#endif - FF_invmod2m(ND, p, n); - - FF_copy(w, x, n); - FF_nres(w, p, n); - - if (e == 2) - { - FF_modsqr(r, w, p, ND, n); - } - else for (;;) - { - if (e % 2 == 1) - { - if (f) FF_copy(r, w, n); - else FF_modmul(r, r, w, p, ND, n); - f = 0; - } - e >>= 1; - if (e == 0) break; - FF_modsqr(w, w, p, ND, n); - } - - FF_redc(r, p, ND, n); -} - -/* r=x^e mod p, faster but not side channel resistant */ -void WWW::FF_pow(BIG r[], BIG x[], BIG e[], BIG p[], int n) -{ - int i, b; -#ifndef USE_VLAS - BIG w[FFLEN_WWW], ND[FFLEN_WWW]; -#else - BIG w[n], ND[n]; -#endif - FF_invmod2m(ND, p, n); - - FF_copy(w, x, n); - FF_one(r, n); - FF_nres(r, p, n); - FF_nres(w, p, n); - - for (i = 8 * MODBYTES_XXX * n - 1; i >= 0; i--) - { - FF_modsqr(r, r, p, ND, n); - b = BIG_bit(e[i / BIGBITS_XXX], i % BIGBITS_XXX); - if (b == 1) FF_modmul(r, r, w, p, ND, n); - } - FF_redc(r, p, ND, n); -} - -/* double exponentiation r=x^e.y^f mod p */ -void WWW::FF_pow2(BIG r[], BIG x[], BIG e, BIG y[], BIG f, BIG p[], int n) -{ - int i, eb, fb; -#ifndef USE_VLAS - BIG xn[FFLEN_WWW], yn[FFLEN_WWW], xy[FFLEN_WWW], ND[FFLEN_WWW]; -#else - BIG xn[n], yn[n], xy[n], ND[n]; -#endif - - FF_invmod2m(ND, p, n); - - FF_copy(xn, x, n); - FF_copy(yn, y, n); - FF_nres(xn, p, n); - FF_nres(yn, p, n); - FF_modmul(xy, xn, yn, p, ND, n); - FF_one(r, n); - FF_nres(r, p, n); - - for (i = 8 * MODBYTES_XXX - 1; i >= 0; i--) - { - eb = BIG_bit(e, i); - fb = BIG_bit(f, i); - FF_modsqr(r, r, p, ND, n); - if (eb == 1) - { - if (fb == 1) FF_modmul(r, r, xy, p, ND, n); - else FF_modmul(r, r, xn, p, ND, n); - } - else - { - if (fb == 1) FF_modmul(r, r, yn, p, ND, n); - } - } - FF_redc(r, p, ND, n); -} - -static sign32 igcd(sign32 x, sign32 y) -{ - /* integer GCD, returns GCD of x and y */ - sign32 r; - if (y == 0) return x; - while ((r = x % y) != 0) - x = y, y = r; - return y; -} - -/* quick and dirty check for common factor with s */ -int WWW::FF_cfactor(BIG w[], sign32 s, int n) -{ - int r; - sign32 g; -#ifndef USE_VLAS - BIG x[FFLEN_WWW], y[FFLEN_WWW]; -#else - BIG x[n], y[n]; -#endif - FF_init(y, s, n); - FF_copy(x, w, n); - FF_norm(x, n); - - do - { - FF_sub(x, x, y, n); - FF_norm(x, n); - while (!FF_iszilch(x, n) && FF_parity(x) == 0) FF_shr(x, n); - } - while (FF_comp(x, y, n) > 0); -#if CHUNK<32 - g = x[0][0] + ((sign32)(x[0][1]) << BASEBITS_XXX); -#else - g = (sign32)x[0][0]; -#endif - r = igcd(s, g); - if (r > 1) return 1; - return 0; -} - -/* Miller-Rabin test for primality. Slow. */ -int WWW::FF_prime(BIG p[], csprng *rng, int n) -{ - int i, j, loop, s = 0; -#ifndef USE_VLAS - BIG d[FFLEN_WWW], x[FFLEN_WWW], unity[FFLEN_WWW], nm1[FFLEN_WWW]; -#else - BIG d[n], x[n], unity[n], nm1[n]; -#endif - sign32 sf = 4849845; /* 3*5*.. *19 */ - - FF_norm(p, n); - - if (FF_cfactor(p, sf, n)) return 0; - - FF_one(unity, n); - FF_sub(nm1, p, unity, n); - FF_norm(nm1, n); - FF_copy(d, nm1, n); - while (FF_parity(d) == 0) - { - FF_shr(d, n); - s++; - } - if (s == 0) return 0; - - for (i = 0; i < 10; i++) - { - FF_randomnum(x, p, rng, n); - FF_pow(x, x, d, p, n); - if (FF_comp(x, unity, n) == 0 || FF_comp(x, nm1, n) == 0) continue; - loop = 0; - for (j = 1; j < s; j++) - { - FF_power(x, x, 2, p, n); - if (FF_comp(x, unity, n) == 0) return 0; - if (FF_comp(x, nm1, n) == 0 ) - { - loop = 1; - break; - } - } - if (loop) continue; - return 0; - } - - return 1; -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp.cpp deleted file mode 100644 index a646c57..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp.cpp +++ /dev/null @@ -1,940 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE mod p functions */ -/* Small Finite Field arithmetic */ -/* SU=m, SU is Stack Usage (NOT_SPECIAL Modulus) */ - -#include "fp_YYY.h" - -using namespace XXX; - -/* Fast Modular Reduction Methods */ - -/* r=d mod m */ -/* d MUST be normalised */ -/* Products must be less than pR in all cases !!! */ -/* So when multiplying two numbers, their product *must* be less than MODBITS_YYY+BASEBITS_XXX*NLEN_XXX */ -/* Results *may* be one bit bigger than MODBITS_YYY */ - -#if MODTYPE_YYY == PSEUDO_MERSENNE -/* r=d mod m */ - -/* Converts from BIG integer to residue form mod Modulus */ -void YYY::FP_nres(FP *y, BIG x) -{ - BIG mdls; - BIG_rcopy(mdls, Modulus); - BIG_copy(y->g, x); - BIG_mod(y->g,mdls); - y->XES = 1; -} - -/* Converts from residue form back to BIG integer form */ -void YYY::FP_redc(BIG x, FP *y) -{ - BIG_copy(x, y->g); -} - -/* reduce a DBIG to a BIG exploiting the special form of the modulus */ -void YYY::FP_mod(BIG r, DBIG d) -{ - BIG t, b; - chunk v, tw; - BIG_split(t, b, d, MODBITS_YYY); - - /* Note that all of the excess gets pushed into t. So if squaring a value with a 4-bit excess, this results in - t getting all 8 bits of the excess product! So products must be less than pR which is Montgomery compatible */ - - if (MConst < NEXCESS_XXX) - { - BIG_imul(t, t, MConst); - BIG_norm(t); - BIG_add(r, t, b); - BIG_norm(r); - tw = r[NLEN_XXX - 1]; - r[NLEN_XXX - 1] &= TMASK_YYY; - r[0] += MConst * ((tw >> TBITS_YYY)); - } - else - { - v = BIG_pmul(t, t, MConst); - BIG_add(r, t, b); - BIG_norm(r); - tw = r[NLEN_XXX - 1]; - r[NLEN_XXX - 1] &= TMASK_YYY; -#if CHUNK == 16 - r[1] += muladd(MConst, ((tw >> TBITS_YYY) + (v << (BASEBITS_XXX - TBITS_YYY))), 0, &r[0]); -#else - r[0] += MConst * ((tw >> TBITS_YYY) + (v << (BASEBITS_XXX - TBITS_YYY))); -#endif - } - BIG_norm(r); -} -#endif - -/* This only applies to Curve C448, so specialised (for now) */ -#if MODTYPE_YYY == GENERALISED_MERSENNE - -void YYY::FP_nres(FP *y, BIG x) -{ - BIG mdls; - BIG_rcopy(mdls, Modulus); - BIG_copy(y->g, x); - BIG_mod(y->g,mdls); - y->XES = 1; -} - -/* Converts from residue form back to BIG integer form */ -void YYY::FP_redc(BIG x, FP *y) -{ - BIG_copy(x, y->g); -} - -/* reduce a DBIG to a BIG exploiting the special form of a modulus 2^m - 2^n -c */ -void YYY::FP_mod(BIG r, DBIG d) -{ - - BIG t, b; - chunk carry; - BIG_split(t, b, d, MBITS_YYY); - - BIG_add(r, t, b); - - BIG_dscopy(d, t); - BIG_dshl(d, MBITS_YYY / 2); - - BIG_split(t, b, d, MBITS_YYY); - - BIG_add(r, r, t); - BIG_add(r, r, b); - BIG_norm(r); - BIG_shl(t, MBITS_YYY / 2); - - BIG_add(r, r, t); - - carry = r[NLEN_XXX - 1] >> TBITS_YYY; - - r[NLEN_XXX - 1] &= TMASK_YYY; - r[0] += carry; - - r[224 / BASEBITS_XXX] += carry << (224 % BASEBITS_XXX); /* need to check that this falls mid-word */ - BIG_norm(r); - -/* - - BIG t, b, t2, b2; - int BTset = MBITS_YYY / 2; - chunk carry; - BIG_split(t, b, d, MBITS_YYY); - - BIG_dscopy(d, t); - BIG_dshl(d, BTset); - - BIG_split(t2, b2, d, MBITS_YYY); - - BIG_add(b, b, b2); // 2 - BIG_add(t, t, t2); // 2 - - BIG_shl(t2, BTset); - - BIG_add(b, b, t2); // 3 - BIG_norm(t); - -// carry=0; -// Now multiply t by MConst..(?) and extract carry -// if (MConst!=1) -// carry=BIG_pmul(t,t,MConst); - - BIG_add(r, t, b); - BIG_norm(r); - - carry = r[NLEN_XXX - 1] >> TBITS_YYY; // + (carry<<(BASEBITS_XXX-TBITS_YYY)); - r[NLEN_XXX - 1] &= TMASK_YYY; - - r[BTset / BASEBITS_XXX] += carry << (BTset % BASEBITS_XXX); // need to check that this falls mid-word -// if (MConst!=1) carry*=MConst; - r[0] += carry; - - BIG_norm(r); -*/ -} - -#endif - -#if MODTYPE_YYY == MONTGOMERY_FRIENDLY - -/* convert to Montgomery n-residue form */ -void YYY::FP_nres(FP *y, BIG x) -{ - DBIG d; - BIG r; - BIG_rcopy(r, R2modp); - BIG_mul(d, x, r); - FP_mod(y->g, d); - y->XES = 2; -} - -/* convert back to regular form */ -void YYY::FP_redc(BIG x, FP *y) -{ - DBIG d; - BIG_dzero(d); - BIG_dscopy(d, y->g); - FP_mod(x, d); -} - -/* fast modular reduction from DBIG to BIG exploiting special form of the modulus */ -void YYY::FP_mod(BIG a, DBIG d) -{ - int i; - - for (i = 0; i < NLEN_XXX; i++) - d[NLEN_XXX + i] += muladd(d[i], MConst - 1, d[i], &d[NLEN_XXX + i - 1]); - - BIG_sducopy(a, d); - BIG_norm(a); -} - -#endif - -#if MODTYPE_YYY == NOT_SPECIAL - -/* convert to Montgomery n-residue form */ -void YYY::FP_nres(FP *y, BIG x) -{ - DBIG d; - BIG r; - BIG_rcopy(r, R2modp); - BIG_mul(d, x, r); - FP_mod(y->g, d); - y->XES = 2; -} - -/* convert back to regular form */ -void YYY::FP_redc(BIG x, FP *y) -{ - DBIG d; - BIG_dzero(d); - BIG_dscopy(d, y->g); - FP_mod(x, d); -} - - -/* reduce a DBIG to a BIG using Montgomery's no trial division method */ -/* d is expected to be dnormed before entry */ -/* SU= 112 */ -void YYY::FP_mod(BIG a, DBIG d) -{ - BIG mdls; - BIG_rcopy(mdls, Modulus); - BIG_monty(a, mdls, MConst, d); -} - -#endif - -void YYY::FP_from_int(FP *x,int a) -{ - BIG w; - if (a<0) BIG_rcopy(w, Modulus); - else BIG_zero(w); - BIG_inc(w,a); BIG_norm(w); - FP_nres(x,w); -} - -/* test x==0 ? */ -/* SU= 48 */ -int YYY::FP_iszilch(FP *x) -{ - BIG m; - FP y; - FP_copy(&y,x); - FP_reduce(&y); - FP_redc(m,&y); - return BIG_iszilch(m); -} - -/* input must be reduced */ -int YYY::FP_isunity(FP *x) -{ - BIG m; - FP y; - FP_copy(&y,x); - FP_reduce(&y); - FP_redc(m,&y); - return BIG_isunity(m); -} - -void YYY::FP_copy(FP *y, FP *x) -{ - BIG_copy(y->g, x->g); - y->XES = x->XES; -} - -void YYY::FP_rcopy(FP *y, const BIG c) -{ - BIG b; - BIG_rcopy(b, c); - FP_nres(y, b); -} - -/* Swap a and b if d=1 */ -void YYY::FP_cswap(FP *a, FP *b, int d) -{ - sign32 t, c = d; - BIG_cswap(a->g, b->g, d); - - c = ~(c - 1); - t = c & ((a->XES) ^ (b->XES)); - a->XES ^= t; - b->XES ^= t; - -} - -/* Move b to a if d=1 */ -void YYY::FP_cmove(FP *a, FP *b, int d) -{ - sign32 c = -d; - - BIG_cmove(a->g, b->g, d); - a->XES ^= (a->XES ^ b->XES)&c; -} - -void YYY::FP_zero(FP *x) -{ - BIG_zero(x->g); - x->XES = 1; -} - -int YYY::FP_equals(FP *x, FP *y) -{ - FP xg, yg; - FP_copy(&xg, x); - FP_copy(&yg, y); - FP_reduce(&xg); FP_reduce(&yg); - - if (BIG_comp(xg.g, yg.g) == 0) return 1; - return 0; -} - -// Is x lexically larger than p-x? -// return -1 for no, 0 if x=0, 1 for yes -int YYY::FP_islarger(FP *x) -{ - BIG p,fx,sx; - if (FP_iszilch(x)) return 0; - BIG_rcopy(p,Modulus); - FP_redc(fx,x); - BIG_sub(sx,p,fx); BIG_norm(sx); - return BIG_comp(fx,sx); -} - -void YYY::FP_toBytes(char *b,FP *x) -{ - BIG t; - FP_redc(t, x); - BIG_toBytes(b, t); -} - -void YYY::FP_fromBytes(FP *x,char *b) -{ - BIG t; - BIG_fromBytes(t, b); - FP_nres(x, t); -} - -/* output FP */ -/* SU= 48 */ -void YYY::FP_output(FP *r) -{ - BIG c; - FP_reduce(r); - FP_redc(c, r); - BIG_output(c); -} - -void YYY::FP_rawoutput(FP *r) -{ - BIG_rawoutput(r->g); -} - -#ifdef GET_STATS -int tsqr = 0, rsqr = 0, tmul = 0, rmul = 0; -int tadd = 0, radd = 0, tneg = 0, rneg = 0; -int tdadd = 0, rdadd = 0, tdneg = 0, rdneg = 0; -#endif - -#ifdef FUSED_MODMUL - -/* Insert fastest code here */ - -#endif - -/* r=a*b mod Modulus */ -/* product must be less that p.R - and we need to know this in advance! */ -/* SU= 88 */ -void YYY::FP_mul(FP *r, FP *a, FP *b) -{ - DBIG d; - - if ((sign64)a->XES * b->XES > (sign64)FEXCESS_YYY) - { -#ifdef DEBUG_REDUCE - printf("Product too large - reducing it\n"); -#endif - FP_reduce(a); /* it is sufficient to fully reduce just one of them < p */ - } - -#ifdef FUSED_MODMUL - FP_modmul(r->g, a->g, b->g); -#else - BIG_mul(d, a->g, b->g); - FP_mod(r->g, d); -#endif - r->XES = 2; -} - - -/* multiplication by an integer, r=a*c */ -/* SU= 136 */ -void YYY::FP_imul(FP *r, FP *a, int c) -{ - DBIG d; - BIG k; - FP f; - - int s = 0; - - if (c < 0) - { - c = -c; - s = 1; - } - -#if MODTYPE_YYY==PSEUDO_MERSENNE || MODTYPE_YYY==GENERALISED_MERSENNE - - BIG_pxmul(d, a->g, c); - FP_mod(r->g, d); - r->XES = 2; - -#else - //Montgomery - if (a->XES * c <= FEXCESS_YYY) - { - BIG_pmul(r->g, a->g, c); - r->XES = a->XES * c; // careful here - XES jumps! - } - else - { // don't want to do this - only a problem for Montgomery modulus and larger constants - BIG_zero(k); - BIG_inc(k, c); - BIG_norm(k); - FP_nres(&f, k); - FP_mul(r, a, &f); - } -#endif - - if (s) - { - FP_neg(r, r); - FP_norm(r); - } -} - -/* Set r=a^2 mod m */ -/* SU= 88 */ -void YYY::FP_sqr(FP *r, FP *a) -{ - DBIG d; - - if ((sign64)a->XES * a->XES > (sign64)FEXCESS_YYY) - { -#ifdef DEBUG_REDUCE - printf("Product too large - reducing it\n"); -#endif - FP_reduce(a); - } - - BIG_sqr(d, a->g); - FP_mod(r->g, d); - r->XES = 2; -} - -/* SU= 16 */ -/* Set r=a+b */ -void YYY::FP_add(FP *r, FP *a, FP *b) -{ - BIG_add(r->g, a->g, b->g); - r->XES = a->XES + b->XES; - if (r->XES > FEXCESS_YYY) - { -#ifdef DEBUG_REDUCE - printf("Sum too large - reducing it \n"); -#endif - FP_reduce(r); - } -} - -/* Set r=a-b mod m */ -/* SU= 56 */ -void YYY::FP_sub(FP *r, FP *a, FP *b) -{ - FP n; - FP_neg(&n, b); - FP_add(r, a, &n); -} - -// https://graphics.stanford.edu/~seander/bithacks.html -// constant time log to base 2 (or number of bits in) - -static int logb2(unsign32 v) -{ - int r; - v |= v >> 1; - v |= v >> 2; - v |= v >> 4; - v |= v >> 8; - v |= v >> 16; - - v = v - ((v >> 1) & 0x55555555); - v = (v & 0x33333333) + ((v >> 2) & 0x33333333); - r = (((v + (v >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24; - return r; -} - -// find appoximation to quotient of a/m -// Out by at most 2. -// Note that MAXXES is bounded to be 2-bits less than half a word -static int quo(BIG n, BIG m) -{ - int sh; - chunk num, den; - int hb = CHUNK / 2; - if (TBITS_YYY < hb) - { - sh = hb - TBITS_YYY; - num = (n[NLEN_XXX - 1] << sh) | (n[NLEN_XXX - 2] >> (BASEBITS_XXX - sh)); - den = (m[NLEN_XXX - 1] << sh) | (m[NLEN_XXX - 2] >> (BASEBITS_XXX - sh)); - } - else - { - num = n[NLEN_XXX - 1]; - den = m[NLEN_XXX - 1]; - } - return (int)(num / (den + 1)); -} - -/* SU= 48 */ -/* Fully reduce a mod Modulus */ -void YYY::FP_reduce(FP *a) -{ - BIG m, r; - int sr, sb, q; - chunk carry; - - BIG_rcopy(m, Modulus); - BIG_norm(a->g); - - if (a->XES > 16) - { - q = quo(a->g, m); - carry = BIG_pmul(r, m, q); - r[NLEN_XXX - 1] += (carry << BASEBITS_XXX); // correction - put any carry out back in again - BIG_sub(a->g, a->g, r); - BIG_norm(a->g); - sb = 2; - } - else sb = logb2(a->XES - 1); // sb does not depend on the actual data - - BIG_fshl(m, sb); - while (sb > 0) - { -// constant time... - sr = BIG_ssn(r, a->g, m); // optimized combined shift, subtract and norm - BIG_cmove(a->g, r, 1 - sr); - sb--; - } - - a->XES = 1; -} - -void YYY::FP_norm(FP *x) -{ - BIG_norm(x->g); -} - -/* Set r=-a mod Modulus */ -/* SU= 64 */ -void YYY::FP_neg(FP *r, FP *a) -{ - int sb; - BIG m; - - BIG_rcopy(m, Modulus); - - sb = logb2(a->XES - 1); - BIG_fshl(m, sb); - BIG_sub(r->g, m, a->g); - r->XES = ((sign32)1 << sb) + 1; // +1 to cover case where a is zero ? - - if (r->XES > FEXCESS_YYY) - { -#ifdef DEBUG_REDUCE - printf("Negation too large - reducing it \n"); -#endif - FP_reduce(r); - } - -} - -/* Set r=a/2. */ -/* SU= 56 */ -void YYY::FP_div2(FP *r, FP *a) -{ - BIG m; - BIG w; - BIG_rcopy(m, Modulus); - int pr=BIG_parity(a->g); - - FP_copy(r, a); - BIG_copy(w,r->g); - BIG_fshr(r->g,1); - BIG_add(w, w, m); - BIG_norm(w); - BIG_fshr(w, 1); - - BIG_cmove(r->g,w,pr); -} - -// Could leak size of b -// but not used here with secret exponent b -void YYY::FP_pow(FP *r, FP *a, BIG b) -{ - sign8 w[1 + (NLEN_XXX * BASEBITS_XXX + 3) / 4]; - FP tb[16]; - BIG t; - int i, nb; - - FP_copy(r,a); - FP_norm(r); - BIG_copy(t, b); - BIG_norm(t); - nb = 1 + (BIG_nbits(t) + 3) / 4; - // convert exponent to 4-bit window - for (i = 0; i < nb; i++) - { - w[i] = BIG_lastbits(t, 4); - BIG_dec(t, w[i]); - BIG_norm(t); - BIG_fshr(t, 4); - } - - FP_one(&tb[0]); - FP_copy(&tb[1], r); - for (i = 2; i < 16; i++) - FP_mul(&tb[i], &tb[i - 1], r); - - FP_copy(r, &tb[w[nb - 1]]); - for (i = nb - 2; i >= 0; i--) - { - FP_sqr(r, r); - FP_sqr(r, r); - FP_sqr(r, r); - FP_sqr(r, r); - FP_mul(r, r, &tb[w[i]]); - } - FP_reduce(r); -} - -#if MODTYPE_YYY==PSEUDO_MERSENNE || MODTYPE_YYY==GENERALISED_MERSENNE - -// See eprint paper https://eprint.iacr.org/2018/1038 -// e.g. If p=3 mod 4 r= x^{(p-3)/4}, if p=5 mod 8 r=x^{(p-5)/8} - -void YYY::FP_fpow(FP *r, FP *x) -{ - int i, j, k, bw, w, nw, lo, m, n, c, nd, e=PM1D2_YYY; - FP xp[11], t, key; - const int ac[] = {1, 2, 3, 6, 12, 15, 30, 60, 120, 240, 255}; -// phase 1 - FP_copy(&xp[0], x); // 1 - FP_sqr(&xp[1], x); // 2 - FP_mul(&xp[2], &xp[1], x); //3 - FP_sqr(&xp[3], &xp[2]); // 6 - FP_sqr(&xp[4], &xp[3]); // 12 - FP_mul(&xp[5], &xp[4], &xp[2]); // 15 - FP_sqr(&xp[6], &xp[5]); // 30 - FP_sqr(&xp[7], &xp[6]); // 60 - FP_sqr(&xp[8], &xp[7]); // 120 - FP_sqr(&xp[9], &xp[8]); // 240 - FP_mul(&xp[10], &xp[9], &xp[5]); // 255 - -#if MODTYPE_YYY==PSEUDO_MERSENNE - n = MODBITS_YYY; -#endif -#if MODTYPE_YYY==GENERALISED_MERSENNE // Ed448 ONLY - n = MODBITS_YYY / 2; -#endif - - n-=(e+1); - c=(MConst+(1< k) i--; - FP_copy(&key, &xp[i]); - k -= ac[i]; - } - while (k != 0) - { - i--; - if (ac[i] > k) continue; - FP_mul(&key, &key, &xp[i]); - k -= ac[i]; - } - -// phase 2 - FP_copy(&xp[1], &xp[2]); - FP_copy(&xp[2], &xp[5]); - FP_copy(&xp[3], &xp[10]); - - j = 3; m = 8; - nw = n - bw; - while (2 * m < nw) - { - FP_copy(&t, &xp[j++]); - for (i = 0; i < m; i++) - FP_sqr(&t, &t); - FP_mul(&xp[j], &xp[j - 1], &t); - m *= 2; - } - - lo = nw - m; - FP_copy(r, &xp[j]); - - while (lo != 0) - { - m /= 2; j--; - if (lo < m) continue; - lo -= m; - FP_copy(&t, r); - for (i = 0; i < m; i++) - FP_sqr(&t, &t); - FP_mul(r, &t, &xp[j]); - } -// phase 3 - - if (bw != 0) - { - for (i = 0; i < bw; i++ ) - FP_sqr(r, r); - FP_mul(r, r, &key); - } - -#if MODTYPE_YYY==GENERALISED_MERSENNE // Ed448 ONLY - FP_copy(&key, r); - FP_sqr(&t, &key); - FP_mul(r, &t, &xp[0]); - for (i = 0; i < n + 1; i++) - FP_sqr(r, r); - FP_mul(r, r, &key); -#endif - - for (i=0;i1;k--) - { - for (j=1;j>1; - -#else - BIG m; - FP y; - FP_copy(&y,x); - FP_reduce(&y); - FP_redc(m,&y); - return BIG_parity(m); -#endif -} - -void YYY::FP_rand(FP *x,csprng *rng) -{ - BIG w,m; - BIG_rcopy(m,Modulus); - BIG_randomnum(w,m,rng); - FP_nres(x,w); -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12.cpp deleted file mode 100644 index 61ac4f3..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp12.cpp +++ /dev/null @@ -1,952 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE Fp^12 functions */ -/* SU=m, m is Stack Usage (no lazy )*/ -/* FP12 elements are of the form a+i.b+i^2.c */ - -#include "fp12_YYY.h" -#include "config_curve_ZZZ.h" - -using namespace XXX; - -/* return 1 if b==c, no branching */ -static int teq(sign32 b, sign32 c) -{ - sign32 x = b ^ c; - x -= 1; // if x=0, x now -1 - return (int)((x >> 31) & 1); -} - - -/* Constant time select from pre-computed table */ -static void FP12_select(YYY::FP12 *f, YYY::FP12 g[], sign32 b) -{ - YYY::FP12 invf; - sign32 m = b >> 31; - sign32 babs = (b ^ m) - m; - - babs = (babs - 1) / 2; - - FP12_cmove(f, &g[0], teq(babs, 0)); // conditional move - FP12_cmove(f, &g[1], teq(babs, 1)); - FP12_cmove(f, &g[2], teq(babs, 2)); - FP12_cmove(f, &g[3], teq(babs, 3)); - FP12_cmove(f, &g[4], teq(babs, 4)); - FP12_cmove(f, &g[5], teq(babs, 5)); - FP12_cmove(f, &g[6], teq(babs, 6)); - FP12_cmove(f, &g[7], teq(babs, 7)); - - FP12_copy(&invf, f); - FP12_conj(&invf, &invf); // 1/f - FP12_cmove(f, &invf, (int)(m & 1)); -} - -/* test x==0 ? */ -/* SU= 8 */ -int YYY::FP12_iszilch(FP12 *x) -{ - if (FP4_iszilch(&(x->a)) && FP4_iszilch(&(x->b)) && FP4_iszilch(&(x->c))) return 1; - return 0; -} - -/* test x==1 ? */ -/* SU= 8 */ -int YYY::FP12_isunity(FP12 *x) -{ - if (FP4_isunity(&(x->a)) && FP4_iszilch(&(x->b)) && FP4_iszilch(&(x->c))) return 1; - return 0; -} - -/* FP12 copy w=x */ -/* SU= 16 */ -void YYY::FP12_copy(FP12 *w, FP12 *x) -{ - if (x == w) return; - FP4_copy(&(w->a), &(x->a)); - FP4_copy(&(w->b), &(x->b)); - FP4_copy(&(w->c), &(x->c)); - w->type = x->type; -} - -/* FP12 w=1 */ -/* SU= 8 */ -void YYY::FP12_one(FP12 *w) -{ - FP4_one(&(w->a)); - FP4_zero(&(w->b)); - FP4_zero(&(w->c)); - w->type = FP_UNITY; -} - -void YYY::FP12_zero(FP12 *w) -{ - FP4_zero(&(w->a)); - FP4_zero(&(w->b)); - FP4_zero(&(w->c)); - w->type = FP_ZILCH; -} - -/* return 1 if x==y, else 0 */ -/* SU= 16 */ -int YYY::FP12_equals(FP12 *x, FP12 *y) -{ - if (FP4_equals(&(x->a), &(y->a)) && FP4_equals(&(x->b), &(y->b)) && FP4_equals(&(x->c), &(y->c))) - return 1; - return 0; -} - -/* Set w=conj(x) */ -/* SU= 8 */ -void YYY::FP12_conj(FP12 *w, FP12 *x) -{ - FP12_copy(w, x); - FP4_conj(&(w->a), &(w->a)); - FP4_nconj(&(w->b), &(w->b)); - FP4_conj(&(w->c), &(w->c)); -} - -/* Create FP12 from FP4 */ -/* SU= 8 */ -void YYY::FP12_from_FP4(FP12 *w, FP4 *a) -{ - FP4_copy(&(w->a), a); - FP4_zero(&(w->b)); - FP4_zero(&(w->c)); - w->type = FP_SPARSEST; -} - -/* Create FP12 from 3 FP4's */ -/* SU= 16 */ -void YYY::FP12_from_FP4s(FP12 *w, FP4 *a, FP4 *b, FP4 *c) -{ - FP4_copy(&(w->a), a); - FP4_copy(&(w->b), b); - FP4_copy(&(w->c), c); - w->type = FP_DENSE; -} - -/* Granger-Scott Unitary Squaring. This does not benefit from lazy reduction */ -/* SU= 600 */ -void YYY::FP12_usqr(FP12 *w, FP12 *x) -{ - FP4 A, B, C, D; - - FP4_copy(&A, &(x->a)); - - FP4_sqr(&(w->a), &(x->a)); // Wa XES=2 - FP4_add(&D, &(w->a), &(w->a)); // Wa XES=4 - FP4_add(&(w->a), &D, &(w->a)); // Wa XES=6 - - FP4_norm(&(w->a)); - FP4_nconj(&A, &A); - - FP4_add(&A, &A, &A); - FP4_add(&(w->a), &(w->a), &A); // Wa XES=8 - FP4_sqr(&B, &(x->c)); - FP4_times_i(&B); - - FP4_add(&D, &B, &B); - FP4_add(&B, &B, &D); - FP4_norm(&B); - - FP4_sqr(&C, &(x->b)); - - FP4_add(&D, &C, &C); - FP4_add(&C, &C, &D); - - FP4_norm(&C); - FP4_conj(&(w->b), &(x->b)); - FP4_add(&(w->b), &(w->b), &(w->b)); - FP4_nconj(&(w->c), &(x->c)); - - FP4_add(&(w->c), &(w->c), &(w->c)); - FP4_add(&(w->b), &B, &(w->b)); - FP4_add(&(w->c), &C, &(w->c)); - - w->type = FP_DENSE; - //FP12_norm(w); - FP12_reduce(w); /* reduce here as in pow function repeated squarings would trigger multiple reductions */ -} - -/* FP12 squaring w=x^2 */ -/* SU= 600 */ -void YYY::FP12_sqr(FP12 *w, FP12 *x) -{ - /* Use Chung-Hasan SQR2 method from http://cacr.uwaterloo.ca/techreports/2006/cacr2006-24.pdf */ - - FP4 A, B, C, D; - - if (x->type <= FP_UNITY) - { - FP12_copy(w, x); - return; - } - - FP4_sqr(&A, &(x->a)); - FP4_mul(&B, &(x->b), &(x->c)); - FP4_add(&B, &B, &B); - FP4_norm(&B); - FP4_sqr(&C, &(x->c)); - - FP4_mul(&D, &(x->a), &(x->b)); - FP4_add(&D, &D, &D); - FP4_add(&(w->c), &(x->a), &(x->c)); - FP4_add(&(w->c), &(x->b), &(w->c)); - FP4_norm(&(w->c)); - - FP4_sqr(&(w->c), &(w->c)); - - FP4_copy(&(w->a), &A); - FP4_add(&A, &A, &B); - - FP4_norm(&A); - - FP4_add(&A, &A, &C); - FP4_add(&A, &A, &D); - - FP4_norm(&A); - FP4_neg(&A, &A); - FP4_times_i(&B); - FP4_times_i(&C); - - FP4_add(&(w->a), &(w->a), &B); - FP4_add(&(w->b), &C, &D); - FP4_add(&(w->c), &(w->c), &A); - - if (x->type == FP_SPARSER || x->type == FP_SPARSEST) - w->type = FP_SPARSE; - else - w->type = FP_DENSE; - FP12_norm(w); -} - -// Use FP12_mul when both multiplicands are dense -// Use FP12smul when it is known that both multiplicands are line functions -// Use FP12ssmul when it is suspected that one or both multiplicands could have some sparsity - - -/* FP12 full multiplication w=w*y */ -void YYY::FP12_mul(FP12 *w, FP12 *y) -{ - FP4 z0, z1, z2, z3, t0, t1; - - FP4_mul(&z0, &(w->a), &(y->a)); // xa.ya always 11x11 - - FP4_mul(&z2, &(w->b), &(y->b)); // xb.yb could be 00x00 or 01x01 or or 10x10 or 11x00 or 11x10 or 11x01 or 11x11 - - FP4_add(&t0, &(w->a), &(w->b)); // (xa+xb) - FP4_add(&t1, &(y->a), &(y->b)); // (ya+yb) - - FP4_norm(&t0); - FP4_norm(&t1); - - FP4_mul(&z1, &t0, &t1); // (xa+xb)(ya+yb) always 11x11 - FP4_add(&t0, &(w->b), &(w->c)); // (xb+xc) - FP4_add(&t1, &(y->b), &(y->c)); // (yb+yc) - - FP4_norm(&t0); - FP4_norm(&t1); - - FP4_mul(&z3, &t0, &t1); // (xb+xc)(yb+yc) could be anything... - FP4_neg(&t0, &z0); // -(xa.ya) - FP4_neg(&t1, &z2); // -(xb.yb) - - FP4_add(&z1, &z1, &t0); - FP4_add(&(w->b), &z1, &t1); // /wb = (xa+xb)(ya+yb) -(xa.ya) -(xb.yb) = xa.yb + xb.ya - - FP4_add(&z3, &z3, &t1); // (xb+xc)(yb+yc) -(xb.yb) - FP4_add(&z2, &z2, &t0); // (xb.yb) - (xa.ya) - - FP4_add(&t0, &(w->a), &(w->c)); // (xa+xc) - FP4_add(&t1, &(y->a), &(y->c)); // (ya+yc) - - FP4_norm(&t0); - FP4_norm(&t1); - - FP4_mul(&t0, &t1, &t0); // (xa+xc)(ya+yc) always 11x11 - FP4_add(&z2, &z2, &t0); // (xb.yb) - (xa.ya) + (xa+xc)(ya+yc) - - FP4_mul(&t0, &(w->c), &(y->c)); // (xc.yc) could be anything - FP4_neg(&t1, &t0); // -(xc.yc) - - FP4_add(&(w->c), &z2, &t1); // wc = (xb.yb) - (xa.ya) + (xa+xc)(ya+yc) - (xc.yc) = xb.yb + xc.ya + xa.yc - FP4_add(&z3, &z3, &t1); // (xb+xc)(yb+yc) -(xb.yb) - (xc.yc) = xb.yc + xc.yb - FP4_times_i(&t0); // i.(xc.yc) - FP4_add(&(w->b), &(w->b), &t0); // wb = (xa+xb)(ya+yb) -(xa.ya) -(xb.yb) +i(xc.yc) - FP4_norm(&z3); - FP4_times_i(&z3); // i[(xb+xc)(yb+yc) -(xb.yb) - (xc.yc)] = i(xb.yc + xc.yb) - FP4_add(&(w->a), &z0, &z3); // wa = xa.ya + i(xb.yc + xc.yb) - - FP12_norm(w); - w->type = FP_DENSE; -} - -/* FP12 full multiplication w=w*y */ -/* Supports sparse multiplicands */ -/* Usually w is denser than y */ -void YYY::FP12_ssmul(FP12 *w, FP12 *y) -{ - FP4 z0, z1, z2, z3, t0, t1; - if (w->type == FP_UNITY) - { - FP12_copy(w, y); - return; - } - if (y->type == FP_UNITY) - return; - - if (y->type >= FP_SPARSE) - { - FP4_mul(&z0, &(w->a), &(y->a)); // xa.ya always 11x11 - -#if SEXTIC_TWIST_ZZZ == M_TYPE - if (y->type == FP_SPARSE || w->type == FP_SPARSE) - { - FP2_mul(&z2.b, &(w->b).b, &(y->b).b); - FP2_zero(&z2.a); - if (y->type != FP_SPARSE) - FP2_mul(&z2.a, &(w->b).b, &(y->b).a); - if (w->type != FP_SPARSE) - FP2_mul(&z2.a, &(w->b).a, &(y->b).b); - FP4_times_i(&z2); - } - else -#endif - FP4_mul(&z2, &(w->b), &(y->b)); // xb.yb could be 00x00 or 01x01 or or 10x10 or 11x00 or 11x10 or 11x01 or 11x11 - - FP4_add(&t0, &(w->a), &(w->b)); // (xa+xb) - FP4_add(&t1, &(y->a), &(y->b)); // (ya+yb) - - FP4_norm(&t0); - FP4_norm(&t1); - - FP4_mul(&z1, &t0, &t1); // (xa+xb)(ya+yb) always 11x11 - FP4_add(&t0, &(w->b), &(w->c)); // (xb+xc) - FP4_add(&t1, &(y->b), &(y->c)); // (yb+yc) - - FP4_norm(&t0); - FP4_norm(&t1); - - FP4_mul(&z3, &t0, &t1); // (xb+xc)(yb+yc) could be anything... - FP4_neg(&t0, &z0); // -(xa.ya) - FP4_neg(&t1, &z2); // -(xb.yb) - - FP4_add(&z1, &z1, &t0); - FP4_add(&(w->b), &z1, &t1); // /wb = (xa+xb)(ya+yb) -(xa.ya) -(xb.yb) = xa.yb + xb.ya - - FP4_add(&z3, &z3, &t1); // (xb+xc)(yb+yc) -(xb.yb) - FP4_add(&z2, &z2, &t0); // (xb.yb) - (xa.ya) - - FP4_add(&t0, &(w->a), &(w->c)); // (xa+xc) - FP4_add(&t1, &(y->a), &(y->c)); // (ya+yc) - - FP4_norm(&t0); - FP4_norm(&t1); - - FP4_mul(&t0, &t1, &t0); // (xa+xc)(ya+yc) always 11x11 - FP4_add(&z2, &z2, &t0); // (xb.yb) - (xa.ya) + (xa+xc)(ya+yc) - -#if SEXTIC_TWIST_ZZZ == D_TYPE - if (y->type == FP_SPARSE || w->type == FP_SPARSE) - { - FP2_mul(&t0.a, &(w->c).a, &(y->c).a); - FP2_zero(&t0.b); - if (y->type != FP_SPARSE) - FP2_mul(&t0.b, &(w->c).a, &(y->c).b); - if (w->type != FP_SPARSE) - FP2_mul(&t0.b, &(w->c).b, &(y->c).a); - } - else -#endif - FP4_mul(&t0, &(w->c), &(y->c)); // (xc.yc) could be anything - - FP4_neg(&t1, &t0); // -(xc.yc) - - FP4_add(&(w->c), &z2, &t1); // wc = (xb.yb) - (xa.ya) + (xa+xc)(ya+yc) - (xc.yc) = xb.yb + xc.ya + xa.yc - FP4_add(&z3, &z3, &t1); // (xb+xc)(yb+yc) -(xb.yb) - (xc.yc) = xb.yc + xc.yb - FP4_times_i(&t0); // i.(xc.yc) - FP4_add(&(w->b), &(w->b), &t0); // wb = (xa+xb)(ya+yb) -(xa.ya) -(xb.yb) +i(xc.yc) - FP4_norm(&z3); - FP4_times_i(&z3); // i[(xb+xc)(yb+yc) -(xb.yb) - (xc.yc)] = i(xb.yc + xc.yb) - FP4_add(&(w->a), &z0, &z3); // wa = xa.ya + i(xb.yc + xc.yb) - } else { - if (w->type == FP_SPARSER || w->type == FP_SPARSEST) - { - FP12_smul(w, y); - return; - } -// dense by sparser or sparsest - 13m -#if SEXTIC_TWIST_ZZZ == D_TYPE - FP4_copy(&z3, &(w->b)); - FP4_mul(&z0, &(w->a), &(y->a)); - - if (y->type == FP_SPARSEST) - FP4_qmul(&z2, &(w->b), &(y->b).a.a); - else - FP4_pmul(&z2, &(w->b), &(y->b).a); - - FP4_add(&(w->b), &(w->a), &(w->b)); - FP4_copy(&t1, &(y->a)); - FP2_add(&t1.a, &t1.a, &(y->b).a); - - FP4_norm(&t1); - FP4_norm(&(w->b)); - - FP4_mul(&(w->b), &(w->b), &t1); - FP4_add(&z3, &z3, &(w->c)); - FP4_norm(&z3); - - if (y->type == FP_SPARSEST) - FP4_qmul(&z3, &z3, &(y->b).a.a); - else - FP4_pmul(&z3, &z3, &(y->b).a); - - FP4_neg(&t0, &z0); - FP4_neg(&t1, &z2); - - FP4_add(&(w->b), &(w->b), &t0); // z1=z1-z0 - FP4_add(&(w->b), &(w->b), &t1); // z1=z1-z2 - - FP4_add(&z3, &z3, &t1); // z3=z3-z2 - FP4_add(&z2, &z2, &t0); // z2=z2-z0 - - FP4_add(&t0, &(w->a), &(w->c)); - FP4_norm(&t0); - FP4_norm(&z3); - - FP4_mul(&t0, &(y->a), &t0); - FP4_add(&(w->c), &z2, &t0); - - FP4_times_i(&z3); - FP4_add(&(w->a), &z0, &z3); -#endif -#if SEXTIC_TWIST_ZZZ == M_TYPE - FP4_mul(&z0, &(w->a), &(y->a)); - FP4_add(&t0, &(w->a), &(w->b)); - FP4_norm(&t0); - - FP4_mul(&z1, &t0, &(y->a)); - FP4_add(&t0, &(w->b), &(w->c)); - FP4_norm(&t0); - - if (y->type == FP_SPARSEST) - FP4_qmul(&z3, &t0, &(y->c).b.a); - else - FP4_pmul(&z3, &t0, &(y->c).b); - - FP4_times_i(&z3); - - FP4_neg(&t0, &z0); - FP4_add(&z1, &z1, &t0); // z1=z1-z0 - - FP4_copy(&(w->b), &z1); - FP4_copy(&z2, &t0); - - FP4_add(&t0, &(w->a), &(w->c)); - FP4_add(&t1, &(y->a), &(y->c)); - - FP4_norm(&t0); - FP4_norm(&t1); - - FP4_mul(&t0, &t1, &t0); - FP4_add(&z2, &z2, &t0); - - if (y->type == FP_SPARSEST) - FP4_qmul(&t0, &(w->c), &(y->c).b.a); - else - FP4_pmul(&t0, &(w->c), &(y->c).b); - - FP4_times_i(&t0); - FP4_neg(&t1, &t0); - FP4_times_i(&t0); - - FP4_add(&(w->c), &z2, &t1); - FP4_add(&z3, &z3, &t1); - - FP4_add(&(w->b), &(w->b), &t0); - FP4_norm(&z3); - FP4_times_i(&z3); - FP4_add(&(w->a), &z0, &z3); - -#endif - } - w->type = FP_DENSE; - FP12_norm(w); -} - -/* FP12 multiplication w=w*y */ -/* catering for special case that arises from special form of ATE pairing line function */ -/* w and y are both sparser or sparsest line functions - cost = 6m */ -void YYY::FP12_smul(FP12 *w, FP12 *y) -{ - FP2 w1, w2, w3, ta, tb, tc, td, te, t; - -#if SEXTIC_TWIST_ZZZ == D_TYPE - FP2_mul(&w1, &(w->a).a, &(y->a).a); // A1.A2 - FP2_mul(&w2, &(w->a).b, &(y->a).b); // B1.B2 - - if (y->type == FP_SPARSEST || w->type == FP_SPARSEST) - { - if (y->type == FP_SPARSEST && w->type == FP_SPARSEST) - { - FP_mul(&w3.a, &(w->b).a.a, &(y->b).a.a); - FP_zero(&w3.b); - } else { - if (y->type != FP_SPARSEST) - FP2_pmul(&w3, &(y->b).a, &(w->b).a.a); - if (w->type != FP_SPARSEST) - FP2_pmul(&w3, &(w->b).a, &(y->b).a.a); - } - } - else - FP2_mul(&w3, &(w->b).a, &(y->b).a); // C1.C2 - - FP2_add(&ta, &(w->a).a, &(w->a).b); // A1+B1 - FP2_add(&tb, &(y->a).a, &(y->a).b); // A2+B2 - FP2_norm(&ta); - FP2_norm(&tb); - FP2_mul(&tc, &ta, &tb); // (A1+B1)(A2+B2) - FP2_add(&t, &w1, &w2); - FP2_neg(&t, &t); - FP2_add(&tc, &tc, &t); // (A1+B1)(A2+B2)-A1.A2-B1*B2 = (A1.B2+A2.B1) - - FP2_add(&ta, &(w->a).a, &(w->b).a); // A1+C1 - FP2_add(&tb, &(y->a).a, &(y->b).a); // A2+C2 - FP2_norm(&ta); - FP2_norm(&tb); - FP2_mul(&td, &ta, &tb); // (A1+C1)(A2+C2) - FP2_add(&t, &w1, &w3); - FP2_neg(&t, &t); - FP2_add(&td, &td, &t); // (A1+C1)(A2+C2)-A1.A2-C1*C2 = (A1.C2+A2.C1) - - FP2_add(&ta, &(w->a).b, &(w->b).a); // B1+C1 - FP2_add(&tb, &(y->a).b, &(y->b).a); // B2+C2 - FP2_norm(&ta); - FP2_norm(&tb); - FP2_mul(&te, &ta, &tb); // (B1+C1)(B2+C2) - FP2_add(&t, &w2, &w3); - FP2_neg(&t, &t); - FP2_add(&te, &te, &t); // (B1+C1)(B2+C2)-B1.B2-C1*C2 = (B1.C2+B2.C1) - - FP2_mul_ip(&w2); - FP2_add(&w1, &w1, &w2); - FP4_from_FP2s(&(w->a), &w1, &tc); - FP4_from_FP2s(&(w->b), &td, &te); // only norm these 2 - FP4_from_FP2(&(w->c), &w3); - - FP4_norm(&(w->a)); - FP4_norm(&(w->b)); -#endif -// } else { -#if SEXTIC_TWIST_ZZZ == M_TYPE - FP2_mul(&w1, &(w->a).a, &(y->a).a); // A1.A2 - FP2_mul(&w2, &(w->a).b, &(y->a).b); // B1.B2 - - if (y->type == FP_SPARSEST || w->type == FP_SPARSEST) - { - if (y->type == FP_SPARSEST && w->type == FP_SPARSEST) - { - FP_mul(&w3.a, &(w->c).b.a, &(y->c).b.a); - FP_zero(&w3.b); - } else { - if (y->type != FP_SPARSEST) - FP2_pmul(&w3, &(y->c).b, &(w->c).b.a); - if (w->type != FP_SPARSEST) - FP2_pmul(&w3, &(w->c).b, &(y->c).b.a); - } - } - else - FP2_mul(&w3, &(w->c).b, &(y->c).b); // F1.F2 - - FP2_add(&ta, &(w->a).a, &(w->a).b); // A1+B1 - FP2_add(&tb, &(y->a).a, &(y->a).b); // A2+B2 - FP2_norm(&ta); - FP2_norm(&tb); - FP2_mul(&tc, &ta, &tb); // (A1+B1)(A2+B2) - FP2_add(&t, &w1, &w2); - FP2_neg(&t, &t); - FP2_add(&tc, &tc, &t); // (A1+B1)(A2+B2)-A1.A2-B1*B2 = (A1.B2+A2.B1) - - FP2_add(&ta, &(w->a).a, &(w->c).b); // A1+F1 - FP2_add(&tb, &(y->a).a, &(y->c).b); // A2+F2 - FP2_norm(&ta); - FP2_norm(&tb); - FP2_mul(&td, &ta, &tb); // (A1+F1)(A2+F2) - FP2_add(&t, &w1, &w3); - FP2_neg(&t, &t); - FP2_add(&td, &td, &t); // (A1+F1)(A2+F2)-A1.A2-F1*F2 = (A1.F2+A2.F1) - - FP2_add(&ta, &(w->a).b, &(w->c).b); // B1+F1 - FP2_add(&tb, &(y->a).b, &(y->c).b); // B2+F2 - FP2_norm(&ta); - FP2_norm(&tb); - FP2_mul(&te, &ta, &tb); // (B1+F1)(B2+F2) - FP2_add(&t, &w2, &w3); - FP2_neg(&t, &t); - FP2_add(&te, &te, &t); // (B1+F1)(B2+F2)-B1.B2-F1*F2 = (B1.F2+B2.F1) - - FP2_mul_ip(&w2); - FP2_add(&w1, &w1, &w2); - FP4_from_FP2s(&(w->a), &w1, &tc); - - FP2_mul_ip(&w3); - FP2_norm(&w3); - FP4_from_FP2H(&(w->b), &w3); - - FP2_norm(&te); - FP2_mul_ip(&te); - FP4_from_FP2s(&(w->c), &te, &td); - - FP4_norm(&(w->a)); - FP4_norm(&(w->c)); -#endif - -// } - w->type = FP_SPARSE; -} - -/* Set w=1/x */ -/* SU= 600 */ -void YYY::FP12_inv(FP12 *w, FP12 *x) -{ - FP4 f0, f1, f2, f3; - - FP4_sqr(&f0, &(x->a)); - FP4_mul(&f1, &(x->b), &(x->c)); - FP4_times_i(&f1); - FP4_sub(&f0, &f0, &f1); /* y.a */ - FP4_norm(&f0); - - FP4_sqr(&f1, &(x->c)); - FP4_times_i(&f1); - FP4_mul(&f2, &(x->a), &(x->b)); - FP4_sub(&f1, &f1, &f2); /* y.b */ - FP4_norm(&f1); - - FP4_sqr(&f2, &(x->b)); - FP4_mul(&f3, &(x->a), &(x->c)); - FP4_sub(&f2, &f2, &f3); /* y.c */ - FP4_norm(&f2); - - FP4_mul(&f3, &(x->b), &f2); - FP4_times_i(&f3); - FP4_mul(&(w->a), &f0, &(x->a)); - FP4_add(&f3, &(w->a), &f3); - FP4_mul(&(w->c), &f1, &(x->c)); - FP4_times_i(&(w->c)); - - FP4_add(&f3, &(w->c), &f3); - FP4_norm(&f3); - - FP4_inv(&f3, &f3, NULL); - - FP4_mul(&(w->a), &f0, &f3); - FP4_mul(&(w->b), &f1, &f3); - FP4_mul(&(w->c), &f2, &f3); - w->type = FP_DENSE; -} - -/* constant time powering by small integer of max length bts */ - -void YYY::FP12_pinpow(FP12 *r, int e, int bts) -{ - int i, b; - FP12 R[2]; - - FP12_one(&R[0]); - FP12_copy(&R[1], r); - - for (i = bts - 1; i >= 0; i--) - { - b = (e >> i) & 1; - FP12_mul(&R[1 - b], &R[b]); - FP12_usqr(&R[b], &R[b]); - } - FP12_copy(r, &R[0]); -} - -/* Compressed powering of unitary elements y=x^(e mod r) */ - -void YYY::FP12_compow(FP4 *c, FP12 *x, BIG e, BIG r) -{ - FP12 g1, g2; - FP4 cp, cpm1, cpm2; - FP2 f; - BIG q, a, b, m; - - BIG_rcopy(a, Fra); - BIG_rcopy(b, Frb); - FP2_from_BIGs(&f, a, b); - - BIG_rcopy(q, Modulus); - - FP12_copy(&g1, x); - FP12_copy(&g2, x); - - BIG_copy(m, q); - BIG_mod(m, r); - - BIG_copy(a, e); - BIG_mod(a, m); - - BIG_copy(b, e); - BIG_sdiv(b, m); - - FP12_trace(c, &g1); - - if (BIG_iszilch(b)) - { - FP4_xtr_pow(c, c, e); - return; - } - - FP12_frob(&g2, &f); - FP12_trace(&cp, &g2); - - FP12_conj(&g1, &g1); - FP12_mul(&g2, &g1); - FP12_trace(&cpm1, &g2); - FP12_mul(&g2, &g1); - FP12_trace(&cpm2, &g2); - - FP4_xtr_pow2(c, &cp, c, &cpm1, &cpm2, a, b); - -} - -/* Note this is simple square and multiply, so not side-channel safe */ -/* But fast for final exponentiation where exponent is not a secret */ - -void YYY::FP12_pow(FP12 *r, FP12 *a, BIG b) -{ - FP12 w, sf; - BIG b1, b3; - int i, nb, bt; - BIG_copy(b1, b); - BIG_norm(b1); - BIG_pmul(b3, b1, 3); - BIG_norm(b3); - FP12_copy(&sf, a); - FP12_norm(&sf); - FP12_copy(&w, &sf); - - if (BIG_iszilch(b3)) - { - FP12_one(r); - return; - } - - nb = BIG_nbits(b3); - for (i = nb - 2; i >= 1; i--) - { - FP12_usqr(&w, &w); - bt = BIG_bit(b3, i) - BIG_bit(b1, i); - if (bt == 1) - FP12_mul(&w, &sf); - if (bt == -1) - { - FP12_conj(&sf, &sf); - FP12_mul(&w, &sf); - FP12_conj(&sf, &sf); - } - } - - FP12_copy(r, &w); - FP12_reduce(r); - - -} - - -/* p=q0^u0.q1^u1.q2^u2.q3^u3 */ -/* Side channel attack secure */ -// Bos & Costello https://eprint.iacr.org/2013/458.pdf -// Faz-Hernandez & Longa & Sanchez https://eprint.iacr.org/2013/158.pdf - -void YYY::FP12_pow4(FP12 *p, FP12 *q, BIG u[4]) -{ - int i, j, k, nb, pb, bt; - FP12 g[8], r; - BIG t[4], mt; - sign8 w[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s[NLEN_XXX * BASEBITS_XXX + 1]; - - for (i = 0; i < 4; i++) - BIG_copy(t[i], u[i]); - - -// Precomputed table - FP12_copy(&g[0], &q[0]); // q[0] - FP12_copy(&g[1], &g[0]); - FP12_mul(&g[1], &q[1]); // q[0].q[1] - FP12_copy(&g[2], &g[0]); - FP12_mul(&g[2], &q[2]); // q[0].q[2] - FP12_copy(&g[3], &g[1]); - FP12_mul(&g[3], &q[2]); // q[0].q[1].q[2] - FP12_copy(&g[4], &g[0]); - FP12_mul(&g[4], &q[3]); // q[0].q[3] - FP12_copy(&g[5], &g[1]); - FP12_mul(&g[5], &q[3]); // q[0].q[1].q[3] - FP12_copy(&g[6], &g[2]); - FP12_mul(&g[6], &q[3]); // q[0].q[2].q[3] - FP12_copy(&g[7], &g[3]); - FP12_mul(&g[7], &q[3]); // q[0].q[1].q[2].q[3] - -// Make it odd - pb = 1 - BIG_parity(t[0]); - BIG_inc(t[0], pb); - BIG_norm(t[0]); - -// Number of bits - BIG_zero(mt); - for (i = 0; i < 4; i++) - { - BIG_or(mt, mt, t[i]); - } - nb = 1 + BIG_nbits(mt); - -// Sign pivot - s[nb - 1] = 1; - for (i = 0; i < nb - 1; i++) - { - BIG_fshr(t[0], 1); - s[i] = 2 * BIG_parity(t[0]) - 1; - } - -// Recoded exponent - for (i = 0; i < nb; i++) - { - w[i] = 0; - k = 1; - for (j = 1; j < 4; j++) - { - bt = s[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w[i] += bt * k; - k *= 2; - } - } - -// Main loop - FP12_select(p, g, 2 * w[nb - 1] + 1); - for (i = nb - 2; i >= 0; i--) - { - FP12_select(&r, g, 2 * w[i] + s[i]); - FP12_usqr(p, p); - FP12_mul(p, &r); - } -// apply correction - FP12_conj(&r, &q[0]); - FP12_mul(&r, p); - FP12_cmove(p, &r, pb); - - FP12_reduce(p); -} - -/* Set w=w^p using Frobenius */ -/* SU= 160 */ -void YYY::FP12_frob(FP12 *w, FP2 *f) -{ - FP2 f2, f3; - FP2_sqr(&f2, f); /* f2=f^2 */ - FP2_mul(&f3, &f2, f); /* f3=f^3 */ - - FP4_frob(&(w->a), &f3); - FP4_frob(&(w->b), &f3); - FP4_frob(&(w->c), &f3); - - FP4_pmul(&(w->b), &(w->b), f); - FP4_pmul(&(w->c), &(w->c), &f2); - w->type = FP_DENSE; -} - -/* SU= 8 */ -/* normalise all components of w */ -void YYY::FP12_norm(FP12 *w) -{ - FP4_norm(&(w->a)); - FP4_norm(&(w->b)); - FP4_norm(&(w->c)); -} - -/* SU= 8 */ -/* reduce all components of w */ -void YYY::FP12_reduce(FP12 *w) -{ - FP4_reduce(&(w->a)); - FP4_reduce(&(w->b)); - FP4_reduce(&(w->c)); -} - -/* trace function w=trace(x) */ -/* SU= 8 */ -void YYY::FP12_trace(FP4 *w, FP12 *x) -{ - FP4_imul(w, &(x->a), 3); - FP4_reduce(w); -} - -/* SU= 8 */ -/* Output w in hex */ -void YYY::FP12_output(FP12 *w) -{ - printf("["); - FP4_output(&(w->a)); - printf(","); - FP4_output(&(w->b)); - printf(","); - FP4_output(&(w->c)); - printf("]"); -} - -/* SU= 64 */ -/* Convert g to octet string w */ -void YYY::FP12_toOctet(octet *W, FP12 *g) -{ - W->len = 12 * MODBYTES_XXX; - FP4_toBytes(&(W->val[0]),&(g->c)); - FP4_toBytes(&(W->val[4 * MODBYTES_XXX]),&(g->b)); - FP4_toBytes(&(W->val[8 * MODBYTES_XXX]),&(g->a)); -} - -/* SU= 24 */ -/* Restore g from octet string w */ -void YYY::FP12_fromOctet(FP12 *g, octet *W) -{ - FP4_fromBytes(&(g->c),&(W->val[0])); - FP4_fromBytes(&(g->b),&(W->val[4 * MODBYTES_XXX])); - FP4_fromBytes(&(g->a),&(W->val[8 * MODBYTES_XXX])); - -} - -/* Move g to f -if d=1 */ -void YYY::FP12_cmove(FP12 *f, FP12 *g, int d) -{ - FP4_cmove(&(f->a), &(g->a), d); - FP4_cmove(&(f->b), &(g->b), d); - FP4_cmove(&(f->c), &(g->c), d); - d = ~(d - 1); - f->type ^= (f->type ^ g->type)&d; -} - - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16.cpp deleted file mode 100644 index cb257aa..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp16.cpp +++ /dev/null @@ -1,610 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE Fp^8 functions */ - -/* FP16 elements are of the form a+ib, where i is sqrt(sqrt(-1+sqrt(-1))) */ - -#include "fp16_YYY.h" - -using namespace XXX; - -/* test x==0 ? */ -int YYY::FP16_iszilch(FP16 *x) -{ - if (FP8_iszilch(&(x->a)) && FP8_iszilch(&(x->b))) return 1; - return 0; -} - -/* test x==1 ? */ -int YYY::FP16_isunity(FP16 *x) -{ - if (FP8_isunity(&(x->a)) && FP8_iszilch(&(x->b))) return 1; - return 0; -} - -/* test is w real? That is in a+ib test b is zero */ -int YYY::FP16_isreal(FP16 *w) -{ - return FP8_iszilch(&(w->b)); -} - -/* return 1 if x==y, else 0 */ -int YYY::FP16_equals(FP16 *x, FP16 *y) -{ - if (FP8_equals(&(x->a), &(y->a)) && FP8_equals(&(x->b), &(y->b))) - return 1; - return 0; -} - - -void YYY::FP16_toBytes(char *b,FP16 *x) -{ - FP8_toBytes(b,&(x->b)); - FP8_toBytes(&b[8*MODBYTES_XXX],&(x->a)); -} - -void YYY::FP16_fromBytes(FP16 *x,char *b) -{ - FP8_fromBytes(&(x->b),b); - FP8_fromBytes(&(x->a),&b[8*MODBYTES_XXX]); -} - - -/* set FP16 from two FP8s */ -void YYY::FP16_from_FP8s(FP16 *w, FP8 * x, FP8* y) -{ - FP8_copy(&(w->a), x); - FP8_copy(&(w->b), y); -} - -/* set FP16 from FP8 */ -void YYY::FP16_from_FP8(FP16 *w, FP8 *x) -{ - FP8_copy(&(w->a), x); - FP8_zero(&(w->b)); -} - -/* set high part of FP16 from FP8 */ -void YYY::FP16_from_FP8H(FP16 *w, FP8 *x) -{ - FP8_copy(&(w->b), x); - FP8_zero(&(w->a)); -} - -/* FP16 copy w=x */ -void YYY::FP16_copy(FP16 *w, FP16 *x) -{ - if (w == x) return; - FP8_copy(&(w->a), &(x->a)); - FP8_copy(&(w->b), &(x->b)); -} - -/* FP16 w=0 */ -void YYY::FP16_zero(FP16 *w) -{ - FP8_zero(&(w->a)); - FP8_zero(&(w->b)); -} - -/* FP16 w=1 */ -void YYY::FP16_one(FP16 *w) -{ - FP8_one(&(w->a)); - FP8_zero(&(w->b)); -} - -/* Set w=-x */ -void YYY::FP16_neg(FP16 *w, FP16 *x) -{ - /* Just one field neg */ - FP8 m, t; - FP16_norm(x); - FP8_add(&m, &(x->a), &(x->b)); - FP8_norm(&m); - FP8_neg(&m, &m); - FP8_add(&t, &m, &(x->b)); - FP8_add(&(w->b), &m, &(x->a)); - FP8_copy(&(w->a), &t); - FP16_norm(w); -} - -/* Set w=conj(x) */ -void YYY::FP16_conj(FP16 *w, FP16 *x) -{ - FP8_copy(&(w->a), &(x->a)); - FP8_neg(&(w->b), &(x->b)); - FP16_norm(w); -} - -/* Set w=-conj(x) */ -void YYY::FP16_nconj(FP16 *w, FP16 *x) -{ - FP8_copy(&(w->b), &(x->b)); - FP8_neg(&(w->a), &(x->a)); - FP16_norm(w); -} - -/* Set w=x+y */ -void YYY::FP16_add(FP16 *w, FP16 *x, FP16 *y) -{ - FP8_add(&(w->a), &(x->a), &(y->a)); - FP8_add(&(w->b), &(x->b), &(y->b)); -} - -/* Set w=x-y */ -/* Input y MUST be normed */ -void YYY::FP16_sub(FP16 *w, FP16 *x, FP16 *y) -{ - FP16 my; - - FP16_neg(&my, y); - FP16_add(w, x, &my); - -} - -/* reduce all components of w mod Modulus */ -void YYY::FP16_reduce(FP16 *w) -{ - FP8_reduce(&(w->a)); - FP8_reduce(&(w->b)); -} - -/* normalise all elements of w */ -void YYY::FP16_norm(FP16 *w) -{ - FP8_norm(&(w->a)); - FP8_norm(&(w->b)); -} - -/* Set w=s*x, where s is FP8 */ -void YYY::FP16_pmul(FP16 *w, FP16 *x, FP8 *s) -{ - FP8_mul(&(w->a), &(x->a), s); - FP8_mul(&(w->b), &(x->b), s); -} - -/* Set w=s*x, where s is FP2 */ -void YYY::FP16_qmul(FP16 *w, FP16 *x, FP2 *s) -{ - FP8_qmul(&(w->a), &(x->a), s); - FP8_qmul(&(w->b), &(x->b), s); -} - -/* Set w=s*x, where s is FP */ -void YYY::FP16_tmul(FP16 *w, FP16 *x, FP *s) -{ - FP8_tmul(&(w->a), &(x->a), s); - FP8_tmul(&(w->b), &(x->b), s); -} - -/* Set w=s*x, where s is int */ -void YYY::FP16_imul(FP16 *w, FP16 *x, int s) -{ - FP8_imul(&(w->a), &(x->a), s); - FP8_imul(&(w->b), &(x->b), s); -} - -/* Set w=x^2 */ -/* Input MUST be normed */ -void YYY::FP16_sqr(FP16 *w, FP16 *x) -{ - FP8 t1, t2, t3; - - FP8_mul(&t3, &(x->a), &(x->b)); /* norms x */ - FP8_copy(&t2, &(x->b)); - FP8_add(&t1, &(x->a), &(x->b)); - FP8_times_i(&t2); - - FP8_add(&t2, &(x->a), &t2); - - FP8_norm(&t1); // 2 - FP8_norm(&t2); // 2 - - FP8_mul(&(w->a), &t1, &t2); - - FP8_copy(&t2, &t3); - FP8_times_i(&t2); - - FP8_add(&t2, &t2, &t3); - - FP8_norm(&t2); // 2 - FP8_neg(&t2, &t2); - FP8_add(&(w->a), &(w->a), &t2); /* a=(a+b)(a+i^2.b)-i^2.ab-ab = a*a+ib*ib */ - FP8_add(&(w->b), &t3, &t3); /* b=2ab */ - - FP16_norm(w); -} - -/* Set w=x*y */ -/* Inputs MUST be normed */ -void YYY::FP16_mul(FP16 *w, FP16 *x, FP16 *y) -{ - - FP8 t1, t2, t3, t4; - FP8_mul(&t1, &(x->a), &(y->a)); - FP8_mul(&t2, &(x->b), &(y->b)); - - FP8_add(&t3, &(y->b), &(y->a)); - FP8_add(&t4, &(x->b), &(x->a)); - - FP8_norm(&t4); // 2 - FP8_norm(&t3); // 2 - - FP8_mul(&t4, &t4, &t3); /* (xa+xb)(ya+yb) */ - FP8_neg(&t3, &t1); // 1 - FP8_add(&t4, &t4, &t3); //t4E=3 - FP8_norm(&t4); - - FP8_neg(&t3, &t2); // 1 - FP8_add(&(w->b), &t4, &t3); //wbE=3 - - FP8_times_i(&t2); - FP8_add(&(w->a), &t2, &t1); - - FP16_norm(w); -} - -/* output FP16 in format [a,b] */ -void YYY::FP16_output(FP16 *w) -{ - printf("["); - FP8_output(&(w->a)); - printf(","); - FP8_output(&(w->b)); - printf("]"); -} - -void YYY::FP16_rawoutput(FP16 *w) -{ - printf("["); - FP8_rawoutput(&(w->a)); - printf(","); - FP8_rawoutput(&(w->b)); - printf("]"); -} - -/* Set w=1/x */ -void YYY::FP16_inv(FP16 *w, FP16 *x) -{ - FP8 t1, t2; - FP8_sqr(&t1, &(x->a)); - FP8_sqr(&t2, &(x->b)); - FP8_times_i(&t2); - FP8_norm(&t2); - - FP8_sub(&t1, &t1, &t2); - FP8_norm(&t1); - - FP8_inv(&t1, &t1, NULL); - - FP8_mul(&(w->a), &t1, &(x->a)); - FP8_neg(&t1, &t1); - FP8_norm(&t1); - FP8_mul(&(w->b), &t1, &(x->b)); -} - -/* w*=i where i = sqrt(sqrt(-1+sqrt(-1))) */ -void YYY::FP16_times_i(FP16 *w) -{ - FP8 s, t; - FP8_copy(&s, &(w->b)); - FP8_copy(&t, &(w->a)); - FP8_times_i(&s); - FP8_copy(&(w->a), &s); - FP8_copy(&(w->b), &t); - FP16_norm(w); - - //FP16_neg(w,w); // *** - //FP16_norm(w); -} - -void YYY::FP16_times_i2(FP16 *w) -{ - FP8_times_i(&(w->a)); - FP8_times_i(&(w->b)); -} - -void YYY::FP16_times_i4(FP16 *w) -{ - FP8_times_i2(&(w->a)); - FP8_times_i2(&(w->b)); -} - -/* Set w=w^p using Frobenius */ -void YYY::FP16_frob(FP16 *w, FP2 *f) -{ // f=(i+1)^(p-3)/8 - FP2 ff; - FP2_sqr(&ff, f); // (i+1)^(p-3)/4 - FP2_norm(&ff); - - FP8_frob(&(w->a), &ff); - FP8_frob(&(w->b), &ff); - - FP8_qmul(&(w->b), &(w->b), f); // times (1+i)^(p-3)/8 - FP8_times_i(&(w->b)); // (i+1)^(p-1)/8 -} - -/* Set r=a^b mod m */ -void YYY::FP16_pow(FP16 *r, FP16* a, BIG b) -{ - FP16 w; - BIG z, zilch; - int bt; - - BIG_zero(zilch); - - BIG_copy(z, b); - FP16_copy(&w, a); - FP16_one(r); - BIG_norm(z); - while (1) - { - bt = BIG_parity(z); - BIG_shr(z, 1); - if (bt) FP16_mul(r, r, &w); - if (BIG_comp(z, zilch) == 0) break; - FP16_sqr(&w, &w); - } - FP16_reduce(r); -} - -/* Move b to a if d=1 */ -void YYY::FP16_cmove(FP16 *f, FP16 *g, int d) -{ - FP8_cmove(&(f->a), &(g->a), d); - FP8_cmove(&(f->b), &(g->b), d); -} - -//#if CURVE_SECURITY_ZZZ == 256 - -/* XTR xtr_a function */ -/* -void YYY::FP16_xtr_A(FP16 *r, FP16 *w, FP16 *x, FP16 *y, FP16 *z) -{ - FP16 t1, t2; - - FP16_copy(r, x); - FP16_sub(&t1, w, y); - FP16_norm(&t1); - FP16_pmul(&t1, &t1, &(r->a)); - FP16_add(&t2, w, y); - FP16_norm(&t2); - FP16_pmul(&t2, &t2, &(r->b)); - FP16_times_i(&t2); - - FP16_add(r, &t1, &t2); - FP16_add(r, r, z); - - FP16_reduce(r); -} -*/ -/* XTR xtr_d function */ -/* -void YYY::FP16_xtr_D(FP16 *r, FP16 *x) -{ - FP16 w; - FP16_copy(r, x); - FP16_conj(&w, r); - FP16_add(&w, &w, &w); - FP16_sqr(r, r); - FP16_norm(&w); - FP16_sub(r, r, &w); - FP16_reduce(r); // reduce here as multiple calls trigger automatic reductions -} -*/ - -/* r=x^n using XTR method on traces of FP48s */ -/* -void YYY::FP16_xtr_pow(FP16 *r, FP16 *x, BIG n) -{ - int i, par, nb; - BIG v; - FP2 w2; - FP4 w4; - FP8 w8; - FP16 t, a, b, c, sf; - - FP16_copy(&sf, x); - FP16_norm(&sf); - BIG_zero(v); - BIG_inc(v, 3); - BIG_norm(v); - FP2_from_BIG(&w2, v); - FP4_from_FP2(&w4, &w2); - FP8_from_FP4(&w8, &w4); - FP16_from_FP8(&a, &w8); - - FP16_copy(&b, &sf); - FP16_xtr_D(&c, &sf); - - - par = BIG_parity(n); - BIG_copy(v, n); - BIG_norm(v); - BIG_shr(v, 1); - if (par == 0) - { - BIG_dec(v, 1); - BIG_norm(v); - } - - nb = BIG_nbits(v); - for (i = nb - 1; i >= 0; i--) - { - if (!BIG_bit(v, i)) - { - FP16_copy(&t, &b); - FP16_conj(&sf, &sf); - FP16_conj(&c, &c); - FP16_xtr_A(&b, &a, &b, &sf, &c); - FP16_conj(&sf, &sf); - FP16_xtr_D(&c, &t); - FP16_xtr_D(&a, &a); - } - else - { - FP16_conj(&t, &a); - FP16_xtr_D(&a, &b); - FP16_xtr_A(&b, &c, &b, &sf, &t); - FP16_xtr_D(&c, &c); - } - } - - if (par == 0) FP16_copy(r, &c); - else FP16_copy(r, &b); - FP16_reduce(r); -} -*/ -/* r=ck^a.cl^n using XTR double exponentiation method on traces of FP48s. See Stam thesis. */ -/* -void YYY::FP16_xtr_pow2(FP16 *r, FP16 *ck, FP16 *cl, FP16 *ckml, FP16 *ckm2l, BIG a, BIG b) -{ - int i, f2; - BIG d, e, w; - FP16 t, cu, cv, cumv, cum2v; - - - BIG_copy(e, a); - BIG_copy(d, b); - BIG_norm(d); - BIG_norm(e); - FP16_copy(&cu, ck); - FP16_copy(&cv, cl); - FP16_copy(&cumv, ckml); - FP16_copy(&cum2v, ckm2l); - - f2 = 0; - while (BIG_parity(d) == 0 && BIG_parity(e) == 0) - { - BIG_shr(d, 1); - BIG_shr(e, 1); - f2++; - } - while (BIG_comp(d, e) != 0) - { - if (BIG_comp(d, e) > 0) - { - BIG_imul(w, e, 4); - BIG_norm(w); - if (BIG_comp(d, w) <= 0) - { - BIG_copy(w, d); - BIG_copy(d, e); - BIG_sub(e, w, e); - BIG_norm(e); - FP16_xtr_A(&t, &cu, &cv, &cumv, &cum2v); - FP16_conj(&cum2v, &cumv); - FP16_copy(&cumv, &cv); - FP16_copy(&cv, &cu); - FP16_copy(&cu, &t); - } - else if (BIG_parity(d) == 0) - { - BIG_shr(d, 1); - FP16_conj(r, &cum2v); - FP16_xtr_A(&t, &cu, &cumv, &cv, r); - FP16_xtr_D(&cum2v, &cumv); - FP16_copy(&cumv, &t); - FP16_xtr_D(&cu, &cu); - } - else if (BIG_parity(e) == 1) - { - BIG_sub(d, d, e); - BIG_norm(d); - BIG_shr(d, 1); - FP16_xtr_A(&t, &cu, &cv, &cumv, &cum2v); - FP16_xtr_D(&cu, &cu); - FP16_xtr_D(&cum2v, &cv); - FP16_conj(&cum2v, &cum2v); - FP16_copy(&cv, &t); - } - else - { - BIG_copy(w, d); - BIG_copy(d, e); - BIG_shr(d, 1); - BIG_copy(e, w); - FP16_xtr_D(&t, &cumv); - FP16_conj(&cumv, &cum2v); - FP16_conj(&cum2v, &t); - FP16_xtr_D(&t, &cv); - FP16_copy(&cv, &cu); - FP16_copy(&cu, &t); - } - } - if (BIG_comp(d, e) < 0) - { - BIG_imul(w, d, 4); - BIG_norm(w); - if (BIG_comp(e, w) <= 0) - { - BIG_sub(e, e, d); - BIG_norm(e); - FP16_xtr_A(&t, &cu, &cv, &cumv, &cum2v); - FP16_copy(&cum2v, &cumv); - FP16_copy(&cumv, &cu); - FP16_copy(&cu, &t); - } - else if (BIG_parity(e) == 0) - { - BIG_copy(w, d); - BIG_copy(d, e); - BIG_shr(d, 1); - BIG_copy(e, w); - FP16_xtr_D(&t, &cumv); - FP16_conj(&cumv, &cum2v); - FP16_conj(&cum2v, &t); - FP16_xtr_D(&t, &cv); - FP16_copy(&cv, &cu); - FP16_copy(&cu, &t); - } - else if (BIG_parity(d) == 1) - { - BIG_copy(w, e); - BIG_copy(e, d); - BIG_sub(w, w, d); - BIG_norm(w); - BIG_copy(d, w); - BIG_shr(d, 1); - FP16_xtr_A(&t, &cu, &cv, &cumv, &cum2v); - FP16_conj(&cumv, &cumv); - FP16_xtr_D(&cum2v, &cu); - FP16_conj(&cum2v, &cum2v); - FP16_xtr_D(&cu, &cv); - FP16_copy(&cv, &t); - } - else - { - BIG_shr(d, 1); - FP16_conj(r, &cum2v); - FP16_xtr_A(&t, &cu, &cumv, &cv, r); - FP16_xtr_D(&cum2v, &cumv); - FP16_copy(&cumv, &t); - FP16_xtr_D(&cu, &cu); - } - } - } - FP16_xtr_A(r, &cu, &cv, &cumv, &cum2v); - for (i = 0; i < f2; i++) FP16_xtr_D(r, r); - FP16_xtr_pow(r, r, d); -} - -#endif -*/ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2.cpp deleted file mode 100644 index 4c8fc67..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp2.cpp +++ /dev/null @@ -1,527 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE Fp^2 functions */ -/* SU=m, m is Stack Usage (no lazy )*/ - -/* FP2 elements are of the form a+ib, where i is sqrt(-1) */ - -#include "fp2_YYY.h" - -//namespace YYY { -//extern int fp2muls; -//extern int fp2sqrs; -//} - -using namespace XXX; - -/* test x==0 ? */ -/* SU= 8 */ -int YYY::FP2_iszilch(FP2 *x) -{ - return (FP_iszilch(&(x->a)) & FP_iszilch(&(x->b))); -} - -/* Move g to f if d=1 */ -void YYY::FP2_cmove(FP2 *f, FP2 *g, int d) -{ - FP_cmove(&(f->a), &(g->a), d); - FP_cmove(&(f->b), &(g->b), d); -} - -/* test x==1 ? */ -/* SU= 48 */ -int YYY::FP2_isunity(FP2 *x) -{ - FP one; - FP_one(&one); - return (FP_equals(&(x->a), &one) & FP_iszilch(&(x->b))); -} - -/* SU= 8 */ -/* Fully reduce a and b mod Modulus */ -void YYY::FP2_reduce(FP2 *w) -{ - FP_reduce(&(w->a)); - FP_reduce(&(w->b)); -} - -/* return 1 if x==y, else 0 */ -/* SU= 16 */ -int YYY::FP2_equals(FP2 *x, FP2 *y) -{ - return (FP_equals(&(x->a), &(y->a)) & FP_equals(&(x->b), &(y->b))); -} - -// Is x lexically larger than p-x? -// return -1 for no, 0 if x=0, 1 for yes -int YYY::FP2_islarger(FP2 *x) -{ - int cmp; - if (FP2_iszilch(x)) return 0; - cmp=FP_islarger(&(x->b)); - if (cmp!=0) return cmp; - return FP_islarger(&(x->a)); -} - -void YYY::FP2_toBytes(char *b,FP2 *x) -{ - FP_toBytes(b,&(x->b)); - FP_toBytes(&b[MODBYTES_XXX],&(x->a)); -} - -void YYY::FP2_fromBytes(FP2 *x,char *b) -{ - FP_fromBytes(&(x->b),b); - FP_fromBytes(&(x->a),&b[MODBYTES_XXX]); -} - -/* Create FP2 from two FPs */ -/* SU= 16 */ -void YYY::FP2_from_FPs(FP2 *w, FP *x, FP *y) -{ - FP_copy(&(w->a), x); - FP_copy(&(w->b), y); -} - -/* Create FP2 from two BIGS */ -/* SU= 16 */ -void YYY::FP2_from_BIGs(FP2 *w, BIG x, BIG y) -{ - FP_nres(&(w->a), x); - FP_nres(&(w->b), y); -} - -/* Create FP2 from two ints */ -void YYY::FP2_from_ints(FP2 *w, int xa, int xb) -{ - FP a,b; - FP_from_int(&a,xa); - FP_from_int(&b,xb); - FP2_from_FPs(w,&a,&b); -} - -/* Create FP2 from FP */ -/* SU= 8 */ -void YYY::FP2_from_FP(FP2 *w, FP *x) -{ - FP_copy(&(w->a), x); - FP_zero(&(w->b)); -} - -/* Create FP2 from BIG */ -/* SU= 8 */ -void YYY::FP2_from_BIG(FP2 *w, BIG x) -{ - FP_nres(&(w->a), x); - FP_zero(&(w->b)); -} - -/* FP2 copy w=x */ -/* SU= 16 */ -void YYY::FP2_copy(FP2 *w, FP2 *x) -{ - if (w == x) return; - FP_copy(&(w->a), &(x->a)); - FP_copy(&(w->b), &(x->b)); -} - -/* FP2 set w=0 */ -/* SU= 8 */ -void YYY::FP2_zero(FP2 *w) -{ - FP_zero(&(w->a)); - FP_zero(&(w->b)); -} - -/* FP2 set w=1 */ -/* SU= 48 */ -void YYY::FP2_one(FP2 *w) -{ - FP one; - FP_one(&one); - FP2_from_FP(w, &one); -} - -void YYY::FP2_rcopy(FP2 *w,const BIG a,const BIG b) -{ - FP_rcopy(&(w->a),a); - FP_rcopy(&(w->b),b); -} - -int YYY::FP2_sign(FP2 *w) -{ - int p1,p2; - p1=FP_sign(&(w->a)); - p2=FP_sign(&(w->b)); -#ifdef BIG_ENDIAN_SIGN_YYY - p2 ^= (p1 ^ p2)&FP_iszilch(&(w->b)); - return p2; -#else - p1 ^= (p1 ^ p2)&FP_iszilch(&(w->a)); - return p1; -#endif - -} - -/* Set w=-x */ -/* SU= 88 */ -void YYY::FP2_neg(FP2 *w, FP2 *x) -{ - /* Just one neg! */ - FP m, t; - FP_add(&m, &(x->a), &(x->b)); - FP_neg(&m, &m); - FP_add(&t, &m, &(x->b)); - FP_add(&(w->b), &m, &(x->a)); - FP_copy(&(w->a), &t); - -} - -/* Set w=conj(x) */ -/* SU= 16 */ -void YYY::FP2_conj(FP2 *w, FP2 *x) -{ - FP_copy(&(w->a), &(x->a)); - FP_neg(&(w->b), &(x->b)); - FP_norm(&(w->b)); -} - -/* Set w=x+y */ -/* SU= 16 */ -void YYY::FP2_add(FP2 *w, FP2 *x, FP2 *y) -{ - FP_add(&(w->a), &(x->a), &(y->a)); - FP_add(&(w->b), &(x->b), &(y->b)); -} - -/* Set w=x-y */ -/* Input y MUST be normed */ -void YYY::FP2_sub(FP2 *w, FP2 *x, FP2 *y) -{ - FP2 m; - FP2_neg(&m, y); - FP2_add(w, x, &m); -} - -/* Set w=s*x, where s is FP */ -/* SU= 16 */ -void YYY::FP2_pmul(FP2 *w, FP2 *x, FP *s) -{ - FP_mul(&(w->a), &(x->a), s); - FP_mul(&(w->b), &(x->b), s); -} - -/* SU= 16 */ -/* Set w=s*x, where s is int */ -void YYY::FP2_imul(FP2 *w, FP2 *x, int s) -{ - FP_imul(&(w->a), &(x->a), s); - FP_imul(&(w->b), &(x->b), s); -} - -/* Set w=x^2 */ -/* SU= 128 */ -void YYY::FP2_sqr(FP2 *w, FP2 *x) -{ - FP w1, w3, mb; - - FP_add(&w1, &(x->a), &(x->b)); - FP_neg(&mb, &(x->b)); - - FP_add(&w3, &(x->a), &(x->a)); - FP_norm(&w3); - FP_mul(&(w->b), &w3, &(x->b)); - - FP_add(&(w->a), &(x->a), &mb); - - FP_norm(&w1); - FP_norm(&(w->a)); - - FP_mul(&(w->a), &w1, &(w->a)); /* w->a#2 w->a=1 w1&w2=6 w1*w2=2 */ - -// YYY::fp2sqrs++; -} - - -/* Set w=x*y */ -/* Inputs MUST be normed */ -/* Now uses Lazy reduction */ -void YYY::FP2_mul(FP2 *w, FP2 *x, FP2 *y) -{ - DBIG A, B, E, F, pR; - BIG C, D, p; - - BIG_rcopy(p, Modulus); - BIG_dsucopy(pR, p); - -// reduce excesses of a and b as required (so product < pR) - - if ((sign64)(x->a.XES + x->b.XES) * (y->a.XES + y->b.XES) > (sign64)FEXCESS_YYY) - { -#ifdef DEBUG_REDUCE - printf("FP2 Product too large - reducing it\n"); -#endif - if (x->a.XES > 1) FP_reduce(&(x->a)); - if (x->b.XES > 1) FP_reduce(&(x->b)); - } - - BIG_mul(A, x->a.g, y->a.g); - BIG_mul(B, x->b.g, y->b.g); - - BIG_add(C, x->a.g, x->b.g); BIG_norm(C); - BIG_add(D, y->a.g, y->b.g); BIG_norm(D); - - BIG_mul(E, C, D); - BIG_dadd(F, A, B); - BIG_dsub(B, pR, B); // - - BIG_dadd(A, A, B); // Aa.g, A); w->a.XES = 3; // may drift above 2p... - BIG_dnorm(E); FP_mod(w->b.g, E); w->b.XES = 2; - -// YYY::fp2muls++; -} - -/* output FP2 in hex format [a,b] */ -/* SU= 16 */ -void YYY::FP2_output(FP2 *w) -{ - BIG bx, by; - FP2_reduce(w); - FP_redc(bx, &(w->a)); - FP_redc(by, &(w->b)); - printf("["); - BIG_output(bx); - printf(","); - BIG_output(by); - printf("]"); - FP_nres(&(w->a), bx); - FP_nres(&(w->b), by); -} - -/* SU= 8 */ -void YYY::FP2_rawoutput(FP2 *w) -{ - printf("["); - BIG_rawoutput(w->a.g); - printf(","); - BIG_rawoutput(w->b.g); - printf("]"); -} - - -/* Set w=1/x */ -/* SU= 128 */ -void YYY::FP2_inv(FP2 *w, FP2 *x, FP *h) -{ - FP w1, w2; - - FP2_norm(x); - FP_sqr(&w1, &(x->a)); - FP_sqr(&w2, &(x->b)); - FP_add(&w1, &w1, &w2); - FP_inv(&w1, &w1, h); - FP_mul(&(w->a), &(x->a), &w1); - FP_neg(&w1, &w1); - FP_norm(&w1); - FP_mul(&(w->b), &(x->b), &w1); -} - - -/* Set w=x/2 */ -/* SU= 16 */ -void YYY::FP2_div2(FP2 *w, FP2 *x) -{ - FP_div2(&(w->a), &(x->a)); - FP_div2(&(w->b), &(x->b)); -} - -/* Input MUST be normed */ -void YYY::FP2_times_i(FP2 *w) -{ - FP z; - FP_copy(&z, &(w->a)); - FP_neg(&(w->a), &(w->b)); - FP_copy(&(w->b), &z); - -// Output NOT normed, so use with care -} - -/* Set w*=(2^i+sqrt(-1)) */ -/* where X^2-(2^i+sqrt(-1)) is irreducible for FP4 */ - -/* Input MUST be normed */ -void YYY::FP2_mul_ip(FP2 *w) -{ - FP2 t; - int i = QNRI_YYY; - - FP2_copy(&t, w); - FP2_times_i(w); - -// add 2^i.t - while (i > 0) - { - FP2_add(&t, &t, &t); - FP2_norm(&t); - i--; - } - FP2_add(w, &t, w); - -#if TOWER_YYY == POSITOWER - FP2_norm(w); - FP2_neg(w, w); // *** -#endif - -// Output NOT normed, so use with care -} - -/* Set w/=(2^i+sqrt(-1)) */ -/* Slow */ -void YYY::FP2_div_ip(FP2 *w) -{ - FP2 z; - FP2_norm(w); - FP2_from_ints(&z, (1 << QNRI_YYY), 1); - FP2_inv(&z, &z, NULL); - FP2_mul(w, &z, w); -#if TOWER_YYY == POSITOWER - FP2_neg(w, w); // *** -#endif -} - -/* SU= 8 */ -/* normalise a and b components of w */ -void YYY::FP2_norm(FP2 *w) -{ - FP_norm(&(w->a)); - FP_norm(&(w->b)); -} - -/* Set w=a^b mod m */ -/* SU= 208 */ -/* -void YYY::FP2_pow(FP2 *r, FP2* a, BIG b) -{ - FP2 w; - FP one; - BIG z, zilch; - int bt; - - BIG_norm(b); - BIG_copy(z, b); - FP2_copy(&w, a); - FP_one(&one); - BIG_zero(zilch); - FP2_from_FP(r, &one); - while (1) - { - bt = BIG_parity(z); - BIG_shr(z, 1); - if (bt) FP2_mul(r, r, &w); - if (BIG_comp(z, zilch) == 0) break; - FP2_sqr(&w, &w); - } - FP2_reduce(r); -} */ - -/* test for x a QR */ -int YYY::FP2_qr(FP2 *x,FP *h) -{ /* test x^(p^2-1)/2 = 1 */ - - FP2 c; - FP2_conj(&c,x); - FP2_mul(&c,&c,x); - - return FP_qr(&(c.a),h); -} - -/* sqrt(a+ib) = sqrt(a+sqrt(a*a-n*b*b))/2+ib/(2*sqrt(a+sqrt(a*a-n*b*b))/2) */ - -void YYY::FP2_sqrt(FP2 *w, FP2 *u, FP *h) -{ - FP w1, w2, w3, w4, hint; - FP2 nw; - int sgn,qr; - FP2_copy(w, u); - if (FP2_iszilch(w)) return; - - FP_sqr(&w1, &(w->b)); // b^2 - FP_sqr(&w2, &(w->a)); // a^2 - FP_add(&w1, &w1, &w2); FP_norm(&w1); // a^2+b^2 - - FP_sqrt(&w1, &w1, h); // sqrt(a^2+b^2) - could use an input hint to avoid exp! - - FP_add(&w2, &(w->a), &w1); // a+sqrt(a^2+b^2) - FP_norm(&w2); - FP_div2(&w2, &w2); // w2=(a+sqrt(a^2+b^2))/2 -// ** - FP_div2(&w1,&(w->b)); // w1=b/2 - qr=FP_qr(&w2,&hint); // only exp! - -// tweak hint - FP_neg(&w3,&hint); FP_norm(&w3); // QNR = -1 - FP_neg(&w4,&w2); FP_norm(&w4); - - FP_cmove(&w2,&w4,1-qr); - FP_cmove(&hint,&w3,1-qr); - - FP_sqrt(&(w->a),&w2,&hint); // a=sqrt(w2) - FP_inv(&w3,&w2,&hint); // w3=1/w2 - FP_mul(&w3,&w3,&(w->a)); // w3=1/sqrt(w2) - FP_mul(&(w->b),&w3,&w1); // b=(b/2)*1/sqrt(w2) - FP_copy(&w4,&(w->a)); - - FP_cmove(&(w->a),&(w->b),1-qr); - FP_cmove(&(w->b),&w4,1-qr); - - -/* - - FP_sqrt(&(w->a),&w2,&hint); // a=sqrt(w2) - FP_inv(&w3,&w2,&hint); // w3=1/w2 - FP_mul(&w3,&w3,&(w->a)); // w3=1/sqrt(w2) - FP_mul(&(w->b),&w3,&w1); // b=(b/2)*1/sqrt(w2) - -// tweak hint - FP_neg(&hint,&hint); FP_norm(&hint); // QNR = -1 - FP_neg(&w2,&w2); FP_norm(&w2); - - FP_sqrt(&w4,&w2,&hint); // w4=sqrt(w2) - FP_inv(&w3,&w2,&hint); // w3=1/w2 - FP_mul(&w3,&w3,&w4); // w3=1/sqrt(w2) - FP_mul(&w3,&w3,&w1); // w3=(b/2)*1/sqrt(w2) - - FP_cmove(&(w->a),&w3,1-qr); - FP_cmove(&(w->b),&w4,1-qr); -*/ -// return +ve root - sgn=FP2_sign(w); - FP2_neg(&nw,w); FP2_norm(&nw); - FP2_cmove(w,&nw,sgn); -} - -void YYY::FP2_rand(FP2 *x,csprng *rng) -{ - FP_rand(&(x->a),rng); - FP_rand(&(x->b),rng); -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp24.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp24.cpp deleted file mode 100644 index 5c821dc..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp24.cpp +++ /dev/null @@ -1,1018 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE Fp^24 functions */ -/* SU=m, m is Stack Usage (no lazy )*/ -/* FP24 elements are of the form a+i.b+i^2.c */ - -#include "fp24_YYY.h" -#include "config_curve_ZZZ.h" - -using namespace XXX; - -/* return 1 if b==c, no branching */ -static int teq(sign32 b, sign32 c) -{ - sign32 x = b ^ c; - x -= 1; // if x=0, x now -1 - return (int)((x >> 31) & 1); -} - - -/* Constant time select from pre-computed table */ -static void FP24_select(YYY::FP24 *f, YYY::FP24 g[], sign32 b) -{ - YYY::FP24 invf; - sign32 m = b >> 31; - sign32 babs = (b ^ m) - m; - - babs = (babs - 1) / 2; - - FP24_cmove(f, &g[0], teq(babs, 0)); // conditional move - FP24_cmove(f, &g[1], teq(babs, 1)); - FP24_cmove(f, &g[2], teq(babs, 2)); - FP24_cmove(f, &g[3], teq(babs, 3)); - FP24_cmove(f, &g[4], teq(babs, 4)); - FP24_cmove(f, &g[5], teq(babs, 5)); - FP24_cmove(f, &g[6], teq(babs, 6)); - FP24_cmove(f, &g[7], teq(babs, 7)); - - FP24_copy(&invf, f); - FP24_conj(&invf, &invf); // 1/f - FP24_cmove(f, &invf, (int)(m & 1)); -} - -/* test x==0 ? */ -/* SU= 8 */ -int YYY::FP24_iszilch(FP24 *x) -{ - if (FP8_iszilch(&(x->a)) && FP8_iszilch(&(x->b)) && FP8_iszilch(&(x->c))) return 1; - return 0; -} - -/* test x==1 ? */ -/* SU= 8 */ -int YYY::FP24_isunity(FP24 *x) -{ - if (FP8_isunity(&(x->a)) && FP8_iszilch(&(x->b)) && FP8_iszilch(&(x->c))) return 1; - return 0; -} - -/* FP24 copy w=x */ -/* SU= 16 */ -void YYY::FP24_copy(FP24 *w, FP24 *x) -{ - if (x == w) return; - FP8_copy(&(w->a), &(x->a)); - FP8_copy(&(w->b), &(x->b)); - FP8_copy(&(w->c), &(x->c)); - w->type = x->type; -} - -/* FP24 w=1 */ -/* SU= 8 */ -void YYY::FP24_one(FP24 *w) -{ - FP8_one(&(w->a)); - FP8_zero(&(w->b)); - FP8_zero(&(w->c)); - w->type = FP_UNITY; - -} - -void YYY::FP24_zero(FP24 *w) -{ - FP8_zero(&(w->a)); - FP8_zero(&(w->b)); - FP8_zero(&(w->c)); - w->type = FP_ZILCH; - -} - -/* return 1 if x==y, else 0 */ -/* SU= 16 */ -int YYY::FP24_equals(FP24 *x, FP24 *y) -{ - if (FP8_equals(&(x->a), &(y->a)) && FP8_equals(&(x->b), &(y->b)) && FP8_equals(&(x->c), &(y->c))) - return 1; - return 0; -} - -/* Set w=conj(x) */ -/* SU= 8 */ -void YYY::FP24_conj(FP24 *w, FP24 *x) -{ - FP24_copy(w, x); - FP8_conj(&(w->a), &(w->a)); - FP8_nconj(&(w->b), &(w->b)); - FP8_conj(&(w->c), &(w->c)); -} - -/* Create FP24 from FP8 */ -/* SU= 8 */ -void YYY::FP24_from_FP8(FP24 *w, FP8 *a) -{ - FP8_copy(&(w->a), a); - FP8_zero(&(w->b)); - FP8_zero(&(w->c)); - w->type = FP_SPARSEST; -} - -/* Create FP24 from 3 FP8's */ -/* SU= 16 */ -void YYY::FP24_from_FP8s(FP24 *w, FP8 *a, FP8 *b, FP8 *c) -{ - FP8_copy(&(w->a), a); - FP8_copy(&(w->b), b); - FP8_copy(&(w->c), c); - w->type = FP_DENSE; -} - -/* Granger-Scott Unitary Squaring. This does not benefit from lazy reduction */ -/* SU= 600 */ -void YYY::FP24_usqr(FP24 *w, FP24 *x) -{ - FP8 A, B, C, D; - - FP8_copy(&A, &(x->a)); - - FP8_sqr(&(w->a), &(x->a)); - FP8_add(&D, &(w->a), &(w->a)); - FP8_add(&(w->a), &D, &(w->a)); - - FP8_norm(&(w->a)); - FP8_nconj(&A, &A); - - FP8_add(&A, &A, &A); - FP8_add(&(w->a), &(w->a), &A); - FP8_sqr(&B, &(x->c)); - FP8_times_i(&B); - - FP8_add(&D, &B, &B); - FP8_add(&B, &B, &D); - FP8_norm(&B); - - FP8_sqr(&C, &(x->b)); - - FP8_add(&D, &C, &C); - FP8_add(&C, &C, &D); - - FP8_norm(&C); - FP8_conj(&(w->b), &(x->b)); - FP8_add(&(w->b), &(w->b), &(w->b)); - FP8_nconj(&(w->c), &(x->c)); - - FP8_add(&(w->c), &(w->c), &(w->c)); - FP8_add(&(w->b), &B, &(w->b)); - FP8_add(&(w->c), &C, &(w->c)); - w->type = FP_DENSE; - - FP24_reduce(w); /* reduce here as in pow function repeated squarings would trigger multiple reductions */ -} - -/* FP24 squaring w=x^2 */ -/* SU= 600 */ -void YYY::FP24_sqr(FP24 *w, FP24 *x) -{ - /* Use Chung-Hasan SQR2 method from http://cacr.uwaterloo.ca/techreports/2006/cacr2006-24.pdf */ - - FP8 A, B, C, D; - - if (x->type <= FP_UNITY) - { - FP24_copy(w, x); - return; - } - - FP8_sqr(&A, &(x->a)); - FP8_mul(&B, &(x->b), &(x->c)); - FP8_add(&B, &B, &B); - FP8_norm(&B); - FP8_sqr(&C, &(x->c)); - - FP8_mul(&D, &(x->a), &(x->b)); - FP8_add(&D, &D, &D); - - FP8_add(&(w->c), &(x->a), &(x->c)); - FP8_add(&(w->c), &(x->b), &(w->c)); - FP8_norm(&(w->c)); - - FP8_sqr(&(w->c), &(w->c)); - - FP8_copy(&(w->a), &A); - FP8_add(&A, &A, &B); - - FP8_norm(&A); - - FP8_add(&A, &A, &C); - FP8_add(&A, &A, &D); - - FP8_norm(&A); - - FP8_neg(&A, &A); - FP8_times_i(&B); - FP8_times_i(&C); - - FP8_add(&(w->a), &(w->a), &B); - FP8_add(&(w->b), &C, &D); - FP8_add(&(w->c), &(w->c), &A); - - if (x->type == FP_SPARSER || x->type == FP_SPARSEST) - w->type = FP_SPARSE; - else - w->type = FP_DENSE; - - FP24_norm(w); -} - -// Use FP24_mul when both multiplicands are dense -// Use FP24smul when it is known that both multiplicands are line functions -// Use FP24ssmul when it is suspected that one or both multiplicands could have some sparsity - - -/* FP24 full multiplication w=w*y */ -void YYY::FP24_mul(FP24 *w, FP24 *y) -{ - FP8 z0, z1, z2, z3, t0, t1; - - FP8_mul(&z0, &(w->a), &(y->a)); - FP8_mul(&z2, &(w->b), &(y->b)); // - - FP8_add(&t0, &(w->a), &(w->b)); - FP8_add(&t1, &(y->a), &(y->b)); // - - FP8_norm(&t0); - FP8_norm(&t1); - - FP8_mul(&z1, &t0, &t1); - FP8_add(&t0, &(w->b), &(w->c)); - FP8_add(&t1, &(y->b), &(y->c)); // - - FP8_norm(&t0); - FP8_norm(&t1); - - FP8_mul(&z3, &t0, &t1); - - FP8_neg(&t0, &z0); - FP8_neg(&t1, &z2); - - FP8_add(&z1, &z1, &t0); // z1=z1-z0 - FP8_add(&(w->b), &z1, &t1); // z1=z1-z2 - FP8_add(&z3, &z3, &t1); // z3=z3-z2 - FP8_add(&z2, &z2, &t0); // z2=z2-z0 - - FP8_add(&t0, &(w->a), &(w->c)); - FP8_add(&t1, &(y->a), &(y->c)); - - FP8_norm(&t0); - FP8_norm(&t1); - - FP8_mul(&t0, &t1, &t0); - FP8_add(&z2, &z2, &t0); - - FP8_mul(&t0, &(w->c), &(y->c)); - FP8_neg(&t1, &t0); - - FP8_add(&(w->c), &z2, &t1); - FP8_add(&z3, &z3, &t1); - FP8_times_i(&t0); - FP8_add(&(w->b), &(w->b), &t0); - FP8_norm(&z3); - FP8_times_i(&z3); - FP8_add(&(w->a), &z0, &z3); - - FP24_norm(w); - w->type = FP_DENSE; -} - -/* FP24 full multiplication w=w*y */ -/* Supports sparse multiplicands */ -/* Usually w is denser than y */ -void YYY::FP24_ssmul(FP24 *w, FP24 *y) -{ - FP8 z0, z1, z2, z3, t0, t1; - if (w->type == FP_UNITY) - { - FP24_copy(w, y); - return; - } - if (y->type == FP_UNITY) - return; - - if (y->type >= FP_SPARSE) - { - FP8_mul(&z0, &(w->a), &(y->a)); // xa.ya always 11x11 - -#if SEXTIC_TWIST_ZZZ == M_TYPE - if (y->type == FP_SPARSE || w->type == FP_SPARSE) - { - FP4_mul(&z2.b, &(w->b).b, &(y->b).b); - FP4_zero(&z2.a); - if (y->type != FP_SPARSE) - FP4_mul(&z2.a, &(w->b).b, &(y->b).a); - if (w->type != FP_SPARSE) - FP4_mul(&z2.a, &(w->b).a, &(y->b).b); - FP8_times_i(&z2); - } - else -#endif - FP8_mul(&z2, &(w->b), &(y->b)); // xb.yb could be 00x00 or 01x01 or or 10x10 or 11x00 or 11x10 or 11x01 or 11x11 - - FP8_add(&t0, &(w->a), &(w->b)); // (xa+xb) - FP8_add(&t1, &(y->a), &(y->b)); // (ya+yb) - - FP8_norm(&t0); - FP8_norm(&t1); - - FP8_mul(&z1, &t0, &t1); // (xa+xb)(ya+yb) always 11x11 - FP8_add(&t0, &(w->b), &(w->c)); // (xb+xc) - FP8_add(&t1, &(y->b), &(y->c)); // (yb+yc) - - FP8_norm(&t0); - FP8_norm(&t1); - - FP8_mul(&z3, &t0, &t1); // (xb+xc)(yb+yc) could be anything... - FP8_neg(&t0, &z0); // -(xa.ya) - FP8_neg(&t1, &z2); // -(xb.yb) - - FP8_add(&z1, &z1, &t0); - FP8_add(&(w->b), &z1, &t1); // /wb = (xa+xb)(ya+yb) -(xa.ya) -(xb.yb) = xa.yb + xb.ya - - FP8_add(&z3, &z3, &t1); // (xb+xc)(yb+yc) -(xb.yb) - FP8_add(&z2, &z2, &t0); // (xb.yb) - (xa.ya) - - FP8_add(&t0, &(w->a), &(w->c)); // (xa+xc) - FP8_add(&t1, &(y->a), &(y->c)); // (ya+yc) - - FP8_norm(&t0); - FP8_norm(&t1); - - FP8_mul(&t0, &t1, &t0); // (xa+xc)(ya+yc) always 11x11 - FP8_add(&z2, &z2, &t0); // (xb.yb) - (xa.ya) + (xa+xc)(ya+yc) - -#if SEXTIC_TWIST_ZZZ == D_TYPE - if (y->type == FP_SPARSE || w->type == FP_SPARSE) - { - FP4_mul(&t0.a, &(w->c).a, &(y->c).a); - FP4_zero(&t0.b); - if (y->type != FP_SPARSE) - FP4_mul(&t0.b, &(w->c).a, &(y->c).b); - if (w->type != FP_SPARSE) - FP4_mul(&t0.b, &(w->c).b, &(y->c).a); - } - else -#endif - FP8_mul(&t0, &(w->c), &(y->c)); // (xc.yc) could be anything - - FP8_neg(&t1, &t0); // -(xc.yc) - - FP8_add(&(w->c), &z2, &t1); // wc = (xb.yb) - (xa.ya) + (xa+xc)(ya+yc) - (xc.yc) = xb.yb + xc.ya + xa.yc - FP8_add(&z3, &z3, &t1); // (xb+xc)(yb+yc) -(xb.yb) - (xc.yc) = xb.yc + xc.yb - FP8_times_i(&t0); // i.(xc.yc) - FP8_add(&(w->b), &(w->b), &t0); // wb = (xa+xb)(ya+yb) -(xa.ya) -(xb.yb) +i(xc.yc) - FP8_norm(&z3); - FP8_times_i(&z3); // i[(xb+xc)(yb+yc) -(xb.yb) - (xc.yc)] = i(xb.yc + xc.yb) - FP8_add(&(w->a), &z0, &z3); // wa = xa.ya + i(xb.yc + xc.yb) - } else { - if (w->type == FP_SPARSER || w->type == FP_SPARSEST) - { - FP24_smul(w, y); - return; - } -// dense by sparser - 13m -#if SEXTIC_TWIST_ZZZ == D_TYPE - FP8_copy(&z3, &(w->b)); - FP8_mul(&z0, &(w->a), &(y->a)); - - if (y->type == FP_SPARSEST) - FP8_tmul(&z2, &(w->b), &(y->b).a.a.a); - else - FP8_pmul(&z2, &(w->b), &(y->b).a); - - - FP8_add(&(w->b), &(w->a), &(w->b)); - FP8_copy(&t1, &(y->a)); - FP4_add(&t1.a, &t1.a, &(y->b).a); - - FP8_norm(&t1); - FP8_norm(&(w->b)); - - FP8_mul(&(w->b), &(w->b), &t1); - FP8_add(&z3, &z3, &(w->c)); - FP8_norm(&z3); - - if (y->type == FP_SPARSEST) - FP8_tmul(&z3, &z3, &(y->b).a.a.a); - else - FP8_pmul(&z3, &z3, &(y->b).a); - - FP8_neg(&t0, &z0); - FP8_neg(&t1, &z2); - - FP8_add(&(w->b), &(w->b), &t0); // z1=z1-z0 - FP8_add(&(w->b), &(w->b), &t1); // z1=z1-z2 - - FP8_add(&z3, &z3, &t1); // z3=z3-z2 - FP8_add(&z2, &z2, &t0); // z2=z2-z0 - - FP8_add(&t0, &(w->a), &(w->c)); - FP8_norm(&t0); - FP8_norm(&z3); - - FP8_mul(&t0, &(y->a), &t0); - FP8_add(&(w->c), &z2, &t0); - - FP8_times_i(&z3); - FP8_add(&(w->a), &z0, &z3); -#endif -#if SEXTIC_TWIST_ZZZ == M_TYPE - FP8_mul(&z0, &(w->a), &(y->a)); - FP8_add(&t0, &(w->a), &(w->b)); - FP8_norm(&t0); - - FP8_mul(&z1, &t0, &(y->a)); - FP8_add(&t0, &(w->b), &(w->c)); - FP8_norm(&t0); - - - if (y->type == FP_SPARSEST) - FP8_tmul(&z3, &t0, &(y->c).b.a.a); - else - FP8_pmul(&z3, &t0, &(y->c).b); - - - FP8_times_i(&z3); - - FP8_neg(&t0, &z0); - FP8_add(&z1, &z1, &t0); // z1=z1-z0 - - FP8_copy(&(w->b), &z1); - FP8_copy(&z2, &t0); - - FP8_add(&t0, &(w->a), &(w->c)); - FP8_add(&t1, &(y->a), &(y->c)); - - FP8_norm(&t0); - FP8_norm(&t1); - - FP8_mul(&t0, &t1, &t0); - FP8_add(&z2, &z2, &t0); - - if (y->type == FP_SPARSEST) - FP8_tmul(&t0, &(w->c), &(y->c).b.a.a); - else - FP8_pmul(&t0, &(w->c), &(y->c).b); - - - FP8_times_i(&t0); - FP8_neg(&t1, &t0); - FP8_times_i(&t0); - - FP8_add(&(w->c), &z2, &t1); - FP8_add(&z3, &z3, &t1); - - FP8_add(&(w->b), &(w->b), &t0); - FP8_norm(&z3); - FP8_times_i(&z3); - FP8_add(&(w->a), &z0, &z3); -#endif - } - w->type = FP_DENSE; - FP24_norm(w); -} - -/* FP24 multiplication w=w*y */ -/* catering for special case that arises from special form of ATE pairing line function */ -/* w and y are both sparser line functions - cost = 6m */ -void YYY::FP24_smul(FP24 *w, FP24 *y) -{ - FP4 w1, w2, w3, ta, tb, tc, td, te, t; - - -#if SEXTIC_TWIST_ZZZ == D_TYPE - FP4_mul(&w1, &(w->a).a, &(y->a).a); // A1.A2 - FP4_mul(&w2, &(w->a).b, &(y->a).b); // B1.B2 - - if (y->type == FP_SPARSEST || w->type == FP_SPARSEST) - { - if (y->type == FP_SPARSEST && w->type == FP_SPARSEST) - { - FP4_zero(&w3); - FP_mul(&w3.a.a, &(w->b).a.a.a, &(y->b).a.a.a); - } else { - if (y->type != FP_SPARSEST) - FP4_qmul(&w3, &(y->b).a, &(w->b).a.a.a); - if (w->type != FP_SPARSEST) - FP4_qmul(&w3, &(w->b).a, &(y->b).a.a.a); - } - } - else - FP4_mul(&w3, &(w->b).a, &(y->b).a); // C1.C2 - - FP4_add(&ta, &(w->a).a, &(w->a).b); // A1+B1 - FP4_add(&tb, &(y->a).a, &(y->a).b); // A2+B2 - FP4_norm(&ta); - FP4_norm(&tb); - FP4_mul(&tc, &ta, &tb); // (A1+B1)(A2+B2) - FP4_add(&t, &w1, &w2); - FP4_neg(&t, &t); - FP4_add(&tc, &tc, &t); // (A1+B1)(A2+B2)-A1.A2-B1*B2 = (A1.B2+A2.B1) - - FP4_add(&ta, &(w->a).a, &(w->b).a); // A1+C1 - FP4_add(&tb, &(y->a).a, &(y->b).a); // A2+C2 - FP4_norm(&ta); - FP4_norm(&tb); - FP4_mul(&td, &ta, &tb); // (A1+C1)(A2+C2) - FP4_add(&t, &w1, &w3); - FP4_neg(&t, &t); - FP4_add(&td, &td, &t); // (A1+C1)(A2+C2)-A1.A2-C1*C2 = (A1.C2+A2.C1) - - FP4_add(&ta, &(w->a).b, &(w->b).a); // B1+C1 - FP4_add(&tb, &(y->a).b, &(y->b).a); // B2+C2 - FP4_norm(&ta); - FP4_norm(&tb); - FP4_mul(&te, &ta, &tb); // (B1+C1)(B2+C2) - FP4_add(&t, &w2, &w3); - FP4_neg(&t, &t); - FP4_add(&te, &te, &t); // (B1+C1)(B2+C2)-B1.B2-C1*C2 = (B1.C2+B2.C1) - - FP4_times_i(&w2); - FP4_add(&w1, &w1, &w2); - FP8_from_FP4s(&(w->a), &w1, &tc); - FP8_from_FP4s(&(w->b), &td, &te); // only norm these 2 - FP8_from_FP4(&(w->c), &w3); - - FP8_norm(&(w->a)); - FP8_norm(&(w->b)); -#endif -#if SEXTIC_TWIST_ZZZ == M_TYPE - FP4_mul(&w1, &(w->a).a, &(y->a).a); // A1.A2 - FP4_mul(&w2, &(w->a).b, &(y->a).b); // B1.B2 - - if (y->type == FP_SPARSEST || w->type == FP_SPARSEST) - { - if (y->type == FP_SPARSEST && w->type == FP_SPARSEST) - { - FP4_zero(&w3); - FP_mul(&w3.a.a, &(w->c).b.a.a, &(y->c).b.a.a); - } else { - if (y->type != FP_SPARSEST) - FP4_qmul(&w3, &(y->c).b, &(w->c).b.a.a); - if (w->type != FP_SPARSEST) - FP4_qmul(&w3, &(w->c).b, &(y->c).b.a.a); - } - } - else - FP4_mul(&w3, &(w->c).b, &(y->c).b); // F1.F2 - - FP4_add(&ta, &(w->a).a, &(w->a).b); // A1+B1 - FP4_add(&tb, &(y->a).a, &(y->a).b); // A2+B2 - FP4_norm(&ta); - FP4_norm(&tb); - FP4_mul(&tc, &ta, &tb); // (A1+B1)(A2+B2) - FP4_add(&t, &w1, &w2); - FP4_neg(&t, &t); - FP4_add(&tc, &tc, &t); // (A1+B1)(A2+B2)-A1.A2-B1*B2 = (A1.B2+A2.B1) - - FP4_add(&ta, &(w->a).a, &(w->c).b); // A1+F1 - FP4_add(&tb, &(y->a).a, &(y->c).b); // A2+F2 - FP4_norm(&ta); - FP4_norm(&tb); - FP4_mul(&td, &ta, &tb); // (A1+F1)(A2+F2) - FP4_add(&t, &w1, &w3); - FP4_neg(&t, &t); - FP4_add(&td, &td, &t); // (A1+F1)(A2+F2)-A1.A2-F1*F2 = (A1.F2+A2.F1) - - FP4_add(&ta, &(w->a).b, &(w->c).b); // B1+F1 - FP4_add(&tb, &(y->a).b, &(y->c).b); // B2+F2 - FP4_norm(&ta); - FP4_norm(&tb); - FP4_mul(&te, &ta, &tb); // (B1+F1)(B2+F2) - FP4_add(&t, &w2, &w3); - FP4_neg(&t, &t); - FP4_add(&te, &te, &t); // (B1+F1)(B2+F2)-B1.B2-F1*F2 = (B1.F2+B2.F1) - - FP4_times_i(&w2); - FP4_add(&w1, &w1, &w2); - FP8_from_FP4s(&(w->a), &w1, &tc); - - FP4_times_i(&w3); - FP4_norm(&w3); - FP8_from_FP4H(&(w->b), &w3); - - FP4_norm(&te); - FP4_times_i(&te); - FP8_from_FP4s(&(w->c), &te, &td); - - FP8_norm(&(w->a)); - FP8_norm(&(w->c)); -#endif - - w->type = FP_SPARSE; -} - -/* Set w=1/x */ -/* SU= 600 */ -void YYY::FP24_inv(FP24 *w, FP24 *x) -{ - FP8 f0, f1, f2, f3; - - FP8_sqr(&f0, &(x->a)); - FP8_mul(&f1, &(x->b), &(x->c)); - FP8_times_i(&f1); - FP8_sub(&f0, &f0, &f1); /* y.a */ - FP8_norm(&f0); - - FP8_sqr(&f1, &(x->c)); - FP8_times_i(&f1); - FP8_mul(&f2, &(x->a), &(x->b)); - FP8_sub(&f1, &f1, &f2); /* y.b */ - FP8_norm(&f1); - - FP8_sqr(&f2, &(x->b)); - FP8_mul(&f3, &(x->a), &(x->c)); - FP8_sub(&f2, &f2, &f3); /* y.c */ - FP8_norm(&f2); - - FP8_mul(&f3, &(x->b), &f2); - FP8_times_i(&f3); - FP8_mul(&(w->a), &f0, &(x->a)); - FP8_add(&f3, &(w->a), &f3); - FP8_mul(&(w->c), &f1, &(x->c)); - FP8_times_i(&(w->c)); - - FP8_add(&f3, &(w->c), &f3); - FP8_norm(&f3); - - FP8_inv(&f3, &f3, NULL); - FP8_mul(&(w->a), &f0, &f3); - FP8_mul(&(w->b), &f1, &f3); - FP8_mul(&(w->c), &f2, &f3); - w->type = FP_DENSE; -} - -/* constant time powering by small integer of max length bts */ - -void YYY::FP24_pinpow(FP24 *r, int e, int bts) -{ - int i, b; - FP24 R[2]; - - FP24_one(&R[0]); - FP24_copy(&R[1], r); - - for (i = bts - 1; i >= 0; i--) - { - b = (e >> i) & 1; - FP24_mul(&R[1 - b], &R[b]); - FP24_usqr(&R[b], &R[b]); - } - FP24_copy(r, &R[0]); -} - -/* Compressed powering of unitary elements y=x^(e mod r) */ - -/* -void YYY::FP24_compow(FP8 *c, FP24 *x, BIG e, BIG r) -{ - FP24 g1, g2; - FP8 cp, cpm1, cpm2; - FP2 f; - BIG q, a, b, m; - - BIG_rcopy(a, Fra); - BIG_rcopy(b, Frb); - FP2_from_BIGs(&f, a, b); - - BIG_rcopy(q, Modulus); - - FP24_copy(&g1, x); - FP24_copy(&g2, x); - - BIG_copy(m, q); - BIG_mod(m, r); - - BIG_copy(a, e); - BIG_mod(a, m); - - BIG_copy(b, e); - BIG_sdiv(b, m); - - FP24_trace(c, &g1); - - if (BIG_iszilch(b)) - { - FP8_xtr_pow(c, c, e); - return; - } - - FP24_frob(&g2, &f, 1); - FP24_trace(&cp, &g2); - FP24_conj(&g1, &g1); - FP24_mul(&g2, &g1); - FP24_trace(&cpm1, &g2); - FP24_mul(&g2, &g1); - - FP24_trace(&cpm2, &g2); - - FP8_xtr_pow2(c, &cp, c, &cpm1, &cpm2, a, b); - -} -*/ -/* Note this is simple square and multiply, so not side-channel safe */ - -void YYY::FP24_pow(FP24 *r, FP24 *a, BIG b) -{ - FP24 w, sf; - BIG b1, b3; - int i, nb, bt; - BIG_copy(b1, b); - BIG_norm(b1); - BIG_pmul(b3, b1, 3); - BIG_norm(b3); - - FP24_copy(&sf, a); - FP24_norm(&sf); - FP24_copy(&w, &sf); - - if (BIG_iszilch(b3)) - { - FP24_one(r); - return; - } - - nb = BIG_nbits(b3); - for (i = nb - 2; i >= 1; i--) - { - FP24_usqr(&w, &w); - bt = BIG_bit(b3, i) - BIG_bit(b1, i); - if (bt == 1) - FP24_mul(&w, &sf); - if (bt == -1) - { - FP24_conj(&sf, &sf); - FP24_mul(&w, &sf); - FP24_conj(&sf, &sf); - } - } - - FP24_copy(r, &w); - FP24_reduce(r); -} - -/* p=q0^u0.q1^u1.q2^u2.q3^u3... */ -/* Side channel attack secure */ -// Bos & Costello https://eprint.iacr.org/2013/458.pdf -// Faz-Hernandez & Longa & Sanchez https://eprint.iacr.org/2013/158.pdf - -void YYY::FP24_pow8(FP24 *p, FP24 *q, BIG u[8]) -{ - int i, j, k, nb, pb1, pb2, bt; - FP24 g1[8], g2[8], r; - BIG t[8], mt; - sign8 w1[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s1[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 w2[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s2[NLEN_XXX * BASEBITS_XXX + 1]; -// FP fx,fy; -// FP2 X; - /* - FP_rcopy(&fx,Fra); - FP_rcopy(&fy,Frb); - FP2_from_FPs(&X,&fx,&fy); - */ - for (i = 0; i < 8; i++) - BIG_copy(t[i], u[i]); - -// Precomputed table - FP24_copy(&g1[0], &q[0]); // q[0] - FP24_copy(&g1[1], &g1[0]); - FP24_mul(&g1[1], &q[1]); // q[0].q[1] - FP24_copy(&g1[2], &g1[0]); - FP24_mul(&g1[2], &q[2]); // q[0].q[2] - FP24_copy(&g1[3], &g1[1]); - FP24_mul(&g1[3], &q[2]); // q[0].q[1].q[2] - FP24_copy(&g1[4], &g1[0]); - FP24_mul(&g1[4], &q[3]); // q[0].q[3] - FP24_copy(&g1[5], &g1[1]); - FP24_mul(&g1[5], &q[3]); // q[0].q[1].q[3] - FP24_copy(&g1[6], &g1[2]); - FP24_mul(&g1[6], &q[3]); // q[0].q[2].q[3] - FP24_copy(&g1[7], &g1[3]); - FP24_mul(&g1[7], &q[3]); // q[0].q[1].q[2].q[3] - - FP24_copy(&g2[0], &q[4]); // q[0] - FP24_copy(&g2[1], &g2[0]); - FP24_mul(&g2[1], &q[5]); // q[0].q[1] - FP24_copy(&g2[2], &g2[0]); - FP24_mul(&g2[2], &q[6]); // q[0].q[2] - FP24_copy(&g2[3], &g2[1]); - FP24_mul(&g2[3], &q[6]); // q[0].q[1].q[2] - FP24_copy(&g2[4], &g2[0]); - FP24_mul(&g2[4], &q[7]); // q[0].q[3] - FP24_copy(&g2[5], &g2[1]); - FP24_mul(&g2[5], &q[7]); // q[0].q[1].q[3] - FP24_copy(&g2[6], &g2[2]); - FP24_mul(&g2[6], &q[7]); // q[0].q[2].q[3] - FP24_copy(&g2[7], &g2[3]); - FP24_mul(&g2[7], &q[7]); // q[0].q[1].q[2].q[3] - -// Use Frobenius - /* - for (i=0;i<8;i++) - { - FP24_copy(&g2[i],&g1[i]); - FP24_frob(&g2[i],&X,4); - } - */ -// Make it odd - pb1 = 1 - BIG_parity(t[0]); - BIG_inc(t[0], pb1); - BIG_norm(t[0]); - - pb2 = 1 - BIG_parity(t[4]); - BIG_inc(t[4], pb2); - BIG_norm(t[4]); - -// Number of bits - BIG_zero(mt); - for (i = 0; i < 8; i++) - { - BIG_or(mt, mt, t[i]); - } - nb = 1 + BIG_nbits(mt); - -// Sign pivot - s1[nb - 1] = 1; - s2[nb - 1] = 1; - for (i = 0; i < nb - 1; i++) - { - BIG_fshr(t[0], 1); - s1[i] = 2 * BIG_parity(t[0]) - 1; - BIG_fshr(t[4], 1); - s2[i] = 2 * BIG_parity(t[4]) - 1; - } - -// Recoded exponents - for (i = 0; i < nb; i++) - { - w1[i] = 0; - k = 1; - for (j = 1; j < 4; j++) - { - bt = s1[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w1[i] += bt * k; - k *= 2; - } - - w2[i] = 0; - k = 1; - for (j = 5; j < 8; j++) - { - bt = s2[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w2[i] += bt * k; - k *= 2; - } - } - -// Main loop - FP24_select(p, g1, 2 * w1[nb - 1] + 1); - FP24_select(&r, g2, 2 * w2[nb - 1] + 1); - FP24_mul(p, &r); - for (i = nb - 2; i >= 0; i--) - { - FP24_usqr(p, p); - FP24_select(&r, g1, 2 * w1[i] + s1[i]); - FP24_mul(p, &r); - FP24_select(&r, g2, 2 * w2[i] + s2[i]); - FP24_mul(p, &r); - } - -// apply correction - FP24_conj(&r, &q[0]); - FP24_mul(&r, p); - FP24_cmove(p, &r, pb1); - FP24_conj(&r, &q[4]); - FP24_mul(&r, p); - FP24_cmove(p, &r, pb2); - - FP24_reduce(p); -} - -/* Set w=w^p using Frobenius */ -/* SU= 160 */ -void YYY::FP24_frob(FP24 *w, FP2 *f, int n) -{ - int i; - FP4 X2, X4; - FP2 f3, f2; // f=(1+i)^(p-7)/12 - FP2_sqr(&f2, f); // - FP2_mul(&f3, &f2, f); // f3=f^3=(1+i)^(p-7)/4 - - FP2_mul_ip(&f3); // f3 = (1+i).f3 = (1+i)^(p-3)/4 - FP2_norm(&f3); - - for (i = 0; i < n; i++) - { - FP8_frob(&(w->a), &f3); // a=a^p - FP8_frob(&(w->b), &f3); // b=b^p - FP8_frob(&(w->c), &f3); // c=c^p - - FP8_qmul(&(w->b), &(w->b), f); FP8_times_i2(&(w->b)); - FP8_qmul(&(w->c), &(w->c), &f2); FP8_times_i2(&(w->c)); FP8_times_i2(&(w->c)); - } - w->type = FP_DENSE; -} - - -/* SU= 8 */ -/* normalise all components of w */ -void YYY::FP24_norm(FP24 *w) -{ - FP8_norm(&(w->a)); - FP8_norm(&(w->b)); - FP8_norm(&(w->c)); -} - -/* SU= 8 */ -/* reduce all components of w */ -void YYY::FP24_reduce(FP24 *w) -{ - FP8_reduce(&(w->a)); - FP8_reduce(&(w->b)); - FP8_reduce(&(w->c)); -} - -/* trace function w=trace(x) */ -/* SU= 8 */ -void YYY::FP24_trace(FP8 *w, FP24 *x) -{ - FP8_imul(w, &(x->a), 3); - FP8_reduce(w); -} - -/* SU= 8 */ -/* Output w in hex */ -void YYY::FP24_output(FP24 *w) -{ - printf("["); - FP8_output(&(w->a)); - printf(","); - FP8_output(&(w->b)); - printf(","); - FP8_output(&(w->c)); - printf("]"); -} - -/* SU= 64 */ -/* Convert g to octet string w */ -void YYY::FP24_toOctet(octet *W, FP24 *g) -{ - W->len = 24 * MODBYTES_XXX; - FP8_toBytes(&(W->val[0]),&(g->c)); - FP8_toBytes(&(W->val[8 * MODBYTES_XXX]),&(g->b)); - FP8_toBytes(&(W->val[16 * MODBYTES_XXX]),&(g->a)); -} - -/* SU= 24 */ -/* Restore g from octet string w */ -void YYY::FP24_fromOctet(FP24 *g, octet *W) -{ - FP8_fromBytes(&(g->c),&(W->val[0])); - FP8_fromBytes(&(g->b),&(W->val[8 * MODBYTES_XXX])); - FP8_fromBytes(&(g->a),&(W->val[16 * MODBYTES_XXX])); -} - -/* Move b to a if d=1 */ -void YYY::FP24_cmove(FP24 *f, FP24 *g, int d) -{ - FP8_cmove(&(f->a), &(g->a), d); - FP8_cmove(&(f->b), &(g->b), d); - FP8_cmove(&(f->c), &(g->c), d); - d = ~(d - 1); - f->type ^= (f->type ^ g->type)&d; -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4.cpp deleted file mode 100644 index 2b0650e..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp4.cpp +++ /dev/null @@ -1,729 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE Fp^4 functions */ -/* SU=m, m is Stack Usage (no lazy )*/ - -/* FP4 elements are of the form a+ib, where i is sqrt(-1+sqrt(-1)) */ - -#include "fp4_YYY.h" - -using namespace XXX; - -/* test x==0 ? */ -/* SU= 8 */ -int YYY::FP4_iszilch(FP4 *x) -{ - return (FP2_iszilch(&(x->a)) & FP2_iszilch(&(x->b))); -} - -/* test x==1 ? */ -/* SU= 8 */ -int YYY::FP4_isunity(FP4 *x) -{ - return (FP2_isunity(&(x->a)) & FP2_iszilch(&(x->b))); -} - -/* test is w real? That is in a+ib test b is zero */ -int YYY::FP4_isreal(FP4 *w) -{ - return FP2_iszilch(&(w->b)); -} - - -// Is x lexically larger than p-x? -// return -1 for no, 0 if x=0, 1 for yes -int YYY::FP4_islarger(FP4 *x) -{ - int cmp; - if (FP4_iszilch(x)) return 0; - cmp=FP2_islarger(&(x->b)); - if (cmp!=0) return cmp; - return FP2_islarger(&(x->a)); -} - -void YYY::FP4_toBytes(char *b,FP4 *x) -{ - FP2_toBytes(b,&(x->b)); - FP2_toBytes(&b[2*MODBYTES_XXX],&(x->a)); -} - -void YYY::FP4_fromBytes(FP4 *x,char *b) -{ - FP2_fromBytes(&(x->b),b); - FP2_fromBytes(&(x->a),&b[2*MODBYTES_XXX]); -} - -/* return 1 if x==y, else 0 */ -/* SU= 16 */ -int YYY::FP4_equals(FP4 *x, FP4 *y) -{ - return (FP2_equals(&(x->a), &(y->a)) & FP2_equals(&(x->b), &(y->b))); -} - -/* set FP4 from two FP2s */ -/* SU= 16 */ -void YYY::FP4_from_FP2s(FP4 *w, FP2 * x, FP2* y) -{ - FP2_copy(&(w->a), x); - FP2_copy(&(w->b), y); -} - -/* set FP4 from FP2 */ -/* SU= 8 */ -void YYY::FP4_from_FP2(FP4 *w, FP2 *x) -{ - FP2_copy(&(w->a), x); - FP2_zero(&(w->b)); -} - -/* set high part of FP4 from FP2 */ -/* SU= 8 */ -void YYY::FP4_from_FP2H(FP4 *w, FP2 *x) -{ - FP2_copy(&(w->b), x); - FP2_zero(&(w->a)); -} - -/* set FP4 from FP */ -void YYY::FP4_from_FP(FP4 *w, FP *x) -{ - FP2 t; - FP2_from_FP(&t, x); - FP4_from_FP2(w, &t); -} - -/* FP4 copy w=x */ -/* SU= 16 */ -void YYY::FP4_copy(FP4 *w, FP4 *x) -{ - if (w == x) return; - FP2_copy(&(w->a), &(x->a)); - FP2_copy(&(w->b), &(x->b)); -} - -/* FP4 w=0 */ -/* SU= 8 */ -void YYY::FP4_zero(FP4 *w) -{ - FP2_zero(&(w->a)); - FP2_zero(&(w->b)); -} - -/* FP4 w=1 */ -/* SU= 8 */ -void YYY::FP4_one(FP4 *w) -{ - FP2_one(&(w->a)); - FP2_zero(&(w->b)); -} - -int YYY::FP4_sign(FP4 *w) -{ - int p1,p2; - p1=FP2_sign(&(w->a)); - p2=FP2_sign(&(w->b)); -#ifdef BIG_ENDIAN_SIGN_YYY - p2 ^= (p1 ^ p2)&FP2_iszilch(&(w->b)); - return p2; -#else - p1 ^= (p1 ^ p2)&FP2_iszilch(&(w->a)); - return p1; -#endif - -} - -/* Set w=-x */ -/* SU= 160 */ -void YYY::FP4_neg(FP4 *w, FP4 *x) -{ - /* Just one field neg */ - FP2 m, t; - FP4_norm(x); - - FP2_add(&m, &(x->a), &(x->b)); - FP2_neg(&m, &m); - FP2_add(&t, &m, &(x->b)); - FP2_add(&(w->b), &m, &(x->a)); - FP2_copy(&(w->a), &t); - FP4_norm(w); -} - -/* Set w=conj(x) */ -/* SU= 16 */ -void YYY::FP4_conj(FP4 *w, FP4 *x) -{ - FP2_copy(&(w->a), &(x->a)); - FP2_neg(&(w->b), &(x->b)); - FP4_norm(w); -} - -/* Set w=-conj(x) */ -/* SU= 16 */ -void YYY::FP4_nconj(FP4 *w, FP4 *x) -{ - FP2_copy(&(w->b), &(x->b)); - FP2_neg(&(w->a), &(x->a)); - FP4_norm(w); -} - -/* Set w=x+y */ -/* SU= 16 */ -void YYY::FP4_add(FP4 *w, FP4 *x, FP4 *y) -{ - FP2_add(&(w->a), &(x->a), &(y->a)); - FP2_add(&(w->b), &(x->b), &(y->b)); -} - -/* Set w=x-y */ -/* Input y MUST be normed */ -void YYY::FP4_sub(FP4 *w, FP4 *x, FP4 *y) -{ - FP4 my; - FP4_neg(&my, y); - FP4_add(w, x, &my); -} -/* SU= 8 */ -/* reduce all components of w mod Modulus */ -void YYY::FP4_reduce(FP4 *w) -{ - FP2_reduce(&(w->a)); - FP2_reduce(&(w->b)); -} - -/* SU= 8 */ -/* normalise all elements of w */ -void YYY::FP4_norm(FP4 *w) -{ - FP2_norm(&(w->a)); - FP2_norm(&(w->b)); -} - -/* Set w=s*x, where s is FP2 */ -/* SU= 16 */ -void YYY::FP4_pmul(FP4 *w, FP4 *x, FP2 *s) -{ - FP2_mul(&(w->a), &(x->a), s); - FP2_mul(&(w->b), &(x->b), s); -} - -/* Set w=s*x, where s is FP */ -void YYY::FP4_qmul(FP4 *w, FP4 *x, FP *s) -{ - FP2_pmul(&(w->a), &(x->a), s); - FP2_pmul(&(w->b), &(x->b), s); -} - -/* SU= 16 */ -/* Set w=s*x, where s is int */ -void YYY::FP4_imul(FP4 *w, FP4 *x, int s) -{ - FP2_imul(&(w->a), &(x->a), s); - FP2_imul(&(w->b), &(x->b), s); -} - -/* Set w=x^2 */ -/* Input MUST be normed */ -void YYY::FP4_sqr(FP4 *w, FP4 *x) -{ - FP2 t1, t2, t3; - - FP2_mul(&t3, &(x->a), &(x->b)); /* norms x */ - FP2_copy(&t2, &(x->b)); - FP2_add(&t1, &(x->a), &(x->b)); - FP2_mul_ip(&t2); - - FP2_add(&t2, &(x->a), &t2); - - FP2_norm(&t1); // 2 - FP2_norm(&t2); // 2 - - FP2_mul(&(w->a), &t1, &t2); - - FP2_copy(&t2, &t3); - FP2_mul_ip(&t2); - - FP2_add(&t2, &t2, &t3); - - FP2_norm(&t2); // 2 - FP2_neg(&t2, &t2); - FP2_add(&(w->a), &(w->a), &t2); /* a=(a+b)(a+i^2.b)-i^2.ab-ab = a*a+ib*ib */ - FP2_add(&(w->b), &t3, &t3); /* b=2ab */ - - FP4_norm(w); -} - -/* Set w=x*y */ -/* Inputs MUST be normed */ -void YYY::FP4_mul(FP4 *w, FP4 *x, FP4 *y) -{ - - FP2 t1, t2, t3, t4; - - FP2_mul(&t1, &(x->a), &(y->a)); - - FP2_mul(&t2, &(x->b), &(y->b)); - FP2_add(&t3, &(y->b), &(y->a)); - FP2_add(&t4, &(x->b), &(x->a)); - - FP2_norm(&t4); // 2 - FP2_norm(&t3); // 2 - - FP2_mul(&t4, &t4, &t3); /* (xa+xb)(ya+yb) */ - - FP2_neg(&t3, &t1); // 1 - FP2_add(&t4, &t4, &t3); //t4E=3 - FP2_norm(&t4); - - FP2_neg(&t3, &t2); // 1 - FP2_add(&(w->b), &t4, &t3); //wbE=3 - - FP2_mul_ip(&t2); - FP2_add(&(w->a), &t2, &t1); - - FP4_norm(w); -} - -/* output FP4 in format [a,b] */ -/* SU= 8 */ -void YYY::FP4_output(FP4 *w) -{ - printf("["); - FP2_output(&(w->a)); - printf(","); - FP2_output(&(w->b)); - printf("]"); -} - -/* SU= 8 */ -void YYY::FP4_rawoutput(FP4 *w) -{ - printf("["); - FP2_rawoutput(&(w->a)); - printf(","); - FP2_rawoutput(&(w->b)); - printf("]"); -} - -/* Set w=1/x */ -/* SU= 160 */ -void YYY::FP4_inv(FP4 *w, FP4 *x, FP *h) -{ - FP2 t1, t2; - FP2_sqr(&t1, &(x->a)); - FP2_sqr(&t2, &(x->b)); - FP2_mul_ip(&t2); - FP2_norm(&t2); - FP2_sub(&t1, &t1, &t2); - FP2_inv(&t1, &t1, h); - FP2_mul(&(w->a), &t1, &(x->a)); - FP2_neg(&t1, &t1); - FP2_norm(&t1); - FP2_mul(&(w->b), &t1, &(x->b)); -} - -/* w*=i where i = sqrt(2^i+sqrt(-1)) */ -/* SU= 200 */ -void YYY::FP4_times_i(FP4 *w) -{ - FP2 t; - FP2_copy(&t, &(w->b)); - FP2_copy(&(w->b), &(w->a)); - FP2_mul_ip(&t); - FP2_copy(&(w->a), &t); - FP4_norm(w); -#if TOWER_YYY == POSITOWER - FP4_neg(w, w); // *** - FP4_norm(w); -#endif -} - -/* Set w=w^p using Frobenius */ -/* SU= 16 */ -void YYY::FP4_frob(FP4 *w, FP2 *f) -{ - FP2_conj(&(w->a), &(w->a)); - FP2_conj(&(w->b), &(w->b)); - FP2_mul( &(w->b), f, &(w->b)); -} - -/* Set r=a^b mod m */ -/* SU= 240 */ -/* -void YYY::FP4_pow(FP4 *r, FP4* a, BIG b) -{ - FP4 w; - BIG z, zilch; - int bt; - - BIG_zero(zilch); - BIG_copy(z, b); - BIG_norm(z); - FP4_copy(&w, a); - FP4_norm(&w); - FP4_one(r); - - while (1) - { - bt = BIG_parity(z); - BIG_shr(z, 1); - if (bt) FP4_mul(r, r, &w); - if (BIG_comp(z, zilch) == 0) break; - FP4_sqr(&w, &w); - } - FP4_reduce(r); -} -*/ -#if CURVE_SECURITY_ZZZ == 128 - -/* SU= 304 */ -/* XTR xtr_a function */ -void YYY::FP4_xtr_A(FP4 *r, FP4 *w, FP4 *x, FP4 *y, FP4 *z) -{ - FP4 t1, t2; - - FP4_copy(r, x); - FP4_sub(&t1, w, y); - FP4_norm(&t1); - FP4_pmul(&t1, &t1, &(r->a)); - FP4_add(&t2, w, y); - FP4_norm(&t2); - FP4_pmul(&t2, &t2, &(r->b)); - FP4_times_i(&t2); - - FP4_add(r, &t1, &t2); - FP4_add(r, r, z); - - FP4_reduce(r); -} - -/* SU= 152 */ -/* XTR xtr_d function */ -void YYY::FP4_xtr_D(FP4 *r, FP4 *x) -{ - FP4 w; - FP4_copy(r, x); - FP4_conj(&w, r); - FP4_add(&w, &w, &w); - FP4_sqr(r, r); - FP4_norm(&w); - FP4_sub(r, r, &w); - FP4_reduce(r); /* reduce here as multiple calls trigger automatic reductions */ -} - -/* SU= 728 */ -/* r=x^n using XTR method on traces of FP12s */ -void YYY::FP4_xtr_pow(FP4 *r, FP4 *x, BIG n) -{ - int i, par, nb; - BIG v; - FP2 w; - FP4 t, a, b, c, sf; - - BIG_zero(v); - BIG_inc(v, 3); - BIG_norm(v); - FP2_from_BIG(&w, v); - FP4_from_FP2(&a, &w); - FP4_copy(&sf, x); - FP4_norm(&sf); - FP4_copy(&b, &sf); - FP4_xtr_D(&c, &sf); - - par = BIG_parity(n); - BIG_copy(v, n); - BIG_norm(v); - BIG_shr(v, 1); - if (par == 0) - { - BIG_dec(v, 1); - BIG_norm(v); - } - - nb = BIG_nbits(v); - for (i = nb - 1; i >= 0; i--) - { - if (!BIG_bit(v, i)) - { - FP4_copy(&t, &b); - FP4_conj(&sf, &sf); - FP4_conj(&c, &c); - FP4_xtr_A(&b, &a, &b, &sf, &c); - FP4_conj(&sf, &sf); - FP4_xtr_D(&c, &t); - FP4_xtr_D(&a, &a); - } - else - { - FP4_conj(&t, &a); - FP4_xtr_D(&a, &b); - FP4_xtr_A(&b, &c, &b, &sf, &t); - FP4_xtr_D(&c, &c); - } - } - - if (par == 0) FP4_copy(r, &c); - else FP4_copy(r, &b); - FP4_reduce(r); -} - -/* SU= 872 */ -/* r=ck^a.cl^n using XTR double exponentiation method on traces of FP12s. See Stam thesis. */ -void YYY::FP4_xtr_pow2(FP4 *r, FP4 *ck, FP4 *cl, FP4 *ckml, FP4 *ckm2l, BIG a, BIG b) -{ - int i, f2; - BIG d, e, w; - FP4 t, cu, cv, cumv, cum2v; - - - BIG_copy(e, a); - BIG_copy(d, b); - BIG_norm(e); - BIG_norm(d); - FP4_copy(&cu, ck); - FP4_copy(&cv, cl); - FP4_copy(&cumv, ckml); - FP4_copy(&cum2v, ckm2l); - - f2 = 0; - while (BIG_parity(d) == 0 && BIG_parity(e) == 0) - { - BIG_shr(d, 1); - BIG_shr(e, 1); - f2++; - } - while (BIG_comp(d, e) != 0) - { - if (BIG_comp(d, e) > 0) - { - BIG_imul(w, e, 4); - BIG_norm(w); - if (BIG_comp(d, w) <= 0) - { - BIG_copy(w, d); - BIG_copy(d, e); - BIG_sub(e, w, e); - BIG_norm(e); - FP4_xtr_A(&t, &cu, &cv, &cumv, &cum2v); - FP4_conj(&cum2v, &cumv); - FP4_copy(&cumv, &cv); - FP4_copy(&cv, &cu); - FP4_copy(&cu, &t); - } - else if (BIG_parity(d) == 0) - { - BIG_shr(d, 1); - FP4_conj(r, &cum2v); - FP4_xtr_A(&t, &cu, &cumv, &cv, r); - FP4_xtr_D(&cum2v, &cumv); - FP4_copy(&cumv, &t); - FP4_xtr_D(&cu, &cu); - } - else if (BIG_parity(e) == 1) - { - BIG_sub(d, d, e); - BIG_norm(d); - BIG_shr(d, 1); - FP4_xtr_A(&t, &cu, &cv, &cumv, &cum2v); - FP4_xtr_D(&cu, &cu); - FP4_xtr_D(&cum2v, &cv); - FP4_conj(&cum2v, &cum2v); - FP4_copy(&cv, &t); - } - else - { - BIG_copy(w, d); - BIG_copy(d, e); - BIG_shr(d, 1); - BIG_copy(e, w); - FP4_xtr_D(&t, &cumv); - FP4_conj(&cumv, &cum2v); - FP4_conj(&cum2v, &t); - FP4_xtr_D(&t, &cv); - FP4_copy(&cv, &cu); - FP4_copy(&cu, &t); - } - } - if (BIG_comp(d, e) < 0) - { - BIG_imul(w, d, 4); - BIG_norm(w); - if (BIG_comp(e, w) <= 0) - { - BIG_sub(e, e, d); - BIG_norm(e); - FP4_xtr_A(&t, &cu, &cv, &cumv, &cum2v); - FP4_copy(&cum2v, &cumv); - FP4_copy(&cumv, &cu); - FP4_copy(&cu, &t); - } - else if (BIG_parity(e) == 0) - { - BIG_copy(w, d); - BIG_copy(d, e); - BIG_shr(d, 1); - BIG_copy(e, w); - FP4_xtr_D(&t, &cumv); - FP4_conj(&cumv, &cum2v); - FP4_conj(&cum2v, &t); - FP4_xtr_D(&t, &cv); - FP4_copy(&cv, &cu); - FP4_copy(&cu, &t); - } - else if (BIG_parity(d) == 1) - { - BIG_copy(w, e); - BIG_copy(e, d); - BIG_sub(w, w, d); - BIG_norm(w); - BIG_copy(d, w); - BIG_shr(d, 1); - FP4_xtr_A(&t, &cu, &cv, &cumv, &cum2v); - FP4_conj(&cumv, &cumv); - FP4_xtr_D(&cum2v, &cu); - FP4_conj(&cum2v, &cum2v); - FP4_xtr_D(&cu, &cv); - FP4_copy(&cv, &t); - } - else - { - BIG_shr(d, 1); - FP4_conj(r, &cum2v); - FP4_xtr_A(&t, &cu, &cumv, &cv, r); - FP4_xtr_D(&cum2v, &cumv); - FP4_copy(&cumv, &t); - FP4_xtr_D(&cu, &cu); - } - } - } - FP4_xtr_A(r, &cu, &cv, &cumv, &cum2v); - for (i = 0; i < f2; i++) FP4_xtr_D(r, r); - FP4_xtr_pow(r, r, d); -} - -#endif - -/* New stuff for ECp4 support */ - -/* Set w=x/2 */ -void YYY::FP4_div2(FP4 *w, FP4 *x) -{ - FP2_div2(&(w->a), &(x->a)); - FP2_div2(&(w->b), &(x->b)); -} - -/* Move b to a if d=1 */ -void YYY::FP4_cmove(FP4 *f, FP4 *g, int d) -{ - FP2_cmove(&(f->a), &(g->a), d); - FP2_cmove(&(f->b), &(g->b), d); -} - -void YYY::FP4_rand(FP4 *x,csprng *rng) -{ - FP2_rand(&(x->a),rng); - FP2_rand(&(x->b),rng); -} - -#if PAIRING_FRIENDLY_ZZZ >= BLS24_CURVE - -/* test for x a QR */ -int YYY::FP4_qr(FP4 *x, FP *h) -{ /* test x^(p^4-1)/2 = 1 */ - - FP4 c; - FP4_conj(&c,x); - FP4_mul(&c,&c,x); - - return FP2_qr(&(c.a),h); -} - -/* sqrt(a+xb) = sqrt((a+sqrt(a*a-n*b*b))/2)+x.b/(2*sqrt((a+sqrt(a*a-n*b*b))/2)) */ - -void YYY::FP4_sqrt(FP4 *r, FP4* x, FP *h) -{ - FP2 a, b, s, t; - FP hint,twk; - FP4 nr; - int sgn,qr; - - FP4_copy(r, x); - if (FP4_iszilch(x)) return; - - FP2_copy(&a, &(x->a)); - FP2_copy(&s, &(x->b)); - - FP2_sqr(&s, &s); // s*=s - FP2_sqr(&a, &a); // a*=a - FP2_mul_ip(&s); - FP2_norm(&s); - FP2_sub(&a, &a, &s); // a-=txx(s) - FP2_norm(&a); // ** - - FP2_sqrt(&s, &a, h); // Cost = +1 - - FP2_add(&a, &(r->a), &s); - FP2_norm(&a); - FP2_div2(&a, &a); - - FP2_div2(&b,&(r->b)); // w1=b/2 - qr=FP2_qr(&a,&hint); // only exp! Cost=+1 - -// tweak hint - multiply old hint by Norm(1/Beta)^e where Beta is irreducible polynomial - FP2_copy(&s,&a); - FP_rcopy(&twk,TWK); - FP_mul(&twk,&twk,&hint); - FP2_div_ip(&s); FP2_norm(&s); // switch to other candidate - - FP2_cmove(&a,&s,1-qr); - FP_cmove(&hint,&twk,1-qr); - - FP2_sqrt(&(r->a),&a,&hint); // a=sqrt(w2) Cost=+1 - FP2_inv(&s,&a,&hint); // w3=1/w2 - FP2_mul(&s,&s,&(r->a)); // w3=1/sqrt(w2) - FP2_mul(&(r->b),&s,&b); // b=(b/2)*1/sqrt(w2) - FP2_copy(&t,&(r->a)); - - FP2_cmove(&(r->a),&(r->b),1-qr); - FP2_cmove(&(r->b),&t,1-qr); - - sgn=FP4_sign(r); - FP4_neg(&nr,r); FP4_norm(&nr); - FP4_cmove(r,&nr,sgn); -} - -void YYY::FP4_div_i(FP4 *f) -{ - FP2 u, v; - FP2_copy(&u, &(f->a)); - FP2_copy(&v, &(f->b)); - - FP2_div_ip(&u); - - FP2_copy(&(f->a), &v); - FP2_copy(&(f->b), &u); - -#if TOWER_YYY == POSITOWER - FP4_neg(f, f); // *** - FP4_norm(f); -#endif -} - - -#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48.cpp deleted file mode 100644 index 9f0905c..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp48.cpp +++ /dev/null @@ -1,1092 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE Fp^12 functions */ -/* SU=m, m is Stack Usage (no lazy )*/ -/* FP48 elements are of the form a+i.b+i^2.c */ - -#include "fp48_YYY.h" -#include "config_curve_ZZZ.h" - -using namespace XXX; - -/* return 1 if b==c, no branching */ -static int teq(sign32 b, sign32 c) -{ - sign32 x = b ^ c; - x -= 1; // if x=0, x now -1 - return (int)((x >> 31) & 1); -} - - -/* Constant time select from pre-computed table */ -static void FP48_select(YYY::FP48 *f, YYY::FP48 g[], sign32 b) -{ - YYY::FP48 invf; - sign32 m = b >> 31; - sign32 babs = (b ^ m) - m; - - babs = (babs - 1) / 2; - - FP48_cmove(f, &g[0], teq(babs, 0)); // conditional move - FP48_cmove(f, &g[1], teq(babs, 1)); - FP48_cmove(f, &g[2], teq(babs, 2)); - FP48_cmove(f, &g[3], teq(babs, 3)); - FP48_cmove(f, &g[4], teq(babs, 4)); - FP48_cmove(f, &g[5], teq(babs, 5)); - FP48_cmove(f, &g[6], teq(babs, 6)); - FP48_cmove(f, &g[7], teq(babs, 7)); - - FP48_copy(&invf, f); - FP48_conj(&invf, &invf); // 1/f - FP48_cmove(f, &invf, (int)(m & 1)); -} - - -/* test x==0 ? */ -/* SU= 8 */ -int YYY::FP48_iszilch(FP48 *x) -{ - if (FP16_iszilch(&(x->a)) && FP16_iszilch(&(x->b)) && FP16_iszilch(&(x->c))) return 1; - return 0; -} - -/* test x==1 ? */ -/* SU= 8 */ -int YYY::FP48_isunity(FP48 *x) -{ - if (FP16_isunity(&(x->a)) && FP16_iszilch(&(x->b)) && FP16_iszilch(&(x->c))) return 1; - return 0; -} - -/* FP48 copy w=x */ -/* SU= 16 */ -void YYY::FP48_copy(FP48 *w, FP48 *x) -{ - if (x == w) return; - FP16_copy(&(w->a), &(x->a)); - FP16_copy(&(w->b), &(x->b)); - FP16_copy(&(w->c), &(x->c)); - w->type = x->type; -} - -/* FP48 w=1 */ -/* SU= 8 */ -void YYY::FP48_one(FP48 *w) -{ - FP16_one(&(w->a)); - FP16_zero(&(w->b)); - FP16_zero(&(w->c)); - w->type = FP_UNITY; -} - -void YYY::FP48_zero(FP48 *w) -{ - FP16_zero(&(w->a)); - FP16_zero(&(w->b)); - FP16_zero(&(w->c)); - w->type = FP_ZILCH; -} - -/* return 1 if x==y, else 0 */ -/* SU= 16 */ -int YYY::FP48_equals(FP48 *x, FP48 *y) -{ - if (FP16_equals(&(x->a), &(y->a)) && FP16_equals(&(x->b), &(y->b)) && FP16_equals(&(x->c), &(y->c))) - return 1; - return 0; -} - -/* Set w=conj(x) */ -/* SU= 8 */ -void YYY::FP48_conj(FP48 *w, FP48 *x) -{ - FP48_copy(w, x); - FP16_conj(&(w->a), &(w->a)); - FP16_nconj(&(w->b), &(w->b)); - FP16_conj(&(w->c), &(w->c)); -} - -/* Create FP48 from FP16 */ -/* SU= 8 */ -void YYY::FP48_from_FP16(FP48 *w, FP16 *a) -{ - FP16_copy(&(w->a), a); - FP16_zero(&(w->b)); - FP16_zero(&(w->c)); - w->type = FP_SPARSEST; -} - -/* Create FP48 from 3 FP16's */ -/* SU= 16 */ -void YYY::FP48_from_FP16s(FP48 *w, FP16 *a, FP16 *b, FP16 *c) -{ - FP16_copy(&(w->a), a); - FP16_copy(&(w->b), b); - FP16_copy(&(w->c), c); - w->type = FP_DENSE; -} - -/* Granger-Scott Unitary Squaring. This does not benefit from lazy reduction */ -/* SU= 600 */ -void YYY::FP48_usqr(FP48 *w, FP48 *x) -{ - FP16 A, B, C, D; - - FP16_copy(&A, &(x->a)); - - FP16_sqr(&(w->a), &(x->a)); - FP16_add(&D, &(w->a), &(w->a)); - FP16_add(&(w->a), &D, &(w->a)); - - FP16_norm(&(w->a)); - FP16_nconj(&A, &A); - - FP16_add(&A, &A, &A); - FP16_add(&(w->a), &(w->a), &A); - FP16_sqr(&B, &(x->c)); - FP16_times_i(&B); - - FP16_add(&D, &B, &B); - FP16_add(&B, &B, &D); - FP16_norm(&B); - - FP16_sqr(&C, &(x->b)); - - FP16_add(&D, &C, &C); - FP16_add(&C, &C, &D); - - FP16_norm(&C); - FP16_conj(&(w->b), &(x->b)); - FP16_add(&(w->b), &(w->b), &(w->b)); - FP16_nconj(&(w->c), &(x->c)); - - FP16_add(&(w->c), &(w->c), &(w->c)); - FP16_add(&(w->b), &B, &(w->b)); - FP16_add(&(w->c), &C, &(w->c)); - w->type = FP_DENSE; - - FP48_reduce(w); /* reduce here as in pow function repeated squarings would trigger multiple reductions */ -} - -/* FP48 squaring w=x^2 */ -/* SU= 600 */ -void YYY::FP48_sqr(FP48 *w, FP48 *x) -{ - /* Use Chung-Hasan SQR2 method from http://cacr.uwaterloo.ca/techreports/2006/cacr2006-24.pdf */ - - FP16 A, B, C, D; - - if (x->type <= FP_UNITY) - { - FP48_copy(w, x); - return; - } - - FP16_sqr(&A, &(x->a)); - FP16_mul(&B, &(x->b), &(x->c)); - FP16_add(&B, &B, &B); - FP16_norm(&B); - FP16_sqr(&C, &(x->c)); - - FP16_mul(&D, &(x->a), &(x->b)); - FP16_add(&D, &D, &D); - - FP16_add(&(w->c), &(x->a), &(x->c)); - FP16_add(&(w->c), &(x->b), &(w->c)); - FP16_norm(&(w->c)); - - FP16_sqr(&(w->c), &(w->c)); - - FP16_copy(&(w->a), &A); - FP16_add(&A, &A, &B); - - FP16_norm(&A); - - FP16_add(&A, &A, &C); - FP16_add(&A, &A, &D); - - FP16_norm(&A); - - FP16_neg(&A, &A); - FP16_times_i(&B); - FP16_times_i(&C); - - FP16_add(&(w->a), &(w->a), &B); - FP16_add(&(w->b), &C, &D); - FP16_add(&(w->c), &(w->c), &A); - - if (x->type == FP_SPARSER || x->type == FP_SPARSEST) - w->type = FP_SPARSE; - else - w->type = FP_DENSE; - - FP48_norm(w); -} - -/* FP48 full multiplication w=w*y */ - - -/* SU= 896 */ -/* FP48 full multiplication w=w*y */ -void YYY::FP48_mul(FP48 *w, FP48 *y) -{ - FP16 z0, z1, z2, z3, t0, t1; - - FP16_mul(&z0, &(w->a), &(y->a)); - FP16_mul(&z2, &(w->b), &(y->b)); // - - FP16_add(&t0, &(w->a), &(w->b)); - FP16_add(&t1, &(y->a), &(y->b)); // - - FP16_norm(&t0); - FP16_norm(&t1); - - FP16_mul(&z1, &t0, &t1); - FP16_add(&t0, &(w->b), &(w->c)); - FP16_add(&t1, &(y->b), &(y->c)); // - - FP16_norm(&t0); - FP16_norm(&t1); - - FP16_mul(&z3, &t0, &t1); - - FP16_neg(&t0, &z0); - FP16_neg(&t1, &z2); - - FP16_add(&z1, &z1, &t0); // z1=z1-z0 - FP16_add(&(w->b), &z1, &t1); // z1=z1-z2 - FP16_add(&z3, &z3, &t1); // z3=z3-z2 - FP16_add(&z2, &z2, &t0); // z2=z2-z0 - - FP16_add(&t0, &(w->a), &(w->c)); - FP16_add(&t1, &(y->a), &(y->c)); - - FP16_norm(&t0); - FP16_norm(&t1); - - FP16_mul(&t0, &t1, &t0); - FP16_add(&z2, &z2, &t0); - - FP16_mul(&t0, &(w->c), &(y->c)); - FP16_neg(&t1, &t0); - - FP16_add(&(w->c), &z2, &t1); - FP16_add(&z3, &z3, &t1); - FP16_times_i(&t0); - FP16_add(&(w->b), &(w->b), &t0); - FP16_norm(&z3); - FP16_times_i(&z3); - FP16_add(&(w->a), &z0, &z3); - - FP48_norm(w); - w->type = FP_DENSE; -} - -/* FP48 full multiplication w=w*y */ -/* Supports sparse multiplicands */ -/* Usually w is denser than y */ -void YYY::FP48_ssmul(FP48 *w, FP48 *y) -{ - FP16 z0, z1, z2, z3, t0, t1; - if (w->type == FP_UNITY) - { - FP48_copy(w, y); - return; - } - if (y->type == FP_UNITY) - return; - -// FP48_mul(w,y); return; - - if (y->type >= FP_SPARSE) - { - FP16_mul(&z0, &(w->a), &(y->a)); // xa.ya always 11x11 - -#if SEXTIC_TWIST_ZZZ == M_TYPE - if (y->type == FP_SPARSE || w->type == FP_SPARSE) - { - FP8_mul(&z2.b, &(w->b).b, &(y->b).b); - FP8_zero(&z2.a); - if (y->type != FP_SPARSE) - FP8_mul(&z2.a, &(w->b).b, &(y->b).a); - if (w->type != FP_SPARSE) - FP8_mul(&z2.a, &(w->b).a, &(y->b).b); - FP16_times_i(&z2); - } - else -#endif - FP16_mul(&z2, &(w->b), &(y->b)); // xb.yb could be 00x00 or 01x01 or or 10x10 or 11x00 or 11x10 or 11x01 or 11x11 - - FP16_add(&t0, &(w->a), &(w->b)); // (xa+xb) - FP16_add(&t1, &(y->a), &(y->b)); // (ya+yb) - - FP16_norm(&t0); - FP16_norm(&t1); - - FP16_mul(&z1, &t0, &t1); // (xa+xb)(ya+yb) always 11x11 - FP16_add(&t0, &(w->b), &(w->c)); // (xb+xc) - FP16_add(&t1, &(y->b), &(y->c)); // (yb+yc) - - FP16_norm(&t0); - FP16_norm(&t1); - - FP16_mul(&z3, &t0, &t1); // (xb+xc)(yb+yc) could be anything... - FP16_neg(&t0, &z0); // -(xa.ya) - FP16_neg(&t1, &z2); // -(xb.yb) - - FP16_add(&z1, &z1, &t0); - FP16_add(&(w->b), &z1, &t1); // /wb = (xa+xb)(ya+yb) -(xa.ya) -(xb.yb) = xa.yb + xb.ya - - FP16_add(&z3, &z3, &t1); // (xb+xc)(yb+yc) -(xb.yb) - FP16_add(&z2, &z2, &t0); // (xb.yb) - (xa.ya) - - FP16_add(&t0, &(w->a), &(w->c)); // (xa+xc) - FP16_add(&t1, &(y->a), &(y->c)); // (ya+yc) - - FP16_norm(&t0); - FP16_norm(&t1); - - FP16_mul(&t0, &t1, &t0); // (xa+xc)(ya+yc) always 11x11 - FP16_add(&z2, &z2, &t0); // (xb.yb) - (xa.ya) + (xa+xc)(ya+yc) - -#if SEXTIC_TWIST_ZZZ == D_TYPE - if (y->type == FP_SPARSE || w->type == FP_SPARSE) - { - FP8_mul(&t0.a, &(w->c).a, &(y->c).a); - FP8_zero(&t0.b); - if (y->type != FP_SPARSE) - FP8_mul(&t0.b, &(w->c).a, &(y->c).b); - if (w->type != FP_SPARSE) - FP8_mul(&t0.b, &(w->c).b, &(y->c).a); - } - else -#endif - FP16_mul(&t0, &(w->c), &(y->c)); // (xc.yc) could be anything - - FP16_neg(&t1, &t0); // -(xc.yc) - - FP16_add(&(w->c), &z2, &t1); // wc = (xb.yb) - (xa.ya) + (xa+xc)(ya+yc) - (xc.yc) = xb.yb + xc.ya + xa.yc - FP16_add(&z3, &z3, &t1); // (xb+xc)(yb+yc) -(xb.yb) - (xc.yc) = xb.yc + xc.yb - FP16_times_i(&t0); // i.(xc.yc) - FP16_add(&(w->b), &(w->b), &t0); // wb = (xa+xb)(ya+yb) -(xa.ya) -(xb.yb) +i(xc.yc) - FP16_norm(&z3); - FP16_times_i(&z3); // i[(xb+xc)(yb+yc) -(xb.yb) - (xc.yc)] = i(xb.yc + xc.yb) - FP16_add(&(w->a), &z0, &z3); // wa = xa.ya + i(xb.yc + xc.yb) - } else { - if (w->type == FP_SPARSER || w->type == FP_SPARSEST) - { - FP48_smul(w, y); - return; - } -// dense by sparser - 13m -#if SEXTIC_TWIST_ZZZ == D_TYPE - FP16_copy(&z3, &(w->b)); - FP16_mul(&z0, &(w->a), &(y->a)); - - if (y->type == FP_SPARSEST) - FP16_tmul(&z2, &(w->b), &(y->b).a.a.a.a); - else - FP16_pmul(&z2, &(w->b), &(y->b).a); - - FP16_add(&(w->b), &(w->a), &(w->b)); - FP16_copy(&t1, &(y->a)); - FP8_add(&t1.a, &t1.a, &(y->b).a); - - FP16_norm(&t1); - FP16_norm(&(w->b)); - - FP16_mul(&(w->b), &(w->b), &t1); - FP16_add(&z3, &z3, &(w->c)); - FP16_norm(&z3); - - if (y->type == FP_SPARSEST) - FP16_tmul(&z3, &z3, &(y->b).a.a.a.a); - else - FP16_pmul(&z3, &z3, &(y->b).a); - - FP16_neg(&t0, &z0); - FP16_neg(&t1, &z2); - - FP16_add(&(w->b), &(w->b), &t0); // z1=z1-z0 - FP16_add(&(w->b), &(w->b), &t1); // z1=z1-z2 - - FP16_add(&z3, &z3, &t1); // z3=z3-z2 - FP16_add(&z2, &z2, &t0); // z2=z2-z0 - - FP16_add(&t0, &(w->a), &(w->c)); - FP16_norm(&t0); - FP16_norm(&z3); - - FP16_mul(&t0, &(y->a), &t0); - FP16_add(&(w->c), &z2, &t0); - - FP16_times_i(&z3); - FP16_add(&(w->a), &z0, &z3); -#endif -#if SEXTIC_TWIST_ZZZ == M_TYPE - FP16_mul(&z0, &(w->a), &(y->a)); - FP16_add(&t0, &(w->a), &(w->b)); - FP16_norm(&t0); - - FP16_mul(&z1, &t0, &(y->a)); - FP16_add(&t0, &(w->b), &(w->c)); - FP16_norm(&t0); - - if (y->type == FP_SPARSEST) - FP16_tmul(&z3, &t0, &(y->c).b.a.a.a); - else - FP16_pmul(&z3, &t0, &(y->c).b); - - FP16_times_i(&z3); - - FP16_neg(&t0, &z0); - FP16_add(&z1, &z1, &t0); // z1=z1-z0 - - FP16_copy(&(w->b), &z1); - FP16_copy(&z2, &t0); - - FP16_add(&t0, &(w->a), &(w->c)); - FP16_add(&t1, &(y->a), &(y->c)); - - FP16_norm(&t0); - FP16_norm(&t1); - - FP16_mul(&t0, &t1, &t0); - FP16_add(&z2, &z2, &t0); - - if (y->type == FP_SPARSEST) - FP16_tmul(&t0, &(w->c), &(y->c).b.a.a.a); - else - FP16_pmul(&t0, &(w->c), &(y->c).b); - - FP16_times_i(&t0); - FP16_neg(&t1, &t0); - FP16_times_i(&t0); - - FP16_add(&(w->c), &z2, &t1); - FP16_add(&z3, &z3, &t1); - - FP16_add(&(w->b), &(w->b), &t0); - FP16_norm(&z3); - FP16_times_i(&z3); - FP16_add(&(w->a), &z0, &z3); -#endif - } - w->type = FP_DENSE; - FP48_norm(w); -} - -/* FP48 multiplication w=w*y */ -/* catering for special case that arises from special form of ATE pairing line function */ -/* w and y are both sparser line functions - cost = 6m */ -void YYY::FP48_smul(FP48 *w, FP48 *y) -{ - FP8 w1, w2, w3, ta, tb, tc, td, te, t; - -// FP48_mul(w,y); return; - -#if SEXTIC_TWIST_ZZZ == D_TYPE - FP8_mul(&w1, &(w->a).a, &(y->a).a); // A1.A2 - FP8_mul(&w2, &(w->a).b, &(y->a).b); // B1.B2 - - if (y->type == FP_SPARSEST || w->type == FP_SPARSEST) - { - if (y->type == FP_SPARSEST && w->type == FP_SPARSEST) - { - FP8_zero(&w3); - FP_mul(&w3.a.a.a, &(w->b).a.a.a.a, &(y->b).a.a.a.a); - } else { - if (y->type != FP_SPARSEST) - FP8_tmul(&w3, &(y->b).a, &(w->b).a.a.a.a); - if (w->type != FP_SPARSEST) - FP8_tmul(&w3, &(w->b).a, &(y->b).a.a.a.a); - } - } - else - FP8_mul(&w3, &(w->b).a, &(y->b).a); // C1.C2 - - FP8_add(&ta, &(w->a).a, &(w->a).b); // A1+B1 - FP8_add(&tb, &(y->a).a, &(y->a).b); // A2+B2 - FP8_norm(&ta); - FP8_norm(&tb); - FP8_mul(&tc, &ta, &tb); // (A1+B1)(A2+B2) - FP8_add(&t, &w1, &w2); - FP8_neg(&t, &t); - FP8_add(&tc, &tc, &t); // (A1+B1)(A2+B2)-A1.A2-B1*B2 = (A1.B2+A2.B1) - - FP8_add(&ta, &(w->a).a, &(w->b).a); // A1+C1 - FP8_add(&tb, &(y->a).a, &(y->b).a); // A2+C2 - FP8_norm(&ta); - FP8_norm(&tb); - FP8_mul(&td, &ta, &tb); // (A1+C1)(A2+C2) - FP8_add(&t, &w1, &w3); - FP8_neg(&t, &t); - FP8_add(&td, &td, &t); // (A1+C1)(A2+C2)-A1.A2-C1*C2 = (A1.C2+A2.C1) - - FP8_add(&ta, &(w->a).b, &(w->b).a); // B1+C1 - FP8_add(&tb, &(y->a).b, &(y->b).a); // B2+C2 - FP8_norm(&ta); - FP8_norm(&tb); - FP8_mul(&te, &ta, &tb); // (B1+C1)(B2+C2) - FP8_add(&t, &w2, &w3); - FP8_neg(&t, &t); - FP8_add(&te, &te, &t); // (B1+C1)(B2+C2)-B1.B2-C1*C2 = (B1.C2+B2.C1) - - FP8_times_i(&w2); - FP8_add(&w1, &w1, &w2); - FP16_from_FP8s(&(w->a), &w1, &tc); - FP16_from_FP8s(&(w->b), &td, &te); // only norm these 2 - FP16_from_FP8(&(w->c), &w3); - - FP16_norm(&(w->a)); - FP16_norm(&(w->b)); -#endif -#if SEXTIC_TWIST_ZZZ == M_TYPE - FP8_mul(&w1, &(w->a).a, &(y->a).a); // A1.A2 - FP8_mul(&w2, &(w->a).b, &(y->a).b); // B1.B2 - - if (y->type == FP_SPARSEST || w->type == FP_SPARSEST) - { - if (y->type == FP_SPARSEST && w->type == FP_SPARSEST) - { - FP8_zero(&w3); - FP_mul(&w3.a.a.a, &(w->c).b.a.a.a, &(y->c).b.a.a.a); - } else { - if (y->type != FP_SPARSEST) - FP8_tmul(&w3, &(y->c).b, &(w->c).b.a.a.a); - if (w->type != FP_SPARSEST) - FP8_tmul(&w3, &(w->c).b, &(y->c).b.a.a.a); - } - } - else - FP8_mul(&w3, &(w->c).b, &(y->c).b); // F1.F2 - - FP8_add(&ta, &(w->a).a, &(w->a).b); // A1+B1 - FP8_add(&tb, &(y->a).a, &(y->a).b); // A2+B2 - FP8_norm(&ta); - FP8_norm(&tb); - FP8_mul(&tc, &ta, &tb); // (A1+B1)(A2+B2) - FP8_add(&t, &w1, &w2); - FP8_neg(&t, &t); - FP8_add(&tc, &tc, &t); // (A1+B1)(A2+B2)-A1.A2-B1*B2 = (A1.B2+A2.B1) - - FP8_add(&ta, &(w->a).a, &(w->c).b); // A1+F1 - FP8_add(&tb, &(y->a).a, &(y->c).b); // A2+F2 - FP8_norm(&ta); - FP8_norm(&tb); - FP8_mul(&td, &ta, &tb); // (A1+F1)(A2+F2) - FP8_add(&t, &w1, &w3); - FP8_neg(&t, &t); - FP8_add(&td, &td, &t); // (A1+F1)(A2+F2)-A1.A2-F1*F2 = (A1.F2+A2.F1) - - FP8_add(&ta, &(w->a).b, &(w->c).b); // B1+F1 - FP8_add(&tb, &(y->a).b, &(y->c).b); // B2+F2 - FP8_norm(&ta); - FP8_norm(&tb); - FP8_mul(&te, &ta, &tb); // (B1+F1)(B2+F2) - FP8_add(&t, &w2, &w3); - FP8_neg(&t, &t); - FP8_add(&te, &te, &t); // (B1+F1)(B2+F2)-B1.B2-F1*F2 = (B1.F2+B2.F1) - - FP8_times_i(&w2); - FP8_add(&w1, &w1, &w2); - FP16_from_FP8s(&(w->a), &w1, &tc); - - FP8_times_i(&w3); - FP8_norm(&w3); - FP16_from_FP8H(&(w->b), &w3); - - FP8_norm(&te); - FP8_times_i(&te); - FP16_from_FP8s(&(w->c), &te, &td); - - FP16_norm(&(w->a)); - FP16_norm(&(w->c)); -#endif - - w->type = FP_SPARSE; -} - -/* Set w=1/x */ -/* SU= 600 */ -void YYY::FP48_inv(FP48 *w, FP48 *x) -{ - FP16 f0, f1, f2, f3; - - FP16_sqr(&f0, &(x->a)); - FP16_mul(&f1, &(x->b), &(x->c)); - FP16_times_i(&f1); - FP16_sub(&f0, &f0, &f1); /* y.a */ - FP16_norm(&f0); - - FP16_sqr(&f1, &(x->c)); - FP16_times_i(&f1); - FP16_mul(&f2, &(x->a), &(x->b)); - FP16_sub(&f1, &f1, &f2); /* y.b */ - FP16_norm(&f1); - - FP16_sqr(&f2, &(x->b)); - FP16_mul(&f3, &(x->a), &(x->c)); - FP16_sub(&f2, &f2, &f3); /* y.c */ - FP16_norm(&f2); - - FP16_mul(&f3, &(x->b), &f2); - FP16_times_i(&f3); - FP16_mul(&(w->a), &f0, &(x->a)); - FP16_add(&f3, &(w->a), &f3); - FP16_mul(&(w->c), &f1, &(x->c)); - FP16_times_i(&(w->c)); - - FP16_add(&f3, &(w->c), &f3); - FP16_norm(&f3); - - FP16_inv(&f3, &f3); - FP16_mul(&(w->a), &f0, &f3); - FP16_mul(&(w->b), &f1, &f3); - FP16_mul(&(w->c), &f2, &f3); - w->type = FP_DENSE; -} - -/* constant time powering by small integer of max length bts */ - -void YYY::FP48_pinpow(FP48 *r, int e, int bts) -{ - int i, b; - FP48 R[2]; - - FP48_one(&R[0]); - FP48_copy(&R[1], r); - - for (i = bts - 1; i >= 0; i--) - { - b = (e >> i) & 1; - FP48_mul(&R[1 - b], &R[b]); - FP48_usqr(&R[b], &R[b]); - } - FP48_copy(r, &R[0]); -} - -/* Compressed powering of unitary elements y=x^(e mod r) */ -/* -void YYY::FP48_compow(FP16 *c, FP48 *x, BIG e, BIG r) -{ - FP48 g1, g2; - FP16 cp, cpm1, cpm2; - FP2 f; - BIG q, a, b, m; - - BIG_rcopy(a, Fra); - BIG_rcopy(b, Frb); - FP2_from_BIGs(&f, a, b); - - BIG_rcopy(q, Modulus); - - FP48_copy(&g1, x); - FP48_copy(&g2, x); - - BIG_copy(m, q); - BIG_mod(m, r); - - BIG_copy(a, e); - BIG_mod(a, m); - - BIG_copy(b, e); - BIG_sdiv(b, m); - - FP48_trace(c, &g1); - - if (BIG_iszilch(b)) - { - FP16_xtr_pow(c, c, e); - return; - } - - FP48_frob(&g2, &f, 1); - FP48_trace(&cp, &g2); - FP48_conj(&g1, &g1); - FP48_mul(&g2, &g1); - FP48_trace(&cpm1, &g2); - FP48_mul(&g2, &g1); - - FP48_trace(&cpm2, &g2); - - FP16_xtr_pow2(c, &cp, c, &cpm1, &cpm2, a, b); - -} -*/ -/* Note this is simple square and multiply, so not side-channel safe */ - -void YYY::FP48_pow(FP48 *r, FP48 *a, BIG b) -{ - FP48 w, sf; - BIG b1, b3; - int i, nb, bt; - BIG_copy(b1, b); - BIG_norm(b1); - BIG_pmul(b3, b1, 3); - BIG_norm(b3); - - FP48_copy(&sf, a); - FP48_norm(&sf); - FP48_copy(&w, &sf); - - if (BIG_iszilch(b3)) - { - FP48_one(r); - return; - } - - nb = BIG_nbits(b3); - for (i = nb - 2; i >= 1; i--) - { - FP48_usqr(&w, &w); - bt = BIG_bit(b3, i) - BIG_bit(b1, i); - if (bt == 1) - FP48_mul(&w, &sf); - if (bt == -1) - { - FP48_conj(&sf, &sf); - FP48_mul(&w, &sf); - FP48_conj(&sf, &sf); - } - } - - FP48_copy(r, &w); - FP48_reduce(r); -} - -/* p=q0^u0.q1^u1.q2^u2.q3^u3... */ -/* Side channel attack secure */ -// Bos & Costello https://eprint.iacr.org/2013/458.pdf -// Faz-Hernandez & Longa & Sanchez https://eprint.iacr.org/2013/158.pdf - -void YYY::FP48_pow16(FP48 *p, FP48 *q, BIG u[16]) -{ - int i, j, k, nb, pb1, pb2, pb3, pb4, bt; - FP48 g1[8], g2[8], g3[8], g4[8], r; - BIG t[16], mt; - sign8 w1[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s1[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 w2[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s2[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 w3[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s3[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 w4[NLEN_XXX * BASEBITS_XXX + 1]; - sign8 s4[NLEN_XXX * BASEBITS_XXX + 1]; - - for (i = 0; i < 16; i++) - BIG_copy(t[i], u[i]); - -// Precomputed tables - FP48_copy(&g1[0], &q[0]); // q[0] - FP48_copy(&g1[1], &g1[0]); - FP48_mul(&g1[1], &q[1]); // q[0].q[1] - FP48_copy(&g1[2], &g1[0]); - FP48_mul(&g1[2], &q[2]); // q[0].q[2] - FP48_copy(&g1[3], &g1[1]); - FP48_mul(&g1[3], &q[2]); // q[0].q[1].q[2] - FP48_copy(&g1[4], &g1[0]); - FP48_mul(&g1[4], &q[3]); // q[0].q[3] - FP48_copy(&g1[5], &g1[1]); - FP48_mul(&g1[5], &q[3]); // q[0].q[1].q[3] - FP48_copy(&g1[6], &g1[2]); - FP48_mul(&g1[6], &q[3]); // q[0].q[2].q[3] - FP48_copy(&g1[7], &g1[3]); - FP48_mul(&g1[7], &q[3]); // q[0].q[1].q[2].q[3] - - FP48_copy(&g2[0], &q[4]); // q[0] - FP48_copy(&g2[1], &g2[0]); - FP48_mul(&g2[1], &q[5]); // q[0].q[1] - FP48_copy(&g2[2], &g2[0]); - FP48_mul(&g2[2], &q[6]); // q[0].q[2] - FP48_copy(&g2[3], &g2[1]); - FP48_mul(&g2[3], &q[6]); // q[0].q[1].q[2] - FP48_copy(&g2[4], &g2[0]); - FP48_mul(&g2[4], &q[7]); // q[0].q[3] - FP48_copy(&g2[5], &g2[1]); - FP48_mul(&g2[5], &q[7]); // q[0].q[1].q[3] - FP48_copy(&g2[6], &g2[2]); - FP48_mul(&g2[6], &q[7]); // q[0].q[2].q[3] - FP48_copy(&g2[7], &g2[3]); - FP48_mul(&g2[7], &q[7]); // q[0].q[1].q[2].q[3] - - FP48_copy(&g3[0], &q[8]); // q[0] - FP48_copy(&g3[1], &g3[0]); - FP48_mul(&g3[1], &q[9]); // q[0].q[1] - FP48_copy(&g3[2], &g3[0]); - FP48_mul(&g3[2], &q[10]); // q[0].q[2] - FP48_copy(&g3[3], &g3[1]); - FP48_mul(&g3[3], &q[10]); // q[0].q[1].q[2] - FP48_copy(&g3[4], &g3[0]); - FP48_mul(&g3[4], &q[11]); // q[0].q[3] - FP48_copy(&g3[5], &g3[1]); - FP48_mul(&g3[5], &q[11]); // q[0].q[1].q[3] - FP48_copy(&g3[6], &g3[2]); - FP48_mul(&g3[6], &q[11]); // q[0].q[2].q[3] - FP48_copy(&g3[7], &g3[3]); - FP48_mul(&g3[7], &q[11]); // q[0].q[1].q[2].q[3] - - FP48_copy(&g4[0], &q[12]); // q[0] - FP48_copy(&g4[1], &g4[0]); - FP48_mul(&g4[1], &q[13]); // q[0].q[1] - FP48_copy(&g4[2], &g4[0]); - FP48_mul(&g4[2], &q[14]); // q[0].q[2] - FP48_copy(&g4[3], &g4[1]); - FP48_mul(&g4[3], &q[14]); // q[0].q[1].q[2] - FP48_copy(&g4[4], &g4[0]); - FP48_mul(&g4[4], &q[15]); // q[0].q[3] - FP48_copy(&g4[5], &g4[1]); - FP48_mul(&g4[5], &q[15]); // q[0].q[1].q[3] - FP48_copy(&g4[6], &g4[2]); - FP48_mul(&g4[6], &q[15]); // q[0].q[2].q[3] - FP48_copy(&g4[7], &g4[3]); - FP48_mul(&g4[7], &q[15]); // q[0].q[1].q[2].q[3] - -// Make them odd - pb1 = 1 - BIG_parity(t[0]); - BIG_inc(t[0], pb1); - BIG_norm(t[0]); - - pb2 = 1 - BIG_parity(t[4]); - BIG_inc(t[4], pb2); - BIG_norm(t[4]); - - pb3 = 1 - BIG_parity(t[8]); - BIG_inc(t[8], pb3); - BIG_norm(t[8]); - - pb4 = 1 - BIG_parity(t[12]); - BIG_inc(t[12], pb4); - BIG_norm(t[12]); - -// Number of bits - BIG_zero(mt); - for (i = 0; i < 16; i++) - { - BIG_or(mt, mt, t[i]); - } - nb = 1 + BIG_nbits(mt); - -// Sign pivot - s1[nb - 1] = 1; - s2[nb - 1] = 1; - s3[nb - 1] = 1; - s4[nb - 1] = 1; - for (i = 0; i < nb - 1; i++) - { - BIG_fshr(t[0], 1); - s1[i] = 2 * BIG_parity(t[0]) - 1; - BIG_fshr(t[4], 1); - s2[i] = 2 * BIG_parity(t[4]) - 1; - BIG_fshr(t[8], 1); - s3[i] = 2 * BIG_parity(t[8]) - 1; - BIG_fshr(t[12], 1); - s4[i] = 2 * BIG_parity(t[12]) - 1; - } - -// Recoded exponents - for (i = 0; i < nb; i++) - { - w1[i] = 0; - k = 1; - for (j = 1; j < 4; j++) - { - bt = s1[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w1[i] += bt * k; - k *= 2; - } - - w2[i] = 0; - k = 1; - for (j = 5; j < 8; j++) - { - bt = s2[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w2[i] += bt * k; - k *= 2; - } - - w3[i] = 0; - k = 1; - for (j = 9; j < 12; j++) - { - bt = s3[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w3[i] += bt * k; - k *= 2; - } - - w4[i] = 0; - k = 1; - for (j = 13; j < 16; j++) - { - bt = s4[i] * BIG_parity(t[j]); - BIG_fshr(t[j], 1); - - BIG_dec(t[j], (bt >> 1)); - BIG_norm(t[j]); - w4[i] += bt * k; - k *= 2; - } - } - -// Main loop - FP48_select(p, g1, 2 * w1[nb - 1] + 1); - FP48_select(&r, g2, 2 * w2[nb - 1] + 1); - FP48_mul(p, &r); - FP48_select(&r, g3, 2 * w3[nb - 1] + 1); - FP48_mul(p, &r); - FP48_select(&r, g4, 2 * w4[nb - 1] + 1); - FP48_mul(p, &r); - for (i = nb - 2; i >= 0; i--) - { - FP48_usqr(p, p); - FP48_select(&r, g1, 2 * w1[i] + s1[i]); - FP48_mul(p, &r); - FP48_select(&r, g2, 2 * w2[i] + s2[i]); - FP48_mul(p, &r); - FP48_select(&r, g3, 2 * w3[i] + s3[i]); - FP48_mul(p, &r); - FP48_select(&r, g4, 2 * w4[i] + s4[i]); - FP48_mul(p, &r); - } - -// apply correction - FP48_conj(&r, &q[0]); - FP48_mul(&r, p); - FP48_cmove(p, &r, pb1); - FP48_conj(&r, &q[4]); - FP48_mul(&r, p); - FP48_cmove(p, &r, pb2); - - FP48_conj(&r, &q[8]); - FP48_mul(&r, p); - FP48_cmove(p, &r, pb3); - FP48_conj(&r, &q[12]); - FP48_mul(&r, p); - FP48_cmove(p, &r, pb4); - - FP48_reduce(p); -} - -/* Set w=w^p using Frobenius */ -/* SU= 160 */ -void YYY::FP48_frob(FP48 *w, FP2 *f, int n) -{ - int i; - FP8 X2, X4; - FP4 F; - FP2 f3, f2; // f=(1+i)^(p-19)/24 - FP2_sqr(&f2, f); // - FP2_mul(&f3, &f2, f); // f3=f^3=(1+i)^(p-19)/8 - - FP2_mul_ip(&f3); - FP2_norm(&f3); - FP2_mul_ip(&f3); // f3 = (1+i)^16/8.(1+i)^(p-19)/8 = (1+i)^(p-3)/8 - FP2_norm(&f3); - - for (i = 0; i < n; i++) - { - FP16_frob(&(w->a), &f3); // a=a^p - FP16_frob(&(w->b), &f3); // b=b^p - FP16_frob(&(w->c), &f3); // c=c^p - - FP16_qmul(&(w->b), &(w->b), f); FP16_times_i4(&(w->b)); FP16_times_i2(&(w->b)); - FP16_qmul(&(w->c), &(w->c), &f2); FP16_times_i4(&(w->c)); FP16_times_i4(&(w->c)); FP16_times_i4(&(w->c)); - } - w->type = FP_DENSE; -} - -/* SU= 8 */ -/* normalise all components of w */ -void YYY::FP48_norm(FP48 *w) -{ - FP16_norm(&(w->a)); - FP16_norm(&(w->b)); - FP16_norm(&(w->c)); -} - -/* SU= 8 */ -/* reduce all components of w */ -void YYY::FP48_reduce(FP48 *w) -{ - FP16_reduce(&(w->a)); - FP16_reduce(&(w->b)); - FP16_reduce(&(w->c)); -} - -/* trace function w=trace(x) */ -/* SU= 8 */ -void YYY::FP48_trace(FP16 *w, FP48 *x) -{ - FP16_imul(w, &(x->a), 3); - FP16_reduce(w); -} - -/* SU= 8 */ -/* Output w in hex */ -void YYY::FP48_output(FP48 *w) -{ - printf("["); - FP16_output(&(w->a)); - printf(","); - FP16_output(&(w->b)); - printf(","); - FP16_output(&(w->c)); - printf("]"); -} - -/* Convert g to octet string w */ -void YYY::FP48_toOctet(octet *W, FP48 *g) -{ - W->len = 48 * MODBYTES_XXX; - FP16_toBytes(&(W->val[0]),&(g->c)); - FP16_toBytes(&(W->val[16 * MODBYTES_XXX]),&(g->b)); - FP16_toBytes(&(W->val[32 * MODBYTES_XXX]),&(g->a)); -} - -/* Restore g from octet string w */ -void YYY::FP48_fromOctet(FP48 *g, octet *W) -{ - FP16_fromBytes(&(g->c),&(W->val[0])); - FP16_fromBytes(&(g->b),&(W->val[16 * MODBYTES_XXX])); - FP16_fromBytes(&(g->a),&(W->val[32 * MODBYTES_XXX])); -} - -/* Move b to a if d=1 */ -void YYY::FP48_cmove(FP48 *f, FP48 *g, int d) -{ - FP16_cmove(&(f->a), &(g->a), d); - FP16_cmove(&(f->b), &(g->b), d); - FP16_cmove(&(f->c), &(g->c), d); - d = ~(d - 1); - f->type ^= (f->type ^ g->type)&d; -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8.cpp deleted file mode 100644 index d6a628c..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/fp8.cpp +++ /dev/null @@ -1,732 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE Fp^8 functions */ - -/* FP8 elements are of the form a+ib, where i is sqrt(sqrt(-1+sqrt(-1))) */ - -#include "fp8_YYY.h" - -using namespace XXX; - -/* test x==0 ? */ -int YYY::FP8_iszilch(FP8 *x) -{ - return (FP4_iszilch(&(x->a)) & FP4_iszilch(&(x->b))); -} - -/* test x==1 ? */ -int YYY::FP8_isunity(FP8 *x) -{ - return (FP4_isunity(&(x->a)) & FP4_iszilch(&(x->b))); -} - -/* test is w real? That is in a+ib test b is zero */ -int YYY::FP8_isreal(FP8 *w) -{ - return FP4_iszilch(&(w->b)); -} - -// Is x lexically larger than p-x? -// return -1 for no, 0 if x=0, 1 for yes -int YYY::FP8_islarger(FP8 *x) -{ - int cmp; - if (FP8_iszilch(x)) return 0; - cmp=FP4_islarger(&(x->b)); - if (cmp!=0) return cmp; - return FP4_islarger(&(x->a)); -} - -void YYY::FP8_toBytes(char *b,FP8 *x) -{ - FP4_toBytes(b,&(x->b)); - FP4_toBytes(&b[4*MODBYTES_XXX],&(x->a)); -} - -void YYY::FP8_fromBytes(FP8 *x,char *b) -{ - FP4_fromBytes(&(x->b),b); - FP4_fromBytes(&(x->a),&b[4*MODBYTES_XXX]); -} - -/* return 1 if x==y, else 0 */ -int YYY::FP8_equals(FP8 *x, FP8 *y) -{ - return (FP4_equals(&(x->a), &(y->a)) & FP4_equals(&(x->b), &(y->b))); -} - -/* set FP8 from two FP4s */ -void YYY::FP8_from_FP4s(FP8 *w, FP4 * x, FP4* y) -{ - FP4_copy(&(w->a), x); - FP4_copy(&(w->b), y); -} - -/* set FP8 from FP4 */ -void YYY::FP8_from_FP4(FP8 *w, FP4 *x) -{ - FP4_copy(&(w->a), x); - FP4_zero(&(w->b)); -} - -/* set high part of FP8 from FP4 */ -void YYY::FP8_from_FP4H(FP8 *w, FP4 *x) -{ - FP4_copy(&(w->b), x); - FP4_zero(&(w->a)); -} - -/* set FP8 from FP */ -void YYY::FP8_from_FP(FP8 *w, FP *x) -{ - FP2 t; - FP4 t4; - FP2_from_FP(&t, x); - FP4_from_FP2(&t4, &t); - FP8_from_FP4(w, &t4); -} - -/* FP8 copy w=x */ -void YYY::FP8_copy(FP8 *w, FP8 *x) -{ - if (w == x) return; - FP4_copy(&(w->a), &(x->a)); - FP4_copy(&(w->b), &(x->b)); -} - -/* FP8 w=0 */ -void YYY::FP8_zero(FP8 *w) -{ - FP4_zero(&(w->a)); - FP4_zero(&(w->b)); -} - -/* FP8 w=1 */ -void YYY::FP8_one(FP8 *w) -{ - FP4_one(&(w->a)); - FP4_zero(&(w->b)); -} - -int YYY::FP8_sign(FP8 *w) -{ - int p1,p2; - p1=FP4_sign(&(w->a)); - p2=FP4_sign(&(w->b)); -#ifdef BIG_ENDIAN_SIGN_YYY - p2 ^= (p1 ^ p2)&FP4_iszilch(&(w->b)); - return p2; -#else - p1 ^= (p1 ^ p2)&FP4_iszilch(&(w->a)); - return p1; -#endif - -} - -/* Set w=-x */ -void YYY::FP8_neg(FP8 *w, FP8 *x) -{ - /* Just one field neg */ - FP4 m, t; - FP8_norm(x); - FP4_add(&m, &(x->a), &(x->b)); - FP4_norm(&m); - FP4_neg(&m, &m); - FP4_add(&t, &m, &(x->b)); - FP4_add(&(w->b), &m, &(x->a)); - FP4_copy(&(w->a), &t); - FP8_norm(w); -} - -/* Set w=conj(x) */ -void YYY::FP8_conj(FP8 *w, FP8 *x) -{ - FP4_copy(&(w->a), &(x->a)); - FP4_neg(&(w->b), &(x->b)); - FP8_norm(w); -} - -/* Set w=-conj(x) */ -void YYY::FP8_nconj(FP8 *w, FP8 *x) -{ - FP4_copy(&(w->b), &(x->b)); - FP4_neg(&(w->a), &(x->a)); - FP8_norm(w); -} - -/* Set w=x+y */ -void YYY::FP8_add(FP8 *w, FP8 *x, FP8 *y) -{ - FP4_add(&(w->a), &(x->a), &(y->a)); - FP4_add(&(w->b), &(x->b), &(y->b)); -} - -/* Set w=x-y */ -/* Input y MUST be normed */ -void YYY::FP8_sub(FP8 *w, FP8 *x, FP8 *y) -{ - FP8 my; - - FP8_neg(&my, y); - FP8_add(w, x, &my); - -} - -/* reduce all components of w mod Modulus */ -void YYY::FP8_reduce(FP8 *w) -{ - FP4_reduce(&(w->a)); - FP4_reduce(&(w->b)); -} - -/* normalise all elements of w */ -void YYY::FP8_norm(FP8 *w) -{ - FP4_norm(&(w->a)); - FP4_norm(&(w->b)); -} - -/* Set w=s*x, where s is FP4 */ -void YYY::FP8_pmul(FP8 *w, FP8 *x, FP4 *s) -{ - FP4_mul(&(w->a), &(x->a), s); - FP4_mul(&(w->b), &(x->b), s); -} - -/* Set w=s*x, where s is FP2 */ -void YYY::FP8_qmul(FP8 *w, FP8 *x, FP2 *s) -{ - FP4_pmul(&(w->a), &(x->a), s); - FP4_pmul(&(w->b), &(x->b), s); -} - -/* Set w=s*x, where s is FP */ -void YYY::FP8_tmul(FP8 *w, FP8 *x, FP *s) -{ - FP4_qmul(&(w->a), &(x->a), s); - FP4_qmul(&(w->b), &(x->b), s); -} - -/* Set w=s*x, where s is int */ -void YYY::FP8_imul(FP8 *w, FP8 *x, int s) -{ - FP4_imul(&(w->a), &(x->a), s); - FP4_imul(&(w->b), &(x->b), s); -} - -/* Set w=x^2 */ -/* Input MUST be normed */ -void YYY::FP8_sqr(FP8 *w, FP8 *x) -{ - FP4 t1, t2, t3; - - FP4_mul(&t3, &(x->a), &(x->b)); /* norms x */ - FP4_copy(&t2, &(x->b)); - FP4_add(&t1, &(x->a), &(x->b)); - FP4_times_i(&t2); - - FP4_add(&t2, &(x->a), &t2); - - FP4_norm(&t1); // 2 - FP4_norm(&t2); // 2 - - FP4_mul(&(w->a), &t1, &t2); - - FP4_copy(&t2, &t3); - FP4_times_i(&t2); - - FP4_add(&t2, &t2, &t3); - - FP4_norm(&t2); // 2 - FP4_neg(&t2, &t2); - FP4_add(&(w->a), &(w->a), &t2); /* a=(a+b)(a+i^2.b)-i^2.ab-ab = a*a+ib*ib */ - FP4_add(&(w->b), &t3, &t3); /* b=2ab */ - - FP8_norm(w); -} - -/* Set w=x*y */ -/* Inputs MUST be normed */ -void YYY::FP8_mul(FP8 *w, FP8 *x, FP8 *y) -{ - - FP4 t1, t2, t3, t4; - - FP4_mul(&t1, &(x->a), &(y->a)); - FP4_mul(&t2, &(x->b), &(y->b)); - FP4_add(&t3, &(y->b), &(y->a)); - FP4_add(&t4, &(x->b), &(x->a)); - - FP4_norm(&t4); // 2 - FP4_norm(&t3); // 2 - - FP4_mul(&t4, &t4, &t3); /* (xa+xb)(ya+yb) */ - FP4_neg(&t3, &t1); // 1 - FP4_add(&t4, &t4, &t3); //t4E=3 - FP4_norm(&t4); - - FP4_neg(&t3, &t2); // 1 - FP4_add(&(w->b), &t4, &t3); //wbE=3 - - FP4_times_i(&t2); - FP4_add(&(w->a), &t2, &t1); - - FP8_norm(w); -} - -/* output FP8 in format [a,b] */ -void YYY::FP8_output(FP8 *w) -{ - printf("["); - FP4_output(&(w->a)); - printf(","); - FP4_output(&(w->b)); - printf("]"); -} - -void YYY::FP8_rawoutput(FP8 *w) -{ - printf("["); - FP4_rawoutput(&(w->a)); - printf(","); - FP4_rawoutput(&(w->b)); - printf("]"); -} - -/* Set w=1/x */ -void YYY::FP8_inv(FP8 *w, FP8 *x, FP *h) -{ - FP4 t1, t2; - FP4_sqr(&t1, &(x->a)); - FP4_sqr(&t2, &(x->b)); - FP4_times_i(&t2); - FP4_norm(&t2); - - FP4_sub(&t1, &t1, &t2); - FP4_norm(&t1); - FP4_inv(&t1, &t1, h); - - FP4_mul(&(w->a), &t1, &(x->a)); - FP4_neg(&t1, &t1); - FP4_norm(&t1); - FP4_mul(&(w->b), &t1, &(x->b)); -} - -/* w*=i where i = sqrt(sqrt(-1+sqrt(-1))) */ -void YYY::FP8_times_i(FP8 *w) -{ - FP4 s, t; - FP4_copy(&s, &(w->b)); - FP4_copy(&t, &(w->a)); - FP4_times_i(&s); - FP4_copy(&(w->a), &s); - FP4_copy(&(w->b), &t); - FP8_norm(w); -#if TOWER_YYY == POSITOWER - FP8_neg(w, w); // *** - FP8_norm(w); -#endif -} - -void YYY::FP8_times_i2(FP8 *w) -{ - FP4_times_i(&(w->a)); - FP4_times_i(&(w->b)); -} - -/* Set w=w^p using Frobenius */ -void YYY::FP8_frob(FP8 *w, FP2 *f) -{ // f=(i+1)^(p-3)/4 - FP2 ff; - FP2_sqr(&ff, f); // (i+1)^(p-3)/2 - FP2_mul_ip(&ff); // (i+1)^(p-1)/2 - FP2_norm(&ff); - FP4_frob(&(w->a), &ff); - FP4_frob(&(w->b), &ff); - FP4_pmul(&(w->b), &(w->b), f); // times (1+i)^(p-3)/4 - FP4_times_i(&(w->b)); // (i+1)^(p-1)/4 -} - -/* Set r=a^b mod m */ -/* -void YYY::FP8_pow(FP8 *r, FP8* a, BIG b) -{ - FP8 w; - BIG z, zilch; - int bt; - - BIG_zero(zilch); - - BIG_copy(z, b); - FP8_copy(&w, a); - FP8_one(r); - BIG_norm(z); - - while (1) - { - bt = BIG_parity(z); - BIG_shr(z, 1); - if (bt) FP8_mul(r, r, &w); - if (BIG_comp(z, zilch) == 0) break; - FP8_sqr(&w, &w); - } - FP8_reduce(r); -}*/ -/* -#if CURVE_SECURITY_ZZZ == 192 -*/ -/* XTR xtr_a function */ -/* -void YYY::FP8_xtr_A(FP8 *r, FP8 *w, FP8 *x, FP8 *y, FP8 *z) -{ - FP8 t1, t2; - - FP8_copy(r, x); - FP8_sub(&t1, w, y); - FP8_norm(&t1); - FP8_pmul(&t1, &t1, &(r->a)); - FP8_add(&t2, w, y); - FP8_norm(&t2); - FP8_pmul(&t2, &t2, &(r->b)); - FP8_times_i(&t2); - - FP8_add(r, &t1, &t2); - FP8_add(r, r, z); - - FP8_reduce(r); -} -*/ -/* XTR xtr_d function */ -/* -void YYY::FP8_xtr_D(FP8 *r, FP8 *x) -{ - FP8 w; - FP8_copy(r, x); - FP8_conj(&w, r); - FP8_add(&w, &w, &w); - FP8_sqr(r, r); - FP8_norm(&w); - FP8_sub(r, r, &w); - FP8_reduce(r); // reduce here as multiple calls trigger automatic reductions -} -*/ -/* r=x^n using XTR method on traces of FP24s */ -/* -void YYY::FP8_xtr_pow(FP8 *r, FP8 *x, BIG n) -{ - int i, par, nb; - BIG v; - FP2 w2; - FP4 w4; - FP8 t, a, b, c, sf; - - BIG_zero(v); - BIG_inc(v, 3); - BIG_norm(v); - FP2_from_BIG(&w2, v); - FP4_from_FP2(&w4, &w2); - FP8_from_FP4(&a, &w4); - - FP8_copy(&sf, x); - FP8_norm(&sf); - FP8_copy(&b, &sf); - FP8_xtr_D(&c, &sf); - - par = BIG_parity(n); - BIG_copy(v, n); - BIG_norm(v); - BIG_shr(v, 1); - if (par == 0) - { - BIG_dec(v, 1); - BIG_norm(v); - } - - nb = BIG_nbits(v); - for (i = nb - 1; i >= 0; i--) - { - if (!BIG_bit(v, i)) - { - FP8_copy(&t, &b); - FP8_conj(&sf, &sf); - FP8_conj(&c, &c); - FP8_xtr_A(&b, &a, &b, &sf, &c); - FP8_conj(&sf, &sf); - FP8_xtr_D(&c, &t); - FP8_xtr_D(&a, &a); - } - else - { - FP8_conj(&t, &a); - FP8_xtr_D(&a, &b); - FP8_xtr_A(&b, &c, &b, &sf, &t); - FP8_xtr_D(&c, &c); - } - } - - if (par == 0) FP8_copy(r, &c); - else FP8_copy(r, &b); - FP8_reduce(r); -} -*/ -/* r=ck^a.cl^n using XTR double exponentiation method on traces of FP24s. See Stam thesis. */ -/* -void YYY::FP8_xtr_pow2(FP8 *r, FP8 *ck, FP8 *cl, FP8 *ckml, FP8 *ckm2l, BIG a, BIG b) -{ - int i, f2; - BIG d, e, w; - FP8 t, cu, cv, cumv, cum2v; - - - BIG_copy(e, a); - BIG_copy(d, b); - BIG_norm(e); - BIG_norm(d); - - FP8_copy(&cu, ck); - FP8_copy(&cv, cl); - FP8_copy(&cumv, ckml); - FP8_copy(&cum2v, ckm2l); - - f2 = 0; - while (BIG_parity(d) == 0 && BIG_parity(e) == 0) - { - BIG_shr(d, 1); - BIG_shr(e, 1); - f2++; - } - while (BIG_comp(d, e) != 0) - { - if (BIG_comp(d, e) > 0) - { - BIG_imul(w, e, 4); - BIG_norm(w); - if (BIG_comp(d, w) <= 0) - { - BIG_copy(w, d); - BIG_copy(d, e); - BIG_sub(e, w, e); - BIG_norm(e); - FP8_xtr_A(&t, &cu, &cv, &cumv, &cum2v); - FP8_conj(&cum2v, &cumv); - FP8_copy(&cumv, &cv); - FP8_copy(&cv, &cu); - FP8_copy(&cu, &t); - } - else if (BIG_parity(d) == 0) - { - BIG_shr(d, 1); - FP8_conj(r, &cum2v); - FP8_xtr_A(&t, &cu, &cumv, &cv, r); - FP8_xtr_D(&cum2v, &cumv); - FP8_copy(&cumv, &t); - FP8_xtr_D(&cu, &cu); - } - else if (BIG_parity(e) == 1) - { - BIG_sub(d, d, e); - BIG_norm(d); - BIG_shr(d, 1); - FP8_xtr_A(&t, &cu, &cv, &cumv, &cum2v); - FP8_xtr_D(&cu, &cu); - FP8_xtr_D(&cum2v, &cv); - FP8_conj(&cum2v, &cum2v); - FP8_copy(&cv, &t); - } - else - { - BIG_copy(w, d); - BIG_copy(d, e); - BIG_shr(d, 1); - BIG_copy(e, w); - FP8_xtr_D(&t, &cumv); - FP8_conj(&cumv, &cum2v); - FP8_conj(&cum2v, &t); - FP8_xtr_D(&t, &cv); - FP8_copy(&cv, &cu); - FP8_copy(&cu, &t); - } - } - if (BIG_comp(d, e) < 0) - { - BIG_imul(w, d, 4); - BIG_norm(w); - if (BIG_comp(e, w) <= 0) - { - BIG_sub(e, e, d); - BIG_norm(e); - FP8_xtr_A(&t, &cu, &cv, &cumv, &cum2v); - FP8_copy(&cum2v, &cumv); - FP8_copy(&cumv, &cu); - FP8_copy(&cu, &t); - } - else if (BIG_parity(e) == 0) - { - BIG_copy(w, d); - BIG_copy(d, e); - BIG_shr(d, 1); - BIG_copy(e, w); - FP8_xtr_D(&t, &cumv); - FP8_conj(&cumv, &cum2v); - FP8_conj(&cum2v, &t); - FP8_xtr_D(&t, &cv); - FP8_copy(&cv, &cu); - FP8_copy(&cu, &t); - } - else if (BIG_parity(d) == 1) - { - BIG_copy(w, e); - BIG_copy(e, d); - BIG_sub(w, w, d); - BIG_norm(w); - BIG_copy(d, w); - BIG_shr(d, 1); - FP8_xtr_A(&t, &cu, &cv, &cumv, &cum2v); - FP8_conj(&cumv, &cumv); - FP8_xtr_D(&cum2v, &cu); - FP8_conj(&cum2v, &cum2v); - FP8_xtr_D(&cu, &cv); - FP8_copy(&cv, &t); - } - else - { - BIG_shr(d, 1); - FP8_conj(r, &cum2v); - FP8_xtr_A(&t, &cu, &cumv, &cv, r); - FP8_xtr_D(&cum2v, &cumv); - FP8_copy(&cumv, &t); - FP8_xtr_D(&cu, &cu); - } - } - } - FP8_xtr_A(r, &cu, &cv, &cumv, &cum2v); - for (i = 0; i < f2; i++) FP8_xtr_D(r, r); - FP8_xtr_pow(r, r, d); -} - -#endif -*/ - -/* New stuff for ECp8 support */ - -/* Set w=x/2 */ -void YYY::FP8_div2(FP8 *w, FP8 *x) -{ - FP4_div2(&(w->a), &(x->a)); - FP4_div2(&(w->b), &(x->b)); -} - -/* Move b to a if d=1 */ -void YYY::FP8_cmove(FP8 *f, FP8 *g, int d) -{ - FP4_cmove(&(f->a), &(g->a), d); - FP4_cmove(&(f->b), &(g->b), d); -} - -void YYY::FP8_rand(FP8 *x,csprng *rng) -{ - FP4_rand(&(x->a),rng); - FP4_rand(&(x->b),rng); -} - -#if PAIRING_FRIENDLY_ZZZ == BLS48_CURVE - -/* test for x a QR */ -int YYY::FP8_qr(FP8 *x,FP *h) -{ /* test x^(p^4-1)/2 = 1 */ - FP8 c; - FP8_conj(&c,x); - FP8_mul(&c,&c,x); - - return FP4_qr(&(c.a),h); -} - -/* sqrt(a+xb) = sqrt((a+sqrt(a*a-n*b*b))/2)+x.b/(2*sqrt((a+sqrt(a*a-n*b*b))/2)) */ - -void YYY::FP8_sqrt(FP8 *r, FP8* x, FP *h) -{ - FP4 a, b, s, t; - FP8 nr; - FP hint,twk; - int sgn,qr; - FP8_copy(r, x); - if (FP8_iszilch(x)) return; - - FP4_copy(&a, &(x->a)); - FP4_copy(&s, &(x->b)); - - FP4_sqr(&s, &s); // s*=s - FP4_sqr(&a, &a); // a*=a - FP4_times_i(&s); - FP4_norm(&s); - FP4_sub(&a, &a, &s); // a-=txx(s) - FP4_norm(&a); // ** - FP4_sqrt(&s, &a, h); - - FP4_copy(&t, &(x->a)); - FP4_add(&a, &t, &s); - FP4_norm(&a); - FP4_div2(&a, &a); - - FP4_div2(&b,&(r->b)); // w1=b/2 - qr=FP4_qr(&a,&hint); // only exp! Cost=+1 - -// tweak hint - multiply old hint by Norm(1/Beta)^e where Beta is irreducible polynomial - FP4_copy(&s,&a); - FP_rcopy(&twk,TWK); - FP_mul(&twk,&twk,&hint); - FP4_div_i(&s); FP4_norm(&s); // switch to other candidate - - FP4_cmove(&a,&s,1-qr); - FP_cmove(&hint,&twk,1-qr); - - FP4_sqrt(&(r->a),&a,&hint); // a=sqrt(w2) Cost=+1 - FP4_inv(&s,&a,&hint); // w3=1/w2 - FP4_mul(&s,&s,&(r->a)); // w3=1/sqrt(w2) - FP4_mul(&(r->b),&s,&b); // b=(b/2)*1/sqrt(w2) - FP4_copy(&t,&(r->a)); - - FP4_cmove(&(r->a),&(r->b),1-qr); - FP4_cmove(&(r->b),&t,1-qr); - - sgn=FP8_sign(r); - FP8_neg(&nr,r); FP8_norm(&nr); - FP8_cmove(r,&nr,sgn); -} - -void YYY::FP8_div_i(FP8 *f) -{ - FP4 u, v; - FP4_copy(&u, &(f->a)); - FP4_copy(&v, &(f->b)); - - FP4_div_i(&u); - - FP4_copy(&(f->a), &v); - FP4_copy(&(f->b), &u); -#if TOWER_YYY == POSITOWER - FP8_neg(f, f); // *** - FP8_norm(f); -#endif -} - - - -#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/gcm.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/gcm.cpp deleted file mode 100644 index 843ab0f..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/gcm.cpp +++ /dev/null @@ -1,440 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Implementation of the AES-GCM Encryption/Authentication - * - * Some restrictions.. - * 1. Only for use with AES - * 2. Returned tag is always 128-bits. Truncate at your own risk. - * 3. The order of function calls must follow some rules - * - * Typical sequence of calls.. - * 1. call GCM_init - * 2. call GCM_add_header any number of times, as long as length of header is multiple of 16 bytes (block size) - * 3. call GCM_add_header one last time with any length of header - * 4. call GCM_add_cipher any number of times, as long as length of cipher/plaintext is multiple of 16 bytes - * 5. call GCM_add_cipher one last time with any length of cipher/plaintext - * 6. call GCM_finish to extract the tag. - * - * See http://www.mindspring.com/~dmcgrew/gcm-nist-6.pdf - */ -/* SU=m, m is Stack Usage */ - -#include -#include -#include "arch.h" -#include "core.h" - -using namespace core; - -#define NB 4 -#define MR_TOBYTE(x) ((uchar)((x))) - -static unsign32 pack(const uchar *b) -{ - /* pack bytes into a 32-bit Word */ - return ((unsign32)b[0] << 24) | ((unsign32)b[1] << 16) | ((unsign32)b[2] << 8) | (unsign32)b[3]; -} - -static void unpack(unsign32 a, uchar *b) -{ - /* unpack bytes from a word */ - b[3] = MR_TOBYTE(a); - b[2] = MR_TOBYTE(a >> 8); - b[1] = MR_TOBYTE(a >> 16); - b[0] = MR_TOBYTE(a >> 24); -} - -static void precompute(gcm *g, uchar *H) -{ - /* precompute small 2k bytes gf2m table of x^n.H */ - int i, j; - unsign32 *last, *next, b; - - for (i = j = 0; i < NB; i++, j += 4) g->table[0][i] = pack((uchar *)&H[j]); - - for (i = 1; i < 128; i++) - { - next = g->table[i]; - last = g->table[i - 1]; - b = 0; - for (j = 0; j < NB; j++) - { - next[j] = b | (last[j]) >> 1; - b = last[j] << 31; - } - if (b) next[0] ^= 0xE1000000; /* irreducible polynomial */ - } -} - -/* SU= 32 */ -static void gf2mul(gcm *g) -{ - /* gf2m mul - Z=H*X mod 2^128 */ - int i, j, m, k; - unsign32 P[4]; - unsign32 b; - - P[0] = P[1] = P[2] = P[3] = 0; - j = 8; - m = 0; - for (i = 0; i < 128; i++) - { - b = (unsign32)(g->stateX[m] >> (--j)) & 1; - b = ~b + 1; - for (k = 0; k < NB; k++) P[k] ^= (g->table[i][k] & b); - if (j == 0) - { - j = 8; - m++; - if (m == 16) break; - } - } - for (i = j = 0; i < NB; i++, j += 4) unpack(P[i], (uchar *)&g->stateX[j]); -} - -/* SU= 32 */ -static void GCM_wrap(gcm *g) -{ - /* Finish off GHASH */ - int i, j; - unsign32 F[4]; - uchar L[16]; - - /* convert lengths from bytes to bits */ - F[0] = (g->lenA[0] << 3) | (g->lenA[1] & 0xE0000000) >> 29; - F[1] = g->lenA[1] << 3; - F[2] = (g->lenC[0] << 3) | (g->lenC[1] & 0xE0000000) >> 29; - F[3] = g->lenC[1] << 3; - for (i = j = 0; i < NB; i++, j += 4) unpack(F[i], (uchar *)&L[j]); - - for (i = 0; i < 16; i++) g->stateX[i] ^= L[i]; - gf2mul(g); -} - -static int GCM_ghash(gcm *g, char *plain, int len) -{ - int i, j = 0; - if (g->status == GCM_ACCEPTING_HEADER) g->status = GCM_ACCEPTING_CIPHER; - if (g->status != GCM_ACCEPTING_CIPHER) return 0; - - while (j < len) - { - for (i = 0; i < 16 && j < len; i++) - { - g->stateX[i] ^= plain[j++]; - g->lenC[1]++; - if (g->lenC[1] == 0) g->lenC[0]++; - } - gf2mul(g); - } - if (len % 16 != 0) g->status = GCM_NOT_ACCEPTING_MORE; - return 1; -} - -/* SU= 48 */ -/* Initialize GCM mode */ -void core::GCM_init(gcm* g, int nk, char *key, int niv, char *iv) -{ - /* iv size niv is usually 12 bytes (96 bits). AES key size nk can be 16,24 or 32 bytes */ - int i; - uchar H[16]; - for (i = 0; i < 16; i++) - { - H[i] = 0; - g->stateX[i] = 0; - } - - AES_init(&(g->a), ECB, nk, key, iv); - AES_ecb_encrypt(&(g->a), H); /* E(K,0) */ - precompute(g, H); - - g->lenA[0] = g->lenC[0] = g->lenA[1] = g->lenC[1] = 0; - if (niv == 12) - { - for (i = 0; i < 12; i++) g->a.f[i] = iv[i]; - unpack((unsign32)1, (uchar *) & (g->a.f[12])); /* initialise IV */ - for (i = 0; i < 16; i++) g->Y_0[i] = g->a.f[i]; - } - else - { - g->status = GCM_ACCEPTING_CIPHER; - GCM_ghash(g, iv, niv); /* GHASH(H,0,IV) */ - GCM_wrap(g); - for (i = 0; i < 16; i++) - { - g->a.f[i] = g->stateX[i]; - g->Y_0[i] = g->a.f[i]; - g->stateX[i] = 0; - } - g->lenA[0] = g->lenC[0] = g->lenA[1] = g->lenC[1] = 0; - } - g->status = GCM_ACCEPTING_HEADER; -} - -/* SU= 24 */ -/* Add Header data - included but not encrypted */ -int core::GCM_add_header(gcm* g, char *header, int len) -{ - /* Add some header. Won't be encrypted, but will be authenticated. len is length of header */ - int i, j = 0; - if (g->status != GCM_ACCEPTING_HEADER) return 0; - - while (j < len) - { - for (i = 0; i < 16 && j < len; i++) - { - g->stateX[i] ^= header[j++]; - g->lenA[1]++; - if (g->lenA[1] == 0) g->lenA[0]++; - } - gf2mul(g); - } - if (len % 16 != 0) g->status = GCM_ACCEPTING_CIPHER; - return 1; -} - -/* SU= 48 */ -/* Add Plaintext - included and encrypted */ -int core::GCM_add_plain(gcm *g, char *cipher, char *plain, int len) -{ - /* Add plaintext to extract ciphertext, len is length of plaintext. */ - int i, j = 0; - unsign32 counter; - uchar B[16]; - if (g->status == GCM_ACCEPTING_HEADER) g->status = GCM_ACCEPTING_CIPHER; - if (g->status != GCM_ACCEPTING_CIPHER) return 0; - - while (j < len) - { - counter = pack((uchar *) & (g->a.f[12])); - counter++; - unpack(counter, (uchar *) & (g->a.f[12])); /* increment counter */ - for (i = 0; i < 16; i++) B[i] = g->a.f[i]; - AES_ecb_encrypt(&(g->a), B); /* encrypt it */ - - for (i = 0; i < 16 && j < len; i++) - { - cipher[j] = plain[j] ^ B[i]; - g->stateX[i] ^= cipher[j++]; - g->lenC[1]++; - if (g->lenC[1] == 0) g->lenC[0]++; - } - gf2mul(g); - } - if (len % 16 != 0) g->status = GCM_NOT_ACCEPTING_MORE; - return 1; -} - -/* SU= 48 */ -/* Add Ciphertext - decrypts to plaintext */ -int core::GCM_add_cipher(gcm *g, char *plain, char *cipher, int len) -{ - /* Add ciphertext to extract plaintext, len is length of ciphertext. */ - int i, j = 0; - unsign32 counter; - char oc; - uchar B[16]; - if (g->status == GCM_ACCEPTING_HEADER) g->status = GCM_ACCEPTING_CIPHER; - if (g->status != GCM_ACCEPTING_CIPHER) return 0; - - while (j < len) - { - counter = pack((uchar *) & (g->a.f[12])); - counter++; - unpack(counter, (uchar *) & (g->a.f[12])); /* increment counter */ - for (i = 0; i < 16; i++) B[i] = g->a.f[i]; - AES_ecb_encrypt(&(g->a), B); /* encrypt it */ - for (i = 0; i < 16 && j < len; i++) - { - oc = cipher[j]; - plain[j] = cipher[j] ^ B[i]; - g->stateX[i] ^= oc; - j++; - g->lenC[1]++; - if (g->lenC[1] == 0) g->lenC[0]++; - } - gf2mul(g); - } - if (len % 16 != 0) g->status = GCM_NOT_ACCEPTING_MORE; - return 1; -} - -/* SU= 16 */ -/* Finish and extract Tag */ -void core::GCM_finish(gcm *g, char *tag) -{ - /* Finish off GHASH and extract tag (MAC) */ - int i; - - GCM_wrap(g); - - /* extract tag */ - if (tag != NULL) - { - AES_ecb_encrypt(&(g->a), g->Y_0); /* E(K,Y0) */ - for (i = 0; i < 16; i++) g->Y_0[i] ^= g->stateX[i]; - for (i = 0; i < 16; i++) - { - tag[i] = g->Y_0[i]; - g->Y_0[i] = g->stateX[i] = 0; - } - } - - g->status = GCM_FINISHED; - AES_end(&(g->a)); -} - -/* AES-GCM Encryption of octets, K is key, H is header, - P is plaintext, C is ciphertext, T is authentication tag */ -void core::AES_GCM_ENCRYPT(octet *K, octet *IV, octet *H, octet *P, octet *C, octet *T) -{ - gcm g; - GCM_init(&g, K->len, K->val, IV->len, IV->val); - GCM_add_header(&g, H->val, H->len); - GCM_add_plain(&g, C->val, P->val, P->len); - C->len = P->len; - GCM_finish(&g, T->val); - T->len = 16; -} - -/* AES-GCM Decryption of octets, K is key, H is header, - P is plaintext, C is ciphertext, T is authentication tag */ -void core::AES_GCM_DECRYPT(octet *K, octet *IV, octet *H, octet *C, octet *P, octet *T) -{ - gcm g; - GCM_init(&g, K->len, K->val, IV->len, IV->val); - GCM_add_header(&g, H->val, H->len); - GCM_add_cipher(&g, P->val, C->val, C->len); - P->len = C->len; - GCM_finish(&g, T->val); - T->len = 16; -} - - -// Compile with -// gcc -O2 gcm.c aes.c -o gcm.exe -/* SU= 16 -*/ - -/* static void hex2bytes(char *hex,char *bin) */ -/* { */ -/* int i; */ -/* char v; */ -/* int len=strlen(hex); */ -/* for (i = 0; i < len/2; i++) { */ -/* char c = hex[2*i]; */ -/* if (c >= '0' && c <= '9') { */ -/* v = c - '0'; */ -/* } else if (c >= 'A' && c <= 'F') { */ -/* v = c - 'A' + 10; */ -/* } else if (c >= 'a' && c <= 'f') { */ -/* v = c - 'a' + 10; */ -/* } else { */ -/* v = 0; */ -/* } */ -/* v <<= 4; */ -/* c = hex[2*i + 1]; */ -/* if (c >= '0' && c <= '9') { */ -/* v += c - '0'; */ -/* } else if (c >= 'A' && c <= 'F') { */ -/* v += c - 'A' + 10; */ -/* } else if (c >= 'a' && c <= 'f') { */ -/* v += c - 'a' + 10; */ -/* } else { */ -/* v = 0; */ -/* } */ -/* bin[i] = v; */ -/* } */ -/* } */ - -/* -int main() -{ - int i; - -// char* KT="feffe9928665731c6d6a8f9467308308"; -// char* MT="d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39"; -// char* HT="feedfacedeadbeeffeedfacedeadbeefabaddad2"; -// char* NT="cafebabefacedbaddecaf888"; -// Tag should be 5bc94fbc3221a5db94fae95ae7121a47 -// char* NT="9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b"; -// Tag should be 619cc5aefffe0bfa462af43c1699d050 - - char* KT="6dfb5dc68af6ae2f3242e9184f100918"; - char* MT="47809d16c2c6ec685962c90e53fe1bba"; - char* HT="dd0fa6e494031139d71ee45f00d56fa4"; - char* NT="37d36f5c54d53479d4745dd1"; - - - int len=strlen(MT)/2; - int lenH=strlen(HT)/2; - int lenK=strlen(KT)/2; - int lenIV=strlen(NT)/2; - - char T[16]; // Tag - char K[16]; // AES Key - char H[64]; // Header - to be included in Authentication, but not encrypted - char N[100]; // IV - Initialisation vector - char M[100]; // Plaintext to be encrypted/authenticated - char C[100]; // Ciphertext - char P[100]; // Recovered Plaintext - - gcm g; - - hex2bytes(MT, M); - hex2bytes(HT, H); - hex2bytes(NT, N); - hex2bytes(KT, K); - - printf("lenK= %d\n",lenK); - - printf("Plaintext=\n"); - for (i=0;i>n) | ((x)<<(m-n))) -#define R(n,x) ((x)>>n) - -#define Ch(x,y,z) ((x&y)^(~(x)&z)) -#define Maj(x,y,z) ((x&y)^(x&z)^(y&z)) -#define Sig0_256(x) (S(32,2,x)^S(32,13,x)^S(32,22,x)) -#define Sig1_256(x) (S(32,6,x)^S(32,11,x)^S(32,25,x)) -#define theta0_256(x) (S(32,7,x)^S(32,18,x)^R(3,x)) -#define theta1_256(x) (S(32,17,x)^S(32,19,x)^R(10,x)) - -#define Sig0_512(x) (S(64,28,x)^S(64,34,x)^S(64,39,x)) -#define Sig1_512(x) (S(64,14,x)^S(64,18,x)^S(64,41,x)) -#define theta0_512(x) (S(64,1,x)^S(64,8,x)^R(7,x)) -#define theta1_512(x) (S(64,19,x)^S(64,61,x)^R(6,x)) - - -/* SU= 72 */ -static void HASH256_transform(hash256 *sh) -{ - /* basic transformation step */ - unsign32 a, b, c, d, e, f, g, h, t1, t2; - int j; - for (j = 16; j < 64; j++) - sh->w[j] = theta1_256(sh->w[j - 2]) + sh->w[j - 7] + theta0_256(sh->w[j - 15]) + sh->w[j - 16]; - - a = sh->h[0]; - b = sh->h[1]; - c = sh->h[2]; - d = sh->h[3]; - e = sh->h[4]; - f = sh->h[5]; - g = sh->h[6]; - h = sh->h[7]; - - for (j = 0; j < 64; j++) - { - /* 64 times - mush it up */ - t1 = h + Sig1_256(e) + Ch(e, f, g) + K_256[j] + sh->w[j]; - t2 = Sig0_256(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + t1; - d = c; - c = b; - b = a; - a = t1 + t2; - } - - sh->h[0] += a; - sh->h[1] += b; - sh->h[2] += c; - sh->h[3] += d; - sh->h[4] += e; - sh->h[5] += f; - sh->h[6] += g; - sh->h[7] += h; -} - -/* Initialise Hash function */ -void core::HASH256_init(hash256 *sh) -{ - /* re-initialise */ - int i; - for (i = 0; i < 64; i++) sh->w[i] = 0L; - sh->length[0] = sh->length[1] = 0L; - sh->h[0] = H0_256; - sh->h[1] = H1_256; - sh->h[2] = H2_256; - sh->h[3] = H3_256; - sh->h[4] = H4_256; - sh->h[5] = H5_256; - sh->h[6] = H6_256; - sh->h[7] = H7_256; - - sh->hlen = 32; -} - -/* process a single byte */ -void core::HASH256_process(hash256 *sh, int byt) -{ - /* process the next message byte */ - int cnt; - cnt = (int)((sh->length[0] / 32) % 16); - - sh->w[cnt] <<= 8; - sh->w[cnt] |= (unsign32)(byt & 0xFF); - - sh->length[0] += 8; - if (sh->length[0] == 0L) - { - sh->length[1]++; - sh->length[0] = 0L; - } - if ((sh->length[0] % 512) == 0) HASH256_transform(sh); -} - -/* SU= 24 */ -/* Generate 32-byte final Hash */ -void core::HASH256_hash(hash256 *sh, char *digest) -{ - /* pad message and finish - supply digest */ - int i; - unsign32 len0, len1; - len0 = sh->length[0]; - len1 = sh->length[1]; - HASH256_process(sh, PAD); - while ((sh->length[0] % 512) != 448) HASH256_process(sh, ZERO); - sh->w[14] = len1; - sh->w[15] = len0; - HASH256_transform(sh); - for (i = 0; i < sh->hlen; i++) - { - /* convert to bytes */ - digest[i] = (char)((sh->h[i / 4] >> (8 * (3 - i % 4))) & 0xffL); - } - HASH256_init(sh); -} - -/* return 32-byte intermediate hash */ -void core::HASH256_continuing_hash(hash256 *sh,char *digest) -{ - hash256 cp=*sh; - HASH256_hash(&cp,digest); -} - - -#define H0_512 0x6a09e667f3bcc908 -#define H1_512 0xbb67ae8584caa73b -#define H2_512 0x3c6ef372fe94f82b -#define H3_512 0xa54ff53a5f1d36f1 -#define H4_512 0x510e527fade682d1 -#define H5_512 0x9b05688c2b3e6c1f -#define H6_512 0x1f83d9abfb41bd6b -#define H7_512 0x5be0cd19137e2179 - -#define H8_512 0xcbbb9d5dc1059ed8 -#define H9_512 0x629a292a367cd507 -#define HA_512 0x9159015a3070dd17 -#define HB_512 0x152fecd8f70e5939 -#define HC_512 0x67332667ffc00b31 -#define HD_512 0x8eb44a8768581511 -#define HE_512 0xdb0c2e0d64f98fa7 -#define HF_512 0x47b5481dbefa4fa4 - -/* */ - -static const unsign64 K_512[80] = -{ - 0x428a2f98d728ae22 , 0x7137449123ef65cd , 0xb5c0fbcfec4d3b2f , 0xe9b5dba58189dbbc , - 0x3956c25bf348b538 , 0x59f111f1b605d019 , 0x923f82a4af194f9b , 0xab1c5ed5da6d8118 , - 0xd807aa98a3030242 , 0x12835b0145706fbe , 0x243185be4ee4b28c , 0x550c7dc3d5ffb4e2 , - 0x72be5d74f27b896f , 0x80deb1fe3b1696b1 , 0x9bdc06a725c71235 , 0xc19bf174cf692694 , - 0xe49b69c19ef14ad2 , 0xefbe4786384f25e3 , 0x0fc19dc68b8cd5b5 , 0x240ca1cc77ac9c65 , - 0x2de92c6f592b0275 , 0x4a7484aa6ea6e483 , 0x5cb0a9dcbd41fbd4 , 0x76f988da831153b5 , - 0x983e5152ee66dfab , 0xa831c66d2db43210 , 0xb00327c898fb213f , 0xbf597fc7beef0ee4 , - 0xc6e00bf33da88fc2 , 0xd5a79147930aa725 , 0x06ca6351e003826f , 0x142929670a0e6e70 , - 0x27b70a8546d22ffc , 0x2e1b21385c26c926 , 0x4d2c6dfc5ac42aed , 0x53380d139d95b3df , - 0x650a73548baf63de , 0x766a0abb3c77b2a8 , 0x81c2c92e47edaee6 , 0x92722c851482353b , - 0xa2bfe8a14cf10364 , 0xa81a664bbc423001 , 0xc24b8b70d0f89791 , 0xc76c51a30654be30 , - 0xd192e819d6ef5218 , 0xd69906245565a910 , 0xf40e35855771202a , 0x106aa07032bbd1b8 , - 0x19a4c116b8d2d0c8 , 0x1e376c085141ab53 , 0x2748774cdf8eeb99 , 0x34b0bcb5e19b48a8 , - 0x391c0cb3c5c95a63 , 0x4ed8aa4ae3418acb , 0x5b9cca4f7763e373 , 0x682e6ff3d6b2b8a3 , - 0x748f82ee5defb2fc , 0x78a5636f43172f60 , 0x84c87814a1f0ab72 , 0x8cc702081a6439ec , - 0x90befffa23631e28 , 0xa4506cebde82bde9 , 0xbef9a3f7b2c67915 , 0xc67178f2e372532b , - 0xca273eceea26619c , 0xd186b8c721c0c207 , 0xeada7dd6cde0eb1e , 0xf57d4f7fee6ed178 , - 0x06f067aa72176fba , 0x0a637dc5a2c898a6 , 0x113f9804bef90dae , 0x1b710b35131c471b , - 0x28db77f523047d84 , 0x32caab7b40c72493 , 0x3c9ebe0a15c9bebc , 0x431d67c49c100d4c , - 0x4cc5d4becb3e42b6 , 0x597f299cfc657e2a , 0x5fcb6fab3ad6faec , 0x6c44198c4a475817 -}; - -static void HASH512_transform(hash512 *sh) -{ - /* basic transformation step */ - unsign64 a, b, c, d, e, f, g, h, t1, t2; - int j; - for (j = 16; j < 80; j++) - sh->w[j] = theta1_512(sh->w[j - 2]) + sh->w[j - 7] + theta0_512(sh->w[j - 15]) + sh->w[j - 16]; - - a = sh->h[0]; - b = sh->h[1]; - c = sh->h[2]; - d = sh->h[3]; - e = sh->h[4]; - f = sh->h[5]; - g = sh->h[6]; - h = sh->h[7]; - - for (j = 0; j < 80; j++) - { - /* 80 times - mush it up */ - t1 = h + Sig1_512(e) + Ch(e, f, g) + K_512[j] + sh->w[j]; - t2 = Sig0_512(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + t1; - d = c; - c = b; - b = a; - a = t1 + t2; - } - sh->h[0] += a; - sh->h[1] += b; - sh->h[2] += c; - sh->h[3] += d; - sh->h[4] += e; - sh->h[5] += f; - sh->h[6] += g; - sh->h[7] += h; -} - -void core::HASH384_init(hash384 *sh) -{ - /* re-initialise */ - int i; - for (i = 0; i < 80; i++) sh->w[i] = 0; - sh->length[0] = sh->length[1] = 0; - sh->h[0] = H8_512; - sh->h[1] = H9_512; - sh->h[2] = HA_512; - sh->h[3] = HB_512; - sh->h[4] = HC_512; - sh->h[5] = HD_512; - sh->h[6] = HE_512; - sh->h[7] = HF_512; - - sh->hlen = 48; -} - -void core::HASH384_process(hash384 *sh, int byt) -{ - /* process the next message byte */ - HASH512_process(sh, byt); -} - -void core::HASH384_hash(hash384 *sh, char *digest) -{ - /* pad message and finish - supply digest */ - HASH512_hash(sh, digest); -} - -/* return intermediate hash */ -void core::HASH384_continuing_hash(hash384 *sh,char *digest) -{ - hash384 cp=*sh; - HASH384_hash(&cp,digest); -} - -void core::HASH512_init(hash512 *sh) -{ - /* re-initialise */ - int i; - - for (i = 0; i < 80; i++) sh->w[i] = 0; - sh->length[0] = sh->length[1] = 0; - sh->h[0] = H0_512; - sh->h[1] = H1_512; - sh->h[2] = H2_512; - sh->h[3] = H3_512; - sh->h[4] = H4_512; - sh->h[5] = H5_512; - sh->h[6] = H6_512; - sh->h[7] = H7_512; - - sh->hlen = 64; -} - -void core::HASH512_process(hash512 *sh, int byt) -{ - /* process the next message byte */ - int cnt; - - cnt = (int)((sh->length[0] / 64) % 16); - - sh->w[cnt] <<= 8; - sh->w[cnt] |= (unsign64)(byt & 0xFF); - - sh->length[0] += 8; - if (sh->length[0] == 0L) - { - sh->length[1]++; - sh->length[0] = 0L; - } - if ((sh->length[0] % 1024) == 0) HASH512_transform(sh); -} - -void core::HASH512_hash(hash512 *sh, char *digest) -{ - /* pad message and finish - supply digest */ - int i; - unsign64 len0, len1; - len0 = sh->length[0]; - len1 = sh->length[1]; - HASH512_process(sh, PAD); - while ((sh->length[0] % 1024) != 896) HASH512_process(sh, ZERO); - sh->w[14] = len1; - sh->w[15] = len0; - HASH512_transform(sh); - for (i = 0; i < sh->hlen; i++) - { - /* convert to bytes */ - digest[i] = (char)((sh->h[i / 8] >> (8 * (7 - i % 8))) & 0xffL); - } - HASH512_init(sh); -} - -/* return intermediate hash */ -void core::HASH512_continuing_hash(hash512 *sh,char *digest) -{ - hash512 cp=*sh; - HASH512_hash(&cp,digest); -} - -/* SHA3 */ - -#define SHA3_ROUNDS 24 -#define rotl(x,n) (((x)<>(64-n))) - -/* round constants */ - -static const unsign64 RC[24] = { - 0x0000000000000001UL, 0x0000000000008082UL, 0x800000000000808AUL, 0x8000000080008000UL, - 0x000000000000808BUL, 0x0000000080000001UL, 0x8000000080008081UL, 0x8000000000008009UL, - 0x000000000000008AUL, 0x0000000000000088UL, 0x0000000080008009UL, 0x000000008000000AUL, - 0x000000008000808BUL, 0x800000000000008BUL, 0x8000000000008089UL, 0x8000000000008003UL, - 0x8000000000008002UL, 0x8000000000000080UL, 0x000000000000800AUL, 0x800000008000000AUL, - 0x8000000080008081UL, 0x8000000000008080UL, 0x0000000080000001UL, 0x8000000080008008UL -}; - -static void SHA3_transform(sha3 *sh) -{ - int k; - unsign64 B00,B01,B02,B03,B04,B10,B11,B12,B13,B14,B20,B21,B22,B23,B24,B30,B31,B32,B33,B34,B40,B41,B42,B43,B44; - unsign64 C0,C1,C2,C3,C4,D0,D1,D2,D3,D4; - - for (k = 0; k < SHA3_ROUNDS; k++) - { - - C0=sh->S[0] ^ sh->S[5] ^ sh->S[10] ^ sh->S[15] ^ sh->S[20]; - C1=sh->S[1] ^ sh->S[6] ^ sh->S[11] ^ sh->S[16] ^ sh->S[21]; - C2=sh->S[2] ^ sh->S[7] ^ sh->S[12] ^ sh->S[17] ^ sh->S[22]; - C3=sh->S[3] ^ sh->S[8] ^ sh->S[13] ^ sh->S[18] ^ sh->S[23]; - C4=sh->S[4] ^ sh->S[9] ^ sh->S[14] ^ sh->S[19] ^ sh->S[24]; - - D0 = C4 ^ rotl(C1, 1); - D1 = C0 ^ rotl(C2, 1); - D2 = C1 ^ rotl(C3, 1); - D3 = C2 ^ rotl(C4, 1); - D4 = C3 ^ rotl(C0, 1); - - B00 = sh->S[0]^D0; - B02 = rotl(sh->S[1]^D1, 1); - B04 = rotl(sh->S[2]^D2, 62); - B01 = rotl(sh->S[3]^D3, 28); - B03 = rotl(sh->S[4]^D4, 27); - - B13 = rotl(sh->S[5]^D0, 36); - B10 = rotl(sh->S[6]^D1, 44); - B12 = rotl(sh->S[7]^D2, 6); - B14 = rotl(sh->S[8]^D3, 55); - B11 = rotl(sh->S[9]^D4, 20); - - B21 = rotl(sh->S[10]^D0, 3); - B23 = rotl(sh->S[11]^D1, 10); - B20 = rotl(sh->S[12]^D2, 43); - B22 = rotl(sh->S[13]^D3, 25); - B24 = rotl(sh->S[14]^D4, 39); - - B34 = rotl(sh->S[15]^D0, 41); - B31 = rotl(sh->S[16]^D1, 45); - B33 = rotl(sh->S[17]^D2, 15); - B30 = rotl(sh->S[18]^D3, 21); - B32 = rotl(sh->S[19]^D4, 8); - - B42 = rotl(sh->S[20]^D0, 18); - B44 = rotl(sh->S[21]^D1, 2); - B41 = rotl(sh->S[22]^D2, 61); - B43 = rotl(sh->S[23]^D3, 56); - B40 = rotl(sh->S[24]^D4, 14); - - sh->S[0]=B00^(~B10&B20); - sh->S[1]=B10^(~B20&B30); - sh->S[2]=B20^(~B30&B40); - sh->S[3]=B30^(~B40&B00); - sh->S[4]=B40^(~B00&B10); - - sh->S[5]=B01^(~B11&B21); - sh->S[6]=B11^(~B21&B31); - sh->S[7]=B21^(~B31&B41); - sh->S[8]=B31^(~B41&B01); - sh->S[9]=B41^(~B01&B11); - - sh->S[10]=B02^(~B12&B22); - sh->S[11]=B12^(~B22&B32); - sh->S[12]=B22^(~B32&B42); - sh->S[13]=B32^(~B42&B02); - sh->S[14]=B42^(~B02&B12); - - sh->S[15]=B03^(~B13&B23); - sh->S[16]=B13^(~B23&B33); - sh->S[17]=B23^(~B33&B43); - sh->S[18]=B33^(~B43&B03); - sh->S[19]=B43^(~B03&B13); - - sh->S[20]=B04^(~B14&B24); - sh->S[21]=B14^(~B24&B34); - sh->S[22]=B24^(~B34&B44); - sh->S[23]=B34^(~B44&B04); - sh->S[24]=B44^(~B04&B14); - - sh->S[0] ^= RC[k]; - } -} - -/* Re-Initialize. olen is output length in bytes - - should be 28, 32, 48 or 64 (224, 256, 384, 512 bits resp.) */ - -void core::SHA3_init(sha3 *sh, int olen) -{ - int i; - for (i = 0; i < 25; i++) - sh->S[i] = 0; /* 5x5x8 bytes = 200 bytes of state */ - - sh->length = 0; - sh->len = olen; - sh->rate = 200 - 2 * olen; /* number of bytes consumed in one gulp. Note that some bytes in the - state ("capacity") are not touched. Gulps are smaller for larger digests. - Important that olenlength); - int b = cnt % 8; - cnt /= 8; - sh->S[cnt] ^= ((unsign64)(byt & 0xff) << (8 * b)); - sh->length++; - if (sh->length == sh->rate) - { - sh->length=0; - SHA3_transform(sh); - } -} - -/* squeeze the sponge */ -void core::SHA3_squeeze(sha3 *sh, char *buff, int len) -{ - int i, j, k, m = 0; - unsign64 el; - int nb=len/sh->rate; -// squeeze out full blocks - for (j=0;jrate/8;i++) - { - el=sh->S[i]; - for (k=0;k<8;k++) - { - buff[m++] = (el & 0xff); - el >>= 8; - } - } - SHA3_transform(sh); - } - -// squeeze out whats left - i=0; - while (mS[i++]; - for (k = 0; k < 8; k++) - { - buff[m++] = (el & 0xff); - if (m >= len) break; - el >>= 8; - } - } -} - -void core::SHA3_hash(sha3 *sh, char *digest) -{ /* generate a SHA3 hash of appropriate size */ - int q = sh->rate - sh->length; - if (q == 1) SHA3_process(sh, 0x86); - else - { - SHA3_process(sh, 0x06); /* 0x06 for SHA-3 */ - while (sh->length != sh->rate - 1) SHA3_process(sh, 0x00); - SHA3_process(sh, 0x80); /* this will force a final transform */ - } - SHA3_squeeze(sh, digest, sh->len); -} - -/* return intermediate hash */ -void core::SHA3_continuing_hash(sha3 *sh,char *digest) -{ - sha3 cp=*sh; - SHA3_hash(&cp,digest); -} - -void core::SHA3_shake(sha3 *sh, char *digest, int len) -{ /* SHAKE out a buffer of variable length len */ - int q = sh->rate - sh->length; - if (q == 1) SHA3_process(sh, 0x9f); - else - { - SHA3_process(sh, 0x1f); // 0x06 for SHA-3 !!!! - while (sh->length != sh->rate - 1) SHA3_process(sh, 0x00); - SHA3_process(sh, 0x80); /* this will force a final transform */ - } - SHA3_squeeze(sh, digest, len); -} - -/* return intermediate hash */ -void core::SHA3_continuing_shake(sha3 *sh,char *digest,int len) -{ - sha3 cp=*sh; - SHA3_shake(&cp,digest,len); -} - -/* test program: should produce digest - -160 bit - -84983e44 1c3bd26e baae4aa1 f95129e5 e54670f1 - -256 bit - -248d6a61 d20638b8 e5c02693 0c3e6039 a33ce459 64ff2167 f6ecedd4 19db06c1 - -512 bit - -8e959b75dae313da 8cf4f72814fc143f 8f7779c6eb9f7fa1 7299aeadb6889018 -501d289e4900f7e4 331b99dec4b5433a c7d329eeb6dd2654 5e96e55b874be909 - -384 bit - -09330c33f71147e8 3d192fc782cd1b47 53111b173b3b05d2 2fa08086e3b0f712 -fcc7c71a557e2db9 66c3e9fa91746039 -*/ -/* -#include - -char test160[]="abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; -char test256[]="abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; -char test512[]="abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"; - -int main() -{ - char digest[100]; - int i; - - hash256 sh256; - hash384 sh384; - hash512 sh512; - sha3 SHA3; - - HASH256_init(&sh256); - for (i=0;test256[i]!=0;i++) HASH256_process(&sh256,test256[i]); - HASH256_hash(&sh256,digest); - for (i=0;i<32;i++) printf("%02x",(unsigned char)digest[i]); - printf("\n"); - - HASH384_init(&sh384); - for (i=0;test512[i]!=0;i++) HASH384_process(&sh384,test512[i]); - HASH384_hash(&sh384,digest); - for (i=0;i<48;i++) printf("%02x",(unsigned char)digest[i]); - printf("\n"); - - HASH512_init(&sh512); - for (i=0;test512[i]!=0;i++) HASH512_process(&sh512,test512[i]); - HASH512_hash(&sh512,digest); - for (i=0;i<64;i++) printf("%02x",(unsigned char)digest[i]); - printf("\n"); - - SHA3_init(&SHA3,SHA3_HASH256); - for (i=0;test512[i]!=0;i++) SHA3_process(&SHA3,test512[i]); - SHA3_hash(&SHA3,digest); - for (i=0;i<32;i++) printf("%02x",(unsigned char)digest[i]); - printf("\n"); - - SHA3_init(&SHA3,SHA3_HASH512); - for (i=0;test512[i]!=0;i++) SHA3_process(&SHA3,test512[i]); - SHA3_hash(&SHA3,digest); - for (i=0;i<64;i++) printf("%02x",(unsigned char)digest[i]); - printf("\n"); - - SHA3_init(&SHA3,SHAKE256); - for (i=0;test512[i]!=0;i++) SHA3_process(&SHA3,test512[i]); - SHA3_shake(&SHA3,digest,72); - for (i=0;i<72;i++) printf("%02x",(unsigned char)digest[i]); - printf("\n"); - - - return 0; -} - -*/ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/hmac.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/hmac.cpp deleted file mode 100644 index 37d221d..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/hmac.cpp +++ /dev/null @@ -1,701 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - HMAC functions -*/ - -#include "arch.h" -#include "core.h" - -using namespace core; - -#define ROUNDUP(a,b) ((a)-1)/(b)+1 -#define CEIL(a,b) (((a)-1)/(b)+1) - -/* General Purpose hash function, padding with zeros, optional input octets p and x, optional integer n,hash to octet w of length olen */ -/* hash is the Hash family, either MC_SHA2 or MC_SHA3 */ -/* hlen should be 32,48 or 64 for MC_SHA2 (that is SHA256/384/512) */ -/* hlen should be 24,32,48,64 for MC_SHA3 */ -/* olen=0 - output = hlen bytes */ -/* olen<=hlen - output = olen bytes */ -/* olen>hlen - output is padded with leading zeros and then hlen bytes */ - -void core::GPhash(int hash,int hlen,octet *w,int olen,int pad,octet *p,int n,octet *x) -{ - hash256 sh256; - hash384 sh384; - hash512 sh512; - sha3 sh3; - int i,c[4]; - char hh[64]; - - if (n>=0) - { - c[0] = (n >> 24) & 0xff; - c[1] = (n >> 16) & 0xff; - c[2] = (n >> 8) & 0xff; - c[3] = (n) & 0xff; - } - - switch (hash) - { - case MC_SHA2 : - switch (hlen) - { - case SHA256 : - HASH256_init(&sh256); - for (i=0;ilen;i++) HASH256_process(&sh256,p->val[i]); - if (n>=0) - for (i=0;i<4;i++) HASH256_process(&sh256,c[i]); - if (x!=NULL) - for (i=0;ilen;i++) HASH256_process(&sh256,x->val[i]); - HASH256_hash(&sh256,hh); - break; - case SHA384 : - HASH384_init(&sh384); - for (i=0;ilen;i++) HASH384_process(&sh384,p->val[i]); - if (n>=0) - for (i=0;i<4;i++) HASH384_process(&sh384,c[i]); - if (x!=NULL) - for (i=0;ilen;i++) HASH384_process(&sh384,x->val[i]); - HASH384_hash(&sh384,hh); - break; - case SHA512 : - HASH512_init(&sh512); - for (i=0;ilen;i++) HASH512_process(&sh512,p->val[i]); - if (n>=0) - for (i=0;i<4;i++) HASH512_process(&sh512,c[i]); - if (x!=NULL) - for (i=0;ilen;i++) HASH512_process(&sh512,x->val[i]); - HASH512_hash(&sh512,hh); - break; - } - break; - case MC_SHA3 : - SHA3_init(&sh3,hlen); - for (i=0;ilen;i++) SHA3_process(&sh3,p->val[i]); - if (n>=0) - for (i=0;i<4;i++) SHA3_process(&sh3,c[i]); - if (x!=NULL) - for (i=0;x->len;i++) SHA3_process(&sh3,x->val[i]); - SHA3_hash(&sh3,hh); - break; - default: return; - } - OCT_empty(w); - if (!olen) - OCT_jbytes(w,hh,hlen); - else - { - if (olen<=hlen) - { - OCT_jbytes(w,hh,olen); - } else { - OCT_jbyte(w, 0, olen - hlen); - OCT_jbytes(w, hh, hlen); - } - } -} - -/* Simple hash octet p to octet w of length hlen */ -void core::SPhash(int hash, int hlen,octet *w, octet *p) -{ - GPhash(hash, hlen, w, 0, 0, p, -1, NULL); -} - -static int blksize(int hash,int hlen) -{ - int blk=0; - switch (hash) - { - case MC_SHA2 : - blk=64; - if (hlen>32) blk=128; - break; - case MC_SHA3 : - blk=200-2*hlen; - break; - default: break; - } - return blk; -} - - -/* RFC 2104 */ -void core::HMAC(int hash,int hlen,octet *TAG,int olen,octet *K,octet *M) -{ - int blk; - char h[128],k0[200]; // assumes max block sizes - octet K0 = {0, sizeof(k0), k0}; - octet H={0,sizeof(h),h}; - - blk=blksize(hash,hlen); - if (blk==0) return; - - if (K->len > blk) SPhash(hash,hlen,&K0,K); - else OCT_copy(&K0,K); - - OCT_jbyte(&K0,0,blk-K0.len); - - OCT_xorbyte(&K0,0x36); - - - GPhash(hash,hlen,&H,0,0,&K0,-1,M); - - OCT_xorbyte(&K0,0x6a); /* 0x6a = 0x36 ^ 0x5c */ - GPhash(hash,hlen,&H,0,0,&K0,-1,&H); - - OCT_empty(TAG); - OCT_jbytes(TAG,H.val,olen); - - OCT_clear(&H); - OCT_clear(&K0); -} - -/* RFC 5869 */ - -void core::HKDF_Extract(int hash,int hlen,octet *PRK,octet *SALT,octet *IKM) -{ - char h[64]; - octet H={0,sizeof(h),h}; - if (SALT==NULL) { - OCT_jbyte(&H,0,hlen); - HMAC(hash,hlen,PRK,hlen,&H,IKM); - } else { - HMAC(hash,hlen,PRK,hlen,SALT,IKM); - } -} - -void core::HKDF_Expand(int hash,int hlen,octet *OKM,int olen,octet *PRK,octet *INFO) -{ - int i; - char t[1024]; // >= info.length+hlen+1 - octet T={0,sizeof(t),t}; - int n=olen/hlen; - int flen=olen%hlen; - OCT_empty(OKM); - - for (i=1;i<=n;i++) - { - OCT_joctet(&T,INFO); - OCT_jbyte(&T,i,1); - HMAC(hash,hlen,&T,hlen,PRK,&T); - OCT_joctet(OKM,&T); - } - if (flen>0) - { - OCT_joctet(&T,INFO); - OCT_jbyte(&T,n+1,1); - HMAC(hash,hlen,&T,flen,PRK,&T); - OCT_joctet(OKM,&T); - } -} - -/* https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/ */ - -void core::XOF_Expand(int hlen,octet *OKM,int olen,octet *DST,octet *M) -{ - int i; - sha3 SHA3; - SHA3_init(&SHA3,hlen); - for (i=0;ilen;i++) SHA3_process(&SHA3,M->val[i]); - SHA3_process(&SHA3,olen/256); - SHA3_process(&SHA3,olen%256); - - for (i=0;ilen;i++) - SHA3_process(&SHA3,DST->val[i]); - SHA3_process(&SHA3,DST->len); - - SHA3_shake(&SHA3,OKM->val,olen); - OKM->len=olen; -} - -static void XMD_Expand_Short_DST(int hash, int hlen,octet *OKM,int olen,octet *DST,octet *M) -{ - int i,blk; - int ell=CEIL(olen,hlen); - char tmp[260]; - octet TMP={0,sizeof(tmp),tmp}; - char h0[64]; - octet H0 = {0, sizeof(h0), h0}; - char h1[64]; - octet H1 = {0, sizeof(h1), h1}; - - blk=blksize(hash,hlen); - OCT_jint(&TMP,olen,2); - OCT_jint(&TMP,0,1); - OCT_joctet(&TMP,DST); - OCT_jint(&TMP,DST->len,1); - - GPhash(hash,hlen,&H0,0,blk,M,-1,&TMP); - OCT_empty(&TMP); - OCT_jint(&TMP,1,1); - OCT_joctet(&TMP,DST); - OCT_jint(&TMP,DST->len,1); - - GPhash(hash,hlen,&H1,0,0,&H0,-1,&TMP); - OCT_empty(OKM); - OCT_joctet(OKM,&H1); - for (i=2;i<=ell;i++) - { - OCT_xor(&H1,&H0); - OCT_empty(&TMP); - OCT_jint(&TMP,i,1); - OCT_joctet(&TMP,DST); - OCT_jint(&TMP,DST->len,1); - GPhash(hash,hlen,&H1,0,0,&H1,-1,&TMP); - OCT_joctet(OKM,&H1); - } - OKM->len=olen; -} - -void core::XMD_Expand(int hash, int hlen,octet *OKM,int olen,octet *DST,octet *M) -{ - char w[64]; - octet W = {0, sizeof(w), w}; - char os[20]; - octet OS={0,sizeof(os),os}; - OCT_jstring(&OS,(char *)"H2C-OVERSIZE-DST-"); - if (DST->len>=256) - { - GPhash(hash,hlen,&W,0,0,&OS,-1,DST); - XMD_Expand_Short_DST(hash,hlen,OKM,olen,&W,M); - } else { - XMD_Expand_Short_DST(hash,hlen,OKM,olen,DST,M); - } -} - -/* Key Derivation Function */ - -void core::KDF2(int hash, int hlen, octet *key, int olen, octet *z, octet *p) -{ - /* NOTE: the parameter olen is the length of the output k in bytes */ - char h[64]; - octet H = {0, sizeof(h), h}; - int counter, cthreshold; - - OCT_empty(key); - - cthreshold = ROUNDUP(olen, hlen); - - for (counter = 1; counter <= cthreshold; counter++) - { - GPhash(hash,hlen, &H, 0, 0, z, counter, p); - if (key->len + hlen > olen) OCT_jbytes(key, H.val, olen % hlen); - else OCT_joctet(key, &H); - } - -} - -/* Password based Key Derivation Function */ -/* Input password p, salt s, and repeat count */ -/* Output key of length olen */ -void core::PBKDF2(int hash, int hlen, octet *key, int olen, octet *p, octet *s, int rep) -{ - int i, j, len, d = ROUNDUP(olen, hlen); - char f[64], u[64]; - octet F = {0, sizeof(f), f}; - octet U = {0, sizeof(u), u}; - OCT_empty(key); - - for (i = 1; i <= d; i++) - { - len = s->len; - OCT_jint(s, i, 4); - - HMAC(hash, hlen, &F, hlen, s, p); - - s->len = len; - OCT_copy(&U, &F); - for (j = 2; j <= rep; j++) - { - HMAC(hash, hlen, &U, hlen, &U, p); - OCT_xor(&F, &U); - } - - OCT_joctet(key, &F); - } - - OCT_chop(key, NULL, olen); -} - -/* RSA Auxiliary Functions */ - -#define MAX_RSA_BYTES 512 /**< Maximum of 4096 */ - -/* Mask Generation Function */ - -static void MGF1(int sha, octet *z, int olen, octet *mask) -{ - char h[64]; - octet H = {0, sizeof(h), h}; - int hlen = sha; - int counter, cthreshold; - - OCT_empty(mask); - - cthreshold = ROUNDUP(olen, hlen); - for (counter = 0; counter < cthreshold; counter++) - { - GPhash(MC_SHA2,sha,&H,0,0,z,counter,NULL); - //hashit(sha, z, counter, &H); - if (mask->len + hlen > olen) OCT_jbytes(mask, H.val, olen % hlen); - else OCT_joctet(mask, &H); - } - OCT_clear(&H); -} - -/* MGF1 plus masking */ -static void MGF1XOR(int sha, octet *z, octet *w) -{ - char h[64]; - octet H = {0, sizeof(h), h}; - int i,len,wlen,hlen = sha; - int counter, cthreshold; - - wlen=0; - cthreshold = ROUNDUP(w->len, hlen); - for (counter = 0; counter < cthreshold; counter++) - { - GPhash(MC_SHA2,sha,&H,0,0,z,counter,NULL); - if (wlen+hlen <= w->len) - len=hlen; - else - len=w->len%hlen; - - for (i=0;ival[wlen+i]^=H.val[i]; - wlen+=len; - } - OCT_clear(&H); -} - - -/* SHAXXX identifier strings */ -const unsigned char SHA256ID[] = {0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20}; -const unsigned char SHA384ID[] = {0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30}; -const unsigned char SHA512ID[] = {0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40}; - -/* PKCS 1.5 padding of a message to be signed */ - -int core::PKCS15(int sha, octet *m, octet *w) -{ - int olen = w->max; - int hlen = sha; - int idlen = 19; - char h[64]; - octet H = {0, sizeof(h), h}; - - if (olen < idlen + hlen + 10) return 0; - GPhash(MC_SHA2,sha,&H,0,0,m,-1,NULL); - - OCT_empty(w); - OCT_jbyte(w, 0x00, 1); - OCT_jbyte(w, 0x01, 1); - OCT_jbyte(w, 0xff, olen - idlen - hlen - 3); - OCT_jbyte(w, 0x00, 1); - - if (hlen == 32) OCT_jbytes(w, (char *)SHA256ID, idlen); - if (hlen == 48) OCT_jbytes(w, (char *)SHA384ID, idlen); - if (hlen == 64) OCT_jbytes(w, (char *)SHA512ID, idlen); - - OCT_joctet(w, &H); - - return 1; -} - -/* Alternate form, without the NULL 0500 */ - -/* SHAXXX identifier strings */ -const unsigned char SHA256IDb[] = {0x30, 0x2f, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x04, 0x20}; -const unsigned char SHA384IDb[] = {0x30, 0x3f, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x04, 0x30}; -const unsigned char SHA512IDb[] = {0x30, 0x4f, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x04, 0x40}; - -/* PKCS 1.5 padding of a message to be signed */ - -int core::PKCS15b(int sha, octet *m, octet *w) -{ - int olen = w->max; - int hlen = sha; - int idlen = 17; - char h[64]; - octet H = {0, sizeof(h), h}; - - if (olen < idlen + hlen + 10) return 0; - GPhash(MC_SHA2,sha,&H,0,0,m,-1,NULL); - - OCT_empty(w); - OCT_jbyte(w, 0x00, 1); - OCT_jbyte(w, 0x01, 1); - OCT_jbyte(w, 0xff, olen - idlen - hlen - 3); - OCT_jbyte(w, 0x00, 1); - - if (hlen == 32) OCT_jbytes(w, (char *)SHA256IDb, idlen); - if (hlen == 48) OCT_jbytes(w, (char *)SHA384IDb, idlen); - if (hlen == 64) OCT_jbytes(w, (char *)SHA512IDb, idlen); - - OCT_joctet(w, &H); - - return 1; -} - -/* PSS Encoding of message to be signed. Salt is hlen */ - -int core::PSS_ENCODE(int sha, octet *m, csprng *RNG, octet *w) -{ - unsigned char mask; - char h[64]; - octet H = {0, sizeof(h), h}; - char md[136]; - octet MD={0,sizeof(md),md}; - char salt[64]; - octet SALT={0,sizeof(salt),salt}; - int hlen=sha; - int emlen=w->max; - int embits=8*emlen-1; - - OCT_rand(&SALT, RNG, hlen); - - mask=(0xff)>>(8*emlen-embits); - - GPhash(MC_SHA2,sha,&H,0,0,m,-1,NULL); - if (emlen < hlen + hlen + 2) return 0; - - OCT_jbyte(&MD,0,8); - OCT_joctet(&MD,&H); - OCT_joctet(&MD,&SALT); - - GPhash(MC_SHA2,sha,&H,0,0,&MD,-1,NULL); - OCT_clear(w); - OCT_jbyte(w,0,emlen-hlen-hlen-2); - OCT_jbyte(w,0x01,1); - OCT_joctet(w,&SALT); - MGF1XOR(sha,&H,w); - w->val[0]&=mask; - - OCT_joctet(w,&H); - OCT_jbyte(w,0xbc,1); - - return 1; -} - -int core::PSS_VERIFY(int sha, octet *m,octet *w) -{ - int i,k; - unsigned char mask; - char hmask[64]; - octet HMASK = {0, sizeof(hmask), hmask}; - char h[64]; - octet H = {0, sizeof(h), h}; - char db[MAX_RSA_BYTES]; - octet DB = {0, sizeof(db), db}; - char salt[64]; - octet SALT={0,sizeof(salt),salt}; - int hlen=sha; - int emlen=w->len; - int embits=8*emlen-1; - - mask=(0xff)>>(8*emlen-embits); - - GPhash(MC_SHA2,sha,&HMASK,0,0,m,-1,NULL); - if (emlen < hlen + hlen + 2) return 0; - if (w->val[emlen-1]!=(char)0xbc) return 0; - if ((w->val[0]&(~mask))!=0) return 0; - - OCT_jbytes(&DB,w->val,emlen-hlen-1); - OCT_jbytes(&H,&w->val[emlen-hlen-1],hlen); - - MGF1XOR(sha,&H,&DB); - DB.val[0]&=mask; - - k=0; - for (i=0;imax - 1; - int mlen = m->len; - int hlen, seedlen; - char dbmask[MAX_RSA_BYTES], seed[64]; - octet DBMASK = {0, sizeof(dbmask), dbmask}; - octet SEED = {0, sizeof(seed), seed}; - - hlen = seedlen = sha; - if (mlen > olen - hlen - seedlen - 1) return 0; - if (m == f) return 0; /* must be distinct octets */ - - GPhash(MC_SHA2,sha,f,0,0,p,-1,NULL); - //hashit(sha, p, -1, f); - - slen = olen - mlen - hlen - seedlen - 1; - - OCT_jbyte(f, 0, slen); - OCT_jbyte(f, 0x1, 1); - OCT_joctet(f, m); - - OCT_rand(&SEED, RNG, seedlen); - - MGF1(sha, &SEED, olen - seedlen, &DBMASK); - - OCT_xor(&DBMASK, f); - MGF1(sha, &DBMASK, seedlen, f); - - OCT_xor(f, &SEED); - - OCT_joctet(f, &DBMASK); - - OCT_pad(f, f->max); - OCT_clear(&SEED); - OCT_clear(&DBMASK); - - return 1; -} - -/* OAEP Message Decoding for Decryption */ - -int core::OAEP_DECODE(int sha, octet *p, octet *f) -{ - int comp, x, t; - int i, k, olen = f->max - 1; - int hlen, seedlen; - char dbmask[MAX_RSA_BYTES], seed[64], chash[64]; - octet DBMASK = {0, sizeof(dbmask), dbmask}; - octet SEED = {0, sizeof(seed), seed}; - octet CHASH = {0, sizeof(chash), chash}; - - seedlen = hlen = sha; - if (olen < seedlen + hlen + 1) return 0; - if (!OCT_pad(f, olen + 1)) return 0; - - GPhash(MC_SHA2,sha,&CHASH,0,0,p,-1,NULL); - //hashit(sha, p, -1, &CHASH); - - x = f->val[0]; - for (i = seedlen; i < olen; i++) - DBMASK.val[i - seedlen] = f->val[i + 1]; - DBMASK.len = olen - seedlen; - - MGF1(sha, &DBMASK, seedlen, &SEED); - for (i = 0; i < seedlen; i++) SEED.val[i] ^= f->val[i + 1]; - MGF1(sha, &SEED, olen - seedlen, f); - OCT_xor(&DBMASK, f); - - comp = OCT_ncomp(&CHASH, &DBMASK, hlen); - - OCT_shl(&DBMASK, hlen); - - OCT_clear(&SEED); - OCT_clear(&CHASH); - -// find first non-zero t in array - t=k=0; - for (i=0;i -#include -#include -#include "hpke_ZZZ.h" - -#define GROUP EGS_ZZZ -#define POINT (2*EFS_ZZZ+1) -#define MAX_HASH HASH_TYPE_ZZZ -#define MAX_LABEL 20 // may need adjustment - -static void ZZZ::LabeledExtract(octet *PRK,octet *SALT,octet *SUITE_ID,char *label,octet *IKM) -{ - char likm[18+MAX_LABEL+2*POINT]; - octet LIKM={0,sizeof(likm),likm}; - OCT_jstring(&LIKM,(char *)"HPKE-v1"); - OCT_joctet(&LIKM,SUITE_ID); - OCT_jstring(&LIKM,label); - if (IKM!=NULL) - OCT_joctet(&LIKM,IKM); - HKDF_Extract(MC_SHA2,HASH_TYPE_ZZZ,PRK,SALT,&LIKM); -} - -static void ZZZ::LabeledExpand(octet *OKM,octet *PRK,octet *SUITE_ID,char *label,octet *INFO,int L) -{ - char linfo[20+MAX_LABEL+3*POINT]; - octet LINFO={0,sizeof(linfo),linfo}; - OCT_jint(&LINFO,L,2); - OCT_jstring(&LINFO,(char *)"HPKE-v1"); - OCT_joctet(&LINFO,SUITE_ID); - OCT_jstring(&LINFO,label); - if (INFO!=NULL) - OCT_joctet(&LINFO,INFO); - HKDF_Expand(MC_SHA2,HASH_TYPE_ZZZ,OKM,L,PRK,&LINFO); -} - -static void ZZZ::ExtractAndExpand(int config_id,octet *OKM,octet *DH,octet *CONTEXT) -{ - char prk[MAX_HASH]; - octet PRK={0,sizeof(prk),prk}; - char suite_id[10]; - octet SUITE_ID={0,sizeof(suite_id),suite_id}; - - int kem_id=config_id&255; - OCT_jstring(&SUITE_ID,(char *)"KEM"); - OCT_jint(&SUITE_ID,kem_id,2); - - LabeledExtract(&PRK,NULL,&SUITE_ID,(char *)"eae_prk",DH); - LabeledExpand(OKM, &PRK,&SUITE_ID,(char *)"shared_secret",CONTEXT,HASH_TYPE_ZZZ); -} - -int ZZZ::DeriveKeyPair(int config_id,octet *SK,octet *PK,octet *SEED) -{ - int counter=0; - char prk[MAX_HASH]; - octet PRK={0,sizeof(prk),prk}; - char suite_id[10]; - octet SUITE_ID={0,sizeof(suite_id),suite_id}; - char info[2]; - octet INFO={0,sizeof(info),info}; - int bit_mask,kem=config_id&255; - OCT_jstring(&SUITE_ID,(char *)"KEM"); - OCT_jint(&SUITE_ID,kem,2); - LabeledExtract(&PRK,NULL,&SUITE_ID,(char *)"dkp_prk",SEED); - -//printf("PRK= ");OCT_output(&PRK); printf("\n"); - - if (kem==32 || kem==33) - { // RFC7748 - LabeledExpand(SK,&PRK,&SUITE_ID,(char *)"sk",NULL,GROUP); - OCT_reverse(SK); - if (kem==32) - { - SK->val[GROUP-1]&=248; - SK->val[0]&=127; - SK->val[0]|=64; - } else { - SK->val[GROUP-1]&=252; - SK->val[0]|=128; - } - - } else { - if (kem==18) bit_mask=1; - else bit_mask=0xFF; - OCT_clear(SK); - while (!ECP_IN_RANGE(SK) && counter<256) - { - OCT_empty(&INFO); - OCT_jbyte(&INFO,counter,1); - LabeledExpand(SK,&PRK,&SUITE_ID,(char *)"candidate",&INFO,GROUP); - SK->val[0]&=bit_mask; - counter++; - } - } -//printf("SK= ");OCT_output(SK); printf("\n"); -//printf("kem= %d\n",kem); -//printf("counter= %d\n",counter); - ECP_KEY_PAIR_GENERATE(NULL, SK, PK); - if (kem==32 || kem==33) - OCT_reverse(PK); - - if (counter<256) return 1; - else return 0; -} - -void ZZZ::HPKE_Encap(int config_id,octet *skE,octet *Z,octet *pkE,octet *pkR) -{ - int res,kem; - char dh[POINT]; - octet DH={0,sizeof(dh),dh}; - char kemcontext[2*POINT]; - octet KEMCONTEXT={0,sizeof(kemcontext),kemcontext}; - kem=config_id&255; - - if (kem==32 || kem==33) - { - OCT_reverse(pkR); - res=ECP_SVDP_DH(skE, pkR, &DH, 0); - OCT_reverse(pkR); - OCT_reverse(&DH); - } else { - res=ECP_SVDP_DH(skE, pkR, &DH, 0); - } - - OCT_copy(&KEMCONTEXT,pkE); - OCT_joctet(&KEMCONTEXT,pkR); - ExtractAndExpand(config_id,Z,&DH,&KEMCONTEXT); -} - -void ZZZ::HPKE_Decap(int config_id,octet *skR,octet *Z,octet *pkE,octet *pkR) -{ - int res,kem; - char dh[POINT]; - octet DH={0,sizeof(dh),dh}; - char kemcontext[2*POINT]; - octet KEMCONTEXT={0,sizeof(kemcontext),kemcontext}; - kem=config_id&255; - - if (kem==32 || kem==33) - { - OCT_reverse(pkE); - ECP_SVDP_DH(skR, pkE, &DH, 0); - OCT_reverse(pkE); - OCT_reverse(&DH); - } else { - ECP_SVDP_DH(skR, pkE, &DH, 0); - } - - OCT_copy(&KEMCONTEXT,pkE); - OCT_joctet(&KEMCONTEXT,pkR); - - ExtractAndExpand(config_id,Z,&DH,&KEMCONTEXT); -} - -void ZZZ::HPKE_AuthEncap(int config_id,octet *skE,octet *skS,octet *Z,octet *pkE,octet *pkR,octet *pkS) -{ - int res,kem; - char dh[2*POINT]; - octet DH={0,sizeof(dh),dh}; - char dh1[POINT]; - octet DH1={0,sizeof(dh1),dh1}; - char kemcontext[3*POINT]; - octet KEMCONTEXT={0,sizeof(kemcontext),kemcontext}; - - kem=config_id&255; - - if (kem==32 || kem==33) - { - OCT_reverse(pkR); - ECP_SVDP_DH(skE, pkR, &DH,0); - ECP_SVDP_DH(skS, pkR, &DH1,0); - OCT_reverse(pkR); - OCT_reverse(&DH); - OCT_reverse(&DH1); - } else { - ECP_SVDP_DH(skE, pkR, &DH, 0); - ECP_SVDP_DH(skS, pkR, &DH1,0); - } - - OCT_joctet(&DH,&DH1); - OCT_copy(&KEMCONTEXT,pkE); - OCT_joctet(&KEMCONTEXT,pkR); - OCT_joctet(&KEMCONTEXT,pkS); - - ExtractAndExpand(config_id,Z,&DH,&KEMCONTEXT); -} - -void ZZZ::HPKE_AuthDecap(int config_id,octet *skR,octet *Z,octet *pkE,octet *pkR,octet *pkS) -{ - int res,kem; - char dh[2*POINT]; - octet DH={0,sizeof(dh),dh}; - char dh1[POINT]; - octet DH1={0,sizeof(dh1),dh1}; - char kemcontext[3*POINT]; - octet KEMCONTEXT={0,sizeof(kemcontext),kemcontext}; - - kem=config_id&255; - - if (kem==32 || kem==33) { - OCT_reverse(pkE); - OCT_reverse(pkS); - ECP_SVDP_DH(skR, pkE, &DH,0); - ECP_SVDP_DH(skR, pkS, &DH1,0); - OCT_reverse(pkE); - OCT_reverse(pkS); - OCT_reverse(&DH); - OCT_reverse(&DH1); - } else { - ECP_SVDP_DH(skR, pkE, &DH, 0); - ECP_SVDP_DH(skR, pkS, &DH1, 0); - } - OCT_joctet(&DH,&DH1); - - OCT_copy(&KEMCONTEXT,pkE); - OCT_joctet(&KEMCONTEXT,pkR); - OCT_joctet(&KEMCONTEXT,pkS); - - ExtractAndExpand(config_id,Z,&DH,&KEMCONTEXT); -} - -void ZZZ::HPKE_KeySchedule(int config_id,octet *key,octet *nonce,octet *exp_secret,int mode,octet *Z,octet *info,octet *psk,octet *pskID) -{ - char context[1+2*MAX_HASH]; - octet CONTEXT={0,sizeof(context),context}; - - char h[MAX_HASH]; - octet H={0,sizeof(h),h}; - char secret_h[MAX_HASH]; - octet secret={0,sizeof(secret_h),secret_h}; - - int kem_id=config_id&255; - int kdf_id=(config_id>>8)&3; - int aead_id=(config_id>>10)&3; - - char suite_id[10]; - octet SUITE_ID={0,sizeof(suite_id),suite_id}; - OCT_jstring(&SUITE_ID,(char *)"HPKE"); - OCT_jint(&SUITE_ID,kem_id,2); - OCT_jint(&SUITE_ID,kdf_id,2); - OCT_jint(&SUITE_ID,aead_id,2); - - OCT_jint(&CONTEXT,mode,1); - - LabeledExtract(&H,NULL,&SUITE_ID,(char *)"psk_id_hash",pskID); - OCT_joctet(&CONTEXT,&H); - LabeledExtract(&H,NULL,&SUITE_ID,(char *)"info_hash",info); - OCT_joctet(&CONTEXT,&H); - - LabeledExtract(&secret,Z,&SUITE_ID,(char *)"secret",psk); - - //LabeledExtract(&H,NULL,&SUITE_ID,(char *)"psk_hash",psk); - //LabeledExtract(&secret,&H,&SUITE_ID,(char *)"secret",Z); - - LabeledExpand(key,&secret,&SUITE_ID,(char *)"key",&CONTEXT,AESKEY_ZZZ); - LabeledExpand(nonce,&secret,&SUITE_ID,(char *)"base_nonce",&CONTEXT,12); - if (exp_secret!=NULL) - LabeledExpand(exp_secret,&secret,&SUITE_ID,(char *)"exp",&CONTEXT,HASH_TYPE_ZZZ); -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/kyber.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/kyber.cpp deleted file mode 100644 index 3956e8c..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/kyber.cpp +++ /dev/null @@ -1,812 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Kyber API implementation. Constant time where it matters. Spends nearly all of its time running SHA3. Small. - - M.Scott 22/11/2021 -*/ - -#include "kyber.h" - -using namespace core; - -// parameters for each security level -// K,eta1,eta2,du,dv,shared secret -const int PARAMS_512[6]={2,3,2,10,4,32}; -const int PARAMS_768[6]={3,2,2,10,4,32}; -const int PARAMS_1024[6]={4,2,2,11,5,32}; - -/* Start of public domain reference implementation code - taken from https://github.com/pq-crystals/kyber */ - -const sign16 zetas[128] = { - -1044, -758, -359, -1517, 1493, 1422, 287, 202, - -171, 622, 1577, 182, 962, -1202, -1474, 1468, - 573, -1325, 264, 383, -829, 1458, -1602, -130, - -681, 1017, 732, 608, -1542, 411, -205, -1571, - 1223, 652, -552, 1015, -1293, 1491, -282, -1544, - 516, -8, -320, -666, -1618, -1162, 126, 1469, - -853, -90, -271, 830, 107, -1421, -247, -951, - -398, 961, -1508, -725, 448, -1065, 677, -1275, - -1103, 430, 555, 843, -1251, 871, 1550, 105, - 422, 587, 177, -235, -291, -460, 1574, 1653, - -246, 778, 1159, -147, -777, 1483, -602, 1119, - -1590, 644, -872, 349, 418, 329, -156, -75, - 817, 1097, 603, 610, 1322, -1285, -1465, 384, - -1215, -136, 1218, -1335, -874, 220, -1187, -1659, - -1185, -1530, -1278, 794, -1510, -854, -870, 478, - -108, -308, 996, 991, 958, -1460, 1522, 1628 -}; - -static int16_t montgomery_reduce(int32_t a) -{ - int16_t t; - - t = (int16_t)a*KY_QINV; - t = (a - (int32_t)t*KY_PRIME) >> 16; - return t; -} - -static int16_t barrett_reduce(int16_t a) { - int16_t t; - const int16_t v = ((1<<26) + KY_PRIME/2)/KY_PRIME; - - t = ((int32_t)v*a + (1<<25)) >> 26; - t *= KY_PRIME; - return a - t; -} - -static sign16 fqmul(sign16 a, sign16 b) { - return montgomery_reduce((sign32)a*b); -} - -static void ntt(int16_t r[256]) { - unsigned int len, start, j, k; - int16_t t, zeta; - - k = 1; - for(len = 128; len >= 2; len >>= 1) { - for(start = 0; start < 256; start = j + len) { - zeta = zetas[k++]; - for(j = start; j < start + len; j++) { - t = fqmul(zeta, r[j + len]); - r[j + len] = r[j] - t; - r[j] = r[j] + t; - } - } - } -} - -static void invntt(int16_t r[256]) { - unsigned int start, len, j, k; - int16_t t, zeta; - const int16_t f = 1441; // mont^2/128 - - k = 127; - for(len = 2; len <= 128; len <<= 1) { - for(start = 0; start < 256; start = j + len) { - zeta = zetas[k--]; - for(j = start; j < start + len; j++) { - t = r[j]; - r[j] = barrett_reduce(t + r[j + len]); - r[j + len] = r[j + len] - t; - r[j + len] = fqmul(zeta, r[j + len]); - } - } - } - - for(j = 0; j < 256; j++) - r[j] = fqmul(r[j], f); -} - -static void basemul(sign16 r[2], const sign16 a[2], const sign16 b[2], sign16 zeta) { - r[0] = fqmul(a[1], b[1]); - r[0] = fqmul(r[0], zeta); - r[0] += fqmul(a[0], b[0]); - r[1] = fqmul(a[0], b[1]); - r[1] += fqmul(a[1], b[0]); -} - -static void poly_reduce(sign16 *r) -{ - int i; - for(i=0;i>bt)&1; -} - -// centered binomial distribution -static void CBD(byte bts[],int eta,sign16 f[KY_DEGREE]) -{ - int a,b; - for (int i=0;i>bts; - sign16 mask=(1<=8) - { - bts-=8; - ptr++; - } - w=r&mask; - return w; -} - -// array t has ab active bits per word -// extract bytes from array of words -// if max!=0 then -max<=t[i]<=+max -static byte nextbyte16(int ab,sign16 t[],int &ptr, int &bts) -{ - sign16 r,w; - int left=ab-bts; // number of bits left in this word - int i=0; - - w=t[ptr]; w+=(w>>15)&KY_PRIME; - r=w>>bts; - while (left<8) - { - i++; - w=t[ptr+i]; w+=(w>>15)&KY_PRIME; - r|=w<=ab) - { - bts-=ab; - ptr++; - } - return (byte)r&0xff; -} - -// encode polynomial vector of length len with coefficients of length L, into packed bytes -static void encode(sign16 t[],int len,int L,byte pack[]) -{ - int ptr,bts,n; - ptr=bts=0; - for (n=0;n>31); - x-=qpart*0xD01; q += qpart; - - qpart=(int32_t)(((int64_t)x*645083)>>31)+1; - x-=qpart*0xD01; q += qpart+(x>>31); - - return q; -} - -// compress polynomial coefficents in place, for polynomial vector of length len -static void compress(sign16 t[],int len,int d) -{ - sign32 twod=(1<>15)&KY_PRIME; - t[i]= (sign16)(safediv(twod*t[i]+KY_PRIME/2)&(twod-1)); - } -} - -// decompress polynomial coefficents in place, for polynomial vector of length len -static void decompress(sign16 t[],int len,int d) -{ - int twod1=(1<<(d-1)); - for (int i=0;i>d; -} - -// input entropy, output key pair -static void KYBER_CPA_keypair(const int *params,byte *tau,octet *sk,octet *pk) -{ - int i,j,k,row; - sha3 sh; - byte rho[32]; - byte sigma[33]; - byte buff[256]; - - int ck=params[0]; - sign16 r[KY_DEGREE]; - sign16 w[KY_DEGREE]; - sign16 Aij[KY_DEGREE]; -#ifdef USE_VLAS - sign16 s[ck*KY_DEGREE]; - sign16 e[ck*KY_DEGREE]; - sign16 p[ck*KY_DEGREE]; -#else - sign16 s[KY_MAXK*KY_DEGREE]; - sign16 e[KY_MAXK*KY_DEGREE]; - sign16 p[KY_MAXK*KY_DEGREE]; -#endif - - int eta1=params[1]; - int public_key_size=32+ck*(KY_DEGREE*3)/2; - int secret_cpa_key_size=ck*(KY_DEGREE*3)/2; - - SHA3_init(&sh,SHA3_HASH512); - - for (i=0;i<32;i++) - SHA3_process(&sh,tau[i]); - SHA3_hash(&sh,(char *)buff); - for (i=0;i<32;i++) - { - rho[i]=buff[i]; - sigma[i]=buff[i+32]; - } - sigma[32]=0; // N - -// create s - for (i=0;ival); - sk->len=secret_cpa_key_size; - encode(p,ck,12,(byte *)pk->val); - pk->len=public_key_size; - for (i=0;i<32;i++) - pk->val[public_key_size-32+i]=rho[i]; -} - -// input 64 random bytes, output secret and public keys -static void KYBER_CCA_keypair(const int *params,byte *randbytes64,octet *sk,octet *pk) -{ - int i; - sha3 sh; - byte h[32]; - - KYBER_CPA_keypair(params,randbytes64,sk,pk); - OCT_joctet(sk,pk); - - SHA3_init(&sh,SHA3_HASH256); - for (i=0;ilen;i++) - SHA3_process(&sh,(byte)pk->val[i]); - SHA3_hash(&sh,(char *)h); - OCT_jbytes(sk,(char *)h,32); - OCT_jbytes(sk,(char *)&randbytes64[32],32); -} - -static void KYBER_CPA_base_encrypt(const int *params,byte *coins,octet *pk,octet *ss,sign16 *u, sign16* v) -{ - int i,row,j,len; - sha3 sh; - byte sigma[33]; - byte buff[256]; - byte rho[32]; - - int ck=params[0]; - sign16 r[KY_DEGREE]; - sign16 w[KY_DEGREE]; - sign16 Aij[KY_DEGREE]; -#ifdef USE_VLAS - sign16 q[ck*KY_DEGREE]; - sign16 p[ck*KY_DEGREE]; -#else - sign16 q[KY_MAXK*KY_DEGREE]; - sign16 p[KY_MAXK*KY_DEGREE]; -#endif - - int eta1=params[1]; - int eta2=params[2]; - int du=params[3]; - int dv=params[4]; - int public_key_size=32+ck*(KY_DEGREE*3)/2; - - for (i=0;i<32;i++) - sigma[i]=coins[i];//i+6; //RAND_byte(RNG); - sigma[32]=0; - - for (i=0;i<32;i++) - rho[i]=pk->val[pk->len-32+i]; - -// create q - for (i=0;ival,12,p,ck); - - poly_mul(v,p,q); - for (i=1;ival,1,r,1); - decompress(r,1,1); - - poly_add(v,v,r); - poly_reduce(v); - - compress(u,ck,du); - compress(v,1,dv); -} - -// Given input of entropy, public key and shared secret is an input, outputs ciphertext -static void KYBER_CPA_encrypt(const int *params,byte *coins,octet *pk,octet *ss,octet *ct) -{ - int ck=params[0]; - sign16 v[KY_DEGREE]; -#ifdef USE_VLAS - sign16 u[ck*KY_DEGREE]; -#else - sign16 u[KY_MAXK*KY_DEGREE]; -#endif - - int du=params[3]; - int dv=params[4]; - int ciphertext_size=(du*ck+dv)*KY_DEGREE/8; - KYBER_CPA_base_encrypt(params,coins,pk,ss,u,v); - encode(u,ck,du,(byte *)ct->val); - encode(v,1,dv,(byte *)&ct->val[ciphertext_size-(dv*KY_DEGREE/8)]); - ct->len=ciphertext_size; -} - -// Re-encrypt and check that ct is OK (if so return is zero) -static byte KYBER_CPA_check_encrypt(const int *params,byte *coins,octet *pk,octet *ss,octet *ct) -{ - int ck=params[0]; - sign16 v[KY_DEGREE]; -#ifdef USE_VLAS - sign16 u[ck*KY_DEGREE]; -#else - sign16 u[KY_MAXK*KY_DEGREE]; -#endif - int du=params[3]; - int dv=params[4]; - int ciphertext_size=(du*ck+dv)*KY_DEGREE/8; - byte d1,d2; - KYBER_CPA_base_encrypt(params,coins,pk,ss,u,v); - d1=chk_encode(u,ck,du,(byte *)ct->val); - d2=chk_encode(v,1,dv,(byte *)&ct->val[ciphertext_size-(dv*KY_DEGREE/8)]); - if ((d1|d2)==0) - return 0; - else - return 0xff; -} - -// Given entropy and public key, outputs 32-byte shared secret and ciphertext -static void KYBER_CCA_encrypt(const int *params,byte *randbytes32,octet *pk,octet *ss,octet *ct) -{ - int i; - sha3 sh; - byte h[32],hm[32],g[64],coins[32]; - octet HM={32,sizeof(hm),(char *)hm}; - int ck=params[0]; - int du=params[3]; - int dv=params[4]; - int shared_secret_size=params[5]; - - SHA3_init(&sh,SHA3_HASH256); // H(m) - for (i=0;i<32;i++) - SHA3_process(&sh,randbytes32[i]); - SHA3_hash(&sh,(char *)hm); - - SHA3_init(&sh,SHA3_HASH256); // H(pk) - for (i=0;ilen;i++) - SHA3_process(&sh,(byte)pk->val[i]); - SHA3_hash(&sh,(char *)h); - - SHA3_init(&sh,SHA3_HASH512); // Kb,r = G(H(m)|H(pk) - for (i=0;i<32;i++) - SHA3_process(&sh,hm[i]); - for (i=0;i<32;i++) - SHA3_process(&sh,h[i]); - SHA3_hash(&sh,(char *)g); - - for (i=0;i<32;i++) - coins[i]=g[i+32]; - KYBER_CPA_encrypt(params,coins,pk,&HM,ct); - - SHA3_init(&sh,SHA3_HASH256); // H(ct) - for (i=0;ilen;i++) - SHA3_process(&sh,(byte)ct->val[i]); - SHA3_hash(&sh,(char *)h); - - SHA3_init(&sh,SHAKE256); // K=KDF(Kb|H(ct)) - for (i=0;i<32;i++) - SHA3_process(&sh,g[i]); - for (i=0;i<32;i++) - SHA3_process(&sh,h[i]); - - SHA3_shake(&sh,ss->val,shared_secret_size); // could be any length? - ss->len=shared_secret_size; -} - -// Input secret key and ciphertext, outputs shared 32-byte secret -static void KYBER_CPA_decrypt(const int *params,octet *sk,octet *ct,octet *ss) -{ - int i,j,row; - int ck=params[0]; - sign16 w[KY_DEGREE]; - sign16 v[KY_DEGREE]; - sign16 r[KY_DEGREE]; -#ifdef USE_VLAS - sign16 u[ck*KY_DEGREE]; - sign16 s[ck*KY_DEGREE]; -#else - sign16 u[KY_MAXK*KY_DEGREE]; - sign16 s[KY_MAXK*KY_DEGREE]; -#endif - - int du=params[3]; - int dv=params[4]; - int shared_secret_size=params[5]; - - decode((byte *)ct->val,du,u,ck); - decode((byte *)&ct->val[du*ck*KY_DEGREE/8],dv,v,1); - decompress(u,ck,du); - decompress(v,1,dv); - decode((byte *)sk->val,12,s,ck); - - poly_ntt(u); - poly_mul(w,u,s); - for (i=1;ival); - ss->len=shared_secret_size; -} - -static void KYBER_CCA_decrypt(const int *params,octet *sk,octet *ct,octet *ss) -{ - int i,olen,same; - sha3 sh; - byte h[32],z[32],m[32],coins[32],g[64],mask; - octet M={32,sizeof(m),(char *)m}; - int ck=params[0]; - int du=params[3]; - int dv=params[4]; - int secret_cpa_key_size=ck*(KY_DEGREE*3)/2; - int public_key_size=32+ck*(KY_DEGREE*3)/2; - int shared_secret_size=params[5]; - octet PK={public_key_size,public_key_size,&sk->val[secret_cpa_key_size]}; // public key is here - - olen=sk->len; - sk->len=secret_cpa_key_size; // chop off CPA secret - for (i=0;i<32;i++) - h[i]=sk->val[secret_cpa_key_size+public_key_size+i]; - for (i=0;i<32;i++) - z[i]=sk->val[secret_cpa_key_size+public_key_size+32+i]; - - KYBER_CPA_decrypt(params,sk,ct,&M); - - SHA3_init(&sh,SHA3_HASH512); // Kb,r = G(H(m)|H(pk) - for (i=0;i<32;i++) - SHA3_process(&sh,m[i]); - for (i=0;i<32;i++) - SHA3_process(&sh,h[i]); - SHA3_hash(&sh,(char *)g); - - for (i=0;i<32;i++) - coins[i]=g[i+32]; - mask=KYBER_CPA_check_encrypt(params,coins,&PK,&M,ct); // encrypt again with public key - FO transform CPA->CCA - - for (i=0;i<32;i++) - g[i]^=(g[i]^z[i])&mask; // substitute z for Kb on failure - - SHA3_init(&sh,SHA3_HASH256); // H(ct) - for (i=0;ilen;i++) - SHA3_process(&sh,(byte)ct->val[i]); - SHA3_hash(&sh,(char *)h); - - SHA3_init(&sh,SHAKE256); // K=KDF(Kb|H(ct)) - for (i=0;i<32;i++) - SHA3_process(&sh,g[i]); - for (i=0;i<32;i++) - SHA3_process(&sh,h[i]); - - SHA3_shake(&sh,ss->val,shared_secret_size); // could be any length? - ss->len=shared_secret_size; - sk->len=olen; // restore length -} - -// ********************* Kyber API ****************************** - -void core::KYBER512_keypair(byte *r64,octet *SK,octet *PK) -{ - KYBER_CCA_keypair(PARAMS_512,r64,SK,PK); -} - -void core::KYBER768_keypair(byte *r64,octet *SK,octet *PK) -{ - KYBER_CCA_keypair(PARAMS_768,r64,SK,PK); -} - -void core::KYBER1024_keypair(byte *r64,octet *SK,octet *PK) -{ - KYBER_CCA_keypair(PARAMS_1024,r64,SK,PK); -} - -void core::KYBER512_encrypt(byte *r32,octet *PK,octet *SS,octet *CT) -{ - KYBER_CCA_encrypt(PARAMS_512,r32,PK,SS,CT); -} - -void core::KYBER768_encrypt(byte *r32,octet *PK,octet *SS,octet *CT) -{ - KYBER_CCA_encrypt(PARAMS_768,r32,PK,SS,CT); -} - -void core::KYBER1024_encrypt(byte *r32,octet *PK,octet *SS,octet *CT) -{ - KYBER_CCA_encrypt(PARAMS_1024,r32,PK,SS,CT); -} - -void core::KYBER512_decrypt(octet *SK,octet *CT,octet *SS) -{ - KYBER_CCA_decrypt(PARAMS_512,SK,CT,SS); -} - -void core::KYBER768_decrypt(octet *SK,octet *CT,octet *SS) -{ - KYBER_CCA_decrypt(PARAMS_768,SK,CT,SS); -} - -void core::KYBER1024_decrypt(octet *SK,octet *CT,octet *SS) -{ - KYBER_CCA_decrypt(PARAMS_1024,SK,CT,SS); -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin.cpp deleted file mode 100644 index 8261cf9..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* MPIN 128-bit API Functions */ - -/* Version 3.0 */ - -#include -#include -#include -#include -#include "mpin_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -#define ROUNDUP(a,b) ((a)-1)/(b)+1 - -/* Encode octet to curve point */ -void ZZZ::MPIN_ENCODE_TO_CURVE(octet *DST,octet *ID,octet *HCID) -{ - int j,k,m,L; - char okm[512],fd[256]; - BIG q,r,w; - ECP P; - FP u; - DBIG dx; - octet OKM = {0,sizeof(okm),okm}; - BIG_rcopy(q,Modulus); - k=BIG_nbits(q); - BIG_rcopy(r, CURVE_Order); - m=BIG_nbits(r); - L=ROUNDUP(k+ROUNDUP(m,2),8); - XMD_Expand(MC_SHA2,HASH_TYPE_ZZZ,&OKM,L,DST,ID); - for (j=0;jval, s); - S->len = MODBYTES_XXX; - return 0; -} - -/* Extract PIN from TOKEN for identity CID */ -int ZZZ::MPIN_EXTRACT_PIN(octet *CID, int pin, octet *TOKEN) -{ - ECP P, R; - int res = 0; - pin %= MAXPIN; - - if (!ECP_fromOctet(&P, TOKEN)) res = MPIN_INVALID_POINT; - if (res == 0) - { - if (!ECP_fromOctet(&R,CID)) res=MPIN_INVALID_POINT; - } - if (res==0) - { - ECP_pinmul(&R, pin, PBLEN); - ECP_sub(&P, &R); - ECP_toOctet(TOKEN, &P, false); - } - return res; -} - -/* Implement step 2 on client side of MPin protocol - SEC=-(x+y)*SEC */ -int ZZZ::MPIN_CLIENT_2(octet *X, octet *Y, octet *SEC) -{ - BIG px, py, r; - ECP P; - int res = 0; - BIG_rcopy(r, CURVE_Order); - if (!ECP_fromOctet(&P, SEC)) res = MPIN_INVALID_POINT; - if (res == 0) - { - BIG_fromBytes(px, X->val); - BIG_fromBytes(py, Y->val); - BIG_add(px, px, py); - BIG_mod(px, r); - PAIR_G1mul(&P, px); - ECP_neg(&P); - ECP_toOctet(SEC, &P, false); /* change to TRUE for point compression */ - } - return res; -} - -/* Client secret CST=s*IDHTC where IDHTC is client ID hashed to a curve point, and s is the master secret */ -int ZZZ::MPIN_GET_CLIENT_SECRET(octet *S, octet *IDHTC, octet *CST) -{ - ECP P; - BIG s; - int res = 0; - BIG_fromBytes(s, S->val); - if (!ECP_fromOctet(&P, IDHTC)) res = MPIN_INVALID_POINT; - - if (res==0) - { - PAIR_G1mul(&P, s); - ECP_toOctet(CST, &P, false); /* change to TRUE for point compression */ - } - return res; -} - -/* Implement step 1 on client side of MPin protocol */ -int ZZZ::MPIN_CLIENT_1(octet *CID, csprng *RNG, octet *X, int pin, octet *TOKEN, octet *SEC, octet *xID) -{ - BIG r, x; - ECP P, T, W; - int res = 0; - - BIG_rcopy(r, CURVE_Order); - if (RNG != NULL) - { - BIG_randtrunc(x, r, 2 * CURVE_SECURITY_ZZZ, RNG); - X->len = MODBYTES_XXX; - BIG_toBytes(X->val, x); - } - else - BIG_fromBytes(x, X->val); - - if (!ECP_fromOctet(&P,CID)) res=MPIN_INVALID_POINT; - - if (res==0) - { - if (!ECP_fromOctet(&T, TOKEN)) res = MPIN_INVALID_POINT; - } - if (res == 0) - { - pin %= MAXPIN; - - ECP_copy(&W, &P); // W=H(ID) - ECP_pinmul(&W, pin, PBLEN); // W=alpha.H(ID) - ECP_add(&T, &W); // T=Token+alpha.H(ID) = s.H(ID) - PAIR_G1mul(&P, x); // P=x.H(ID) - ECP_toOctet(xID, &P, false); // xID /* change to TRUE for point compression */ - } - - if (res == 0) - { - ECP_toOctet(SEC, &T, false); // V /* change to TRUE for point compression */ - } - return res; -} - -/* Extract Server Secret SST=S*Q where Q is fixed generator in G2 and S is master secret */ -int ZZZ::MPIN_GET_SERVER_SECRET(octet *S, octet *SST) -{ - BIG r, s; - ECP2 Q; - int res = 0; - BIG_rcopy(r, CURVE_Order); - ECP2_generator(&Q); - if (res == 0) - { - BIG_fromBytes(s, S->val); - PAIR_G2mul(&Q, s); - ECP2_toOctet(SST, &Q, false); - } - return res; -} - -/* Implement M-Pin on server side */ -int ZZZ::MPIN_SERVER(octet *HID, octet *Y, octet *SST, octet *xID, octet *mSEC) -{ - BIG y; - FP12 g; - ECP2 Q, sQ; - ECP P, R; - int res = 0; - - ECP2_generator(&Q); - if (!ECP2_fromOctet(&sQ, SST)) res = MPIN_INVALID_POINT; - if (res == 0) - { - if (!ECP_fromOctet(&R, xID)) res = MPIN_INVALID_POINT; - } - if (res == 0) - { - BIG_fromBytes(y, Y->val); - if (!ECP_fromOctet(&P, HID)) res = MPIN_INVALID_POINT; - } - if (res == 0) - { - PAIR_G1mul(&P, y); - ECP_add(&P, &R); - if (!ECP_fromOctet(&R, mSEC)) res = MPIN_INVALID_POINT; // V - } - if (res == 0) - { - PAIR_double_ate(&g, &Q, &R, &sQ, &P); - PAIR_fexp(&g); - - if (!FP12_isunity(&g)) - { - res = MPIN_BAD_PIN; - } - } - return res; -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin192.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin192.cpp deleted file mode 100644 index 1aa6471..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin192.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* MPIN 192-bit API Functions */ - -/* Version 3.0 */ - -#include -#include -#include -#include -#include "mpin192_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -#define ROUNDUP(a,b) ((a)-1)/(b)+1 - -void ZZZ::MPIN_ENCODE_TO_CURVE(octet *DST,octet *ID,octet *HCID) -{ - int j,k,m,L; - char okm[512],fd[256]; - BIG q,r,w; - ECP P; - FP u; - DBIG dx; - octet OKM = {0,sizeof(okm),okm}; - BIG_rcopy(q,Modulus); - k=BIG_nbits(q); - BIG_rcopy(r, CURVE_Order); - m=BIG_nbits(r); - L=ROUNDUP(k+ROUNDUP(m,2),8); - XMD_Expand(MC_SHA2,HASH_TYPE_ZZZ,&OKM,L,DST,ID); - for (j=0;jval, s); - S->len = MODBYTES_XXX; - return 0; -} - -/* Extract PIN from TOKEN for identity CID */ -int ZZZ::MPIN_EXTRACT_PIN(octet *CID, int pin, octet *TOKEN) -{ - ECP P, R; - int res = 0; - pin %= MAXPIN; - - if (!ECP_fromOctet(&P, TOKEN)) res = MPIN_INVALID_POINT; - if (res == 0) - { - if (!ECP_fromOctet(&R,CID)) res=MPIN_INVALID_POINT; - } - if (res==0) - { - ECP_pinmul(&R, pin, PBLEN); - ECP_sub(&P, &R); - ECP_toOctet(TOKEN, &P, false); - } - return res; -} - -/* Implement step 2 on client side of MPin protocol - SEC=-(x+y)*SEC */ -int ZZZ::MPIN_CLIENT_2(octet *X, octet *Y, octet *SEC) -{ - BIG px, py, r; - ECP P; - int res = 0; - BIG_rcopy(r, CURVE_Order); - if (!ECP_fromOctet(&P, SEC)) res = MPIN_INVALID_POINT; - if (res == 0) - { - BIG_fromBytes(px, X->val); - BIG_fromBytes(py, Y->val); - BIG_add(px, px, py); - BIG_mod(px, r); - PAIR_G1mul(&P, px); - ECP_neg(&P); - ECP_toOctet(SEC, &P, false); - } - return res; -} - -/* Client secret CST=s*IDHTC where IDHTC is client ID hashed to a curve point, and s is the master secret */ -int ZZZ::MPIN_GET_CLIENT_SECRET(octet *S, octet *IDHTC, octet *CST) -{ - ECP P; - BIG s; - int res = 0; - BIG_fromBytes(s, S->val); - if (!ECP_fromOctet(&P, IDHTC)) res = MPIN_INVALID_POINT; - if (res==0) - { - PAIR_G1mul(&P, s); - ECP_toOctet(CST, &P, false); /* change to TRUE for point compression */ - } - return res; -} - -/* Implement step 1 on client side of MPin protocol */ -int ZZZ::MPIN_CLIENT_1(octet *CID, csprng *RNG, octet *X, int pin, octet *TOKEN, octet *SEC, octet *xID) -{ - BIG r, x; - ECP P, T, W; - int res = 0; - BIG_rcopy(r, CURVE_Order); - if (RNG != NULL) - { - BIG_randtrunc(x, r, 2 * CURVE_SECURITY_ZZZ, RNG); - X->len = MODBYTES_XXX; - BIG_toBytes(X->val, x); - } - else - BIG_fromBytes(x, X->val); - - if (!ECP_fromOctet(&P,CID)) res=MPIN_INVALID_POINT; - - if (res==0) - { - if (!ECP_fromOctet(&T, TOKEN)) res = MPIN_INVALID_POINT; - } - if (res == 0) - { - pin %= MAXPIN; - ECP_copy(&W, &P); // W=H(ID) - ECP_pinmul(&W, pin, PBLEN); // W=alpha.H(ID) - ECP_add(&T, &W); // T=Token+alpha.H(ID) = s.H(ID) - PAIR_G1mul(&P, x); // P=x.H(ID) - ECP_toOctet(xID, &P, false); // xID - } - - if (res == 0) - { - ECP_toOctet(SEC, &T, false); // V - } - return res; -} - -/* Extract Server Secret SST=S*Q where Q is fixed generator in G2 and S is master secret */ -int ZZZ::MPIN_GET_SERVER_SECRET(octet *S, octet *SST) -{ - BIG r, s; - ECP4 Q; - int res = 0; - BIG_rcopy(r, CURVE_Order); - ECP4_generator(&Q); - if (res == 0) - { - BIG_fromBytes(s, S->val); - PAIR_G2mul(&Q, s); - ECP4_toOctet(SST, &Q, false); - } - return res; -} - -/* Implement M-Pin on server side */ -int ZZZ::MPIN_SERVER(octet *HID, octet *Y, octet *SST, octet *xID, octet *mSEC) -{ - BIG y; - FP24 g; - ECP4 Q, sQ; - ECP P, R; - int res = 0; - ECP4_generator(&Q); - - if (!ECP4_fromOctet(&sQ, SST)) res = MPIN_INVALID_POINT; - if (res == 0) - { - if (!ECP_fromOctet(&R, xID)) res = MPIN_INVALID_POINT; - } - if (res == 0) - { - BIG_fromBytes(y, Y->val); - if (!ECP_fromOctet(&P, HID)) res = MPIN_INVALID_POINT; - } - if (res == 0) - { - PAIR_G1mul(&P, y); // y(A+AT) - ECP_add(&P, &R); // x(A+AT)+y(A+T) - if (!ECP_fromOctet(&R, mSEC)) res = MPIN_INVALID_POINT; // V - } - if (res == 0) - { - PAIR_double_ate(&g, &Q, &R, &sQ, &P); - PAIR_fexp(&g); - if (!FP24_isunity(&g)) - { - res = MPIN_BAD_PIN; - } - } - return res; -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin256.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin256.cpp deleted file mode 100644 index 14230c6..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/mpin256.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* MPIN 256-bit API Functions */ - -/* Version 3.0 */ - -#include -#include -#include -#include -#include "mpin256_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -#define ROUNDUP(a,b) ((a)-1)/(b)+1 - -void ZZZ::MPIN_ENCODE_TO_CURVE(octet *DST,octet *ID,octet *HCID) -{ - int j,k,m,L; - char okm[512],fd[256]; - BIG q,r,w; - ECP P; - FP u; - DBIG dx; - octet OKM = {0,sizeof(okm),okm}; - BIG_rcopy(q,Modulus); - k=BIG_nbits(q); - BIG_rcopy(r, CURVE_Order); - m=BIG_nbits(r); - L=ROUNDUP(k+ROUNDUP(m,2),8); - XMD_Expand(MC_SHA2,HASH_TYPE_ZZZ,&OKM,L,DST,ID); - for (j=0;jval, s); - S->len = MODBYTES_XXX; - return 0; -} - -/* Extract PIN from TOKEN for identity CID */ -int ZZZ::MPIN_EXTRACT_PIN(octet *CID, int pin, octet *TOKEN) -{ - ECP P, R; - int res = 0; - pin %= MAXPIN; - if (!ECP_fromOctet(&P, TOKEN)) res = MPIN_INVALID_POINT; - if (res == 0) - { - if (!ECP_fromOctet(&R,CID)) res=MPIN_INVALID_POINT; - } - if (res==0) - { - ECP_pinmul(&R, pin, PBLEN); - ECP_sub(&P, &R); - ECP_toOctet(TOKEN, &P, false); - } - return res; -} - -/* Implement step 2 on client side of MPin protocol - SEC=-(x+y)*SEC */ -int ZZZ::MPIN_CLIENT_2(octet *X, octet *Y, octet *SEC) -{ - BIG px, py, r; - ECP P; - int res = 0; - BIG_rcopy(r, CURVE_Order); - if (!ECP_fromOctet(&P, SEC)) res = MPIN_INVALID_POINT; - if (res == 0) - { - BIG_fromBytes(px, X->val); - BIG_fromBytes(py, Y->val); - BIG_add(px, px, py); - BIG_mod(px, r); - PAIR_G1mul(&P, px); - ECP_neg(&P); - ECP_toOctet(SEC, &P, false); - } - return res; -} - -/* Client secret CST=s*IDHTC where IDHTC is client ID hashed to a curve point, and s is the master secret */ -int ZZZ::MPIN_GET_CLIENT_SECRET(octet *S, octet *IDHTC, octet *CST) -{ - ECP P; - BIG s; - int res = 0; - BIG_fromBytes(s, S->val); - if (!ECP_fromOctet(&P, IDHTC)) res = MPIN_INVALID_POINT; - if (res==0) - { - PAIR_G1mul(&P, s); - ECP_toOctet(CST, &P, false); /* change to TRUE for point compression */ - } - return res; -} - -/* Implement step 1 on client side of MPin protocol */ -int ZZZ::MPIN_CLIENT_1(octet *CID, csprng *RNG, octet *X, int pin, octet *TOKEN, octet *SEC, octet *xID) -{ - BIG r, x; - ECP P, T, W; - int res = 0; - BIG_rcopy(r, CURVE_Order); - if (RNG != NULL) - { - BIG_randtrunc(x, r, 2 * CURVE_SECURITY_ZZZ, RNG); - X->len = MODBYTES_XXX; - BIG_toBytes(X->val, x); - } - else - BIG_fromBytes(x, X->val); - - if (!ECP_fromOctet(&P,CID)) res=MPIN_INVALID_POINT; - - if (res==0) - { - if (!ECP_fromOctet(&T, TOKEN)) res = MPIN_INVALID_POINT; - } - if (res == 0) - { - pin %= MAXPIN; - ECP_copy(&W, &P); // W=H(ID) - ECP_pinmul(&W, pin, PBLEN); // W=alpha.H(ID) - ECP_add(&T, &W); // T=Token+alpha.H(ID) = s.H(ID) - PAIR_G1mul(&P, x); // P=x.H(ID) - ECP_toOctet(xID, &P, false); // xID - } - if (res == 0) - { - ECP_toOctet(SEC, &T, false); // V - } - return res; -} - -/* Extract Server Secret SST=S*Q where Q is fixed generator in G2 and S is master secret */ -int ZZZ::MPIN_GET_SERVER_SECRET(octet *S, octet *SST) -{ - BIG r, s; - ECP8 Q; - int res = 0; - BIG_rcopy(r, CURVE_Order); - ECP8_generator(&Q); - if (res == 0) - { - BIG_fromBytes(s, S->val); - PAIR_G2mul(&Q, s); - ECP8_toOctet(SST, &Q, false); - } - return res; -} - -/* Implement M-Pin on server side */ -int ZZZ::MPIN_SERVER(octet *HID, octet *Y, octet *SST, octet *xID, octet *mSEC) -{ - BIG y; - FP48 g; - ECP8 Q, sQ; - ECP P, R; - int res = 0; - ECP8_generator(&Q); - - if (!ECP8_fromOctet(&sQ, SST)) res = MPIN_INVALID_POINT; - - if (res == 0) - { - if (!ECP_fromOctet(&R, xID)) res = MPIN_INVALID_POINT; - } - if (res == 0) - { - BIG_fromBytes(y, Y->val); - if (!ECP_fromOctet(&P, HID)) res = MPIN_INVALID_POINT; - } - if (res == 0) - { - PAIR_G1mul(&P, y); // y(A+AT) - ECP_add(&P, &R); // x(A+AT)+y(A+T) - if (!ECP_fromOctet(&R, mSEC)) res = MPIN_INVALID_POINT; // V - } - if (res == 0) - { - PAIR_double_ate(&g, &Q, &R, &sQ, &P); - PAIR_fexp(&g); - if (!FP48_isunity(&g)) - { - res = MPIN_BAD_PIN; - } - } - return res; -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/newhope.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/newhope.cpp deleted file mode 100644 index b3b4c4c..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/newhope.cpp +++ /dev/null @@ -1,517 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* NewHope API implementation. Constant time. - - LOOK - no if statements! - - M.Scott 21/07/2017 -*/ - -#include "newhope.h" - -using namespace core; - -const sign16 roots[] = {0x2ac8, 0x2baf, 0x299b, 0x685, 0x2f04, 0x158d, 0x2d49, 0x24b5, 0x1edc, 0xab3, 0x2a95, 0x24d, 0x3cb, 0x6a8, 0x12f9, 0x15ba, 0x1861, 0x2a89, 0x1c5c, 0xbe6, 0xc1e, 0x2024, 0x207, 0x19ce, 0x2710, 0x1744, 0x18bc, 0x2cd7, 0x396, 0x18d5, 0x1c45, 0xc4, 0x21a6, 0xe03, 0x2b3c, 0x2d91, 0xc5d, 0x432, 0x1fbc, 0xcae, 0x2512, 0x2979, 0x3b2, 0x714, 0xb2e, 0x1a97, 0x1a03, 0x1bcd, 0x2216, 0x2701, 0xa, 0x263c, 0x1179, 0x200c, 0x2d08, 0x1c34, 0x291, 0x2c99, 0x2a5a, 0x723, 0xb1d, 0x1ccc, 0x1fb6, 0x2f58, 0x2bfe, 0x1cda, 0x2a0, 0x5f1, 0x2de, 0x1fc7, 0x1ea8, 0x1719, 0x2fa7, 0x27ec, 0x20ff, 0x12c0, 0x1ac1, 0x2232, 0x2f9b, 0xd3e, 0x2aed, 0x15f0, 0x11e8, 0xed0, 0x26a, 0x1de5, 0xa3f, 0xf43, 0xebf, 0x204e, 0xac7, 0x2d9c, 0x5ea, 0x25d1, 0xb6, 0x49c, 0x995, 0x2555, 0x26e2, 0x100, 0x1878, 0x5aa, 0x2e10, 0x271c, 0xcb, 0x1b4c, 0x2fb8, 0x25b7, 0x1543, 0x2c7b, 0x241a, 0x2223, 0x20ca, 0x24ed, 0x137, 0x1b65, 0x1dc2, 0x7c7, 0x2ec3, 0xd0c, 0x1169, 0x1c7a, 0x1ea1, 0xf89, 0x2199, 0x291d, 0x1088, 0x2046, 0x256d, 0x2bc7, 0x2e9b, 0x41f, 0x1b55, 0x2b38, 0xd0, 0x2e6a, 0x1755, 0x6bc, 0x2724, 0x3ba, 0x222e, 0x2c5c, 0x2da5, 0x213c, 0x10fe, 0x169a, 0x1552, 0x5d3, 0x300, 0x1b5d, 0x1342, 0x2004, 0x256f, 0x2039, 0x667, 0x23b5, 0x1123, 0xdb, 0x2da0, 0xe1e, 0x2f54, 0x2767, 0x154a, 0x40a, 0x11d3, 0x2821, 0xc09, 0x974, 0x694, 0xfbf, 0x27ba, 0x132, 0x83f, 0x2d06, 0x10e, 0x183f, 0x29ae, 0x28c3, 0x2dc9, 0x1144, 0x2c70, 0x2a4a, 0xf3c, 0x1e32, 0x1171, 0x1e43, 0xdd4, 0x2ddf, 0x28d2, 0xfac, 0x3c4, 0x2f19, 0x10a6, 0x2f7, 0xe1d, 0x828, 0x138f, 0x1332, 0xfab, 0xcf6, 0x13f8, 0x24a0, 0x112d, 0x2717, 0x6e7, 0x1044, 0x36e, 0xfe8, 0x6a, 0xba7, 0x1d69, 0x29ec, 0x23b2, 0xaee, 0x16df, 0x1068, 0x1a7e, 0x253f, 0x24c, 0xb33, 0x2683, 0x15ce, 0x1ad3, 0x1a36, 0xc96, 0xaea, 0x260a, 0xce, 0x28b1, 0xe4f, 0x2b11, 0x5f8, 0x1fc4, 0xe77, 0x2366, 0x11f9, 0x153c, 0x24eb, 0x20cd, 0x1398, 0x22, 0x2b97, 0x249b, 0x8eb, 0x12b2, 0x2fe3, 0x29c1, 0x1b00, 0x2663, 0xeaa, 0x2e06, 0xe0, 0x1569, 0x10f5, 0x284e, 0xa38, 0x201d, 0x1c53, 0x1681, 0x1f6f, 0x2f95, 0x2fe8, 0xacb, 0x1680, 0x17fd, 0x2c39, 0x165a, 0x10bb, 0x29d8, 0x2622, 0x1196, 0x884, 0x2a79, 0x140e, 0x2d80, 0x6fa, 0x11b2, 0x26c4, 0x355, 0x1054, 0x29e9, 0x23ed, 0xbe3, 0x24fa, 0x1fb3, 0x10ac, 0x2919, 0x2584, 0x10a4, 0xe85, 0x650, 0x1893, 0x1dc1, 0xd8e, 0x12dc, 0x2d42, 0x284d, 0xfff, 0x250f, 0xacd, 0x13c3, 0x6cc, 0x1a79, 0x1221, 0x2614, 0x270a, 0x1ea, 0x155, 0x2818, 0x222c, 0x2e5b, 0x25d8, 0x1dbf, 0x191c, 0xb0f, 0xdac, 0x1082, 0x12ef, 0x11b6, 0xfa8, 0x2b72, 0x159d, 0x209e, 0x31b, 0x2c7c, 0x14f7, 0xe09, 0x1bb2, 0x1ec7, 0x2404, 0x20ae, 0x6ad, 0xed6, 0x2b70, 0x1c7b, 0x18d1, 0x2732, 0x12da, 0xd56, 0x5c1, 0x1648, 0x18b7, 0x1605, 0x1bc4, 0x280, 0x2ece, 0xc, 0x1aae, 0x1c4, 0x1cdb, 0x22d6, 0x21d8, 0x257c, 0x51f, 0x211b, 0xff, 0x2ee0, 0x2585, 0xe1, 0x2c35, 0x26db, 0x2971, 0x2208, 0x17e1, 0x21be, 0x135e, 0x28d6, 0x2891, 0x1689, 0x2138, 0xb86, 0x2e3a, 0x1204, 0x2d10, 0x2324, 0xf3f, 0x2508, 0x33d, 0xcb2, 0x292a, 0xe27, 0x2e64, 0x29f8, 0x2d46, 0x9b7, 0x20eb, 0x1b7c, 0x9eb, 0x2b2a, 0x58c, 0x27d0, 0x121b, 0x272e, 0x29f6, 0x2dbd, 0x2697, 0x2aac, 0xd6f, 0x1c67, 0x2c5b, 0x108d, 0x363, 0x249d, 0x2d5e, 0x2fd, 0x2cb2, 0x1f8f, 0x20a4, 0xa19, 0x2ac9, 0x19b1, 0x1581, 0x17a2, 0x29eb, 0x1b72, 0x13b0, 0xee4, 0xa8f, 0x2315, 0x5e6, 0x951, 0x2e29, 0xdad, 0x1f2b, 0x224e, 0x37f, 0x1a72, 0xa91, 0x1407, 0x2df9, 0x3ad, 0x23f7, 0x1a24, 0x1d2a, 0x234b, 0x1df3, 0x1143, 0x7ff, 0x1a6d, 0x2774, 0x2690, 0x2ab5, 0x586, 0x2781, 0x2009, 0x2fdd, 0x2881, 0x399, 0x2fb6, 0x144, 0x137f, 0xfa0, 0x2e4c, 0x1c7f, 0x2fac, 0xb09, 0x1264, 0x127b, 0x198c, 0x2b40, 0x230, 0x1cf4, 0x180b, 0xb58, 0x144a, 0x2aec, 0xfb, 0x2602, 0x14ee, 0x783, 0x1098, 0x23d8, 0x203, 0xe9, 0x108a, 0x14b8, 0xeec, 0xc58, 0x1248, 0x243c, 0x28aa, 0x6bf, 0x27c4, 0x276e, 0x19b8, 0x1d11, 0x2e16, 0x472, 0x1464, 0x24b9, 0x662, 0x1097, 0x2067, 0x20d6, 0x171c, 0x4, 0x682, 0x17bb, 0x1186, 0x4f2, 0x3ff, 0x2a43, 0x1dc7, 0x1ae5, 0x8cc, 0x2e7c, 0x2ef8, 0x2ae0, 0x2904, 0xed4, 0x6c5, 0x14ae, 0xb72, 0x11c3, 0x337, 0x2da3, 0x2916, 0x6d8, 0x1cf9, 0x10ee, 0x1800, 0x1ae4, 0xa0d, 0x101b, 0x1a8d, 0x2e98, 0x24cd, 0x813, 0x1aa4, 0x9b9, 0x680, 0x2349, 0x24d1, 0x20f8, 0xe31, 0x249f, 0x216b, 0x12d9, 0x1d21, 0x19db, 0x191a, 0x1dd0, 0x5df, 0x55c, 0x2b86, 0x213, 0xe9e, 0x1ef1, 0x268a, 0x1d5e, 0x1e20, 0x28c1, 0x1379, 0x249, 0x19de, 0x18b, 0x1e41, 0x2a1e, 0x2612, 0x297, 0x2e96, 0x2102, 0x46, 0x1b9f, 0x1a4d, 0x2050, 0x1b32, 0x568, 0x11f7, 0x1829, 0x870, 0x1f4, 0x1dca, 0x990, 0x1df6, 0x2b62, 0x13ec, 0x9f2, 0x1260, 0x2997, 0x1412, 0x1e6d, 0x1694, 0x11ac, 0x2d8b, 0x276f, 0x26f5, 0x233e, 0x2b44, 0x2f5a, 0x2d37, 0x2cb1, 0xc75, 0x98d, 0x1d56, 0x7ae, 0x10e6, 0x113f, 0x17b8, 0xad3, 0x737, 0x221e, 0x1b70, 0x1f3e, 0x2966, 0x18b2, 0x4fa, 0x2044, 0x1312, 0x154e, 0x2029, 0x700, 0x1b45, 0x27a6, 0x226a, 0x21bf, 0x58d, 0x2f11, 0x2e02, 0x17fc, 0x4d2, 0x1757, 0xcb1, 0x2ef1, 0x2582, 0x1276, 0x881, 0x2fc0, 0x104a, 0x670, 0x274f, 0x2b53, 0x19dd, 0x752, 0x1663, 0xcbd, 0x2b2b, 0x2fc6, 0x13b6, 0x21e6, 0x15f6, 0x126b, 0x2637, 0x1cd9, 0x2f50, 0xe82, 0x5b0, 0x24e0, 0x1350, 0x2f24, 0x21f7, 0x1a16, 0x2f3e, 0x167e, 0x1f7d, 0x28a0, 0x16f0, 0xe33, 0x53b, 0x28c5, 0x1500, 0x2f88, 0x26cc, 0x2018, 0x1604, 0x218b, 0x2cd1, 0x9ee, 0x17f3, 0x5fd, 0x1f5a, 0x2d0, 0x2b46, 0x23cc, 0x503, 0x1c46, 0x1cc3, 0x28e2, 0x243e, 0x122b, 0x2e0c, 0xe37, 0x2611, 0x85e, 0x9b8, 0x1b24, 0x762, 0x19b6, 0x3bc, 0x2d50, 0x2079, 0x18da, 0x170a, 0x800, 0xaa2, 0x135a, 0x1a15, 0x13d1, 0xca, 0x2113, 0x2db9, 0xdb2, 0x1a5c, 0x29a9, 0x1488, 0x14c1, 0x2c9, 0x917, 0x28e7, 0x265c, 0xdab, 0x2ab9, 0x2bc6, 0x105b, 0x1839, 0x219c, 0x50, 0x11da, 0x1802, 0xf56, 0x2e6, 0x2190, 0xddb, 0x56e, 0x9d9, 0x1c81, 0x1016, 0x12d6, 0x296f, 0x14b4, 0x1014, 0x1e64, 0x1d90, 0x89f, 0x2bc2, 0x2777, 0x2819, 0x1c65, 0x1a41, 0x5a2, 0x2cd2, 0x427, 0xd71, 0x29c8, 0x1e58, 0x53f, 0x7c5, 0x1dcd, 0x4a1, 0x1268, 0x2597, 0x2926, 0xee, 0x111b, 0x1038, 0xe6c, 0x22dc, 0x2f2f, 0x441, 0x2cfd, 0x1cb0, 0x6a4, 0x2224, 0x620, 0x5dc, 0x16b1, 0x2a1d, 0x1787, 0x20c7, 0x641, 0xd84, 0x1c05, 0x2d0d, 0x2f52, 0x1b8c, 0xd7d, 0x17e8, 0x1589, 0xc73, 0x151b, 0x4e2, 0x1ae9, 0x1b18, 0xb9b, 0x949, 0x2c60, 0x1e7a, 0xd5, 0x1bdc, 0x1f57, 0x1753, 0x124a, 0x559, 0xb76, 0x2334, 0x12d1, 0x1de1, 0x14b2, 0x2faa, 0x1697, 0x147a, 0x5a1, 0x2c30, 0x1c02, 0x1043, 0x2ee1, 0x2402, 0x1cc8, 0x2a16, 0xff7, 0x1364, 0x1b9a, 0x2a53, 0x2f94, 0x294c, 0x1ee5, 0x1a87, 0x2141, 0xd66, 0x953, 0x28a3, 0x2f30, 0x2477, 0x18e3, 0x1035, 0x1fc1, 0x1d68, 0x2fb3, 0x138c, 0x2487, 0x1bf8, 0xd96, 0x1018, 0x748, 0x244e, 0x15bd, 0x175e, 0x2be, 0x23d, 0x1da, 0x176d, 0xc17, 0x24be, 0x2ebb, 0x7d8, 0x100a, 0x759, 0x1db4, 0x2259, 0x23f4, 0x2d59, 0x2847, 0xbf5, 0x1cfe, 0xa20, 0x258, 0x1180, 0x279c, 0x54, 0x2abf, 0xc5c, 0x9f9, 0x3d5, 0x2ce4, 0x165f, 0x23d9, 0x27b9, 0x6f9, 0x281a, 0x169e, 0x627, 0x156d, 0x1ff8, 0x211, 0x2e34, 0x1724, 0x2c2e, 0x2790, 0x2dd5, 0x2bf2, 0xdbc, 0x2884, 0x20a9, 0x2390, 0x1e1a, 0x1b6a, 0x5f7, 0xab7, 0x1333, 0x16ab, 0x28dd, 0x20, 0x30f, 0x24b6, 0x5c2, 0x1ce4, 0x1400, 0x2669, 0x60, 0x156c, 0xe20, 0x26d4, 0x26ab, 0x1ebb, 0x223d, 0x5b4, 0x2025, 0x1e1c, 0xaae, 0x2e08, 0x6cd, 0x1677, 0x13d9, 0x17b5, 0x1046, 0x1d8c, 0x14eb, 0x18d8, 0x1ce5, 0x2478, 0x16ae, 0xb79, 0x23d4, 0x684, 0x156b, 0x567, 0x1a, 0x29ce, 0x83a, 0x19e8, 0x58e, 0x294a, 0x1136, 0x2319, 0x2fba, 0x1a29, 0x1d, 0x1879, 0x291b, 0x19f6, 0x2c2f, 0x21c9, 0x19bb, 0xbbc, 0x26f9, 0xc22, 0x708, 0x11a1, 0x18d3, 0x7f8, 0x28f8, 0x2427, 0x1deb, 0xaed, 0x26aa, 0x2482, 0x203b, 0x2f05, 0x2b82, 0x192f, 0x2df4, 0x8dc, 0x2877, 0xd5e, 0x240e, 0x775, 0x2dae, 0x1d3e, 0x20ba, 0x215b, 0x22d1, 0xeba, 0xf50, 0xaa8, 0x184a, 0x1f67, 0x2e04, 0xc6e, 0x6dd, 0x1a09, 0x27f, 0x494, 0x1426, 0xae3, 0xe15, 0x65f, 0x13c4, 0x105, 0x872, 0x2667, 0x1ff6, 0xd9f, 0x2ca1, 0x2f39, 0x2657, 0x23fd, 0x2405, 0xb73, 0x2294, 0x1f1e, 0x2eba, 0x110a, 0x2cae, 0x141f, 0x22cd, 0x25d6, 0x11c1, 0x1c, 0x2d8e, 0x161a, 0x1aa8, 0x229e, 0x1bf9, 0x7cf, 0x106d, 0x2c40, 0xd93, 0x255e, 0x28c2, 0xc1a, 0x2f17, 0x7ca, 0x2f63, 0xbf}; -const sign16 iroots[] = {0x2ac8, 0x452, 0x297c, 0x666, 0xb4c, 0x2b8, 0x1a74, 0xfd, 0x1a47, 0x1d08, 0x2959, 0x2c36, 0x2db4, 0x56c, 0x254e, 0x1125, 0x2f3d, 0x13bc, 0x172c, 0x2c6b, 0x32a, 0x1745, 0x18bd, 0x8f1, 0x1633, 0x2dfa, 0xfdd, 0x23e3, 0x241b, 0x13a5, 0x578, 0x17a0, 0xa9, 0x104b, 0x1335, 0x24e4, 0x28de, 0x5a7, 0x368, 0x2d70, 0x13cd, 0x2f9, 0xff5, 0x1e88, 0x9c5, 0x2ff7, 0x900, 0xdeb, 0x1434, 0x15fe, 0x156a, 0x24d3, 0x28ed, 0x2c4f, 0x688, 0xaef, 0x2353, 0x1045, 0x2bcf, 0x23a4, 0x270, 0x4c5, 0x21fe, 0xe5b, 0xfbb, 0x1f79, 0x6e4, 0xe68, 0x2078, 0x1160, 0x1387, 0x1e98, 0x22f5, 0x13e, 0x283a, 0x123f, 0x149c, 0x2eca, 0xb14, 0xf37, 0xdde, 0xbe7, 0x386, 0x1abe, 0xa4a, 0x49, 0x14b5, 0x2f36, 0x8e5, 0x1f1, 0x2a57, 0x1789, 0x2f01, 0x91f, 0xaac, 0x266c, 0x2b65, 0x2f4b, 0xa30, 0x2a17, 0x265, 0x253a, 0xfb3, 0x2142, 0x20be, 0x25c2, 0x121c, 0x2d97, 0x2131, 0x1e19, 0x1a11, 0x514, 0x22c3, 0x66, 0xdcf, 0x1540, 0x1d41, 0xf02, 0x815, 0x5a, 0x18e8, 0x1159, 0x103a, 0x2d23, 0x2a10, 0x2d61, 0x1327, 0x403, 0x25c9, 0x7b3, 0x1f0c, 0x1a98, 0x2f21, 0x1fb, 0x2157, 0x99e, 0x1501, 0x640, 0x1e, 0x1d4f, 0x2716, 0xb66, 0x46a, 0x2fdf, 0x1c69, 0xf34, 0xb16, 0x1ac5, 0x1e08, 0xc9b, 0x218a, 0x103d, 0x2a09, 0x4f0, 0x21b2, 0x750, 0x2f33, 0x9f7, 0x2517, 0x236b, 0x15cb, 0x152e, 0x1a33, 0x97e, 0x24ce, 0x2db5, 0xac2, 0x1583, 0x1f99, 0x1922, 0x2513, 0xc4f, 0x615, 0x1298, 0x245a, 0x2f97, 0x2019, 0x2c93, 0x1fbd, 0x291a, 0x8ea, 0x1ed4, 0xb61, 0x1c09, 0x230b, 0x2056, 0x1ccf, 0x1c72, 0x27d9, 0x21e4, 0x2d0a, 0x1f5b, 0xe8, 0x2c3d, 0x2055, 0x72f, 0x222, 0x222d, 0x11be, 0x1e90, 0x11cf, 0x20c5, 0x5b7, 0x391, 0x1ebd, 0x238, 0x73e, 0x653, 0x17c2, 0x2ef3, 0x2fb, 0x27c2, 0x2ecf, 0x847, 0x2042, 0x296d, 0x268d, 0x23f8, 0x7e0, 0x1e2e, 0x2bf7, 0x1ab7, 0x89a, 0xad, 0x21e3, 0x261, 0x2f26, 0x1ede, 0xc4c, 0x299a, 0xfc8, 0xa92, 0xffd, 0x1cbf, 0x14a4, 0x2d01, 0x2a2e, 0x1aaf, 0x1967, 0x1f03, 0xec5, 0x25c, 0x3a5, 0xdd3, 0x2c47, 0x8dd, 0x2945, 0x18ac, 0x197, 0x2f31, 0x4c9, 0x14ac, 0x2be2, 0x166, 0x43a, 0xa94, 0x1b53, 0x293c, 0x212d, 0x6fd, 0x521, 0x109, 0x185, 0x2735, 0x151c, 0x123a, 0x5be, 0x2c02, 0x2b0f, 0x1e7b, 0x1846, 0x297f, 0x2ffd, 0x18e5, 0xf2b, 0xf9a, 0x1f6a, 0x299f, 0xb48, 0x1b9d, 0x2b8f, 0x1eb, 0x12f0, 0x1649, 0x893, 0x83d, 0x2942, 0x757, 0xbc5, 0x1db9, 0x23a9, 0x2115, 0x1b49, 0x1f77, 0x2f18, 0x2dfe, 0xc29, 0x1f69, 0x287e, 0x1b13, 0x9ff, 0x2f06, 0x515, 0x1bb7, 0x24a9, 0x17f6, 0x130d, 0x2dd1, 0x4c1, 0x1675, 0x1d86, 0x1d9d, 0x24f8, 0x55, 0x1382, 0x1b5, 0x2061, 0x1c82, 0x2ebd, 0x4b, 0x2c68, 0x780, 0x24, 0xff8, 0x880, 0x2a7b, 0x54c, 0x971, 0x88d, 0x1594, 0x2802, 0x1ebe, 0x120e, 0xcb6, 0x12d7, 0x15dd, 0xc0a, 0x2c54, 0x208, 0x1bfa, 0x2570, 0x158f, 0x2c82, 0xdb3, 0x10d6, 0x2254, 0x1d8, 0x26b0, 0x2a1b, 0xcec, 0x2572, 0x211d, 0x1c51, 0x148f, 0x616, 0x185f, 0x1a80, 0x1650, 0x538, 0x25e8, 0xf5d, 0x1072, 0x34f, 0x2d04, 0x2a3, 0xb64, 0x2c9e, 0x1f74, 0x3a6, 0x139a, 0x2292, 0x555, 0x96a, 0x244, 0x60b, 0x8d3, 0x1de6, 0x831, 0x2a75, 0x4d7, 0x2616, 0x1485, 0xf16, 0x264a, 0x2bb, 0x609, 0x19d, 0x21da, 0x6d7, 0x234f, 0x2cc4, 0xaf9, 0x20c2, 0xcdd, 0x2f1, 0x1dfd, 0x1c7, 0x247b, 0xec9, 0x1978, 0x770, 0x72b, 0x1ca3, 0xe43, 0x1820, 0xdf9, 0x690, 0x926, 0x3cc, 0x2f20, 0xa7c, 0x121, 0x2f02, 0xee6, 0x2ae2, 0xa85, 0xe29, 0xd2b, 0x1326, 0x2e3d, 0x1553, 0x2ff5, 0x133, 0x2d81, 0x143d, 0x19fc, 0x174a, 0x19b9, 0x2a40, 0x22ab, 0x1d27, 0x8cf, 0x1730, 0x1386, 0x491, 0x212b, 0x2954, 0xf53, 0xbfd, 0x113a, 0x144f, 0x21f8, 0x1b0a, 0x385, 0x2ce6, 0xf63, 0x1a64, 0x48f, 0x2059, 0x1e4b, 0x1d12, 0x1f7f, 0x2255, 0x24f2, 0x16e5, 0x1242, 0xa29, 0x1a6, 0xdd5, 0x7e9, 0x2eac, 0x2e17, 0x8f7, 0x9ed, 0x1de0, 0x1588, 0x2935, 0x1c3e, 0x2534, 0xaf2, 0x2002, 0x7b4, 0x2bf, 0x1d25, 0x2273, 0x1240, 0x176e, 0x29b1, 0x217c, 0x1f5d, 0xa7d, 0x6e8, 0x1f55, 0x104e, 0xb07, 0x241e, 0xc14, 0x618, 0x1fad, 0x2cac, 0x93d, 0x1e4f, 0x2907, 0x281, 0x1bf3, 0x588, 0x277d, 0x1e6b, 0x9df, 0x629, 0x1f46, 0x19a7, 0x3c8, 0x1804, 0x1981, 0x2536, 0x19, 0x6c, 0x1092, 0x1980, 0x13ae, 0xfe4, 0x2f42, 0x9e, 0x2837, 0xea, 0x23e7, 0x73f, 0xaa3, 0x226e, 0x3c1, 0x1f94, 0x2832, 0x1408, 0xd63, 0x1559, 0x19e7, 0x273, 0x2fe5, 0x1e40, 0xa2b, 0xd34, 0x1be2, 0x353, 0x1ef7, 0x147, 0x10e3, 0xd6d, 0x248e, 0xbfc, 0xc04, 0x9aa, 0xc8, 0x360, 0x2262, 0x100b, 0x99a, 0x278f, 0x2efc, 0x1c3d, 0x29a2, 0x21ec, 0x251e, 0x1bdb, 0x2b6d, 0x2d82, 0x15f8, 0x2924, 0x2393, 0x1fd, 0x109a, 0x17b7, 0x2559, 0x20b1, 0x2147, 0xd30, 0xea6, 0xf47, 0x12c3, 0x253, 0x288c, 0xbf3, 0x22a3, 0x78a, 0x2725, 0x20d, 0x16d2, 0x47f, 0xfc, 0xfc6, 0xb7f, 0x957, 0x2514, 0x1216, 0xbda, 0x709, 0x2809, 0x172e, 0x1e60, 0x28f9, 0x23df, 0x908, 0x2445, 0x1646, 0xe38, 0x3d2, 0x160b, 0x6e6, 0x1788, 0x2fe4, 0x15d8, 0x47, 0xce8, 0x1ecb, 0x6b7, 0x2a73, 0x1619, 0x27c7, 0x633, 0x2fe7, 0x2a9a, 0x1a96, 0x297d, 0xc2d, 0x2488, 0x1953, 0xb89, 0x131c, 0x1729, 0x1b16, 0x1275, 0x1fbb, 0x184c, 0x1c28, 0x198a, 0x2934, 0x1f9, 0x2553, 0x11e5, 0xfdc, 0x2a4d, 0xdc4, 0x1146, 0x956, 0x92d, 0x21e1, 0x1a95, 0x2fa1, 0x998, 0x1c01, 0x131d, 0x2a3f, 0xb4b, 0x2cf2, 0x2fe1, 0x724, 0x1956, 0x1cce, 0x254a, 0x2a0a, 0x1497, 0x11e7, 0xc71, 0xf58, 0x77d, 0x2245, 0x40f, 0x22c, 0x871, 0x3d3, 0x18dd, 0x1cd, 0x2df0, 0x1009, 0x1a94, 0x29da, 0x1963, 0x7e7, 0x2908, 0x848, 0xc28, 0x19a2, 0x31d, 0x2c2c, 0x2608, 0x23a5, 0x542, 0x2fad, 0x865, 0x1e81, 0x2da9, 0x25e1, 0x1303, 0x240c, 0x7ba, 0x2a8, 0xc0d, 0xda8, 0x124d, 0x28a8, 0x1ff7, 0x2829, 0x146, 0xb43, 0x23ea, 0x1894, 0x2e27, 0x2dc4, 0x2d43, 0x18a3, 0x1a44, 0xbb3, 0x28b9, 0x1fe9, 0x226b, 0x1409, 0xb7a, 0x1c75, 0x4e, 0x1299, 0x1040, 0x1fcc, 0x171e, 0xb8a, 0xd1, 0x75e, 0x26ae, 0x229b, 0xec0, 0x157a, 0x111c, 0x6b5, 0x6d, 0x5ae, 0x1467, 0x1c9d, 0x200a, 0x5eb, 0x1339, 0xbff, 0x120, 0x1fbe, 0x13ff, 0x3d1, 0x2a60, 0x1b87, 0x196a, 0x57, 0x1b4f, 0x1220, 0x1d30, 0xccd, 0x248b, 0x2aa8, 0x1db7, 0x18ae, 0x10aa, 0x1425, 0x2f2c, 0x1187, 0x3a1, 0x26b8, 0x2466, 0x14e9, 0x1518, 0x2b1f, 0x1ae6, 0x238e, 0x1a78, 0x1819, 0x2284, 0x1475, 0xaf, 0x2f4, 0x13fc, 0x227d, 0x29c0, 0xf3a, 0x187a, 0x5e4, 0x1950, 0x2a25, 0x29e1, 0xddd, 0x295d, 0x1351, 0x304, 0x2bc0, 0xd2, 0xd25, 0x2195, 0x1fc9, 0x1ee6, 0x2f13, 0x6db, 0xa6a, 0x1d99, 0x2b60, 0x1234, 0x283c, 0x2ac2, 0x11a9, 0x639, 0x2290, 0x2bda, 0x32f, 0x2a5f, 0x15c0, 0x139c, 0x7e8, 0x88a, 0x43f, 0x2762, 0x1271, 0x119d, 0x1fed, 0x1b4d, 0x692, 0x1d2b, 0x1feb, 0x1380, 0x2628, 0x2a93, 0x2226, 0xe71, 0x2d1b, 0x20ab, 0x17ff, 0x1e27, 0x2fb1, 0xe65, 0x17c8, 0x1fa6, 0x43b, 0x548, 0x2256, 0x9a5, 0x71a, 0x26ea, 0x2d38, 0x1b40, 0x1b79, 0x658, 0x15a5, 0x224f, 0x248, 0xeee, 0x2f37, 0x1c30, 0x15ec, 0x1ca7, 0x255f, 0x2801, 0x18f7, 0x1727, 0xf88, 0x2b1, 0x2c45, 0x164b, 0x289f, 0x14dd, 0x2649, 0x27a3, 0x9f0, 0x21ca, 0x1f5, 0x1dd6, 0xbc3, 0x71f, 0x133e, 0x13bb, 0x2afe, 0xc35, 0x4bb, 0x2d31, 0x10a7, 0x2a04, 0x180e, 0x2613, 0x330, 0xe76, 0x19fd, 0xfe9, 0x935, 0x79, 0x1b01, 0x73c, 0x2ac6, 0x21ce, 0x1911, 0x761, 0x1084, 0x1983, 0xc3, 0x15eb, 0xe0a, 0xdd, 0x1cb1, 0xb21, 0x2a51, 0x217f, 0xb1, 0x1328, 0x9ca, 0x1d96, 0x1a0b, 0xe1b, 0x1c4b, 0x3b, 0x4d6, 0x2344, 0x199e, 0x28af, 0x1624, 0x4ae, 0x8b2, 0x2991, 0x1fb7, 0x41, 0x2780, 0x1d8b, 0xa7f, 0x110, 0x2350, 0x18aa, 0x2b2f, 0x1805, 0x1ff, 0xf0, 0x2a74, 0xe42, 0xd97, 0x85b, 0x14bc, 0x2901, 0xfd8, 0x1ab3, 0x1cef, 0xfbd, 0x2b07, 0x174f, 0x69b, 0x10c3, 0x1491, 0xde3, 0x28ca, 0x252e, 0x1849, 0x1ec2, 0x1f1b, 0x2853, 0x12ab, 0x2674, 0x238c, 0x350, 0x2ca, 0xa7, 0x4bd, 0xcc3, 0x90c, 0x892, 0x276, 0x1e55, 0x196d, 0x1194, 0x1bef, 0x66a, 0x1da1, 0x260f, 0x1c15, 0x49f, 0x120b, 0x2671, 0x1237, 0x2e0d, 0x2791, 0x17d8, 0x1e0a, 0x2a99, 0x14cf, 0xfb1, 0x15b4, 0x1462, 0x2fbb, 0xeff, 0x16b, 0x2d6a, 0x9ef, 0x5e3, 0x11c0, 0x2e76, 0x1623, 0x2db8, 0x1c88, 0x740, 0x11e1, 0x12a3, 0x977, 0x1110, 0x2163, 0x2dee, 0x47b, 0x2aa5, 0x2a22, 0x1231, 0x16e7, 0x1626, 0x12e0, 0x1d28, 0xe96, 0xb62, 0x21d0, 0xf09, 0xb30, 0xcb8, 0x2981, 0x2648, 0x155d, 0x27ee, 0xb34, 0x169, 0x1574, 0x1fe6, 0x25f4, 0x151d, 0x1801, 0x1f13, 0x1308, 0x2929, 0x6eb, 0x25e, 0x2cca, 0x1e3e, 0x248f}; -const sign16 inv = 0xeab; -const sign16 invpr = 0x2c2a; - -#define DEGREE (1<> 31); - return (x + mask)^mask; -} - -/* Montgomery stuff */ - -static sign32 redc(unsign64 T) -{ - unsign32 m = (unsign32)T * (unsign32)RLWE_ND; - return ((unsign64)m * RLWE_PRIME + T) >> WL; -} - -static sign32 nres(unsign32 x) -{ - return redc((unsign64)x * RLWE_R2MODP); -} - -static sign32 modmul(unsign32 a, unsign32 b) -{ - return redc((unsign64)a * b); -} - -/* NTT code */ -/* Cooley-Tukey NTT */ - -static void ntt(sign32 *x) -{ - int m, i, j, k, t = DEGREE / 2; - sign32 S, U, V, W, q = RLWE_PRIME; - - /* Convert to Montgomery form */ - for (j = 0; j < DEGREE; j++) - x[j] = nres(x[j]); - - m = 1; - while (m < DEGREE) - { - k = 0; - for (i = 0; i < m; i++) - { - S = roots[m + i]; - for (j = k; j < k + t; j++) - { - U = x[j]; - V = modmul(x[j + t], S); - x[j] = U + V; - x[j + t] = U + 2 * q - V; - } - k += 2 * t; - } - t /= 2; - m *= 2; - } -} - -/* Gentleman-Sande INTT */ - -static void intt(sign32 *x) -{ - int m, i, j, k, t = 1; - sign32 S, U, V, W, q = RLWE_PRIME; - - m = DEGREE / 2; - while (m > 1) - { - k = 0; - for (i = 0; i < m; i++) - { - S = iroots[m + i]; - for (j = k; j < k + t; j++) - { - U = x[j]; - V = x[j + t]; - x[j] = U + V; - W = U + DEGREE * q - V; - x[j + t] = modmul(W, S); - } - k += 2 * t; - } - t *= 2; - m /= 2; - } - - /* Last iteration merged with n^-1 */ - - t = DEGREE / 2; - for (j = 0; j < t; j++) - { - U = x[j]; - V = x[j + t]; - W = U + DEGREE * q - V; - x[j + t] = modmul(W, (sign32)invpr); - x[j] = modmul(U + V, (sign32)inv); - } - /* convert back from Montgomery to "normal" form */ - for (j = 0; j < DEGREE; j++) - { - x[j] = redc(x[j]); - x[j] -= q; - x[j] += (x[j] >> (WL - 1))&q; - } -} - -/* See https://eprint.iacr.org/2016/1157.pdf */ - -static void NHSEncode(byte *key, sign32 *poly) -{ - int i, j, b, k, kj, q2; - - q2 = RLWE_PRIME / 2; - for (i = j = 0; i < 256;) - { - kj = key[j++]; - for (k = 0; k < 8; k++) - { - b = kj & 1; - poly[i] = b * q2; - poly[i + 256] = b * q2; - poly[i + 512] = b * q2; - poly[i + 768] = b * q2; - kj >>= 1; - i++; - } - } -} - -static void NHSDecode(sign32 *poly, byte *key) -{ - int i, j, k; - sign32 b, t, q2; - q2 = RLWE_PRIME / 2; - for (i = 0; i < 32; i++) - key[i] = 0; - - for (i = j = 0; i < 256;) - { - for (k = 0; k < 8; k++) - { - t = nabs(poly[i] - q2) + nabs(poly[i + 256] - q2) + nabs(poly[i + 512] - q2) + nabs(poly[i + 768] - q2); - - b = t - RLWE_PRIME; - b = (b >> 31) & 1; - key[j] = (key[j] >> 1) + (b << 7); - i++; - } - j++; - } -} - -/* convert 32-byte seed to random polynomial */ - -static void parse(byte *seed, sign32 *poly) -{ - int i, j; - sign32 n; - byte hash[4 * DEGREE]; - sha3 sh; - - SHA3_init(&sh, SHAKE128); - for (i = 0; i < 32; i++) - SHA3_process(&sh, seed[i]); - SHA3_shake(&sh, (char *)hash, 4 * DEGREE); - - for (i = j = 0; i < DEGREE; i++) - { - - n = hash[j] & 0x7f; n <<= 8; - n += hash[j + 1]; n <<= 8; - n += hash[j + 2]; n <<= 8; - n += hash[j + 3]; j += 4; - poly[i] = nres(n); - } -} - -/* Compress 14 bits polynomial coefficients into byte array */ -/* 7 bytes is 3x14 */ - -static void NHSpack(sign32 *poly, byte *array) -{ - int i, j; - sign32 a, b, c, d; - - for (i = j = 0; i < DEGREE; ) - { - a = poly[i++]; b = poly[i++]; c = poly[i++]; d = poly[i++]; - array[j++] = (byte)(a & 0xff); - array[j++] = (byte)(((a >> 8) | (b << 6)) & 0xff); - array[j++] = (byte)((b >> 2) & 0xff); - array[j++] = (byte)(((b >> 10) | (c << 4)) & 0xff); - array[j++] = (byte)((c >> 4) & 0xff); - array[j++] = (byte)(((c >> 12) | (d << 2)) & 0xff); - array[j++] = (byte)(d >> 6); - } -} - -static void NHSunpack(byte *array, sign32 *poly) -{ - int i, j; - sign32 a, b, c, d, e, f, g; - - for (i = j = 0; i < DEGREE; ) - { - a = ((sign32)array[j++]) & 0xff; b = ((sign32)array[j++]) & 0xff; c = ((sign32)array[j++]) & 0xff; d = ((sign32)array[j++]) & 0xff; e = ((sign32)array[j++]) & 0xff; f = ((sign32)array[j++]) & 0xff; g = ((sign32)array[j++]) & 0xff; - poly[i++] = a | ((b & 0x3f) << 8); - poly[i++] = (b >> 6) | (c << 2) | ((d & 0xf) << 10); - poly[i++] = (d >> 4) | (e << 4) | ((f & 3) << 12); - poly[i++] = (f >> 2) | (g << 6); - } -} - -/* See https://eprint.iacr.org/2016/1157.pdf */ - -static void NHSCompress(sign32 *poly, byte *array) -{ - int i, j, k, b; - unsign32 col = 0; - - for (i = j = 0; i < DEGREE;) - { - for (k = 0; k < 8; k++) - { - b = round((poly[i] * 8), RLWE_PRIME) & 7; - col = (col << 3) + b; - i++; - } - array[j] = col & 0xff; - array[j + 1] = (col >> 8) & 0xff; - array[j + 2] = (col >> 16) & 0xff; - j += 3; col = 0; - } -} - -static void NHSDecompress(byte *array, sign32 *poly) -{ - int i, j, k, b; - unsign32 col = 0; - - for (i = j = 0; i < DEGREE;) - { - col = array[j + 2]; - col = (col << 8) + array[j + 1]; - col = (col << 8) + array[j]; - j += 3; - for (k = 0; k < 8; k++) - { - b = (col & 0xe00000) >> 21; col <<= 3; - poly[i] = round((b * RLWE_PRIME), 8); - i++; - } - } -} - -/* generate centered binomial distribution */ - -static void NHSError(csprng *RNG, sign32 *poly) -{ - int i, j; - sign32 n1, n2, r; - for (i = 0; i < DEGREE; i++) - { - n1 = RAND_byte(RNG) + (RAND_byte(RNG) << 8); - n2 = RAND_byte(RNG) + (RAND_byte(RNG) << 8); - r = 0; - for (j = 0; j < 16; j++) - { - r += (n1 & 1) - (n2 & 1); - n1 >>= 1; n2 >>= 1; - } - poly[i] = (r + RLWE_PRIME); - } -} - -static void redc_it(sign32 *p) -{ - int i; - for (i = 0; i < DEGREE; i++) - p[i] = redc(p[i]); -} - -static void nres_it(sign32 *p) -{ - int i; - for (i = 0; i < DEGREE; i++) - p[i] = nres(p[i]); -} - -static void poly_mul(sign32 *p1, sign32 *p2, sign32 *p3) -{ - int i; - for (i = 0; i < DEGREE; i++) - p1[i] = modmul(p2[i], p3[i]); -} - -static void poly_add(sign32 *p1, sign32 *p2, sign32 *p3) -{ - int i; - for (i = 0; i < DEGREE; i++) - p1[i] = (p2[i] + p3[i]); -} - -static void poly_sub(sign32 *p1, sign32 *p2, sign32 *p3) -{ - int i; - for (i = 0; i < DEGREE; i++) - p1[i] = (p2[i] + RLWE_PRIME - p3[i]); -} - -/* reduces inputs < 2q */ -static void poly_soft_reduce(sign32 *poly) -{ - int i; - sign32 e; - for (i = 0; i < DEGREE; i++) - { - e = poly[i] - RLWE_PRIME; - poly[i] = e + ((e >> (WL - 1))&RLWE_PRIME); - } -} - -/* fully reduces modulo q */ -static void poly_hard_reduce(sign32 *poly) -{ - int i; - sign32 e; - for (i = 0; i < DEGREE; i++) - { - e = modmul(poly[i], RLWE_ONE); - e = e - RLWE_PRIME; - poly[i] = e + ((e >> (WL - 1))&RLWE_PRIME); - } -} - -/* API functions. See https://eprint.iacr.org/2016/1157.pdf Protocol 1 */ -// S is secret key key, SB is seed|public key to be sent to client -void core::NHS_SERVER_1(csprng *RNG, octet *SB, octet *S) -{ - int i; - byte seed[32], array[1792]; - sign32 s[DEGREE], e[DEGREE], b[DEGREE]; - - for (i = 0; i < 32; i++) - seed[i] = RAND_byte(RNG); - - parse(seed, b); - - NHSError(RNG, e); - NHSError(RNG, s); - - ntt(s); - ntt(e); - - poly_mul(b, b, s); - poly_add(b, b, e); - poly_hard_reduce(b); - - redc_it(b); - NHSpack(b, array); - - OCT_empty(SB); - OCT_jbytes(SB, (char *)seed, 32); - OCT_jbytes(SB, (char *)array, 1792); - - poly_hard_reduce(s); - - NHSpack(s, array); - OCT_empty(S); - OCT_jbytes(S, (char *)array, 1792); - -} - -// optimized to reduce memory -// UC is U|cbar to be returned to server -// KEY is shared key -void core::NHS_CLIENT(csprng *RNG, octet *SB, octet *UC, octet *KEY) -{ - int i; - sha3 sh; - byte seed[32], array[1792], key[32], cc[384]; - sign32 sd[DEGREE], ed[DEGREE], u[DEGREE]; - NHSError(RNG, sd); - NHSError(RNG, ed); - - ntt(sd); - ntt(ed); - - for (i = 0; i < 32; i++) - seed[i] = SB->val[i]; - - parse(seed, u); - - poly_mul(u, u, sd); - poly_add(u, u, ed); - poly_hard_reduce(u); - - redc_it(u); - NHSpack(u, array); - OCT_empty(UC); - OCT_jbytes(UC, (char *)array, 1792); - - for (i = 0; i < 32; i++) - key[i] = RAND_byte(RNG); - - SHA3_init(&sh, SHA3_HASH256); - for (i = 0; i < 32; i++) - SHA3_process(&sh, key[i]); - SHA3_hash(&sh, (char *)key); - - for (i = 0; i < 1792; i++) - array[i] = SB->val[i + 32]; - - NHSunpack(array, u); - nres_it(u); - - poly_mul(u, u, sd); - intt(u); - NHSError(RNG, ed); - poly_add(u, u, ed); - - NHSEncode(key, sd); - poly_add(u, u, sd); - - NHSCompress(u, cc); - - SHA3_init(&sh, SHA3_HASH256); - for (i = 0; i < 32; i++) - SHA3_process(&sh, key[i]); - SHA3_hash(&sh, (char *)key); - - OCT_empty(KEY); - OCT_jbytes(KEY, (char *)key, 32); - - OCT_jbytes(UC, (char *)cc, 384); -} - -// calculate shared key from UC and secret key S -void core::NHS_SERVER_2(octet *S, octet *UC, octet *KEY) -{ - int i; - sha3 sh; - sign32 c[DEGREE], s[DEGREE], k[DEGREE]; - byte array[1792], key[32], cc[384]; - - for (i = 0; i < 1792; i++) - array[i] = UC->val[i]; - - NHSunpack(array, k); - nres_it(k); - - for (i = 0; i < 384; i++) - cc[i] = UC->val[i + 1792]; - - NHSDecompress(cc, c); - - for (i = 0; i < 1792; i++) - array[i] = S->val[i]; - - NHSunpack(array, s); - - poly_mul(k, k, s); - intt(k); - poly_sub(k, c, k); - poly_soft_reduce(k); - - NHSDecode(k, key); - - SHA3_init(&sh, SHA3_HASH256); - for (i = 0; i < 32; i++) - SHA3_process(&sh, key[i]); - SHA3_hash(&sh, (char *)key); - - OCT_empty(KEY); - OCT_jbytes(KEY, (char *)key, 32); -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/oct.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/oct.cpp deleted file mode 100644 index 9146202..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/oct.cpp +++ /dev/null @@ -1,446 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/*** Basic Octet string maintainance routines ***/ -/* SU=m, m is Stack Usage */ - -#include -#include "core.h" - -#ifdef CORE_ARDUINO -#include -#endif - -using namespace core; - -/* Output an octet string (Debug Only) */ - -/* SU= 16 */ -/* output octet */ -void core::OCT_output(octet *w) -{ - int i; - unsigned char ch; - for (i = 0; i < w->len; i++) - { - ch = w->val[i]; -#ifdef CORE_ARDUINO - char my_data[3]; - sprintf(my_data, "%02x", ch); - Serial.print(my_data); -#else - printf("%02x", ch); -#endif - } -#ifdef CORE_ARDUINO - Serial.println(""); -#else - printf("\n"); -#endif -} - -/* reverse bytes. Useful if dealing with those little-endian bastards */ -void core::OCT_reverse(octet *w) -{ - int i; - unsigned char ch; - for (i = 0; i < w->len/2; i++) { - ch = w->val[i]; - w->val[i] = w->val[w->len - i - 1]; - w->val[w->len - i - 1] = ch; - } -} - -//#define PUT_IN_SPACES - -/* SU= 16 */ -void core::OCT_output_string(octet *w) -{ - int i; - unsigned char ch; - for (i = 0; i < w->len; i++) - { - - ch = w->val[i]; -#ifdef CORE_ARDUINO - char my_data[3]; -#ifdef PUT_IN_SPACES - sprintf(my_data, "%c ", ch); -#else - sprintf(my_data, "%c", ch); -#endif - Serial.print(my_data); -#else -#ifdef PUT_IN_SPACES - printf("%c ", ch); -#else - printf("%c", ch); -#endif -#endif - } -} - -/* Convert C string to octet format - truncates if no room */ -void core::OCT_jstring(octet *y, char *s) -{ - int i, j; - i = y->len; - j = 0; - while (s[j] != 0 && i < y->max) - { - y->val[i] = s[j]; - y->len++; - i++; - j++; - } -} - -/* compare 2 octet strings. - * If x==y return TRUE, else return FALSE */ -/* SU= 8 */ -int core::OCT_comp(octet *x, octet *y) -{ - int i; - if (x->len > y->len) return 0; - if (x->len < y->len) return 0; - for (i = 0; i < x->len; i++) - { - if (x->val[i] != y->val[i]) return 0; - } - return 1; -} - -/* check are first n bytes the same (in constant time) */ - -int core::OCT_ncomp(octet *x, octet *y, int n) -{ - int i, res = 0; - if (n > y->len || n > x->len) return 0; - for (i = 0; i < n; i++) - { - res |= (int)(x->val[i] ^ y->val[i]); - } - if (res == 0) return 1; - return 0; -} - -/* Shift octet to the left by n bytes. Leftmost bytes disappear */ -void core::OCT_shl(octet *x, int n) -{ - int i; - if (n >= x->len) - { - x->len = 0; - return; - } - x->len -= n; - for (i = 0; i < x->len; i++) - x->val[i] = x->val[i + n]; -} - -/* Append binary string to octet - truncates if no room */ -/* SU= 12 */ -void core::OCT_jbytes(octet *y, char *b, int len) -{ - int i, j; - i = y->len; - for (j = 0; j < len && i < y->max; j++) - { - y->val[i] = b[j]; - y->len++; - i++; - } -} - -/* Concatenates two octet strings */ -/* SU= 8 */ -void core::OCT_joctet(octet *y, octet *x) -{ - /* y=y || x */ - int i, j; - if (x == NULL) return; - - for (i = 0; i < x->len; i++) - { - j = y->len + i; - if (j >= y->max) - { - y->len = y->max; - return; - } - y->val[j] = x->val[i]; - } - y->len += x->len; -} - -/* Append byte to octet rep times */ -/* SU= 8 */ -void core::OCT_jbyte(octet *y, int ch, int rep) -{ - int i, j; - i = y->len; - for (j = 0; j < rep && i < y->max; j++) - { - y->val[i] = ch; - y->len++; - i++; - } -} - -/* XOR common bytes of x with y */ -/* SU= 8 */ -void core::OCT_xor(octet *y, octet *x) -{ - /* xor first x->len bytes of y */ - - int i; - for (i = 0; i < x->len && i < y->len; i++) - { - y->val[i] ^= x->val[i]; - } -} - -/* clear an octet */ -void core::OCT_empty(octet *w) -{ - w->len = 0; -} - -/* Kill an octet string - Zeroise it for security */ -void core::OCT_clear(octet *w) -{ - int i; - for (i = 0; i < w->max; i++) w->val[i] = 0; - w->len = 0; -} - -/* appends int x of length len bytes to OCTET string */ -/* SU= 8 */ -void core::OCT_jint(octet *y, unsigned int x, int len) -{ - int i, n; - n = y->len + len; - if (n > y->max || len <= 0) return; - for (i = y->len; i < n; i++) y->val[i] = 0; - y->len = n; - - i = y->len; - while (x > 0 && i > 0) - { - i--; - y->val[i] = x % 256; - x /= 256; - } -} - -/* Pad an octet to a given length */ -/* SU= 8 */ -int core::OCT_pad(octet *w, int n) -{ - int i, d; - if (w->len > n || n > w->max) return 0; - if (n == w->len) return 1; - d = n - w->len; - for (i = n - 1; i >= d; i--) - w->val[i] = w->val[i - d]; - for (i = d - 1; i >= 0; i--) - w->val[i] = 0; - w->len = n; - return 1; -} - - -/* Convert an octet string to base64 string */ -/* SU= 56 */ -void core::OCT_tobase64(char *b, octet *w) -{ - int i, j, k, rem, last; - int c, ch[4]; - unsigned char ptr[3]; - rem = w->len % 3; - j = k = 0; - last = 4; - while (j < w->len) - { - for (i = 0; i < 3; i++) - { - if (j < w->len) ptr[i] = w->val[j++]; - else - { - ptr[i] = 0; - last--; - } - } - ch[0] = (ptr[0] >> 2) & 0x3f; - ch[1] = ((ptr[0] << 4) | (ptr[1] >> 4)) & 0x3f; - ch[2] = ((ptr[1] << 2) | (ptr[2] >> 6)) & 0x3f; - ch[3] = ptr[2] & 0x3f; - for (i = 0; i < last; i++) - { - c = ch[i]; - if (c < 26) c += 65; - if (c >= 26 && c < 52) c += 71; - if (c >= 52 && c < 62) c -= 4; - if (c == 62) c = '+'; - if (c == 63) c = '/'; - b[k++] = c; - } - } - if (rem > 0) for (i = rem; i < 3; i++) b[k++] = '='; - b[k] = '\0'; /* dangerous! */ -} - -/* SU= 56 */ -void core::OCT_frombase64(octet *w, char *b) -{ - int i, j, k, pads, len = (int)strlen(b); - int c, ch[4], ptr[3]; - j = k = 0; - while (j < len && k < w->max) - { - pads = 0; i=0; - while (i<4) - { - c = 80 + b[j++]; - if (c <= 112) continue; /* ignore white space */ - if (c > 144 && c < 171) c -= 145; - if (c > 176 && c < 203) c -= 151; - if (c > 127 && c < 138) c -= 76; - if (c == 123) c = 62; - if (c == 127) c = 63; - if (c == 141) - { - pads++; /* ignore pads '=' */ - i++; - continue; - } - ch[i++] = c; - } - ptr[0] = (ch[0] << 2) | (ch[1] >> 4); - ptr[1] = (ch[1] << 4) | (ch[2] >> 2); - ptr[2] = (ch[2] << 6) | ch[3]; - for (i = 0; i < 3 - pads && k < w->max; i++) - { - /* don't put in leading zeros */ - w->val[k++] = ptr[i]; - } - - } - w->len = k; -} - -/* copy an octet string - truncates if no room */ -/* SU= 16 */ -void core::OCT_copy(octet *y, octet *x) -{ - int i; - OCT_clear(y); - y->len = x->len; - if (y->len > y->max) y->len = y->max; - - for (i = 0; i < y->len; i++) - y->val[i] = x->val[i]; -} - -/* XOR m with all of x */ -void core::OCT_xorbyte(octet *x, int m) -{ - int i; - for (i = 0; i < x->len; i++) x->val[i] ^= m; -} - -/* truncates x to n bytes and places the rest in y (if y is not NULL) */ -/* SU= 8 */ -void core::OCT_chop(octet *x, octet *y, int n) -{ - int i; - if (n >= x->len) - { - if (y != NULL) y->len = 0; - return; - } - if (y != NULL) y->len = x->len - n; - x->len = n; - - if (y != NULL) - { - for (i = 0; i < y->len && i < y->max; i++) y->val[i] = x->val[i + n]; - } -} - -/* set x to len random bytes */ -void core::OCT_rand(octet *x, csprng *RNG, int len) -{ - int i; - if (len > x->max) len = x->max; - x->len = len; - - for (i = 0; i < len; i++) x->val[i] = RAND_byte(RNG); -} - -/* Convert an octet to a hex string */ -void core::OCT_toHex(octet *src, char *dst) -{ - int i,len=src->len; - unsigned char ch; - for (i = 0; i < len; i++) - { - ch = src->val[i]; - sprintf(&dst[i * 2], "%02x", ch); - } - dst[2*len]='\0'; -} - -static int char2int(char input) -{ - if (input >= '0' && input <= '9') - return input - '0'; - if (input >= 'A' && input <= 'F') - return input - 'A' + 10; - if (input >= 'a' && input <= 'f') - return input - 'a' + 10; - return 0; -} - -/* Convert from a hex string */ -void core::OCT_fromHex(octet *dst, char *src) -{ - int i = 0; - int j = 0; - OCT_clear(dst); - while (src[j] != 0) - { - dst->val[i++] = char2int(src[j]) * 16 + char2int(src[j + 1]); - j += 2; - } - dst->len = i; -} - - -/* Convert an octet to a string */ -void core::OCT_toStr(octet *src, char *dst) -{ - int i; - unsigned char ch; - for (i = 0; i < src->len; i++) - { - ch = src->val[i]; - sprintf(&dst[i], "%c", ch); - } -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair.cpp deleted file mode 100644 index 0d202bd..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair.cpp +++ /dev/null @@ -1,1233 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE BN Curve pairing functions */ - -//#define HAS_MAIN - -#include "pair_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -namespace ZZZ { -static void PAIR_line(FP12 *, ECP2 *, ECP2 *, FP *, FP *); -static void PAIR_double(ECP2 *, FP2 *, FP2 *, FP2 *); -static void PAIR_add(ECP2 *, ECP2 *B, FP2 *, FP2 *, FP2 *); -static void PAIR_pack(FP4 *, FP2 *, FP2 *, FP2 *); -static void PAIR_unpack(FP12 *, FP4 *, FP *, FP *); -static void glv(BIG u[2], BIG); -static void gs(BIG u[4], BIG); -} - -// Point doubling for pairings -static void ZZZ::PAIR_double(ECP2 *A, FP2 *AA, FP2 *BB, FP2 *CC) -{ - FP2 YY; - FP2_copy(CC, &(A->x)); //FP2 XX=new FP2(A.getx()); //X - FP2_copy(&YY, &(A->y)); //FP2 YY=new FP2(A.gety()); //Y - FP2_copy(BB, &(A->z)); //FP2 ZZ=new FP2(A.getz()); //Z - - FP2_copy(AA, &YY); //FP2 YZ=new FP2(YY); //Y - FP2_mul(AA, AA, BB); //YZ.mul(ZZ); //YZ - FP2_sqr(CC, CC); //XX.sqr(); //X^2 - FP2_sqr(&YY, &YY); //YY.sqr(); //Y^2 - FP2_sqr(BB, BB); //ZZ.sqr(); //Z^2 - - FP2_add(AA, AA, AA); - FP2_neg(AA, AA); - FP2_norm(AA); // -2YZ - FP2_mul_ip(AA); - FP2_norm(AA); // -2YZi - - FP2_imul(BB, BB, 3 * CURVE_B_I); //3Bz^2 - FP2_imul(CC, CC, 3); //3X^2 - -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP2_mul_ip(&YY); // Y^2.i - FP2_norm(&YY); - FP2_mul_ip(CC); // 3X^2.i - FP2_norm(CC); -#endif - -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP2_mul_ip(BB); // 3Bz^2.i - FP2_norm(BB); -#endif - - FP2_sub(BB, BB, &YY); - FP2_norm(BB); - - ECP2_dbl(A); //A.dbl(); -} - -// Point addition for pairings -static void ZZZ::PAIR_add(ECP2 *A, ECP2 *B, FP2 *AA, FP2 *BB, FP2 *CC) -{ - FP2 T1; - FP2_copy(AA, &(A->x)); //FP2 X1=new FP2(A.getx()); // X1 - FP2_copy(CC, &(A->y)); //FP2 Y1=new FP2(A.gety()); // Y1 - FP2_copy(&T1, &(A->z)); //FP2 T1=new FP2(A.getz()); // Z1 - - FP2_copy(BB, &T1); //FP2 T2=new FP2(A.getz()); // Z1 - - FP2_mul(&T1, &T1, &(B->y)); //T1.mul(B.gety()); // T1=Z1.Y2 - FP2_mul(BB, BB, &(B->x)); //T2.mul(B.getx()); // T2=Z1.X2 - - FP2_sub(AA, AA, BB); //X1.sub(T2); - FP2_norm(AA); //X1.norm(); // X1=X1-Z1.X2 - FP2_sub(CC, CC, &T1); //Y1.sub(T1); - FP2_norm(CC); //Y1.norm(); // Y1=Y1-Z1.Y2 - - FP2_copy(&T1, AA); //T1.copy(X1); // T1=X1-Z1.X2 - -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP2_mul_ip(AA); - FP2_norm(AA); -#endif - - FP2_mul(&T1, &T1, &(B->y)); //T1.mul(B.gety()); // T1=(X1-Z1.X2).Y2 - - FP2_copy(BB, CC); //T2.copy(Y1); // T2=Y1-Z1.Y2 - FP2_mul(BB, BB, &(B->x)); //T2.mul(B.getx()); // T2=(Y1-Z1.Y2).X2 - FP2_sub(BB, BB, &T1); //T2.sub(T1); - FP2_norm(BB); //T2.norm(); // T2=(Y1-Z1.Y2).X2 - (X1-Z1.X2).Y2 - - FP2_neg(CC, CC); //Y1.neg(); - FP2_norm(CC); //Y1.norm(); // Y1=-(Y1-Z1.Y2).Xs - *** - - ECP2_add(A, B); //A.add(B); -} - -/* Line function */ -static void ZZZ::PAIR_line(FP12 *v, ECP2 *A, ECP2 *B, FP *Qx, FP *Qy) -{ - FP2 AA, BB, CC; - FP4 a, b, c; - - if (A == B) - PAIR_double(A, &AA, &BB, &CC); - else - PAIR_add(A, B, &AA, &BB, &CC); - - FP2_pmul(&CC, &CC, Qx); - FP2_pmul(&AA, &AA, Qy); - - FP4_from_FP2s(&a, &AA, &BB); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP4_from_FP2(&b, &CC); - FP4_zero(&c); -#endif -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP4_zero(&b); - FP4_from_FP2H(&c, &CC); -#endif - - FP12_from_FP4s(v, &a, &b, &c); - v->type = FP_SPARSER; -} - -/* prepare ate parameter, n=6u+2 (BN) or n=u (BLS), n3=3*n */ -int ZZZ::PAIR_nbits(BIG n3, BIG n) -{ - BIG x; - BIG_rcopy(x, CURVE_Bnx); - -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - BIG_pmul(n, x, 6); -#if SIGN_OF_X_ZZZ==POSITIVEX - BIG_inc(n, 2); -#else - BIG_dec(n, 2); -#endif - -#else - BIG_copy(n, x); -#endif - - BIG_norm(n); - BIG_pmul(n3, n, 3); - BIG_norm(n3); - - return BIG_nbits(n3); -} - -/* - For multi-pairing, product of n pairings - 1. Declare FP12 array of length number of bits in Ate parameter - 2. Initialise this array by calling PAIR_initmp() - 3. Accumulate each pairing by calling PAIR_another() n times - 4. Call PAIR_miller() - 5. Call final exponentiation PAIR_fexp() -*/ - -/* prepare for multi-pairing */ -void ZZZ::PAIR_initmp(FP12 r[]) -{ - int i; - for (i = ATE_BITS_ZZZ - 1; i >= 0; i--) - FP12_one(&r[i]); - return; -} - -/* basic Miller loop */ -void ZZZ::PAIR_miller(FP12 *res, FP12 r[]) -{ - int i; - FP12_one(res); - for (i = ATE_BITS_ZZZ - 1; i >= 1; i--) - { - FP12_sqr(res, res); - FP12_ssmul(res, &r[i]); - FP12_zero(&r[i]); - } - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP12_conj(res, res); -#endif - FP12_ssmul(res, &r[0]); - FP12_zero(&r[0]); - return; -} - -// Store precomputed line details in an FP4 -static void ZZZ::PAIR_pack(FP4 *T, FP2* AA, FP2* BB, FP2 *CC) -{ - FP2 I, A, B; - FP2_inv(&I, CC, NULL); - FP2_mul(&A, AA, &I); - FP2_mul(&B, BB, &I); - FP4_from_FP2s(T, &A, &B); -} - -// Unpack G2 line function details and include G1 -static void ZZZ::PAIR_unpack(FP12 *v, FP4* T, FP *Qx, FP *Qy) -{ - FP4 a, b, c; - FP2 t; - FP4_copy(&a, T); - FP2_pmul(&a.a, &a.a, Qy); - FP2_from_FP(&t, Qx); - -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP4_from_FP2(&b, &t); - FP4_zero(&c); -#endif -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP4_zero(&b); - FP4_from_FP2H(&c, &t); -#endif - - FP12_from_FP4s(v, &a, &b, &c); - v->type = FP_SPARSEST; -} - -// Precompute table of line functions for fixed G2 value -void ZZZ::PAIR_precomp(FP4 T[], ECP2* GV) -{ - int i, j, nb, bt; - BIG n, n3; - FP2 AA, BB, CC; - ECP2 A, G, NG; -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - ECP2 K; - FP2 X; - FP Qx, Qy; - FP_rcopy(&Qx, Fra); - FP_rcopy(&Qy, Frb); - FP2_from_FPs(&X, &Qx, &Qy); -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP2_inv(&X, &X, NULL); - FP2_norm(&X); -#endif -#endif - - ECP2_copy(&A, GV); - ECP2_copy(&G, GV); - ECP2_copy(&NG, GV); - ECP2_neg(&NG); - - nb = PAIR_nbits(n3, n); - j = 0; - - for (i = nb - 2; i >= 1; i--) - { - PAIR_double(&A, &AA, &BB, &CC); - PAIR_pack(&T[j++], &AA, &BB, &CC); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // bt=BIG_bit(n,i); - if (bt == 1) - { - PAIR_add(&A, &G, &AA, &BB, &CC); - PAIR_pack(&T[j++], &AA, &BB, &CC); - } - if (bt == -1) - { - PAIR_add(&A, &NG, &AA, &BB, &CC); - PAIR_pack(&T[j++], &AA, &BB, &CC); - } - } -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - -#if SIGN_OF_X_ZZZ==NEGATIVEX - ECP2_neg(&A); -#endif - - ECP2_copy(&K, &G); - ECP2_frob(&K, &X); - PAIR_add(&A, &K, &AA, &BB, &CC); - PAIR_pack(&T[j++], &AA, &BB, &CC); - ECP2_frob(&K, &X); - ECP2_neg(&K); - PAIR_add(&A, &K, &AA, &BB, &CC); - PAIR_pack(&T[j++], &AA, &BB, &CC); - -#endif - -} - -/* Accumulate another set of line functions for n-pairing, assuming precomputation on G2 */ -void ZZZ::PAIR_another_pc(FP12 r[], FP4 T[], ECP *QV) -{ - int i, j, nb, bt; - BIG n, n3; - FP12 lv, lv2; - ECP Q; - FP Qx, Qy; - - if (ECP_isinf(QV)) return; - - nb = PAIR_nbits(n3, n); - - ECP_copy(&Q, QV); - ECP_affine(&Q); - - FP_copy(&Qx, &(Q.x)); - FP_copy(&Qy, &(Q.y)); - - j = 0; - for (i = nb - 2; i >= 1; i--) - { - PAIR_unpack(&lv, &T[j++], &Qx, &Qy); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // bt=BIG_bit(n,i); - if (bt == 1) - { - PAIR_unpack(&lv2, &T[j++], &Qx, &Qy); - FP12_smul(&lv, &lv2); - } - if (bt == -1) - { - PAIR_unpack(&lv2, &T[j++], &Qx, &Qy); - FP12_smul(&lv, &lv2); - } - FP12_ssmul(&r[i], &lv); - } - -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - PAIR_unpack(&lv, &T[j++], &Qx, &Qy); - PAIR_unpack(&lv2, &T[j++], &Qx, &Qy); - FP12_smul(&lv, &lv2); - FP12_ssmul(&r[0], &lv); -#endif -} - -/* Accumulate another set of line functions for n-pairing */ -void ZZZ::PAIR_another(FP12 r[], ECP2* PV, ECP* QV) -{ - int i, nb, bt; - BIG n, n3; - FP12 lv, lv2; - ECP2 A, NP, P; - ECP Q; - FP Qx, Qy; -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - ECP2 K; - FP2 X; - FP_rcopy(&Qx, Fra); - FP_rcopy(&Qy, Frb); - FP2_from_FPs(&X, &Qx, &Qy); -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP2_inv(&X, &X, NULL); - FP2_norm(&X); -#endif -#endif - - if (ECP_isinf(QV)) return; - - nb = PAIR_nbits(n3, n); - - ECP2_copy(&P, PV); - ECP_copy(&Q, QV); - - ECP2_affine(&P); - ECP_affine(&Q); - - FP_copy(&Qx, &(Q.x)); - FP_copy(&Qy, &(Q.y)); - - ECP2_copy(&A, &P); - ECP2_copy(&NP, &P); ECP2_neg(&NP); - - for (i = nb - 2; i >= 1; i--) - { - PAIR_line(&lv, &A, &A, &Qx, &Qy); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // bt=BIG_bit(n,i); - if (bt == 1) - { - PAIR_line(&lv2, &A, &P, &Qx, &Qy); - FP12_smul(&lv, &lv2); - } - if (bt == -1) - { - PAIR_line(&lv2, &A, &NP, &Qx, &Qy); - FP12_smul(&lv, &lv2); - } - FP12_ssmul(&r[i], &lv); - } - -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - -#if SIGN_OF_X_ZZZ==NEGATIVEX - ECP2_neg(&A); -#endif - - ECP2_copy(&K, &P); - ECP2_frob(&K, &X); - PAIR_line(&lv, &A, &K, &Qx, &Qy); - ECP2_frob(&K, &X); - ECP2_neg(&K); - PAIR_line(&lv2, &A, &K, &Qx, &Qy); - FP12_smul(&lv, &lv2); - FP12_ssmul(&r[0], &lv); - -#endif -} - -/* Optimal single R-ate pairing r=e(P,Q) */ -void ZZZ::PAIR_ate(FP12 *r, ECP2 *P1, ECP *Q1) -{ - BIG n, n3; - FP Qx, Qy; - int i, nb, bt; - ECP2 A, NP, P; - ECP Q; - FP12 lv, lv2; -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - ECP2 KA; - FP2 X; - - FP_rcopy(&Qx, Fra); - FP_rcopy(&Qy, Frb); - FP2_from_FPs(&X, &Qx, &Qy); - -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP2_inv(&X, &X, NULL); - FP2_norm(&X); -#endif - -#endif - - FP12_one(r); - if (ECP_isinf(Q1)) return; - - nb = PAIR_nbits(n3, n); - - ECP2_copy(&P, P1); - ECP_copy(&Q, Q1); - - ECP2_affine(&P); - ECP_affine(&Q); - - FP_copy(&Qx, &(Q.x)); - FP_copy(&Qy, &(Q.y)); - - ECP2_copy(&A, &P); - ECP2_copy(&NP, &P); ECP2_neg(&NP); - - /* Main Miller Loop */ - for (i = nb - 2; i >= 1; i--) - { - FP12_sqr(r, r); - PAIR_line(&lv, &A, &A, &Qx, &Qy); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // bt=BIG_bit(n,i); - if (bt == 1) - { - PAIR_line(&lv2, &A, &P, &Qx, &Qy); - FP12_smul(&lv, &lv2); - } - if (bt == -1) - { - PAIR_line(&lv2, &A, &NP, &Qx, &Qy); - FP12_smul(&lv, &lv2); - } - FP12_ssmul(r, &lv); - } - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP12_conj(r, r); -#endif - - /* R-ate fixup required for BN curves */ -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - -#if SIGN_OF_X_ZZZ==NEGATIVEX - ECP2_neg(&A); -#endif - - ECP2_copy(&KA, &P); - ECP2_frob(&KA, &X); - PAIR_line(&lv, &A, &KA, &Qx, &Qy); - ECP2_frob(&KA, &X); - ECP2_neg(&KA); - PAIR_line(&lv2, &A, &KA, &Qx, &Qy); - FP12_smul(&lv, &lv2); - FP12_ssmul(r, &lv); -#endif -} - -/* Optimal R-ate double pairing e(P,Q).e(R,S) */ -void ZZZ::PAIR_double_ate(FP12 *r, ECP2 *P1, ECP *Q1, ECP2 *R1, ECP *S1) -{ - - BIG n, n3; - FP Qx, Qy, Sx, Sy; - int i, nb, bt; - ECP2 A, B, NP, NR, P, R; - ECP Q, S; - FP12 lv, lv2; -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - ECP2 K; - FP2 X; - - FP_rcopy(&Qx, Fra); - FP_rcopy(&Qy, Frb); - FP2_from_FPs(&X, &Qx, &Qy); - -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP2_inv(&X, &X, NULL); - FP2_norm(&X); -#endif - -#endif - - if (ECP_isinf(Q1)) - { - PAIR_ate(r, R1, S1); - return; - } - if (ECP_isinf(S1)) - { - PAIR_ate(r, P1, Q1); - return; - } - - nb = PAIR_nbits(n3, n); - - ECP2_copy(&P, P1); - ECP_copy(&Q, Q1); - - ECP2_affine(&P); - ECP_affine(&Q); - - ECP2_copy(&R, R1); - ECP_copy(&S, S1); - - ECP2_affine(&R); - ECP_affine(&S); - - FP_copy(&Qx, &(Q.x)); - FP_copy(&Qy, &(Q.y)); - - FP_copy(&Sx, &(S.x)); - FP_copy(&Sy, &(S.y)); - - ECP2_copy(&A, &P); - ECP2_copy(&B, &R); - - ECP2_copy(&NP, &P); ECP2_neg(&NP); - ECP2_copy(&NR, &R); ECP2_neg(&NR); - - FP12_one(r); - - /* Main Miller Loop */ - for (i = nb - 2; i >= 1; i--) - { - FP12_sqr(r, r); - PAIR_line(&lv, &A, &A, &Qx, &Qy); - PAIR_line(&lv2, &B, &B, &Sx, &Sy); - FP12_smul(&lv, &lv2); - FP12_ssmul(r, &lv); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // bt=BIG_bit(n,i); - if (bt == 1) - { - PAIR_line(&lv, &A, &P, &Qx, &Qy); - PAIR_line(&lv2, &B, &R, &Sx, &Sy); - FP12_smul(&lv, &lv2); - FP12_ssmul(r, &lv); - } - if (bt == -1) - { - PAIR_line(&lv, &A, &NP, &Qx, &Qy); - PAIR_line(&lv2, &B, &NR, &Sx, &Sy); - FP12_smul(&lv, &lv2); - FP12_ssmul(r, &lv); - } - } - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP12_conj(r, r); -#endif - /* R-ate fixup required for BN curves */ -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - -#if SIGN_OF_X_ZZZ==NEGATIVEX - ECP2_neg(&A); - ECP2_neg(&B); -#endif - - ECP2_copy(&K, &P); - ECP2_frob(&K, &X); - PAIR_line(&lv, &A, &K, &Qx, &Qy); - ECP2_frob(&K, &X); - ECP2_neg(&K); - PAIR_line(&lv2, &A, &K, &Qx, &Qy); - FP12_smul(&lv, &lv2); - FP12_ssmul(r, &lv); - - ECP2_copy(&K, &R); - ECP2_frob(&K, &X); - PAIR_line(&lv, &B, &K, &Sx, &Sy); - ECP2_frob(&K, &X); - ECP2_neg(&K); - PAIR_line(&lv2, &B, &K, &Sx, &Sy); - FP12_smul(&lv, &lv2); - FP12_ssmul(r, &lv); -#endif -} - -/* final exponentiation - keep separate for multi-pairings and to avoid thrashing stack */ -void ZZZ::PAIR_fexp(FP12 *r) -{ - FP2 X; - BIG x; - FP a, b; - FP12 t0, y0, y1; -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - FP12 y2, y3; -#endif - BIG_rcopy(x, CURVE_Bnx); - FP_rcopy(&a, Fra); - FP_rcopy(&b, Frb); - FP2_from_FPs(&X, &a, &b); - - /* Easy part of final exp */ - - FP12_inv(&t0, r); - FP12_conj(r, r); - - FP12_mul(r, &t0); - FP12_copy(&t0, r); - - FP12_frob(r, &X); - FP12_frob(r, &X); - FP12_mul(r, &t0); - - /* Hard part of final exp - see Duquesne & Ghamman eprint 2015/192.pdf */ -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - FP12_pow(&t0, r, x); // t0=f^-u -#if SIGN_OF_X_ZZZ==POSITIVEX - FP12_conj(&t0, &t0); -#endif - FP12_usqr(&y3, &t0); // y3=t0^2 - FP12_copy(&y0, &t0); - FP12_mul(&y0, &y3); // y0=t0*y3 - FP12_copy(&y2, &y3); - FP12_frob(&y2, &X); // y2=y3^p - FP12_mul(&y2, &y3); //y2=y2*y3 - FP12_usqr(&y2, &y2); //y2=y2^2 - FP12_mul(&y2, &y3); // y2=y2*y3 - - FP12_pow(&t0, &y0, x); //t0=y0^-u -#if SIGN_OF_X_ZZZ==POSITIVEX - FP12_conj(&t0, &t0); -#endif - FP12_conj(&y0, r); //y0=~r - FP12_copy(&y1, &t0); - FP12_frob(&y1, &X); - FP12_frob(&y1, &X); //y1=t0^p^2 - FP12_mul(&y1, &y0); // y1=y0*y1 - FP12_conj(&t0, &t0); // t0=~t0 - FP12_copy(&y3, &t0); - FP12_frob(&y3, &X); //y3=t0^p - FP12_mul(&y3, &t0); // y3=t0*y3 - FP12_usqr(&t0, &t0); // t0=t0^2 - FP12_mul(&y1, &t0); // y1=t0*y1 - - FP12_pow(&t0, &y3, x); // t0=y3^-u -#if SIGN_OF_X_ZZZ==POSITIVEX - FP12_conj(&t0, &t0); -#endif - FP12_usqr(&t0, &t0); //t0=t0^2 - FP12_conj(&t0, &t0); //t0=~t0 - FP12_mul(&y3, &t0); // y3=t0*y3 - - FP12_frob(r, &X); - FP12_copy(&y0, r); - FP12_frob(r, &X); - FP12_mul(&y0, r); - FP12_frob(r, &X); - FP12_mul(&y0, r); - - FP12_usqr(r, &y3); //r=y3^2 - FP12_mul(r, &y2); //r=y2*r - FP12_copy(&y3, r); - FP12_mul(&y3, &y0); // y3=r*y0 - FP12_mul(r, &y1); // r=r*y1 - FP12_usqr(r, r); // r=r^2 - FP12_mul(r, &y3); // r=r*y3 - FP12_reduce(r); -#else - -// See https://eprint.iacr.org/2020/875.pdf - FP12_usqr(&y1,r); - FP12_mul(&y1,r); // y1=r^3 - - FP12_pow(&y0,r,x); // y0=r^x -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP12_conj(&y0, &y0); -#endif - FP12_conj(&t0,r); // t0=r^-1 - FP12_copy(r,&y0); - FP12_mul(r,&t0); // r=r^(x-1) - - FP12_pow(&y0,r,x); // y0=r^x -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP12_conj(&y0, &y0); -#endif - FP12_conj(&t0,r); // t0=r^-1 - FP12_copy(r,&y0); - FP12_mul(r,&t0); // r=r^(x-1) - -// ^(x+p) - FP12_pow(&y0,r,x); // y0=r^x -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP12_conj(&y0, &y0); -#endif - FP12_copy(&t0,r); - FP12_frob(&t0,&X); // t0=r^p - FP12_copy(r,&y0); - FP12_mul(r,&t0); // r=r^x.r^p - -// ^(x^2+p^2-1) - FP12_pow(&y0,r,x); - FP12_pow(&y0,&y0,x); // y0=r^x^2 - FP12_copy(&t0,r); - FP12_frob(&t0,&X); - FP12_frob(&t0,&X); // t0=r^p^2 - FP12_mul(&y0,&t0); // y0=r^x^2.r^p^2 - FP12_conj(&t0,r); // t0=r^-1 - FP12_copy(r,&y0); // - FP12_mul(r,&t0); // r=r^x^2.r^p^2.r^-1 - - FP12_mul(r,&y1); - FP12_reduce(r); -#endif -} - -#ifdef USE_GLV_ZZZ -/* GLV method */ -static void ZZZ::glv(BIG u[2], BIG ee) -{ - BIG q; - BIG_rcopy(q, CURVE_Order); -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - int i, j; - BIG v[2], t; - DBIG d; - - for (i = 0; i < 2; i++) - { - BIG_rcopy(t, CURVE_W[i]); - BIG_mul(d, t, ee); - BIG_ctddiv(v[i],d,q,BIG_nbits(t)); - BIG_zero(u[i]); - } - BIG_copy(u[0], ee); - for (i = 0; i < 2; i++) - for (j = 0; j < 2; j++) - { - BIG_rcopy(t, CURVE_SB[j][i]); - BIG_modmul(t, v[j], t, q); - BIG_add(u[i], u[i], q); - BIG_sub(u[i], u[i], t); - BIG_ctmod(u[i],q,1); - } - - //BIG x, x2; - //BIG_rcopy(x, CURVE_Bnx); - //BIG_smul(x2, x, x); - //BIG_imul(x2,x2,6); - //printf("bits(6x^2) = %d \n",BIG_nbits(x2)); - -#else -// -(x^2).P = (Beta.x,y) - int bd; - BIG x, x2; - BIG_rcopy(x, CURVE_Bnx); - - BIG_smul(x2, x, x); - bd=BIG_nbits(q)-BIG_nbits(x2); // fixed - BIG_copy(u[0], ee); - BIG_ctmod(u[0], x2, bd); - BIG_copy(u[1], ee); - BIG_ctsdiv(u[1], x2, bd); - - BIG_sub(u[1], q, u[1]); - -#endif - - return; -} -#endif // USE_GLV - -/* Galbraith & Scott Method */ -static void ZZZ::gs(BIG u[4], BIG ee) -{ - int i; - BIG q; - BIG_rcopy(q, CURVE_Order); - -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE - int j; - BIG v[4], t; - DBIG d; - - for (i = 0; i < 4; i++) - { - BIG_rcopy(t, CURVE_WB[i]); - BIG_mul(d, t, ee); - BIG_ctddiv(v[i],d,q,BIG_nbits(t)); - BIG_zero(u[i]); - } - - BIG_copy(u[0], ee); - for (i = 0; i < 4; i++) - for (j = 0; j < 4; j++) - { - BIG_rcopy(t, CURVE_BB[j][i]); - BIG_modmul(t, v[j], t, q); - BIG_add(u[i], u[i], q); - BIG_sub(u[i], u[i], t); - BIG_ctmod(u[i],q,1); - } - - //BIG x; - //BIG_rcopy(x, CURVE_Bnx); - //BIG_imul(x,x,3); - //printf("bits(3x) = %d \n",BIG_nbits(x)); - -#else - int bd; - BIG x, w; - - BIG_rcopy(x, CURVE_Bnx); - BIG_copy(w, ee); - bd=BIG_nbits(q)-BIG_nbits(x); // fixed - - for (i = 0; i < 3; i++) - { - BIG_copy(u[i], w); - BIG_ctmod(u[i],x,bd); - BIG_ctsdiv(w,x,bd); - } - BIG_copy(u[3], w); - - /* */ -#if SIGN_OF_X_ZZZ==NEGATIVEX - BIG_modneg(u[1], u[1], q); - BIG_modneg(u[3], u[3], q); -#endif - -#endif - return; -} - -/* Multiply P by e in group G1 */ -void ZZZ::PAIR_G1mul(ECP *P, BIG e) -{ - BIG ee,q; - BIG_copy(ee,e); - BIG_rcopy(q, CURVE_Order); - BIG_mod(ee,q); -#ifdef USE_GLV_ZZZ /* Note this method is patented */ - int np, nn; - ECP Q; - FP cru; - BIG t; - BIG u[2]; - glv(u, ee); - - ECP_copy(&Q, P); ECP_affine(&Q); - FP_rcopy(&cru, CRu); - FP_mul(&(Q.x), &(Q.x), &cru); - - /* note that -a.B = a.(-B). Use a or -a depending on which is smaller */ - - np = BIG_nbits(u[0]); - BIG_modneg(t, u[0], q); - nn = BIG_nbits(t); - if (nn < np) - { - BIG_copy(u[0], t); - ECP_neg(P); - } - - np = BIG_nbits(u[1]); - BIG_modneg(t, u[1], q); - nn = BIG_nbits(t); - if (nn < np) - { - BIG_copy(u[1], t); - ECP_neg(&Q); - } - BIG_norm(u[0]); - BIG_norm(u[1]); - ECP_mul2(P, &Q, u[0], u[1]); - - //printf("nbits(q) = %d\n",BIG_nbits(q)); - //printf("nbits(q)/2 = %d\n",BIG_nbits(q)/2); - //printf("u[0] %d = ",BIG_nbits(u[0]));BIG_output(u[0]); printf("\n"); - //printf("u[1] %d = ",BIG_nbits(u[1]));BIG_output(u[1]); printf("\n"); -#else - ECP_clmul(P, ee, q); -#endif -} - -/* Multiply P by e in group G2 */ -void ZZZ::PAIR_G2mul(ECP2 *P, BIG e) -{ - BIG ee,q; - BIG_copy(ee,e); - BIG_rcopy(q, CURVE_Order); - BIG_mod(ee,q); -#ifdef USE_GS_G2_ZZZ /* Well I didn't patent it :) */ - int i, np, nn; - ECP2 Q[4]; - FP2 X; - FP fx, fy; - BIG x, u[4]; - - FP_rcopy(&fx, Fra); - FP_rcopy(&fy, Frb); - FP2_from_FPs(&X, &fx, &fy); - -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP2_inv(&X, &X, NULL); - FP2_norm(&X); -#endif - - gs(u, ee); - - ECP2_copy(&Q[0], P); - for (i = 1; i < 4; i++) - { - ECP2_copy(&Q[i], &Q[i - 1]); - ECP2_frob(&Q[i], &X); - } - - for (i = 0; i < 4; i++) - { - np = BIG_nbits(u[i]); - BIG_modneg(x, u[i], q); - nn = BIG_nbits(x); - if (nn < np) - { - BIG_copy(u[i], x); - ECP2_neg(&Q[i]); - } - BIG_norm(u[i]); - } - ECP2_mul4(P, Q, u); - - //printf("nbits(q) = %d\n",BIG_nbits(q)); - //printf("nbits(q)/4 = %d\n",BIG_nbits(q)/4); - //printf("u[0] %d = ",BIG_nbits(u[0]));BIG_output(u[0]); printf("\n"); - //printf("u[1] %d = ",BIG_nbits(u[1]));BIG_output(u[1]); printf("\n"); - //printf("u[2] %d = ",BIG_nbits(u[2]));BIG_output(u[2]); printf("\n"); - //printf("u[3] %d = ",BIG_nbits(u[3]));BIG_output(u[3]); printf("\n"); - - -#else - ECP2_mul(P, ee); -#endif -} - -/* f=f^e */ -void ZZZ::PAIR_GTpow(FP12 *f, BIG e) -{ - BIG ee,q; - BIG_copy(ee,e); - BIG_rcopy(q, CURVE_Order); - BIG_mod(ee,q); -#ifdef USE_GS_GT_ZZZ /* Note that this option requires a lot of RAM! Maybe better to use compressed XTR method, see fp4.c */ - int i, np, nn; - FP12 g[4]; - FP2 X; - BIG t; - FP fx, fy; - BIG u[4]; - - FP_rcopy(&fx, Fra); - FP_rcopy(&fy, Frb); - FP2_from_FPs(&X, &fx, &fy); - - gs(u, ee); - - FP12_copy(&g[0], f); - for (i = 1; i < 4; i++) - { - FP12_copy(&g[i], &g[i - 1]); - FP12_frob(&g[i], &X); - } - - for (i = 0; i < 4; i++) - { - np = BIG_nbits(u[i]); - BIG_modneg(t, u[i], q); - nn = BIG_nbits(t); - if (nn < np) - { - BIG_copy(u[i], t); - FP12_conj(&g[i], &g[i]); - } - BIG_norm(u[i]); - } - FP12_pow4(f, g, u); - -#else - FP12_pow(f, f, ee); -#endif -} - -/* test G1 group membership */ - -int ZZZ::PAIR_G1member(ECP *P) -{ - ECP W,T; - BIG x; - FP cru; - if (ECP_isinf(P)) return 0; -#if PAIRING_FRIENDLY_ZZZ!=BN_CURVE - BIG_rcopy(x, CURVE_Bnx); - ECP_copy(&W,P); - ECP_copy(&T,P); - ECP_mul(&T,x); - if (ECP_equals(P,&T)) return 0; // P is of low order - ECP_mul(&T,x); - ECP_neg(&T); - - FP_rcopy(&cru, CRu); - FP_mul(&(W.x), &(W.x), &cru); - if (!ECP_equals(&W,&T)) return 0; // check that Endomorphism works - -// Not needed -// ECP_add(&W,P); -// FP_mul(&(T.x), &(T.x), &cru); -// ECP_add(&W,&T); -// if (!ECP_isinf(&W)) return 0; // use it to check order -/* - BIG_rcopy(q, CURVE_Order); - ECP_copy(&W,P); - ECP_mul(&W,q); - if (!ECP_isinf(&W)) return 0; */ -#endif - return 1; -} - -/* test G2 group membership */ -int ZZZ::PAIR_G2member(ECP2 *P) -{ - ECP2 W,T; - BIG x; - FP2 X; - FP fx, fy; - - if (ECP2_isinf(P)) return 0; - FP_rcopy(&fx, Fra); - FP_rcopy(&fy, Frb); - FP2_from_FPs(&X, &fx, &fy); -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP2_inv(&X, &X, NULL); - FP2_norm(&X); -#endif - BIG_rcopy(x, CURVE_Bnx); - - ECP2_copy(&T,P); - ECP2_mul(&T,x); - -#if SIGN_OF_X_ZZZ==NEGATIVEX - ECP2_neg(&T); -#endif - -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE -//https://eprint.iacr.org/2022/348.pdf - ECP2_copy(&W,&T); - ECP2_frob(&W,&X); // W=\psi(xP) - ECP2_add(&T,P); // T=xP+P - ECP2_add(&T,&W); // T=xP+P+\psi(xP) - ECP2_frob(&W,&X); // W=\psi^2(xP) - ECP2_add(&T,&W); // T=xp+P+\psi(xP)+\psi^2(xP) - ECP2_frob(&W,&X); // W=\psi^3(xP) - ECP2_dbl(&W); // W=\psi^3(2xP) -#else -//https://eprint.iacr.org/2021/1130 - ECP2_copy(&W,P); - ECP2_frob(&W, &X); // W=\psi(P) -#endif - - if (ECP2_equals(&W,&T)) return 1; - return 0; -} - -/* Check that m is in cyclotomic sub-group */ -/* Check that m!=1, conj(m)*m==1, and m.m^{p^4}=m^{p^2} */ -int ZZZ::PAIR_GTcyclotomic(FP12 *m) -{ - FP fx,fy; - FP2 X; - FP12 r,w; - if (FP12_isunity(m)) return 0; - FP12_conj(&r,m); - FP12_mul(&r,m); - if (!FP12_isunity(&r)) return 0; - - FP_rcopy(&fx,Fra); - FP_rcopy(&fy,Frb); - FP2_from_FPs(&X,&fx,&fy); - - FP12_copy(&r,m); FP12_frob(&r,&X); FP12_frob(&r,&X); - FP12_copy(&w,&r); FP12_frob(&w,&X); FP12_frob(&w,&X); - FP12_mul(&w,m); - - if (!FP12_equals(&w,&r)) return 0; - return 1; -} - -/* test for full GT group membership */ -int ZZZ::PAIR_GTmember(FP12 *m) -{ - BIG x; - FP2 X; - FP fx, fy; - FP12 r,t; - if (!PAIR_GTcyclotomic(m)) return 0; - - FP_rcopy(&fx, Fra); - FP_rcopy(&fy, Frb); - FP2_from_FPs(&X, &fx, &fy); - BIG_rcopy(x, CURVE_Bnx); - - FP12_pow(&t,m,x); - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP12_conj(&t,&t); -#endif - -#if PAIRING_FRIENDLY_ZZZ==BN_CURVE -//https://eprint.iacr.org/2022/348.pdf - FP12_copy(&r,&t); - FP12_frob(&r,&X); // r=(m^x)^p - FP12_mul(&t,m); // t=(m^x).m - FP12_mul(&t,&r); // t=(m^x).m.(m^x)^p - FP12_frob(&r,&X); // r=(m^x)^p^2 - FP12_mul(&t,&r); // t=(m^x).m.(m^x)^p.(m^x)^p^2 - FP12_frob(&r,&X); // r=(m^x)^p^3 - FP12_usqr(&r,&r); // r=(m^2x)^p^3 -#else -//https://eprint.iacr.org/2021/1130 - FP12_copy(&r,m); - FP12_frob(&r, &X); -#endif - - if (FP12_equals(&r,&t)) return 1; - return 0; -} - -#ifdef HAS_MAIN - -int main() -{ - int i; - char byt[32]; - csprng rng; - BIG xa, xb, ya, yb, w, a, b, t1, q, u[2], v[4], m, r; - ECP2 P, G; - ECP Q, R; - FP12 g, gp; - FP4 t, c, cp, cpm1, cpm2; - FP2 x, y, X; - - - BIG_rcopy(a, CURVE_Fra); - BIG_rcopy(b, CURVE_Frb); - FP2_from_BIGs(&X, a, b); - - BIG_rcopy(xa, CURVE_Gx); - BIG_rcopy(ya, CURVE_Gy); - - ECP_set(&Q, xa, ya); - if (Q.inf) printf("Failed to set - point not on curve\n"); - else printf("G1 set success\n"); - - printf("Q= "); - ECP_output(&Q); - printf("\n"); - - BIG_rcopy(xa, CURVE_Pxa); - BIG_rcopy(xb, CURVE_Pxb); - BIG_rcopy(ya, CURVE_Pya); - BIG_rcopy(yb, CURVE_Pyb); - - FP2_from_BIGs(&x, xa, xb); - FP2_from_BIGs(&y, ya, yb); - - ECP2_set(&P, &x, &y); - if (P.inf) printf("Failed to set - point not on curve\n"); - else printf("G2 set success\n"); - - printf("P= "); - ECP2_output(&P); - printf("\n"); - - for (i = 0; i < 1000; i++ ) - { - PAIR_ate(&g, &P, &Q); - PAIR_fexp(&g); - } - printf("g= "); - FP12_output(&g); - printf("\n"); - -} - -#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair4.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair4.cpp deleted file mode 100644 index 53b53e0..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair4.cpp +++ /dev/null @@ -1,1087 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE BLS Curve pairing functions */ - -//#define HAS_MAIN - -#include "pair4_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -namespace ZZZ { -static void PAIR_line(FP24 *, ECP4 *, ECP4 *, FP *, FP *); -static void PAIR_double(ECP4 *, FP4 *, FP4 *, FP4 *); -static void PAIR_add(ECP4 *, ECP4 *B, FP4 *, FP4 *, FP4 *); -static void PAIR_pack(FP8 *, FP4 *, FP4 *, FP4 *); -static void PAIR_unpack(FP24 *, FP8 *, FP *, FP *); -static void glv(BIG u[2], BIG); -static void gs(BIG u[4], BIG); -} - - -// Point doubling for pairings -static void ZZZ::PAIR_double(ECP4 *A, FP4 *AA, FP4 *BB, FP4 *CC) -{ - FP4 YY; - FP4_copy(CC, &(A->x)); //FP4 XX=new FP4(A.getx()); //X - FP4_copy(&YY, &(A->y)); //FP4 YY=new FP4(A.gety()); //Y - FP4_copy(BB, &(A->z)); //FP4 ZZ=new FP4(A.getz()); //Z - - FP4_copy(AA, &YY); //FP4 YZ=new FP4(YY); //Y - FP4_mul(AA, AA, BB); //YZ.mul(ZZ); //YZ - FP4_sqr(CC, CC); //XX.sqr(); //X^2 - FP4_sqr(&YY, &YY); //YY.sqr(); //Y^2 - FP4_sqr(BB, BB); //ZZ.sqr(); //Z^2 - - FP4_add(AA, AA, AA); - FP4_neg(AA, AA); - FP4_norm(AA); // -2YZ - FP4_times_i(AA); // -2YZi - - FP4_imul(BB, BB, 3 * CURVE_B_I); //3Bz^2 - FP4_imul(CC, CC, 3); //3X^2 - -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP4_times_i(&YY); // Y^2.i - FP4_times_i(CC); // 3X^2.i -#endif - -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP4_times_i(BB); // 3Bz^2.i -#endif - - FP4_sub(BB, BB, &YY); - FP4_norm(BB); - - ECP4_dbl(A); //A.dbl(); - -} - -// Point addition for pairings -static void ZZZ::PAIR_add(ECP4 *A, ECP4 *B, FP4 *AA, FP4 *BB, FP4 *CC) -{ - FP4 T1; - FP4_copy(AA, &(A->x)); //FP4 X1=new FP4(A.getx()); // X1 - FP4_copy(CC, &(A->y)); //FP4 Y1=new FP4(A.gety()); // Y1 - FP4_copy(&T1, &(A->z)); //FP4 T1=new FP4(A.getz()); // Z1 - - FP4_copy(BB, &T1); //FP4 T2=new FP4(A.getz()); // Z1 - - FP4_mul(&T1, &T1, &(B->y)); //T1.mul(B.gety()); // T1=Z1.Y2 - FP4_mul(BB, BB, &(B->x)); //T2.mul(B.getx()); // T2=Z1.X2 - - FP4_sub(AA, AA, BB); //X1.sub(T2); - FP4_norm(AA); //X1.norm(); // X1=X1-Z1.X2 - FP4_sub(CC, CC, &T1); //Y1.sub(T1); - FP4_norm(CC); //Y1.norm(); // Y1=Y1-Z1.Y2 - - FP4_copy(&T1, AA); //T1.copy(X1); // T1=X1-Z1.X2 - -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP4_times_i(AA); - FP4_norm(AA); -#endif - - FP4_mul(&T1, &T1, &(B->y)); //T1.mul(B.gety()); // T1=(X1-Z1.X2).Y2 - - FP4_copy(BB, CC); //T2.copy(Y1); // T2=Y1-Z1.Y2 - FP4_mul(BB, BB, &(B->x)); //T2.mul(B.getx()); // T2=(Y1-Z1.Y2).X2 - FP4_sub(BB, BB, &T1); //T2.sub(T1); - FP4_norm(BB); //T2.norm(); // T2=(Y1-Z1.Y2).X2 - (X1-Z1.X2).Y2 - - FP4_neg(CC, CC); //Y1.neg(); - FP4_norm(CC); //Y1.norm(); // Y1=-(Y1-Z1.Y2).Xs - *** - - ECP4_add(A, B); //A.add(B); -} - -/* Line function */ -static void ZZZ::PAIR_line(FP24 *v, ECP4 *A, ECP4 *B, FP *Qx, FP *Qy) -{ - FP4 AA, BB, CC; - FP8 a, b, c; - - if (A == B) - PAIR_double(A, &AA, &BB, &CC); - else - PAIR_add(A, B, &AA, &BB, &CC); - - FP4_qmul(&CC, &CC, Qx); - FP4_qmul(&AA, &AA, Qy); - - FP8_from_FP4s(&a, &AA, &BB); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP8_from_FP4(&b, &CC); - FP8_zero(&c); -#endif -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP8_zero(&b); - FP8_from_FP4H(&c, &CC); -#endif - - FP24_from_FP8s(v, &a, &b, &c); - v->type = FP_SPARSER; -} - -/* prepare ate parameter, n=6u+2 (BN) or n=u (BLS), n3=3*n */ -int ZZZ::PAIR_nbits(BIG n3, BIG n) -{ - BIG x; - BIG_rcopy(x, CURVE_Bnx); - - BIG_copy(n, x); - BIG_norm(n); - BIG_pmul(n3, n, 3); - BIG_norm(n3); - - return BIG_nbits(n3); -} - -/* - For multi-pairing, product of n pairings - 1. Declare FP24 array of length number of bits in Ate parameter - 2. Initialise this array by calling PAIR_initmp() - 3. Accumulate each pairing by calling PAIR_another() n times - 4. Call PAIR_miller() - 5. Call final exponentiation PAIR_fexp() -*/ - -/* prepare for multi-pairing */ -void ZZZ::PAIR_initmp(FP24 r[]) -{ - int i; - for (i = ATE_BITS_ZZZ - 1; i >= 0; i--) - FP24_one(&r[i]); - return; -} - -/* basic Miller loop */ -void ZZZ::PAIR_miller(FP24 *res, FP24 r[]) -{ - int i; - FP24_one(res); - for (i = ATE_BITS_ZZZ - 1; i >= 1; i--) - { - FP24_sqr(res, res); - FP24_ssmul(res, &r[i]); - FP24_zero(&r[i]); - } - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP24_conj(res, res); -#endif - FP24_ssmul(res, &r[0]); - FP24_zero(&r[0]); - return; -} - - -// Store precomputed line details in an FP4 -static void ZZZ::PAIR_pack(FP8 *T, FP4* AA, FP4* BB, FP4 *CC) -{ - FP4 I, A, B; - FP4_inv(&I, CC, NULL); - FP4_mul(&A, AA, &I); - FP4_mul(&B, BB, &I); - FP8_from_FP4s(T, &A, &B); -} - -// Unpack G2 line function details and include G1 -static void ZZZ::PAIR_unpack(FP24 *v, FP8* T, FP *Qx, FP *Qy) -{ - FP8 a, b, c; - FP4 t; - FP8_copy(&a, T); - FP4_qmul(&a.a, &a.a, Qy); - FP4_from_FP(&t, Qx); - -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP8_from_FP4(&b, &t); - FP8_zero(&c); -#endif -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP8_zero(&b); - FP8_from_FP4H(&c, &t); -#endif - - FP24_from_FP8s(v, &a, &b, &c); - v->type = FP_SPARSEST; -} - - -// Precompute table of line functions for fixed G2 value -void ZZZ::PAIR_precomp(FP8 T[], ECP4* GV) -{ - int i, j, nb, bt; - BIG n, n3; - FP4 AA, BB, CC; - ECP4 A, G, NG; - - ECP4_copy(&A, GV); - ECP4_copy(&G, GV); - ECP4_copy(&NG, GV); - ECP4_neg(&NG); - - nb = PAIR_nbits(n3, n); - j = 0; - - for (i = nb - 2; i >= 1; i--) - { - PAIR_double(&A, &AA, &BB, &CC); - PAIR_pack(&T[j++], &AA, &BB, &CC); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // bt=BIG_bit(n,i); - if (bt == 1) - { - PAIR_add(&A, &G, &AA, &BB, &CC); - PAIR_pack(&T[j++], &AA, &BB, &CC); - } - if (bt == -1) - { - PAIR_add(&A, &NG, &AA, &BB, &CC); - PAIR_pack(&T[j++], &AA, &BB, &CC); - } - } -} - -/* Accumulate another set of line functions for n-pairing, assuming precomputation on G2 */ -void ZZZ::PAIR_another_pc(FP24 r[], FP8 T[], ECP *QV) -{ - int i, j, nb, bt; - BIG x, n, n3; - FP24 lv, lv2; - ECP Q; - FP Qx, Qy; - - if (ECP_isinf(QV)) return; - - nb = PAIR_nbits(n3, n); - - ECP_copy(&Q, QV); - ECP_affine(&Q); - - FP_copy(&Qx, &(Q.x)); - FP_copy(&Qy, &(Q.y)); - - j = 0; - for (i = nb - 2; i >= 1; i--) - { - PAIR_unpack(&lv, &T[j++], &Qx, &Qy); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // bt=BIG_bit(n,i); - if (bt == 1) - { - PAIR_unpack(&lv2, &T[j++], &Qx, &Qy); - FP24_smul(&lv, &lv2); - } - if (bt == -1) - { - PAIR_unpack(&lv2, &T[j++], &Qx, &Qy); - FP24_smul(&lv, &lv2); - } - FP24_ssmul(&r[i], &lv); - } -} - -/* Accumulate another set of line functions for n-pairing */ -void ZZZ::PAIR_another(FP24 r[], ECP4* PV, ECP* QV) -{ - int i, j, nb, bt; - BIG x, n, n3; - FP24 lv, lv2; - ECP4 A, NP, P; - ECP Q; - FP Qx, Qy; - - if (ECP_isinf(QV)) return; - - nb = PAIR_nbits(n3, n); - - ECP4_copy(&P, PV); - ECP_copy(&Q, QV); - - ECP4_affine(&P); - ECP_affine(&Q); - - FP_copy(&Qx, &(Q.x)); - FP_copy(&Qy, &(Q.y)); - - ECP4_copy(&A, &P); - ECP4_copy(&NP, &P); ECP4_neg(&NP); - - for (i = nb - 2; i >= 1; i--) - { - PAIR_line(&lv, &A, &A, &Qx, &Qy); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // bt=BIG_bit(n,i); - if (bt == 1) - { - PAIR_line(&lv2, &A, &P, &Qx, &Qy); - FP24_smul(&lv, &lv2); - } - if (bt == -1) - { - PAIR_line(&lv2, &A, &NP, &Qx, &Qy); - FP24_smul(&lv, &lv2); - } - FP24_ssmul(&r[i], &lv); - } -} - -/* Optimal R-ate pairing r=e(P,Q) */ -void ZZZ::PAIR_ate(FP24 *r, ECP4 *P1, ECP *Q1) -{ - BIG x, n, n3; - FP Qx, Qy; - int i, nb, bt; - ECP4 A, NP, P; - ECP Q; - FP24 lv, lv2; - - FP24_one(r); - if (ECP_isinf(Q1)) return; - - nb = PAIR_nbits(n3, n); - - ECP4_copy(&P, P1); - ECP_copy(&Q, Q1); - - ECP4_affine(&P); - ECP_affine(&Q); - - FP_copy(&Qx, &(Q.x)); - FP_copy(&Qy, &(Q.y)); - - ECP4_copy(&A, &P); - ECP4_copy(&NP, &P); ECP4_neg(&NP); - - /* Main Miller Loop */ - for (i = nb - 2; i >= 1; i--) - { - FP24_sqr(r, r); - PAIR_line(&lv, &A, &A, &Qx, &Qy); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // BIG_bit(n,i); - if (bt == 1) - { - PAIR_line(&lv2, &A, &P, &Qx, &Qy); - FP24_smul(&lv, &lv2); - } - if (bt == -1) - { - PAIR_line(&lv2, &A, &NP, &Qx, &Qy); - FP24_smul(&lv, &lv2); - } - FP24_ssmul(r, &lv); - - } - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP24_conj(r, r); -#endif - -} - -/* Optimal R-ate double pairing e(P,Q).e(R,S) */ -void ZZZ::PAIR_double_ate(FP24 *r, ECP4 *P1, ECP *Q1, ECP4 *R1, ECP *S1) -{ - BIG x, n, n3; - FP Qx, Qy, Sx, Sy; - int i, nb, bt; - ECP4 A, B, NP, NR, P, R; - ECP Q, S; - FP24 lv, lv2; - - if (ECP_isinf(Q1)) - { - PAIR_ate(r, R1, S1); - return; - } - if (ECP_isinf(S1)) - { - PAIR_ate(r, P1, Q1); - return; - } - nb = PAIR_nbits(n3, n); - - ECP4_copy(&P, P1); - ECP_copy(&Q, Q1); - - ECP4_affine(&P); - ECP_affine(&Q); - - ECP4_copy(&R, R1); - ECP_copy(&S, S1); - - ECP4_affine(&R); - ECP_affine(&S); - - FP_copy(&Qx, &(Q.x)); - FP_copy(&Qy, &(Q.y)); - - FP_copy(&Sx, &(S.x)); - FP_copy(&Sy, &(S.y)); - - ECP4_copy(&A, &P); - ECP4_copy(&B, &R); - - ECP4_copy(&NP, &P); ECP4_neg(&NP); - ECP4_copy(&NR, &R); ECP4_neg(&NR); - - - FP24_one(r); - - /* Main Miller Loop */ - for (i = nb - 2; i >= 1; i--) - { - FP24_sqr(r, r); - PAIR_line(&lv, &A, &A, &Qx, &Qy); - PAIR_line(&lv2, &B, &B, &Sx, &Sy); - FP24_smul(&lv, &lv2); - FP24_ssmul(r, &lv); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // bt=BIG_bit(n,i); - if (bt == 1) - { - PAIR_line(&lv, &A, &P, &Qx, &Qy); - PAIR_line(&lv2, &B, &R, &Sx, &Sy); - FP24_smul(&lv, &lv2); - FP24_ssmul(r, &lv); - } - if (bt == -1) - { - PAIR_line(&lv, &A, &NP, &Qx, &Qy); - PAIR_line(&lv2, &B, &NR, &Sx, &Sy); - FP24_smul(&lv, &lv2); - FP24_ssmul(r, &lv); - } - } - - - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP24_conj(r, r); -#endif - -} - -/* final exponentiation - keep separate for multi-pairings and to avoid thrashing stack */ - -void ZZZ::PAIR_fexp(FP24 *r) -{ - FP2 X; - BIG x; - FP a, b; - FP24 t0, t1, t2; //, t3, t4, t5, t6, t7; // could lose one of these - r=t3 - - BIG_rcopy(x, CURVE_Bnx); - FP_rcopy(&a, Fra); - FP_rcopy(&b, Frb); - FP2_from_FPs(&X, &a, &b); - - /* Easy part of final exp - r^(p^12-1)(p^4+1)*/ - - FP24_inv(&t0, r); - FP24_conj(r, r); - - FP24_mul(r, &t0); - FP24_copy(&t0, r); - - FP24_frob(r, &X, 4); - - FP24_mul(r, &t0); - -// See https://eprint.iacr.org/2020/875.pdf - FP24_usqr(&t2,r); - FP24_mul(&t2,r); // t2=r^3 - - FP24_pow(&t1,r,x); // t1=r^x -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP24_conj(&t1, &t1); -#endif - FP24_conj(&t0,r); // t0=r^-1 - FP24_copy(r,&t1); - FP24_mul(r,&t0); // r=r^(x-1) - - FP24_pow(&t1,r,x); // t1=r^x -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP24_conj(&t1, &t1); -#endif - FP24_conj(&t0,r); // t0=r^-1 - FP24_copy(r,&t1); - FP24_mul(r,&t0); // r=r^(x-1) - -// ^(x+p) - FP24_pow(&t1,r,x); // t1=r^x -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP24_conj(&t1, &t1); -#endif - FP24_copy(&t0,r); - FP24_frob(&t0,&X,1); // t0=r^p - FP24_copy(r,&t1); - FP24_mul(r,&t0); // r=r^x.r^p - -// ^(x^2+p^2) - FP24_pow(&t1,r,x); - FP24_pow(&t1,&t1,x); // t1=r^x^2 - FP24_copy(&t0,r); - FP24_frob(&t0,&X,2); // t0=r^p^2 - FP24_mul(&t1,&t0); // t1=r^x^2.r^p^2 - FP24_copy(r,&t1); - -// ^(x^4+p^4-1) - FP24_pow(&t1,r,x); - FP24_pow(&t1,&t1,x); - FP24_pow(&t1,&t1,x); - FP24_pow(&t1,&t1,x); // t1=r^x^4 - FP24_copy(&t0,r); - FP24_frob(&t0,&X,4); // t0=r^p^4 - FP24_mul(&t1,&t0); // t1=r^x^4.r^p^4 - FP24_conj(&t0,r); // t0=r^-1 - FP24_copy(r,&t1); - FP24_mul(r,&t0); // r=r^x^4.r^p^4.r^-1 - - FP24_mul(r,&t2); - FP24_reduce(r); - -/* -// Ghamman & Fouotsa Method - (completely garbled in https://eprint.iacr.org/2016/130) - - FP24_usqr(&t7, r); // t7=f^2 - FP24_pow(&t1, &t7, x); // t1=t7^u - - BIG_fshr(x, 1); - FP24_pow(&t2, &t1, x); // t2=t1^(u/2) - BIG_fshl(x, 1); // x must be even - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP24_conj(&t1, &t1); -#endif - - FP24_conj(&t3, &t1); // t3=1/t1 - FP24_mul(&t2, &t3); // t2=t1*t3 - FP24_mul(&t2, r); // t2=t2*f - - - FP24_pow(&t3, &t2, x); // t3=t2^u - FP24_pow(&t4, &t3, x); // t4=t3^u - FP24_pow(&t5, &t4, x); // t5=t4^u - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP24_conj(&t3, &t3); - FP24_conj(&t5, &t5); -#endif - - FP24_frob(&t3, &X, 6); - FP24_frob(&t4, &X, 5); - - FP24_mul(&t3, &t4); // t3=t3.t4 - - - FP24_pow(&t6, &t5, x); // t6=t5^u -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP24_conj(&t6, &t6); -#endif - - - FP24_frob(&t5, &X, 4); - FP24_mul(&t3, &t5); // ?? - - - FP24_conj(&t0, &t2); // t0=1/t2 - FP24_mul(&t6, &t0); // t6=t6*t0 - - FP24_copy(&t5, &t6); - FP24_frob(&t5, &X, 3); - - FP24_mul(&t3, &t5); // t3=t3*t5 - FP24_pow(&t5, &t6, x); // t5=t6^x - FP24_pow(&t6, &t5, x); // t6=t5^x - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP24_conj(&t5, &t5); -#endif - - FP24_copy(&t0, &t5); - FP24_frob(&t0, &X, 2); - FP24_mul(&t3, &t0); // t3=t3*t0 - FP24_copy(&t0, &t6); // - FP24_frob(&t0, &X, 1); - - FP24_mul(&t3, &t0); // t3=t3*t0 - FP24_pow(&t5, &t6, x); // t5=t6*x - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP24_conj(&t5, &t5); -#endif - - FP24_frob(&t2, &X, 7); - - FP24_mul(&t5, &t7); // t5=t5*t7 - FP24_mul(&t3, &t2); // t3=t3*t2 - FP24_mul(&t3, &t5); // t3=t3*t5 - - FP24_mul(r, &t3); - FP24_reduce(r); -*/ -} - -#ifdef USE_GLV_ZZZ -/* GLV method */ -static void ZZZ::glv(BIG u[2], BIG ee) -{ - int bd; - BIG q,x,x2; - BIG_rcopy(q, CURVE_Order); - -// -(x^4).P = (Beta.x,y) - - BIG_rcopy(x, CURVE_Bnx); - - BIG_smul(x2, x, x); - BIG_smul(x, x2, x2); - bd=BIG_nbits(q)-BIG_nbits(x); // fixed x^4 - - BIG_copy(u[0], ee); - BIG_ctmod(u[0], x, bd); - BIG_copy(u[1], ee); - BIG_ctsdiv(u[1], x, bd); - - BIG_sub(u[1], q, u[1]); - - - return; -} -#endif // USE_GLV - -/* Galbraith & Scott Method */ -static void ZZZ::gs(BIG u[8], BIG ee) -{ - int i,bd; - BIG q,x,w; - BIG_rcopy(q, CURVE_Order); - - BIG_rcopy(x, CURVE_Bnx); - BIG_copy(w, ee); - bd=BIG_nbits(q)-BIG_nbits(x); // fixed - - for (i = 0; i < 7; i++) - { - BIG_copy(u[i], w); - BIG_ctmod(u[i], x, bd); - BIG_ctsdiv(w, x, bd); - } - BIG_copy(u[7], w); - - /* */ -#if SIGN_OF_X_ZZZ==NEGATIVEX - BIG_modneg(u[1], u[1], q); - BIG_modneg(u[3], u[3], q); - BIG_modneg(u[5], u[5], q); - BIG_modneg(u[7], u[7], q); -#endif - - return; -} - -/* Multiply P by e in group G1 */ -void ZZZ::PAIR_G1mul(ECP *P, BIG e) -{ - BIG ee,q; - BIG_copy(ee,e); - BIG_rcopy(q, CURVE_Order); - BIG_mod(ee,q); -#ifdef USE_GLV_ZZZ /* Note this method is patented */ - int np, nn; - ECP Q; - FP cru; - BIG t; - BIG u[2]; - - glv(u, ee); - - ECP_copy(&Q, P); ECP_affine(&Q); - FP_rcopy(&cru, CRu); - FP_mul(&(Q.x), &(Q.x), &cru); - - /* note that -a.B = a.(-B). Use a or -a depending on which is smaller */ - - np = BIG_nbits(u[0]); - BIG_modneg(t, u[0], q); - nn = BIG_nbits(t); - if (nn < np) - { - BIG_copy(u[0], t); - ECP_neg(P); - } - - np = BIG_nbits(u[1]); - BIG_modneg(t, u[1], q); - nn = BIG_nbits(t); - if (nn < np) - { - BIG_copy(u[1], t); - ECP_neg(&Q); - } - BIG_norm(u[0]); - BIG_norm(u[1]); - ECP_mul2(P, &Q, u[0], u[1]); - -#else - ECP_clmul(P, ee, q); -#endif -} - -/* Multiply P by e in group G2 */ -void ZZZ::PAIR_G2mul(ECP4 *P, BIG e) -{ - BIG ee,q; - BIG_copy(ee,e); - BIG_rcopy(q, CURVE_Order); - BIG_mod(ee,q); -#ifdef USE_GS_G2_ZZZ /* Well I didn't patent it :) */ - int i, np, nn; - ECP4 Q[8]; - FP2 X[3]; - BIG x, u[8]; - - ECP4_frob_constants(X); - - gs(u, ee); - - ECP4_copy(&Q[0], P); - for (i = 1; i < 8; i++) - { - ECP4_copy(&Q[i], &Q[i - 1]); - ECP4_frob(&Q[i], X, 1); - } - - for (i = 0; i < 8; i++) - { - np = BIG_nbits(u[i]); - BIG_modneg(x, u[i], q); - nn = BIG_nbits(x); - if (nn < np) - { - BIG_copy(u[i], x); - ECP4_neg(&Q[i]); - } - BIG_norm(u[i]); - } - - ECP4_mul8(P, Q, u); - -#else - ECP4_mul(P, ee); -#endif -} - -/* f=f^e */ -void ZZZ::PAIR_GTpow(FP24 *f, BIG e) -{ - BIG ee,q; - BIG_copy(ee,e); - BIG_rcopy(q, CURVE_Order); - BIG_mod(ee,q); -#ifdef USE_GS_GT_ZZZ /* Note that this option requires a lot of RAM! Maybe better to use compressed XTR method, see FP8.c */ - int i, np, nn; - FP24 g[8]; - FP2 X; - BIG t; - FP fx, fy; - BIG u[8]; - - FP_rcopy(&fx, Fra); - FP_rcopy(&fy, Frb); - FP2_from_FPs(&X, &fx, &fy); - - gs(u, ee); - - FP24_copy(&g[0], f); - for (i = 1; i < 8; i++) - { - FP24_copy(&g[i], &g[i - 1]); - FP24_frob(&g[i], &X, 1); - } - - for (i = 0; i < 8; i++) - { - np = BIG_nbits(u[i]); - BIG_modneg(t, u[i], q); - nn = BIG_nbits(t); - if (nn < np) - { - BIG_copy(u[i], t); - FP24_conj(&g[i], &g[i]); - } - BIG_norm(u[i]); - } - FP24_pow8(f, g, u); - -#else - FP24_pow(f, f, ee); -#endif -} - -/* test G1 group membership */ - -int ZZZ::PAIR_G1member(ECP *P) -{ - ECP W,T; - BIG x; - FP cru; - if (ECP_isinf(P)) return 0; - - BIG_rcopy(x, CURVE_Bnx); - ECP_copy(&W,P); - ECP_copy(&T,P); - ECP_mul(&T,x); - if (ECP_equals(P,&T)) return 0; // P is of low order - ECP_mul(&T,x); - ECP_mul(&T,x); ECP_mul(&T,x); - ECP_neg(&T); - - FP_rcopy(&cru, CRu); - FP_mul(&(W.x), &(W.x), &cru); - if (!ECP_equals(&W,&T)) return 0; // check that Endomorphism works - -// Not needed -// ECP_add(&W,P); -// FP_mul(&(T.x), &(T.x), &cru); -// ECP_add(&W,&T); -// if (!ECP_isinf(&W)) return 0; // use it to check order - -/* - BIG q; - ECP W; - if (ECP_isinf(P)) return 0; - BIG_rcopy(q, CURVE_Order); - ECP_copy(&W,P); - ECP_mul(&W,q); - if (!ECP_isinf(&W)) return 0; */ - return 1; -} - -/* test G2 group membership */ - -int ZZZ::PAIR_G2member(ECP4 *P) -{ - ECP4 W,T; - BIG x; - FP2 X[3]; - - if (ECP4_isinf(P)) return 0; - ECP4_frob_constants(X); - BIG_rcopy(x, CURVE_Bnx); - - ECP4_copy(&W,P); - ECP4_frob(&W, X, 1); - - ECP4_copy(&T,P); - ECP4_mul(&T,x); - -#if SIGN_OF_X_ZZZ==NEGATIVEX - ECP4_neg(&T); -#endif -/* - ECP4_copy(&R,&W); - ECP4_frob(&R,X,1); // R=\psi^2(P) - ECP4_sub(&W,&R); - ECP4_copy(&R,&T); // R=xP - ECP4_frob(&R,X,1); - ECP4_add(&W,&R); // W=\psi(P)-\psi^2(P)+\psi(xP) -*/ - if (ECP4_equals(&W,&T)) return 1; - return 0; - -/* - BIG q; - ECP4 W; - if (ECP4_isinf(P)) return 0; - BIG_rcopy(q, CURVE_Order); - ECP4_copy(&W,P); - ECP4_mul(&W,q); - if (!ECP4_isinf(&W)) return 0; - return 1; */ -} - -/* Check that m is in cyclotomic sub-group */ -/* Check that m!=1, conj(m)*m==1, and m.m^{p^8}=m^{p^4} */ -int ZZZ::PAIR_GTcyclotomic(FP24 *m) -{ - FP fx,fy; - FP2 X; - FP24 r,w; - if (FP24_isunity(m)) return 0; - FP24_conj(&r,m); - FP24_mul(&r,m); - if (!FP24_isunity(&r)) return 0; - - FP_rcopy(&fx,Fra); - FP_rcopy(&fy,Frb); - FP2_from_FPs(&X,&fx,&fy); - - FP24_copy(&r,m); FP24_frob(&r,&X,4); - FP24_copy(&w,&r); FP24_frob(&w,&X,4); - FP24_mul(&w,m); - - if (!FP24_equals(&w,&r)) return 0; - return 1; -} -/* test for full GT group membership */ - -int ZZZ::PAIR_GTmember(FP24 *m) -{ - BIG x; - FP2 X; - FP fx, fy; - FP24 r,t; - if (!PAIR_GTcyclotomic(m)) return 0; - - FP_rcopy(&fx, Fra); - FP_rcopy(&fy, Frb); - FP2_from_FPs(&X, &fx, &fy); - BIG_rcopy(x, CURVE_Bnx); - - FP24_copy(&r,m); - FP24_frob(&r, &X, 1); - - FP24_pow(&t,m,x); - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP24_conj(&t,&t); -#endif - - if (FP24_equals(&r,&t)) return 1; - return 0; -/* - BIG_rcopy(q, CURVE_Order); - FP24_pow(&r, m, q); - if (!FP24_isunity(&r)) return 0; - return 1; */ -} - -#ifdef HAS_MAIN - -using namespace std; -using namespace ZZZ; - - -// g++ -O2 pair4_BLS24.cpp ecp4_BLS24.cpp fp24_BLS24.cpp fp8_BLS24.cpp fp4_BLS24.cpp fp2_BLS24.cpp ecp_BLS24.cpp fp_BLS24.cpp big_XXX.cpp rom_curve_BLS24.cpp rom_field_BLS24.cpp rand.cpp hash.cpp oct.cpp -o pair4_BLS24.exe - -int main() -{ - int i; - char byt[32]; - csprng rng; - BIG xa, xb, ya, yb, w, a, b, t1, q, u[2], v[4], m, r, xx, x2, x4, p; - ECP4 P, G; - ECP Q, R; - FP24 g, gp; - FP8 t, c, cp, cpm1, cpm2; - FP4 X, Y; - FP2 x, y, f, Aa, Bb; - FP cru; - - for (i = 0; i < 32; i++) - byt[i] = i + 9; - RAND_seed(&rng, 32, byt); - - BIG_rcopy(r, CURVE_Order); - BIG_rcopy(p, Modulus); - - - BIG_rcopy(xa, CURVE_Gx); - BIG_rcopy(ya, CURVE_Gy); - - ECP_set(&Q, xa, ya); - if (Q.inf) printf("Failed to set - point not on curve\n"); - else printf("G1 set success\n"); - - printf("Q= "); - ECP_output(&Q); - printf("\n"); - - ECP4_generator(&P); - - if (P.inf) printf("Failed to set - point not on curve\n"); - else printf("G2 set success\n"); - - BIG_rcopy(a, Fra); - BIG_rcopy(b, Frb); - FP2_from_BIGs(&f, a, b); - - PAIR_ate(&g, &P, &Q); - - printf("gb= "); - FP24_output(&g); - printf("\n"); - PAIR_fexp(&g); - - printf("g= "); - FP24_output(&g); - printf("\n"); - - ECP_copy(&R, &Q); - ECP4_copy(&G, &P); - - ECP4_dbl(&G); - ECP_dbl(&R); - ECP_affine(&R); - - PAIR_ate(&g, &G, &Q); - PAIR_fexp(&g); - - printf("g1= "); - FP24_output(&g); - printf("\n"); - - PAIR_ate(&g, &P, &R); - PAIR_fexp(&g); - - printf("g2= "); - FP24_output(&g); - printf("\n"); - - - PAIR_G1mul(&Q, r); - printf("rQ= "); ECP_output(&Q); printf("\n"); - - PAIR_G2mul(&P, r); - printf("rP= "); ECP4_output(&P); printf("\n"); - - BIG_randomnum(w, r, &rng); - - FP24_copy(&gp, &g); - - PAIR_GTpow(&g, w); - - FP24_trace(&t, &g); - - printf("g^r= "); FP8_output(&t); printf("\n"); - - FP24_compow(&t, &gp, w, r); - - printf("t(g)= "); FP8_output(&t); printf("\n"); - -} - -#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair8.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair8.cpp deleted file mode 100644 index 7bfba83..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/pair8.cpp +++ /dev/null @@ -1,1181 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE BLS Curve pairing functions */ - -//#define HAS_MAIN - -#include "pair8_ZZZ.h" - -using namespace XXX; -using namespace YYY; - -namespace ZZZ { -static void PAIR_line(FP48 *, ECP8 *, ECP8 *, FP *, FP *); -static void PAIR_double(ECP8 *, FP8 *, FP8 *, FP8 *); -static void PAIR_add(ECP8 *, ECP8 *B, FP8 *, FP8 *, FP8 *); -static void PAIR_pack(FP16 *, FP8 *, FP8 *, FP8 *); -static void PAIR_unpack(FP48 *, FP16 *, FP *, FP *); -static void glv(BIG u[2], BIG); -static void gs(BIG u[4], BIG); -} - - -// Point doubling for pairings -static void ZZZ::PAIR_double(ECP8 *A, FP8 *AA, FP8 *BB, FP8 *CC) -{ - FP8 YY; - FP8_copy(CC, &(A->x)); //FP8 XX=new FP8(A.getx()); //X - FP8_copy(&YY, &(A->y)); //FP8 YY=new FP8(A.gety()); //Y - FP8_copy(BB, &(A->z)); //FP8 ZZ=new FP8(A.getz()); //Z - - FP8_copy(AA, &YY); //FP8 YZ=new FP8(YY); //Y - FP8_mul(AA, AA, BB); //YZ.mul(ZZ); //YZ - FP8_sqr(CC, CC); //XX.sqr(); //X^2 - FP8_sqr(&YY, &YY); //YY.sqr(); //Y^2 - FP8_sqr(BB, BB); //ZZ.sqr(); //Z^2 - - FP8_add(AA, AA, AA); - FP8_neg(AA, AA); - FP8_norm(AA); // -2YZ - FP8_times_i(AA); // -2YZi - - FP8_imul(BB, BB, 3 * CURVE_B_I); //3Bz^2 - FP8_imul(CC, CC, 3); //3X^2 - -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP8_times_i(&YY); // Y^2.i - FP8_times_i(CC); // 3X^2.i -#endif - -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP8_times_i(BB); // 3Bz^2.i -#endif - - FP8_sub(BB, BB, &YY); - FP8_norm(BB); - - ECP8_dbl(A); //A.dbl(); - -} - -// Point addition for pairings -static void ZZZ::PAIR_add(ECP8 *A, ECP8 *B, FP8 *AA, FP8 *BB, FP8 *CC) -{ - FP8 T1; - FP8_copy(AA, &(A->x)); //FP8 X1=new FP8(A.getx()); // X1 - FP8_copy(CC, &(A->y)); //FP8 Y1=new FP8(A.gety()); // Y1 - FP8_copy(&T1, &(A->z)); //FP8 T1=new FP8(A.getz()); // Z1 - - FP8_copy(BB, &T1); //FP8 T2=new FP8(A.getz()); // Z1 - - FP8_mul(&T1, &T1, &(B->y)); //T1.mul(B.gety()); // T1=Z1.Y2 - FP8_mul(BB, BB, &(B->x)); //T2.mul(B.getx()); // T2=Z1.X2 - - FP8_sub(AA, AA, BB); //X1.sub(T2); - FP8_norm(AA); //X1.norm(); // X1=X1-Z1.X2 - FP8_sub(CC, CC, &T1); //Y1.sub(T1); - FP8_norm(CC); //Y1.norm(); // Y1=Y1-Z1.Y2 - - FP8_copy(&T1, AA); //T1.copy(X1); // T1=X1-Z1.X2 - -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP8_times_i(AA); - FP8_norm(AA); -#endif - - FP8_mul(&T1, &T1, &(B->y)); //T1.mul(B.gety()); // T1=(X1-Z1.X2).Y2 - - FP8_copy(BB, CC); //T2.copy(Y1); // T2=Y1-Z1.Y2 - FP8_mul(BB, BB, &(B->x)); //T2.mul(B.getx()); // T2=(Y1-Z1.Y2).X2 - FP8_sub(BB, BB, &T1); //T2.sub(T1); - FP8_norm(BB); //T2.norm(); // T2=(Y1-Z1.Y2).X2 - (X1-Z1.X2).Y2 - - FP8_neg(CC, CC); //Y1.neg(); - FP8_norm(CC); //Y1.norm(); // Y1=-(Y1-Z1.Y2).Xs - *** - - ECP8_add(A, B); //A.add(B); -} - -/* Line function */ -static void ZZZ::PAIR_line(FP48 *v, ECP8 *A, ECP8 *B, FP *Qx, FP *Qy) -{ - FP8 AA, BB, CC; - FP16 a, b, c; - - if (A == B) - PAIR_double(A, &AA, &BB, &CC); - else - PAIR_add(A, B, &AA, &BB, &CC); - - FP8_tmul(&CC, &CC, Qx); - FP8_tmul(&AA, &AA, Qy); - - FP16_from_FP8s(&a, &AA, &BB); -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP16_from_FP8(&b, &CC); - FP16_zero(&c); -#endif -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP16_zero(&b); - FP16_from_FP8H(&c, &CC); -#endif - - FP48_from_FP16s(v, &a, &b, &c); - v->type = FP_SPARSER; -} - - -/* prepare ate parameter, n=6u+2 (BN) or n=u (BLS), n3=3*n */ -int ZZZ::PAIR_nbits(BIG n3, BIG n) -{ - BIG x; - BIG_rcopy(x, CURVE_Bnx); - - BIG_copy(n, x); - BIG_norm(n); - BIG_pmul(n3, n, 3); - BIG_norm(n3); - - return BIG_nbits(n3); -} - -/* - For multi-pairing, product of n pairings - 1. Declare FP48 array of length number of bits in Ate parameter - 2. Initialise this array by calling PAIR_initmp() - 3. Accumulate each pairing by calling PAIR_another() n times - 4. Call PAIR_miller() - 5. Call final exponentiation PAIR_fexp() -*/ - -/* prepare for multi-pairing */ -void ZZZ::PAIR_initmp(FP48 r[]) -{ - int i; - for (i = ATE_BITS_ZZZ - 1; i >= 0; i--) - FP48_one(&r[i]); - return; -} - -/* basic Miller loop */ -void ZZZ::PAIR_miller(FP48 *res, FP48 r[]) -{ - int i; - FP48_one(res); - for (i = ATE_BITS_ZZZ - 1; i >= 1; i--) - { - FP48_sqr(res, res); - FP48_ssmul(res, &r[i]); - FP48_zero(&r[i]); - } - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(res, res); -#endif - FP48_ssmul(res, &r[0]); - FP48_zero(&r[0]); - return; -} - - -// Store precomputed line details in an FP4 -static void ZZZ::PAIR_pack(FP16 *T, FP8* AA, FP8* BB, FP8 *CC) -{ - FP8 I, A, B; - FP8_inv(&I, CC, NULL); - FP8_mul(&A, AA, &I); - FP8_mul(&B, BB, &I); - FP16_from_FP8s(T, &A, &B); -} - -// Unpack G2 line function details and include G1 -static void ZZZ::PAIR_unpack(FP48 *v, FP16* T, FP *Qx, FP *Qy) -{ - FP16 a, b, c; - FP8 t; - FP16_copy(&a, T); - FP8_tmul(&a.a, &a.a, Qy); - FP8_from_FP(&t, Qx); - -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP16_from_FP8(&b, &t); - FP16_zero(&c); -#endif -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP16_zero(&b); - FP16_from_FP8H(&c, &t); -#endif - - FP48_from_FP16s(v, &a, &b, &c); - v->type = FP_SPARSEST; -} - -// Precompute table of line functions for fixed G2 value -void ZZZ::PAIR_precomp(FP16 T[], ECP8* GV) -{ - int i, j, nb, bt; - BIG n, n3; - FP8 AA, BB, CC; - ECP8 A, G, NG; - - ECP8_copy(&A, GV); - ECP8_copy(&G, GV); - ECP8_copy(&NG, GV); - ECP8_neg(&NG); - - nb = PAIR_nbits(n3, n); - j = 0; - - for (i = nb - 2; i >= 1; i--) - { - PAIR_double(&A, &AA, &BB, &CC); - PAIR_pack(&T[j++], &AA, &BB, &CC); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // bt=BIG_bit(n,i); - if (bt == 1) - { - PAIR_add(&A, &G, &AA, &BB, &CC); - PAIR_pack(&T[j++], &AA, &BB, &CC); - } - if (bt == -1) - { - PAIR_add(&A, &NG, &AA, &BB, &CC); - PAIR_pack(&T[j++], &AA, &BB, &CC); - } - } -} - -/* Accumulate another set of line functions for n-pairing, assuming precomputation on G2 */ -void ZZZ::PAIR_another_pc(FP48 r[], FP16 T[], ECP *QV) -{ - int i, j, nb, bt; - BIG x, n, n3; - FP48 lv, lv2; - ECP Q; - FP Qx, Qy; - - if (ECP_isinf(QV)) return; - - nb = PAIR_nbits(n3, n); - - ECP_copy(&Q, QV); - ECP_affine(&Q); - - FP_copy(&Qx, &(Q.x)); - FP_copy(&Qy, &(Q.y)); - - j = 0; - for (i = nb - 2; i >= 1; i--) - { - PAIR_unpack(&lv, &T[j++], &Qx, &Qy); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // bt=BIG_bit(n,i); - if (bt == 1) - { - PAIR_unpack(&lv2, &T[j++], &Qx, &Qy); - FP48_smul(&lv, &lv2); - } - if (bt == -1) - { - PAIR_unpack(&lv2, &T[j++], &Qx, &Qy); - FP48_smul(&lv, &lv2); - } - FP48_ssmul(&r[i], &lv); - } -} - -/* Accumulate another set of line functions for n-pairing */ -void ZZZ::PAIR_another(FP48 r[], ECP8* PV, ECP* QV) -{ - int i, j, nb, bt; - BIG x, n, n3; - FP48 lv, lv2; - ECP8 A, NP, P; - ECP Q; - FP Qx, Qy; - - if (ECP_isinf(QV)) return; - - nb = PAIR_nbits(n3, n); - - ECP8_copy(&P, PV); - ECP_copy(&Q, QV); - - ECP8_affine(&P); - ECP_affine(&Q); - - FP_copy(&Qx, &(Q.x)); - FP_copy(&Qy, &(Q.y)); - - ECP8_copy(&A, &P); - ECP8_copy(&NP, &P); ECP8_neg(&NP); - - for (i = nb - 2; i >= 1; i--) - { - PAIR_line(&lv, &A, &A, &Qx, &Qy); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // bt=BIG_bit(n,i); - if (bt == 1) - { - PAIR_line(&lv2, &A, &P, &Qx, &Qy); - FP48_smul(&lv, &lv2); - } - if (bt == -1) - { - PAIR_line(&lv2, &A, &NP, &Qx, &Qy); - FP48_smul(&lv, &lv2); - } - FP48_ssmul(&r[i], &lv); - } -} - -/* Optimal R-ate pairing r=e(P,Q) */ -void ZZZ::PAIR_ate(FP48 *r, ECP8 *P1, ECP *Q1) -{ - BIG x, n, n3; - FP Qx, Qy; - int i, nb, bt; - ECP8 A, NP, P; - ECP Q; - FP48 lv, lv2; - - FP48_one(r); - if (ECP_isinf(Q1)) return; - - nb = PAIR_nbits(n3, n); - - ECP8_copy(&P, P1); - ECP_copy(&Q, Q1); - - ECP8_affine(&P); - ECP_affine(&Q); - - - FP_copy(&Qx, &(Q.x)); - FP_copy(&Qy, &(Q.y)); - - ECP8_copy(&A, &P); - ECP8_copy(&NP, &P); ECP8_neg(&NP); - - /* Main Miller Loop */ - for (i = nb - 2; i >= 1; i--) - { - FP48_sqr(r, r); - PAIR_line(&lv, &A, &A, &Qx, &Qy); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // BIG_bit(n,i); - if (bt == 1) - { - PAIR_line(&lv2, &A, &P, &Qx, &Qy); - FP48_smul(&lv, &lv2); - } - if (bt == -1) - { - PAIR_line(&lv2, &A, &NP, &Qx, &Qy); - FP48_smul(&lv, &lv2); - } - FP48_ssmul(r, &lv); - - } - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(r, r); -#endif - -} - -/* Optimal R-ate double pairing e(P,Q).e(R,S) */ -void ZZZ::PAIR_double_ate(FP48 *r, ECP8 *P1, ECP *Q1, ECP8 *R1, ECP *S1) -{ - BIG x, n, n3; - FP Qx, Qy, Sx, Sy; - int i, nb, bt; - ECP8 A, B, NP, NR, P, R; - ECP Q, S; - FP48 lv, lv2; - - if (ECP_isinf(Q1)) - { - PAIR_ate(r, R1, S1); - return; - } - if (ECP_isinf(S1)) - { - PAIR_ate(r, P1, Q1); - return; - } - nb = PAIR_nbits(n3, n); - - ECP8_copy(&P, P1); - ECP_copy(&Q, Q1); - - ECP8_affine(&P); - ECP_affine(&Q); - - ECP8_copy(&R, R1); - ECP_copy(&S, S1); - - ECP8_affine(&R); - ECP_affine(&S); - - FP_copy(&Qx, &(Q.x)); - FP_copy(&Qy, &(Q.y)); - - FP_copy(&Sx, &(S.x)); - FP_copy(&Sy, &(S.y)); - - ECP8_copy(&A, &P); - ECP8_copy(&B, &R); - - ECP8_copy(&NP, &P); ECP8_neg(&NP); - ECP8_copy(&NR, &R); ECP8_neg(&NR); - - FP48_one(r); - - /* Main Miller Loop */ - for (i = nb - 2; i >= 1; i--) - { - FP48_sqr(r, r); - PAIR_line(&lv, &A, &A, &Qx, &Qy); - PAIR_line(&lv2, &B, &B, &Sx, &Sy); - FP48_smul(&lv, &lv2); - FP48_ssmul(r, &lv); - - bt = BIG_bit(n3, i) - BIG_bit(n, i); // bt=BIG_bit(n,i); - if (bt == 1) - { - PAIR_line(&lv, &A, &P, &Qx, &Qy); - PAIR_line(&lv2, &B, &R, &Sx, &Sy); - FP48_smul(&lv, &lv2); - FP48_ssmul(r, &lv); - } - if (bt == -1) - { - PAIR_line(&lv, &A, &NP, &Qx, &Qy); - PAIR_line(&lv2, &B, &NR, &Sx, &Sy); - FP48_smul(&lv, &lv2); - FP48_ssmul(r, &lv); - } - } - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(r, r); -#endif - -} - -/* final exponentiation - keep separate for multi-pairings and to avoid thrashing stack */ - -void ZZZ::PAIR_fexp(FP48 *r) -{ - FP2 X; - BIG x; - FP a, b; - FP48 t0, t1, t2;//, t3; - - BIG_rcopy(x, CURVE_Bnx); - FP_rcopy(&a, Fra); - FP_rcopy(&b, Frb); - FP2_from_FPs(&X, &a, &b); - - /* Easy part of final exp - r^(p^24-1)(p^8+1)*/ - - FP48_inv(&t0, r); - FP48_conj(r, r); - - FP48_mul(r, &t0); - FP48_copy(&t0, r); - - FP48_frob(r, &X, 8); - - FP48_mul(r, &t0); - -// See https://eprint.iacr.org/2020/875.pdf - FP48_usqr(&t2,r); - FP48_mul(&t2,r); // t2=r^3 - - FP48_pow(&t1,r,x); // t1=r^x -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_conj(&t0,r); // t0=r^-1 - FP48_copy(r,&t1); - FP48_mul(r,&t0); // r=r^(x-1) - - FP48_pow(&t1,r,x); // t1=r^x -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_conj(&t0,r); // t0=r^-1 - FP48_copy(r,&t1); - FP48_mul(r,&t0); // r=r^(x-1) - -// ^(x+p) - FP48_pow(&t1,r,x); // t1=r^x -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t0,r); - FP48_frob(&t0,&X,1); // t0=r^p - FP48_copy(r,&t1); - FP48_mul(r,&t0); // r=r^x.r^p - -// ^(x^2+p^2) - FP48_pow(&t1,r,x); - FP48_pow(&t1,&t1,x); // t1=r^x^2 - FP48_copy(&t0,r); - FP48_frob(&t0,&X,2); // t0=r^p^2 - FP48_mul(&t1,&t0); // t1=r^x^2.r^p^2 - FP48_copy(r,&t1); - -// ^(x^4+p^4) - FP48_pow(&t1,r,x); - FP48_pow(&t1,&t1,x); - FP48_pow(&t1,&t1,x); - FP48_pow(&t1,&t1,x); // t1=r^x^4 - FP48_copy(&t0,r); - FP48_frob(&t0,&X,4); // t0=r^p^4 - FP48_mul(&t1,&t0); // t1=r^x^4.r^p^4 - FP48_copy(r,&t1); - -// ^(x^8+p^8-1) - FP48_pow(&t1,r,x); - FP48_pow(&t1,&t1,x); - FP48_pow(&t1,&t1,x); - FP48_pow(&t1,&t1,x); - FP48_pow(&t1,&t1,x); - FP48_pow(&t1,&t1,x); - FP48_pow(&t1,&t1,x); - FP48_pow(&t1,&t1,x); // t1=r^x^8 - FP48_copy(&t0,r); - FP48_frob(&t0,&X,8); // t0=r^p^8 - FP48_mul(&t1,&t0); // t1=r^x^8.r^p^8 - FP48_conj(&t0,r); // t0=r^-1 - FP48_copy(r,&t1); - FP48_mul(r,&t0); // r=r^x^4.r^p^4.r^-1 - - FP48_mul(r,&t2); - FP48_reduce(r); -/* -// f^e0.f^e1^p.f^e2^p^2.. .. f^e14^p^14.f^e15^p^15 - - FP48_usqr(&t7, r); // t7=f^2 - - if (BIG_parity(x) == 1) - { - FP48_pow(&t2, r, x); // f^u - FP48_usqr(&t1, &t2); // f^(2u) - FP48_pow(&t2, &t2, x); // f^u^2 - } else { - FP48_pow(&t1, &t7, x); // t1=f^2u - BIG_fshr(x, 1); - FP48_pow(&t2, &t1, x); // t2=f^2u^(u/2) = f^u^2 - BIG_fshl(x, 1); // x must be even - } -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - - FP48_conj(&t3, &t1); // t3=f^-2u - FP48_mul(&t2, &t3); // t2=f^u^2.f^-2u - FP48_mul(&t2, r); // t2=f^u^2.f^-2u.f = f^(u^2-2u+1) = f^e15 - - FP48_mul(r, &t7); // f^3 - - FP48_pow(&t1, &t2, x); // f^e15^u = f^(u.e15) = f^(u^3-2u^2+u) = f^(e14) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 14); // f^(u^3-2u^2+u)^p^14 - FP48_mul(r, &t3); // f^3.f^(u^3-2u^2+u)^p^14 - - FP48_pow(&t1, &t1, x); // f^(u.e14) = f^(u^4-2u^3+u^2) = f^(e13) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 13); // f^(e13)^p^13 - FP48_mul(r, &t3); // f^3.f^(u^3-2u^2+u)^p^14.f^(u^4-2u^3+u^2)^p^13 - - FP48_pow(&t1, &t1, x); // f^(u.e13) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 12); // f^(e12)^p^12 - FP48_mul(r, &t3); - - FP48_pow(&t1, &t1, x); // f^(u.e12) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 11); // f^(e11)^p^11 - FP48_mul(r, &t3); - - FP48_pow(&t1, &t1, x); // f^(u.e11) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 10); // f^(e10)^p^10 - FP48_mul(r, &t3); - - FP48_pow(&t1, &t1, x); // f^(u.e10) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 9); // f^(e9)^p^9 - FP48_mul(r, &t3); - - FP48_pow(&t1, &t1, x); // f^(u.e9) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 8); // f^(e8)^p^8 - FP48_mul(r, &t3); - - FP48_pow(&t1, &t1, x); // f^(u.e8) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_conj(&t3, &t2); - FP48_mul(&t1, &t3); // f^(u.e8).f^-e15 - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 7); // f^(e7)^p^7 - FP48_mul(r, &t3); - - FP48_pow(&t1, &t1, x); // f^(u.e7) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 6); // f^(e6)^p^6 - FP48_mul(r, &t3); - - FP48_pow(&t1, &t1, x); // f^(u.e6) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 5); // f^(e5)^p^5 - FP48_mul(r, &t3); - - FP48_pow(&t1, &t1, x); // f^(u.e5) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 4); // f^(e4)^p^4 - FP48_mul(r, &t3); - - FP48_pow(&t1, &t1, x); // f^(u.e4) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 3); // f^(e3)^p^3 - FP48_mul(r, &t3); - - FP48_pow(&t1, &t1, x); // f^(u.e3) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 2); // f^(e2)^p^2 - FP48_mul(r, &t3); - - FP48_pow(&t1, &t1, x); // f^(u.e2) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_copy(&t3, &t1); - FP48_frob(&t3, &X, 1); // f^(e1)^p^1 - FP48_mul(r, &t3); - - FP48_pow(&t1, &t1, x); // f^(u.e1) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t1, &t1); -#endif - FP48_mul(r, &t1); // r.f^e0 - - FP48_frob(&t2, &X, 15); // f^(e15.p^15) - FP48_mul(r, &t2); - - FP48_reduce(r); -*/ -} - -#ifdef USE_GLV_ZZZ -/* GLV method */ -static void ZZZ::glv(BIG u[2], BIG ee) -{ - - int bd; - BIG q,x,x2; - BIG_rcopy(q, CURVE_Order); - -// -(x^8).P = (Beta.x,y) - - BIG_rcopy(x, CURVE_Bnx); - - BIG_smul(x2, x, x); - BIG_smul(x, x2, x2); - BIG_smul(x2, x, x); - bd=BIG_nbits(q)-BIG_nbits(x2); // fixed x^8 - - BIG_copy(u[0], ee); - BIG_ctmod(u[0], x2, bd); - BIG_copy(u[1], ee); - BIG_ctsdiv(u[1], x2, bd); - - BIG_sub(u[1], q, u[1]); - - return; -} -#endif // USE_GLV - -/* Galbraith & Scott Method */ -static void ZZZ::gs(BIG u[16], BIG ee) -{ - int i,bd; - BIG q,x,w; - BIG_rcopy(q, CURVE_Order); - - BIG_rcopy(x, CURVE_Bnx); - BIG_copy(w, ee); - bd=BIG_nbits(q)-BIG_nbits(x); // fixed - - for (i = 0; i < 15; i++) - { - BIG_copy(u[i], w); - BIG_ctmod(u[i], x, bd); - BIG_ctsdiv(w, x, bd); - } - BIG_copy(u[15], w); - - /* */ -#if SIGN_OF_X_ZZZ==NEGATIVEX - BIG_modneg(u[1], u[1], q); - BIG_modneg(u[3], u[3], q); - BIG_modneg(u[5], u[5], q); - BIG_modneg(u[7], u[7], q); - BIG_modneg(u[9], u[9], q); - BIG_modneg(u[11], u[11], q); - BIG_modneg(u[13], u[13], q); - BIG_modneg(u[15], u[15], q); -#endif - - - return; -} - -/* Multiply P by e in group G1 */ -void ZZZ::PAIR_G1mul(ECP *P, BIG e) -{ - BIG ee,q; - BIG_copy(ee,e); - BIG_rcopy(q, CURVE_Order); - BIG_mod(ee,q); -#ifdef USE_GLV_ZZZ /* Note this method is patented */ - int np, nn; - ECP Q; - FP cru; - BIG t; - BIG u[2]; - - glv(u, ee); - - ECP_copy(&Q, P); ECP_affine(&Q); - FP_rcopy(&cru, CRu); - FP_mul(&(Q.x), &(Q.x), &cru); - - /* note that -a.B = a.(-B). Use a or -a depending on which is smaller */ - - np = BIG_nbits(u[0]); - BIG_modneg(t, u[0], q); - nn = BIG_nbits(t); - if (nn < np) - { - BIG_copy(u[0], t); - ECP_neg(P); - } - - np = BIG_nbits(u[1]); - BIG_modneg(t, u[1], q); - nn = BIG_nbits(t); - if (nn < np) - { - BIG_copy(u[1], t); - ECP_neg(&Q); - } - BIG_norm(u[0]); - BIG_norm(u[1]); - ECP_mul2(P, &Q, u[0], u[1]); - -#else - ECP_clmul(P, ee, q); -#endif -} - -/* Multiply P by e in group G2 */ -void ZZZ::PAIR_G2mul(ECP8 *P, BIG e) -{ - BIG ee,q; - BIG_copy(ee,e); - BIG_rcopy(q, CURVE_Order); - BIG_mod(ee,q); -#ifdef USE_GS_G2_ZZZ /* Well we didn't patent it :) */ - int i, np, nn; - ECP8 Q[16], T; - FP2 X[3]; - BIG x, u[16]; - - ECP8_frob_constants(X); - - gs(u, ee); - - ECP8_copy(&Q[0], P); - - for (i = 1; i < 16; i++) - { - ECP8_copy(&Q[i], &Q[i - 1]); - ECP8_frob(&Q[i], X, 1); - } - - for (i = 0; i < 16; i++) - { - np = BIG_nbits(u[i]); - BIG_modneg(x, u[i], q); - BIG_norm(x); - nn = BIG_nbits(x); - if (nn < np) - { - BIG_copy(u[i], x); - ECP8_neg(&Q[i]); - } - BIG_norm(u[i]); - } - - ECP8_mul16(P, Q, u); - -#else - ECP8_mul(P, ee); -#endif -} - -/* f=f^e */ -void ZZZ::PAIR_GTpow(FP48 *f, BIG e) -{ - BIG ee,q; - BIG_copy(ee,e); - BIG_rcopy(q, CURVE_Order); - BIG_mod(ee,q); -#ifdef USE_GS_GT_ZZZ /* Note that this option requires a lot of RAM! Maybe better to use compressed XTR method, see FP16.cpp */ - int i, np, nn; - FP48 g[16]; - FP2 X; - BIG t; - FP fx, fy; - BIG u[16]; - - FP_rcopy(&fx, Fra); - FP_rcopy(&fy, Frb); - FP2_from_FPs(&X, &fx, &fy); - - gs(u, ee); - - FP48_copy(&g[0], f); - for (i = 1; i < 16; i++) - { - FP48_copy(&g[i], &g[i - 1]); - FP48_frob(&g[i], &X, 1); - } - - for (i = 0; i < 16; i++) - { - np = BIG_nbits(u[i]); - BIG_modneg(t, u[i], q); - nn = BIG_nbits(t); - if (nn < np) - { - BIG_copy(u[i], t); - FP48_conj(&g[i], &g[i]); - } - BIG_norm(u[i]); - } - FP48_pow16(f, g, u); - -#else - FP48_pow(f, f, ee); -#endif -} - -/* test G1 group membership */ - -int ZZZ::PAIR_G1member(ECP *P) -{ - ECP W,T; - BIG x; - FP cru; - if (ECP_isinf(P)) return 0; - - BIG_rcopy(x, CURVE_Bnx); - ECP_copy(&W,P); - ECP_copy(&T,P); - ECP_mul(&T,x); - if (ECP_equals(P,&T)) return 0; // P is of low order - ECP_mul(&T,x); - ECP_mul(&T,x); ECP_mul(&T,x); - ECP_mul(&T,x); ECP_mul(&T,x); - ECP_mul(&T,x); ECP_mul(&T,x); - ECP_neg(&T); - - FP_rcopy(&cru, CRu); - FP_mul(&(W.x), &(W.x), &cru); - if (!ECP_equals(&W,&T)) return 0; // check that Endomorphism works - -// Not needed -// ECP_add(&W,P); -// FP_mul(&(T.x), &(T.x), &cru); -// ECP_add(&W,&T); -// if (!ECP_isinf(&W)) return 0; // use it to check order -/* - BIG q; - ECP W; - if (ECP_isinf(P)) return 0; - BIG_rcopy(q, CURVE_Order); - ECP_copy(&W,P); - ECP_mul(&W,q); - if (!ECP_isinf(&W)) return 0; */ - return 1; -} - -/* test G2 group membership */ - -int ZZZ::PAIR_G2member(ECP8 *P) -{ - ECP8 W,T; - BIG x; - FP2 X[3]; - - if (ECP8_isinf(P)) return 0; - ECP8_frob_constants(X); - BIG_rcopy(x, CURVE_Bnx); - - ECP8_copy(&W,P); - ECP8_frob(&W, X, 1); - - ECP8_copy(&T,P); - ECP8_mul(&T,x); - -#if SIGN_OF_X_ZZZ==NEGATIVEX - ECP8_neg(&T); -#endif -/* - ECP8_copy(&R,&W); - ECP8_frob(&R,X,1); // R=\psi^2(P) - ECP8_sub(&W,&R); - ECP8_copy(&R,&T); // R=xP - ECP8_frob(&R,X,1); - ECP8_add(&W,&R); // W=\psi(P)-\psi^2(P)+\psi(xP) -*/ - if (ECP8_equals(&W,&T)) return 1; - return 0; - - -/* BIG q; - ECP8 W; - if (ECP8_isinf(P)) return 0; - BIG_rcopy(q, CURVE_Order); - ECP8_copy(&W,P); - ECP8_mul(&W,q); - if (!ECP8_isinf(&W)) return 0; - return 1; */ -} - - -/* Check that m is in cyclotomic sub-group */ -/* Check that m!=1, conj(m)*m==1, and m.m^{p^16}=m^{p^8} */ -int ZZZ::PAIR_GTcyclotomic(FP48 *m) -{ - FP fx,fy; - FP2 X; - FP48 r,w; - if (FP48_isunity(m)) return 0; - FP48_conj(&r,m); - FP48_mul(&r,m); - if (!FP48_isunity(&r)) return 0; - - FP_rcopy(&fx,Fra); - FP_rcopy(&fy,Frb); - FP2_from_FPs(&X,&fx,&fy); - - FP48_copy(&r,m); FP48_frob(&r,&X,8); - FP48_copy(&w,&r); FP48_frob(&w,&X,8); - FP48_mul(&w,m); - - if (!FP48_equals(&w,&r)) return 0; - return 1; -} - -/* test for full GT group membership */ -int ZZZ::PAIR_GTmember(FP48 *m) -{ - BIG x; - FP2 X; - FP fx, fy; - FP48 r,t; - if (!PAIR_GTcyclotomic(m)) return 0; - - FP_rcopy(&fx, Fra); - FP_rcopy(&fy, Frb); - FP2_from_FPs(&X, &fx, &fy); - BIG_rcopy(x, CURVE_Bnx); - - FP48_copy(&r,m); - FP48_frob(&r, &X, 1); - - FP48_pow(&t,m,x); - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_conj(&t,&t); -#endif - - if (FP48_equals(&r,&t)) return 1; - return 0; -/* - BIG_rcopy(q, CURVE_Order); - FP48_pow(&r, m, q); - if (!FP48_isunity(&r)) return 0; - return 1; */ -} - -#ifdef HAS_MAIN - -using namespace std; -using namespace ZZZ; - - -// g++ -O2 pair8_BLS48.cpp ecp8_BLS48.cpp fp48_BLS48.cpp fp16_BLS48.cpp fp8_BLS48.cpp fp4_BLS48.cpp fp2_BLS48.cpp ecp_BLS48.cpp fp_BLS48.cpp big_B560_29.cpp rom_curve_BLS48.cpp rom_field_BLS48.cpp rand.cpp hash.cpp oct.cpp -o pair8_BLS48.exe - -int main() -{ - int i; - char byt[32]; - csprng rng; - BIG xa, xb, ya, yb, w, a, b, t1, q, u[2], v[4], m, r, xx, x2, x4, p; - ECP8 P, G; - ECP Q, R; - FP48 g, gp; - FP16 t, c, cp, cpm1, cpm2; - FP8 X, Y; - FP2 x, y, f, Aa, Bb; - FP cru; - - for (i = 0; i < 32; i++) - byt[i] = i + 9; - RAND_seed(&rng, 32, byt); - - BIG_rcopy(r, CURVE_Order); - BIG_rcopy(p, Modulus); - - - BIG_rcopy(xa, CURVE_Gx); - BIG_rcopy(ya, CURVE_Gy); - - ECP_set(&Q, xa, ya); - if (Q.inf) printf("Failed to set - point not on curve\n"); - else printf("G1 set success\n"); - - printf("Q= "); - ECP_output(&Q); - printf("\n"); - - ECP8_generator(&P); - - if (P.inf) printf("Failed to set - point not on curve\n"); - else printf("G2 set success\n"); - - BIG_rcopy(a, Fra); - BIG_rcopy(b, Frb); - FP2_from_BIGs(&f, a, b); - - PAIR_ate(&g, &P, &Q); - - printf("gb= "); - FP48_output(&g); - printf("\n"); - PAIR_fexp(&g); - - printf("g= "); - FP48_output(&g); - printf("\n"); - - ECP_copy(&R, &Q); - ECP8_copy(&G, &P); - - ECP8_dbl(&G); - ECP_dbl(&R); - ECP_affine(&R); - - PAIR_ate(&g, &G, &Q); - PAIR_fexp(&g); - - printf("g1= "); - FP48_output(&g); - printf("\n"); - - PAIR_ate(&g, &P, &R); - PAIR_fexp(&g); - - printf("g2= "); - FP48_output(&g); - printf("\n"); - - PAIR_G1mul(&Q, r); - printf("rQ= "); ECP_output(&Q); printf("\n"); - - PAIR_G2mul(&P, r); - printf("rP= "); ECP8_output(&P); printf("\n"); - - PAIR_GTpow(&g, r); - printf("g^r= "); FP48_output(&g); printf("\n"); - - BIG_randomnum(w, r, &rng); - - FP48_copy(&gp, &g); - - PAIR_GTpow(&g, w); - - FP48_trace(&t, &g); - - printf("g^r= "); FP16_output(&t); printf("\n"); - - FP48_compow(&t, &gp, w, r); - - printf("t(g)= "); FP16_output(&t); printf("\n"); - -} - -#endif diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rand.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rand.cpp deleted file mode 100644 index a3bda7b..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rand.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Cryptographic strong random number generator - * - * Unguessable seed -> SHA -> PRNG internal state -> SHA -> random numbers - * Slow - but secure - * - * See ftp://ftp.rsasecurity.com/pub/pdfs/bull-1.pdf for a justification - */ -/* SU=m, m is Stack Usage */ - -#include "core.h" - -using namespace core; - -/* SU= 20 */ -static unsign32 sbrand(csprng *rng) -{ - /* Marsaglia & Zaman random number generator */ - int i, k; - unsign32 pdiff, t; - rng->rndptr++; - if (rng->rndptr < NK) return rng->ira[rng->rndptr]; - rng->rndptr = 0; - for (i = 0, k = NK - NJ; i < NK; i++, k++) - { - /* calculate next NK values */ - if (k == NK) k = 0; - t = rng->ira[k]; - pdiff = t - rng->ira[i] - rng->borrow; - - if (pdiff < t) rng->borrow = 0; - if (pdiff > t) rng->borrow = 1; - rng->ira[i] = pdiff; - } - return rng->ira[0]; -} - -/* SU= 20 */ -static void sirand(csprng* rng, unsign32 seed) -{ - /* initialise random number system */ - /* modified so that a subsequent call "stirs" in another seed value */ - /* in this way as many seed bits as desired may be used */ - int i, in; - unsign32 t, m = 1; - rng->borrow = 0L; - rng->rndptr = 0; - rng->ira[0] ^= seed; - for (i = 1; i < NK; i++) - { - /* fill initialisation vector */ - in = (NV * i) % NK; - rng->ira[in] ^= m; /* note XOR */ - t = m; - m = seed - m; - seed = t; - } - for (i = 0; i < 10000; i++) sbrand(rng ); /* "warm-up" & stir the generator */ -} - -/* SU= 312 */ -static void fill_pool(csprng *rng) -{ - /* hash down output of RNG to re-fill the pool */ - int i; - hash256 sh; - HASH256_init(&sh); - for (i = 0; i < 128; i++) HASH256_process(&sh, sbrand(rng)); - HASH256_hash(&sh, rng->pool); - rng->pool_ptr = 0; -} - -static unsign32 pack(const uchar *b) -{ - /* pack bytes into a 32-bit Word */ - return ((unsign32)b[3] << 24) | ((unsign32)b[2] << 16) | ((unsign32)b[1] << 8) | (unsign32)b[0]; -} - -/* SU= 360 */ -/* Initialize RNG with some real entropy from some external source */ -void core::RAND_seed(csprng *rng, int rawlen, char *raw) -{ - /* initialise from at least 128 byte string of raw * - * random (keyboard?) input, and 32-bit time-of-day */ - int i; - char digest[32]; - uchar b[4]; - hash256 sh; - rng->pool_ptr = 0; - for (i = 0; i < NK; i++) rng->ira[i] = 0; - if (rawlen > 0) - { - HASH256_init(&sh); - for (i = 0; i < rawlen; i++) - HASH256_process(&sh, raw[i]); - HASH256_hash(&sh, digest); - - /* initialise PRNG from distilled randomness */ - - for (i = 0; i < 8; i++) - { - b[0] = digest[4 * i]; - b[1] = digest[4 * i + 1]; - b[2] = digest[4 * i + 2]; - b[3] = digest[4 * i + 3]; - // printf("%08x\n",pack(b)); - sirand(rng, pack(b)); - } - } - fill_pool(rng); -} - -/* Terminate and clean up */ -void core::RAND_clean(csprng *rng) -{ - /* kill internal state */ - int i; - rng->pool_ptr = rng->rndptr = 0; - for (i = 0; i < 32; i++) rng->pool[i] = 0; - for (i = 0; i < NK; i++) rng->ira[i] = 0; - rng->borrow = 0; -} - -/* get random byte */ -/* SU= 8 */ -int core::RAND_byte(csprng *rng) -{ - int r; - r = rng->pool[rng->pool_ptr++]; - if (rng->pool_ptr >= 32) fill_pool(rng); - return (r & 0xff); -} - -/* test main program */ -/* -#include -#include - -void main() -{ - int i; - char raw[256]; - csprng rng; - - RAND_clean(&rng); - - - for (i=0;i<256;i++) raw[i]=(char)i; - RAND_seed(&rng,256,raw); - - for (i=0;i<1000;i++) - printf("%02x ",(unsigned char)RAND_byte(&rng)); -} - -*/ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/randapi.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/randapi.cpp deleted file mode 100644 index 9f2d5c5..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/randapi.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "randapi.h" - -using namespace core; - -/* Initialise a Cryptographically Strong Random Number Generator from - an octet of raw random data */ - -void core::CREATE_CSPRNG(csprng *RNG, octet *RAW) -{ - RAND_seed(RNG, RAW->len, RAW->val); -} - -void core::KILL_CSPRNG(csprng *RNG) -{ - RAND_clean(RNG); -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/readme.md b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/readme.md deleted file mode 100644 index a998d83..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/readme.md +++ /dev/null @@ -1,124 +0,0 @@ -# Description - -This C++ version is really just C plus namespaces. Namespaces are the -only feature of C++ that is used - -Separate ROM files provide the constants required for each curve. The -associated header files (big.h, fp.h and ecp.h) also specify -certain constants that must be set for the particular curve. - -# Installation and Testing - -To build a library and see it in action, copy all of the files in this -directory to a fresh directory. Then execute the python3 script config32.py -for a 32-bit build, or config64.py for a 64-bit build, and select the curves -that you wish to support. Note that support for 16-bit builds is currently -somewhat limited - see config16.py. A library is built automatically -including all of the modules that you will need. - -The configuration files assume the g++ compiler. For clang++ edit the -config*.py files and substitute "clang++" for "g++". -Note that clang++ is about 10-15% faster.* - -Make sure to use a 64-bit compiler on a 64-bit architecture. - ---------------------------------------- - -To create a 32-bit library - - python3 config32.py - -Then select options 1, 3, 7, 28, 30, 37, 38 and 42, which are fixed for the example -programs. (For a 16-bit build select 1, 4 and 6). Select 0 then to exit. - -Then compile - - g++ -O2 testecc.cpp core.a -o testecc - -(if using MINGW-W64 in Windows change -o testecc to -o testecc.exe) - -The test program exercises 3 different ordinary elliptic curves (for ECDH -Key exchange, ECDSA signature and ECIES encryption), plus RSA, all in the -one binary - -Next compile - - g++ -O2 testeddsa.cpp core.a -o testeddsa - -This test program exercises the EDDSA signature algorithm using the Edwards curves Ed25519 and Ed448 - - -Next compile - - g++ -O2 testmpin.cpp core.a -o testmpin - -This test program exercises 4 different pairing friendly curves using -the MPIN authentication protocol. - -The correct PIN is 1234 - - -Next compile - - g++ -O2 testbls.cpp core.a -o testbls - -This program implements the pairing-based BLS signature - - -Next compile - - g++ -O2 benchtest_all.cpp core.a -o benchtest_all - -This program provides some timings. - -Finally - - g++ -O2 testnhs.cpp core.a -o testnhs - -------------------------------------------------- - -Alternatively building and testing can be combined via - - python3 configXX.py test - -where XX can be 16, 32 or 64 - -Note that this builds the library for ALL of the options. -Executables of the above test programs are created, and can be run immediately. - -------------------------------------------------- - -NEW: support for emerging Hash To Curve standard. -See https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/ - - -Create 32 or 64-bit library selecting curves 1, 2, 3, 7, 17 and 31 (Ed25519, C25519, NIST256, Ed448, SECP256K1 and BLS12381) - - g++ -O2 testhtp.cpp core.a -o testhtp - -Test program runs through test vectors from the draft standard. - -------------------------------------------------- - -NEW: Experimental support for emerging HPKE (Hybrid Public Key Encryption) standard. -See https://datatracker.ietf.org/doc/draft-irtf-cfrg-hpke/ - -New hpke.cpp/.h api files - -- Supports KEM_IDs for X25519, X448, P256 and P521 -- Supports HDF_IDs for SHA256/512 -- Supports AEAD_IDs for AES-GCM-128/256 only - -Create 32 or 64-bit library selecting curves 2 and 10 (X25519 and P521) - - g++ -O2 testhpke.cpp core.a -o testhpke - -Test program runs through test vectors for all modes 0-3. - ---------------------------------------------------- - -*Using clang on Windows. -Download latest clang from http://releases.llvm.org/download.html. -Choose Clang for Windows (64-bit) (.sig). -Install a free version of Microsoft Visual C++ https://www.visualstudio.com/downloads/. -Now use "clang++" wherever "g++" was used before. diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_ANSSI.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_ANSSI.cpp deleted file mode 100644 index 2414943..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_ANSSI.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_ANSSI.h" - - -namespace ANSSI { -/* ANSSI Curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0xB7BB73F,0x75ED967,0x1A18030,0xC9AE4B,0xFDFEC,0x754A44C,0xD4ABA,0x5428A93,0xE353FCA,0xE}; -const BIG CURVE_Order= {0x6D655E1,0xFDD459C,0x2BF941F,0x67E140D,0x35B53DC,0xE8CE424,0xF10126D,0xB3AD58,0x1FD178C,0xF}; -const BIG CURVE_Gx= {0x98F5CFF,0xC97A2DD,0x8B70164,0xD2DCAF9,0x3958C27,0x4749D42,0xB31183D,0x56C139E,0x6B3D4C3,0xB}; -const BIG CURVE_Gy= {0x4062CFB,0x115A155,0x4C9E183,0xC307E8E,0xF8C2701,0xF0F3ECE,0x11F9271,0xC8B2049,0x142E0F7,0x6}; -const BIG CURVE_HTPC= {0x1A725D0,0xA8983E2,0x77B349E,0x66D2BB4,0x676B54C,0x119A095,0xCAC6DC7,0xFD18A3A,0x2906D4D,0x7}; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0x75ED967B7BB73FL,0xC9AE4B1A18030L,0x754A44C00FDFECL,0x5428A9300D4ABAL,0xEE353FCAL}; -const BIG CURVE_Order= {0xFDD459C6D655E1L,0x67E140D2BF941FL,0xE8CE42435B53DCL,0xB3AD58F10126DL,0xF1FD178CL}; -const BIG CURVE_Gx= {0xC97A2DD98F5CFFL,0xD2DCAF98B70164L,0x4749D423958C27L,0x56C139EB31183DL,0xB6B3D4C3L}; -const BIG CURVE_Gy= {0x115A1554062CFBL,0xC307E8E4C9E183L,0xF0F3ECEF8C2701L,0xC8B204911F9271L,0x6142E0F7L}; -const BIG CURVE_HTPC= {0xA8983E21A725D0L,0x66D2BB477B349EL,0x119A095676B54CL,0xFD18A3ACAC6DC7L,0x72906D4DL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS12381.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS12381.cpp deleted file mode 100644 index 016b7af..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS12381.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_BLS12381.h" - -namespace BLS12381 { -/* Curve BLS12381 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B384_29; - -const int CURVE_Cof_I=0; -const int CURVE_B_I= 4; -const BIG CURVE_B= {0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x1,0x1FFFFFF8,0x1F96FFBF,0x1B4805FF,0x1D80553B,0xC0404D0,0x1520CCE7,0xA6533AF,0x73EDA7,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Gx= {0x1B22C6BB,0x19D78056,0x1E86BBFE,0xBD07FF2,0x1AC586C5,0x1D1F8B8D,0x4168538,0x9F2EE97,0xFC3688C,0x27D4D60,0x9A558E3,0x32FAF28,0x1F1D3A73,0xB}; -const BIG CURVE_Gy= {0x6C5E7E1,0x551194A,0x222B903,0x198E8945,0xB3EDD03,0xC659602,0xBD8036C,0x12BABA01,0x4FCF5E0,0xBA0EC57,0x8278C3B,0x75541E3,0xB3F481E,0x4}; -//const BIG CURVE_HTPC= {0x1AAAE,0xFD80000,0xFFFFED7,0x189FAFDA,0x1C912627,0x14945F,0xBA6AF26,0xEC3ECC4,0x13EFA3BF,0x1422F081,0x33A3655,0x12FFCD33,0x111EA3,0xD}; -const BIG CURVE_HTPC= {0x1DE821B8,0x6288315,0x1715FEDF,0xD2A41DC,0x1C31088B,0xDEEA01F,0x7FC11BB,0x1E9291A1,0x1A12F01D,0xD1EB8DE,0x16CE3D2A,0x16D97EE9,0x1F7462C8,0x0}; -const BIG CURVE_Bnx= {0x10000,0x10080000,0x34,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Cof= {0x10001,0x10080000,0x34,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -//const BIG CURVE_Cof= {0xAAAB,0x55558,0x157855A3,0x191800AA,0x396,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Pxa= {0x121BDB8,0x402B646,0x16EFBF5,0x18064D50,0x1D1770BA,0x5B23D71,0xC0AD144,0x1A9F4807,0x11C6E47A,0x196E2882,0x9820149,0x11E1522,0x4AA2B2F,0x1}; -const BIG CURVE_Pxb= {0x1D042B7E,0xD63E82A,0x51755F9,0x19E22427,0x15049334,0x10DDEE3F,0x186AD769,0x1A132416,0x5596BD0,0x4413A7B,0x1F6B34E8,0x4E33EC0,0x1E02B605,0x9}; -const BIG CURVE_Pya= {0x8B82801,0xC9AA430,0xB28A278,0x15939877,0xD12C923,0xD34A8B0,0xE9DB50A,0x155197BA,0x1AADFD9B,0x16D171A8,0x3327371,0x4FADC23,0xE5D5277,0x6}; -const BIG CURVE_Pyb= {0x105F79BE,0x15483AFF,0x1B07686A,0xE1A4EB9,0x99AB3F3,0x955AB97,0xEBC99D2,0xFD0B4EC,0x19CB3E28,0x15E145C,0xCAB34AC,0x1D4E6998,0x6C4A02,0x3}; - -#if HTC_ISO_BLS12381 != 0 - -const BIG CURVE_Ad= {0xD584C1D,0x7A14041,0x183E5FD7,0x6DF1B41,0x81AC989,0xC0D77EC,0x1AA363A2,0xA707DCC,0x2B0EA98,0x164B6A4C,0xF5A4E80,0x771D286,0x144698A,0x0}; -const BIG CURVE_Bd= {0xE172BE0,0xE62474C,0x1B3AA974,0x642B462,0x15EF55A2,0xA7E779,0x1C282E7,0x1E1E49E8,0x1B2016C1,0x3A9F771,0x62C4BA,0x2D10060,0xE2908D1,0x9}; -const BIG PC[53]= {{0xBA2D229,0xE45D174,0x134E47EA,0x1637016C,0x6B68C24,0x1F8DE126,0x1EF08F02,0xFC45906,0x1D31D79D,0x1C0F6F71,0xF47A588,0x1C4C1CE1,0xE08C248,0x3},{0x1605FB7B,0x133EF9F8,0xA177B32,0x16EE3F18,0x14866F69,0x19B001D8,0x1E5B542B,0x1BBCCF0F,0xDFA7DCC,0xE92B2D8,0x1CB63B02,0x139C0FC4,0x321DA07,0x8},{0x1E390C9E,0x1920833D,0xC9DE5F,0x12165DB8,0x11B7FA31,0xA5D7A5D,0x12659D8C,0x1007418B,0x2DD2ECB,0xAE89C79,0xB830DD4,0x179F4F88,0x9B1F8E1,0xB},{0x497E317,0xB8CC354,0xDD3A55B,0x52BE52D,0x1D1DE4FA,0xB649462,0x15D28B16,0xD9CF3EA,0xDC43B75,0xB1DF4C8,0x1EE42CCD,0x134F1F88,0xD3CF1F,0x4},{0x3F0C88E,0x65AB0C7,0x1D1D6BE7,0xF91F191,0x753339B,0x3177879,0x16C69A0B,0x1564EB69,0x13356DE5,0x6888BF2,0x1A1D0E21,0x357B7C5,0x1B81E770,0xB},{0x139ED84,0xEBF912D,0x14BB2B7,0x4A25182,0x6B2A8DA,0x110C7CE4,0x13864023,0x4C9E1F1,0x1FB11586,0x1C573295,0x1A8DC9B0,0x1FC89A52,0x16ED6553,0x6},{0xF652983,0x89E0E33,0x19CF4673,0xE1A5B95,0x8F90A08,0x15C84BF3,0x66E7B4E,0xFBB2A4F,0x15DB3CB1,0x1FBD3A55,0x744806,0x1AE627FE,0x30C3250,0xB},{0xC8895D9,0x8AA674D,0x79DF114,0x1450DE60,0x1AC18985,0x15B2CC17,0xCFC21BB,0xB424AFF,0x1499DB99,0x1F208C72,0x1990AD2C,0x333E886,0x99726A3,0x7},{0x1D9B6861,0xD9C4320,0x41C64F1,0xDC4B9C6,0x13083533,0x1944F8D9,0x1C97C6CC,0xCAD51B7,0x12D7F5E4,0x183F2AA0,0x13818274,0x1F98DB6E,0x178E7166,0xB},{0xC9EDCB0,0xBCFCED,0x25CA7F8,0x187C7A54,0xE25C958,0x1280F634,0xF95A1E3,0xE652B30,0x1BCE0324,0xE8854D0,0x7441231,0x12ECF1D8,0x154005DB,0x6},{0x13CB83BB,0x1A7778D,0x630D5BA,0x11E54DE6,0x1E86B483,0x119E3868,0x105FD597,0xB65ED50,0x1C7C17E7,0x110A3D40,0x1622EAC,0x1287565E,0x1294ED3E,0xB},{0x134649B7,0x1560B313,0x198B5BAB,0x185ABE5,0xE2C8561,0x1DAB66DA,0x17FC989,0x11145AE0,0x56B303E,0xECCC0AC,0xE024407,0x1D066681,0x1A05F2B1,0x8},{0x8ECDD0A,0xB1C268B,0x1E19400B,0xE9C9696,0x11C15931,0x99CBC79,0xDDDB7D,0x1DD2DEFA,0xF682B4,0x159D2B34,0x11DB5B8F,0x13D255A8,0x15FC13AB,0x4},{0x19A1D641,0x1BB761D3,0xE90DC11,0x4CD2557,0x18835038,0x6D33F9C,0x19ADD040,0x3AE2C26,0xCE07F8D,0xD7E3D1E,0x17A482CF,0x1B4A9F04,0x10ECF6A,0x5},{0x1DCC5A5E,0xFBECCDD,0x478B4C4,0xB72913A,0x2C580FA,0x10E6FCC1,0x2A0665B,0x1843794D,0x196E7F63,0x3A6780C,0xC2CFD6C,0x1AC95164,0xA7AC2A9,0xA},{0xEE84A3A,0x12BA24B,0x3781B3B,0x766A71E,0xDE9CEA7,0x3983157,0x62538B8,0x1335EA74,0x1570F57,0x1F02CB39,0x3CF8318,0x2D26C32,0x172CAACF,0x3},{0x1F6304A5,0x16FCD14,0x8A3C470,0x1A49788,0x982F740,0x1E77925C,0x1534290E,0x1D39D395,0x9395735,0x18283637,0x154E43DF,0x9CCCF72,0x7355F8E,0x7},{0x1532A21E,0x1CE9CAD9,0xD5E0754,0x537503E,0x106DA9BD,0x27419D9,0xAEE35AD,0xB34240C,0x1DFFDFC7,0x1A1F3D03,0x29BC757,0x4522950,0x1A8E1620,0x9},{0xDC62CD8,0x186F449C,0x1B3D7104,0xDAA487D,0x16FD0497,0x1455E146,0x15455332,0x7E2D62C,0x145B0824,0x1BE2075A,0x120EABFB,0xB15C5FD,0x1425581A,0x1},{0x1CB83E19,0x611CDD2,0x53FB73F,0x7A12CF9,0xCEACD6A,0x700588D,0x1347F299,0xDEB4E31,0x1F6F8941,0xDFF94C8,0x4DF98A,0xF4644BD,0x12962FE5,0x5},{0x82B3BFF,0xE413B76,0xC09BA79,0x155108D9,0xBF5713D,0x12C4624,0x30049B,0x19419E10,0x167041E8,0x14C729B1,0x122D1C44,0x16AB3886,0x561A5DE,0x9},{0xD21B1C,0x9E7CFD2,0xD0F7E26,0x11AD037C,0xAC62B55,0x430BFE4,0x2EA7256,0x9746B69,0xF01D5EF,0x1A5E9FD3,0x62CB98B,0x19FE335C,0xCA8D548,0x4},{0x9C8B604,0x5A2B5F3,0x10071DC1,0xA04FDFD,0x101B2B66,0xA7D4AD7,0x8E55EB7,0x11F092CB,0x15CB181D,0x1A16F975,0x13A942CE,0x121E079C,0x1E6BE4E9,0xA},{0x1475224B,0x1358F38A,0x1E6BEDE1,0x20936CA,0x7CE46BA,0x7AE9CB5,0x15A366AC,0x103AFD0C,0x1C5E673D,0x1A46251F,0xA8567D,0x1C899E22,0x1C129645,0x2},{0x1B980133,0x16CE9FAE,0x8CA9910,0x1F215A38,0x659CC6C,0x11969E20,0x16004F99,0x101A982,0x1C757B3B,0x13DF18AE,0x1CBF002B,0x1A3D9536,0x45A394A,0x1},{0xB971EF8,0xA602780,0x4847C83,0x10A38323,0x633F06C,0x87403DA,0x23B009C,0x54684D6,0x47AA7B1,0x27A9FA,0x14554258,0x372733,0x1182CAC1,0x5},{0x10074D8E,0x103E4526,0x113581B3,0x139BE836,0x1643249D,0x1F3FC88F,0x918B9AF,0x17155E18,0xC523559,0x1FF6976E,0xE463050,0x1E6DEDBD,0xB46A908,0xC},{0x1011C132,0x9B88D6,0xFEEBF3A,0x1E74B99C,0x1E61031B,0x1F20B1C4,0x4FF4460,0x196D95E9,0x13CD2FCB,0x18EA1FDC,0x37F42E3,0x6F9A37C,0x1713E479,0xC},{0xA731C30,0x1D7D575E,0x13AE9BCA,0x1EE0ABBA,0xD43B9B3,0xF3F68F2,0x1BF81A61,0x14F22B5E,0x3C42A0C,0x1D6D0A51,0x88EAF79,0x30D7B6A,0x1BBA7A1,0x7},{0x1BDBA587,0x1B872BB,0x181E8D8,0xCA4038F,0xCABE69D,0x17350F90,0x9B07A2D,0x2CCF3B8,0x1B8F3ABD,0x10F26D0D,0x1A232788,0x1B2CD097,0x1FC4018B,0x4},{0x1870FB29,0xAF26518,0x17FA4D68,0xC8AA1FD,0x842642F,0x6D36136,0x7FF40E,0x17FC77BB,0x14170A05,0x9653633,0x17A649AF,0x67570DF,0x187C8D53,0x4},{0x1FE9D6F2,0xB0FC42A,0x3D057B2,0x10F5848C,0x14F3747A,0x9E26B1,0x132D48C5,0x19457C30,0x1CE75BB8,0x13BCB59,0xCB25DF4,0x1F583779,0xAB0B9BC,0x2},{0x1633A5F0,0xD91D589,0x16A01CA6,0x1EC64D92,0x1544E203,0xE1E9D6A,0x1EF5D941,0x1A95F5B6,0x74A7D0,0xDC78535,0x8847847,0xC696D4,0x603FCA4,0xB},{0x12E8FEDB,0xDB6D767,0x4102A10,0xFF1B813,0x11ADC2EE,0x1FE9109A,0x2E1E60C,0x1F7C79CA,0x4195536,0x1510A94E,0x172BD3F8,0x1FC1FE26,0xCC03FDE,0x4},{0x10E5F4CB,0x11AAE3BD,0x11877B29,0xB5753D,0x11CF9DE4,0x11F60192,0x4702792,0x1721DD6F,0x17D42AA7,0x16C3A33A,0x1E261D46,0x11303842,0x1F86376E,0x0},{0x72DE1F6,0x6FF1206,0xC0148EE,0x1AA42C51,0xDA7D26,0x1F25C8A0,0x138B0D12,0x1ACB1463,0x142552E2,0x351DA4C,0x1D28E132,0x152CDCCD,0xCC786BA,0x0},{0xE41C696,0x4BF3AD1,0xBEA2FF8,0xACE232C,0x1AD34D6C,0x11A1F5B3,0xF43E41,0xD84A9E7,0x31223E9,0x1BB7DA34,0x15440DB5,0x9DCB023,0x14996A10,0x9},{0x1707BB33,0x14C22B8C,0xEE8F0AF,0x18F5DD36,0x143D3CD0,0x17B64AB2,0x548AD4A,0x11C9150D,0x1A11AD13,0xA4C06E7,0x96747C2,0x17449DC0,0x10D97C81,0x4},{0x1D634B8F,0xAA39D0,0xD25E011,0x5EAE1E2,0xAA205CA,0x1E6B1AB6,0x14CC93B,0xCBC4E77,0x171C40F,0x106BC0CE,0x1AC90957,0xDBB807C,0xFA1D81,0x7},{0x6ED06F7,0xFD6E099,0x5332034,0xA2F7B0E,0x480E420,0x6F93CA1,0x1F072DD2,0x129CE524,0x12BF565B,0xA9E6BB7,0x18A2F743,0x165C9E76,0x660400E,0x1},{0x173345CC,0x14CD89C2,0xE42B047,0xEC7C7,0x19B86930,0x177CD006,0x899F573,0x1B315BE0,0x16543346,0x5A2F8A4,0x10D84C51,0x18ECFFC7,0xD6B9514,0x5},{0x2561092,0x1425A94F,0x1FAEFAA5,0x12D130DE,0x1913516F,0xD446753,0xB4A303E,0x115DF9C8,0x77F94FF,0x12462862,0x1D614B07,0x103A067F,0xCCBB674,0x5},{0x1A8F6AA8,0x7C5A4E5,0xC18100,0xB853E9F,0xA5C871A,0xD9B731B,0x18A43964,0x7376C34,0x1D9C6DD0,0xD69488,0x123C0428,0x1D480B7A,0xD2F259E,0x2},{0x18913F55,0x377A45D,0xA6CD78D,0x10BD47AA,0x1D4FBC73,0xC973F53,0x1EED4C21,0xC7C27B0,0x103216F7,0x1ECA5424,0x1AA08165,0xE14DC39,0x7A55CDA,0xB},{0x15535D4A,0x1919ECEA,0x49220DA,0x1FC5EF77,0x19B4852C,0x1A8625F9,0x482AF15,0x1C98D5EB,0x4F9FB0C,0x1E8EBA66,0x686F953,0x6D8C246,0x66C8ED3,0xC},{0x15812ED9,0x7720AD0,0x77B918,0x1EB6010,0x17132B92,0x7E9031A,0x1F5FFACD,0xBDF43E9,0xEE5A437,0x15DD37FB,0xEF377E,0x1C7D4FD4,0xA3EF08B,0xB},{0x126A775C,0x8D09CC8,0x2C7EE4F,0x1538034B,0x51D5F,0x12DE2005,0x3BD774D,0x1F51A19F,0xB5EECFD,0x5674C12,0x10EEA1CD,0x1533B65F,0x6007C08,0xB},{0xAF9B7AC,0x16323BFD,0xA733880,0x71B73BF,0x15A6449F,0xC3DB787,0x20717B3,0x18CAAA1B,0x2B70152,0x1563C18C,0x7EC99BA,0x30DB65B,0xD9E5297,0x4},{0x11A5001D,0x11C8A118,0x14BB7B76,0x162BB81F,0xC916A20,0xD07E4EF,0xEC150BB,0x13E1ED37,0x1CC6D19C,0x17C1146E,0xC033244,0x8BE87C9,0x1E0E0795,0x5},{0x45F5416,0x6936CC2,0xA5EB6A,0x6C9E585,0xAF41727,0x1244F393,0xC3848F6,0x1B7BB79A,0x11D115C5,0x1C4F6DA6,0x1C8348EF,0x131CA72B,0xB7D2887,0xB},{0x1DBF67F2,0x1129C5A9,0x1E5BE247,0xAF9AC6D,0xD2ECA67,0x12EE93CE,0x1CC430D6,0xAAA35CF,0x1778C485,0xB74758A,0x1BEAAB9F,0xC81B44E,0x18DF3306,0x2},{0xE49A03D,0x17B08161,0x14A78D4C,0x84C0EC6,0x1E01F78A,0x1AB7A29,0x16729284,0x1EE6389A,0x1885C84F,0x21E1A45,0x6832F5B,0x702403C,0x162D75C2,0xC},{0x103663C1,0xA3C929D,0x3081B40,0x6D11DEC,0x12E7A07F,0x1195ADF3,0xF9BBB0C,0x1CAF1301,0x9601A6D,0x7D68757,0x14860450,0x15393164,0x112C4C3,0xB}}; - -#endif - -#if HTC_ISO_G2_BLS12381 != 0 -const BIG CURVE_HTPC2= {0xF8492B,0x13B89D4,0x1AA68D1F,0x108A10FD,0x16D9723B,0x1B0EEA65,0x1CD7D27C,0xDC4EA3A,0x149FAD53,0x10F6735,0x4075923,0x180F008F,0x52988B9,0x0}; -const BIG CURVE_Adr= {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Adi= {0xF0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Bdr= {0x3F4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Bdi= {0x3F4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG PCR[13]= {{0xAAA5ED1,0x7155555,0x19C71C62,0x11C71A1E,0x18575709,0x8478A15,0x2A88B58,0x1CFE9D02,0x14CB14B4,0x8FAFDB0,0x1B5B7A9A,0x147199F5,0x11D6541F,0xB},{0x1FFFC71E,0x154FFFFF,0x3555549,0x5555397,0xA418147,0x635A790,0x11FE6882,0x15BEF5C1,0xF984F87,0x16BC3E44,0xC849BF3,0x17553378,0x1560BF17,0x8},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xAAA97D6,0x11C55555,0x1671C718,0xC71C687,0xE15D5C2,0x211E285,0x10AA22D6,0x73FA740,0x532C52D,0x123EBF6C,0xED6DEA6,0x1D1C667D,0x1C759507,0x2},{0xC,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1C718B10,0xD9B8E38,0x1712F678,0x1212F4AD,0x74524E7,0x1BE34D51,0xA1AC3A5,0x6F43C4C,0x10761B0F,0xF1C08D6,0x1EFDC10F,0x16D9EF37,0x4C9AD43,0x9},{0x1FFFC71C,0x154FFFFF,0x3555549,0x5555397,0xA418147,0x635A790,0x11FE6882,0x15BEF5C1,0xF984F87,0x16BC3E44,0xC849BF3,0x17553378,0x1560BF17,0x8},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x11C6D706,0x167E38E3,0x124BDA04,0x184BD7F1,0x1E500FC8,0x1CEC3E93,0x126FD510,0x1A940FEC,0x130F7DA5,0x183B688C,0x16693062,0x15682276,0x130477C7,0xA},{0x12,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1FFFA8FB,0xFF7FFFF,0x14FFFFEE,0x17FFFD62,0xF6241EA,0x9507B58,0xAFD9CC3,0x109E70A2,0x1764774B,0x121A5D66,0x12C6E9ED,0x12FFCD34,0x111EA3,0xD}}; -const BIG PCI[13]= {{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1FFFE38D,0x1AA7FFFF,0x11AAAAA4,0x12AAA9CB,0x520C0A3,0x31AD3C8,0x18FF3441,0x1ADF7AE0,0x7CC27C3,0x1B5E1F22,0x6424DF9,0x1BAA99BC,0xAB05F8B,0x4},{0x1FFFC71A,0x154FFFFF,0x3555549,0x5555397,0xA418147,0x635A790,0x11FE6882,0x15BEF5C1,0xF984F87,0x16BC3E44,0xC849BF3,0x17553378,0x1560BF17,0x8},{0xAAA97D6,0x11C55555,0x1671C718,0xC71C687,0xE15D5C2,0x211E285,0x10AA22D6,0x73FA740,0x532C52D,0x123EBF6C,0xED6DEA6,0x1D1C667D,0x1C759507,0x2},{0x1FFFAA9F,0xFF7FFFF,0x14FFFFEE,0x17FFFD62,0xF6241EA,0x9507B58,0xAFD9CC3,0x109E70A2,0x1764774B,0x121A5D66,0x12C6E9ED,0x12FFCD34,0x111EA3,0xD},{0x1FFFAA63,0xFF7FFFF,0x14FFFFEE,0x17FFFD62,0xF6241EA,0x9507B58,0xAFD9CC3,0x109E70A2,0x1764774B,0x121A5D66,0x12C6E9ED,0x12FFCD34,0x111EA3,0xD},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1FFFE38F,0x1AA7FFFF,0x11AAAAA4,0x12AAA9CB,0x520C0A3,0x31AD3C8,0x18FF3441,0x1ADF7AE0,0x7CC27C3,0x1B5E1F22,0x6424DF9,0x1BAA99BC,0xAB05F8B,0x4},{0xAAA97BE,0x11C55555,0x1671C718,0xC71C687,0xE15D5C2,0x211E285,0x10AA22D6,0x73FA740,0x532C52D,0x123EBF6C,0xED6DEA6,0x1D1C667D,0x1C759507,0x2},{0x11C6D706,0x167E38E3,0x124BDA04,0x184BD7F1,0x1E500FC8,0x1CEC3E93,0x126FD510,0x1A940FEC,0x130F7DA5,0x183B688C,0x16693062,0x15682276,0x130477C7,0xA},{0x1FFFAA99,0xFF7FFFF,0x14FFFFEE,0x17FFFD62,0xF6241EA,0x9507B58,0xAFD9CC3,0x109E70A2,0x1764774B,0x121A5D66,0x12C6E9ED,0x12FFCD34,0x111EA3,0xD},{0x1FFFA9D3,0xFF7FFFF,0x14FFFFEE,0x17FFFD62,0xF6241EA,0x9507B58,0xAFD9CC3,0x109E70A2,0x1764774B,0x121A5D66,0x12C6E9ED,0x12FFCD34,0x111EA3,0xD},{0x1FFFA8FB,0xFF7FFFF,0x14FFFFEE,0x17FFFD62,0xF6241EA,0x9507B58,0xAFD9CC3,0x109E70A2,0x1764774B,0x121A5D66,0x12C6E9ED,0x12FFCD34,0x111EA3,0xD}}; - -#endif - -#endif - -#if CHUNK==64 - -using namespace B384_58; - -const int CURVE_Cof_I=0; -const int CURVE_B_I= 4; -const BIG CURVE_B= {0x4L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x3FFFFFF00000001L,0x36900BFFF96FFBFL,0x180809A1D80553BL,0x14CA675F520CCE7L,0x73EDA7L,0x0L,0x0L}; -const BIG CURVE_Gx= {0x33AF00ADB22C6BBL,0x17A0FFE5E86BBFEL,0x3A3F171BAC586C5L,0x13E5DD2E4168538L,0x4FA9AC0FC3688CL,0x65F5E509A558E3L,0x17F1D3A73L}; -const BIG CURVE_Gy= {0xAA232946C5E7E1L,0x331D128A222B903L,0x18CB2C04B3EDD03L,0x25757402BD8036CL,0x1741D8AE4FCF5E0L,0xEAA83C68278C3BL,0x8B3F481EL}; -//const BIG CURVE_HTPC= {0x1FB00000001AAAEL,0x313F5FB4FFFFED7L,0x2928BFC912627L,0x1D87D988BA6AF26L,0x2845E1033EFA3BFL,0x25FF9A6633A3655L,0x1A0111EA3L}; -const BIG CURVE_HTPC= {0xC51062BDE821B8L,0x1A5483B9715FEDFL,0x1BDD403FC31088BL,0x3D2523427FC11BBL,0x1A3D71BDA12F01DL,0x2DB2FDD36CE3D2AL,0x1F7462C8L}; - -const BIG CURVE_Bnx= {0x201000000010000L,0x34L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Cof= {0x201000000010001L,0x34L,0x0L,0x0L,0x0L,0x0L,0x0L}; -//const BIG CURVE_Cof= {0xAAAB0000AAABL,0x3230015557855A3L,0x396L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Pxa= {0x8056C8C121BDB8L,0x300C9AA016EFBF5L,0xB647AE3D1770BAL,0x353E900EC0AD144L,0x32DC51051C6E47AL,0x23C2A449820149L,0x24AA2B2FL}; -const BIG CURVE_Pxb= {0x1AC7D055D042B7EL,0x33C4484E51755F9L,0x21BBDC7F5049334L,0x3426482D86AD769L,0x88274F65596BD0L,0x9C67D81F6B34E8L,0x13E02B605L}; -const BIG CURVE_Pya= {0x193548608B82801L,0x2B2730EEB28A278L,0x1A695160D12C923L,0x2AA32F74E9DB50AL,0x2DA2E351AADFD9BL,0x9F5B8463327371L,0xCE5D5277L}; -const BIG CURVE_Pyb= {0x2A9075FF05F79BEL,0x1C349D73B07686AL,0x12AB572E99AB3F3L,0x1FA169D8EBC99D2L,0x2BC28B99CB3E28L,0x3A9CD330CAB34ACL,0x606C4A02L}; - -#if HTC_ISO_BLS12381 != 0 -const BIG CURVE_Ad= {0xF428082D584C1DL,0xDBE368383E5FD7L,0x181AEFD881AC989L,0x14E0FB99AA363A2L,0x2C96D4982B0EA98L,0xEE3A50CF5A4E80L,0x144698AL}; -const BIG CURVE_Bd= {0x1CC48E98E172BE0L,0xC8568C5B3AA974L,0x14FCEF35EF55A2L,0x3C3C93D01C282E7L,0x753EEE3B2016C1L,0x5A200C0062C4BAL,0x12E2908D1L}; -const BIG PC[53]= {{0x1C8BA2E8BA2D229L,0x2C6E02D934E47EAL,0x3F1BC24C6B68C24L,0x1F88B20DEF08F02L,0x381EDEE3D31D79DL,0x389839C2F47A588L,0x6E08C248L},{0x267DF3F1605FB7BL,0x2DDC7E30A177B32L,0x336003B14866F69L,0x37799E1FE5B542BL,0x1D2565B0DFA7DCCL,0x27381F89CB63B02L,0x10321DA07L},{0x3241067BE390C9EL,0x242CBB700C9DE5FL,0x14BAF4BB1B7FA31L,0x200E83172659D8CL,0x15D138F22DD2ECBL,0x2F3E9F10B830DD4L,0x169B1F8E1L},{0x171986A8497E317L,0xA57CA5ADD3A55BL,0x16C928C5D1DE4FAL,0x1B39E7D55D28B16L,0x163BE990DC43B75L,0x269E3F11EE42CCDL,0x80D3CF1FL},{0xCB5618E3F0C88EL,0x1F23E323D1D6BE7L,0x62EF0F2753339BL,0x2AC9D6D36C69A0BL,0xD1117E53356DE5L,0x6AF6F8BA1D0E21L,0x17B81E770L},{0x1D7F225A139ED84L,0x944A30414BB2B7L,0x2218F9C86B2A8DAL,0x993C3E33864023L,0x38AE652BFB11586L,0x3F9134A5A8DC9B0L,0xD6ED6553L},{0x113C1C66F652983L,0x1C34B72B9CF4673L,0x2B9097E68F90A08L,0x1F76549E66E7B4EL,0x3F7A74AB5DB3CB1L,0x35CC4FFC0744806L,0x1630C3250L},{0x1154CE9AC8895D9L,0x28A1BCC079DF114L,0x2B65982FAC18985L,0x168495FECFC21BBL,0x3E4118E5499DB99L,0x667D10D990AD2CL,0xE99726A3L},{0x1B388641D9B6861L,0x1B89738C41C64F1L,0x3289F1B33083533L,0x195AA36FC97C6CCL,0x307E55412D7F5E4L,0x3F31B6DD3818274L,0x1778E7166L},{0x179F9DAC9EDCB0L,0x30F8F4A825CA7F8L,0x2501EC68E25C958L,0x1CCA5660F95A1E3L,0x1D10A9A1BCE0324L,0x25D9E3B07441231L,0xD54005DBL},{0x34EEF1B3CB83BBL,0x23CA9BCC630D5BAL,0x233C70D1E86B483L,0x16CBDAA105FD597L,0x22147A81C7C17E7L,0x250EACBC1622EACL,0x17294ED3EL},{0x2AC1662734649B7L,0x30B57CB98B5BABL,0x3B56CDB4E2C8561L,0x2228B5C017FC989L,0x1D99815856B303EL,0x3A0CCD02E024407L,0x11A05F2B1L},{0x16384D168ECDD0AL,0x1D392D2DE19400BL,0x133978F31C15931L,0x3BA5BDF40DDDB7DL,0x2B3A56680F682B4L,0x27A4AB511DB5B8FL,0x95FC13ABL},{0x376EC3A79A1D641L,0x99A4AAEE90DC11L,0xDA67F398835038L,0x75C584D9ADD040L,0x1AFC7A3CCE07F8DL,0x36953E097A482CFL,0xA10ECF6AL},{0x1F7D99BBDCC5A5EL,0x16E52274478B4C4L,0x21CDF9822C580FAL,0x3086F29A2A0665BL,0x74CF01996E7F63L,0x3592A2C8C2CFD6CL,0x14A7AC2A9L},{0x2574496EE84A3AL,0xECD4E3C3781B3BL,0x73062AEDE9CEA7L,0x266BD4E862538B8L,0x3E0596721570F57L,0x5A4D8643CF8318L,0x772CAACFL},{0x2DF9A29F6304A5L,0x3492F108A3C470L,0x3CEF24B8982F740L,0x3A73A72B534290EL,0x30506C6E9395735L,0x13999EE554E43DFL,0xE7355F8EL},{0x39D395B3532A21EL,0xA6EA07CD5E0754L,0x4E833B306DA9BDL,0x16684818AEE35ADL,0x343E7A07DFFDFC7L,0x8A452A029BC757L,0x13A8E1620L},{0x30DE8938DC62CD8L,0x1B5490FBB3D7104L,0x28ABC28D6FD0497L,0xFC5AC595455332L,0x37C40EB545B0824L,0x162B8BFB20EABFBL,0x3425581AL},{0xC239BA5CB83E19L,0xF4259F253FB73FL,0xE00B11ACEACD6AL,0x1BD69C63347F299L,0x1BFF2991F6F8941L,0x1E8C897A04DF98AL,0xB2962FE5L},{0x1C8276EC82B3BFFL,0x2AA211B2C09BA79L,0x2588C48BF5713DL,0x32833C20030049BL,0x298E536367041E8L,0x2D56710D22D1C44L,0x12561A5DEL},{0x13CF9FA40D21B1CL,0x235A06F8D0F7E26L,0x8617FC8AC62B55L,0x12E8D6D22EA7256L,0x34BD3FA6F01D5EFL,0x33FC66B862CB98BL,0x8CA8D548L},{0xB456BE69C8B604L,0x1409FBFB0071DC1L,0x14FA95AF01B2B66L,0x23E125968E55EB7L,0x342DF2EB5CB181DL,0x243C0F393A942CEL,0x15E6BE4E9L},{0x26B1E715475224BL,0x4126D95E6BEDE1L,0xF5D396A7CE46BAL,0x2075FA195A366ACL,0x348C4A3FC5E673DL,0x39133C440A8567DL,0x5C129645L},{0x2D9D3F5DB980133L,0x3E42B4708CA9910L,0x232D3C40659CC6CL,0x20353056004F99L,0x27BE315DC757B3BL,0x347B2A6DCBF002BL,0x245A394AL},{0x14C04F00B971EF8L,0x214706464847C83L,0x10E807B4633F06CL,0xA8D09AC23B009CL,0x4F53F447AA7B1L,0x6E4E674554258L,0xB182CAC1L},{0x207C8A4D0074D8EL,0x2737D06D13581B3L,0x3E7F911F643249DL,0x2E2ABC30918B9AFL,0x3FED2EDCC523559L,0x3CDBDB7AE463050L,0x18B46A908L},{0x13711AD011C132L,0x3CE97338FEEBF3AL,0x3E416389E61031BL,0x32DB2BD24FF4460L,0x31D43FB93CD2FCBL,0xDF346F837F42E3L,0x19713E479L},{0x3AFAAEBCA731C30L,0x3DC157753AE9BCAL,0x1E7ED1E4D43B9B3L,0x29E456BDBF81A61L,0x3ADA14A23C42A0CL,0x61AF6D488EAF79L,0xE1BBA7A1L},{0x370E577BDBA587L,0x1948071E181E8D8L,0x2E6A1F20CABE69DL,0x599E7709B07A2DL,0x21E4DA1BB8F3ABDL,0x3659A12FA232788L,0x9FC4018BL},{0x15E4CA31870FB29L,0x191543FB7FA4D68L,0xDA6C26C842642FL,0x2FF8EF7607FF40EL,0x12CA6C674170A05L,0xCEAE1BF7A649AFL,0x987C8D53L},{0x161F8855FE9D6F2L,0x21EB09183D057B2L,0x13C4D634F3747AL,0x328AF86132D48C5L,0x27796B3CE75BB8L,0x3EB06EF2CB25DF4L,0x4AB0B9BCL},{0x1B23AB13633A5F0L,0x3D8C9B256A01CA6L,0x1C3D3AD5544E203L,0x352BEB6DEF5D941L,0x1B8F0A6A074A7D0L,0x18D2DA88847847L,0x16603FCA4L},{0x1B6DAECF2E8FEDBL,0x1FE370264102A10L,0x3FD221351ADC2EEL,0x3EF8F3942E1E60CL,0x2A21529C4195536L,0x3F83FC4D72BD3F8L,0x8CC03FDEL},{0x2355C77B0E5F4CBL,0x16AEA7B1877B29L,0x23EC03251CF9DE4L,0x2E43BADE4702792L,0x2D8746757D42AA7L,0x22607085E261D46L,0x1F86376EL},{0xDFE240C72DE1F6L,0x354858A2C0148EEL,0x3E4B91400DA7D26L,0x359628C738B0D12L,0x6A3B49942552E2L,0x2A59B99BD28E132L,0xCC786BAL},{0x97E75A2E41C696L,0x159C4658BEA2FF8L,0x2343EB67AD34D6CL,0x1B0953CE0F43E41L,0x376FB46831223E9L,0x13B960475440DB5L,0x134996A10L},{0x29845719707BB33L,0x31EBBA6CEE8F0AFL,0x2F6C956543D3CD0L,0x23922A1A548AD4AL,0x14980DCFA11AD13L,0x2E893B8096747C2L,0x90D97C81L},{0x15473A1D634B8FL,0xBD5C3C4D25E011L,0x3CD6356CAA205CAL,0x19789CEE14CC93BL,0x20D7819C171C40FL,0x1B7700F9AC90957L,0xE0FA1D81L},{0x1FADC1326ED06F7L,0x145EF61C5332034L,0xDF27942480E420L,0x2539CA49F072DD2L,0x153CD76F2BF565BL,0x2CB93CED8A2F743L,0x2660400EL},{0x299B138573345CCL,0x1D8F8EE42B047L,0x2EF9A00D9B86930L,0x3662B7C0899F573L,0xB45F1496543346L,0x31D9FF8F0D84C51L,0xAD6B9514L},{0x284B529E2561092L,0x25A261BDFAEFAA5L,0x1A88CEA7913516FL,0x22BBF390B4A303EL,0x248C50C477F94FFL,0x20740CFFD614B07L,0xACCBB674L},{0xF8B49CBA8F6AA8L,0x170A7D3E0C18100L,0x1B36E636A5C871AL,0xE6ED8698A43964L,0x1AD2911D9C6DD0L,0x3A9016F523C0428L,0x4D2F259EL},{0x6EF48BB8913F55L,0x217A8F54A6CD78DL,0x192E7EA7D4FBC73L,0x18F84F61EED4C21L,0x3D94A84903216F7L,0x1C29B873AA08165L,0x167A55CDAL},{0x3233D9D55535D4AL,0x3F8BDEEE49220DAL,0x350C4BF39B4852CL,0x3931ABD6482AF15L,0x3D1D74CC4F9FB0CL,0xDB1848C686F953L,0x1866C8ED3L},{0xEE415A15812ED9L,0x3D6C020077B918L,0xFD206357132B92L,0x17BE87D3F5FFACDL,0x2BBA6FF6EE5A437L,0x38FA9FA80EF377EL,0x16A3EF08BL},{0x11A1399126A775CL,0x2A7006962C7EE4FL,0x25BC400A0051D5FL,0x3EA3433E3BD774DL,0xACE9824B5EECFDL,0x2A676CBF0EEA1CDL,0x166007C08L},{0x2C6477FAAF9B7ACL,0xE36E77EA733880L,0x187B6F0F5A6449FL,0x3195543620717B3L,0x2AC783182B70152L,0x61B6CB67EC99BAL,0x8D9E5297L},{0x239142311A5001DL,0x2C57703F4BB7B76L,0x1A0FC9DEC916A20L,0x27C3DA6EEC150BBL,0x2F8228DDCC6D19CL,0x117D0F92C033244L,0xBE0E0795L},{0xD26D98445F5416L,0xD93CB0A0A5EB6AL,0x2489E726AF41727L,0x36F76F34C3848F6L,0x389EDB4D1D115C5L,0x26394E57C8348EFL,0x16B7D2887L},{0x22538B53DBF67F2L,0x15F358DBE5BE247L,0x25DD279CD2ECA67L,0x15546B9FCC430D6L,0x16E8EB15778C485L,0x1903689DBEAAB9FL,0x58DF3306L},{0x2F6102C2E49A03DL,0x10981D8D4A78D4CL,0x356F453E01F78AL,0x3DCC71356729284L,0x43C348B885C84FL,0xE0480786832F5BL,0x1962D75C2L},{0x1479253B03663C1L,0xDA23BD83081B40L,0x232B5BE72E7A07FL,0x395E2602F9BBB0CL,0xFAD0EAE9601A6DL,0x2A7262C94860450L,0x16112C4C3L}}; -#endif - -#if HTC_ISO_G2_BLS12381 != 0 -const BIG CURVE_HTPC2= {0x27713A80F8492BL,0x211421FBAA68D1FL,0x361DD4CB6D9723BL,0x1B89D475CD7D27CL,0x21ECE6B49FAD53L,0x301E011E4075923L,0x52988B9L}; -const BIG CURVE_Adr= {0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Adi= {0xF0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Bdr= {0x3F4L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Bdi= {0x3F4L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG PCR[13]= {{0xE2AAAAAAAA5ED1L,0x238E343D9C71C62L,0x108F142B8575709L,0x39FD3A042A88B58L,0x11F5FB614CB14B4L,0x28E333EBB5B7A9AL,0x171D6541FL},{0x2A9FFFFFFFFC71EL,0xAAAA72E3555549L,0xC6B4F20A418147L,0x2B7DEB831FE6882L,0x2D787C88F984F87L,0x2EAA66F0C849BF3L,0x11560BF17L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x238AAAAAAAA97D6L,0x18E38D0F671C718L,0x423C50AE15D5C2L,0xE7F4E810AA22D6L,0x247D7ED8532C52DL,0x3A38CCFAED6DEA6L,0x5C759507L},{0xCL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x1B371C71C718B10L,0x2425E95B712F678L,0x37C69AA274524E7L,0xDE87898A1AC3A5L,0x1E3811AD0761B0FL,0x2DB3DE6FEFDC10FL,0x124C9AD43L},{0x2A9FFFFFFFFC71CL,0xAAAA72E3555549L,0xC6B4F20A418147L,0x2B7DEB831FE6882L,0x2D787C88F984F87L,0x2EAA66F0C849BF3L,0x11560BF17L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x2CFC71C71C6D706L,0x3097AFE324BDA04L,0x39D87D27E500FC8L,0x35281FD926FD510L,0x3076D11930F7DA5L,0x2AD044ED6693062L,0x1530477C7L},{0x12L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x1FEFFFFFFFFA8FBL,0x2FFFFAC54FFFFEEL,0x12A0F6B0F6241EAL,0x213CE144AFD9CC3L,0x2434BACD764774BL,0x25FF9A692C6E9EDL,0x1A0111EA3L}}; -const BIG PCI[13]= {{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x354FFFFFFFFE38DL,0x255553971AAAAA4L,0x635A790520C0A3L,0x35BEF5C18FF3441L,0x36BC3E447CC27C3L,0x375533786424DF9L,0x8AB05F8BL},{0x2A9FFFFFFFFC71AL,0xAAAA72E3555549L,0xC6B4F20A418147L,0x2B7DEB831FE6882L,0x2D787C88F984F87L,0x2EAA66F0C849BF3L,0x11560BF17L},{0x238AAAAAAAA97D6L,0x18E38D0F671C718L,0x423C50AE15D5C2L,0xE7F4E810AA22D6L,0x247D7ED8532C52DL,0x3A38CCFAED6DEA6L,0x5C759507L},{0x1FEFFFFFFFFAA9FL,0x2FFFFAC54FFFFEEL,0x12A0F6B0F6241EAL,0x213CE144AFD9CC3L,0x2434BACD764774BL,0x25FF9A692C6E9EDL,0x1A0111EA3L},{0x1FEFFFFFFFFAA63L,0x2FFFFAC54FFFFEEL,0x12A0F6B0F6241EAL,0x213CE144AFD9CC3L,0x2434BACD764774BL,0x25FF9A692C6E9EDL,0x1A0111EA3L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x354FFFFFFFFE38FL,0x255553971AAAAA4L,0x635A790520C0A3L,0x35BEF5C18FF3441L,0x36BC3E447CC27C3L,0x375533786424DF9L,0x8AB05F8BL},{0x238AAAAAAAA97BEL,0x18E38D0F671C718L,0x423C50AE15D5C2L,0xE7F4E810AA22D6L,0x247D7ED8532C52DL,0x3A38CCFAED6DEA6L,0x5C759507L},{0x2CFC71C71C6D706L,0x3097AFE324BDA04L,0x39D87D27E500FC8L,0x35281FD926FD510L,0x3076D11930F7DA5L,0x2AD044ED6693062L,0x1530477C7L},{0x1FEFFFFFFFFAA99L,0x2FFFFAC54FFFFEEL,0x12A0F6B0F6241EAL,0x213CE144AFD9CC3L,0x2434BACD764774BL,0x25FF9A692C6E9EDL,0x1A0111EA3L},{0x1FEFFFFFFFFA9D3L,0x2FFFFAC54FFFFEEL,0x12A0F6B0F6241EAL,0x213CE144AFD9CC3L,0x2434BACD764774BL,0x25FF9A692C6E9EDL,0x1A0111EA3L},{0x1FEFFFFFFFFA8FBL,0x2FFFFAC54FFFFEEL,0x12A0F6B0F6241EAL,0x213CE144AFD9CC3L,0x2434BACD764774BL,0x25FF9A692C6E9EDL,0x1A0111EA3L}}; -#endif - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS12383.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS12383.cpp deleted file mode 100644 index dcc4a28..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS12383.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_BLS12383.h" - -namespace BLS12383 { -/* Curve BLS12383 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B384_29; - -// Base Bits= 29 - -const int CURVE_Cof_I= 0; -const BIG CURVE_Cof= {0x10011FF,0x400000,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -//const BIG CURVE_Cof= {0x15169EAB,0xA82AB0A,0xAAEFFED,0x15558001,0x555,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 15; -const BIG CURVE_B= {0xF,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x1EBC0001,0x1904CF5F,0x834E5CE,0xBE12B42,0xB381DE0,0xE40B4C,0x270110,0x10018017,0x1002001,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Gx= {0x8734573,0x623B9C8,0x1D1DC11E,0xBB7E107,0x1E3445C5,0x1D6C2578,0x10B0BE1E,0xED6103E,0x10F31D9F,0x296ED82,0x18E0D7D0,0x12F3D9C9,0x1FCBA55B,0x20}; -const BIG CURVE_Gy= {0x3F224,0x968B2F4,0x1FE63F48,0xFA93D90,0x14D2DDE5,0x54A56F5,0x12441D4C,0x18CD76C8,0x199D0DAD,0xE18E236,0x92BA73,0x99F6600,0x8F16727,0x3}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Bnx= {0x1001200,0x400000,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Pxa= {0xD7F2D86,0x1E59DB1,0x17474F85,0x1FB56CF2,0x572EE81,0xE487AB1,0x96F51FC,0x190A5AAE,0x6432501,0x13E58F3A,0x101E6425,0xFD807D1,0x34D2240,0x3}; -const BIG CURVE_Pxb= {0x452DE15,0x1ECF20F6,0x1FF9837B,0x95651AA,0xD5D75B5,0x5D44749,0x12277F66,0x1DB3A0B9,0x1D24F498,0x19441B0E,0x1CDE9DC5,0x2C975,0xD78006,0x18}; -const BIG CURVE_Pya= {0x1408CB41,0x34785DC,0x3586597,0x13DBC9E4,0x1A2E75B4,0x1D65489,0xCF9A25E,0x1ACE7933,0x1B6E990E,0x19FF31A3,0x12527615,0x1A44A68F,0x1792CF93,0x19}; -const BIG CURVE_Pyb= {0x1F479093,0x16C2321B,0x1889218E,0x87961BC,0x1BC98B01,0x197A24FB,0xA3DEBC2,0x88D67DF,0x1CE0D,0x1E8AD3D7,0x93B9EE9,0x59B18D6,0xE5247DD,0x10}; -#endif - -#if CHUNK==64 - -using namespace B384_58; - -// Base Bits= 58 - -const int CURVE_Cof_I= 0; -const BIG CURVE_Cof= {0x80000010011FFL,0x40L,0x0L,0x0L,0x0L,0x0L,0x0L}; -//const BIG CURVE_Cof= {0x150556155169EABL,0x2AAB0002AAEFFEDL,0x555L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 15; -const BIG CURVE_B= {0xFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x32099EBFEBC0001L,0x17C25684834E5CEL,0x1C81698B381DE0L,0x2003002E0270110L,0x1002001L,0x0L,0x0L}; -const BIG CURVE_Gx= {0xC4773908734573L,0x176FC20FD1DC11EL,0x3AD84AF1E3445C5L,0x1DAC207D0B0BE1EL,0x52DDB050F31D9FL,0x25E7B3938E0D7D0L,0x41FCBA55BL}; -const BIG CURVE_Gy= {0x12D165E8003F224L,0x1F527B21FE63F48L,0xA94ADEB4D2DDE5L,0x319AED912441D4CL,0x1C31C46D99D0DADL,0x133ECC00092BA73L,0x68F16727L}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Bnx= {0x8000001001200L,0x40L,0x0L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Pxa= {0x3CB3B62D7F2D86L,0x3F6AD9E57474F85L,0x1C90F562572EE81L,0x3214B55C96F51FCL,0x27CB1E746432501L,0x1FB00FA301E6425L,0x634D2240L}; -const BIG CURVE_Pxb= {0x3D9E41EC452DE15L,0x12ACA355FF9837BL,0xBA88E92D5D75B5L,0x3B6741732277F66L,0x3288361DD24F498L,0x592EBCDE9DC5L,0x300D78006L}; -const BIG CURVE_Pya= {0x68F0BB9408CB41L,0x27B793C83586597L,0x3ACA913A2E75B4L,0x359CF266CF9A25EL,0x33FE6347B6E990EL,0x34894D1F2527615L,0x33792CF93L}; -const BIG CURVE_Pyb= {0x2D846437F479093L,0x10F2C379889218EL,0x32F449F7BC98B01L,0x111ACFBEA3DEBC2L,0x3D15A7AE001CE0DL,0xB3631AC93B9EE9L,0x20E5247DDL}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS12443.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS12443.cpp deleted file mode 100644 index 3ad1d29..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS12443.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_BLS12443.h" - -namespace BLS12443 { -/* Curve BLS12443 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B448_29; - -// Base Bits= 29 - -const int CURVE_Cof_I= 0; -const BIG CURVE_Cof= {0x11FFFFFF,0x1F800000,0x100FF,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 4; -const BIG CURVE_B= {0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x1,0x15E00000,0x8FFFFF,0x330FEE0,0x5A3E808,0x1A0482EE,0x174DC4C0,0x6E9E59B,0x1062F694,0x2F9E86,0x41,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Gx= {0x18ABC574,0x13652D93,0xF8A9B4B,0x18DD91D9,0x40BFDDF,0xDEBE0C3,0x1CA5E24A,0x29B37A3,0x9049E88,0x11415BE7,0x1C4F9EAE,0x2569C1B,0x1681E434,0x8BDF6ED,0x19B12D89,0x73}; -const BIG CURVE_Gy= {0x17A9CE3F,0xCA0ABAC,0x710C772,0x120BAD6D,0x900742F,0x3B52AB4,0x1D0A758D,0x13CBE7A7,0x15769DB0,0xC676B97,0x7EF77EB,0x30FC21B,0x43B2B19,0x21C2EEA,0x1887E1D4,0x24}; -const BIG CURVE_HTPC= {0x911B6DF,0xA620224,0x155D68,0xBAE768,0x43A6AA,0xCE9FFD0,0x14EAAC40,0x19772A08,0x10074A9D,0xC451CC1,0xE84AE3C,0xDED8262,0x9680088,0x1A07DE19,0x19648C8F,0x9E}; - -const BIG CURVE_Bnx= {0x12000000,0x1F800000,0x100FF,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Pxa= {0x1F3AF148,0x12812AAB,0x11B9D6E1,0x1E9B7A3E,0x4DD695A,0x19843AAA,0x15D8C5C5,0xF509C60,0x139FC8E3,0x1060B671,0x11CFC89D,0x1F708C93,0x2219258,0x167260A8,0x117B1177,0x5}; -const BIG CURVE_Pxb= {0x136279B6,0x27B735D,0xB60056F,0x61C6492,0x19E29515,0x18B4393A,0x9480BCF,0x9596877,0x9BD13DD,0x370B284,0x1FEBABF8,0x12D6CB9C,0x164C9DA2,0x9DA997,0x192E45BB,0x1E}; -const BIG CURVE_Pya= {0x11C0B975,0x1FE07513,0x1C67EDF6,0xE36130E,0x1A91EFB9,0x1AC39A4,0x1316E89E,0x4DC3C2C,0x1122B65B,0x173710A4,0x10067CD2,0x1C58269E,0x1BD2F919,0x16A8822B,0x1A81C011,0x8B}; -const BIG CURVE_Pyb= {0x82464AD,0x1F70FF80,0x3C33C6C,0x10AAF915,0x77B77F,0x3152868,0x1BBD7AD8,0xDADC2F9,0x17218280,0xAECA451,0x103E4E3E,0x1BD9B92,0xB9E9169,0x1F547AC3,0x577AC6,0x68}; - -const BIG CURVE_Ad= {0x98E3466,0x15BE78D9,0x12B6D628,0xD93FCB0,0x1D091D0,0x130C6222,0x14B30AEB,0x13910DCD,0xCA78F64,0xD0F66FC,0xEEC9DEF,0x7F9B01B,0x1760C9FC,0x78FCB94,0x1A839D35,0x33}; -const BIG CURVE_Bd= {0x10F780D9,0xE65C309,0x1D294680,0x1AB4F80F,0x101A1BB2,0xD28DB7E,0x9192026,0x1C25665C,0x14D2890A,0xE458245,0x14A22C11,0x963FDB1,0x8F5BAD7,0x19106B58,0x146889DA,0x53}; -const BIG PC[53]= {{0x3F34E48,0x651745D,0xE259428,0x1383ECF5,0x7BA3300,0x27D38ED,0x1D7FF700,0x9431A4,0x1689CD1,0x545B0E1,0x187C27A6,0x1969C0B2,0xA0C6C03,0x1BF55844,0xA442AE5,0x1E},{0x604D319,0x6D5B3BB,0x1FC7CA7A,0x1C6674A9,0x4CBF065,0x35A66CF,0x159ADD2C,0x1B552927,0x19CC61F8,0x9D5A2C5,0xC0A549B,0x1F40B1BF,0x10CB5BAC,0xFCEF9F5,0x1F238FE7,0x7B},{0x1EA1F60A,0x1A99A439,0x1F84EA1B,0xA936DD8,0x4E25589,0xEA2C846,0x1DE6DCE9,0x1AE6724D,0x191243E0,0x10C3978C,0x134B2B37,0x1BDC07A,0x8D2C8E0,0x7A49BE0,0x14F4B45A,0xA7},{0x17499741,0x260A801,0x7616D51,0x17AEAADD,0x521E193,0x5A429A4,0x1BD4909C,0x19D689BE,0x138A814D,0x101764AE,0xE5495FD,0xD6862F8,0x6EABD3B,0x139CBE79,0x102FAAE0,0x1E},{0x8A9B7DD,0xBC06177,0xE848FDB,0x17FA150F,0x56E9B75,0x1820A4D3,0x5A69ED,0x7B1B04A,0x1B5A80FB,0x17F1C270,0x8B8B6E,0x1CDB6D31,0xD4D2E33,0x1EAB98E9,0x18FD46B7,0x4F},{0x41C4477,0x170C7C9E,0x1A7CEED7,0x104562CB,0x151713B8,0xDE756B,0x100E4CFE,0x1FAAEA0A,0x16BAE1F3,0x1D349BB5,0xC6D2950,0x18311C0F,0x39A42E2,0x182C5CBC,0x4853E91,0x25},{0x10815090,0x2323376,0x20A1BDB,0x5508EE7,0x5B59C38,0xA0AFD37,0x165A6095,0x19B7465E,0x6474F,0x15D05C5C,0x1F4B70EF,0xFDBD849,0x6F8D806,0x1AEA48A0,0xC688DC,0x4E},{0x1500BAD1,0x11B8B8DE,0x169485E4,0x9CBB577,0x18400475,0x1CF76B6C,0xF9C2EC0,0xC5678B7,0x60B689F,0x14149AEA,0x1904CD6D,0x19952882,0x169C5E37,0xDBAA643,0x1C756EAA,0x9E},{0x1E8081C0,0x4410E14,0xAC7DCFD,0x1621F086,0x135547E8,0x199A0DEF,0xB5938FC,0x1B1450DE,0x5AFD544,0x79F9A9F,0x199ED81F,0x17543471,0x126B077C,0x1CE6BCD,0x1DF891D0,0x2B},{0x17226171,0x1C950142,0x16E104BB,0xE1B0949,0x92190E6,0x3F99D6,0x354C7D3,0xF8472E3,0x118257FE,0x1F5B17E4,0x16FD305B,0x1EBF4465,0x63A6551,0x115C8EEB,0xEE9A889,0xA2},{0x7A91954,0x9CA1080,0x12A3E384,0x112E1137,0x18E69E7C,0x1CB385BF,0x10F0213C,0x1AB981F5,0xD5D73EC,0x1172365C,0x1E0EB929,0xB0CA35E,0xE794D69,0x6BF5788,0x73D5885,0x94},{0x192801A5,0x81AFAC5,0x15B7E81,0x1BA422EB,0x39F6E89,0x2A238D6,0x1A3E1907,0x9488AB6,0x7933000,0x1F9A227A,0x1ABA3F3A,0x12DD9604,0x1BB10A18,0xC5456C7,0xD84DE,0x8},{0xF9D1C0A,0x92C9E14,0xD40ECC4,0x1CA779A4,0x14378709,0x7F8AF5E,0x1400B55D,0x9A45554,0x2C03381,0x6B22956,0x1606538F,0x14ED05D5,0x77F1CED,0xCA45FB0,0x1858F2A3,0x96},{0x1F0A734C,0x14ABBA56,0x62122B9,0x149E1F5E,0x11502173,0x194DC7FF,0xCB2DB28,0x1497703A,0x1BF898CF,0x1A9F7152,0x133A7119,0x1EE3FFE6,0x1D9A176F,0xEB09FF5,0x18EC7E61,0x95},{0x11F37A8D,0x137B967F,0x7ED1992,0x112A56C,0xB74C59C,0xF981054,0x1B16179D,0x6FDEA23,0x7CFCEF8,0x170947AC,0x165FEEB3,0x17304126,0x4045C68,0x1EAC0CF1,0x16C0476,0x26},{0x1124740B,0x56CC8D1,0x11A7A71A,0x374C848,0x8B0336B,0x828068D,0x17B3591B,0x12F676CC,0xC2A2446,0x8945941,0x79445E2,0x1FD486BC,0x1D89A7C5,0xCC0BCD2,0x150AFD2,0x6E},{0xD27D311,0x175A4D55,0x68B0D25,0x89656E1,0x18EEF0CC,0x1ECB7F5C,0x141F2E5,0x1FC71B9D,0xB3FF9ED,0x1816DAFB,0x124875C,0x8ECB03B,0x152F5A8E,0xE62A638,0x944C294,0x8F},{0x1F1FC577,0x171D678,0xAE5DEF,0x1033B90B,0x82CAB80,0x558A914,0x1CF59E4B,0x12019535,0x171CE7C8,0xACC9CB1,0x16CD1D1E,0x1C4BE058,0x1BE1ACDC,0xC595284,0x1342A963,0x5F},{0x9150A48,0x12B944D7,0x1D088301,0x118D6111,0xD0F4583,0x1A41F59C,0x5E0D400,0x12013D5F,0x1235B458,0x1DC12203,0xC5391FA,0x14E54599,0xDCCF56C,0x17E1395E,0x770FA99,0x87},{0x1357D628,0x1311EF7C,0x178C48D1,0x1AF751CF,0xDB9E8BF,0xE02049C,0x14F36DA6,0x1FC80D93,0x11A703B0,0x7B2DF3A,0x11F7AF4E,0x6E20944,0x169657CA,0x12D90851,0xCB4DFB2,0x72},{0x117D6EEC,0x111FF17D,0xDCAAB9E,0xF57E6E9,0x877F70,0x1615F8C3,0x15089BD8,0x8C6A10B,0x768CC8C,0xD87AB83,0x1AC4BCA5,0x192138F5,0xEC4C227,0xBB626C5,0x1EAD484,0x59},{0x180B7137,0x17C45952,0xF72FD01,0x14038FD8,0x1BC6906,0x1D30FF2A,0x272EF9D,0x3DDAEBC,0xEF123C2,0x36325B3,0xE4BD355,0x1CA82937,0x11E3AE9B,0x1F3E2015,0x10AA89CD,0x4A},{0x5BEFD8,0x1AC19637,0xCEC24BD,0x1BF4B873,0x39C9045,0x60B6244,0x113A2DBA,0x5DEED3D,0x5F23CCD,0x7AB2FD,0x1C6860B2,0x24F6E9B,0x1B1866E9,0x1CB93691,0x1834BE14,0x2},{0xACA5AD9,0xCDA044,0x1F06B705,0x60D70E0,0x16099A07,0x6B0FFD7,0xA3D226B,0x3BDE7A2,0x76F4EC5,0x1B842F45,0x3EC2206,0x1673113C,0x7E552D3,0x18F5183E,0x1CF7F587,0x97},{0x12C72185,0x141B8D52,0x14B678E2,0x1D6934AB,0x17932E98,0x16339B40,0x1590A131,0x17E6E0AE,0x1943949D,0x1D0E5D2D,0xD2A9510,0x15EB21C4,0x1D89CD87,0xFE5601A,0x11A001F4,0x5F},{0xEFEE0EA,0x1F50A4DD,0x111B4E23,0x19E8C81C,0x5EDC2C3,0x126703FF,0x13C16387,0x12147E91,0xD63425F,0xCF00CF7,0x47A627C,0x5E7D6B1,0xEE08F4E,0x1766140F,0xBB95F5F,0x96},{0x16887410,0x1FA80776,0x93C0854,0x1EA20D2,0x1CBCC511,0x179B0F85,0x5396256,0x8D385B5,0x19CDF1BA,0x18ECD9E9,0xF80B760,0x1072505E,0x5BD4CB5,0x22FBE14,0x1EA80B78,0x7B},{0xDD0AA9,0x1F70909A,0xD5597D7,0x101CE2A8,0x617757C,0xDEEDA0C,0x11EA1972,0x114E055,0xF76A90,0x1A95E01E,0x15379DEC,0x175A609C,0x14C8FDB9,0x115156DE,0xCBF4809,0x96},{0x1E428BFD,0x16F21A08,0x3ADF604,0x82249C5,0x1CB7A3FA,0x1E570ACB,0x1EB4B47B,0xECB355A,0x84B430D,0x1BBAA20E,0x1C8EF513,0x115C7B9F,0x1D5EB53A,0x122DD3FB,0x17BB0101,0x50},{0x12540F1F,0x13939806,0x18268D14,0x1FBD962B,0xB448310,0xEF54811,0x23A248,0x162322C2,0x3AF19BB,0x13AB6F20,0x179673B2,0x1B141CDA,0x40D00EE,0x1B1F7AD8,0x9046568,0xA4},{0x1545BF96,0x11613F77,0x1925835E,0x14B70DE1,0x14CA0A0A,0x17FB7979,0x43DDB1A,0xA1AFFB6,0x5E74A2D,0x1DA600F1,0x4D0C711,0x9107354,0x2A96CA7,0x7460C2C,0x4772C30,0x9C},{0xC96D5DE,0x11B3C719,0x12C44E72,0x62A8455,0xB3522DF,0x1722392D,0x17C4C84A,0xC5B08EF,0x1C73E4E8,0x184F76C5,0x1BE85639,0x4178224,0x5F1ADAC,0x1004293E,0x14020923,0x6C},{0x1A433825,0xF576BC3,0x159F38EF,0x1A9CD3BC,0x5854D83,0x1C7BD842,0x113DF3CB,0x195CCF87,0xF553CAE,0x4937DAE,0x12924884,0x15F7F1B0,0x18EBD637,0x1A325E15,0x1CE00B35,0x33},{0xF92004C,0x960B5AD,0x16377D4C,0x6B9BC92,0x1B008FFB,0x1235B5EB,0x1CCD413F,0x15FF451A,0x22BBD23,0x18E7FA12,0x15789412,0x1407F3AD,0xE34E149,0x1DD9EF60,0x85B4C28,0xA1},{0x93FF538,0x7AA0B71,0x3D2CEB3,0x61BCB1E,0xACC622E,0x1A3767DE,0x61F027B,0x185CDCB1,0x13E6A1E9,0xE361803,0x1880218F,0x62895FE,0x14B2BBFE,0xD240288,0x1C1FC271,0x13},{0x1B349B02,0xB53E37C,0x1ED9EA61,0x5AB2858,0xB67832E,0x2AA71F7,0xDB9D08F,0xC73B305,0x73FA5E7,0x13B8B1BB,0x55FF6BB,0x85C4222,0x1CE8EB95,0xFFD7A2F,0xE35B9C2,0x7B},{0x1E8BF419,0x58C0D7E,0x1E8CB5A2,0x73EC57B,0x1BA6872,0x8468C61,0x188BEA65,0x1816C6AF,0x13946FCA,0x1CAB443C,0x1A0B0CBE,0x133FAF0E,0x1DFEAF70,0x81B1972,0x7C15DCD,0x2F},{0x15EA6770,0x153E7411,0x194A07B0,0x3DE3153,0x1B272CD3,0x1457211A,0xBBE8481,0x124FDB0F,0x1D9F0AB1,0x1C1A31DD,0x1C1A7078,0xE0FBD4B,0x4C2F512,0x1E9AA0A2,0xD77577F,0x9D},{0x6C0FF64,0xDED97C9,0x1ABFB826,0x10A18BCB,0xA2E9E97,0x2F2BF0C,0x1BE37B6,0x15083D61,0x1F0EAD50,0x1285E151,0xE8C9A5,0xAACDD1C,0x21BAABC,0x12A1AB54,0xDF074C8,0x33},{0x1AD61CD4,0x15B2A8D2,0xE89EDBC,0x1FC8A43B,0x1B234A16,0x56FF55F,0x4434214,0x19A164DF,0x6FD7D0B,0x1F59707F,0x4024A6B,0x3C55387,0xB3B4937,0xC2440D9,0x151CFAE4,0x25},{0x13196AB7,0x1C4BE1B9,0x12338A3D,0x43704AC,0x5D1A5BF,0x1B56BCC6,0x907C135,0x111C7910,0x3E32A73,0xBF1FC0B,0xE4F0527,0x5083EC8,0x17B28B9,0x6268B6,0x55F070B,0x39},{0xA64A98B,0x1F4F594,0x1090DE8C,0x1CCB6B44,0x1BDBE18A,0x1915B90,0x1837267C,0x13AA0893,0x9E2045F,0x140227B2,0x151C8D7,0x1CF5C8F1,0x16B1A688,0x1E328319,0x174847C4,0x29},{0x23F15E0,0x20AE21E,0x2250855,0x13008AB4,0x73F6DF,0x111C5B0C,0x159AF9C6,0xB7FE152,0x79DF96D,0x9C80D6,0x8824E75,0xEA4AE30,0xD1ACD04,0x186AA2D2,0x1089D613,0x3F},{0xDEEFD29,0xE27AD26,0x1D3C7648,0x114BFF08,0x1E99583F,0x117A1E0B,0xBEB066D,0x888DA10,0x3FCD8,0x452C56F,0x1151FB02,0x1BBC16F2,0x5BDE13E,0xF9C061A,0x5F0DF6F,0x4A},{0xC6AA7A5,0xB730285,0x16623E6B,0x11428639,0xE16EF5A,0xB3CA060,0xD95CDD3,0xCD03F43,0xCC34C0E,0x1E6D50EB,0x1454A80,0x1DDE2C91,0x18D93981,0x1F2FBD71,0xD51A6B7,0x52},{0x8B3D97C,0x93E33A9,0xE5BECEC,0x1B419BCC,0x19948005,0x17561899,0xAB43192,0x62F209E,0x72E20EB,0x1404250C,0x1DE0C492,0x3B72CA1,0x10C7D312,0x1AC39F4F,0xCC2FE92,0x24},{0x17E5B5CD,0xAC10F48,0x4D24A06,0x13D52E8B,0x3CAC1AD,0x9AFA89C,0x15A904CE,0x1973387C,0xE4F654D,0x6BDE920,0x2894302,0x115601A7,0x6F09153,0x6D61B04,0xC0C09D6,0x2F},{0x20CBB48,0x1CD36C35,0x1D1ECCAD,0xA4A2E64,0x6410B48,0x1F0178A6,0x140D5A2A,0xBC9E98D,0x25196AD,0x1D674AE6,0x17968F26,0x170DF7C0,0x14FA6C21,0x11136ABF,0x16E9371E,0x84},{0x120E7325,0x2081D06,0x1178C70E,0x18029A79,0x1D1A3656,0x8BD4833,0x678C01,0x1FFEA081,0x1E52B15F,0x6DB1DE3,0x1312FB85,0xCF17DA,0xD42415A,0xE097FC3,0x14AF9D8F,0x91},{0x3BCD51F,0x1252FE3F,0x1CFC6139,0x865D2A9,0x351F9EE,0x94E9CD5,0x16A17578,0x1D1A2E67,0x18D6D662,0x15C773CC,0x15DFD11A,0xC186191,0x261488A,0x14F3BFC3,0x13D7B4DA,0x58},{0x1F460AFF,0xEBF619A,0x21112D1,0x6519E28,0x16301DF6,0x122DCCC,0x199520F0,0x18B93BAA,0x1066120A,0xAB20E15,0x153840C7,0x1553B357,0x65990C8,0x1480086C,0x70D3E2F,0x16},{0x188381C1,0x61392FE,0x106D2339,0x1FF56EA5,0x2C827C6,0x1542A2B,0x102CF503,0x25FD7D8,0x8F93EAA,0xA554551,0xEC5FC64,0x18684127,0x71BE49B,0xAD4A921,0x2AA5579,0x11},{0x20F40C4,0xE3CE918,0xEF3E41,0x6819DB7,0xA3F7AA3,0x1704BF3,0x1FC1BE3A,0x1D2E30CC,0x1D39A6D9,0x1340E096,0xDBC8405,0x5CE2E57,0x117283E0,0x1F8CF7E8,0x95C44F4,0xA7}}; -const BIG CURVE_HTPC2= {0x152C1DFF,0x99DA487,0x18C185A2,0x6546AF3,0x144EC7F8,0xEF3797,0x1994DD57,0x179C04E7,0x57CDB0F,0x2585126,0x49E8583,0xCA412D5,0x6BFAFF3,0x14C442E4,0xBD9A0,0x1B}; -const BIG CURVE_Adr= {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Adi= {0xF0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Bdr= {0x3F4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Bdi= {0x3F4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG PCR[13]= {{0xB425ED1,0xA84BDA1,0x81DED55,0x1E8897B4,0x73D0AA2,0x1D575C73,0x3B6AF6,0xBF03B37,0x19D6C70F,0x14E85262,0x3AB4A64,0x1D1426CB,0x12C9C7B1,0x121291F5,0x967F827,0x9B},{0x71C71E,0x1FE38E39,0x61671FF,0x6E671C7,0xD6DC7FA,0x6018556,0x82C9039,0x10F42C69,0x361154B,0xFAE3DCA,0xAC077CB,0xDCF1D18,0x61755C5,0x158DED78,0xF0DFA1D,0x74},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xAD097D6,0xAA12F68,0x2077B55,0x17A225ED,0x19CF42A8,0x1755D71C,0x180EDABD,0x1AFC0ECD,0x1675B1C3,0x53A1498,0x18EAD299,0xF4509B2,0xCB271EC,0x1C84A47D,0x1A59FE09,0x26},{0xC,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xEDD3C0D,0x18BA7819,0x8CB1671,0x6694F03,0x1A8220DB,0x1A73F97C,0x1D95B3E0,0x14EEEAD0,0xBFE0250,0x16A65940,0xBF99097,0xCD5D4B1,0x1AFEDAB,0x63EC8CA,0x785F780,0xA8},{0x1038E38F,0x1FF1C71C,0x130B38FF,0x37338E3,0x6B6E3FD,0x1300C2AB,0x1416481C,0x187A1634,0x1B08AA5,0x17D71EE5,0x5603BE5,0x16E78E8C,0x30BAAE2,0x1AC6F6BC,0x786FD0E,0x3A},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x974F017,0x369E065,0x17C758C7,0x1A983C0C,0xD9A7F86,0x1EC90DEE,0x18E4681,0x1770E36A,0xC3296E,0x4094EF4,0x1F84274B,0x5334FD7,0xB56B4B5,0x7FC768B,0x1A58F87B,0x94},{0x12,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x10AAA8FB,0x1FD55555,0x1921AAFF,0xA59AAAA,0x1424ABF7,0x19024801,0x1C42D855,0x96E429D,0x5119FF1,0x7855CAF,0x1020B3B1,0x4B6ABA4,0x92300A8,0x1054E434,0x1694F72C,0xAE}}; -const BIG PCI[13]= {{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1038E38D,0x1FF1C71C,0x130B38FF,0x37338E3,0x6B6E3FD,0x1300C2AB,0x1416481C,0x187A1634,0x1B08AA5,0x17D71EE5,0x5603BE5,0x16E78E8C,0x30BAAE2,0x1AC6F6BC,0x786FD0E,0x3A},{0x71C71A,0x1FE38E39,0x61671FF,0x6E671C7,0xD6DC7FA,0x6018556,0x82C9039,0x10F42C69,0x361154B,0xFAE3DCA,0xAC077CB,0xDCF1D18,0x61755C5,0x158DED78,0xF0DFA1D,0x74},{0xAD097D6,0xAA12F68,0x2077B55,0x17A225ED,0x19CF42A8,0x1755D71C,0x180EDABD,0x1AFC0ECD,0x1675B1C3,0x53A1498,0x18EAD299,0xF4509B2,0xCB271EC,0x1C84A47D,0x1A59FE09,0x26},{0x10AAAA9F,0x1FD55555,0x1921AAFF,0xA59AAAA,0x1424ABF7,0x19024801,0x1C42D855,0x96E429D,0x5119FF1,0x7855CAF,0x1020B3B1,0x4B6ABA4,0x92300A8,0x1054E434,0x1694F72C,0xAE},{0x10AAAA63,0x1FD55555,0x1921AAFF,0xA59AAAA,0x1424ABF7,0x19024801,0x1C42D855,0x96E429D,0x5119FF1,0x7855CAF,0x1020B3B1,0x4B6ABA4,0x92300A8,0x1054E434,0x1694F72C,0xAE},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x71C71C,0x1FE38E39,0x61671FF,0x6E671C7,0xD6DC7FA,0x6018556,0x82C9039,0x10F42C69,0x361154B,0xFAE3DCA,0xAC077CB,0xDCF1D18,0x61755C5,0x158DED78,0xF0DFA1D,0x74},{0x5DA12ED,0x153425ED,0x171A2FAA,0x12B784BD,0x1A55694E,0x1AC70E4,0x433FD98,0xE7233D0,0xE9BEE2D,0x24B4816,0x1735E118,0x1571A1F1,0x1C708EBB,0x13D03FB6,0x1C3AF922,0x87},{0x974F017,0x369E065,0x17C758C7,0x1A983C0C,0xD9A7F86,0x1EC90DEE,0x18E4681,0x1770E36A,0xC3296E,0x4094EF4,0x1F84274B,0x5334FD7,0xB56B4B5,0x7FC768B,0x1A58F87B,0x94},{0x10AAAA99,0x1FD55555,0x1921AAFF,0xA59AAAA,0x1424ABF7,0x19024801,0x1C42D855,0x96E429D,0x5119FF1,0x7855CAF,0x1020B3B1,0x4B6ABA4,0x92300A8,0x1054E434,0x1694F72C,0xAE},{0x10AAA9D3,0x1FD55555,0x1921AAFF,0xA59AAAA,0x1424ABF7,0x19024801,0x1C42D855,0x96E429D,0x5119FF1,0x7855CAF,0x1020B3B1,0x4B6ABA4,0x92300A8,0x1054E434,0x1694F72C,0xAE},{0x10AAA8FB,0x1FD55555,0x1921AAFF,0xA59AAAA,0x1424ABF7,0x19024801,0x1C42D855,0x96E429D,0x5119FF1,0x7855CAF,0x1020B3B1,0x4B6ABA4,0x92300A8,0x1054E434,0x1694F72C,0xAE}}; -#endif - -#if CHUNK==64 - -using namespace B448_60; - -// Base Bits= 60 - -const int CURVE_Cof_I= 0; -const BIG CURVE_Cof= {0xFF0000011FFFFFFL,0x403FL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 4; -const BIG CURVE_B= {0x4L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0xEBC000000000001L,0x81987F70023FFFFL,0x340905DC5A3E80L,0x94374F2CDDD3713L,0x10405F3D0D062F6L,0x0L,0x0L,0x0L}; -const BIG CURVE_Gx= {0xE6CA5B278ABC574L,0xFC6EC8ECBE2A6D2L,0x29BD7C18640BFDDL,0x8814D9BD1F29789L,0xABA282B7CE9049EL,0x43412B4E0DF13E7L,0xB62517BEDDB681EL,0x39E6C4L}; -const BIG CURVE_Gy= {0x994157597A9CE3FL,0xF905D6B69C431DCL,0x3476A5568900742L,0xB09E5F3D3F429D6L,0xFAD8CED72F5769DL,0xB19187E10D9FBDDL,0x87504385DD443B2L,0x12621FL}; -const BIG CURVE_HTPC= {0x14C40448911B6DFL,0xA05D73B4005575AL,0x19D3FFA0043A6AL,0x9DCBB950453AAB1L,0x8F188A39830074AL,0x886F6C1313A12BL,0x323F40FBC329680L,0x4F6592L}; - -const BIG CURVE_Bnx= {0xFF0000012000000L,0x403FL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Pxa= {0x65025557F3AF148L,0xAF4DBD1F46E75B8L,0x1730875544DD695L,0xE37A84E30576317L,0x2760C16CE339FC8L,0x258FB84649C73F2L,0x45DECE4C1502219L,0x2C5ECL}; -const BIG CURVE_Pxb= {0xC4F6E6BB36279B6L,0x530E32492D8015BL,0x3F16872759E2951L,0xDD4ACB43BA5202FL,0xFE06E165089BD13L,0xDA296B65CE7FAEAL,0x16EC13B532F64C9L,0xF64B9L}; -const BIG CURVE_Pya= {0xBFC0EA271C0B975L,0x971B0987719FB7DL,0x783587349A91EFBL,0x5B26E1E164C5BA2L,0x34AE6E2149122B6L,0x919E2C134F4019FL,0x46D510457BD2FL,0x45EA07L}; -const BIG CURVE_Pyb= {0x3EE1FF0082464ADL,0xF8557C8A8F0CF1BL,0x6062A50D0077B77L,0x806D6E17CEEF5EBL,0x8F95D948A372182L,0x1690DECDC940F93L,0xEB1BEA8F586B9E9L,0x34015DL}; - -const BIG CURVE_Ad= {0x2B7CF1B298E3466L,0x6C9FE584ADB58AL,0xAE618C4441D091DL,0x649C886E6D2CC2BL,0x7BDA1ECDF8CA78FL,0x9FC3FCD80DBBB27L,0x74D4F1F9729760CL,0x19EA0EL}; -const BIG CURVE_Bd= {0x1CCB86130F780D9L,0x2D5A7C07F4A51A0L,0x99A51B6FD01A1BBL,0xAE12B32E246480L,0x45C8B048B4D289L,0xAD74B1FED8D288BL,0x276B220D6B08F5BL,0x29D1A2L}; -const BIG PC[53]= {{0xCA2E8BA3F34E48L,0x9C1F67AB89650AL,0x4FA71DA7BA330L,0xD104A18D275FFDCL,0xE98A8B61C21689CL,0xC03CB4E05961F09L,0xAB977EAB088A0C6L,0xF2910L},{0x8DAB6776604D319L,0x5E333A54FF1F29EL,0xB06B4CD9E4CBF06L,0xF8DAA9493D66B74L,0x26D3AB458B9CC61L,0xBACFA058DFB0295L,0x3F9DF9DF3EB0CB5L,0x3DFC8EL},{0xF5334873EA1F60AL,0x9549B6EC7E13A86L,0xA5D45908C4E2558L,0xE0D733926F79B73L,0xCDE1872F1991243L,0x8E00DEE03D4D2CAL,0xD168F4937C08D2CL,0x53D3D2L},{0x44C150037499741L,0x3BD7556E9D85B54L,0x70B485348521E19L,0x4DCEB44DF6F5242L,0x7F602EC95D38A81L,0xD3B6B4317C39525L,0xAB827397CF26EABL,0xF40BEL},{0xD780C2EE8A9B7DDL,0x5BFD0A87BA123F6L,0xB704149A656E9B7L,0xFB3D8D8250169A7L,0xDBAFE384E1B5A80L,0xE33E6DB698822E2L,0x1ADFD5731D2D4D2L,0x27E3F5L},{0xEE18F93C41C4477L,0x8822B165E9F3BB5L,0xF81BCEAD751713BL,0xF3FD57505403933L,0x543A69376B6BAE1L,0x2E2C188E07B1B4AL,0xFA47058B97839A4L,0x129214L},{0xC46466ED0815090L,0x82A8477388286F6L,0x55415FA6E5B59C3L,0x4FCDBA32F596982L,0x3BEBA0B8B800647L,0x8067EDEC24FD2DCL,0x23735D491406F8DL,0x27031AL},{0x237171BD500BAD1L,0x54E5DABBDA52179L,0x39EED6D9840047L,0x9F62B3C5BBE70BBL,0x5B682935D460B68L,0xE37CCA944164133L,0xBAA9B754C8769C5L,0x4F71D5L},{0x48821C29E8081C0L,0x8B10F8432B1F73FL,0xF33341BDF35547EL,0x44D8A286F2D64E3L,0x7CF3F353E5AFD5L,0x77CBAA1A38E67B6L,0x474039CD79B26B0L,0x15F7E2L},{0xF92A02857226171L,0x670D84A4DB8412EL,0x4C07F33AC92190EL,0xFE7C239718D531FL,0x16FEB62FC918257L,0x551F5FA232DBF4CL,0xA2262B91DD663A6L,0x513BA6L},{0x139421007A91954L,0xC897089BCA8F8E1L,0xF39670B7F8E69E7L,0xECD5CC0FAC3C084L,0x4A62E46CB8D5D73L,0xD6958651AF783AEL,0x6214D7EAF10E794L,0x4A1CF5L},{0x5035F58B92801A5L,0x9DD21175856DFA0L,0x1C54471AC39F6E8L,0x4A4455B68F864L,0xCEBF3444F479330L,0xA1896ECB026AE8FL,0x13798A8AD8FBB10L,0x40036L},{0x12593C28F9D1C0AL,0x9E53BCD23503B31L,0x74FF15EBD437870L,0x814D22AAA5002D5L,0xE3CD6452AC2C033L,0xCEDA7682EAD8194L,0xCA8D948BF6077F1L,0x4B6163L},{0x695774ADF0A734CL,0x3A4F0FAF18848AEL,0xA329B8FFF150217L,0xCFA4BB81D32CB6CL,0x46753EE2A5BF898L,0x76FF71FFF34CE9CL,0xF985D613FEBD9A1L,0x4AE3B1L},{0xA6F72CFF1F37A8DL,0xC08952B61FB4664L,0x75F3020A8B74C59L,0xF837EF511EC585EL,0xACEE128F587CFCEL,0xC68B982093597FBL,0x11DBD5819E24045L,0x1305B0L},{0x8AD991A3124740BL,0xB1BA6424469E9C6L,0x6D0500D1A8B0336L,0x4697B3B665ECD64L,0x789128B282C2A24L,0x7C5FEA435E1E511L,0xBF4998179A5D89AL,0x370542L},{0x6EB49AAAD27D311L,0xC44B2B709A2C349L,0x97D96FEB98EEF0CL,0xEDFE38DCE8507CBL,0xD7302DB5F6B3FF9L,0xA8E476581D84921L,0xA51CC54C7152F5L,0x47A513L},{0xC2E3ACF1F1FC577L,0x819DC8582B977BL,0x2CAB1522882CAB8L,0xC8900CA9AF3D679L,0x479599396371CE7L,0xCDCE25F02C5B347L,0xA58D8B2A509BE1AL,0x2FCD0AL},{0x657289AE9150A48L,0x38C6B088F4220C0L,0x3483EB38D0F458L,0x589009EAF978350L,0x7EBB824407235B4L,0x56CA72A2CCB14E4L,0xEA66FC272BCDCCFL,0x439DC3L},{0x6623DEF9357D628L,0xFD7BA8E7DE31234L,0x99C040938DB9E8BL,0xB0FE406C9D3CDB6L,0xD38F65BE751A703L,0x7CA37104A247DEBL,0x7ECA5B210A36965L,0x3932D3L},{0xA23FE2FB17D6EECL,0x7ABF374B72AAE7L,0x62C2BF1860877F7L,0x8C4635085D4226FL,0x295B0F5706768CCL,0x227C909C7AEB12FL,0x521176C4D8AEC4CL,0x2C87ABL},{0x6F88B2A580B7137L,0x6A01C7EC3DCBF40L,0x77A61FE541BC690L,0xC21EED75E09CBBEL,0xD546C64B66EF123L,0xE9BE54149BB92F4L,0x2737E7C402B1E3AL,0x2542AAL},{0x75832C6E05BEFD8L,0x5DFA5C39B3B092FL,0xE8C16C48839C904L,0xCD2EF769EC4E8B6L,0x2C80F565FA5F23CL,0x6E9127B74DF1A18L,0xF8539726D23B186L,0x160D2L},{0x419B4088ACA5AD9L,0x7306B8707C1ADC1L,0xACD61FFAF6099A0L,0xC51DEF3D128F489L,0x81B7085E8A76F4EL,0x2D3B39889E0FB08L,0xD61F1EA307C7E55L,0x4BF3DFL},{0xA8371AA52C72185L,0x8EB49A55D2D9E38L,0xC6C6736817932E9L,0x9DBF37057564284L,0x443A1CBA5B94394L,0xD87AF590E234AA5L,0x7D1FCAC035D89CL,0x2FC680L},{0xFEA149BAEFEE0EAL,0x3CF4640E446D388L,0x1E4CE07FE5EDC2CL,0x5F90A3F48CF058EL,0x9F19E019EED6342L,0xF4E2F3EB5891E98L,0x7D7EECC281EEE08L,0x4B2EE5L},{0x3F500EED6887410L,0x10F5106924F0215L,0x5AF361F0BCBCC51L,0xBA469C2DA94E589L,0xD831D9B3D39CDF1L,0xCB5839282F3E02DL,0x2DE045F7C285BD4L,0x3DFAA0L},{0xFEE121340DD0AA9L,0xC80E715435565F5L,0xC9BDDB418617757L,0x9008A702AC7A865L,0x7B352BC03C0F76AL,0xDB9BAD304E54DE7L,0x20262A2ADBD4C8FL,0x4B32FDL},{0x2DE43411E428BFDL,0xA41124E28EB7D81L,0xEFCAE1597CB7A3FL,0xD7659AAD7AD2D1L,0x44F775441C84B43L,0x53A8AE3DCFF23BDL,0x40645BA7F7D5EBL,0x285EECL},{0x2727300D2540F1FL,0xFDECB15E09A345L,0x21DEA9022B44831L,0xBBB119161008E89L,0xECA756DE403AF19L,0xEED8A0E6D5E59CL,0x95A363EF5B040D0L,0x522411L},{0xA2C27EEF545BF96L,0xAA5B86F0E4960D7L,0x6AFF6F2F34CA0A0L,0x2D50D7FDB10F76CL,0xC47B4C01E25E74AL,0xCA748839AA13431L,0xB0C0E8C18582A96L,0x4E11DCL},{0xA3678E32C96D5DEL,0xF315422ACB1139CL,0x2AE44725AB3522DL,0xE862D8477DF1321L,0x8E709EED8BC73E4L,0xDAC20BC1126FA15L,0x248E008527C5F1AL,0x365008L},{0xDEAED787A433825L,0x3D4E69DE567CE3BL,0x2F8F7B0845854D8L,0xAECAE67C3C4F7CFL,0x210926FB5CF553CL,0x637AFBF8D84A492L,0x2CD7464BC2B8EBDL,0x19F380L},{0x12C16B5AF92004CL,0xB35CDE4958DDF53L,0xFE46B6BD7B008FFL,0x23AFFA28D733504L,0x4B1CFF42422BBDL,0x149A03F9D6D5E25L,0x30A3BB3DEC0E34EL,0x50A16DL},{0xCF5416E293FF538L,0xE30DE58F0F4B3ACL,0xEF46ECFBCACC622L,0xE9C2E6E58987C09L,0x63DC6C30073E6A1L,0xBFE3144AFF62008L,0x9C5A4805114B2BL,0x9F07FL},{0x56A7C6F9B349B02L,0xE2D5942C7B67A98L,0x3C554E3EEB67832L,0xE7639D982B6E742L,0xAEE771637673FA5L,0xB9542E2111157FDL,0xE709FFAF45FCE8EL,0x3DB8D6L},{0x8B181AFDE8BF419L,0x239F62BDFA32D68L,0x9508D18C21BA687L,0xCAC0B6357E22FA9L,0x2FB95688793946FL,0xF7099FD787682C3L,0x773503632E5DFEAL,0x179F05L},{0x2A7CE8235EA6770L,0x31EF18A9E5281ECL,0x68AE4235B272CDL,0xB1927ED87AEFA12L,0x1E383463BBD9F0AL,0x512707DEA5F069CL,0x5DFFD3541444C2FL,0x4EB5DDL},{0x9BDB2F926C0FF64L,0x7850C5E5EAFEE09L,0xD85E57E18A2E9E9L,0x50A841EB086F8DEL,0x69650BC2A3F0EADL,0xABC5566E8E03A32L,0xD32254356A821BAL,0x19B7C1L},{0x2B6551A5AD61CD4L,0x6FE4521DBA27B6FL,0x50ADFEABFB234A1L,0xBCD0B26F910D08L,0x9AFEB2E0FE6FD7DL,0x9371E2A9C390092L,0xEB9184881B2B3B4L,0x12D473L},{0x7897C3733196AB7L,0xF21B825648CE28FL,0xD76AD798C5D1A5BL,0x7388E3C88241F04L,0x49D7E3F8163E32AL,0x8B92841F64393C1L,0x1C2C0C4D16C17B2L,0x1C957CL},{0x3E9EB28A64A98BL,0xAE65B5A242437A3L,0xF0322B721BDBE18L,0x5F9D50449E0DC99L,0x35E8044F649E204L,0x688E7AE47885472L,0x1F13C6506336B1AL,0x14DD21L},{0x4415C43C23F15E0L,0xF980455A0894215L,0x1A238B618073F6DL,0x6D5BFF0A9566BE7L,0x9D413901AC79DF9L,0xD04752571822093L,0x584F0D545A4D1ACL,0x1FC227L},{0x1C4F5A4CDEEFD29L,0xF8A5FF8474F1D92L,0xB62F43C17E99583L,0xD84446D082FAC19L,0xC088A58ADE003FCL,0x13EDDE0B794547EL,0x7DBDF380C345BDEL,0x2517C3L},{0xD6E6050AC6AA7A5L,0xA8A1431CD988F9AL,0x4D67940C0E16EF5L,0xE6681FA1B65737L,0xA03CDAA1D6CC34CL,0x981EEF164885152L,0x9ADFE5F7AE38D93L,0x293546L},{0x127C67528B3D97CL,0x5DA0CDE6396FB3BL,0x4AEAC3133994800L,0xEB317904F2AD0C6L,0x24A8084A1872E20L,0x3121DB9650F7831L,0xFA4B5873E9F0C7DL,0x12330BL},{0x95821E917E5B5CDL,0xD9EA97459349281L,0x3935F51383CAC1AL,0x4DCB99C3E56A413L,0xC08D7BD240E4F65L,0x1538AB00D38A250L,0x2758DAC36086F09L,0x17B030L},{0x79A6D86A20CBB48L,0x85251732747B32BL,0xABE02F14C6410B4L,0xAD5E4F4C6D03568L,0xC9BACE95CC25196L,0xC21B86FBE05E5A3L,0xDC7A226D57F4FA6L,0x425BA4L},{0x84103A0D20E7325L,0x6C014D3CC5E31C3L,0x517A9067D1A365L,0x5FFFF5040819E30L,0xE14DB63BC7E52B1L,0x15A0678BED4C4BEL,0x763DC12FF86D424L,0x48D2BEL},{0x64A5FC7E3BCD51FL,0xE432E954F3F184EL,0xE129D39AA351F9EL,0x62E8D1733DA85D5L,0x46AB8EE7998D6D6L,0x88A60C30C8D77F4L,0xD36A9E77F862614L,0x2C4F5EL},{0x5D7EC335F460AFFL,0x6328CF1408444B4L,0xC0245B9996301DFL,0xAC5C9DD5665483L,0x31D5641C2B06612L,0xC8AA9D9ABD4E10L,0xF8BE90010D86599L,0xB1C34L},{0x4C2725FD88381C1L,0x6FFAB752C1B48CEL,0xC2A854562C827CL,0xAA12FEBEC40B3D4L,0x1914AA8AA28F93EL,0x49BC342093BB17FL,0x55E55A9524271BEL,0x88AA9L},{0x5C79D23020F40C4L,0x3340CEDB83BCF90L,0xE82E097E6A3F7AAL,0xD9E9718667F06F8L,0x16681C12DD39A6L,0x3E02E7172BB6F21L,0x13D3F19EFD11728L,0x53A571L}}; -const BIG CURVE_HTPC2= {0x933B490F52C1DFFL,0x832A3579E306168L,0x5C1DE6F2F44EC7FL,0xFBCE0273E65375L,0x60C4B0A24C57CDBL,0xFF3652096A927A1L,0x668298885C86BFAL,0xD802FL}; -const BIG CURVE_Adr= {0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Adi= {0xF0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Bdr= {0x3F4L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Bdi= {0x3F4L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG PCR[13]= {{0x55097B42B425ED1L,0x2F444BDA2077B55L,0xDBAAEB8E673D0AAL,0xF5F81D9B80EDABL,0x9929D0A4C59D6C7L,0x7B1E8A13658EAD2L,0xE09E42523EB2C9CL,0x4DA59FL},{0xFFC71C72071C71EL,0xA37338E39859C7FL,0xE4C030AACD6DC7FL,0x4B87A1634A0B240L,0xF2DF5C7B9436115L,0x5C56E78E8C2B01DL,0xE876B1BDAF06175L,0x3A3C37L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x55425ED0AD097D6L,0x8BD112F6881DED5L,0xF6EABAE399CF42AL,0xC3D7E0766E03B6AL,0xA64A742931675B1L,0x1EC7A284D963AB4L,0xF82790948FACB27L,0x136967L},{0xCL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x7174F032EDD3C0DL,0xB334A781A32C59CL,0x834E7F2F9A8220DL,0x50A7775687656CFL,0x25ED4CB280BFE02L,0xDAB66AEA58AFE64L,0xDE00C7D91941AFEL,0x541E17L},{0xFFE38E39038E38FL,0xD1B99C71CC2CE3FL,0x7260185566B6E3FL,0xA5C3D0B1A505920L,0xF96FAE3DCA1B08AL,0xAE2B73C7461580EL,0xF43B58DED7830BAL,0x1D1E1BL},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0xC6D3C0CA974F017L,0x6D4C1E065F1D631L,0x7D921BDCD9A7F8L,0x6EBB871B506391AL,0xD2C8129DE80C329L,0x4B5299A7EBFE109L,0xE1ECFF8ED16B56BL,0x4A6963L},{0x12L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0xFFAAAAAB0AAA8FBL,0x752CD5556486ABFL,0x572049003424ABFL,0xF14B7214EF10B61L,0xEC4F0AB95E5119FL,0xA825B55D24082CL,0xDCB20A9C8689230L,0x575A53L}}; -const BIG PCI[13]= {{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0xFFE38E39038E38DL,0xD1B99C71CC2CE3FL,0x7260185566B6E3FL,0xA5C3D0B1A505920L,0xF96FAE3DCA1B08AL,0xAE2B73C7461580EL,0xF43B58DED7830BAL,0x1D1E1BL},{0xFFC71C72071C71AL,0xA37338E39859C7FL,0xE4C030AACD6DC7FL,0x4B87A1634A0B240L,0xF2DF5C7B9436115L,0x5C56E78E8C2B01DL,0xE876B1BDAF06175L,0x3A3C37L},{0x55425ED0AD097D6L,0x8BD112F6881DED5L,0xF6EABAE399CF42AL,0xC3D7E0766E03B6AL,0xA64A742931675B1L,0x1EC7A284D963AB4L,0xF82790948FACB27L,0x136967L},{0xFFAAAAAB0AAAA9FL,0x752CD5556486ABFL,0x572049003424ABFL,0xF14B7214EF10B61L,0xEC4F0AB95E5119FL,0xA825B55D24082CL,0xDCB20A9C8689230L,0x575A53L},{0xFFAAAAAB0AAAA63L,0x752CD5556486ABFL,0x572049003424ABFL,0xF14B7214EF10B61L,0xEC4F0AB95E5119FL,0xA825B55D24082CL,0xDCB20A9C8689230L,0x575A53L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0xFFC71C72071C71CL,0xA37338E39859C7FL,0xE4C030AACD6DC7FL,0x4B87A1634A0B240L,0xF2DF5C7B9436115L,0x5C56E78E8C2B01DL,0xE876B1BDAF06175L,0x3A3C37L},{0xAA684BDA5DA12EDL,0xE95BC25EDC68BEAL,0x60358E1C9A55694L,0x2D73919E810CFF6L,0x460496902CE9BEEL,0xEBBAB8D0F8DCD78L,0xE48A7A07F6DC708L,0x43F0EBL},{0xC6D3C0CA974F017L,0x6D4C1E065F1D631L,0x7D921BDCD9A7F8L,0x6EBB871B506391AL,0xD2C8129DE80C329L,0x4B5299A7EBFE109L,0xE1ECFF8ED16B56BL,0x4A6963L},{0xFFAAAAAB0AAAA99L,0x752CD5556486ABFL,0x572049003424ABFL,0xF14B7214EF10B61L,0xEC4F0AB95E5119FL,0xA825B55D24082CL,0xDCB20A9C8689230L,0x575A53L},{0xFFAAAAAB0AAA9D3L,0x752CD5556486ABFL,0x572049003424ABFL,0xF14B7214EF10B61L,0xEC4F0AB95E5119FL,0xA825B55D24082CL,0xDCB20A9C8689230L,0x575A53L},{0xFFAAAAAB0AAA8FBL,0x752CD5556486ABFL,0x572049003424ABFL,0xF14B7214EF10B61L,0xEC4F0AB95E5119FL,0xA825B55D24082CL,0xDCB20A9C8689230L,0x575A53L}}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS12461.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS12461.cpp deleted file mode 100644 index f16bf58..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS12461.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_BLS12461.h" - -namespace BLS12461 { -/* Curve BLS12461 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B464_28; - -const int CURVE_Cof_I=0; -const int CURVE_B_I= 9; -const BIG CURVE_B= {0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x1,0x0,0xFFFFC00,0x7FEFFFE,0x110000,0x7FFC800,0x801FC01,0x5FD000E,0x17FE0,0xFFFC018,0xFFFFFF7,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Gx= {0xADEE93D,0x4D026A8,0x74B7411,0xD9C00EE,0x31AC7F2,0xC3981B5,0x9218229,0xD3564DC,0xA096650,0x6F7C292,0x9743616,0xBE922B1,0x12CF668,0xC81327,0x463B73A,0xE74E99B,0xAD0}; -const BIG CURVE_Gy= {0xAD1D465,0xF763157,0xC4FF470,0x17884C8,0xB8D215D,0xA819E66,0xF4959D0,0xE5C3245,0xB84910A,0xB8BFA40,0xBE96EEC,0x8BF9F8C,0xF277ACC,0x5F1C3F2,0x5F68C9,0xCDB14B3,0x77B}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Bnx= {0x0,0xFBFFFE0,0x1FFFFF,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Cof= {0x1,0xFBFFFE0,0x1FFFFF,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -//const BIG CURVE_Cof= {0xAAAAAAB,0xA7FFFEA,0x1556AA,0xD55AAAB,0x554FFFF,0x1555,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - - -const BIG CURVE_Pxa= {0x6D0A37C,0x5B50318,0x75DCC46,0xC2E492E,0xD6878A9,0xE01F919,0xF92F564,0x86DB74F,0x66803F0,0x46D581A,0x7ED78D,0x2F97C29,0xC270C89,0xF679453,0x6A50A9A,0x54138A0,0x10CC}; -const BIG CURVE_Pxb= {0x2C1C0AD,0xF85CA8C,0x25CADE9,0x6CD66C4,0xA289609,0xC612951,0xEE2401A,0x529ABEB,0xF65B17D,0xBA09D33,0xD4C5AF5,0x4D4371E,0x46A672E,0xA279D22,0xACEA37C,0x1FB4FE5,0x95C}; -const BIG CURVE_Pya= {0x2FB006,0xCCD0C1B,0xA12A337,0x3D194A4,0xC92C895,0x4960CFC,0x39FC68B,0x3A9B00F,0xED1BA0F,0xA7DBBC5,0xA9CDFD8,0x27CC2F7,0x4E73ED2,0x6070F4F,0xEBA7E67,0xAC848E7,0x226}; -const BIG CURVE_Pyb= {0xDF1457C,0xA506ADF,0x4C20A8,0xD6A31DC,0x36E3FB4,0xEA9A8F1,0x92F5668,0x3C3BE44,0x67A1297,0x74BEABA,0x56A20BE,0x4C42E38,0x45157F0,0x2AB1D00,0xBB402EA,0x101B4FA,0xE38}; - -#endif - -#if CHUNK==64 - -using namespace B464_60; - -const int CURVE_Cof_I=0; -const int CURVE_B_I= 9; -const BIG CURVE_B= {0x9L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x1L,0x7FEFFFEFFFFC0L,0xC017FFC80001100L,0x7FE05FD000E801FL,0xFFFF7FFFC018001L,0xFFL,0x0L,0x0L}; -const BIG CURVE_Gx= {0x14D026A8ADEE93DL,0xF2D9C00EE74B741L,0x229C3981B531AC7L,0x6650D3564DC9218L,0x436166F7C292A09L,0x2CF668BE922B197L,0x463B73A0C813271L,0xAD0E74E99BL}; -const BIG CURVE_Gy= {0xF763157AD1D465L,0x5D17884C8C4FF47L,0x9D0A819E66B8D21L,0x910AE5C3245F495L,0x96EECB8BFA40B84L,0x277ACC8BF9F8CBEL,0x5F68C95F1C3F2FL,0x77BCDB14B3L}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Bnx= {0xFFBFFFE00000000L,0x1FFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Cof= {0xFFBFFFE00000001L,0x1FFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -//const BIG CURVE_Cof= {0xAA7FFFEAAAAAAABL,0xFFD55AAAB01556AL,0x1555554FFL,0x0L,0x0L,0x0L,0x0L,0x0L}; - - -const BIG CURVE_Pxa= {0x65B503186D0A37CL,0xA9C2E492E75DCC4L,0x564E01F919D6878L,0x3F086DB74FF92FL,0xED78D46D581A668L,0x270C892F97C2907L,0x6A50A9AF679453CL,0x10CC54138A0L}; -const BIG CURVE_Pxb= {0x9F85CA8C2C1C0ADL,0x96CD66C425CADEL,0x1AC612951A2896L,0xB17D529ABEBEE24L,0xC5AF5BA09D33F65L,0x6A672E4D4371ED4L,0xACEA37CA279D224L,0x95C1FB4FE5L}; -const BIG CURVE_Pya= {0x7CCD0C1B02FB006L,0x953D194A4A12A33L,0x68B4960CFCC92C8L,0xBA0F3A9B00F39FCL,0xCDFD8A7DBBC5ED1L,0xE73ED227CC2F7A9L,0xEBA7E676070F4F4L,0x226AC848E7L}; -const BIG CURVE_Pyb= {0x8A506ADFDF1457CL,0xB4D6A31DC04C20AL,0x668EA9A8F136E3FL,0x12973C3BE4492F5L,0xA20BE74BEABA67AL,0x5157F04C42E3856L,0xBB402EA2AB1D004L,0xE38101B4FAL}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS24479.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS24479.cpp deleted file mode 100644 index dac4cb1..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS24479.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_BLS24479.h" - -namespace BLS24479 { -/* Curve BLS24479 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B480_29; - -// Base Bits= 29 - -const int CURVE_Cof_I=0; -const int CURVE_B_I= 19; -const BIG CURVE_B= {0x13,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x10000001,0xD047FF,0x1FD54464,0x1E3CE067,0xE322DDA,0x1D356F3F,0x7433B44,0x49091F9,0x1729CC2,0x250286C,0x16E62ED,0xB403E1E,0x1001000,0x80,0x0,0x0,0x0}; -const BIG CURVE_Gx= {0xBE3CCD4,0x33B07AF,0x1B67D159,0x3DFC5B5,0xEBA1FCC,0x1A3C1F84,0x56BE204,0xEF8DF1B,0x11AE2D84,0x5FEE546,0x161B3BF9,0x183B20EE,0x1EA5D99B,0x14F0C5BF,0xBE521B7,0x17C682F9,0x1AB2}; -const BIG CURVE_Gy= {0x121E5245,0x65D2E56,0x11577DB1,0x16DACC11,0x14F39746,0x459F694,0x12483FCF,0xC828B04,0xFD63E5A,0x7B1D52,0xAFDE738,0xF349254,0x1A4529FF,0x10E53353,0xF91DEE1,0x16E18D8A,0x47FC}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Bnx= {0x11FF80,0x80010,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Cof= {0x11FF7F,0x80010,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -//const BIG CURVE_Cof= {0x19F415AB,0x1E0FFDFF,0x15AAADFF,0xAA,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Pxaa= {0x14E24678,0x1F149A9B,0x9609022,0x1C186868,0xCDEFC69,0x1C87BB2E,0x14A2235F,0x7586755,0x5896747,0x159BFE92,0x3B5572E,0x1710A521,0x71EB14A,0xC643C33,0x12581DE5,0x1BCA747D,0x959}; -const BIG CURVE_Pxab= {0x1FB099B8,0x3FCF5D7,0x4A91C0E,0xC6EEB40,0x11FC2385,0x11B5AE8D,0x1A9CC3E7,0x194FE144,0x185DB2A5,0x930E1C7,0x14F85F9A,0x1F2ED4E,0x1D1BE5AD,0xF26169C,0xCF7F194,0x1DA1062E,0x3B0D}; -const BIG CURVE_Pxba= {0x11AD15D3,0xD0E6F38,0x17DB85BB,0x30A62F1,0x1EA3E09A,0x17B25FA1,0x1B7959AC,0x1165B19A,0x6C74FDB,0x18F790E1,0x12278FDA,0x1E008F79,0x103F329,0x14619FF1,0x1EBCAA8,0xFF5A9CA,0x3EC2}; -const BIG CURVE_Pxbb= {0x1EE0F480,0x3D5943A,0xF5B12E3,0x128AADC8,0x180E1CB9,0x1EFD916F,0x48BC7F,0x1D5EE1FA,0x5698EF5,0x11D6AED9,0x1386BC6E,0x196E900B,0x1CE2E465,0xC2A8ED3,0x1E67DF99,0x71B7940,0xA5B}; -const BIG CURVE_Pyaa= {0x14781AA0,0xC324C98,0xEDC2AC,0x16C13B46,0x145FC44B,0x12529530,0x1310A8C4,0x1768C5C0,0xE19AE68,0x56E1C1D,0x13DAF93F,0x17E94366,0xF901AD0,0x76800CC,0x10250D8B,0x1E6BAE6D,0x5057}; -const BIG CURVE_Pyab= {0xEAE08FA,0xDDF62BF,0xA97E5AB,0xF0EE97,0x99A42CA,0x1C326578,0xF33DC11,0x8B913F7,0xFEF8552,0x19F35B90,0x58DDBDE,0xFC32FF2,0x1587B5DF,0xB5EB07A,0x1A258DE0,0x1692CC3D,0x2CE2}; -const BIG CURVE_Pyba= {0x5F0CC41,0xB9813B5,0x14C2A87D,0xFF1264A,0x19AF8A14,0x6CE6C3,0x2A7F8A2,0x121DCA7D,0x7D37153,0x19D21078,0x15466DC7,0x1362982B,0x1DD3CB5B,0x1CFC0D1C,0x18C69AF8,0x8CC7DC,0x1807}; -const BIG CURVE_Pybb= {0x115C1CAE,0x78D9732,0x16C26237,0x5A81A6A,0x1C38A777,0x56121FE,0x4DAD9D7,0x1BEBA670,0xA1D72FC,0xD60B274,0x19734258,0x1D621775,0x4691771,0x14206B68,0x17B22DE4,0x29D5B37,0x499D}; - - -#endif - -#if CHUNK==64 - -using namespace B480_56; - -// Base Bits= 56 - -const int CURVE_Cof_I=0; -const int CURVE_B_I= 19; -const BIG CURVE_B= {0x13L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x1A08FFF0000001L,0x1E7033FF551190L,0x6ADE7EE322DDAFL,0x848FC9D0CED13AL,0x50D81729CC224L,0x1F0F05B98BB44AL,0x10010010005A0L,0x0L,0x0L}; -const BIG CURVE_Gx= {0x6760F5EBE3CCD4L,0xEFE2DAED9F4564L,0x783F08EBA1FCC1L,0xC6F8D95AF88134L,0xDCA8D1AE2D8477L,0x9077586CEFE4BFL,0x8B7FEA5D99BC1DL,0x17CAF9486DE9E1L,0x1AB2BE34L}; -const BIG CURVE_Gy= {0xCBA5CAD21E5245L,0x6D6608C55DF6C4L,0xB3ED294F39746BL,0x145824920FF3C8L,0x63AA4FD63E5A64L,0x492A2BF79CE00FL,0x66A7A4529FF79AL,0x6C53E477B861CAL,0x47FCB70CL}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Bnx= {0x100020011FF80L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Cof= {0x100020011FF7FL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -//const BIG CURVE_Cof= {0xC1FFBFF9F415ABL,0x5556AAB7FFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Pxaa= {0xE2935374E24678L,0xC34342582408BL,0xF765CCDEFC69EL,0xC33AAD2888D7F9L,0x7FD2458967473AL,0x52908ED55CBAB3L,0x786671EB14AB88L,0xA3EC96077958C8L,0x959DE53L}; -const BIG CURVE_Pxab= {0x7F9EBAFFB099B8L,0x3775A012A47038L,0x6B5D1B1FC23856L,0x7F0A26A730F9E3L,0x1C38F85DB2A5CAL,0x76A753E17E6926L,0x2D39D1BE5AD0F9L,0x31733DFC651E4CL,0x3B0DED08L}; -const BIG CURVE_Pxba= {0xA1CDE711AD15D3L,0x853178DF6E16EDL,0x64BF43EA3E09A1L,0x2D8CD6DE566B2FL,0xF21C26C74FDB8BL,0x47BCC89E3F6B1EL,0x3FE2103F329F00L,0x4E507AF2AA28C3L,0x3EC27FADL}; -const BIG CURVE_Pxbb= {0x7AB2875EE0F480L,0x4556E43D6C4B8CL,0xFB22DF80E1CB99L,0xF70FD0122F1FFDL,0xD5DB25698EF5EAL,0x4805CE1AF1BA3AL,0x1DA7CE2E465CB7L,0xCA0799F7E65855L,0xA5B38DBL}; -const BIG CURVE_Pyaa= {0x86499314781AA0L,0x609DA303B70AB1L,0xA52A6145FC44BBL,0x462E04C42A3124L,0xC383AE19AE68BBL,0xA1B34F6BE4FCADL,0x198F901AD0BF4L,0x736C094362CED0L,0x5057F35DL}; -const BIG CURVE_Pyab= {0xBBEC57EEAE08FAL,0x78774BAA5F96ADL,0x64CAF099A42CA0L,0xC89FBBCCF70478L,0x6B720FEF855245L,0x97F916376F7B3EL,0x60F5587B5DF7E1L,0x61EE89637816BDL,0x2CE2B496L}; -const BIG CURVE_Pyba= {0x730276A5F0CC41L,0xF89325530AA1F5L,0xD9CD879AF8A147L,0xEE53E8A9FE2880L,0x420F07D3715390L,0x4C15D519B71F3AL,0x1A39DD3CB5B9B1L,0x3EE631A6BE39F8L,0x18070466L}; -const BIG CURVE_Pybb= {0xF1B2E6515C1CAEL,0xD40D355B0988DCL,0xC243FDC38A7772L,0x5D338136B675CAL,0x164E8A1D72FCDFL,0xBBAE5CD0961ACL,0xD6D04691771EB1L,0xD9BDEC8B792840L,0x499D14EAL}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS48286.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS48286.cpp deleted file mode 100644 index b7cff1d..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS48286.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_BLS48286.h" - -namespace BLS48286 { -/* Curve BLS48286 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B288_29; - -// Base Bits= 29 - -const int CURVE_Cof_I= 62958; -const BIG CURVE_Cof= {0xF5EE,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 10; -const BIG CURVE_B= {0xA,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x1D612C81,0x1E208D97,0x1CA5C07F,0x11E51045,0x1E4FE229,0x13154A7D,0x127B79AC,0x1602A6BF,0x86BC9E,0x0}; -const BIG CURVE_Gx= {0x95D59E0,0x44BF518,0x1BEE8577,0x1B2E8EB9,0xE84D19D,0xA23A0D2,0x103C1301,0x111F68ED,0x13D120DB,0x34B921}; -const BIG CURVE_Gy= {0x10ABEB43,0x177B4FCB,0x38F8BB,0x6F9CD6B,0x1B0AC1F2,0x1846F729,0x1E5E6A8C,0x5AF112F,0xA1E656E,0x101C720}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Bnx= {0xF5EF,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Pxaaa= {0x56106B5,0x20B1A4C,0x113303FA,0x187639D9,0x1D9F51AC,0xA96D657,0x132BADEA,0x1A544F60,0x531C71,0x11567EA}; -const BIG CURVE_Pxaab= {0x96D1A55,0xF668DEC,0xE2476A7,0x4EE30AA,0x1EF56B94,0x5192C97,0x121CF932,0x14B1A4A1,0x196B5C85,0xC6DDCC}; -const BIG CURVE_Pxaba= {0x7D7A35E,0x408D1D3,0x1162980E,0x1F5E9D19,0x12AF41C9,0xCD2835A,0x17875370,0x62F5C57,0x15DE0A7C,0x541496}; -const BIG CURVE_Pxabb= {0x2F023E8,0x14742906,0xCF4B428,0x3236B9E,0x1B62D89F,0x192E7AEF,0x1E4BA079,0x19B17763,0x155FAC94,0x1015F06}; -const BIG CURVE_Pxbaa= {0xF14CB9B,0x5CC6ADC,0x18955362,0x142FAC5F,0x11B96A21,0x18F7B6AA,0x96591F1,0xC5096A4,0x9A1E3F7,0xBA939B}; -const BIG CURVE_Pxbab= {0xB60DD54,0x1FB59436,0x1C68910E,0x10A65726,0x6BE9C0B,0x1C6AA6BF,0x14DD8358,0x1E68D885,0x85E9D59,0x880F52}; -const BIG CURVE_Pxbba= {0x19D776DA,0x1052D855,0x844D7E8,0xCAE4EC2,0x4ADABAA,0x120A2C5F,0x192AB537,0x3F9DEC1,0xE261FE4,0x7B037E}; -const BIG CURVE_Pxbbb= {0x8B50A8E,0x19FF11C1,0x18273AD7,0xEAA9DE4,0x1EC9A57,0x1670C91D,0x300009C,0xACD8A2D,0x6920D19,0xF85987}; -const BIG CURVE_Pyaaa= {0x7E988BE,0x1366AFEB,0x5E2F3B8,0x1FCBDF1D,0x114E8B31,0x1CD92A27,0x1A53FC0,0xAAF8FE7,0xDA962CD,0x10F87C6}; -const BIG CURVE_Pyaab= {0xDF11B92,0x1BC2B368,0x1AF17821,0x6663003,0xDB40CB8,0x20094F8,0x1856186E,0x1528744B,0x1EC6FED7,0x700E0F}; -const BIG CURVE_Pyaba= {0xBFDD06A,0x3E7D33D,0x13F96495,0x179B5611,0x12EB8E64,0xD7054C6,0xD7BFC95,0x145B3D76,0x18C3D6BE,0x9607FD}; -const BIG CURVE_Pyabb= {0x188A47F4,0x19EEFE9B,0x41ACCA2,0x12BF346C,0x11F157D1,0x19429C28,0x14D4ACD2,0x743BB7B,0x55BDFFF,0xAB418F}; -const BIG CURVE_Pybaa= {0x5E39E77,0x1B76DB9A,0x54E3132,0x190321FF,0x5119324,0x123E6F79,0x1064FB7D,0x1D69EBDE,0xAA01884,0x39C720}; -const BIG CURVE_Pybab= {0x164975C6,0x194140A1,0xA2302C0,0x1C495B39,0x613723B,0xB4D86D7,0x1A6F8686,0x7238A06,0x6896E24,0x9B2C3B}; -const BIG CURVE_Pybba= {0x1BF2D7C,0x1E99CD5E,0xEA89102,0xE27DE36,0x13837F1B,0xA2D04CE,0x23E06D8,0x18BDC695,0x175143C9,0xFD8541}; -const BIG CURVE_Pybbb= {0x51130A6,0x154D068F,0x18954F6A,0x173CE106,0x7C687EE,0xD23B3B5,0xB58CC3B,0x1342EEF6,0xDC6AC9E,0xC9F9BC}; - - -#endif - -#if CHUNK==64 - -using namespace B288_60; - -// Base Bits= 60 - -const int CURVE_Cof_I= 62958; -const BIG CURVE_Cof= {0xF5EEL,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 10; -const BIG CURVE_B= {0xAL,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0xFC411B2FD612C81L,0x98F28822F29701FL,0xB262A94FBE4FE22L,0x9EB01535FC9EDE6L,0x86BCL}; -const BIG CURVE_Gx= {0xC897EA3095D59E0L,0xDD97475CEFBA15DL,0x544741A4E84D19L,0xDB88FB476C0F04CL,0x6972433D120L}; -const BIG CURVE_Gy= {0xEEF69F970ABEB43L,0x237CE6B580E3E2EL,0x3308DEE53B0AC1FL,0x6E2D78897F979AAL,0x2038E40A1E65L}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Bnx= {0xF5EFL,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Pxaaa= {0x8416349856106B5L,0xCC3B1CECC4CC0FEL,0xA952DACAFD9F51AL,0x71D2A27B04CAEB7L,0x22ACFD40531CL}; -const BIG CURVE_Pxaab= {0xDECD1BD896D1A55L,0x427718553891DA9L,0xC8A32592FEF56B9L,0x85A58D250C873E4L,0x18DBB9996B5CL}; -const BIG CURVE_Pxaba= {0x8811A3A67D7A35EL,0x9FAF4E8CC58A603L,0xC19A506B52AF41CL,0x7C317AE2BDE1D4DL,0xA8292D5DE0AL}; -const BIG CURVE_Pxabb= {0x28E8520C2F023E8L,0xF191B5CF33D2D0AL,0xE725CF5DFB62D89L,0x94CD8BBB1F92E81L,0x202BE0D55FACL}; -const BIG CURVE_Pxbaa= {0x8B98D5B8F14CB9BL,0x1A17D62FE2554D8L,0xC71EF6D551B96A2L,0xF76284B52259647L,0x17527369A1E3L}; -const BIG CURVE_Pxbab= {0xBF6B286CB60DD54L,0xB8532B9371A2443L,0x638D54D7E6BE9C0L,0x59F346C42D3760DL,0x1101EA485E9DL}; -const BIG CURVE_Pxbba= {0x20A5B0AB9D776DAL,0xA657276121135FAL,0xDE41458BE4ADABAL,0xE41FCEF60E4AAD4L,0xF606FCE261FL}; -const BIG CURVE_Pxbbb= {0xF3FE23828B50A8EL,0x77554EF2609CEB5L,0x72CE1923A1EC9A5L,0x19566C5168C0002L,0x1F0B30E6920DL}; -const BIG CURVE_Pyaaa= {0x26CD5FD67E988BEL,0x1FE5EF8E978BCEEL,0x39B2544F14E8B3L,0xCD557C7F38694FFL,0x21F0F8CDA962L}; -const BIG CURVE_Pyaab= {0x778566D0DF11B92L,0x83331801EBC5E08L,0xB840129F0DB40CBL,0xD7A943A25E15861L,0xE01C1FEC6FEL}; -const BIG CURVE_Pyaba= {0x47CFA67ABFDD06AL,0x4BCDAB08CFE5925L,0x55AE0A98D2EB8E6L,0xBEA2D9EBB35EFF2L,0x12C0FFB8C3D6L}; -const BIG CURVE_Pyabb= {0xB3DDFD3788A47F4L,0x195F9A36106B328L,0x4B28538511F157DL,0xFF3A1DDBDD352B3L,0x156831E55BDFL}; -const BIG CURVE_Pybaa= {0xB6EDB7345E39E77L,0x4C8190FF9538C4CL,0xF647CDEF2511932L,0x84EB4F5EF4193EDL,0x738E40AA018L}; -const BIG CURVE_Pybab= {0x3282814364975C6L,0xBE24AD9CA88C0B0L,0x1969B0DAE613723L,0x24391C50369BE1AL,0x13658766896EL}; -const BIG CURVE_Pybba= {0xBD339ABC1BF2D7CL,0xB713EF1B3AA2440L,0x6145A099D3837F1L,0xC9C5EE34A88F81BL,0x1FB0A8375143L}; -const BIG CURVE_Pybbb= {0xAA9A0D1E51130A6L,0xEB9E708362553DAL,0xEDA47676A7C687EL,0x9E9A1777B2D6330L,0x193F378DC6ACL}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS48556.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS48556.cpp deleted file mode 100644 index efce0cb..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS48556.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_BLS48556.h" - -namespace BLS48556 { -/* Curve BLS48556 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B560_29; - -// Base Bits= 29 - -const int CURVE_Cof_I=0; -const int CURVE_B_I= 17; -const BIG CURVE_B= {0x11,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x1,0x17FFF800,0xA769C21,0x8AA813C,0x2029C21,0xA68F58B,0xB6307F4,0x1184DA51,0x6DFED78,0x1A3C85E9,0x571037B,0x1637F1F9,0x1C465FB0,0x98354B9,0x118DF17A,0x1422355D,0x43BF73E,0x6,0x0,0x0}; -const BIG CURVE_Gx= {0x5D71D33,0x1943697B,0x18CB783F,0x1B00AA9F,0x1711EE0B,0x7F80B23,0x129FD8CC,0x1345E03F,0x9A80F66,0x7038173,0xC056511,0x142801F5,0x42B2C3A,0x1AF09869,0x7924166,0x8381264,0x957EDD7,0xBACAEDC,0xA27A4A1,0x13}; -const BIG CURVE_Gy= {0xA6ED83A,0x14D2D9FF,0xA29C33D,0x1B8972A9,0x6958677,0x19C8F547,0x1DED7E3E,0x14F9E3DC,0x18FB7229,0x27171C0,0x1551E32D,0xE6184CC,0x6260E3C,0x733D204,0x579C437,0x1534665C,0x2B3349D,0x3162FD7,0xB634253,0x1}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Bnx= {0x1DE40020,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Cof= {0x1DE4001F,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -//const BIG CURVE_Cof= {0x1F12ABEB,0x516887B,0x5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Pxaaa= {0x923CE4A,0x14697474,0xAE04F4A,0x17AE205A,0x1313A20C,0x10B2EC50,0x18DF074F,0x15FE3FE8,0x7C90B98,0x959BF85,0xE57BD37,0x14376C96,0xBF57375,0xE20B625,0x12EE2172,0x1CBBCE85,0x1A5D9487,0xD0E024B,0x195E3602,0x1C}; -const BIG CURVE_Pxaab= {0xC0A1BE1,0x138E6E2D,0x1DF5FDC,0x151FC760,0x33972C5,0x56AA3C2,0x2491D8C,0x115B9FD7,0x140A11FA,0x1873AE35,0x1F259C26,0x74B0647,0x12D18B04,0x4672431,0x1C27F419,0x1CAA4D35,0x18DB48B6,0x13A54BDA,0x5080497,0x5}; -const BIG CURVE_Pxaba= {0x170C5DC4,0x11D39263,0x16B3BCB6,0x152C95BB,0x19BEC736,0x8849A12,0x49AB2A8,0xC7162D3,0xC58CD55,0x15C2659,0x11EE8B90,0xB40CAFC,0xE233167,0x7BEC8BE,0x129335BD,0x151C7DBB,0x78B689B,0x1B6B8EED,0x14BFBE3D,0x16}; -const BIG CURVE_Pxabb= {0x1A64B740,0x6B14B34,0x12481578,0x23FA931,0x323ADD1,0x206B82A,0xD789E1B,0x1FCFA666,0x1F4EEA7,0xF1E39E2,0x1968610,0xAF3EBD3,0x590D3B,0xDA0C35A,0x17306AAF,0xCF9DD2B,0x3F63B1A,0x96FF2F9,0xE102A76,0x12}; -const BIG CURVE_Pxbaa= {0x12F1E01F,0xDD8630B,0x12C29802,0x186239A6,0x19218788,0x4C87D1,0x16AE2501,0x775C076,0x870C80B,0x1A394429,0x1637D478,0x4A420E8,0x1C3AD4D4,0x10E5E713,0x111E6AD5,0x514FCF0,0x7CC49D3,0xC678A2,0x1787BDFD,0x1B}; -const BIG CURVE_Pxbab= {0x637383D,0x1851C11C,0x661F866,0x14404A7F,0x15D3D212,0x9AE28F6,0x8051F25,0x1E1CE2BF,0x137D882F,0xB231CEB,0xA8DB8FC,0x18957645,0x5E54DA8,0x1FF41C44,0x1A297414,0x17E1CBC5,0x1014F91F,0x4282AB7,0xB6CE9E3,0x10}; -const BIG CURVE_Pxbba= {0x1711939C,0xB41ED9E,0x69066BA,0x137CA3AD,0xCF2F6C0,0x5E6DAB9,0x2CE1323,0x946E448,0xF353D1C,0x14D9919F,0x46B7046,0x1A12015,0x3D6070,0x18C3E8D2,0x1F23BA45,0x1F1A337C,0x435A9CC,0x6CA1DF1,0x8A9CE1,0x15}; -const BIG CURVE_Pxbbb= {0x56F4899,0x196A0854,0xA959750,0x38A3D72,0x190BC9BC,0x145752BC,0x1E9E26DA,0x1403F88,0x71895E3,0x14162F5D,0x19FEC5FF,0x14190B16,0x7597C,0x19A3CF18,0x26A4B00,0x113D1BB6,0x7857A32,0xE0B78AB,0x1DD51E0F,0x1B}; -const BIG CURVE_Pyaaa= {0x14137844,0x1704BE7D,0x1FD3CCDD,0x189D8C93,0x1C768851,0xF5C37D5,0xE29C659,0x20AB1C1,0xF8896E0,0x1E08663E,0x1D1D539C,0x117E1C47,0x156CDD39,0x161F1017,0x143E8C72,0x174B22FD,0x18706190,0x49AA47E,0x19BB42E1,0xE}; -const BIG CURVE_Pyaab= {0xDC83190,0x12F19247,0x1AA26424,0x15D55E88,0xC418D32,0xB0E91DD,0x47CBFF7,0x2D992C1,0xDE03C1F,0x7694AE5,0x5C741A2,0x1D423AC6,0x5E02B9E,0x1E903F10,0x4EA6513,0x433A1F1,0x8EFA1C4,0xED54713,0x1E72CE4F,0x4}; -const BIG CURVE_Pyaba= {0x1985C0D,0xEE2FE82,0x64770FA,0x11A809B4,0x1483ACE9,0x18BCD2FA,0x171F32C,0x1612D58D,0x1E658341,0x1CBE2201,0x186E971,0x73F0E1,0xB0A5F40,0xAC90FB0,0x1635E008,0x237498B,0x1F3140D6,0xBF789A9,0x1166F259,0x1A}; -const BIG CURVE_Pyabb= {0x159D42F8,0x1B7F0540,0x45895D7,0x14875FA2,0x1E9E7F2B,0x10139D87,0x10F3FD7D,0x11D3717F,0x69E5006,0xF9BB3C4,0x13C9ED8D,0x16516DA,0x102F51DE,0x2725FEC,0x1F125B66,0xFFC324,0x1ED80731,0x1C16C4D,0x383AAA8,0x14}; -const BIG CURVE_Pybaa= {0x1F38039F,0x6A8959C,0x13C68984,0x11DD12AF,0x58093CF,0x1C8550A0,0xFFA1622,0xFF85979,0x1F2ABB75,0x18862E62,0x1EB6A2C9,0x1EC80B64,0x8EC2F18,0xE7BF713,0xC36B65A,0x19C5DD89,0x18A1D1AB,0xF772C8D,0xC11927C,0x5}; -const BIG CURVE_Pybab= {0x95F7865,0x134F0379,0x1CE9A0E,0x17E0EADD,0x1DACADD7,0x1B18F9F8,0x181D3943,0x186679A,0x2505BB0,0x1FDF1DC8,0x11B36A49,0x11E254E9,0xA438576,0x102B09AE,0x139984F4,0x15BC0233,0x1B6F180E,0x960562B,0x48CA65B,0x6}; -const BIG CURVE_Pybba= {0x7CC1979,0xEC1D4FB,0x1D89E6F0,0x955F38E,0x1635FDA9,0x123D8E10,0x10076209,0x494404A,0xD733D7,0x17678BCF,0x153841F9,0x10696FFD,0x5BC9FE8,0x1A20D8B2,0xE22EC9D,0x18449116,0x108C86C5,0x1B4CD720,0x34967,0x19}; -const BIG CURVE_Pybbb= {0xFC9F25B,0x7E44AB1,0xE9AB5D3,0x589F00D,0x1C9D264F,0xC7478B4,0x16B24A13,0x1D2C146B,0xEF84D9A,0xF47ECDE,0x1BFEE16A,0x1B69071E,0x11AB4C1C,0xBE9D9EF,0x390F005,0x78C8288,0x1B9BF549,0x9320730,0x3D84D97,0x14}; - - -#endif - -#if CHUNK==64 - -using namespace B560_58; - -// Base Bits= 58 - -const int CURVE_Cof_I=0; -const int CURVE_B_I= 17; -const BIG CURVE_B= {0x11L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x2FFFF0000000001L,0x11550278A769C21L,0x14D1EB162029C21L,0x2309B4A2B6307F4L,0x34790BD26DFED78L,0x2C6FE3F2571037BL,0x1306A973C465FB0L,0x28446ABB18DF17AL,0xC43BF73EL,0x0L}; -const BIG CURVE_Gx= {0x3286D2F65D71D33L,0x3601553F8CB783FL,0xFF01647711EE0BL,0x268BC07F29FD8CCL,0xE0702E69A80F66L,0x285003EAC056511L,0x35E130D242B2C3AL,0x107024C87924166L,0x17595DB8957EDD7L,0x26A27A4A1L}; -const BIG CURVE_Gy= {0x29A5B3FEA6ED83AL,0x3712E552A29C33DL,0x3391EA8E6958677L,0x29F3C7B9DED7E3EL,0x4E2E3818FB7229L,0x1CC30999551E32DL,0xE67A4086260E3CL,0x2A68CCB8579C437L,0x62C5FAE2B3349DL,0x2B634253L}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Bnx= {0x7DE40020L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Cof= {0x7DE4001FL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -//const BIG CURVE_Cof= {0xA2D10F7F12ABEBL,0x5L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Pxaaa= {0x28D2E8E8923CE4AL,0x2F5C40B4AE04F4AL,0x2165D8A1313A20CL,0x2BFC7FD18DF074FL,0x12B37F0A7C90B98L,0x286ED92CE57BD37L,0x1C416C4ABF57375L,0x39779D0B2EE2172L,0x1A1C0497A5D9487L,0x3995E3602L}; -const BIG CURVE_Pxaab= {0x271CDC5AC0A1BE1L,0x2A3F8EC01DF5FDCL,0xAD5478433972C5L,0x22B73FAE2491D8CL,0x30E75C6B40A11FAL,0xE960C8FF259C26L,0x8CE48632D18B04L,0x39549A6BC27F419L,0x274A97B58DB48B6L,0xA5080497L}; -const BIG CURVE_Pxaba= {0x23A724C770C5DC4L,0x2A592B776B3BCB6L,0x110934259BEC736L,0x18E2C5A649AB2A8L,0x2B84CB2C58CD55L,0x168195F91EE8B90L,0xF7D917CE233167L,0x2A38FB7729335BDL,0x36D71DDA78B689BL,0x2D4BFBE3DL}; -const BIG CURVE_Pxabb= {0xD629669A64B740L,0x47F52632481578L,0x40D7054323ADD1L,0x3F9F4CCCD789E1BL,0x1E3C73C41F4EEA7L,0x15E7D7A61968610L,0x1B4186B40590D3BL,0x19F3BA577306AAFL,0x12DFE5F23F63B1AL,0x24E102A76L}; -const BIG CURVE_Pxbaa= {0x1BB0C6172F1E01FL,0x30C4734D2C29802L,0x990FA39218788L,0xEEB80ED6AE2501L,0x34728852870C80BL,0x94841D1637D478L,0x21CBCE27C3AD4D4L,0xA29F9E111E6AD5L,0x18CF1447CC49D3L,0x37787BDFDL}; -const BIG CURVE_Pxbab= {0x30A38238637383DL,0x288094FE661F866L,0x135C51ED5D3D212L,0x3C39C57E8051F25L,0x164639D737D882FL,0x312AEC8AA8DB8FCL,0x3FE838885E54DA8L,0x2FC3978BA297414L,0x850556F014F91FL,0x20B6CE9E3L}; -const BIG CURVE_Pxbba= {0x1683DB3D711939CL,0x26F9475A69066BAL,0xBCDB572CF2F6C0L,0x128DC8902CE1323L,0x29B3233EF353D1CL,0x342402A46B7046L,0x3187D1A403D6070L,0x3E3466F9F23BA45L,0xD943BE2435A9CCL,0x2A08A9CE1L}; -const BIG CURVE_Pxbbb= {0x32D410A856F4899L,0x7147AE4A959750L,0x28AEA57990BC9BCL,0x2807F11E9E26DAL,0x282C5EBA71895E3L,0x2832162D9FEC5FFL,0x33479E30007597CL,0x227A376C26A4B00L,0x1C16F1567857A32L,0x37DD51E0FL}; -const BIG CURVE_Pyaaa= {0x2E097CFB4137844L,0x313B1927FD3CCDDL,0x1EB86FABC768851L,0x4156382E29C659L,0x3C10CC7CF8896E0L,0x22FC388FD1D539CL,0x2C3E202F56CDD39L,0x2E9645FB43E8C72L,0x93548FD8706190L,0x1D9BB42E1L}; -const BIG CURVE_Pyaab= {0x25E3248EDC83190L,0x2BAABD11AA26424L,0x161D23BAC418D32L,0x5B3258247CBFF7L,0xED295CADE03C1FL,0x3A84758C5C741A2L,0x3D207E205E02B9EL,0x86743E24EA6513L,0x1DAA8E268EFA1C4L,0x9E72CE4FL}; -const BIG CURVE_Pyaba= {0x1DC5FD041985C0DL,0x2350136864770FAL,0x3179A5F5483ACE9L,0x2C25AB1A171F32CL,0x397C4403E658341L,0xE7E1C2186E971L,0x15921F60B0A5F40L,0x46E9317635E008L,0x17EF1353F3140D6L,0x35166F259L}; -const BIG CURVE_Pyabb= {0x36FE0A8159D42F8L,0x290EBF4445895D7L,0x20273B0FE9E7F2BL,0x23A6E2FF0F3FD7DL,0x1F37678869E5006L,0x2CA2DB53C9ED8DL,0x4E4BFD902F51DEL,0x1FF8649F125B66L,0x382D89BED80731L,0x28383AAA8L}; -const BIG CURVE_Pybaa= {0xD512B39F38039FL,0x23BA255F3C68984L,0x390AA14058093CFL,0x1FF0B2F2FFA1622L,0x310C5CC5F2ABB75L,0x3D9016C9EB6A2C9L,0x1CF7EE268EC2F18L,0x338BBB12C36B65AL,0x1EEE591B8A1D1ABL,0xAC11927CL}; -const BIG CURVE_Pybab= {0x269E06F295F7865L,0x2FC1D5BA1CE9A0EL,0x3631F3F1DACADD7L,0x30CCF3581D3943L,0x3FBE3B902505BB0L,0x23C4A9D31B36A49L,0x2056135CA438576L,0x2B78046739984F4L,0x12C0AC57B6F180EL,0xC48CA65BL}; -const BIG CURVE_Pybba= {0x1D83A9F67CC1979L,0x12ABE71DD89E6F0L,0x247B1C21635FDA9L,0x92880950076209L,0x2ECF179E0D733D7L,0x20D2DFFB53841F9L,0x3441B1645BC9FE8L,0x3089222CE22EC9DL,0x3699AE4108C86C5L,0x320034967L}; -const BIG CURVE_Pybbb= {0xFC89562FC9F25BL,0xB13E01AE9AB5D3L,0x18E8F169C9D264FL,0x3A5828D76B24A13L,0x1E8FD9BCEF84D9AL,0x36D20E3DBFEE16AL,0x17D3B3DF1AB4C1CL,0xF190510390F005L,0x12640E61B9BF549L,0x283D84D97L}; - - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS48581.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS48581.cpp deleted file mode 100644 index 77258c0..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BLS48581.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_BLS48581.h" - -namespace BLS48581 { -/* Curve BLS48581 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B584_29; - -//*** rom curve parameters ***** -// Base Bits= 29 -// Ate Bits= 33 -// G2 Table size= 36 - -const int CURVE_Cof_I= 0; -const BIG CURVE_Cof= {0x382,0xA,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 1; -const BIG CURVE_B= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0xD671C01,0x52FF37E,0x10936846,0x1CB328CF,0x103C4CCB,0x1E682B11,0x5AA171,0x6989924,0x741969D,0xB961737,0xFEB5AF2,0x16797C00,0x1387A3F0,0x6B631A,0x13305857,0xBC46753,0x925E288,0x11C37C5,0x0,0x0,0x0}; -const BIG CURVE_Gx= {0x115AF640,0x1E743991,0x79B630E,0x9B4BA74,0x11786CB7,0x1ED9B458,0x1BAF6F15,0xBB0B246,0x4584766,0x14EFB7CB,0x1154151A,0x1F73EEA8,0xBDBAEDF,0x3467B0D,0x15F83A1A,0xC1BC7E4,0x1F1E93F8,0x1D795B9E,0xB0D03CA,0x55EB36F,0x0}; -const BIG CURVE_Gy= {0x2587A70,0xDDAEF1F,0x49AD5DB,0x6F5DEF7,0x11B2E35F,0x1BE143B6,0x8BD21FD,0xB0987DE,0x1E80F678,0x1CC57729,0xEDEFBFE,0x16E41DEF,0x1279DD41,0x52974C8,0xF27BFAE,0x149114AA,0xD1FB398,0xFC359D1,0x1D94C7E4,0x19DFB489,0x0}; -const BIG CURVE_HTPC= {0x31193EC,0x1C9F85F0,0x1D6090C,0x5112C88,0x10D4620C,0x1F255473,0x1F5583B6,0x4F7AABD,0xCD0706B,0x14B125F7,0xECD8492,0x4D5AF8A,0xC755E26,0x2D4C018,0xB0B7761,0x1369CD4C,0x1FD42938,0x782EC54,0x17716BE5,0x1246919A,0x0}; - -const BIG CURVE_Bnx= {0x381,0xA,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Pxaaa= {0xCE8BFAB,0x1A7E85A5,0x85537B0,0xF2ECC64,0x1510317B,0x6C0248F,0x140C01,0x140C25E8,0x281A63C,0x168D4621,0x1BFDE6EA,0x1DE2AD88,0x64DB3A2,0xDE65BEF,0x1F1C0D13,0x1BD7577D,0x45A2775,0x11C11BFD,0x9E1C792,0xBAC2BB3,0x0}; -const BIG CURVE_Pxaab= {0x16B47C57,0x134D9B33,0x1E850FC5,0xAAD4035,0x30FFD75,0x1186CBCB,0x13C30F1D,0x1FF4C4A0,0x214A76A,0x15FF6F8B,0xE50E802,0xFE9C38,0xF6DA123,0x111F4A93,0x1B660385,0x1D164576,0x86ABC07,0x9034D87,0x13889614,0xF892E7D,0x0}; -const BIG CURVE_Pxaba= {0x55A3E6A,0x440AB65,0xCFC2D19,0x1E99BDAD,0x1D5FEA8E,0x1EFDDC3C,0x157C0A32,0x1E1A54DA,0xFFAE766,0xDE8C921,0x18058707,0x156B56D0,0x16957CCB,0x1BE53D36,0x1B2A6B88,0x178E7514,0x1853AD83,0x70D9750,0x663C4CD,0x3F998E0,0x0}; -const BIG CURVE_Pxabb= {0x1B7FEAFE,0xD3819E5,0x2F0FC2,0x171969D,0xCA5231,0x292BE10,0x51A30C7,0x16364F37,0xE6EC143,0x11F0E3BB,0x862A57D,0x1F17C198,0x1B92A393,0x1F2C10DB,0x16B18BC,0x17FD1EB3,0x12954D4,0x2E3C6C0,0x973AD86,0x17C44318,0x0}; -const BIG CURVE_Pxbaa= {0x13F8CCE5,0x1CE1D0E2,0x7532EDC,0x16BEE8D9,0x1AA80C65,0xAFE0C44,0x49D3EB5,0x9255CB1,0xC10B2EF,0x40CCEAD,0x6607E79,0xA70CD3,0x1F0E7C58,0x15AB3AF,0x1D742C59,0xC600F8C,0x4CAA9DD,0x1D1E2CC7,0x2CD644,0x717238C,0x0}; -const BIG CURVE_Pxbab= {0xA3C093A,0x10026C8A,0x138CDC3C,0x12C1221F,0xF097FC7,0xF8BBB09,0x175D656A,0x1738162B,0x1EB57B40,0x1AE944CB,0x77D8E0,0x6E8303,0x58677BB,0xBBD1E8D,0xD773BC2,0x111EF71E,0x1E4ECDA0,0x101F8988,0x1FAC1CE1,0x192D8EF2,0x0}; -const BIG CURVE_Pxbba= {0x750E057,0xB03F30,0x170CD539,0x16B61C40,0x2D63334,0x1F219261,0xCAAB472,0xBDF9E68,0x10FD0CAA,0x9D89E76,0x13BC47CA,0x16F4893,0x1908BA2C,0x1C295B6D,0x106CE744,0x1CCC1BD4,0x98908AE,0x1F80CBD2,0x118187B8,0x1736F2A3,0x0}; -const BIG CURVE_Pxbbb= {0x1BC6AE34,0x10CED007,0x5F0FE13,0x15E5F93D,0x1FC44E56,0x1EB575FC,0x116151E6,0x16FC561A,0x164A7190,0x1F94E7F9,0x1E33F2A4,0xE514FF3,0xF741719,0x3DA908E,0xA77BEBD,0x563CBAF,0xC4F4AAA,0x2941312,0xBECAF7B,0x104FAB84,0x0}; -const BIG CURVE_Pyaaa= {0xD2D7971,0x1F6E9FF2,0xB03FCC8,0xA025562,0x6D65904,0x15FBBF75,0x18F05666,0xDB15CA2,0xD90F733,0x17D13BA4,0x24188D6,0x86BF556,0x1B39EBFC,0x12BBF379,0x108E0166,0x4972316,0x16452F30,0xFD24B90,0x1B0DD6D7,0x1D6A66A,0x0}; -const BIG CURVE_Pyaab= {0x16CD5665,0xA38EDC9,0x1FF1EC44,0x16846A4B,0xE2E588,0x1D04BEBB,0x1877484B,0x11255649,0x12C5C3D1,0x121D8F8C,0xBEC25AC,0x65F97E7,0x1D729647,0xF37DD00,0x108AE8C9,0x1B856EB4,0x11815FCA,0xA26D329,0x5E783FC,0x509B8EB,0x0}; -const BIG CURVE_Pyaba= {0xA2A8474,0x1995293,0xEE3F79A,0x18F88DF8,0x52269CB,0x9AEA8D3,0x178BC307,0x194652BC,0x11515536,0xE874820,0x17DF5726,0xE0A288E,0x13A480D3,0x16AD88CE,0x1140C085,0x13DE585F,0x17036766,0x1F210F7D,0x17402148,0x166D4403,0x0}; -const BIG CURVE_Pyabb= {0x841589D,0x1109ED49,0x194CDCC5,0x7B17143,0x5E578FB,0x1ED281F7,0xE84359E,0xEE84EE1,0xDCED281,0x199FD20,0xB226C89,0x245A4E8,0xB0E710E,0x7711EEC,0x1B4CD837,0x563859B,0x1BD47876,0x144111FD,0x1887B701,0x15D84B48,0x0}; -const BIG CURVE_Pybaa= {0x2E50137,0x3C18FCC,0x13DE90FD,0xAFFBBBF,0x1137B088,0x9ACA2E,0x13D67D0C,0x9CA256C,0x8A1E2CA,0x111C66E7,0x16171DFE,0x2530AFD,0x159805F1,0xEC9DAD4,0x11506D0F,0xB44AA9B,0x1A5A8832,0x148B281F,0x88EA711,0x1A413AB4,0x0}; -const BIG CURVE_Pybab= {0xF90BEE4,0x776E2C6,0x1B3CE965,0xB3DB044,0x12B679DA,0xCC6553,0xE78EABF,0xF8301A2,0x1F6824F4,0x6138420,0xA0D083A,0x156EA09F,0x182E2055,0x1915AC4E,0x159BAC59,0x17208435,0x1D5AD537,0x1289E99C,0x115CDADE,0xFA1A06E,0x0}; -const BIG CURVE_Pybba= {0x1EB23986,0xA0FD757,0x6A98ACF,0x110802FB,0x13DCCC9E,0x7D31CFA,0x62D6ED0,0x118E964C,0x122C1FAB,0x11D14327,0x63D096B,0x10334DBF,0x15F14E4C,0xD8320A,0xD93F021,0x1F1400DE,0x1DFDD17A,0x112E1682,0x46F997A,0x112CECF0,0x0}; -const BIG CURVE_Pybbb= {0x132718B6,0x133FFE5B,0x1A71575,0x158CDD08,0x13F748E5,0x6C62559,0x1505CC0,0x7D8E324,0x1E1AD033,0x14E18F4B,0xCE8FE39,0x1D95352A,0x149B6EF8,0x728643A,0x1C501AFA,0x36BC0D1,0x7E84F98,0x9C9D2E0,0x1FE240A7,0x6BC4A49,0x0}; - -#endif - -#if CHUNK==64 - -using namespace B584_60; - -// Base Bits= 60 -// Ate Bits= 33 -// G2 Table size= 36 - -const int CURVE_Cof_I= 0; -const BIG CURVE_Cof= {0x140000382L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 1; -const BIG CURVE_B= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x8A5FE6FCD671C01L,0xBE599467C24DA11L,0xC7CD0562303C4CCL,0x9D34C4C92016A85L,0xBC972C2E6E74196L,0x3F0B3CBE003FAD6L,0x615C0D6C635387AL,0xE2885E233A9CCC1L,0x2386F8A925L,0x0L}; -const BIG CURVE_Gx= {0xBCE8732315AF640L,0x74DA5D3A1E6D8C3L,0x57DB368B11786CBL,0x665D859236EBDBCL,0x46A9DF6F9645847L,0xEDFFB9F75445505L,0xE86868CF61ABDBAL,0x93F860DE3F257E0L,0x40F2BAF2B73DF1EL,0x2AF59B7AC3L}; -const BIG CURVE_Gy= {0xDBB5DE3E2587A70L,0xF37AEF7B926B576L,0xF77C2876D1B2E35L,0x78584C3EF22F487L,0xFFB98AEE53E80F6L,0xD41B720EF7BB7BEL,0xFEB8A52E991279DL,0xB398A488A553C9EL,0x31F91F86B3A2D1FL,0xCEFDA44F65L}; -const BIG CURVE_HTPC= {0x393F0BE031193ECL,0xC28896440758243L,0xDBE4AA8E70D4620L,0x6B27BD55EFD560EL,0x24A9624BEECD070L,0xE2626AD7C53B361L,0xDD845A98030C755L,0x29389B4E6A62C2DL,0x5AF94F05D8A9FD4L,0x92348CD5DCL}; -const BIG CURVE_Bnx= {0x140000381L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Pxaaa= {0x34FD0B4ACE8BFABL,0xB79766322154DECL,0x4D80491F510317L,0x3CA0612F4005030L,0xBAAD1A8C42281A6L,0x3A2EF156C46FF79L,0x344DBCCB7DE64DBL,0x2775DEBABBEFC70L,0x71E4A38237FA45AL,0x5D615D9A78L}; -const BIG CURVE_Pxaab= {0x669B36676B47C57L,0x5556A01AFA143F1L,0x7630D979630FFD7L,0x6AFFA62504F0C3CL,0xABFEDF16214A7L,0x12307F4E1C3943AL,0xE1623E9526F6DAL,0xBC07E8B22BB6D98L,0x258512069B0E86AL,0x7C4973ECE2L}; -const BIG CURVE_Pxaba= {0x488156CA55A3E6AL,0xEF4CDED6B3F0B46L,0xCBDFBB879D5FEA8L,0x66F0D2A6D55F028L,0xC1DBD19242FFAE7L,0xCCBAB5AB6860161L,0xAE237CA7A6D6957L,0xAD83BC73A8A6CA9L,0xF1334E1B2EA1853L,0x1FCCC70198L}; -const BIG CURVE_Pxabb= {0x9A7033CBB7FEAFEL,0x10B8CB4E80BC3F0L,0x1C5257C200CA523L,0x43B1B279B9468C3L,0x5F63E1C776E6EC1L,0x393F8BE0CC218A9L,0x62F3E5821B7B92AL,0x54D4BFE8F5985ACL,0xEB6185C78D80129L,0xBE2218C25CL}; -const BIG CURVE_Pxbaa= {0x39C3A1C53F8CCE5L,0x5B5F746C9D4CBB7L,0xD55FC1889AA80C6L,0xEF492AE589274FAL,0x9E48199D5AC10B2L,0xC5805386699981FL,0xB1642B5675FF0E7L,0xA9DD63007C675D0L,0x35913A3C598E4CAL,0x38B91C600BL}; -const BIG CURVE_Pxbab= {0x2004D914A3C093AL,0x7960910FCE3370FL,0xA9F177612F097FCL,0x40B9C0B15DD7595L,0x3835D28997EB57BL,0x7BB037418181DF6L,0xEF0977A3D1A5867L,0xCDA088F7B8F35DCL,0x738603F1311E4EL,0xC96C7797EBL}; -const BIG CURVE_Pxbba= {0x41607E60750E057L,0x4B5B0E205C3354EL,0xCBE4324C22D6333L,0xAA5EFCF3432AAD1L,0xF293B13CED0FD0CL,0xA2C0B7A449CEF11L,0x9D13852B6DB908BL,0x8AEE660DEA41B3L,0x61EE3F0197A4989L,0xB9B7951C60L}; -const BIG CURVE_Pxbbb= {0xE19DA00FBC6AE34L,0x6AF2FC9E97C3F84L,0x9BD6AEBF9FC44E5L,0x90B7E2B0D458547L,0xA93F29CFF364A71L,0x719728A7F9F8CFCL,0xFAF47B5211CF741L,0x4AAA2B1E5D7A9DEL,0x2BDEC5282624C4FL,0x827D5C22FBL}; -const BIG CURVE_Pyaaa= {0x3EDD3FE4D2D7971L,0x45012AB12C0FF32L,0x9ABF77EEA6D6590L,0x336D8AE5163C159L,0x35AFA27748D90F7L,0xBFC435FAAB09062L,0x59A577E6F3B39EL,0x2F3024B918B4238L,0x75B5DFA49721645L,0xEB53356C3L}; -const BIG CURVE_Pyaab= {0x1471DB936CD5665L,0x8B423525FFC7B11L,0x2FA097D760E2E58L,0xD1892AB24E1DD21L,0x6B243B1F192C5C3L,0x64732FCBF3AFB09L,0xA325E6FBA01D729L,0x5FCADC2B75A422BL,0xE0FF144DA653181L,0x284DC75979L}; -const BIG CURVE_Pyaba= {0x8332A526A2A8474L,0xBC7C46FC3B8FDE6L,0x1D35D51A652269CL,0x36CA3295E5E2F0CL,0xC99D0E904115155L,0xD370514475F7D5L,0x216D5B119D3A48L,0x67669EF2C2FC503L,0x8523E421EFB703L,0xB36A201DD0L}; -const BIG CURVE_Pyabb= {0x6213DA92841589DL,0xB3D8B8A1E533731L,0x7BDA503EE5E578FL,0x817742770BA10D6L,0x224333FA40DCED2L,0x10E122D2742C89BL,0x60DCEE23DD8B0E7L,0x78762B1C2CDED33L,0xEDC0688223FBBD4L,0xAEC25A4621L}; -const BIG CURVE_Pybaa= {0x47831F982E50137L,0x857FDDDFCF7A43FL,0x30135945D137B08L,0xCA4E512B64F59F4L,0x7FA238CDCE8A1E2L,0x5F1129857ED85C7L,0xB43DD93B5A95980L,0x88325A2554DC541L,0xA9C46916503FA5AL,0xD209D5A223L}; -const BIG CURVE_Pybab= {0x4EEDC58CF90BEE4L,0xA59ED8226CF3A59L,0xFC198CAA72B679DL,0xF47C180D139E3AAL,0xE8C270841F6824L,0x55AB7504FA8342L,0xB16722B589D82E2L,0xD537B90421AD66EL,0x36B7A513D339D5AL,0x7D0D037457L}; -const BIG CURVE_Pybba= {0xD41FAEAFEB23986L,0xE884017D9AA62B3L,0x40FA639F53DCCC9L,0xAB8C74B2618B5BBL,0x5AE3A2864F22C1FL,0xE4C819A6DF98F42L,0xC0841B064155F14L,0xD17AF8A006F364FL,0xE65EA25C2D05DFDL,0x896767811BL}; -const BIG CURVE_Pybbb= {0x667FFCB732718B6L,0x5AC66E84069C55DL,0xD8C4AB33F748EL,0x333EC7192054173L,0x8E69C31E97E1AD0L,0xEF8ECA9A9533A3FL,0x6BE8E50C87549B6L,0x4F981B5E068F140L,0x9029D393A5C07E8L,0x35E2524FF8L}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BN158.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BN158.cpp deleted file mode 100644 index 4dd5e9b..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BN158.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_BN158.h" - -namespace BN158 { - -/* Curve BN158 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B160_28; - -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 5; -const BIG CURVE_B= {0x5,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0xF04200D,0xD59F209,0xF73FA14,0x9953CF6,0x27628C,0x24012}; -const BIG CURVE_Gx= {0xB04E012,0x72280A,0xFD3FB95,0x9953CF6,0x27628C,0x24012}; -const BIG CURVE_Gy= {0x2,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Bnx= {0x801001,0x400,0x0,0x0,0x0,0x0}; -const BIG CURVE_Pxa= {0x33A5768,0x3B27650,0x3022922,0x1EECE2B,0xF882728,0x1EA35}; -const BIG CURVE_Pxb= {0x776A2F5,0x7B04ACE,0x14F9D68,0x5D05BA3,0x611EB92,0x23485}; -const BIG CURVE_Pya= {0x30CFE24,0x69AB26E,0xF92C435,0x1FB7A85,0xF906B6E,0x1C952}; -const BIG CURVE_Pyb= {0x8E8609D,0x9101773,0xA0F3EE2,0x8445B3B,0x9544ED8,0x23E28}; -const BIG CURVE_W[2]= {{0xA008003,0x3182600,0x600180,0x0,0x0,0x0},{0x1002001,0x800,0x0,0x0,0x0,0x0}}; -const BIG CURVE_SB[2][2]= {{{0xB00A004,0x3182E00,0x600180,0x0,0x0,0x0},{0x1002001,0x800,0x0,0x0,0x0,0x0}},{{0x1002001,0x800,0x0,0x0,0x0,0x0},{0x503A00A,0xA41CC09,0xF13F894,0x9953CF6,0x27628C,0x24012}}}; -const BIG CURVE_WB[4]= {{0x2801000,0x1080600,0x200080,0x0,0x0,0x0},{0x6815005,0xF907C02,0x2519090,0x120264,0x30,0x0},{0x380B003,0x7C84001,0x128C848,0x90132,0x18,0x0},{0x3803001,0x1080E00,0x200080,0x0,0x0,0x0}}; -const BIG CURVE_BB[4][4]= {{{0xE84100D,0xD59EE09,0xF73FA14,0x9953CF6,0x27628C,0x24012},{0xE84100C,0xD59EE09,0xF73FA14,0x9953CF6,0x27628C,0x24012},{0xE84100C,0xD59EE09,0xF73FA14,0x9953CF6,0x27628C,0x24012},{0x1002002,0x800,0x0,0x0,0x0,0x0}},{{0x1002001,0x800,0x0,0x0,0x0,0x0},{0xE84100C,0xD59EE09,0xF73FA14,0x9953CF6,0x27628C,0x24012},{0xE84100D,0xD59EE09,0xF73FA14,0x9953CF6,0x27628C,0x24012},{0xE84100C,0xD59EE09,0xF73FA14,0x9953CF6,0x27628C,0x24012}},{{0x1002002,0x800,0x0,0x0,0x0,0x0},{0x1002001,0x800,0x0,0x0,0x0,0x0},{0x1002001,0x800,0x0,0x0,0x0,0x0},{0x1002001,0x800,0x0,0x0,0x0,0x0}},{{0x801002,0x400,0x0,0x0,0x0,0x0},{0x2004002,0x1000,0x0,0x0,0x0,0x0},{0xE04000A,0xD59EA09,0xF73FA14,0x9953CF6,0x27628C,0x24012},{0x801002,0x400,0x0,0x0,0x0,0x0}}}; - -#endif - -#if CHUNK==64 - -using namespace B160_56; - -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L}; -const int CURVE_B_I= 5; -const BIG CURVE_B= {0x5L,0x0L,0x0L}; -const BIG CURVE_Order= {0xD59F209F04200DL,0x9953CF6F73FA14L,0x24012027628CL}; -const BIG CURVE_Gx= {0x72280AB04E012L,0x9953CF6FD3FB95L,0x24012027628CL}; -const BIG CURVE_Gy= {0x2L,0x0L,0x0L}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L}; - -const BIG CURVE_Bnx= {0x4000801001L,0x0L,0x0L}; -const BIG CURVE_Pxa= {0x3B2765033A5768L,0x1EECE2B3022922L,0x1EA35F882728L}; -const BIG CURVE_Pxb= {0x7B04ACE776A2F5L,0x5D05BA314F9D68L,0x23485611EB92L}; -const BIG CURVE_Pya= {0x69AB26E30CFE24L,0x1FB7A85F92C435L,0x1C952F906B6EL}; -const BIG CURVE_Pyb= {0x91017738E8609DL,0x8445B3BA0F3EE2L,0x23E289544ED8L}; -const BIG CURVE_W[2]= {{0x3182600A008003L,0x600180L,0x0L},{0x8001002001L,0x0L,0x0L}}; -const BIG CURVE_SB[2][2]= {{{0x3182E00B00A004L,0x600180L,0x0L},{0x8001002001L,0x0L,0x0L}},{{0x8001002001L,0x0L,0x0L},{0xA41CC09503A00AL,0x9953CF6F13F894L,0x24012027628CL}}}; -const BIG CURVE_WB[4]= {{0x10806002801000L,0x200080L,0x0L},{0xF907C026815005L,0x1202642519090L,0x30L},{0x7C84001380B003L,0x90132128C848L,0x18L},{0x1080E003803001L,0x200080L,0x0L}}; -const BIG CURVE_BB[4][4]= {{{0xD59EE09E84100DL,0x9953CF6F73FA14L,0x24012027628CL},{0xD59EE09E84100CL,0x9953CF6F73FA14L,0x24012027628CL},{0xD59EE09E84100CL,0x9953CF6F73FA14L,0x24012027628CL},{0x8001002002L,0x0L,0x0L}},{{0x8001002001L,0x0L,0x0L},{0xD59EE09E84100CL,0x9953CF6F73FA14L,0x24012027628CL},{0xD59EE09E84100DL,0x9953CF6F73FA14L,0x24012027628CL},{0xD59EE09E84100CL,0x9953CF6F73FA14L,0x24012027628CL}},{{0x8001002002L,0x0L,0x0L},{0x8001002001L,0x0L,0x0L},{0x8001002001L,0x0L,0x0L},{0x8001002001L,0x0L,0x0L}},{{0x4000801002L,0x0L,0x0L},{0x10002004002L,0x0L,0x0L},{0xD59EA09E04000AL,0x9953CF6F73FA14L,0x24012027628CL},{0x4000801002L,0x0L,0x0L}}}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BN254.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BN254.cpp deleted file mode 100644 index cfdb78d..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BN254.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_BN254.h" - -namespace BN254 { - -/* Curve BN254 - Pairing friendly BN curve */ - -/* Nogami's fast curve */ - -#if CHUNK==16 - -using namespace B256_13; - -const int CURVE_Cof_I=1; -const int CURVE_B_I= 2; -const BIG CURVE_B= {0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0xD,0x0,0x0,0x0,0xA10,0x8,0x0,0x0,0x1F80,0x1FFC,0x1,0x0,0x1800,0x1A26,0x6E8,0x0,0x0,0x412,0x8D9,0x4A}; -const BIG CURVE_Gx= {0x12,0x0,0x0,0x0,0x1A70,0x9,0x0,0x0,0x100,0x309,0x2,0x0,0x1800,0x1A26,0x6E8,0x0,0x0,0x412,0x8D9,0x4A}; -const BIG CURVE_Gy= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Bnx= {0x1,0x0,0x0,0x0,0x408,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Pxa= {0x1B2B,0x1F,0x932,0x1C84,0x191E,0x1F86,0x262,0x1769,0x48B,0x1523,0x1B6D,0x18C3,0x7E8,0x6C6,0x1FAE,0x16C5,0x119E,0x5DA,0x684,0xC}; -const BIG CURVE_Pxb= {0xCF3,0x1EAA,0x1079,0x1869,0x10D8,0x25B,0x18DE,0xD75,0xD74,0x18FA,0xA96,0x1305,0x18C5,0x553,0xCC4,0xF06,0x1A73,0x17CD,0x5AA,0xA}; -const BIG CURVE_Pya= {0xB9A,0xE69,0x1E24,0x1C0,0x119F,0x4DE,0x16F8,0x1CD7,0x1D0A,0x194D,0x88,0x1319,0x966,0x870,0xE6A,0x1268,0xBAF,0x1D03,0x625,0x4}; -const BIG CURVE_Pyb= {0xE9B,0x19D6,0x1B1A,0x1A35,0x18A2,0x4AB,0x1CE7,0x1FFA,0x1006,0x1D84,0x34D,0xBE7,0x56F,0x16A2,0x1A3D,0x2A4,0x1C8B,0x1873,0xECA,0x1D}; -const BIG CURVE_W[2]= {{0x3,0x0,0x0,0x0,0x40,0x1,0x0,0x0,0x180,0x30C,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1,0x0,0x0,0x0,0x810,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_SB[2][2]= {{{0x4,0x0,0x0,0x0,0x850,0x1,0x0,0x0,0x180,0x30C,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1,0x0,0x0,0x0,0x810,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x1,0x0,0x0,0x0,0x810,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xA,0x0,0x0,0x0,0x9D0,0x7,0x0,0x0,0x1E00,0x1CF0,0x1,0x0,0x1800,0x1A26,0x6E8,0x0,0x0,0x412,0x8D9,0x4A}}}; -const BIG CURVE_WB[4]= {{0x0,0x0,0x0,0x0,0x408,0x0,0x0,0x0,0x80,0x104,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x5,0x0,0x0,0x0,0x14A8,0x2,0x0,0x0,0x700,0xE38,0x0,0x0,0x1800,0x1120,0xC4,0x0,0x0,0x0,0x0,0x0},{0x3,0x0,0x0,0x0,0xC58,0x1,0x0,0x0,0x380,0x71C,0x0,0x0,0xC00,0x890,0x62,0x0,0x0,0x0,0x0,0x0},{0x1,0x0,0x0,0x0,0xC18,0x0,0x0,0x0,0x80,0x104,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_BB[4][4]= {{{0xD,0x0,0x0,0x0,0x608,0x8,0x0,0x0,0x1F80,0x1FFC,0x1,0x0,0x1800,0x1A26,0x6E8,0x0,0x0,0x412,0x8D9,0x4A},{0xC,0x0,0x0,0x0,0x608,0x8,0x0,0x0,0x1F80,0x1FFC,0x1,0x0,0x1800,0x1A26,0x6E8,0x0,0x0,0x412,0x8D9,0x4A},{0xC,0x0,0x0,0x0,0x608,0x8,0x0,0x0,0x1F80,0x1FFC,0x1,0x0,0x1800,0x1A26,0x6E8,0x0,0x0,0x412,0x8D9,0x4A},{0x2,0x0,0x0,0x0,0x810,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x1,0x0,0x0,0x0,0x810,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xC,0x0,0x0,0x0,0x608,0x8,0x0,0x0,0x1F80,0x1FFC,0x1,0x0,0x1800,0x1A26,0x6E8,0x0,0x0,0x412,0x8D9,0x4A},{0xD,0x0,0x0,0x0,0x608,0x8,0x0,0x0,0x1F80,0x1FFC,0x1,0x0,0x1800,0x1A26,0x6E8,0x0,0x0,0x412,0x8D9,0x4A},{0xC,0x0,0x0,0x0,0x608,0x8,0x0,0x0,0x1F80,0x1FFC,0x1,0x0,0x1800,0x1A26,0x6E8,0x0,0x0,0x412,0x8D9,0x4A}},{{0x2,0x0,0x0,0x0,0x810,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1,0x0,0x0,0x0,0x810,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1,0x0,0x0,0x0,0x810,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1,0x0,0x0,0x0,0x810,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x2,0x0,0x0,0x0,0x408,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x2,0x0,0x0,0x0,0x1020,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xA,0x0,0x0,0x0,0x200,0x8,0x0,0x0,0x1F80,0x1FFC,0x1,0x0,0x1800,0x1A26,0x6E8,0x0,0x0,0x412,0x8D9,0x4A},{0x2,0x0,0x0,0x0,0x408,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}}; - - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -const int CURVE_Cof_I=1; -const int CURVE_B_I= 2; -const BIG CURVE_B= {0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0xD,0x0,0x10A1,0x8000000,0x7FF9F,0x8000000,0x1BA344D,0x4000000,0x5236482,0x2}; -const BIG CURVE_Gx= {0x12,0x0,0x13A7,0x0,0x86121,0x8000000,0x1BA344D,0x4000000,0x5236482,0x2}; -const BIG CURVE_Gy= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Bnx= {0x1,0x8000000,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Pxa= {0x803FB2B,0xEE4224C,0x8BF0D91,0x8BBB489,0xDB6A464,0x7E8C61E,0xFEB8D8C,0x519EB62,0x61A10BB,0x0}; -const BIG CURVE_Pxb= {0x7D54CF3,0x8C34C1E,0x784B70D,0x746BAE3,0xA5B1F4D,0x8C5982A,0x3310AA7,0xBA73783,0x516AAF9,0x0}; -const BIG CURVE_Pya= {0x1CD2B9A,0xF0E0789,0xE09BD19,0xAE6BDB,0x22329BD,0x96698C8,0x39A90E0,0x6BAF934,0x21897A0,0x0}; -const BIG CURVE_Pyb= {0xB3ACE9B,0x2D1AEC6,0x9C9578A,0x6FFD73,0xD37B090,0x56F5F38,0x68F6D44,0x7C8B152,0xEBB2B0E,0x0}; -const BIG CURVE_W[2]= {{0x3,0x0,0x204,0x8000000,0x6181,0x0,0x0,0x0,0x0,0x0},{0x1,0x0,0x81,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_SB[2][2]= {{{0x4,0x0,0x285,0x8000000,0x6181,0x0,0x0,0x0,0x0,0x0},{0x1,0x0,0x81,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x1,0x0,0x81,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xA,0x0,0xE9D,0x0,0x79E1E,0x8000000,0x1BA344D,0x4000000,0x5236482,0x2}}}; -const BIG CURVE_WB[4]= {{0x0,0x8000000,0x40,0x8000000,0x2080,0x0,0x0,0x0,0x0,0x0},{0x5,0x8000000,0x54A,0x0,0x1C707,0x8000000,0x312241,0x0,0x0,0x0},{0x3,0x8000000,0x2C5,0x8000000,0xE383,0xC000000,0x189120,0x0,0x0,0x0},{0x1,0x8000000,0xC1,0x8000000,0x2080,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_BB[4][4]= {{{0xD,0x8000000,0x1060,0x8000000,0x7FF9F,0x8000000,0x1BA344D,0x4000000,0x5236482,0x2},{0xC,0x8000000,0x1060,0x8000000,0x7FF9F,0x8000000,0x1BA344D,0x4000000,0x5236482,0x2},{0xC,0x8000000,0x1060,0x8000000,0x7FF9F,0x8000000,0x1BA344D,0x4000000,0x5236482,0x2},{0x2,0x0,0x81,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x1,0x0,0x81,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xC,0x8000000,0x1060,0x8000000,0x7FF9F,0x8000000,0x1BA344D,0x4000000,0x5236482,0x2},{0xD,0x8000000,0x1060,0x8000000,0x7FF9F,0x8000000,0x1BA344D,0x4000000,0x5236482,0x2},{0xC,0x8000000,0x1060,0x8000000,0x7FF9F,0x8000000,0x1BA344D,0x4000000,0x5236482,0x2}},{{0x2,0x0,0x81,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1,0x0,0x81,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1,0x0,0x81,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1,0x0,0x81,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x2,0x8000000,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x2,0x0,0x102,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xA,0x0,0x1020,0x8000000,0x7FF9F,0x8000000,0x1BA344D,0x4000000,0x5236482,0x2},{0x2,0x8000000,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}}; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I=1; -const int CURVE_B_I= 2; -const BIG CURVE_B= {0x2L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0xDL,0x800000000010A1L,0x8000000007FF9FL,0x40000001BA344DL,0x25236482L}; -const BIG CURVE_Gx= {0x12L,0x13A7L,0x80000000086121L,0x40000001BA344DL,0x25236482L}; -const BIG CURVE_Gy= {0x1L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Bnx= {0x80000000000001L,0x40L,0x0L,0x0L,0x0L}; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Pxa= {0xEE4224C803FB2BL,0x8BBB4898BF0D91L,0x7E8C61EDB6A464L,0x519EB62FEB8D8CL,0x61A10BBL}; -const BIG CURVE_Pxb= {0x8C34C1E7D54CF3L,0x746BAE3784B70DL,0x8C5982AA5B1F4DL,0xBA737833310AA7L,0x516AAF9L}; -const BIG CURVE_Pya= {0xF0E07891CD2B9AL,0xAE6BDBE09BD19L,0x96698C822329BDL,0x6BAF93439A90E0L,0x21897A0L}; -const BIG CURVE_Pyb= {0x2D1AEC6B3ACE9BL,0x6FFD739C9578AL,0x56F5F38D37B090L,0x7C8B15268F6D44L,0xEBB2B0EL}; -const BIG CURVE_W[2]= {{0x3L,0x80000000000204L,0x6181L,0x0L,0x0L},{0x1L,0x81L,0x0L,0x0L,0x0L}}; -const BIG CURVE_SB[2][2]= {{{0x4L,0x80000000000285L,0x6181L,0x0L,0x0L},{0x1L,0x81L,0x0L,0x0L,0x0L}},{{0x1L,0x81L,0x0L,0x0L,0x0L},{0xAL,0xE9DL,0x80000000079E1EL,0x40000001BA344DL,0x25236482L}}}; -const BIG CURVE_WB[4]= {{0x80000000000000L,0x80000000000040L,0x2080L,0x0L,0x0L},{0x80000000000005L,0x54AL,0x8000000001C707L,0x312241L,0x0L},{0x80000000000003L,0x800000000002C5L,0xC000000000E383L,0x189120L,0x0L},{0x80000000000001L,0x800000000000C1L,0x2080L,0x0L,0x0L}}; -const BIG CURVE_BB[4][4]= {{{0x8000000000000DL,0x80000000001060L,0x8000000007FF9FL,0x40000001BA344DL,0x25236482L},{0x8000000000000CL,0x80000000001060L,0x8000000007FF9FL,0x40000001BA344DL,0x25236482L},{0x8000000000000CL,0x80000000001060L,0x8000000007FF9FL,0x40000001BA344DL,0x25236482L},{0x2L,0x81L,0x0L,0x0L,0x0L}},{{0x1L,0x81L,0x0L,0x0L,0x0L},{0x8000000000000CL,0x80000000001060L,0x8000000007FF9FL,0x40000001BA344DL,0x25236482L},{0x8000000000000DL,0x80000000001060L,0x8000000007FF9FL,0x40000001BA344DL,0x25236482L},{0x8000000000000CL,0x80000000001060L,0x8000000007FF9FL,0x40000001BA344DL,0x25236482L}},{{0x2L,0x81L,0x0L,0x0L,0x0L},{0x1L,0x81L,0x0L,0x0L,0x0L},{0x1L,0x81L,0x0L,0x0L,0x0L},{0x1L,0x81L,0x0L,0x0L,0x0L}},{{0x80000000000002L,0x40L,0x0L,0x0L,0x0L},{0x2L,0x102L,0x0L,0x0L,0x0L},{0xAL,0x80000000001020L,0x8000000007FF9FL,0x40000001BA344DL,0x25236482L},{0x80000000000002L,0x40L,0x0L,0x0L,0x0L}}}; - - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BN254CX.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BN254CX.cpp deleted file mode 100644 index c24535a..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BN254CX.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_BN254CX.h" - -namespace BN254CX { - -/* Curve BN254CX - Pairing friendly BN curve */ - -/* CertiVox BN curve/field */ - - -#if CHUNK==16 - -using namespace B256_13; - -const int CURVE_Cof_I=1; -const int CURVE_B_I= 2; -const BIG CURVE_B= {0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x1F6D,0x1758,0x98D,0x381,0xBE1,0x367,0x1324,0x1DC1,0x1FD6,0x1621,0x19B4,0x14C6,0x1647,0x1EEF,0x16C2,0x541,0x870,0x0,0x0,0x48}; -const BIG CURVE_Gx= {0x15B2,0xDA,0x1BD7,0xC47,0x1BE6,0x1F70,0x24,0x1DC3,0x1FD6,0x1921,0x19B4,0x14C6,0x1647,0x1EEF,0x16C2,0x541,0x870,0x0,0x0,0x48}; -const BIG CURVE_Gy= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Bnx= {0x12B1,0x1E00,0x0,0x0,0x400,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Pxa= {0xAF5,0x1AFD,0x1B2,0x7D0,0x51C,0x1B14,0xE64,0x1CC3,0xFB8,0x4A2,0x10BC,0x1633,0x73C,0x90E,0x1E9C,0x1369,0x1F9A,0x12DB,0x1256,0x35}; -const BIG CURVE_Pxb= {0x1433,0xAF,0x183F,0xA00,0x1EDE,0x4A6,0xF68,0x1435,0x1A33,0xDD,0xD93,0x103E,0xD16,0x8E1,0x10FC,0xCC0,0x365,0x8,0xF4C,0xA}; -const BIG CURVE_Pya= {0x299,0x1B95,0x1AA5,0x642,0x683,0x427,0x1A8D,0x126D,0x1FF0,0x3CE,0x1019,0x1230,0x1FEF,0x35D,0xBB8,0xDF6,0x109E,0xB85,0x1C9E,0x2A}; -const BIG CURVE_Pyb= {0x8CD,0x24F,0x7E7,0x1782,0x1C41,0x10D6,0x681,0xC12,0x5,0x1699,0x59,0xC0E,0x17F5,0x1DEB,0x1F55,0x313,0x2AC,0xB60,0xF2D,0x23}; -const BIG CURVE_W[2]= {{0xB83,0x117F,0x1245,0x8C6,0x5,0x1C09,0xD00,0x1,0x0,0x300,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x561,0x1C01,0x1,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_SB[2][2]= {{{0x10E4,0xD80,0x1247,0x8C6,0x805,0x1C09,0xD00,0x1,0x0,0x300,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x561,0x1C01,0x1,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x561,0x1C01,0x1,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x13EA,0x5D9,0x1748,0x1ABA,0xBDB,0x75E,0x623,0x1DC0,0x1FD6,0x1321,0x19B4,0x14C6,0x1647,0x1EEF,0x16C2,0x541,0x870,0x0,0x0,0x48}}}; -const BIG CURVE_WB[4]= {{0x4B0,0x13D4,0x615,0x1842,0x401,0x958,0xF00,0x0,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x475,0x1110,0x56F,0x1BF3,0x36C,0x1FCD,0x329,0x1DB5,0x1E94,0xE03,0xA83,0x10E0,0x0,0x0,0xC0,0x0,0x0,0x0,0x0,0x0},{0xB93,0x788,0x12B8,0xDF9,0x13B6,0x1FE6,0x1194,0xEDA,0x1F4A,0x1701,0x541,0x870,0x0,0x0,0x60,0x0,0x0,0x0,0x0,0x0},{0xA11,0xFD5,0x617,0x1842,0xC01,0x958,0xF00,0x0,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_BB[4][4]= {{{0xCBD,0x1958,0x98C,0x381,0x7E1,0x367,0x1324,0x1DC1,0x1FD6,0x1621,0x19B4,0x14C6,0x1647,0x1EEF,0x16C2,0x541,0x870,0x0,0x0,0x48},{0xCBC,0x1958,0x98C,0x381,0x7E1,0x367,0x1324,0x1DC1,0x1FD6,0x1621,0x19B4,0x14C6,0x1647,0x1EEF,0x16C2,0x541,0x870,0x0,0x0,0x48},{0xCBC,0x1958,0x98C,0x381,0x7E1,0x367,0x1324,0x1DC1,0x1FD6,0x1621,0x19B4,0x14C6,0x1647,0x1EEF,0x16C2,0x541,0x870,0x0,0x0,0x48},{0x562,0x1C01,0x1,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x561,0x1C01,0x1,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xCBC,0x1958,0x98C,0x381,0x7E1,0x367,0x1324,0x1DC1,0x1FD6,0x1621,0x19B4,0x14C6,0x1647,0x1EEF,0x16C2,0x541,0x870,0x0,0x0,0x48},{0xCBD,0x1958,0x98C,0x381,0x7E1,0x367,0x1324,0x1DC1,0x1FD6,0x1621,0x19B4,0x14C6,0x1647,0x1EEF,0x16C2,0x541,0x870,0x0,0x0,0x48},{0xCBC,0x1958,0x98C,0x381,0x7E1,0x367,0x1324,0x1DC1,0x1FD6,0x1621,0x19B4,0x14C6,0x1647,0x1EEF,0x16C2,0x541,0x870,0x0,0x0,0x48}},{{0x562,0x1C01,0x1,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x561,0x1C01,0x1,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x561,0x1C01,0x1,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x561,0x1C01,0x1,0x0,0x800,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x12B2,0x1E00,0x0,0x0,0x400,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xAC2,0x1802,0x3,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1A0A,0x1B57,0x98B,0x381,0x3E1,0x367,0x1324,0x1DC1,0x1FD6,0x1621,0x19B4,0x14C6,0x1647,0x1EEF,0x16C2,0x541,0x870,0x0,0x0,0x48},{0x12B2,0x1E00,0x0,0x0,0x400,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}}; -#endif - -#if CHUNK==32 - -using namespace B256_28; - -const int CURVE_Cof_I=1; -const int CURVE_B_I= 2; -const BIG CURVE_B= {0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x6EB1F6D,0x11C0A63,0x906CEBE,0xD6EE0CC,0x6D2C43F,0x647A636,0xDB0BDDF,0x8702A0,0x4000000,0x2}; -const BIG CURVE_Gx= {0xC1B55B2,0x6623EF5,0x93EE1BE,0xD6EE180,0x6D3243F,0x647A636,0xDB0BDDF,0x8702A0,0x4000000,0x2}; -const BIG CURVE_Gy= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Bnx= {0x3C012B1,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Pxa= {0xB5FAAF5,0xC3E806C,0x9362851,0xB8E61B9,0x2F0944F,0x73CB19C,0xFA7121C,0x7F9A9B4,0xAC95A5B,0x1}; -const BIG CURVE_Pxb= {0xC15F433,0xE50060F,0xA094DED,0x33A1ABD,0x64C1BBA,0xD1681F3,0x43F11C2,0x365660,0x53D3001,0x0}; -const BIG CURVE_Pya= {0x772A299,0x33216A9,0x3484E68,0xF0936EA,0x6479DF,0xFEF9184,0x2EE06BB,0xB09E6FB,0x5727970,0x1}; -const BIG CURVE_Pyb= {0xC49E8CD,0x1BC11F9,0x61ADC4,0x56091A,0x166D320,0x7F56070,0xFD57BD7,0x2AC189,0x1BCB56C,0x1}; -const BIG CURVE_W[2]= {{0x62FEB83,0x5463491,0x381200,0xB4,0x6000,0x0,0x0,0x0,0x0,0x0},{0x7802561,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_SB[2][2]= {{{0xDB010E4,0x5463491,0x381280,0xB4,0x6000,0x0,0x0,0x0,0x0,0x0},{0x7802561,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x7802561,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xBB33EA,0xBD5D5D2,0x8CEBCBD,0xD6EE018,0x6D2643F,0x647A636,0xDB0BDDF,0x8702A0,0x4000000,0x2}}}; -const BIG CURVE_WB[4]= {{0x67A84B0,0x1C21185,0x12B040,0x3C,0x2000,0x0,0x0,0x0,0x0,0x0},{0xE220475,0xCDF995B,0xA7F9A36,0x94EDA8C,0xA0DC07E,0x8702,0x300000,0x0,0x0,0x0},{0xF10B93,0x66FCCAE,0x53FCD3B,0x4A76D46,0x506E03F,0x4381,0x180000,0x0,0x0,0x0},{0xDFAAA11,0x1C21185,0x12B0C0,0x3C,0x2000,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_BB[4][4]= {{{0x32B0CBD,0x11C0A63,0x906CE7E,0xD6EE0CC,0x6D2C43F,0x647A636,0xDB0BDDF,0x8702A0,0x4000000,0x2},{0x32B0CBC,0x11C0A63,0x906CE7E,0xD6EE0CC,0x6D2C43F,0x647A636,0xDB0BDDF,0x8702A0,0x4000000,0x2},{0x32B0CBC,0x11C0A63,0x906CE7E,0xD6EE0CC,0x6D2C43F,0x647A636,0xDB0BDDF,0x8702A0,0x4000000,0x2},{0x7802562,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x7802561,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x32B0CBC,0x11C0A63,0x906CE7E,0xD6EE0CC,0x6D2C43F,0x647A636,0xDB0BDDF,0x8702A0,0x4000000,0x2},{0x32B0CBD,0x11C0A63,0x906CE7E,0xD6EE0CC,0x6D2C43F,0x647A636,0xDB0BDDF,0x8702A0,0x4000000,0x2},{0x32B0CBC,0x11C0A63,0x906CE7E,0xD6EE0CC,0x6D2C43F,0x647A636,0xDB0BDDF,0x8702A0,0x4000000,0x2}},{{0x7802562,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x7802561,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x7802561,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x7802561,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x3C012B2,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xF004AC2,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xF6AFA0A,0x11C0A62,0x906CE3E,0xD6EE0CC,0x6D2C43F,0x647A636,0xDB0BDDF,0x8702A0,0x4000000,0x2},{0x3C012B2,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}}; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I=1; -const int CURVE_B_I= 2; -const BIG CURVE_B= {0x2L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x11C0A636EB1F6DL,0xD6EE0CC906CEBEL,0x647A6366D2C43FL,0x8702A0DB0BDDFL,0x24000000L}; -const BIG CURVE_Gx= {0x6623EF5C1B55B2L,0xD6EE18093EE1BEL,0x647A6366D3243FL,0x8702A0DB0BDDFL,0x24000000L}; -const BIG CURVE_Gy= {0x1L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Bnx= {0x3C012B1L,0x40L,0x0L,0x0L,0x0L}; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Pxa= {0xC3E806CB5FAAF5L,0xB8E61B99362851L,0x73CB19C2F0944FL,0x7F9A9B4FA7121CL,0x1AC95A5BL}; -const BIG CURVE_Pxb= {0xE50060FC15F433L,0x33A1ABDA094DEDL,0xD1681F364C1BBAL,0x36566043F11C2L,0x53D3001L}; -const BIG CURVE_Pya= {0x33216A9772A299L,0xF0936EA3484E68L,0xFEF918406479DFL,0xB09E6FB2EE06BBL,0x15727970L}; -const BIG CURVE_Pyb= {0x1BC11F9C49E8CDL,0x56091A061ADC4L,0x7F56070166D320L,0x2AC189FD57BD7L,0x11BCB56CL}; -const BIG CURVE_W[2]= {{0x546349162FEB83L,0xB40381200L,0x6000L,0x0L,0x0L},{0x7802561L,0x80L,0x0L,0x0L,0x0L}}; -const BIG CURVE_SB[2][2]= {{{0x5463491DB010E4L,0xB40381280L,0x6000L,0x0L,0x0L},{0x7802561L,0x80L,0x0L,0x0L,0x0L}},{{0x7802561L,0x80L,0x0L,0x0L,0x0L},{0xBD5D5D20BB33EAL,0xD6EE0188CEBCBDL,0x647A6366D2643FL,0x8702A0DB0BDDFL,0x24000000L}}}; -const BIG CURVE_WB[4]= {{0x1C2118567A84B0L,0x3C012B040L,0x2000L,0x0L,0x0L},{0xCDF995BE220475L,0x94EDA8CA7F9A36L,0x8702A0DC07EL,0x300000L,0x0L},{0x66FCCAE0F10B93L,0x4A76D4653FCD3BL,0x4381506E03FL,0x180000L,0x0L},{0x1C21185DFAAA11L,0x3C012B0C0L,0x2000L,0x0L,0x0L}}; -const BIG CURVE_BB[4][4]= {{{0x11C0A6332B0CBDL,0xD6EE0CC906CE7EL,0x647A6366D2C43FL,0x8702A0DB0BDDFL,0x24000000L},{0x11C0A6332B0CBCL,0xD6EE0CC906CE7EL,0x647A6366D2C43FL,0x8702A0DB0BDDFL,0x24000000L},{0x11C0A6332B0CBCL,0xD6EE0CC906CE7EL,0x647A6366D2C43FL,0x8702A0DB0BDDFL,0x24000000L},{0x7802562L,0x80L,0x0L,0x0L,0x0L}},{{0x7802561L,0x80L,0x0L,0x0L,0x0L},{0x11C0A6332B0CBCL,0xD6EE0CC906CE7EL,0x647A6366D2C43FL,0x8702A0DB0BDDFL,0x24000000L},{0x11C0A6332B0CBDL,0xD6EE0CC906CE7EL,0x647A6366D2C43FL,0x8702A0DB0BDDFL,0x24000000L},{0x11C0A6332B0CBCL,0xD6EE0CC906CE7EL,0x647A6366D2C43FL,0x8702A0DB0BDDFL,0x24000000L}},{{0x7802562L,0x80L,0x0L,0x0L,0x0L},{0x7802561L,0x80L,0x0L,0x0L,0x0L},{0x7802561L,0x80L,0x0L,0x0L,0x0L},{0x7802561L,0x80L,0x0L,0x0L,0x0L}},{{0x3C012B2L,0x40L,0x0L,0x0L,0x0L},{0xF004AC2L,0x100L,0x0L,0x0L,0x0L},{0x11C0A62F6AFA0AL,0xD6EE0CC906CE3EL,0x647A6366D2C43FL,0x8702A0DB0BDDFL,0x24000000L},{0x3C012B2L,0x40L,0x0L,0x0L,0x0L}}}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BN462.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BN462.cpp deleted file mode 100644 index ac358ab..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BN462.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_BN462.h" - -namespace BN462 { -/* Curve BN462 - Pairing friendly BN curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B464_28; - -//*** rom curve parameters ***** -// Base Bits= 28 -// Ate Bits= 118 -// G2 Table size= 125 - -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 5; -const BIG CURVE_B= {0x5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x10800D,0x1B007E,0x24,0xF7C0000,0xC7BF717,0xF6FF66F,0xFFFFFFF,0xC201F7F,0x2908EE1,0xD81,0xA000000,0xB7D9BFC,0x6FF0CF6,0xFFFFFFF,0x23FFF,0x8036012,0x2404}; -const BIG CURVE_Gx= {0x6B6980D,0x98D91F3,0xD70113C,0x372E5C,0xE79239C,0x416A0B1,0xBB4E69A,0x689DB1B,0x3CF4B2E,0xB3EDBEC,0x6F95F63,0xAC9264B,0x30160B9,0xBA34A0A,0x191FAD,0xD67EF25,0x21A6}; -const BIG CURVE_Gy= {0x6FB03DE,0xA5734D3,0x22ECAA8,0xC666006,0xF475432,0xE40EB80,0xDF11B8A,0x6E6AF77,0x5965042,0x7D788C6,0x42CCCFA,0x90EEDA8,0xA7432A4,0x2B33676,0x7F7ABB8,0xEA0460F,0x118}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Bnx= {0xFFFBFFF,0xFFFFFFF,0xFFFFFFF,0x1FFFF,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Pxa= {0xAE1E4DF,0x8E3D934,0x769546,0x6A8B488,0xAE1F0AA,0x92E0032,0x2699BAD,0x208F9AD,0x3820408,0xED61C91,0x7C1CD96,0x2E0337E,0xCBDC548,0xB38E3A8,0x8DDA0DF,0xCCC85B5,0x257}; -const BIG CURVE_Pxb= {0xA8CD283,0x108BA6A,0x50E9B73,0x59BF7E8,0xF50AF8B,0xB783718,0x6BAE555,0x8134DD8,0x84058B1,0xED91768,0x54730CB,0xC98E2A3,0x9566BA3,0x8EDCA84,0x99102AF,0x4343E85,0x1D2E}; -const BIG CURVE_Pya= {0xDB7154E,0x5B68DF0,0x7C3376E,0xE7B11D,0x3695A14,0xDAE32E0,0x1F41C9D,0xF1399A,0xB42FE81,0x3FA7A6B,0x706E23C,0xA035634,0x20809EC,0x517427A,0x22C1979,0x50439DA,0xA06}; -const BIG CURVE_Pyb= {0xCA2A93A,0x14CC552,0x93B9EBA,0xD537434,0x387AA68,0xA04EF87,0x7692444,0x725CC64,0xAB370FD,0x7B393F1,0xC69AC5,0x44D5E6B,0x306324D,0x2C8AE37,0x8CBE017,0xF0CBD43,0x73E}; -const BIG CURVE_W[2]= {{0x20003,0x6,0x0,0xFF00000,0xFF3FF7F,0xFFFFFFF,0xFFFFFFF,0x60017F,0x60,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xFFF7FFF,0xFFFFFFF,0xFFFFFFF,0x3FFFF,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_SB[2][2]= {{{0x28004,0x6,0x0,0xFEC0000,0xFF3FF77,0xFFFFFFF,0xFFFFFFF,0x60017F,0x60,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x11000E,0x1B007E,0x24,0xF780000,0xC7BF70F,0xF6FF66F,0xFFFFFFF,0xC201F7F,0x2908EE1,0xD81,0xA000000,0xB7D9BFC,0x6FF0CF6,0xFFFFFFF,0x23FFF,0x8036012,0x2404}},{{0xFFF7FFF,0xFFFFFFF,0xFFFFFFF,0x3FFFF,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x20003,0x6,0x0,0xFF00000,0xFF3FF7F,0xFFFFFFF,0xFFFFFFF,0x60017F,0x60,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}}; -const BIG CURVE_WB[4]= {{0x4000,0x2,0x0,0xFFE0000,0xFFBFFDB,0xFFFFFFF,0xFFFFFFF,0x20007F,0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xFFABFFB,0xFFCFFE3,0xFFFFFFF,0x29FFFF,0x800214,0x90,0x0,0xBFFF900,0xF6FF53F,0xFFFFFFF,0x5FFFFFF,0x4802400,0x300,0x0,0x0,0x0,0x0},{0xFFD3FFD,0xFFE7FF1,0xFFFFFFF,0x15FFFF,0x40010C,0x48,0x0,0xDFFFC80,0xFB7FA9F,0xFFFFFFF,0x2FFFFFF,0x2401200,0x180,0x0,0x0,0x0,0x0},{0xC001,0x2,0x0,0xFFA0000,0xFFBFFD3,0xFFFFFFF,0xFFFFFFF,0x20007F,0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_BB[4][4]= {{{0xFFFC000,0xFFFFFFF,0xFFFFFFF,0x1FFFF,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xFFFBFFF,0xFFFFFFF,0xFFFFFFF,0x1FFFF,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xFFFBFFF,0xFFFFFFF,0xFFFFFFF,0x1FFFF,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x11000F,0x1B007E,0x24,0xF780000,0xC7BF70F,0xF6FF66F,0xFFFFFFF,0xC201F7F,0x2908EE1,0xD81,0xA000000,0xB7D9BFC,0x6FF0CF6,0xFFFFFFF,0x23FFF,0x8036012,0x2404}},{{0xFFF7FFF,0xFFFFFFF,0xFFFFFFF,0x3FFFF,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x10C00E,0x1B007E,0x24,0xF7A0000,0xC7BF713,0xF6FF66F,0xFFFFFFF,0xC201F7F,0x2908EE1,0xD81,0xA000000,0xB7D9BFC,0x6FF0CF6,0xFFFFFFF,0x23FFF,0x8036012,0x2404},{0x10C00D,0x1B007E,0x24,0xF7A0000,0xC7BF713,0xF6FF66F,0xFFFFFFF,0xC201F7F,0x2908EE1,0xD81,0xA000000,0xB7D9BFC,0x6FF0CF6,0xFFFFFFF,0x23FFF,0x8036012,0x2404},{0x10C00E,0x1B007E,0x24,0xF7A0000,0xC7BF713,0xF6FF66F,0xFFFFFFF,0xC201F7F,0x2908EE1,0xD81,0xA000000,0xB7D9BFC,0x6FF0CF6,0xFFFFFFF,0x23FFF,0x8036012,0x2404}},{{0xFFF7FFE,0xFFFFFFF,0xFFFFFFF,0x3FFFF,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xFFF7FFF,0xFFFFFFF,0xFFFFFFF,0x3FFFF,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xFFF7FFF,0xFFFFFFF,0xFFFFFFF,0x3FFFF,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0xFFF7FFF,0xFFFFFFF,0xFFFFFFF,0x3FFFF,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x10C00F,0x1B007E,0x24,0xF7A0000,0xC7BF713,0xF6FF66F,0xFFFFFFF,0xC201F7F,0x2908EE1,0xD81,0xA000000,0xB7D9BFC,0x6FF0CF6,0xFFFFFFF,0x23FFF,0x8036012,0x2404},{0x11800F,0x1B007E,0x24,0xF740000,0xC7BF707,0xF6FF66F,0xFFFFFFF,0xC201F7F,0x2908EE1,0xD81,0xA000000,0xB7D9BFC,0x6FF0CF6,0xFFFFFFF,0x23FFF,0x8036012,0x2404},{0xFFF7FFD,0xFFFFFFF,0xFFFFFFF,0x3FFFF,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x10C00F,0x1B007E,0x24,0xF7A0000,0xC7BF713,0xF6FF66F,0xFFFFFFF,0xC201F7F,0x2908EE1,0xD81,0xA000000,0xB7D9BFC,0x6FF0CF6,0xFFFFFFF,0x23FFF,0x8036012,0x2404}}}; - -#endif - -#if CHUNK==64 - -using namespace B464_60; - -//*** rom curve parameters ***** -// Base Bits= 60 -// Ate Bits= 118 -// G2 Table size= 125 - -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 5; -const BIG CURVE_B= {0x5L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x401B007E010800DL,0x17F7C0000000002L,0xFFFF6FF66FC7BF7L,0x8EE1C201F7FFFFFL,0xD81290L,0xFF0CF6B7D9BFCA0L,0x23FFFFFFFFFF6L,0x24048036012L}; -const BIG CURVE_Gx= {0xC98D91F36B6980DL,0x9C0372E5CD70113L,0x69A416A0B1E7923L,0x4B2E689DB1BBB4EL,0x95F63B3EDBEC3CFL,0x160B9AC9264B6FL,0x191FADBA34A0A3L,0x21A6D67EF25L}; -const BIG CURVE_Gy= {0x8A5734D36FB03DEL,0x32C66600622ECAAL,0xB8AE40EB80F4754L,0x50426E6AF77DF11L,0xCCCFA7D788C6596L,0x7432A490EEDA842L,0x7F7ABB82B33676AL,0x118EA0460FL}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Bnx= {0xFFFFFFFFFFFBFFFL,0x4001FFFFFFFFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Cru= {0x401F80A801A401AL,0xDBF2E0000000002L,0xFFFF6FF597BBBF3L,0x9F0222029FFFFFFL,0xD81368L,0xFF08764BD65FC10L,0x23FFFFFFFFFF6L,0x24048036012L}; -const BIG CURVE_Pxa= {0x68E3D934AE1E4DFL,0xAA6A8B488076954L,0xBAD92E0032AE1F0L,0x408208F9AD2699L,0x1CD96ED61C91382L,0xBDC5482E0337E7CL,0x8DDA0DFB38E3A8CL,0x257CCC85B5L}; -const BIG CURVE_Pxb= {0x3108BA6AA8CD283L,0x8B59BF7E850E9B7L,0x555B783718F50AFL,0x58B18134DD86BAEL,0x730CBED91768840L,0x566BA3C98E2A354L,0x99102AF8EDCA849L,0x1D2E4343E85L}; -const BIG CURVE_Pya= {0xE5B68DF0DB7154EL,0x140E7B11D7C3376L,0xC9DDAE32E03695AL,0xFE810F1399A1F41L,0x6E23C3FA7A6BB42L,0x809ECA03563470L,0x22C1979517427A2L,0xA0650439DAL}; -const BIG CURVE_Pyb= {0xA14CC552CA2A93AL,0x68D53743493B9EBL,0x444A04EF87387AAL,0x70FD725CC647692L,0x69AC57B393F1AB3L,0x6324D44D5E6B0CL,0x8CBE0172C8AE373L,0x73EF0CBD43L}; -const BIG CURVE_W[2]= {{0x60020003L,0x7FFF00000000000L,0xFFFFFFFFFFFF3FFL,0x60060017FFFFFL,0x0L,0x0L,0x0L,0x0L},{0xFFFFFFFFFFF7FFFL,0x8003FFFFFFFFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}; -const BIG CURVE_SB[2][2]= {{{0x60028004L,0x77FEC0000000000L,0xFFFFFFFFFFFF3FFL,0x60060017FFFFFL,0x0L,0x0L,0x0L,0x0L},{0x401B007E011000EL,0xFF780000000002L,0xFFFF6FF66FC7BF7L,0x8EE1C201F7FFFFFL,0xD81290L,0xFF0CF6B7D9BFCA0L,0x23FFFFFFFFFF6L,0x24048036012L}},{{0xFFFFFFFFFFF7FFFL,0x8003FFFFFFFFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x60020003L,0x7FFF00000000000L,0xFFFFFFFFFFFF3FFL,0x60060017FFFFFL,0x0L,0x0L,0x0L,0x0L}}}; -const BIG CURVE_WB[4]= {{0x20004000L,0xDBFFE0000000000L,0xFFFFFFFFFFFFBFFL,0x20020007FFFFFL,0x0L,0x0L,0x0L,0x0L},{0xFFFCFFE3FFABFFBL,0x14029FFFFFFFFFFL,0x9008002L,0xF53FBFFF9000000L,0xFFFFFFFFFFFFF6FL,0x30048024005FL,0x0L,0x0L},{0xFFFE7FF1FFD3FFDL,0xC015FFFFFFFFFFL,0x4804001L,0xFA9FDFFFC800000L,0xFFFFFFFFFFFFFB7L,0x18024012002FL,0x0L,0x0L},{0x2000C001L,0xD3FFA0000000000L,0xFFFFFFFFFFFFBFFL,0x20020007FFFFFL,0x0L,0x0L,0x0L,0x0L}}; -const BIG CURVE_BB[4][4]= {{{0xFFFFFFFFFFFC000L,0x4001FFFFFFFFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0xFFFFFFFFFFFBFFFL,0x4001FFFFFFFFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0xFFFFFFFFFFFBFFFL,0x4001FFFFFFFFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x401B007E011000FL,0xFF780000000002L,0xFFFF6FF66FC7BF7L,0x8EE1C201F7FFFFFL,0xD81290L,0xFF0CF6B7D9BFCA0L,0x23FFFFFFFFFF6L,0x24048036012L}},{{0xFFFFFFFFFFF7FFFL,0x8003FFFFFFFFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x401B007E010C00EL,0x13F7A0000000002L,0xFFFF6FF66FC7BF7L,0x8EE1C201F7FFFFFL,0xD81290L,0xFF0CF6B7D9BFCA0L,0x23FFFFFFFFFF6L,0x24048036012L},{0x401B007E010C00DL,0x13F7A0000000002L,0xFFFF6FF66FC7BF7L,0x8EE1C201F7FFFFFL,0xD81290L,0xFF0CF6B7D9BFCA0L,0x23FFFFFFFFFF6L,0x24048036012L},{0x401B007E010C00EL,0x13F7A0000000002L,0xFFFF6FF66FC7BF7L,0x8EE1C201F7FFFFFL,0xD81290L,0xFF0CF6B7D9BFCA0L,0x23FFFFFFFFFF6L,0x24048036012L}},{{0xFFFFFFFFFFF7FFEL,0x8003FFFFFFFFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0xFFFFFFFFFFF7FFFL,0x8003FFFFFFFFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0xFFFFFFFFFFF7FFFL,0x8003FFFFFFFFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0xFFFFFFFFFFF7FFFL,0x8003FFFFFFFFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}},{{0x401B007E010C00FL,0x13F7A0000000002L,0xFFFF6FF66FC7BF7L,0x8EE1C201F7FFFFFL,0xD81290L,0xFF0CF6B7D9BFCA0L,0x23FFFFFFFFFF6L,0x24048036012L},{0x401B007E011800FL,0x7F740000000002L,0xFFFF6FF66FC7BF7L,0x8EE1C201F7FFFFFL,0xD81290L,0xFF0CF6B7D9BFCA0L,0x23FFFFFFFFFF6L,0x24048036012L},{0xFFFFFFFFFFF7FFDL,0x8003FFFFFFFFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x401B007E010C00FL,0x13F7A0000000002L,0xFFFF6FF66FC7BF7L,0x8EE1C201F7FFFFFL,0xD81290L,0xFF0CF6B7D9BFCA0L,0x23FFFFFFFFFF6L,0x24048036012L}}}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BRAINPOOL.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BRAINPOOL.cpp deleted file mode 100644 index 93b5380..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_BRAINPOOL.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_BRAINPOOL.h" - -namespace BRAINPOOL { - -/* Brainpool Curve */ -/* Note that the original curve has been transformed to an isomorphic curve with A=-3 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0xEE92B04,0xE58101F,0xF49256A,0xEBC4AF2,0x6B7BF93,0x733D0B7,0x4FE66A7,0x30D84EA,0x62C61C4,0x6}; -const BIG CURVE_Order= {0x74856A7,0x1E0E829,0x1A6F790,0x7AA3B56,0xD718C39,0x909D838,0xC3E660A,0xA1EEA9B,0x9FB57DB,0xA}; -const BIG CURVE_Gx= {0xE1305F4,0xA191562,0xFBC2B79,0x42C47AA,0x149AFA1,0xB23A656,0x7732213,0xC1CFE7B,0x3E8EB3C,0xA}; -const BIG CURVE_Gy= {0xB25C9BE,0xABE8F35,0x27001D,0xB6DE39D,0x17E69BC,0xE146444,0xD7F7B22,0x3439C56,0xD996C82,0x2}; -const BIG CURVE_HTPC= {0x3BC7B16,0xBC14BB0,0xAE888EB,0x30D22DE,0xD959247,0xDF0183F,0x1737593,0xF0C052E,0x665C79C,0x6}; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0xE58101FEE92B04L,0xEBC4AF2F49256AL,0x733D0B76B7BF93L,0x30D84EA4FE66A7L,0x662C61C4L}; -const BIG CURVE_Order= {0x1E0E82974856A7L,0x7AA3B561A6F790L,0x909D838D718C39L,0xA1EEA9BC3E660AL,0xA9FB57DBL}; -const BIG CURVE_Gx= {0xA191562E1305F4L,0x42C47AAFBC2B79L,0xB23A656149AFA1L,0xC1CFE7B7732213L,0xA3E8EB3CL}; -const BIG CURVE_Gy= {0xABE8F35B25C9BEL,0xB6DE39D027001DL,0xE14644417E69BCL,0x3439C56D7F7B22L,0x2D996C82L}; -const BIG CURVE_HTPC= {0xBC14BB03BC7B16L,0x30D22DEAE888EBL,0xDF0183FD959247L,0xF0C052E1737593L,0x6665C79CL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C1174.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C1174.cpp deleted file mode 100644 index 072be5e..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C1174.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_C1174.h" - -namespace C1174 { - -/* Curve C1174 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_29; - -const int CURVE_Cof_I= 4; -const BIG CURVE_Cof= {0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= -1174; -const BIG CURVE_B= {0x1FFFFB61,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -const BIG CURVE_Order= {0x1166C971,0xA26A2FE,0x14C1CD22,0x12CB89BF,0x1FFFFF77,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFF}; -const BIG CURVE_Gx= {0x1CE29EDA,0x1091F93D,0xBB35945,0x3B2D492,0x1A190C02,0x1773E014,0x111E4D0E,0x19D4611,0x37FBB}; -const BIG CURVE_Gy= {0x1B46360E,0x6658DFC,0xFE5DAE9,0x5BDC55E,0xE0C4FE,0x208B4C2,0x1F31995A,0x105A8FF6,0x6B72F}; -const BIG CURVE_HTPC= {0x1FFFFFF6,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I= 4; -const BIG CURVE_Cof= {0x4L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= -1174; -const BIG CURVE_B= {0xFFFFFFFFFFFB61L,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0x7FFFFFFL}; -const BIG CURVE_Order= {0x44D45FD166C971L,0x65C4DFD3073489L,0xFFFFFFFFFFF779L,0xFFFFFFFFFFFFFFL,0x1FFFFFFL}; -const BIG CURVE_Gx= {0x123F27BCE29EDAL,0xD96A492ECD6516L,0xE7C029A190C021L,0xEA308C479343AEL,0x37FBB0CL}; -const BIG CURVE_Gy= {0xCCB1BF9B46360EL,0xDEE2AF3F976BA4L,0x1169840E0C4FE2L,0xD47FB7CC665684L,0x6B72F82L}; -const BIG CURVE_HTPC= {0xFFFFFFFFFFFFF6L,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0x7FFFFFFL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C13318.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C13318.cpp deleted file mode 100644 index a7ca2a5..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C13318.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_C13318.h" - -namespace C13318 { - -/* C13318 */ - -#if CHUNK==16 -/* C13318 Curve */ -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_29; - -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 13318; -const BIG CURVE_B= {0x3406,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0xDC2CBE3,0x1BE896E2,0x1AE345BA,0xCA9F07B,0xF4F,0x0,0x0,0x0,0x800000}; -const BIG CURVE_Gx= {0x5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Gy= {0xB6EAD0B,0x6469AA3,0x5B6D6E,0x1996099E,0x166369D4,0x18728B34,0x1BC4E058,0x1B24D794,0x6675AA}; -const BIG CURVE_HTPC= {0x507504F,0x13B86C9D,0x5FC8F18,0x31806AD,0x1EBD397A,0x264F7E,0x1E16569A,0x804FC1D,0x55C192}; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 13318; -const BIG CURVE_B= {0x3406L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x7D12DC4DC2CBE3L,0x54F83DEB8D16EBL,0xF4F6L,0x0L,0x80000000L}; -const BIG CURVE_Gx= {0x5L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Gy= {0xC8D3546B6EAD0BL,0xCB04CF016DB5B8L,0xE5166966369D4CL,0x26BCA6F1381630L,0x6675AAD9L}; -const BIG CURVE_HTPC= {0x770D93A507504FL,0x8C035697F23C62L,0x4C9EFDEBD397A1L,0x27E0EF8595A680L,0x55C19240L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C1665.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C1665.cpp deleted file mode 100644 index c7f513e..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C1665.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_C1665.h" - -namespace C1665 { - -/* Curve C1665 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B168_29; - -const int CURVE_Cof_I= 4; -const BIG CURVE_Cof= {0x4,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 5766; -const BIG CURVE_B= {0x1686,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x1DBA8B27,0x7F854C,0x1F57BC06,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -const BIG CURVE_Gx= {0x19D52398,0x138DCEDF,0x183D99B1,0x1340C31D,0x1A505B80,0xA64A6}; -const BIG CURVE_Gy= {0x4920345,0x3843D92,0x758B70B,0x77F8EE7,0x149BC0A1,0x14A0A2}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0}; -#endif - -#if CHUNK==64 - -using namespace B168_60; - -const int CURVE_Cof_I= 4; -const BIG CURVE_Cof= {0x4L,0x0L,0x0L}; -const int CURVE_B_I= 5766; -const BIG CURVE_B= {0x1686L,0x0L,0x0L}; -const BIG CURVE_Order= {0x80FF0A99DBA8B27L,0xFFFFFFFFFD5EF01L,0xFFFFFFFFFFFL}; -const BIG CURVE_Gx= {0x671B9DBF9D52398L,0x9A0618EE0F666CL,0x14C94DA505B8L}; -const BIG CURVE_Gy= {0xC7087B244920345L,0x13BFC7739D62DC2L,0x29414549BC0AL}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C25519.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C25519.cpp deleted file mode 100644 index 9dcf93b..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C25519.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_C25519.h" - -namespace C25519 { - -/* Curve 25519 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_29; - -const int CURVE_Cof_I=8; -const BIG CURVE_Cof= {0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x1CF5D3ED,0x9318D2,0x1DE73596,0x1DF3BD45,0x14D,0x0,0x0,0x0,0x100000}; -const BIG CURVE_Gx= {0x9}; -const BIG CURVE_HTPC= {0x507504F,0x13B86C9D,0x5FC8F18,0x31806AD,0x1EBD397A,0x264F7E,0x1E16569A,0x804FC1D,0x55C192}; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I=8; -const BIG CURVE_Cof= {0x8L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x12631A5CF5D3ED,0xF9DEA2F79CD658,0x14DE,0x0,0x10000000}; -const BIG CURVE_Gx= {0x9}; -const BIG CURVE_HTPC= {0x770D93A507504FL,0x8C035697F23C62L,0x4C9EFDEBD397A1L,0x27E0EF8595A680L,0x55C19240L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C41417.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C41417.cpp deleted file mode 100644 index 29331e6..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_C41417.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_C41417.h" - -namespace C41417 { - -/* Curve C41417 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B416_29; - -const int CURVE_Cof_I=8; -const BIG CURVE_Cof= {0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 3617; -const BIG CURVE_B= {0xE21,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x106AF79,0x18738D2F,0x18F3C606,0x1806715A,0x22B36F1,0xA67B830,0xCF32490,0x1FFFFFFD,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1F}; -const BIG CURVE_Gx= {0x13CBC595,0x7E9C097,0x14DF1931,0x14E7F550,0x1A111301,0x15A6B6B5,0xD526292,0x18FEAFFE,0x1F44C03E,0x1E6A31B4,0x70C9B97,0x43180C6,0x1443300,0x19A4828A,0x68}; -const BIG CURVE_Gy= {0x22,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_HTPC= {0x1FFFFFEE,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0xFF}; -#endif - -#if CHUNK==64 - -using namespace B416_60; - -const int CURVE_Cof_I=8; -const BIG CURVE_Cof= {0x8L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 3617; -const BIG CURVE_B= {0xE21L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0xB0E71A5E106AF79L,0x1C0338AD63CF181L,0x414CF706022B36FL,0xFFFFFFFFEB3CC92L,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0x7FFFFFFFFFFFFL}; -const BIG CURVE_Gx= {0x4FD3812F3CBC595L,0x1A73FAA8537C64CL,0x4AB4D6D6BA11130L,0x3EC7F57FF35498AL,0xE5FCD46369F44C0L,0x300218C0631C326L,0x1A334905141443L}; -const BIG CURVE_Gy= {0x22L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_HTPC= {0xFFFFFFFFFFFFFEEL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_Ed25519.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_Ed25519.cpp deleted file mode 100644 index da51d2e..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_Ed25519.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_Ed25519.h" - -namespace Ed25519 { - -/* Ed25519 */ - -#if CHUNK==16 -/* Ed25519 Curve */ - -using namespace B256_13; - -const int CURVE_Cof_I=8; -const BIG CURVE_Cof= {0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0x18A3,0x1ACB,0x1284,0x169B,0x175E,0xC55,0x507,0x9A8,0x100A,0x3,0x1A26,0xEF3,0x797,0x3A0,0xE33,0x1FCE,0xB6F,0x771,0xDB,0xA4}; -const BIG CURVE_Order= {0x13ED,0x7AE,0x697,0x4C6,0x581,0xE6B,0xBDE,0x1BD4,0x1EF9,0xA6,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20}; -const BIG CURVE_Gx= {0x151A,0x192E,0x1823,0xC5A,0xC95,0x13D9,0x1496,0xC12,0xCC7,0x349,0x1717,0x1BAD,0x31F,0x1271,0x1B02,0xA7F,0xD6E,0x169E,0x1A4D,0x42}; -const BIG CURVE_Gy= {0x658,0x1333,0x1999,0xCCC,0x666,0x1333,0x1999,0xCCC,0x666,0x1333,0x1999,0xCCC,0x666,0x1333,0x1999,0xCCC,0x666,0x1333,0x1999,0xCC}; -const BIG CURVE_HTPC= {0x104F,0x83A,0x4E9,0xE1B,0x627,0x191E,0x1A5F,0x6A,0x18C,0x1CBD,0x1AF4,0x1DFB,0x4C9,0x1340,0x1656,0x1DF0,0x7E0,0x1201,0x1064,0xAB}; -#endif - -#if CHUNK==32 - -using namespace B256_29; - -const int CURVE_Cof_I=8; -const BIG CURVE_Cof= {0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0x135978A3,0xF5A6E50,0x10762ADD,0x149A82,0x1E898007,0x3CBBBC,0x19CE331D,0x1DC56DFF,0x52036C}; -const BIG CURVE_Order= {0x1CF5D3ED,0x9318D2,0x1DE73596,0x1DF3BD45,0x14D,0x0,0x0,0x0,0x100000}; -const BIG CURVE_Gx= {0xF25D51A,0xAB16B04,0x969ECB2,0x198EC12A,0xDC5C692,0x1118FEEB,0xFFB0293,0x1A79ADCA,0x216936}; -const BIG CURVE_Gy= {0x6666658,0x13333333,0x19999999,0xCCCCCCC,0x6666666,0x13333333,0x19999999,0xCCCCCCC,0x666666}; -const BIG CURVE_HTPC= {0x507504F,0x13B86C9D,0x5FC8F18,0x31806AD,0x1EBD397A,0x264F7E,0x1E16569A,0x804FC1D,0x55C192}; - -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I=8; -const BIG CURVE_Cof= {0x8L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0xEB4DCA135978A3L,0xA4D4141D8AB75L,0x797779E8980070L,0x2B6FFE738CC740L,0x52036CEEL}; -const BIG CURVE_Order= {0x12631A5CF5D3EDL,0xF9DEA2F79CD658L,0x14DEL,0x0L,0x10000000L}; -const BIG CURVE_Gx= {0x562D608F25D51AL,0xC7609525A7B2C9L,0x31FDD6DC5C692CL,0xCD6E53FEC0A4E2L,0x216936D3L}; -const BIG CURVE_Gy= {0x66666666666658L,0x66666666666666L,0x66666666666666L,0x66666666666666L,0x66666666L}; -const BIG CURVE_HTPC= {0x770D93A507504FL,0x8C035697F23C62L,0x4C9EFDEBD397A1L,0x27E0EF8595A680L,0x55C19240L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_Ed448.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_Ed448.cpp deleted file mode 100644 index 36a900a..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_Ed448.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_Ed448.h" - -namespace Ed448 { - -/* Curve Ed448 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B448_29; - -const int CURVE_Cof_I=4; -const BIG CURVE_Cof= {0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= -39081; -const BIG CURVE_B= {0x1FFF6756,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FDFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFF}; -const BIG CURVE_Order= {0xB5844F3,0x1BC61495,0x1163D548,0x1984E51B,0x3690216,0xDA4D76B,0xFA7113B,0x1FEF9944,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FF}; -//const BIG CURVE_Gx= {0x15555555,0xAAAAAAA,0x15555555,0xAAAAAAA,0x15555555,0xAAAAAAA,0x15555555,0x152AAAAA,0xAAAAAAA,0x15555555,0xAAAAAAA,0x15555555,0xAAAAAAA,0x15555555,0xAAAAAAA,0x1555}; -//const BIG CURVE_Gy= {0xA9386ED,0x1757DE6F,0x13681AF6,0x19657DA3,0x3098BBB,0x12C19D15,0x12E03595,0xE515B18,0x17B7E36D,0x1AC426E,0xDBB5E8,0x10D8560,0x159D6205,0xB8246D9,0x17A58D2B,0x15C0}; -const BIG CURVE_Gx= {0x70CC05E,0x1135415E,0x24E389,0x1701C316,0x6511433,0xD7B955B,0x11904AB8,0x4947A74,0x7EA6DE3,0x23878BB,0x785195C,0x57E6DB5,0x1D15A62,0x1686F691,0x5C319AF,0x9E3}; -const BIG CURVE_Gy= {0x1230FA14,0x43CADF,0x15F22B66,0x1A26589D,0x39C4FDB,0x1F8E733E,0xB5CEB4F,0x3C0B418,0x87789C,0x1B651CC2,0x12FA9CDC,0xD938EC4,0x7620375,0x1B5E1244,0x1D19C5BA,0xD27}; -const BIG CURVE_HTPC= {0x1FFFFFFE,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FDFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFF}; -#endif - -#if CHUNK==64 - -using namespace B448_58; - -const int CURVE_Cof_I=4; -const BIG CURVE_Cof= {0x4L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= -39081; -const BIG CURVE_B= {0x3FFFFFFFFFF6756L,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FBFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFL}; -const BIG CURVE_Order= {0x378C292AB5844F3L,0x3309CA37163D548L,0x1B49AED63690216L,0x3FDF3288FA7113BL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0xFFFFFFFFFFL}; -//const BIG CURVE_Gx= {0x155555555555555L,0x155555555555555L,0x155555555555555L,0x2A5555555555555L,0x2AAAAAAAAAAAAAAL,0x2AAAAAAAAAAAAAAL,0x2AAAAAAAAAAAAAAL,0x2AAAAAAAAAAL}; -//const BIG CURVE_Gy= {0x2EAFBCDEA9386EDL,0x32CAFB473681AF6L,0x25833A2A3098BBBL,0x1CA2B6312E03595L,0x35884DD7B7E36DL,0x21B0AC00DBB5E8L,0x17048DB359D6205L,0x2B817A58D2BL}; -const BIG CURVE_Gx= {0x226A82BC70CC05EL,0x2E03862C024E389L,0x1AF72AB66511433L,0x928F4E91904AB8L,0x470F1767EA6DE3L,0xAFCDB6A785195CL,0x2D0DED221D15A62L,0x13C65C319AFL}; -const BIG CURVE_Gy= {0x8795BF230FA14L,0x344CB13B5F22B66L,0x3F1CE67C39C4FDBL,0x7816830B5CEB4FL,0x36CA3984087789CL,0x1B271D892FA9CDCL,0x36BC24887620375L,0x1A4FD19C5BAL}; -const BIG CURVE_HTPC= {0x3FFFFFFFFFFFFFEL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FBFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_FP256BN.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_FP256BN.cpp deleted file mode 100644 index 85140ad..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_FP256BN.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_FP256BN.h" - -namespace FP256BN { - -/* Curve BN254 - Pairing friendly BN curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -const int CURVE_Cof_I=1; -const int CURVE_B_I= 3; -const BIG CURVE_B= {0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x10B500D,0x2D536CD,0x9921AF6,0x65FB129,0x49E0CDC,0x5EEE71A,0xD46E5F2,0xFFFCF0C,0xFFFFFFF,0xF}; -const BIG CURVE_Gx= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Gy= {0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Bnx= {0xB0A801,0x82F5C03,0x68,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Pxa= {0x9C09EFB,0x2616B68,0xF843CD2,0x539A12B,0x13ACE1C,0x577C289,0x28560F,0xB4C96C2,0xE0C3350,0xF}; -const BIG CURVE_Pxb= {0x37E6A2B,0x69ED34A,0x3589D2,0x78E287D,0x3B924DD,0xC637D81,0x4DB5AE1,0x738AC05,0xEA66057,0x4}; -const BIG CURVE_Pya= {0xEDC27FF,0x9B481B,0x15848E9,0x24758D6,0xE51EFCB,0x75124E3,0x376770D,0xC542A3B,0x2046E7,0x7}; -const BIG CURVE_Pyb= {0xAAD049B,0x1281114,0xA98B3E0,0xBE80821,0x29F8B4C,0x49297EB,0x42EEA6,0xD388C29,0x554E3BC,0x0}; -const BIG CURVE_W[2]= {{0xB054003,0xF0036E1,0xE78663A,0xFFFFFFF,0xFFFF,0x0,0x0,0x0,0x0,0x0},{0x1615001,0x5EB806,0xD1,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_SB[2][2]= {{{0xC669004,0xF5EEEE7,0xE78670B,0xFFFFFFF,0xFFFF,0x0,0x0,0x0,0x0,0x0},{0x1615001,0x5EB806,0xD1,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x1615001,0x5EB806,0xD1,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x606100A,0x3D4FFEB,0xB19B4BB,0x65FB129,0x49D0CDC,0x5EEE71A,0xD46E5F2,0xFFFCF0C,0xFFFFFFF,0xF}}}; -const BIG CURVE_WB[4]= {{0xD30A800,0x20678F0,0x4D2CC10,0x5555555,0x5555,0x0,0x0,0x0,0x0,0x0},{0xD7DC805,0xD6764C0,0xBC3AD1A,0x8FBEA10,0x4467DE,0x8061601,0xD105EB,0x0,0x0,0x0},{0xF173803,0xACB6061,0x5E1D6C1,0x47DF508,0x82233EF,0xC030B00,0x6882F5,0x0,0x0,0x0},{0xE91F801,0x26530F6,0x4D2CCE1,0x5555555,0x5555,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_BB[4][4]= {{{0x5AA80D,0xAA5DACA,0x9921A8D,0x65FB129,0x49E0CDC,0x5EEE71A,0xD46E5F2,0xFFFCF0C,0xFFFFFFF,0xF}, - {0x5AA80C,0xAA5DACA,0x9921A8D,0x65FB129,0x49E0CDC,0x5EEE71A,0xD46E5F2,0xFFFCF0C,0xFFFFFFF,0xF}, - {0x5AA80C,0xAA5DACA,0x9921A8D,0x65FB129,0x49E0CDC,0x5EEE71A,0xD46E5F2,0xFFFCF0C,0xFFFFFFF,0xF}, - {0x1615002,0x5EB806,0xD1,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}, - {{0x1615001,0x5EB806,0xD1,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0x5AA80C,0xAA5DACA,0x9921A8D,0x65FB129,0x49E0CDC,0x5EEE71A,0xD46E5F2,0xFFFCF0C,0xFFFFFFF,0xF}, - {0x5AA80D,0xAA5DACA,0x9921A8D,0x65FB129,0x49E0CDC,0x5EEE71A,0xD46E5F2,0xFFFCF0C,0xFFFFFFF,0xF}, - {0x5AA80C,0xAA5DACA,0x9921A8D,0x65FB129,0x49E0CDC,0x5EEE71A,0xD46E5F2,0xFFFCF0C,0xFFFFFFF,0xF}}, - {{0x1615002,0x5EB806,0xD1,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0x1615001,0x5EB806,0xD1,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0x1615001,0x5EB806,0xD1,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0x1615001,0x5EB806,0xD1,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}, - {{0xB0A802,0x82F5C03,0x68,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0x2C2A002,0xBD700C,0x1A2,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0xFAA000A,0x2767EC6,0x9921A25,0x65FB129,0x49E0CDC,0x5EEE71A,0xD46E5F2,0xFFFCF0C,0xFFFFFFF,0xF}, - {0xB0A802,0x82F5C03,0x68,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}}; - - - - -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I=1; -const int CURVE_B_I= 3; -const BIG CURVE_B= {0x3L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x2D536CD10B500DL,0x65FB1299921AF6L,0x5EEE71A49E0CDCL,0xFFFCF0CD46E5F2L,0xFFFFFFFFL}; -const BIG CURVE_Gx= {0x1L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Gy= {0x2L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Bnx= {0x82F5C030B0A801L,0x68L,0x0L,0x0L,0x0L}; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Pxa= {0x2616B689C09EFBL,0x539A12BF843CD2L,0x577C28913ACE1CL,0xB4C96C2028560FL,0xFE0C3350L}; -const BIG CURVE_Pxb= {0x69ED34A37E6A2BL,0x78E287D03589D2L,0xC637D813B924DDL,0x738AC054DB5AE1L,0x4EA66057L}; -const BIG CURVE_Pya= {0x9B481BEDC27FFL,0x24758D615848E9L,0x75124E3E51EFCBL,0xC542A3B376770DL,0x702046E7L}; -const BIG CURVE_Pyb= {0x1281114AAD049BL,0xBE80821A98B3E0L,0x49297EB29F8B4CL,0xD388C29042EEA6L,0x554E3BCL}; -const BIG CURVE_W[2]= {{0xF0036E1B054003L,0xFFFFFFFE78663AL,0xFFFFL,0x0L,0x0L},{0x5EB8061615001L,0xD1L,0x0L,0x0L,0x0L}}; -const BIG CURVE_SB[2][2]= {{{0xF5EEEE7C669004L,0xFFFFFFFE78670BL,0xFFFFL,0x0L,0x0L},{0x5EB8061615001L,0xD1L,0x0L,0x0L,0x0L}},{{0x5EB8061615001L,0xD1L,0x0L,0x0L,0x0L},{0x3D4FFEB606100AL,0x65FB129B19B4BBL,0x5EEE71A49D0CDCL,0xFFFCF0CD46E5F2L,0xFFFFFFFFL}}}; -const BIG CURVE_WB[4]= {{0x20678F0D30A800L,0x55555554D2CC10L,0x5555L,0x0L,0x0L},{0xD6764C0D7DC805L,0x8FBEA10BC3AD1AL,0x806160104467DEL,0xD105EBL,0x0L},{0xACB6061F173803L,0x47DF5085E1D6C1L,0xC030B0082233EFL,0x6882F5L,0x0L},{0x26530F6E91F801L,0x55555554D2CCE1L,0x5555L,0x0L,0x0L}}; -const BIG CURVE_BB[4][4]= {{{0xAA5DACA05AA80DL,0x65FB1299921A8DL,0x5EEE71A49E0CDCL,0xFFFCF0CD46E5F2L,0xFFFFFFFFL},{0xAA5DACA05AA80CL,0x65FB1299921A8DL,0x5EEE71A49E0CDCL,0xFFFCF0CD46E5F2L,0xFFFFFFFFL},{0xAA5DACA05AA80CL,0x65FB1299921A8DL,0x5EEE71A49E0CDCL,0xFFFCF0CD46E5F2L,0xFFFFFFFFL},{0x5EB8061615002L,0xD1L,0x0L,0x0L,0x0L}},{{0x5EB8061615001L,0xD1L,0x0L,0x0L,0x0L},{0xAA5DACA05AA80CL,0x65FB1299921A8DL,0x5EEE71A49E0CDCL,0xFFFCF0CD46E5F2L,0xFFFFFFFFL},{0xAA5DACA05AA80DL,0x65FB1299921A8DL,0x5EEE71A49E0CDCL,0xFFFCF0CD46E5F2L,0xFFFFFFFFL},{0xAA5DACA05AA80CL,0x65FB1299921A8DL,0x5EEE71A49E0CDCL,0xFFFCF0CD46E5F2L,0xFFFFFFFFL}},{{0x5EB8061615002L,0xD1L,0x0L,0x0L,0x0L},{0x5EB8061615001L,0xD1L,0x0L,0x0L,0x0L},{0x5EB8061615001L,0xD1L,0x0L,0x0L,0x0L},{0x5EB8061615001L,0xD1L,0x0L,0x0L,0x0L}},{{0x82F5C030B0A802L,0x68L,0x0L,0x0L,0x0L},{0xBD700C2C2A002L,0x1A2L,0x0L,0x0L,0x0L},{0x2767EC6FAA000AL,0x65FB1299921A25L,0x5EEE71A49E0CDCL,0xFFFCF0CD46E5F2L,0xFFFFFFFFL},{0x82F5C030B0A802L,0x68L,0x0L,0x0L,0x0L}}}; - - - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_FP512BN.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_FP512BN.cpp deleted file mode 100644 index c9a2edf..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_FP512BN.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_FP512BN.h" - -namespace FP512BN { - -/* Curve FP512BN - Pairing friendly BN curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B512_29; - -const int CURVE_Cof_I=1; -const int CURVE_B_I= 3; -const BIG CURVE_B= {0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x119A09ED,0x153252FA,0x1E68AD01,0x627C09,0x79A34A1,0x12EF5593,0x2E39231,0x3D597D3,0x45146CF,0x88D877A,0x102EF8F0,0x1196A60F,0x1C60BA1D,0x1CF63F80,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -const BIG CURVE_Gx= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Gy= {0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Bnx= {0x1E1BD80F,0x59835DA,0xC3DFC04,0x5EB8061,0x688,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - -const BIG CURVE_Pxa= {0xDB646B5,0x183D4B70,0x1CBFFA3,0x11F0E632,0x1C78F221,0x1F10DE5D,0x171B715E,0xF0C6A29,0x10B02453,0xBE63C66,0xE6D5F69,0x166B1E1B,0x4BBBD29,0x179E750F,0x6E9D04,0xC912B10,0x1339E138,0x1D8B2}; -const BIG CURVE_Pxb= {0x1A8AE0E9,0xDAE5F7E,0x22446CF,0x1948239B,0x15ADCE40,0xB709C1E,0x18357943,0xE50AA4D,0x19781E22,0x12B35CA6,0x11DAA2C0,0x18D8DDE4,0x5EA656D,0x15F45A41,0xD311A02,0xCFCD913,0x13CBF850,0x240E0}; -const BIG CURVE_Pya= {0xDDE67A1,0x12401895,0x17BEE178,0x142F5AC2,0xB7BC5CD,0x92A1404,0x1A3B748C,0x17BD82A7,0x14B6CD18,0xAC34CE,0x1740FB97,0x1ECC15F9,0x17085B1D,0x1D1BA793,0x1BD6AC32,0x18F70525,0xC84C827,0x3780F}; -const BIG CURVE_Pyb= {0x84F8E8B,0xC5B8C36,0xFDD85A1,0xB84449,0x19C08DFF,0x56BF713,0x1C5290C4,0x187C5CA0,0x1DA2897F,0x24B0CA0,0x326D8F4,0x2310CF6,0x1021438C,0xFBAEC8F,0xD9030C5,0x1CF06358,0x1CEC8B04,0x28D1D}; -const BIG CURVE_W[2]= {{0x9834583,0x887C4BA,0x5A85CFC,0xBF7223A,0xF63FE96,0x1FFFFFFE,0x1FFFFFFF,0x1FFFFFFF,0xFFFFFF,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x1C37B01F,0xB306BB5,0x187BF808,0xBD700C2,0xD10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_SB[2][2]= {{{0xD4B9564,0x1D575904,0xD2C64F3,0x202177,0xF63F186,0x1FFFFFFE,0x1FFFFFFF,0x1FFFFFFF,0xFFFFFF,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x156259CE,0xA01E744,0x5ECB4F9,0x148B7B47,0x79A2790,0x12EF5593,0x2E39231,0x3D597D3,0x45146CF,0x88D877A,0x102EF8F0,0x1196A60F,0x1C60BA1D,0x1CF63F80,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}},{{0x1C37B01F,0xB306BB5,0x187BF808,0xBD700C2,0xD10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x9834583,0x887C4BA,0x5A85CFC,0xBF7223A,0xF63FE96,0x1FFFFFFE,0x1FFFFFFF,0x1FFFFFFF,0xFFFFFF,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}}; -const BIG CURVE_WB[4]= {{0x155A29F0,0x16D59B55,0xF4C305,0x18858C0B,0x5215FBF,0xAAAAAAA,0x15555555,0xAAAAAAA,0x555555,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x2355D4B,0x1758095D,0x1FE13C5F,0x41F83FA,0xBB5E5CF,0x97D4EF1,0xB503D62,0x172C0C9B,0x16315274,0x15E1A9A8,0x859835D,0x2C3DFC0,0x105EB806,0x68,0x0,0x0,0x0,0x0},{0x289AAD,0x1E781F9C,0x60F9C31,0x1505822E,0x15DAF62B,0x4BEA778,0x15A81EB1,0xB96064D,0xB18A93A,0x1AF0D4D4,0x42CC1AE,0x161EFE0,0x82F5C03,0x34,0x0,0x0,0x0,0x0},{0x192279D1,0xBA52F9F,0x878CAFD,0xCAE8B48,0x52152AF,0xAAAAAAA,0x15555555,0xAAAAAAA,0x555555,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG CURVE_BB[4][4]= {{{0x1E1BD810,0x59835DA,0xC3DFC04,0x5EB8061,0x688,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0x1E1BD80F,0x59835DA,0xC3DFC04,0x5EB8061,0x688,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0x1E1BD80F,0x59835DA,0xC3DFC04,0x5EB8061,0x688,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0x156259CF,0xA01E744,0x5ECB4F9,0x148B7B47,0x79A2790,0x12EF5593,0x2E39231,0x3D597D3,0x45146CF,0x88D877A,0x102EF8F0,0x1196A60F,0x1C60BA1D,0x1CF63F80,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}}, - {{0x1C37B01F,0xB306BB5,0x187BF808,0xBD700C2,0xD10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0x137E31DE,0xF9A1D1F,0x122AB0FD,0x1A76FBA8,0x79A2E18,0x12EF5593,0x2E39231,0x3D597D3,0x45146CF,0x88D877A,0x102EF8F0,0x1196A60F,0x1C60BA1D,0x1CF63F80,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}, - {0x137E31DD,0xF9A1D1F,0x122AB0FD,0x1A76FBA8,0x79A2E18,0x12EF5593,0x2E39231,0x3D597D3,0x45146CF,0x88D877A,0x102EF8F0,0x1196A60F,0x1C60BA1D,0x1CF63F80,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}, - {0x137E31DE,0xF9A1D1F,0x122AB0FD,0x1A76FBA8,0x79A2E18,0x12EF5593,0x2E39231,0x3D597D3,0x45146CF,0x88D877A,0x102EF8F0,0x1196A60F,0x1C60BA1D,0x1CF63F80,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}}, - {{0x1C37B01E,0xB306BB5,0x187BF808,0xBD700C2,0xD10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0x1C37B01F,0xB306BB5,0x187BF808,0xBD700C2,0xD10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0x1C37B01F,0xB306BB5,0x187BF808,0xBD700C2,0xD10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0x1C37B01F,0xB306BB5,0x187BF808,0xBD700C2,0xD10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}, - {{0x137E31DF,0xF9A1D1F,0x122AB0FD,0x1A76FBA8,0x79A2E18,0x12EF5593,0x2E39231,0x3D597D3,0x45146CF,0x88D877A,0x102EF8F0,0x1196A60F,0x1C60BA1D,0x1CF63F80,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}, - {0x192AA9AF,0x1ED17B8E,0xD70BCF0,0x8B47A84,0x79A1A80,0x12EF5593,0x2E39231,0x3D597D3,0x45146CF,0x88D877A,0x102EF8F0,0x1196A60F,0x1C60BA1D,0x1CF63F80,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}, - {0x1C37B01D,0xB306BB5,0x187BF808,0xBD700C2,0xD10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, - {0x137E31DF,0xF9A1D1F,0x122AB0FD,0x1A76FBA8,0x79A2E18,0x12EF5593,0x2E39231,0x3D597D3,0x45146CF,0x88D877A,0x102EF8F0,0x1196A60F,0x1C60BA1D,0x1CF63F80,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}}}; - - - -#endif - -#if CHUNK==64 - -using namespace B512_60; - -const int CURVE_Cof_I=1; -const int CURVE_B_I= 3; -const BIG CURVE_B= {0x3L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x6A64A5F519A09EDL,0x10313E04F9A2B40L,0xC65DEAB2679A34AL,0xCF1EACBE98B8E48L,0x3C111B0EF445146L,0xA1D8CB5307C0BBEL,0xFFFF9EC7F01C60BL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG CURVE_Gx= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Gy= {0x2L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Bnx= {0xB306BB5E1BD80FL,0x82F5C030B0F7F01L,0x68L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; - -const BIG CURVE_Pxa= {0xF07A96E0DB646B5L,0x18F87319072FFE8L,0x7BE21BCBBC78F22L,0x537863514DC6DC5L,0xDA57CC78CD0B024L,0xD29B358F0DB9B57L,0x7412F3CEA1E4BBBL,0xE138648958801BAL,0x3B165339L}; -const BIG CURVE_Pxb= {0xDB5CBEFDA8AE0E9L,0xCA411CD88911B3L,0xD6E1383D5ADCE4L,0x227285526E0D5E5L,0xB02566B94D9781EL,0x56DC6C6EF2476A8L,0x680ABE8B4825EA6L,0xF85067E6C89B4C4L,0x481C13CBL}; -const BIG CURVE_Pya= {0x2480312ADDE67A1L,0xDA17AD615EFB85EL,0x312542808B7BC5CL,0x18BDEC153E8EDD2L,0xE5C158699D4B6CDL,0xB1DF660AFCDD03EL,0xB0CBA374F277085L,0xC827C7B8292EF5AL,0x6F01EC84L}; -const BIG CURVE_Pyb= {0x58B7186C84F8E8BL,0xF05C2224BF76168L,0x10AD7EE279C08DFL,0x7FC3E2E50714A43L,0x3D04961941DA289L,0x38C118867B0C9B6L,0xC315F75D91F0214L,0x8B04E7831AC3640L,0x51A3BCECL}; - - -const BIG CURVE_W[2]= {{0x110F89749834583L,0x65FB911D16A173FL,0xFFFFFFFFCF63FE9L,0xFFFFFFFFFFFFFFFL,0xFFFFL,0x0L,0x0L,0x0L,0x0L},{0x1660D76BC37B01FL,0x5EB806161EFE02L,0xD1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}; -const BIG CURVE_SB[2][2]= {{{0xFAAEB208D4B9564L,0x601010BBB4B193CL,0xFFFFFFFFCF63F18L,0xFFFFFFFFFFFFFFFL,0xFFFFL,0x0L,0x0L,0x0L,0x0L},{0x5403CE8956259CEL,0xA45BDA397B2D3EL,0xC65DEAB2679A279L,0xCF1EACBE98B8E48L,0x3C111B0EF445146L,0xA1D8CB5307C0BBEL,0xFFFF9EC7F01C60BL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}},{{0x1660D76BC37B01FL,0x5EB806161EFE02L,0xD1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x110F89749834583L,0x65FB911D16A173FL,0xFFFFFFFFCF63FE9L,0xFFFFFFFFFFFFFFFL,0xFFFFL,0x0L,0x0L,0x0L,0x0L}}}; -const BIG CURVE_WB[4]= {{0x6DAB36AB55A29F0L,0xFC42C60583D30C1L,0x5555555545215FBL,0x555555555555555L,0x5555L,0x0L,0x0L,0x0L,0x0L}, - {0xEEB012BA2355D4BL,0xF20FC1FD7F84F17L,0x892FA9DE2BB5E5CL,0x74B96064DAD40F5L,0xD76BC3535163152L,0x806161EFE021660L,0xD105EBL,0x0L,0x0L}, - {0x7CF03F380289AADL,0xBA82C117183E70CL,0xC497D4EF15DAF62L,0x3A5CB0326D6A07AL,0x6BB5E1A9A8B18A9L,0xC030B0F7F010B30L,0x6882F5L,0x0L,0x0L}, - {0x574A5F3F92279D1L,0xF65745A421E32BFL,0x55555555452152AL,0x555555555555555L,0x5555L,0x0L,0x0L,0x0L,0x0L}}; -const BIG CURVE_BB[4][4]= {{{0xB306BB5E1BD810L,0x82F5C030B0F7F01L,0x68L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0xB306BB5E1BD80FL,0x82F5C030B0F7F01L,0x68L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0xB306BB5E1BD80FL,0x82F5C030B0F7F01L,0x68L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x5403CE8956259CFL,0xA45BDA397B2D3EL,0xC65DEAB2679A279L,0xCF1EACBE98B8E48L,0x3C111B0EF445146L,0xA1D8CB5307C0BBEL,0xFFFF9EC7F01C60BL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}}, - {{0x1660D76BC37B01FL,0x5EB806161EFE02L,0xD1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x5F343A3F37E31DEL,0x8D3B7DD448AAC3FL,0xC65DEAB2679A2E1L,0xCF1EACBE98B8E48L,0x3C111B0EF445146L,0xA1D8CB5307C0BBEL,0xFFFF9EC7F01C60BL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL},{0x5F343A3F37E31DDL,0x8D3B7DD448AAC3FL,0xC65DEAB2679A2E1L,0xCF1EACBE98B8E48L,0x3C111B0EF445146L,0xA1D8CB5307C0BBEL,0xFFFF9EC7F01C60BL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL},{0x5F343A3F37E31DEL,0x8D3B7DD448AAC3FL,0xC65DEAB2679A2E1L,0xCF1EACBE98B8E48L,0x3C111B0EF445146L,0xA1D8CB5307C0BBEL,0xFFFF9EC7F01C60BL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}}, - {{0x1660D76BC37B01EL,0x5EB806161EFE02L,0xD1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x1660D76BC37B01FL,0x5EB806161EFE02L,0xD1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x1660D76BC37B01FL,0x5EB806161EFE02L,0xD1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x1660D76BC37B01FL,0x5EB806161EFE02L,0xD1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}, - {{0x5F343A3F37E31DFL,0x8D3B7DD448AAC3FL,0xC65DEAB2679A2E1L,0xCF1EACBE98B8E48L,0x3C111B0EF445146L,0xA1D8CB5307C0BBEL,0xFFFF9EC7F01C60BL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL},{0x3DA2F71D92AA9AFL,0x45A3D4235C2F3CL,0xC65DEAB2679A1A8L,0xCF1EACBE98B8E48L,0x3C111B0EF445146L,0xA1D8CB5307C0BBEL,0xFFFF9EC7F01C60BL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL},{0x1660D76BC37B01DL,0x5EB806161EFE02L,0xD1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x5F343A3F37E31DFL,0x8D3B7DD448AAC3FL,0xC65DEAB2679A2E1L,0xCF1EACBE98B8E48L,0x3C111B0EF445146L,0xA1D8CB5307C0BBEL,0xFFFF9EC7F01C60BL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}}}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_HIFIVE.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_HIFIVE.cpp deleted file mode 100644 index 3edc1fa..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_HIFIVE.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_HIFIVE.h" - -namespace HIFIVE { - -/* Curve HIFIVE */ - - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B336_29; - -const int CURVE_Cof_I=8; -const BIG CURVE_Cof= {0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 11111; -const BIG CURVE_B= {0x2B67,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x1E9FA805,0x197CACB9,0x1E4EEA9E,0x17AD70F,0x1FA9850C,0x38A0A,0x0,0x0,0x0,0x0,0x0,0x4000}; -const BIG CURVE_Gx= {0xC,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Gy= {0x5FE8632,0x15F63428,0xD976C4,0x1AACA194,0x35B6DB5,0x8E3F7A,0x52D1B0E,0xF0A7A36,0x1C161D00,0x8170C70,0x1185AD59,0x181B}; -const BIG CURVE_HTPC= {0x5531622,0x11FEDF60,0x182A7392,0x16BAC746,0x1A3512D9,0x49580D5,0xE77C13C,0x1AAC2086,0x1E3A6A5,0x2B61FB8,0x783F9C2,0x6C0}; -#endif - -#if CHUNK==64 - -using namespace B336_60; - -const int CURVE_Cof_I=8; -const BIG CURVE_Cof= {0x8L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 11111; -const BIG CURVE_B= {0x2B67L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0xB2F95973E9FA805L,0xC0BD6B87F93BAA7L,0x71415FA9850L,0x0L,0x0L,0x200000000L}; -const BIG CURVE_Gx= {0xCL,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Gy= {0x2BEC68505FE8632L,0x5D5650CA0365DB1L,0x3811C7EF435B6DBL,0x7853D1B14B46CL,0x56502E18E1C161DL,0xC0DC616BL}; -const BIG CURVE_HTPC= {0xA3FDBEC05531622L,0x9B5D63A360A9CE4L,0xF092B01ABA3512DL,0xA5D56104339DF04L,0x70856C3F701E3A6L,0x3601E0FEL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_JUBJUB.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_JUBJUB.cpp deleted file mode 100644 index 6db686a..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_JUBJUB.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_JUBJUB.h" - -namespace JUBJUB { - -/* JUBJUB Curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_29; - -const int CURVE_Cof_I= 8; -const BIG CURVE_Cof= {0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0x16343EB1,0x832FEB6,0x15E74980,0x1AFEDA6E,0x17FD4292,0x903F35E,0xD23D7F6,0x1CE97F45,0x2A9318}; -const BIG CURVE_Order= {0x16F72CB7,0x4B872F6,0x120420B4,0x10412799,0x3B00A66,0x1D80809A,0x1EA4199C,0x1D4CA675,0xE7DB4}; -const BIG CURVE_Gx= {0x14F976C4,0x1A7678D3,0x1CE7B79F,0x18A8D7E5,0x4882000,0x1A6F801C,0xE329892,0x55F1DFE,0x518397}; -const BIG CURVE_Gy= {0x1349702E,0x35D6B84,0x9A0CEC5,0x190E0FFF,0x1C308096,0x62D5ECE,0x10B27A3F,0x8E5945F,0x3B43F8}; -const BIG CURVE_HTPC= {0x47BBBB6,0x83D77CF,0x1D4C82A6,0x1BFEA2A2,0xD546E25,0x1765A39E,0x7500F8F,0x168566F6,0x62FD68}; -#endif - -#if CHUNK==64 - -using namespace B256_56; -const int CURVE_Cof_I= 8; -const BIG CURVE_Cof= {0x8L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0x65FD6D6343EB1L,0x7F6D37579D2601L,0x7E6BD7FD4292DL,0x4BFA2B48F5FD92L,0x2A9318E7L}; -const BIG CURVE_Order= {0x970E5ED6F72CB7L,0x2093CCC81082D0L,0x101343B00A668L,0x6533AFA906673BL,0xE7DB4EAL}; -const BIG CURVE_Gx= {0x4ECF1A74F976C4L,0x546BF2F39EDE7FL,0xDF00384882000CL,0xF8EFF38CA624B4L,0x5183972AL}; -const BIG CURVE_Gy= {0x6BAD709349702EL,0x8707FFA6833B14L,0x5ABD9DC308096CL,0x2CA2FC2C9E8FCCL,0x3B43F847L}; -const BIG CURVE_HTPC= {0x7AEF9E47BBBB6L,0xFF515175320A99L,0xCB473CD546E25DL,0x2B37B1D403E3EEL,0x62FD68B4L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_MDC.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_MDC.cpp deleted file mode 100644 index 1da8f55..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_MDC.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_MDC.h" - - -namespace MDC { - -/* Million Dollar Curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -const int CURVE_Cof_I= 4; -const BIG CURVE_Cof= {0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0x300CF89,0x9309250,0x1F041EE,0x70F63F2,0x9625F12,0xCCFB0CB,0xA7CDFBF,0x1965B68,0x7130452,0x5}; -const BIG CURVE_Order= {0x1B0F7FB,0x8552F42,0x974BB58,0x8975FAF,0xF534FB3,0xBF75E97,0xD14CBE4,0x7515ABE,0xC4EDA2E,0x3}; -const BIG CURVE_Gx= {0xE68363B,0x2C25BFE,0x713E223,0x2ABB8D2,0xF6350D7,0x1E03CBC,0x3D85B42,0x7F903B8,0x681886A,0xB}; -const BIG CURVE_Gy= {0xD2864B5,0x73C355B,0x93A3A7E,0xBC3D81A,0xA421DA8,0xCF6563D,0x359814D,0xB59C0B0,0xA6734E1,0xC}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I= 4; -const BIG CURVE_Cof= {0x4L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0x9309250300CF89L,0x70F63F21F041EEL,0xCCFB0CB9625F12L,0x1965B68A7CDFBFL,0x57130452L}; -const BIG CURVE_Order= {0x8552F421B0F7FBL,0x8975FAF974BB58L,0xBF75E97F534FB3L,0x7515ABED14CBE4L,0x3C4EDA2EL}; -const BIG CURVE_Gx= {0x2C25BFEE68363BL,0x2ABB8D2713E223L,0x1E03CBCF6350D7L,0x7F903B83D85B42L,0xB681886AL}; -const BIG CURVE_Gy= {0x73C355BD2864B5L,0xBC3D81A93A3A7EL,0xCF6563DA421DA8L,0xB59C0B0359814DL,0xCA6734E1L}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L,0x0L,0x0L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NIST256.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NIST256.cpp deleted file mode 100644 index fd42dc6..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NIST256.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_NIST256.h" - -namespace NIST256 { - -/* Curve NIST256 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0x7D2604B,0xCE3C3E2,0x3B0F63B,0x6B0CC5,0x6BC651D,0x5576988,0x7B3EBBD,0xAA3A93E,0xAC635D8,0x5}; -const BIG CURVE_Order= {0xC632551,0xB9CAC2F,0x79E84F3,0xFAADA71,0xFFFBCE6,0xFFFFFFF,0xFFFFFF,0x0,0xFFFFFFF,0xF}; -const BIG CURVE_Gx= {0x898C296,0xA13945D,0xB33A0F4,0x7D812DE,0xF27703,0xE563A44,0x7F8BCE6,0xE12C424,0xB17D1F2,0x6}; -const BIG CURVE_Gy= {0x7BF51F5,0xB640683,0x15ECECB,0x33576B3,0xE162BCE,0x4A7C0F9,0xB8EE7EB,0xFE1A7F9,0xFE342E2,0x4}; -const BIG CURVE_HTPC= {0xC613926,0xB847959,0xA9DD42E,0xB001452,0x5548D3E,0x8F44A65,0x45240B3,0xB63723A,0xA2AD82C,0x6}; - -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0xCE3C3E27D2604BL,0x6B0CC53B0F63BL,0x55769886BC651DL,0xAA3A93E7B3EBBDL,0x5AC635D8L}; -const BIG CURVE_Order= {0xB9CAC2FC632551L,0xFAADA7179E84F3L,0xFFFFFFFFFFBCE6L,0xFFFFFFL,0xFFFFFFFFL}; -const BIG CURVE_Gx= {0xA13945D898C296L,0x7D812DEB33A0F4L,0xE563A440F27703L,0xE12C4247F8BCE6L,0x6B17D1F2L}; -const BIG CURVE_Gy= {0xB6406837BF51F5L,0x33576B315ECECBL,0x4A7C0F9E162BCEL,0xFE1A7F9B8EE7EBL,0x4FE342E2L}; -const BIG CURVE_HTPC= {0xB847959C613926L,0xB001452A9DD42EL,0x8F44A655548D3EL,0xB63723A45240B3L,0x6A2AD82CL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NIST384.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NIST384.cpp deleted file mode 100644 index 1349595..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NIST384.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_NIST384.h" - -namespace NIST384 { - -/* Curve NIST384 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B384_29; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0x13EC2AEF,0x142E476E,0xBB4674A,0xC731B14,0x1875AC65,0x447A809,0x4480C50,0xDDFD028,0x19181D9C,0x1F1FC168,0x623815A,0x47DCFC9,0x1312FA7E,0x59}; -const BIG CURVE_Order= {0xCC52973,0x760CB56,0xC29DEBB,0x141B6491,0x12DDF581,0x6C0FA1B,0x1FFF1D8D,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7F}; -const BIG CURVE_Gx= {0x12760AB7,0x12A2F1C3,0x154A5B0E,0x5E4BB7E,0x2A38550,0xF0412A,0xE6167DD,0xC5174F3,0x146E1D3B,0x1799056B,0x3AC71C7,0x1D160A6F,0x87CA22B,0x55}; -const BIG CURVE_Gy= {0x10EA0E5F,0x1218EBE4,0x1FA0675E,0x1639C3A,0xB8C00A6,0x1889DAF8,0x11F3A768,0x17A51342,0x9F8F41D,0x1C9496E1,0x1767A62F,0xC4C58DE,0x17DE4A9,0x1B}; -const BIG CURVE_HTPC= {0xDCD21B,0x1213626A,0x1502B4CF,0x85A550E,0x5FEED05,0x13578422,0xED2F57D,0x16A06E8C,0x2E00897,0x1652C3E0,0x12F5A8FF,0x6E2A490,0x6EF0F22,0x5E}; -#endif - -#if CHUNK==64 - -using namespace B384_56; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0x85C8EDD3EC2AEFL,0x398D8A2ED19D2AL,0x8F5013875AC656L,0xFE814112031408L,0xF82D19181D9C6EL,0xE7E4988E056BE3L,0xB3312FA7E23EL}; -const BIG CURVE_Order= {0xEC196ACCC52973L,0xDB248B0A77AECL,0x81F4372DDF581AL,0xFFFFFFFFC7634DL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFL}; -const BIG CURVE_Gx= {0x545E3872760AB7L,0xF25DBF55296C3AL,0xE082542A385502L,0x8BA79B9859F741L,0x20AD746E1D3B62L,0x5378EB1C71EF3L,0xAA87CA22BE8BL}; -const BIG CURVE_Gy= {0x431D7C90EA0E5FL,0xB1CE1D7E819D7AL,0x13B5F0B8C00A60L,0x289A147CE9DA31L,0x92DC29F8F41DBDL,0x2C6F5D9E98BF92L,0x3617DE4A9626L}; -const BIG CURVE_HTPC= {0x426C4D40DCD21BL,0x2D2A87540AD33EL,0xAF08445FEED054L,0x37463B4BD5F66L,0x587C02E00897B5L,0x52484BD6A3FECAL,0xBC6EF0F22371L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NIST521.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NIST521.cpp deleted file mode 100644 index 68d48ae..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NIST521.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_NIST521.h" - -namespace NIST521 { - -/* Curve NIST521 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B528_28; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0xB503F00,0x451FD46,0xC34F1EF,0xDF883D2,0xF073573,0xBD3BB1B,0xB1652C0,0xEC7E937,0x6193951,0xF109E15,0x489918E,0x15F3B8B,0x25B99B3,0xEEA2DA7,0xB68540,0x929A21A,0xE1C9A1F,0x3EB9618,0x5195}; -const BIG CURVE_Order= {0x1386409,0x6FB71E9,0xC47AEBB,0xC9B8899,0x5D03BB5,0x48F709A,0xB7FCC01,0xBF2F966,0x1868783,0xFFFFFA5,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0x1FFFF}; -const BIG CURVE_Gx= {0x2E5BD66,0x7E7E31C,0xA429BF9,0xB3C1856,0x8DE3348,0x27A2FFA,0x8FE1DC1,0xEFE7592,0x14B5E77,0x4D3DBAA,0x8AF606B,0xB521F82,0x139053F,0x429C648,0x62395B4,0x9E3ECB6,0x404E9CD,0x8E06B70,0xC685}; -const BIG CURVE_Gy= {0xFD16650,0xBE94769,0x2C24088,0x7086A27,0x761353C,0x13FAD0,0xC550B9,0x5EF4264,0x7EE7299,0x3E662C9,0xFBD1727,0x446817A,0x449579B,0xD998F54,0x42C7D1B,0x5C8A5FB,0xA3BC004,0x296A789,0x11839}; -const BIG CURVE_HTPC= {0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFF}; -#endif - -#if CHUNK==64 - -using namespace B528_60; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0xF451FD46B503F00L,0x73DF883D2C34F1EL,0x2C0BD3BB1BF0735L,0x3951EC7E937B165L,0x9918EF109E15619L,0x5B99B315F3B8B48L,0xB68540EEA2DA72L,0x8E1C9A1F929A21AL,0x51953EB961L}; -const BIG CURVE_Order= {0xB6FB71E91386409L,0xB5C9B8899C47AEBL,0xC0148F709A5D03BL,0x8783BF2F966B7FCL,0xFFFFFFFFFFA5186L,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0x1FFFFFFFFFFL}; -const BIG CURVE_Gx= {0x97E7E31C2E5BD66L,0x48B3C1856A429BFL,0xDC127A2FFA8DE33L,0x5E77EFE75928FE1L,0xF606B4D3DBAA14BL,0x39053FB521F828AL,0x62395B4429C6481L,0x404E9CD9E3ECB6L,0xC6858E06B7L}; -const BIG CURVE_Gy= {0x8BE94769FD16650L,0x3C7086A272C2408L,0xB9013FAD076135L,0x72995EF42640C55L,0xD17273E662C97EEL,0x49579B446817AFBL,0x42C7D1BD998F544L,0x9A3BC0045C8A5FBL,0x11839296A78L}; -const BIG CURVE_HTPC= {0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS256E.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS256E.cpp deleted file mode 100644 index d35fbd1..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS256E.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_NUMS256E.h" - -namespace NUMS256E { - -/* NUMS 256-bit Curve - Edwards */ - -#if CHUNK==16 - -using namespace B256_13; - -const int CURVE_Cof_I=4; -const BIG CURVE_Cof= {0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= -15342; -const BIG CURVE_B= {0x355,0x1FFE,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FF}; -const BIG CURVE_Order= {0xAF5,0x16EA,0x43B,0xF63,0x11A4,0x1CD,0x1D65,0x14A5,0x155A,0x20C,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80}; -const BIG CURVE_Gx= {0x13DA,0x1768,0x40B,0x1D81,0xA0D,0x1AC3,0xC20,0x1DC,0x198A,0x1061,0x6F5,0x1241,0x15F6,0xF1E,0x1734,0x46F,0xAEA,0x7DB,0x1D45,0x114}; -const BIG CURVE_Gy= {0x9E6,0xC54,0x19DE,0xC2D,0x12FA,0x1769,0x215,0x1B02,0x1F61,0x38A,0x4,0xC97,0x1D9A,0xB32,0x1F3A,0x4B8,0x19D9,0x14FE,0x154F,0x89}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -#endif - -#if CHUNK==32 - -using namespace B256_29; - -const int CURVE_Cof_I=4; -const BIG CURVE_Cof= {0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= -15342; -const BIG CURVE_B= {0x1FFFC355,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0xFFFFFF}; -const BIG CURVE_Order= {0xEDD4AF5,0x123D8C87,0x1650E6C6,0xAB54A5E,0x419,0x0,0x0,0x0,0x400000}; -const BIG CURVE_Gx= {0xEED13DA,0x6F60481,0x20D61A8,0x13141DC6,0x9BD60C3,0x1EAFB490,0xDF73478,0x1F6D5D44,0x8A7514}; -const BIG CURVE_Gy= {0x198A89E6,0x1D30B73B,0x15BB4CB,0x1EC3B021,0x18010715,0x12ECD325,0x171F3A59,0x13FB3B24,0x44D53E}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I=4; -const BIG CURVE_Cof= {0x4L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= -15342; -const BIG CURVE_B= {0xFFFFFFFFFFC355L,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG CURVE_Order= {0x47B190EEDD4AF5L,0x5AA52F59439B1AL,0x4195L,0x0L,0x40000000L}; -const BIG CURVE_Gx= {0xDEC0902EED13DAL,0x8A0EE3083586A0L,0x5F69209BD60C39L,0x6AEA237DCD1E3DL,0x8A7514FBL}; -const BIG CURVE_Gy= {0xA616E7798A89E6L,0x61D810856ED32FL,0xD9A64B8010715FL,0xD9D925C7CE9665L,0x44D53E9FL}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L,0x0L,0x0L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS256W.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS256W.cpp deleted file mode 100644 index 16da170..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS256W.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_NUMS256W.h" - -namespace NUMS256W { - -/* NUMS 256-bit Curve - Weierstrass */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 152961; -const BIG CURVE_B= {0x25581,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x751A825,0xAB20294,0x65C6020,0x8275EA2,0xFFFE43C,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xF}; -const BIG CURVE_Gx= {0x21AACB1,0x52EE1EB,0x4C73ABC,0x9B0903D,0xB098357,0xA04F42C,0x1297A95,0x5AAADB6,0xC9ED6B6,0xB}; -const BIG CURVE_Gy= {0x184DE9F,0xB5B9CB2,0x10FBB80,0xC3D1153,0x35C955,0xF77E04E,0x673448B,0x3399B6A,0x8FC0F1,0xD}; -const BIG CURVE_HTPC= {0x52B84D6,0xFC6F759,0xE89E05,0x92C6204,0x6AE4640,0x70CADDC,0x5B22ED0,0x5411E3B,0xF7F44E4,0xC}; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 152961; -const BIG CURVE_B= {0x25581L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0xAB20294751A825L,0x8275EA265C6020L,0xFFFFFFFFFFE43CL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG CURVE_Gx= {0x52EE1EB21AACB1L,0x9B0903D4C73ABCL,0xA04F42CB098357L,0x5AAADB61297A95L,0xBC9ED6B6L}; -const BIG CURVE_Gy= {0xB5B9CB2184DE9FL,0xC3D115310FBB80L,0xF77E04E035C955L,0x3399B6A673448BL,0xD08FC0F1L}; -const BIG CURVE_HTPC= {0xFC6F75952B84D6L,0x92C62040E89E05L,0x70CADDC6AE4640L,0x5411E3B5B22ED0L,0xCF7F44E4L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS384E.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS384E.cpp deleted file mode 100644 index 6f12a5b..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS384E.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_NUMS384E.h" - -namespace NUMS384E { - -/* NUMS 384-bit Curve - Edwards */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B384_29; - -const int CURVE_Cof_I=4; -const BIG CURVE_Cof= {0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= -11556; -const BIG CURVE_B= {0x1FFFD19F,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7F}; -const BIG CURVE_Order= {0x6A3897D,0x5CEE627,0xD721E48,0x8AAB556,0x1E1CF61E,0xD0E5A35,0x1FFF891C,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1F}; -const BIG CURVE_Gx= {0xC206BDE,0x6AA0723,0x116504D4,0x52562CA,0x163406FF,0x1FD47998,0x10015D8F,0x8DCB7C9,0x15B30BF4,0x14D72AED,0x102DA884,0xB524CD9,0x1B111FB4,0x30}; -const BIG CURVE_Gy= {0x10729392,0xC681F0F,0x1B123727,0x561F28D,0x1964B007,0xC7BFB22,0x1D5A0C3E,0xE9E284B,0x1716AD82,0x11D886E,0x1CE2C69,0x134DDD61,0x983E67B,0x41}; -const BIG CURVE_HTPC= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -#endif - -#if CHUNK==64 - -using namespace B384_58; - -const int CURVE_Cof_I= 4; -const BIG CURVE_Cof= {0x4L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= -11556; -const BIG CURVE_B= {0x3FFFFFFFFFFD19FL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0xFFFFFFFFFL}; -const BIG CURVE_Order= {0xB9DCC4E6A3897DL,0x11556AACD721E48L,0x1A1CB46BE1CF61EL,0x3FFFFFFFFFF891CL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFL}; -const BIG CURVE_Gx= {0xD540E46C206BDEL,0xA4AC59516504D4L,0x3FA8F33163406FFL,0x11B96F930015D8FL,0x29AE55DB5B30BF4L,0x16A499B302DA884L,0x61B111FB4L}; -const BIG CURVE_Gy= {0x18D03E1F0729392L,0xAC3E51BB123727L,0x18F7F645964B007L,0x1D3C5097D5A0C3EL,0x23B10DD716AD82L,0x269BBAC21CE2C69L,0x82983E67BL}; -const BIG CURVE_HTPC= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS384W.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS384W.cpp deleted file mode 100644 index 6b1741b..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS384W.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_NUMS384W.h" - -namespace NUMS384W { - -/* NUMS 384-bit Curve - Weierstrass */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B384_29; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= -34568; -const BIG CURVE_B= {0x1FFF77BB,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7F}; -const BIG CURVE_Order= {0x1B0E61B9,0x26C0FB3,0xDF89E98,0x153A7A98,0x16881BED,0x178F75AE,0x1FFF587A,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7F}; -const BIG CURVE_Gx= {0x98152A,0x1CE5D021,0x18711EFA,0x1DDA201E,0xC742522,0x148D9536,0x7D3CEF4,0x19BF703F,0x60225C1,0x12082F8D,0x12203288,0x2DE3038,0x17956F0B,0x3A}; -const BIG CURVE_Gy= {0x6180716,0x3A5C763,0x1D2B4997,0xD69B77F,0x837EBCD,0x1BE890D,0xE72E482,0xEFF0FEE,0x1EB00469,0x2C267B,0x15F8CF4C,0x3371C71,0xDEE368E,0x56}; -const BIG CURVE_HTPC= {0x1FFFFF61,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x3F}; -#endif - -#if CHUNK==64 - -using namespace B384_58; - -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= -34568; -const BIG CURVE_B= {0x3FFFFFFFFFF77BBL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0xFFFFFFFFFL}; -const BIG CURVE_Order= {0x4D81F67B0E61B9L,0x2A74F530DF89E98L,0x2F1EEB5D6881BEDL,0x3FFFFFFFFFF587AL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0xFFFFFFFFFL}; -const BIG CURVE_Gx= {0x39CBA042098152AL,0x3BB4403D8711EFAL,0x291B2A6CC742522L,0x337EE07E7D3CEF4L,0x24105F1A60225C1L,0x5BC60712203288L,0x757956F0BL}; -const BIG CURVE_Gy= {0x74B8EC66180716L,0x1AD36EFFD2B4997L,0x37D121A837EBCDL,0x1DFE1FDCE72E482L,0x584CF7EB00469L,0x66E38E35F8CF4CL,0xACDEE368EL}; -const BIG CURVE_HTPC= {0x3FFFFFFFFFFFF61L,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x7FFFFFFFFL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS512E.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS512E.cpp deleted file mode 100644 index d9138d9..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS512E.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_NUMS512E.h" - -namespace NUMS512E { - -/* NUMS 512-bit Curve - Edwards */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B512_29; - -const int CURVE_Cof_I=4; -const BIG CURVE_Cof= {0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= -78296; -const BIG CURVE_B= {0x1FFECBEF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -const BIG CURVE_Order= {0x1BEED46D,0x1A3467A8,0x1BFB3FD9,0xC0AF0DB,0x86F52A4,0xC64B85B,0x6EA78FF,0xDA5F9F2,0x1FB4F063,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFF}; -const BIG CURVE_Gx= {0x19EC57FE,0xDCD594C,0x113C0571,0xA4A84F9,0x104AD0FE,0x4C92B44,0xC3DE2F7,0x9DDC8CE,0x74621C1,0x1139DC0A,0x9E85FAF,0x1B894704,0x1D1E79F4,0x9E29997,0x32DE223,0x16D38F43,0x116D128D,0x6FC71}; -const BIG CURVE_Gy= {0x1E2F5E1,0x136EF606,0x1C7407CC,0xDA71537,0xC1FD026,0x3431576,0x15898068,0x1E5D32C6,0x120CA53,0xC84F41A,0xA4ADAE5,0x104B3A45,0x76F726D,0x1512B772,0x3D5DEA0,0x194E3316,0x1FF39D49,0x3684D}; -const BIG CURVE_HTPC= {0x1FFFFDC6,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -#endif - -#if CHUNK==64 - -using namespace B512_60; - -const int CURVE_Cof_I= 4; -const BIG CURVE_Cof= {0x4L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= -78296; -const BIG CURVE_B= {0xFFFFFFFFFFECBEFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG CURVE_Order= {0x7468CF51BEED46DL,0x4605786DEFECFF6L,0xFD8C970B686F52AL,0x636D2FCF91BA9E3L,0xFFFFFFFFFFFB4F0L,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0x3FFFFFFFL}; -const BIG CURVE_Gx= {0x5B9AB2999EC57FEL,0xE525427CC4F015CL,0xDC992568904AD0FL,0xC14EEE46730F78BL,0xEBE273B81474621L,0x9F4DC4A38227A17L,0x888D3C5332FD1E7L,0x128DB69C7A18CB7L,0xDF8E316DL}; -const BIG CURVE_Gy= {0x26DDEC0C1E2F5E1L,0x66D38A9BF1D01F3L,0xA06862AECC1FD02L,0x53F2E9963562601L,0xB95909E834120CAL,0x26D8259D22A92B6L,0x7A82A256EE476F7L,0x9D49CA7198B0F57L,0x6D09BFF3L}; -const BIG CURVE_HTPC= {0xFFFFFFFFFFFFDC6L,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS512W.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS512W.cpp deleted file mode 100644 index 616f30b..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_NUMS512W.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_NUMS512W.h" - -namespace NUMS512W { - -/* NUMS 512-bit Curve - Weierstrass */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B512_29; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 121243; -const BIG CURVE_B= {0x1D99B,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x433555D,0x10A9F9C8,0x1F3490F3,0xD166CC0,0xBDC63B5,0xC76CBE8,0xC6D3F09,0x1F729CF0,0x1F5B3CA4,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -const BIG CURVE_Gx= {0xCABAE57,0x4143CAC,0x1BD778B7,0x1AC026FA,0x15831D5,0x14312AB,0x167A4DE5,0xA20ED66,0x195021A1,0x129836CF,0x1141B830,0xA03ED0A,0xCAD83BB,0x1E9DA94C,0xDC00A80,0x1527B45,0x1447141D,0x1D601}; -const BIG CURVE_Gy= {0x183527A6,0x1D043B01,0x1F43FA48,0x16B83C99,0x5602CF2,0x1420592D,0x17A70486,0x1B5161DD,0x14A28415,0x3DE8A78,0x3D2C983,0x17797719,0x197DBDEA,0x15D88025,0x1BBB718F,0xAD679C1,0x14CA29AD,0x4A1D2}; -const BIG CURVE_HTPC= {0x1FFFFEE3,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x3FFFF}; -#endif - -#if CHUNK==64 - -using namespace B512_60; - -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 121243; -const BIG CURVE_B= {0x1D99BL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0xE153F390433555DL,0x568B36607CD243CL,0x258ED97D0BDC63BL,0xA4FB94E7831B4FCL,0xFFFFFFFFFFF5B3CL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG CURVE_Gx= {0xC8287958CABAE57L,0x5D60137D6F5DE2DL,0x94286255615831DL,0xA151076B359E937L,0xC25306D9F95021L,0x3BB501F6854506EL,0x2A03D3B5298CAD8L,0x141D0A93DA2B700L,0x3AC03447L}; -const BIG CURVE_Gy= {0x3A08760383527A6L,0x2B5C1E4CFD0FE92L,0x1A840B25A5602CFL,0x15DA8B0EEDE9C12L,0x60C7BD14F14A284L,0xDEABBCBB8C8F4B2L,0xC63EBB1004B97DBL,0x29AD56B3CE0EEEDL,0x943A54CAL}; -const BIG CURVE_HTPC= {0xFFFFFFFFFFFFEE3L,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0x7FFFFFFFL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_SECP160R1.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_SECP160R1.cpp deleted file mode 100644 index 03ffa33..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_SECP160R1.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_SECP160R1.h" - -namespace SECP160R1 { - -/* Curve SECP160R1 */ - -#if CHUNK==16 - -using namespace B160_13; -// Base Bits= 13 - -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0x1A45,0xB2F,0xB71,0x9A9,0x181D,0x1C4F,0x16B3,0x116C,0x1D7A,0x2A5,0xFBF,0x192F,0x1}; -const BIG CURVE_Order= {0x257,0x13A9,0x14F2,0xF5D,0xF92,0x1A64,0x7,0x0,0x0,0x0,0x0,0x0,0x10}; -const BIG CURVE_Gx= {0x1C82,0x1E5F,0xE44,0x717,0x168C,0x14C4,0x1991,0x508,0x1573,0x477,0xD5A,0x152D,0x4}; -const BIG CURVE_Gy= {0x1B32,0x162F,0xDDE,0x6A2,0x42,0x489,0x773,0xFAB,0x894,0x98B,0xA15,0x74C,0x2}; -const BIG CURVE_HTPC= {0xDA,0x12DE,0x1CE8,0x15F5,0x105D,0x1539,0xB39,0xDF,0x1A61,0x166A,0xF40,0x1CA1,0x1}; -#endif - -#if CHUNK==32 - -using namespace B160_29; - -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0x565FA45,0xEA6A56E,0xB3E27E0,0x1AF516CB,0x1BEFC54B,0xE4B}; -const BIG CURVE_Order= {0xA752257,0x93D769E,0x7D323E,0x0,0x0,0x8000}; -const BIG CURVE_Gx= {0x13CBFC82,0x61C5DC8,0x191A625A,0xAE6508C,0xB5688EF,0x254B}; -const BIG CURVE_Gy= {0x1AC5FB32,0x11A89BB,0x17324481,0x1128FAB3,0x2855316,0x11D3}; -const BIG CURVE_HTPC= {0x25BC0DA,0xED7D79D,0x139A9CC1,0x14C20DF5,0xBD02CD5,0xF28}; -#endif - -#if CHUNK==64 - -using namespace B160_56; - -// Base Bits= 56 -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0xD4D4ADC565FA45L,0x7A8B65ACF89F81L,0x1C97BEFC54BDL}; -const BIG CURVE_Order= {0x27AED3CA752257L,0x1F4C8F9L,0x1000000000000L}; -const BIG CURVE_Gx= {0xC38BB913CBFC82L,0x73284664698968L,0x4A96B5688EF5L}; -const BIG CURVE_Gy= {0x2351377AC5FB32L,0x947D59DCC91204L,0x23A628553168L}; -const BIG CURVE_HTPC= {0xDAFAF3A25BC0DAL,0x6106FACE6A7305L,0x1E50BD02CD5AL}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_SECP256K1.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_SECP256K1.cpp deleted file mode 100644 index 5241cb1..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_SECP256K1.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_SECP256K1.h" - -namespace SECP256K1 { - -/* Curve SECP256K1 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 7; -const BIG CURVE_B= {0x7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x364141,0xD25E8CD,0x8A03BBF,0xDCE6AF4,0xFFEBAAE,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xF}; -const BIG CURVE_Gx= {0x6F81798,0xF2815B1,0xE28D959,0xFCDB2DC,0xB07029B,0x95CE870,0xC55A062,0xF9DCBBA,0x9BE667E,0x7}; -const BIG CURVE_Gy= {0xB10D4B8,0x47D08FF,0x554199C,0xB448A68,0x8A8FD17,0xFC0E110,0x55DA4FB,0x26A3C46,0x83ADA77,0x4}; -//const BIG HTPC= {0xCD5F852,0x8D27AE1,0x4ECD47D,0x6D15DA1,0x62CC61F,0xC2A7979,0xF233770,0x3507F1D,0xA2D2BA9,0x0}; -const BIG CURVE_HTPC= {0xE8624AA,0xC813789,0xF508ECD,0xCA45C23,0xD8BBBFD,0x640A39C,0xF4D5B4,0x813FFE3,0xCE8E9E8,0xC}; - -#if HTC_ISO_SECP256K1 != 0 -const BIG CURVE_Ad= {0xA444533,0x5447C01,0xF0E5D40,0xD363CB6,0x272E953,0x58F0F5D,0xCA08A55,0xDD661AD,0xF8731AB,0x3}; -const BIG CURVE_Bd= {0x6EB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG PC[13]= {{0xAAAA88C,0x38E38DA,0xE38E38E,0x8E38E38,0x38E38E3,0xE38E38E,0x8E38E38,0x38E38E3,0xE38E38E,0x8},{0xD9DD262,0xCBD0B53,0xC40314E,0x6144037,0xAECE450,0xDECA25C,0x6E2A413,0x23F234E,0x34C328D,0x5},{0x17C6581,0xFF1044F,0x63B92DF,0xD2FC0BF,0x4C5D595,0xCEA7FD4,0x5B9F315,0xBC321D,0x7D3D4C8,0x0},{0xAAAA8C7,0x38E38DA,0xE38E38E,0x8E38E38,0x38E38E3,0xE38E38E,0x8E38E38,0x38E38E3,0xE38E38E,0x8},{0xA8C6D14,0x2A56612,0xE41BBC5,0x6B641F5,0x25406D3,0xD51B542,0xDF7C4B2,0x4383DC1,0xDADC6F6,0xE},{0x81EB49B,0xE6B7457,0x8487D9F,0x409542F,0xDD86CD,0xCBB7B64,0xA9CA34C,0x3D94918,0x3577119,0xD},{0x8E38D84,0xBDA12F3,0xA12F684,0x2F684BD,0x684BDA1,0x4BDA12F,0xDA12F68,0x12F684B,0xF684BDA,0x2},{0xECEE931,0x65E85A9,0xE2018A7,0x30A201B,0x5767228,0xEF6512E,0x3715209,0x91F91A7,0x9A61946,0x2},{0x1D71A3,0xFC90FC2,0x6DA6FDF,0xB046D68,0x6D5647A,0x4B12A0A,0xFA9D0A5,0xD5CB7C0,0x75E0C32,0xC},{0xE38E23C,0x2F684B8,0x684BDA1,0x4BDA12F,0xDA12F68,0x12F684B,0xF684BDA,0x84BDA12,0xBDA12F6,0x4},{0xFD2A76F,0xBF8192B,0xD6299A7,0x21162F0,0x37E0A3D,0x3FA8FE3,0xCF3A70C,0x6545CA2,0x484AA71,0x6},{0x85C2573,0xB425D26,0x8D978DF,0xC1BFC8E,0x2989467,0x632722C,0xFD5E9E6,0xB8BDB49,0xA06534B,0x7},{0xFFFF93B,0xFFFFFEF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xF}}; -#endif - -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const int CURVE_Cof_I=1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 7; -const BIG CURVE_B= {0x7L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0xD25E8CD0364141L,0xDCE6AF48A03BBFL,0xFFFFFFFFFEBAAEL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG CURVE_Gx= {0xF2815B16F81798L,0xFCDB2DCE28D959L,0x95CE870B07029BL,0xF9DCBBAC55A062L,0x79BE667EL}; -const BIG CURVE_Gy= {0x47D08FFB10D4B8L,0xB448A68554199CL,0xFC0E1108A8FD17L,0x26A3C4655DA4FBL,0x483ADA77L}; -//const BIG HTPC= {0x8D27AE1CD5F852L,0x6D15DA14ECD47DL,0xC2A797962CC61FL,0x3507F1DF233770L,0xA2D2BA9L}; -const BIG CURVE_HTPC= {0xC813789E8624AAL,0xCA45C23F508ECDL,0x640A39CD8BBBFDL,0x813FFE30F4D5B4L,0xCCE8E9E8L}; - -#if HTC_ISO_SECP256K1 != 0 -const BIG CURVE_Ad= {0x5447C01A444533L,0xD363CB6F0E5D40L,0x58F0F5D272E953L,0xDD661ADCA08A55L,0x3F8731ABL}; -const BIG CURVE_Bd= {0x6EBL,0x0L,0x0L,0x0L,0x0L}; -const BIG PC[13]= {{0x38E38DAAAAA88CL,0x8E38E38E38E38EL,0xE38E38E38E38E3L,0x38E38E38E38E38L,0x8E38E38EL},{0xCBD0B53D9DD262L,0x6144037C40314EL,0xDECA25CAECE450L,0x23F234E6E2A413L,0x534C328DL},{0xFF1044F17C6581L,0xD2FC0BF63B92DFL,0xCEA7FD44C5D595L,0xBC321D5B9F315L,0x7D3D4C8L},{0x38E38DAAAAA8C7L,0x8E38E38E38E38EL,0xE38E38E38E38E3L,0x38E38E38E38E38L,0x8E38E38EL},{0x2A56612A8C6D14L,0x6B641F5E41BBC5L,0xD51B54225406D3L,0x4383DC1DF7C4B2L,0xEDADC6F6L},{0xE6B745781EB49BL,0x409542F8487D9FL,0xCBB7B640DD86CDL,0x3D94918A9CA34CL,0xD3577119L},{0xBDA12F38E38D84L,0x2F684BDA12F684L,0x4BDA12F684BDA1L,0x12F684BDA12F68L,0x2F684BDAL},{0x65E85A9ECEE931L,0x30A201BE2018A7L,0xEF6512E5767228L,0x91F91A73715209L,0x29A61946L},{0xFC90FC201D71A3L,0xB046D686DA6FDFL,0x4B12A0A6D5647AL,0xD5CB7C0FA9D0A5L,0xC75E0C32L},{0x2F684B8E38E23CL,0x4BDA12F684BDA1L,0x12F684BDA12F68L,0x84BDA12F684BDAL,0x4BDA12F6L},{0xBF8192BFD2A76FL,0x21162F0D6299A7L,0x3FA8FE337E0A3DL,0x6545CA2CF3A70CL,0x6484AA71L},{0xB425D2685C2573L,0xC1BFC8E8D978DFL,0x632722C2989467L,0xB8BDB49FD5E9E6L,0x7A06534BL},{0xFFFFFEFFFFF93BL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFL}}; -#endif - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_SM2.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_SM2.cpp deleted file mode 100644 index ddf9230..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_SM2.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_SM2.h" - -namespace SM2 { - -/* Curve SM2 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0xD940E93,0xBCBD414,0xB8F92DD,0x89F515A,0x9A7F397,0x4BCF650,0x44D5A9E,0x9D9F5E3,0x8E9FA9E,0x2}; -const BIG CURVE_Order= {0x9D54123,0xBBF4093,0x6052B53,0xDF6B21C,0xFFF7203,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFE,0xF}; -const BIG CURVE_Gx= {0x34C74C7,0x5A45893,0x60BE171,0xBBFF26,0x9948FE3,0x466A39C,0x95F9904,0x1F19811,0x2C4AE2C,0x3}; -const BIG CURVE_Gy= {0x139F0A0,0xDF32E52,0xA474002,0x877CC62,0x153D0A9,0xE36B692,0xC59BDCE,0xF4F6779,0xC3736A2,0xB}; -const BIG CURVE_HTPC= {0xFFFFFFF,0xFFFFFFF,0x55555FF,0xFFFF555,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xAAAAAA9,0xA}; - -#endif - -#if CHUNK==64 - -using namespace B256_56; - -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 0; -const BIG CURVE_B= {0xBCBD414D940E93L,0x89F515AB8F92DDL,0x4BCF6509A7F397L,0x9D9F5E344D5A9EL,0x28E9FA9EL}; -const BIG CURVE_Order= {0xBBF40939D54123L,0xDF6B21C6052B53L,0xFFFFFFFFFF7203L,0xFFFFFFFFFFFFFFL,0xFFFFFFFEL}; -const BIG CURVE_Gx= {0x5A4589334C74C7L,0xBBFF2660BE171L,0x466A39C9948FE3L,0x1F1981195F9904L,0x32C4AE2CL}; -const BIG CURVE_Gy= {0xDF32E52139F0A0L,0x877CC62A474002L,0xE36B692153D0A9L,0xF4F6779C59BDCEL,0xBC3736A2L}; -const BIG CURVE_HTPC= {0xFFFFFFFFFFFFFFL,0xFFFF55555555FFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xAAAAAAA9L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_TWEEDLEDEE.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_TWEEDLEDEE.cpp deleted file mode 100644 index 7e6e35a..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_TWEEDLEDEE.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_TWEEDLEDEE.h" - - -namespace TWEEDLEDEE { -/* TWEEDLEDEE Curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_29; - -//*** rom curve parameters ***** -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 5; -const BIG CURVE_B= {0x5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x1,0xA032710,0xFD66E68,0x15424ED8,0x38,0x0,0x0,0x0,0x400000}; -const BIG CURVE_Gx= {0x0,0x1657EA0,0x18A1B261,0x15424ED2,0x38,0x0,0x0,0x0,0x400000}; -const BIG CURVE_Gy= {0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_HTPC= {0xD69C848,0x1C30E5ED,0xBBDA1CC,0x180EA8CE,0xE9704A,0x1172DE0D,0x1C820B1A,0x1BC54C92,0x3AC188}; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -//*** rom curve parameters ***** -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 5; -const BIG CURVE_B= {0x5L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x4064E200000001L,0xA1276C3F59B9A1L,0x38AL,0x0L,0x40000000L}; -const BIG CURVE_Gx= {0x2CAFD400000000L,0xA127696286C984L,0x38AL,0x0L,0x40000000L}; -const BIG CURVE_Gy= {0x2L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_HTPC= {0x861CBDAD69C848L,0x754672EF68733L,0xE5BC1A0E9704ACL,0x2A64972082C6A2L,0x3AC188DEL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_TWEEDLEDUM.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_TWEEDLEDUM.cpp deleted file mode 100644 index bfe803e..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_TWEEDLEDUM.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_TWEEDLEDUM.h" - - -namespace TWEEDLEDUM { -/* TWEEDLEDUM Curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_29; - -//*** rom curve parameters ***** -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I= 5; -const BIG CURVE_B= {0x5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0x1,0x1657EA0,0x18A1B261,0x15424ED2,0x38,0x0,0x0,0x0,0x400000}; -const BIG CURVE_Gx= {0x0,0xA032710,0xFD66E68,0x15424ED8,0x38,0x0,0x0,0x0,0x400000}; -const BIG CURVE_Gy= {0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_HTPC= {0x1381795,0x16B3AA9A,0xF3EF0D9,0x15DD7A0,0xBAA53E1,0xC45B655,0xFD3BC53,0x1E66E041,0x3AB46C}; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -//*** rom curve parameters ***** -const int CURVE_Cof_I= 1; -const BIG CURVE_Cof= {0x1L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I= 5; -const BIG CURVE_B= {0x5L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x2CAFD400000001L,0xA127696286C984L,0x38AL,0x0L,0x40000000L}; -const BIG CURVE_Gx= {0x4064E200000000L,0xA1276C3F59B9A1L,0x38AL,0x0L,0x40000000L}; -const BIG CURVE_Gy= {0x2L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_HTPC= {0xD6755341381795L,0xAEEBD03CFBC366L,0x8B6CAABAA53E10L,0x37020BF4EF14D8L,0x3AB46CF3L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_X448.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_X448.cpp deleted file mode 100644 index 52d8001..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_curve_X448.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "ecp_X448.h" - -namespace X448 { - -/* Curve X448 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B448_29; - -const int CURVE_Cof_I= 4; -const BIG CURVE_Cof= {0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG CURVE_Order= {0xB5844F3,0x1BC61495,0x1163D548,0x1984E51B,0x3690216,0xDA4D76B,0xFA7113B,0x1FEF9944,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FF}; -const BIG CURVE_Gx= {0x5}; -const BIG CURVE_HTPC= {0x1FFFFFFE,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FDFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFF}; -#endif - -#if CHUNK==64 - -using namespace B448_58; - -const int CURVE_Cof_I= 4; -const BIG CURVE_Cof= {0x4L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG CURVE_Order= {0x378C292AB5844F3L,0x3309CA37163D548L,0x1B49AED63690216L,0x3FDF3288FA7113BL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0xFFFFFFFFFFL}; -const BIG CURVE_Gx= {0x5L}; -const BIG CURVE_HTPC= {0x3FFFFFFFFFFFFFEL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FBFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFL}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_ANSSI.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_ANSSI.cpp deleted file mode 100644 index e2d6f30..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_ANSSI.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_ANSSI.h" - -namespace ANSSI { - -/* ANNSI Curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -// Base Bits= 28 -const BIG Modulus= {0x86E9C03,0xFCF353D,0x8CA6DE8,0xADBCABC,0x35B3961,0xE8CE424,0xF10126D,0xB3AD58,0x1FD178C,0xF}; -const BIG ROI= {0x86E9C02,0xFCF353D,0x8CA6DE8,0xADBCABC,0x35B3961,0xE8CE424,0xF10126D,0xB3AD58,0x1FD178C,0xF}; -const BIG R2modp= {0x288CC9C,0x18D2374,0x646BD2B,0x4929E67,0xD6F7F2D,0x220E6C1,0xABCE02E,0x751B1FD,0x7401B78,0xE}; -const chunk MConst= 0x64E1155; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0xFCF353D86E9C03L,0xADBCABC8CA6DE8L,0xE8CE42435B3961L,0xB3AD58F10126DL,0xF1FD178CL}; -const BIG ROI= {0xFCF353D86E9C02L,0xADBCABC8CA6DE8L,0xE8CE42435B3961L,0xB3AD58F10126DL,0xF1FD178CL}; -const BIG R2modp= {0x18D2374288CC9CL,0x4929E67646BD2BL,0x220E6C1D6F7F2DL,0x751B1FDABCE02EL,0xE7401B78L}; -const chunk MConst= 0x97483A164E1155L; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS12381.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS12381.cpp deleted file mode 100644 index f7fbfd0..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS12381.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_BLS12381.h" - -namespace BLS12381 { - -/* Curve BLS12381 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B384_29; - -// Base Bits= 29 -const BIG Modulus= {0x1FFFAAAB,0xFF7FFFF,0x14FFFFEE,0x17FFFD62,0xF6241EA,0x9507B58,0xAFD9CC3,0x109E70A2,0x1764774B,0x121A5D66,0x12C6E9ED,0x12FFCD34,0x111EA3,0xD}; -const BIG ROI= {0x1FFFAAAA,0xFF7FFFF,0x14FFFFEE,0x17FFFD62,0xF6241EA,0x9507B58,0xAFD9CC3,0x109E70A2,0x1764774B,0x121A5D66,0x12C6E9ED,0x12FFCD34,0x111EA3,0xD}; -const BIG R2modp= {0x15BEF7AE,0x1031CD0E,0x2DD93E8,0x9226323,0xE6E2CD2,0x11684DAA,0x1170E5DB,0x88E25B1,0x1B366399,0x1C536F47,0xD1F9CBC,0x278B67F,0x1EA66A2B,0xC}; -const BIG CRu= {0x1FFEFFFE,0x100FFFFF,0x280008B,0xFB026C4,0x9688DE1,0x149DF37C,0x1FAB76CE,0xED41EE,0x11BA69C6,0x1EFBB672,0x17C659CB,0x0,0x0,0x0}; -const chunk MConst= 0x1FFCFFFD; -const BIG Fra= {0x12235FB8,0x83BAF6C,0x19E04F63,0x1D4A7AC7,0xB9C4F67,0x1EBC25D,0x1D3DEC91,0x1FA797AB,0x1F0FD603,0x1016068,0x108C6FAD,0x5760CCF,0x104D3BF0,0xC}; -const BIG Frb= {0xDDC4AF3,0x7BC5093,0x1B1FB08B,0x1AB5829A,0x3C5F282,0x764B8FB,0xDBFB032,0x10F6D8F6,0x1854A147,0x1118FCFD,0x23A7A40,0xD89C065,0xFC3E2B3,0x0}; -const BIG SQRTm3= {0x1AAAE,0xFD80000,0xFFFFED7,0x189FAFDA,0x1C912627,0x14945F,0xBA6AF26,0xEC3ECC4,0x13EFA3BF,0x1422F081,0x33A3655,0x12FFCD33,0x111EA3,0xD}; -#endif - -#if CHUNK==64 - -using namespace B384_58; -// Base Bits= 58 -const BIG Modulus= {0x1FEFFFFFFFFAAABL,0x2FFFFAC54FFFFEEL,0x12A0F6B0F6241EAL,0x213CE144AFD9CC3L,0x2434BACD764774BL,0x25FF9A692C6E9EDL,0x1A0111EA3L}; -const BIG ROI= {0x1FEFFFFFFFFAAAAL,0x2FFFFAC54FFFFEEL,0x12A0F6B0F6241EAL,0x213CE144AFD9CC3L,0x2434BACD764774BL,0x25FF9A692C6E9EDL,0x1A0111EA3L}; -const BIG R2modp= {0x20639A1D5BEF7AEL,0x1244C6462DD93E8L,0x22D09B54E6E2CD2L,0x111C4B63170E5DBL,0x38A6DE8FB366399L,0x4F16CFED1F9CBCL,0x19EA66A2BL}; -const BIG CRu= {0x201FFFFFFFEFFFEL,0x1F604D88280008BL,0x293BE6F89688DE1L,0x1DA83DDFAB76CEL,0x3DF76CE51BA69C6L,0x17C659CBL,0x0L}; -const chunk MConst= 0x1F3FFFCFFFCFFFDL; -const BIG Fra= {0x10775ED92235FB8L,0x3A94F58F9E04F63L,0x3D784BAB9C4F67L,0x3F4F2F57D3DEC91L,0x202C0D1F0FD603L,0xAEC199F08C6FADL,0x1904D3BF0L}; -const BIG Frb= {0xF78A126DDC4AF3L,0x356B0535B1FB08BL,0xEC971F63C5F282L,0x21EDB1ECDBFB032L,0x2231F9FB854A147L,0x1B1380CA23A7A40L,0xFC3E2B3L}; -const BIG SQRTm3= {0x1FB00000001AAAEL,0x313F5FB4FFFFED7L,0x2928BFC912627L,0x1D87D988BA6AF26L,0x2845E1033EFA3BFL,0x25FF9A6633A3655L,0x1A0111EA3L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS12383.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS12383.cpp deleted file mode 100644 index a5b8849..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS12383.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_BLS12383.h" - -namespace BLS12383 { - -/* Curve BLS12383 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B384_29; - -// Base Bits= 29 -const BIG Modulus= {0x5AAB0AB,0x11B8EB24,0x19214AF6,0x187E5314,0x124F47A8,0x1C00B4B0,0x1446B0C6,0x59E6CB4,0x4A0AD46,0xFF5494,0x81B6B71,0x956DD6B,0x16556956,0x2A}; -const BIG ROI= {0x5AAB0AA,0x11B8EB24,0x19214AF6,0x187E5314,0x124F47A8,0x1C00B4B0,0x1446B0C6,0x59E6CB4,0x4A0AD46,0xFF5494,0x81B6B71,0x956DD6B,0x16556956,0x2A}; -const BIG R2modp= {0x116907F4,0x405B700,0x1752AC11,0x67A9E7C,0x1941C581,0x1AEA38C4,0xB1E4D22,0xCE841AE,0xA0FC49B,0xB4B1F48,0x13852312,0x1B3FDCED,0x1FECE397,0x26}; - -const BIG CRu= {0xEAAC2A9,0x61B3A81,0x17D974B7,0xBED0345,0xA341BC2,0x17A51A6F,0x5738948,0x69B7BAE,0x14605445,0x374A43,0x8116AD1,0x956DD69,0x16556956,0x2A}; -const chunk MConst= 0x73435FD; -const BIG Fra= {0x1311DAC1,0x296B969,0x19DCF806,0x126901FC,0xD8C8A36,0x1A2572A8,0xA1A0959,0x1A47F743,0x110E4C6C,0x1608DA97,0xCE2E7F0,0x4FED178,0xACD5BF0,0x11}; -const BIG Frb= {0x1298D5EA,0xF2231BA,0x1F4452F0,0x6155117,0x4C2BD72,0x1DB4208,0xA2CA76D,0xB567571,0x139260D9,0xAF679FC,0x1B388380,0x4580BF2,0xB880D66,0x19}; -const BIG SQRTm3= {0x17AAD4A8,0x1A7D89DE,0x16919E77,0x1F5BB376,0x218EFDB,0x1349802E,0x16A061CA,0x7988AA7,0x41FFB44,0x1F6F3FF3,0x8076A30,0x956DD67,0x16556956,0x2A}; -#endif - -#if CHUNK==64 - -using namespace B384_58; - -// Base Bits= 58 -const BIG Modulus= {0x2371D6485AAB0ABL,0x30FCA6299214AF6L,0x3801696124F47A8L,0xB3CD969446B0C6L,0x1FEA9284A0AD46L,0x12ADBAD681B6B71L,0x556556956L}; -const BIG ROI= {0x2371D6485AAB0AAL,0x30FCA6299214AF6L,0x3801696124F47A8L,0xB3CD969446B0C6L,0x1FEA9284A0AD46L,0x12ADBAD681B6B71L,0x556556956L}; -const BIG R2modp= {0x80B6E0116907F4L,0xCF53CF9752AC11L,0x35D47189941C581L,0x19D0835CB1E4D22L,0x16963E90A0FC49BL,0x367FB9DB3852312L,0x4DFECE397L}; - -const BIG CRu= {0xC367502EAAC2A9L,0x17DA068B7D974B7L,0x2F4A34DEA341BC2L,0xD36F75C5738948L,0x6E94874605445L,0x12ADBAD28116AD1L,0x556556956L}; -const chunk MConst= 0x1BC0571073435FDL; -const BIG Fra= {0x52D72D3311DAC1L,0x24D203F99DCF806L,0x344AE550D8C8A36L,0x348FEE86A1A0959L,0x2C11B52F10E4C6CL,0x9FDA2F0CE2E7F0L,0x22ACD5BF0L}; -const BIG Frb= {0x1E446375298D5EAL,0xC2AA22FF4452F0L,0x3B684104C2BD72L,0x16ACEAE2A2CA76DL,0x15ECF3F939260D9L,0x8B017E5B388380L,0x32B880D66L}; -const BIG SQRTm3= {0x34FB13BD7AAD4A8L,0x3EB766ED6919E77L,0x2693005C218EFDBL,0xF31154F6A061CAL,0x3EDE7FE641FFB44L,0x12ADBACE8076A30L,0x556556956L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS12443.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS12443.cpp deleted file mode 100644 index a63e1a0..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS12443.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_BLS12443.h" - -namespace BLS12443 { - -/* Curve BLS12443 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B448_29; - -// Base Bits= 29 -const BIG Modulus= {0x10AAAAAB,0x1FD55555,0x1921AAFF,0xA59AAAA,0x1424ABF7,0x19024801,0x1C42D855,0x96E429D,0x5119FF1,0x7855CAF,0x1020B3B1,0x4B6ABA4,0x92300A8,0x1054E434,0x1694F72C,0xAE}; -const BIG R2modp= {0x1118A8F7,0x1AB7CA8,0x2333712,0x132DCAD3,0x16E13882,0x10A03200,0x5B25363,0x9C87B7C,0xB9A40C9,0x975222C,0x28F658F,0x147AD511,0xF6028F0,0xBA52E95,0x262ED53,0x69}; -const BIG ROI= {0x10AAAAAA,0x1FD55555,0x1921AAFF,0xA59AAAA,0x1424ABF7,0x19024801,0x1C42D855,0x96E429D,0x5119FF1,0x7855CAF,0x1020B3B1,0x4B6ABA4,0x92300A8,0x1054E434,0x1694F72C,0xAE}; -const BIG SQRTm3= {0x14AAAAA8,0x1ED55556,0x16F7ACFF,0x6B6AA9,0x1E4D5046,0x1413E017,0x19DD9B9D,0x1E5F53AC,0x64B9158,0x1368614B,0x1F58A387,0x96E1519,0x8A07BAD,0x1054E434,0x1694F72C,0xAE}; -const BIG CRu= {0x2AAAAA9,0x1F555556,0x80CABFF,0x15628AAA,0x1938FE1E,0x168B140C,0xB1039F9,0x3E6CB25,0x5AE98A5,0xD76DEFD,0x7BCAB9C,0x1712605F,0x8E1BE2A,0x1054E434,0x1694F72C,0xAE}; -const chunk MConst= 0x15FFFFFD; -const BIG Fra= {0x49551C8,0x9D8A27E,0x1FACD18F,0x10236D5E,0x1D38DC4B,0xA2FCECB,0x46BF1F0,0x1C2F955E,0x1029E275,0x7D8436E,0x13DD8C0,0x1C9052A0,0x1979B8C6,0x1F97223F,0xC24C77,0x88}; -const BIG Frb= {0xC1558E3,0x15FCB2D7,0x1974D970,0x1A363D4B,0x16EBCFAB,0xED27935,0x17D6E665,0xD3EAD3F,0x14E7BD7B,0x1FAD1940,0xEE2DAF0,0x8265904,0xFA947E1,0x10BDC1F4,0x15D2AAB4,0x26}; -#endif - -#if CHUNK==64 - -using namespace B448_60; - -// Base Bits= 60 -const BIG Modulus= {0xFFAAAAAB0AAAAABL,0x752CD5556486ABFL,0x572049003424ABFL,0xF14B7214EF10B61L,0xEC4F0AB95E5119FL,0xA825B55D24082CL,0xDCB20A9C8689230L,0x575A53L}; -const BIG R2modp= {0xF5CDA0EB0AD64E2L,0xDE66AA74FAE046BL,0x8B9229B598075AEL,0xDFAFBC5DB0E321EL,0x9AF61017ADA96A8L,0xFFAEA657DE81FE0L,0x1800170F84B9395L,0x8E3DDL}; -const BIG ROI= {0xFFAAAAAB0AAAAAAL,0x752CD5556486ABFL,0x572049003424ABFL,0xF14B7214EF10B61L,0xEC4F0AB95E5119FL,0xA825B55D24082CL,0xDCB20A9C8689230L,0x575A53L}; -const BIG SQRTm3= {0xFDAAAAAD4AAAAA8L,0x6035B554DBDEB3FL,0x76827C02FE4D504L,0x58F2FA9D667766EL,0xE1E6D0C29664B91L,0xBAD4B70A8CFD628L,0xDCB20A9C8688A07L,0x575A53L}; -const BIG CRu= {0xFEAAAAAC2AAAAA9L,0xEAB145552032AFFL,0xE6D162819938FE1L,0xA51F36592AC40E7L,0xE71AEDBDFA5AE98L,0xE2AB89302F9EF2AL,0xDCB20A9C8688E1BL,0x575A53L}; -const chunk MConst= 0xC04000035FFFFFDL; -const BIG Fra= {0xD3B144FC49551C8L,0xB811B6AF7EB3463L,0xC145F9D97D38DC4L,0x75E17CAAF11AFC7L,0x300FB086DD029E2L,0x8C6E48295004F76L,0x31DFF2E447F979BL,0x440309L}; -const BIG Frb= {0x2BF965AEC1558E3L,0xBD1B1EA5E5D365CL,0x95DA4F26B6EBCFAL,0x7B69F569FDF5B99L,0xBC3F5A32814E7BDL,0x7E14132C823B8B6L,0xAAD217B83E8FA94L,0x13574AL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS12461.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS12461.cpp deleted file mode 100644 index 2c68a27..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS12461.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_BLS12461.h" - -namespace BLS12461 { - -/* Curve BLS12461 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B464_28; - -// Base Bits= 28 -const BIG Modulus= {0xAAAAAAB,0xAC0000A,0x54AAAAA,0x5555,0x400020,0x91557F0,0xF26AA,0xFA5C1CC,0xB42A8DF,0x7B14848,0x8BACCA4,0x6F1E32D,0x4935FBD,0x55D6941,0xD5A555A,0x5545554,0x1555}; -const BIG ROI= {0xAAAAAAA,0xAC0000A,0x54AAAAA,0x5555,0x400020,0x91557F0,0xF26AA,0xFA5C1CC,0xB42A8DF,0x7B14848,0x8BACCA4,0x6F1E32D,0x4935FBD,0x55D6941,0xD5A555A,0x5545554,0x1555}; -const BIG R2modp= {0xC9B6A33,0x2ECD087,0x3CCB2B1,0xCD461FE,0x8CB5AB2,0xC5B9635,0x5312E92,0xB659F64,0x3B596FA,0x8679006,0xA92E2B3,0x3CE05E3,0x363550F,0x7C07A8E,0x382C083,0x6347FEA,0xBD}; -const BIG CRu= {0xFFFFFFE,0x40001F,0xFE00000,0xFFE7FFF,0xF0FFF6F,0x7200C47,0x7BCC604,0x15796DB,0xCF47771,0x9875433,0x613F0E8,0x5000502,0xEBFFF60,0x1FFFFF,0x0,0x0,0x0}; -const chunk MConst= 0xFFFFFFD; -const BIG Fra= {0xB812A3A,0x7117BF9,0x99C400F,0xC6308A5,0x5BF8A1,0x510E075,0x45FA5A6,0xCE4858D,0x770B31A,0xBC2CB04,0xE2FC61E,0xD073588,0x4366190,0x4DFEFA8,0x69E55E2,0x504B7F,0x12E4}; -const BIG Frb= {0xF298071,0x3AE8410,0xBAE6A9B,0x39D4CAF,0xFE4077E,0x404777A,0xBAF8104,0x2C13C3E,0x3D1F5C5,0xBEE7D44,0xA8B0685,0x9EAADA4,0x5CFE2C,0x7D7999,0x6BBFF78,0x50409D5,0x271}; -const BIG SQRTm3= {0xAAAAAAE,0xA3FFFCA,0x58AAAAA,0x35555,0x2200140,0xAD53F60,0x959AA1,0xCF69415,0x159B9FD,0x4A29FE1,0xC92EAD3,0xCF1D928,0x71360FC,0x51D6941,0xD5A555A,0x5545554,0x1555}; -#endif - -#if CHUNK==64 - -using namespace B464_60; - -// Base Bits= 60 -const BIG Modulus= {0xAAC0000AAAAAAABL,0x20000555554AAAAL,0x6AA91557F004000L,0xA8DFFA5C1CC00F2L,0xACCA47B14848B42L,0x935FBD6F1E32D8BL,0xD5A555A55D69414L,0x15555545554L}; -const BIG ROI= {0xAAC0000AAAAAAAAL,0x20000555554AAAAL,0x6AA91557F004000L,0xA8DFFA5C1CC00F2L,0xACCA47B14848B42L,0x935FBD6F1E32D8BL,0xD5A555A55D69414L,0x15555545554L}; -const BIG R2modp= {0x96D08774614DDA8L,0xCD45F539225D5BDL,0xD712EB760C95AB1L,0xB3B687155F30B55L,0xC4E62A05C3F5B81L,0xBA1151676CA3CD0L,0x7EDD8A958F442BEL,0x12B89DD3F91L}; -const BIG CRu= {0x40001FFFFFFFEL,0x6FFFE7FFFFE0000L,0x6047200C47F0FFFL,0x777115796DB7BCCL,0x3F0E89875433CF4L,0xBFFF60500050261L,0x1FFFFFEL,0x0L}; -const chunk MConst= 0xC0005FFFFFFFDL; -const BIG Fra= {0xF7117BF9B812A3AL,0xA1C6308A599C400L,0x5A6510E07505BF8L,0xB31ACE4858D45FAL,0xFC61EBC2CB04770L,0x366190D073588E2L,0x69E55E24DFEFA84L,0x12E40504B7FL}; -const BIG Frb= {0xB3AE8410F298071L,0x7E39D4CAFBAE6A9L,0x104404777AFE407L,0xF5C52C13C3EBAF8L,0xB0685BEE7D443D1L,0x5CFE2C9EAADA4A8L,0x6BBFF7807D79990L,0x27150409D5L}; -const BIG SQRTm3= {0xAA3FFFCAAAAAAAEL,0x40003555558AAAAL,0xAA1AD53F6022001L,0xB9FDCF694150959L,0x2EAD34A29FE1159L,0x1360FCCF1D928C9L,0xD5A555A51D69417L,0x15555545554L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS24479.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS24479.cpp deleted file mode 100644 index 413382d..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS24479.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_BLS24479.h" - -namespace BLS24479 { - -/* Curve BLS24479 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B480_29; - -const BIG Modulus= {0xA06152B,0x2260B3A,0xB4C36BE,0x5FFC5D0,0xBDB6A64,0x5B78E2E,0x1C1A28CA,0x10E6441B,0x1F244061,0xB4704F0,0x141E5CCD,0x9837504,0x3F2E77E,0xD763740,0x1316EA0E,0xF0079,0x555C}; -const BIG ROI= {0xA06152A,0x2260B3A,0xB4C36BE,0x5FFC5D0,0xBDB6A64,0x5B78E2E,0x1C1A28CA,0x10E6441B,0x1F244061,0xB4704F0,0x141E5CCD,0x9837504,0x3F2E77E,0xD763740,0x1316EA0E,0xF0079,0x555C}; -const BIG R2modp= {0x8533EA9,0x6A02789,0x183B24DE,0x1E45ECF8,0xC8F8F37,0x10CAD209,0x4C0C4B8,0x9B1FABD,0xDEBE4C0,0xDC353F9,0x18A18E26,0x10F489BB,0x31206A5,0x19673BBF,0x6BE69F9,0xB091169,0x9CD}; -const BIG CRu= {0xDD794A9,0x1DE138A3,0x2BCCE90,0xC746127,0x15223DDC,0x1DD8890B,0xED08DB7,0xE24B9F,0xE379CE6,0x37011AC,0x11BAC820,0x1EEFAD01,0x200860F,0x147218A6,0xF16A209,0xF0079,0x555C}; -const chunk MConst= 0x95FE7D; -const BIG Fra= {0x1BF96F1D,0xAE53A55,0x31BFEEB,0x183FF17A,0x6237469,0x12A4F4F1,0x12101FE3,0x16E79D94,0xFF59267,0x5EB4EB4,0x78CC49F,0x274BA33,0x149184F3,0x16C6DCBA,0x1C90B694,0x10F729CE,0x4BBC}; -const BIG Frb= {0xE0CA60E,0x1740D0E4,0x83037D2,0xDBFD456,0x5B7F5FA,0x1312993D,0xA0A08E6,0x19FEA687,0xF2EADF9,0x55BB63C,0xC91982E,0x70EBAD1,0xF61628B,0x16AF5A85,0x16863379,0xF17D6AA,0x99F}; -const BIG SQRTm3= {0x11A91428,0x199C660C,0x1A2D6663,0x12E8FC7D,0x1E691154,0x15F983E8,0x186F2A5,0x10DE5323,0x1D4AF96A,0x1B991E67,0xF573372,0x145BE4FE,0xE24A1,0x1B6DFA0C,0xB165A04,0xF0079,0x555C}; -const BIG TWK= {0x16EA62F3,0x52C4905,0x17CF5F35,0x13967138,0x16BCA61B,0xF766FBB,0x9B547D6,0x11625BCD,0x1AFF154D,0xDE4D18C,0xF9C3EF8,0x84619DC,0x15E18EE4,0x1D55B149,0xED04681,0x64CDD9E,0x337A}; -#endif - -#if CHUNK==64 - -using namespace B480_56; -// Base Bits= 56 -const BIG Modulus= {0x44C1674A06152BL,0xFFE2E82D30DAF8L,0x6F1C5CBDB6A642L,0x3220DF068A328BL,0xE09E1F24406187L,0xBA825079733568L,0x6E803F2E77E4C1L,0x3CCC5BA839AECL,0x555C0078L}; -const BIG ROI= {0x44C1674A06152AL,0xFFE2E82D30DAF8L,0x6F1C5CBDB6A642L,0x3220DF068A328BL,0xE09E1F24406187L,0xBA825079733568L,0x6E803F2E77E4C1L,0x3CCC5BA839AECL,0x555C0078L}; -const BIG R2modp= {0x6A4A1FE013DF5BL,0xE8E46D4D1BDE65L,0x1F841391F45C67L,0x9148A4516FB28L,0x4398524EDF4C88L,0x41C0E241B6DCE8L,0xE42C208C19411L,0xA7FE6FD73A7B1CL,0xFCCCA76L}; -const BIG CRu= {0xBC27146DD794A9L,0x3A30938AF33A43L,0xB112175223DDC6L,0x125CFBB4236DFBL,0x2358E379CE607L,0xD680C6EB20806EL,0x314C200860FF77L,0x3CBC5A88268E4L,0x555C0078L}; -const chunk MConst= 0xBD5D7D8095FE7DL; -const BIG Fra= {0x5CA74ABBF96F1DL,0x1FF8BD0C6FFBADL,0x49E9E26237469CL,0x3CECA48407F8E5L,0x69D68FF59267B7L,0x5D199E33127CBDL,0xB97549184F313AL,0x4E77242DA52D8DL,0x4BBC87B9L}; -const BIG Frb= {0xE81A1C8E0CA60EL,0xDFEA2B20C0DF4AL,0x25327A5B7F5FA6L,0xF5343A828239A6L,0x76C78F2EADF9CFL,0x5D68B24660B8ABL,0xB50AF61628B387L,0xB555A18CDE6D5EL,0x99F78BEL}; -const BIG SQRTm3= {0x338CC191A91428L,0x747E3EE8B5998FL,0xF307D1E6911549L,0xF2991861BCA96BL,0x23CCFD4AF96A86L,0xF27F3D5CCDCB73L,0xF41800E24A1A2DL,0x3CAC5968136DBL,0x555C0078L}; -const BIG TWK= {0xA58920B6EA62F3L,0xCB389C5F3D7CD4L,0xECDF776BCA61B9L,0x12DE6A6D51F59EL,0x9A319AFF154D8BL,0xCEE3E70FBE1BCL,0x62935E18EE4423L,0xECF3B411A07AABL,0x337A3266L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS48286.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS48286.cpp deleted file mode 100644 index 7966399..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS48286.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_BLS48286.h" - -namespace BLS48286 { - -/* Curve BLS48286 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B288_29; - -// Base Bits= 29 -const BIG Modulus= {0x9C345B,0x13A815C9,0x38D4B67,0xC8388A5,0x4809AAF,0x63F0D60,0x516A1B2,0x16040390,0x11EC7BD7,0x14B9629}; -const BIG R2modp= {0x8484275,0x16B4A09C,0x13973525,0x19DBD350,0x188DE1C0,0x111BD51D,0x113A0F92,0x6489CAD,0xF188E5E,0xCED0C0}; -const BIG ROI= {0x9C345A,0x13A815C9,0x38D4B67,0xC8388A5,0x4809AAF,0x63F0D60,0x516A1B2,0x16040390,0x11EC7BD7,0x14B9629}; -const BIG CRu= {0x3773F7B,0xD329CB0,0xC2BB8E5,0x99D4594,0x667A6F2,0x1945AD4C,0x159AC407,0x20C33EA,0x332B8D8,0x14B921E}; -const chunk MConst= 0x16EA242D; -const BIG Fra= {0x1FC90183,0x15434AF9,0xF4FA4DB,0xAAD7DA3,0x8F09A7C,0x81F7813,0x1F8010F6,0x9D15D85,0xC522C11,0x6CA0BF}; -const BIG Frb= {0xD332D8,0x1E64CACF,0x143DA68B,0x1D60B01,0x1B900033,0x1E1F954C,0x59690BB,0xC32A60A,0x59A4FC6,0xDEF56A}; -const BIG SQRTm3= {0x6524A9C,0x6BD2397,0x14CA2663,0x6B70283,0x84EB335,0xC4C4D38,0x61EE65D,0xE146445,0x1478F5D8,0x14B8E12}; -const BIG TWK= {0x3D05DCC,0x13ECB9AE,0x10A9C2E6,0x132E0A8A,0x1AA2C6A1,0x65E8A65,0x19C887EF,0xA33E6E6,0xF448A33,0xE9076F}; -#endif - -#if CHUNK==64 - -using namespace B288_60; - -// Base Bits= 60 -const BIG Modulus= {0xE7502B9209C345BL,0xF641C4528E352D9L,0xC8C7E1AC04809AAL,0xD7B0201C8145A86L,0x2972C531EC7BL}; -const BIG R2modp= {0x61F9539D245AF2CL,0xA1991A6E51410D8L,0x1603A99FC661885L,0xC8A2CE485CD7822L,0xD54A6F0B25EL}; -const BIG ROI= {0xE7502B9209C345AL,0xF641C4528E352D9L,0xC8C7E1AC04809AAL,0xD7B0201C8145A86L,0x2972C531EC7BL}; -const BIG CRu= {0x5A6539603773F7BL,0x24CEA2CA30AEE39L,0x1F28B5A98667A6FL,0xD810619F5566B10L,0x297243C332B8L}; -const chunk MConst= 0x227E5D8F6EA242DL; -const BIG Fra= {0xEA8695F3FC90183L,0xC556BED1BD3E936L,0xD903EF0268F09A7L,0x114E8AEC2FE0043L,0xD9417EC522CL}; -const BIG Frb= {0xFCC9959E0D332D8L,0x30EB0580D0F69A2L,0xEFC3F2A99B90003L,0xC66195305165A42L,0x1BDEAD459A4FL}; -const BIG SQRTm3= {0xCD7A472E6524A9CL,0x535B8141D328998L,0x758989A7084EB33L,0xD870A3222987B99L,0x2971C25478F5L}; -const BIG TWK= {0xA7D9735C3D05DCCL,0x1997054542A70B9L,0xBCCBD14CBAA2C6AL,0x33519F37367221FL,0x1D20EDEF448AL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS48556.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS48556.cpp deleted file mode 100644 index 66b5331..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS48556.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_BLS48556.h" - -namespace BLS48556 { - -/* Curve BLS48556 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B560_29; - -// Base Bits= 29 -const BIG Modulus= {0x1CF6AC0B,0x17B7307F,0x19877E7B,0x12CE0134,0x14228402,0x1BD4C386,0x1DACBB04,0x40410D0,0x25A415,0x980B53E,0xDE6E250,0x15D9AAD6,0x5DA950,0x1029B7A,0x54AB351,0x14AD90CE,0x3729047,0x1FE7E2D9,0x145F610B,0x1F}; -const BIG ROI= {0x1CF6AC0A,0x17B7307F,0x19877E7B,0x12CE0134,0x14228402,0x1BD4C386,0x1DACBB04,0x40410D0,0x25A415,0x980B53E,0xDE6E250,0x15D9AAD6,0x5DA950,0x1029B7A,0x54AB351,0x14AD90CE,0x3729047,0x1FE7E2D9,0x145F610B,0x1F}; -const BIG R2modp= {0xD59D0FA,0x12F01FD0,0xDE8FD41,0x35AAEE1,0xB937F48,0x50700E8,0x1F50EFCE,0x1019B13C,0x3470A2F,0x11094115,0xF9FB72D,0x6AD10E2,0x1CFD9F8,0x44F4785,0x2B48793,0x1148ED3,0xF609E61,0x1EE34BC7,0x1735D29E,0x0}; -const BIG CRu= {0xCBBA429,0x1B273F3,0xD3DD160,0x19C61452,0x308093A,0x146E1E34,0xAE0E768,0x1185948,0x1B73BC2D,0x93D855C,0x1B1A639C,0x118C919B,0xFF04AE3,0xF1CCD77,0x91318E5,0x10644780,0x3A79F7,0x1BE77919,0x145F60F3,0x1F}; -const chunk MConst= 0x9DA805D; -const BIG Fra= {0x1325BF89,0x1311E7EC,0xCD0A56F,0x1A0FD46E,0xE83BCCA,0xCA97DD0,0x18D1D297,0x5F1E137,0x7AB9F2C,0x13FC255F,0x1C9DECEB,0x9DEF4A2,0x3C0F60B,0x1D9909E4,0x1FF27FF7,0x1DBF8208,0x89BB36C,0x40044E0,0x62E01EE,0x5}; -const BIG Frb= {0x1325BF89,0x1311E7EC,0xCD0A56F,0x1A0FD46E,0xE83BCCA,0xCA97DD0,0x18D1D297,0x5F1E137,0x7AB9F2C,0x13FC255F,0x1C9DECEB,0x9DEF4A2,0x3C0F60B,0x1D9909E4,0x1FF27FF7,0x1DBF8208,0x89BB36C,0x40044E0,0x62E01EE,0x5}; -const BIG SQRTm3= {0x1C809C48,0xBADB766,0xF42444,0xBE2770,0x11ED8E73,0xD0778E1,0x181513CC,0x1E2CA1BF,0x16C1D444,0x8FA557B,0x84DE4E8,0xD3F7861,0x1F82EC76,0x1D36FF74,0xCDB7E79,0xC1AFE32,0x1D0263A7,0x17E70F58,0x145F60DB,0x1F}; -const BIG TWK= {0x16F9937,0x9133D51,0xD89F92B,0x17A682C,0x16600368,0x1830F509,0x1531266E,0x159D972D,0x1C269C72,0x46E0687,0xCAA903,0x1EEF4D3A,0xED502F8,0x1046B2AB,0x1EC6EF4F,0xFD93805,0x1EEEDD57,0xD0AFF3F,0xC83E724,0x8}; -#endif - -#if CHUNK==64 - -using namespace B560_58; - -// Base Bits= 58 -const BIG Modulus= {0x2F6E60FFCF6AC0BL,0x259C02699877E7BL,0x37A9870D4228402L,0x80821A1DACBB04L,0x13016A7C025A415L,0x2BB355ACDE6E250L,0x20536F405DA950L,0x295B219C54AB351L,0x3FCFC5B23729047L,0x3F45F610BL}; -const BIG ROI= {0x2F6E60FFCF6AC0AL,0x259C02699877E7BL,0x37A9870D4228402L,0x80821A1DACBB04L,0x13016A7C025A415L,0x2BB355ACDE6E250L,0x20536F405DA950L,0x295B219C54AB351L,0x3FCFC5B23729047L,0x3F45F610BL}; -const BIG R2modp= {0x25E03FA0D59D0FAL,0x6B55DC2DE8FD41L,0xA0E01D0B937F48L,0x20336279F50EFCEL,0x2212822A3470A2FL,0xD5A21C4F9FB72DL,0x89E8F0A1CFD9F8L,0x2291DA62B48793L,0x3DC6978EF609E61L,0x1735D29EL}; -const BIG CRu= {0x364E7E6CBBA429L,0x338C28A4D3DD160L,0x28DC3C68308093AL,0x230B290AE0E768L,0x127B0AB9B73BC2DL,0x23192337B1A639CL,0x1E399AEEFF04AE3L,0x20C88F0091318E5L,0x37CEF23203A79F7L,0x3F45F60F3L}; -const chunk MConst= 0x21BFCBCA9DA805DL; -const BIG Fra= {0x2623CFD9325BF89L,0x341FA8DCCD0A56FL,0x1952FBA0E83BCCAL,0xBE3C26F8D1D297L,0x27F84ABE7AB9F2CL,0x13BDE945C9DECEBL,0x3B3213C83C0F60BL,0x3B7F0411FF27FF7L,0x80089C089BB36CL,0xA62E01EEL}; -const BIG Frb= {0x2623CFD9325BF89L,0x341FA8DCCD0A56FL,0x1952FBA0E83BCCAL,0xBE3C26F8D1D297L,0x27F84ABE7AB9F2CL,0x13BDE945C9DECEBL,0x3B3213C83C0F60BL,0x3B7F0411FF27FF7L,0x80089C089BB36CL,0xA62E01EEL}; -const BIG SQRTm3= {0x175B6ECDC809C48L,0x17C4EE00F42444L,0x1A0EF1C31ED8E73L,0x3C59437F81513CCL,0x11F4AAF76C1D444L,0x1A7EF0C284DE4E8L,0x3A6DFEE9F82EC76L,0x1835FC64CDB7E79L,0x2FCE1EB1D0263A7L,0x3F45F60DBL}; -const BIG TWK= {0x12267AA216F9937L,0x2F4D058D89F92BL,0x3061EA136600368L,0x2B3B2E5B531266EL,0x8DC0D0FC269C72L,0x3DDE9A740CAA903L,0x208D6556ED502F8L,0x1FB2700BEC6EF4FL,0x1A15FE7FEEEDD57L,0x10C83E724L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS48581.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS48581.cpp deleted file mode 100644 index f0af263..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BLS48581.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_BLS48581.h" - -namespace BLS48581 { - -/* Curve BLS48581 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B584_29; - -// Base Bits= 29 -const BIG Modulus= {0x565912B,0x16E0AA73,0x12922B0F,0x1FBEE434,0xEE0A578,0x12A898B8,0xBDA0D9E,0x9E8E6DB,0x19CD3039,0x17041566,0x2B90EBD,0xEA88949,0xC0F1F39,0x18DD9DF3,0x1E344884,0xADD09,0x1D47012A,0x9C12718,0x1CD1DBCC,0x501EE7F,0x1}; -const BIG ROI= {0x565912A,0x16E0AA73,0x12922B0F,0x1FBEE434,0xEE0A578,0x12A898B8,0xBDA0D9E,0x9E8E6DB,0x19CD3039,0x17041566,0x2B90EBD,0xEA88949,0xC0F1F39,0x18DD9DF3,0x1E344884,0xADD09,0x1D47012A,0x9C12718,0x1CD1DBCC,0x501EE7F,0x1}; -const BIG R2modp= {0x19BCC5B0,0x126A343E,0xA46F6C0,0x29B7799,0xB758510,0x1357043D,0x1DC2D482,0x115A8C75,0x1F6CA5F6,0x9B40365,0x16E1C7DB,0x1A304684,0xA85F60F,0x16E21141,0x1D5AE21,0xD9EA745,0x1641FB69,0x249C4AC,0xA2B23E1,0x14FCE472,0x0}; -const BIG CRu= {0x1C79B90,0x6F4D62F,0x3977A09,0x19B1C7F1,0x1421A205,0x190FBA7B,0x16D758AA,0x129736C1,0x2F43166,0x115AFDC,0x1E9AA9CD,0xD508D6B,0xBED6FF4,0x1360F2FE,0x95960F5,0x709E55F,0x1F4E2096,0x2AEEAE8,0xB1A2DD4,0x0,0x0}; -const chunk MConst= 0x39D5A7D; -const BIG Fra= {0x42AEB25,0x1175B67F,0x182B4FE5,0x1683284E,0x115ECE4D,0x1EF92B83,0x22B03E9,0x6EF6A24,0x8C41890,0x4249F0E,0x61F9A1,0xC60FC53,0x16B62F49,0x71E57E,0xF9E161D,0xFA08F30,0x1E55F606,0x1AE6BF39,0x140527E9,0x1FA61B6,0x0}; -const BIG Frb= {0x42AEB25,0x1175B67F,0x182B4FE5,0x1683284E,0x115ECE4D,0x1EF92B83,0x22B03E9,0x6EF6A24,0x8C41890,0x4249F0E,0x61F9A1,0xC60FC53,0x16B62F49,0x71E57E,0xF9E161D,0xFA08F30,0x1E55F606,0x1AE6BF39,0x140527E9,0x1FA61B6,0x0}; -const BIG SQRTm3= {0x1D65A0A,0x8F6FE15,0xB6336FD,0xC5B5452,0x69D616D,0x8923C1,0x1E2B5C49,0x4BA7957,0x13E4CD6C,0x14D8B5AE,0x583BB23,0x14076E71,0x14343F50,0x121BB7F6,0xB818699,0x11F7124B,0x1EAABFFD,0x4635146,0x69D8024,0x501EE7F,0x1}; -const BIG TWK= {0x1F426953,0x1DA19E92,0xEE618F5,0x159C8B24,0xD37E160,0x145DEFD1,0xD2F0630,0x1FF9915F,0x2C4F62,0xDA1C978,0x51E0598,0x4FD2A34,0x132462ED,0x13341DC2,0x81D59C2,0x19374271,0x1D9EAEB8,0x1ABB4E6E,0xDEF0401,0x74CB4A,0x0}; -#endif - -#if CHUNK==64 - -using namespace B584_60; - -// Base Bits= 60 -const BIG Modulus= {0xEDC154E6565912BL,0x8FDF721A4A48AC3L,0x7A5513170EE0A57L,0x394F4736DAF6836L,0xAF6E082ACD9CD30L,0xF3975444A48AE43L,0x22131BB3BE6C0F1L,0x12A0056E84F8D1L,0x76F313824E31D47L,0x1280F73FF34L}; -const BIG ROI= {0xEDC154E6565912AL,0x8FDF721A4A48AC3L,0x7A5513170EE0A57L,0x394F4736DAF6836L,0xAF6E082ACD9CD30L,0xF3975444A48AE43L,0x22131BB3BE6C0F1L,0x12A0056E84F8D1L,0x76F313824E31D47L,0x1280F73FF34L}; -const BIG R2modp= {0x79868479F1B5833L,0xFB6EBA8FCB82D07L,0x9CC8A7F1FD84C7FL,0x402C51CF5CC3CBBL,0x3F3114F078502CL,0xFC90829BDC8336EL,0xC7BE91DE9CA8EEDL,0xD4D273BB17BFADBL,0x6EC7C9A81E792CAL,0x1DC317A6E4L}; -const BIG CRu= {0x4DE9AC5E1C79B90L,0x5CD8E3F88E5DE82L,0xAB21F74F7421A20L,0x6694B9B60DB5D62L,0x73422B5FB82F431L,0xFF46A846B5FA6AAL,0x83D66C1E5FCBED6L,0x2096384F2AFA565L,0x8B75055DD5D1F4EL,0x2C6L}; -const chunk MConst= 0x148B81FC39D5A7DL; -const BIG Fra= {0x62EB6CFE42AEB25L,0xDB41942760AD3F9L,0xA7DF2570715ECE4L,0x90377B51208AC0FL,0x6848493E1C8C418L,0xF496307E298187EL,0x58740E3CAFD6B62L,0xF6067D047983E78L,0x49FA75CD7E73E55L,0xFD30DB501L}; -const BIG Frb= {0x62EB6CFE42AEB25L,0xDB41942760AD3F9L,0xA7DF2570715ECE4L,0x90377B51208AC0FL,0x6848493E1C8C418L,0xF496307E298187EL,0x58740E3CAFD6B62L,0xF6067D047983E78L,0x49FA75CD7E73E55L,0xFD30DB501L}; -const BIG SQRTm3= {0x51EDFC2A1D65A0AL,0xD62DAA292D8CDBFL,0x24112478269D616L,0x6C25D3CABF8AD71L,0xC8E9B16B5D3E4CDL,0xF50A03B738960EEL,0x1A664376FED4343L,0xBFFD8FB8925AE06L,0x600908C6A28DEAAL,0x1280F73F9A7L}; -const BIG TWK= {0x7B433D25F426953L,0xACE45923B9863DL,0xC28BBDFA2D37E16L,0x62FFCC8AFB4BC18L,0x661B4392F002C4FL,0x2ED27E951A14781L,0x670A6683B853246L,0xAEB8C9BA138A075L,0xC10075769CDDD9EL,0x3A65A537BL}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BN158.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BN158.cpp deleted file mode 100644 index 7e0d583..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BN158.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_BN158.h" - -namespace BN158 { - -/* Curve BN158 - Pairing friendly BN curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B160_28; - -// Base Bits= 28 -const BIG Modulus= {0xB04E013,0x72280A,0xFD3FB95,0x9953CF6,0x27628C,0x24012}; -const BIG R2modp= {0x545973D,0xA60739B,0x65DB288,0x526165,0xB226C,0x17315}; -const BIG ROI= {0xB04E012,0x72280A,0xFD3FB95,0x9953CF6,0x27628C,0x24012}; -const BIG SQRTm3= {0x8018004,0x7F0E404,0x99F4CE2,0x95F35CA,0x2761FC,0x24012}; -const BIG CRu= {0x181B007,0x440A203,0x31A5759,0x1B0396,0x48,0x0}; -const chunk MConst= 0x4F615E5; -const BIG Fra= {0x6ECE2A9,0xA167429,0x99296F2,0xE1BF21C,0xCF82A02,0xA85E}; -const BIG Frb= {0x417FD6A,0x65BB3E1,0x64164A2,0xB794ADA,0x32F3889,0x197B3}; -#endif - -#if CHUNK==64 - -using namespace B160_56; - -// Base Bits= 56 -const BIG Modulus= {0x72280AB04E013L,0x9953CF6FD3FB95L,0x24012027628CL}; -const BIG R2modp= {0xA60739B545973DL,0x52616565DB288L,0x1731500B226CL}; -const BIG ROI= {0x72280AB04E012L,0x9953CF6FD3FB95L,0x24012027628CL}; -const BIG SQRTm3= {0x7F0E4048018004L,0x95F35CA99F4CE2L,0x2401202761FCL}; -const BIG CRu= {0x440A203181B007L,0x1B039631A5759L,0x48L}; -const chunk MConst= 0xFC609004F615E5L; -const BIG Fra= {0xA1674296ECE2A9L,0xE1BF21C99296F2L,0xA85ECF82A02L}; -const BIG Frb= {0x65BB3E1417FD6AL,0xB794ADA64164A2L,0x197B332F3889L}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BN254.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BN254.cpp deleted file mode 100644 index 9588d4a..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BN254.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_BN254.h" - -namespace BN254 { - -/* Curve BN254 - Pairing friendly BN curve */ - -/* Nogami's fast curve */ - -#if CHUNK==16 - -using namespace B256_13; - -// Base Bits= 13 -const BIG Modulus= {0x13,0x0,0x0,0x0,0x1A70,0x9,0x0,0x0,0x100,0x309,0x2,0x0,0x1800,0x1A26,0x6E8,0x0,0x0,0x412,0x8D9,0x4A}; -const BIG ROI= {0x12,0x0,0x0,0x0,0x1A70,0x9,0x0,0x0,0x100,0x309,0x2,0x0,0x1800,0x1A26,0x6E8,0x0,0x0,0x412,0x8D9,0x4A}; -const BIG R2modp= {0xF32,0x239,0x14DC,0xCE8,0x928,0x11B6,0x130F,0x1183,0x56E,0x1AEE,0x124F,0xD2A,0x7F8,0x1CE6,0x1B50,0x77C,0x3A,0x1A9E,0x1EFD,0x1C}; -const BIG CRu= {0x7,0x0,0x0,0x0,0xCD8,0x3,0x0,0x0,0x900,0x1248,0x0,0x0,0x400,0x19B1,0x126,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0x15E5; -const BIG Fra= {0xDE9,0x1953,0x101B,0x1BCD,0xE17,0x1BE1,0x14FD,0x1249,0x974,0x1C28,0x54F,0x108D,0x150A,0x4CD,0x12D9,0xF91,0x12E,0x10C9,0xDDD,0x36}; -const BIG Frb= {0x122A,0x6AC,0xFE4,0x432,0xC58,0x428,0xB02,0xDB6,0x178B,0x6E0,0x1AB2,0xF72,0x2F5,0x1559,0x140F,0x106E,0x1ED1,0x1348,0x1AFB,0x13}; -const BIG SQRTm3= {0x4,0x0,0x0,0x0,0xC0,0x3,0x0,0x0,0xF00,0x1E78,0x0,0x0,0x1000,0x6C4,0x49B,0x0,0x0,0x412,0x8D9,0x4A}; -#endif - -#if CHUNK==32 - -using namespace B256_28; - -// Base Bits= 28 -const BIG Modulus= {0x13,0x0,0x13A7,0x0,0x86121,0x8000000,0x1BA344D,0x4000000,0x5236482,0x2}; -const BIG ROI= {0x12,0x0,0x13A7,0x0,0x86121,0x8000000,0x1BA344D,0x4000000,0x5236482,0x2}; -const BIG R2modp= {0xF5E7E39,0x2F2A96F,0xB96F13C,0x64E8642,0xC7146,0x9926F7B,0x4DACD24,0x8321E7B,0xD127A2E,0x1}; -const BIG CRu= {0x7,0x8000000,0x6CD,0x0,0x24909,0x4000000,0x49B362,0x0,0x0,0x0}; -const chunk MConst= 0x79435E5; -const BIG Fra= {0xF2A6DE9,0x7DE6C06,0xF77C2E1,0x74924D3,0x53F8509,0x50A8469,0xCB6499B,0x212E7C8,0xB377619,0x1}; -const BIG Frb= {0xD5922A,0x82193F9,0x8850C5,0x8B6DB2C,0xAC8DC17,0x2F57B96,0x503EAB2,0x1ED1837,0x9EBEE69,0x0}; -const BIG SQRTm3= {0x4,0x0,0x60C,0x0,0x3CF0F,0x0,0x126CD89,0x4000000,0x5236482,0x2}; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0x13L,0x13A7L,0x80000000086121L,0x40000001BA344DL,0x25236482L}; -const BIG ROI= {0x12L,0x13A7L,0x80000000086121L,0x40000001BA344DL,0x25236482L}; -const BIG R2modp= {0x2F2A96FF5E7E39L,0x64E8642B96F13CL,0x9926F7B00C7146L,0x8321E7B4DACD24L,0x1D127A2EL}; -const BIG CRu= {0x80000000000007L,0x6CDL,0x40000000024909L,0x49B362L,0x0L}; -const chunk MConst= 0x435E50D79435E5L; -const BIG Fra= {0x7DE6C06F2A6DE9L,0x74924D3F77C2E1L,0x50A846953F8509L,0x212E7C8CB6499BL,0x1B377619L}; -const BIG Frb= {0x82193F90D5922AL,0x8B6DB2C08850C5L,0x2F57B96AC8DC17L,0x1ED1837503EAB2L,0x9EBEE69L}; -const BIG SQRTm3= {0x4L,0x60CL,0x3CF0FL,0x4000000126CD89L,0x25236482L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BN254CX.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BN254CX.cpp deleted file mode 100644 index 6eaa2f5..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BN254CX.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_BN254CX.h" - -namespace BN254CX { - -/* Curve BN254CX - Pairing friendly BN curve */ - -/* CertiVox BN curve/field */ - -#if CHUNK==16 - -using namespace B256_13; - -// Base Bits= 13 -const BIG Modulus= {0x15B3,0xDA,0x1BD7,0xC47,0x1BE6,0x1F70,0x24,0x1DC3,0x1FD6,0x1921,0x19B4,0x14C6,0x1647,0x1EEF,0x16C2,0x541,0x870,0x0,0x0,0x48}; -const BIG ROI= {0x15B2,0xDA,0x1BD7,0xC47,0x1BE6,0x1F70,0x24,0x1DC3,0x1FD6,0x1921,0x19B4,0x14C6,0x1647,0x1EEF,0x16C2,0x541,0x870,0x0,0x0,0x48}; -const BIG R2modp= {0x1527,0x146B,0x12A7,0x1A60,0x1E0A,0x1382,0x2BC,0x1D3F,0xB30,0xA8,0xD19,0x11AB,0x1D40,0x1965,0xD6D,0x643,0x10FF,0x1BC7,0x1E61,0x31}; -const BIG CRu= {0x1C97,0x11A,0x5E5,0x126,0x31E,0x3AB,0x7BE,0xC8E,0x1DDF,0x205,0xFC5,0x1950,0x0,0x0,0x120,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0x1E85; -const BIG Fra= {0xEA3,0xE40,0xCD5,0x1210,0x15BD,0x1C10,0x5CF,0x4DE,0x773,0x343,0x626,0x194E,0x18AA,0x10C5,0x12BF,0x2C,0x63A,0x17D,0x1642,0x26}; -const BIG Frb= {0x710,0x129A,0xF01,0x1A37,0x628,0x360,0x1A55,0x18E4,0x1863,0x15DE,0x138E,0x1B78,0x1D9C,0xE29,0x403,0x515,0x236,0x1E83,0x9BD,0x21}; -const BIG SQRTm3= {0x1C84,0x1EA4,0x100C,0x9FB,0x15AA,0x181A,0x10A8,0x4A6,0x418,0x1516,0x1A2A,0x225,0x1646,0x1EEF,0x1482,0x541,0x870,0x0,0x0,0x48}; -#endif - -#if CHUNK==32 - -using namespace B256_28; - -// Base Bits= 28 -const BIG Modulus= {0xC1B55B3,0x6623EF5,0x93EE1BE,0xD6EE180,0x6D3243F,0x647A636,0xDB0BDDF,0x8702A0,0x4000000,0x2}; -const BIG ROI= {0xC1B55B2,0x6623EF5,0x93EE1BE,0xD6EE180,0x6D3243F,0x647A636,0xDB0BDDF,0x8702A0,0x4000000,0x2}; -const BIG R2modp= {0x8A0800A,0x466A061,0x43056A3,0x2B3A225,0x9C6600,0x148515B,0x6BDF50,0xEC9EA56,0xC992E66,0x1}; -const chunk MConst= 0x9789E85; -const BIG Fra= {0x5C80EA3,0xD908335,0x3F8215B,0x7326F17,0x8986867,0x8AACA71,0x4AFE18B,0xA63A016,0x359082F,0x1}; -const BIG Frb= {0x6534710,0x8D1BBC0,0x546C062,0x63C7269,0xE3ABBD8,0xD9CDBC4,0x900DC53,0x623628A,0xA6F7D0,0x1}; -const BIG SQRTm3= {0x3D49C84,0xA4FDC03,0xA30355A,0x1825342,0x8AAA2C4,0x646112E,0xD20BDDF,0x8702A0,0x4000000,0x2}; - -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0x6623EF5C1B55B3L,0xD6EE18093EE1BEL,0x647A6366D3243FL,0x8702A0DB0BDDFL,0x24000000L}; -const BIG ROI= {0x6623EF5C1B55B2L,0xD6EE18093EE1BEL,0x647A6366D3243FL,0x8702A0DB0BDDFL,0x24000000L}; -const BIG R2modp= {0x466A0618A0800AL,0x2B3A22543056A3L,0x148515B09C6600L,0xEC9EA5606BDF50L,0x1C992E66L}; -const chunk MConst= 0x4E205BF9789E85L; -const BIG Fra= {0xD9083355C80EA3L,0x7326F173F8215BL,0x8AACA718986867L,0xA63A0164AFE18BL,0x1359082FL}; -const BIG Frb= {0x8D1BBC06534710L,0x63C7269546C062L,0xD9CDBC4E3ABBD8L,0x623628A900DC53L,0x10A6F7D0L}; -const BIG SQRTm3= {0xA4FDC033D49C84L,0x1825342A30355AL,0x646112E8AAA2C4L,0x8702A0D20BDDFL,0x24000000L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BN462.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BN462.cpp deleted file mode 100644 index e3af5c1..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BN462.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_BN462.h" - -namespace BN462 { - -/* Curve BN462 - Pairing friendly BN curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B464_28; - -// Base Bits= 28 -const BIG Modulus= {0x138013,0x1B0084,0x24,0xF640000,0xC6FF687,0xF6FF66F,0xFFFFFFF,0xC8020FF,0x2908F41,0xD81,0xA000000,0xB7D9BFC,0x6FF0CF6,0xFFFFFFF,0x23FFF,0x8036012,0x2404}; -const BIG ROI= {0x138012,0x1B0084,0x24,0xF640000,0xC6FF687,0xF6FF66F,0xFFFFFFF,0xC8020FF,0x2908F41,0xD81,0xA000000,0xB7D9BFC,0x6FF0CF6,0xFFFFFFF,0x23FFF,0x8036012,0x2404}; -const BIG R2modp= {0x88F9612,0xC8B9999,0x247088C,0xDB3ACD5,0xCA792EF,0x6E92E73,0x34F5999,0x4273E13,0x6714A6A,0xCBFE239,0xA0E2617,0x2487CB3,0xBE0EA3C,0x97791E4,0x8A07DE5,0x56CFA97,0x373}; -const BIG CRu= {0x4235C97,0xE093179,0xF875631,0xDF6471E,0xF1440BD,0xCA83,0x480000,0x0,0x0,0x0}; -const chunk MConst= 0x11BB5E5; -const BIG Fra= {0x2575D1A,0xE4BE3FF,0x659DBDE,0xFC7D89,0x93FA118,0xD45D1D,0xCC78D9,0x6217331,0xD547C05,0xC792504,0x9A87E11,0x92ED03A,0x1727085,0xB5A8CC1,0xB40BCFD,0xF4348CB,0x16F}; -const BIG Frb= {0x55FF85B,0x204AE09,0x57BEB62,0x9023886,0xD630A20,0xF94F4B,0x84FF0D0,0x14A1A7A,0xB1DBADB,0xB00D8E4,0x1E85F7,0x7493CA0,0x68325B2,0x2008E6B,0xE90EA88,0x7F80940,0x23C3}; -const BIG SQRTm3= {0x210022,0x2400CC,0x24,0xEF80000,0xB07F12F,0xF6FF4BF,0xFFFFFFF,0x7C032FF,0x440AEC2,0xD81,0x8000000,0xDFD2FFB,0x6FF03F5,0xFFFFFFF,0x23FFF,0x8036012,0x2404}; -#endif - -#if CHUNK==64 - -using namespace B464_60; - -// Base Bits= 60 -const BIG Modulus= {0x401B00840138013L,0x87F640000000002L,0xFFFF6FF66FC6FF6L,0x8F41C8020FFFFFFL,0xD81290L,0xFF0CF6B7D9BFCA0L,0x23FFFFFFFFFF6L,0x24048036012L}; -const BIG ROI= {0x401B00840138012L,0x87F640000000002L,0xFFFF6FF66FC6FF6L,0x8F41C8020FFFFFFL,0xD81290L,0xFF0CF6B7D9BFCA0L,0x23FFFFFFFFFF6L,0x24048036012L}; -const BIG R2modp= {0x89118D28DC21038L,0x1C24CD524708896L,0x96F6AF594FD13D3L,0xFC17B3AFB34F599L,0x617CBFE0F54B3BCL,0x105034B613F1E2L,0x47E597791E4CB9L,0x12EACA995DAL}; -const BIG CRu= {0xE0931794235C97L,0xDF6471EF875631L,0xCA83F1440BDL,0x480000L,0x0L}; -const chunk MConst= 0x718CE9E711BB5E5L; -const BIG Fra= {0xEE4BE3FF2575D1AL,0x180FC7D89659DBDL,0x8D90D45D1D93FA1L,0x7C0562173310CC7L,0x87E11C792504D54L,0x72708592ED03A9AL,0xB40BCFDB5A8CC11L,0x16FF4348CBL}; -const BIG Frb= {0x2204AE0955FF85BL,0x20902388657BEB6L,0xD00F94F4BD630AL,0xBADB14A1A7A84FFL,0xE85F7B00D8E4B1DL,0x8325B27493CA001L,0xE90EA882008E6B6L,0x23C37F80940L}; -const BIG SQRTm3= {0x402400CC0210022L,0x2FEF80000000002L,0xFFFF6FF4BFB07F1L,0xAEC27C032FFFFFFL,0xD81440L,0xFF03F5DFD2FFB80L,0x23FFFFFFFFFF6L,0x24048036012L}; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BRAINPOOL.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BRAINPOOL.cpp deleted file mode 100644 index 008745f..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_BRAINPOOL.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_BRAINPOOL.h" - -namespace BRAINPOOL { - -/* Brainpool Modulus */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -// Base Bits= 28 -const BIG Modulus= {0xF6E5377,0x13481D1,0x6202820,0xF623D52,0xD726E3B,0x909D838,0xC3E660A,0xA1EEA9B,0x9FB57DB,0xA}; -const BIG ROI= {0xF6E5376,0x13481D1,0x6202820,0xF623D52,0xD726E3B,0x909D838,0xC3E660A,0xA1EEA9B,0x9FB57DB,0xA}; -const BIG R2modp= {0xB9A3787,0x9E04F49,0x8F3CF49,0x2931721,0xF1DBC89,0x54E8C3C,0xF7559CA,0xBB411A3,0x773E15F,0x9}; -const chunk MConst= 0xEFD89B9; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0x13481D1F6E5377L,0xF623D526202820L,0x909D838D726E3BL,0xA1EEA9BC3E660AL,0xA9FB57DBL}; -const BIG ROI= {0x13481D1F6E5376L,0xF623D526202820L,0x909D838D726E3BL,0xA1EEA9BC3E660AL,0xA9FB57DBL}; -const BIG R2modp= {0x9E04F49B9A3787L,0x29317218F3CF49L,0x54E8C3CF1DBC89L,0xBB411A3F7559CAL,0x9773E15FL}; -const chunk MConst= 0xA75590CEFD89B9L; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_C1174.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_C1174.cpp deleted file mode 100644 index dbbf0f5..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_C1174.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_C1174.h" - -namespace C1174 { - -/* Curve C1174 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_29; - -// Base Bits= 29 -const BIG Modulus= {0x1FFFFFF7,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -const BIG R2modp= {0x5100000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG ROI= {0x1FFFFFF6,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -const chunk MConst= 0x9; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0xFFFFFFFFFFFFF7L,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0x7FFFFFFL}; -const BIG R2modp= {0x0L,0x144L,0x0L,0x0L,0x0L}; -const BIG ROI= {0xFFFFFFFFFFFFF6L,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0x7FFFFFFL}; -const chunk MConst= 0x9L; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_C1665.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_C1665.cpp deleted file mode 100644 index 1f2dea3..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_C1665.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_C1665.h" - -namespace C1665 { - -/* Curve C1665 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B168_29; - -// Base Bits= 29 -const BIG Modulus= {0x1FFFFFFB,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFF}; -const BIG R2modp= {0x190000,0x0,0x0,0x0,0x0,0x0}; -const BIG ROI= {0x1FFFFFFA,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFF}; -const chunk MConst= 0x5; -#endif - -#if CHUNK==64 - -using namespace B168_60; - -// Base Bits= 60 -const BIG Modulus= {0xFFFFFFFFFFFFFFBL,0xFFFFFFFFFFFFFFFL,0x3FFFFFFFFFFFL}; -const BIG R2modp= {0x190000000L,0x0L,0x0L}; -const BIG ROI= {0xFFFFFFFFFFFFFFAL,0xFFFFFFFFFFFFFFFL,0x3FFFFFFFFFFFL}; -const chunk MConst= 0x5L; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_C41417.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_C41417.cpp deleted file mode 100644 index 0c03263..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_C41417.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_C41417.h" - -namespace C41417 { - -/* Curve C41417 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B416_29; - -// Base Bits= 29 -const BIG Modulus= {0x1FFFFFEF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0xFF}; -const BIG ROI= {0x1FFFFFEE,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0xFF}; -const BIG R2modp= {0x0,0x242000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0x11; -#endif - -#if CHUNK==64 - -using namespace B416_60; - -// Base Bits= 60 -const BIG Modulus= {0xFFFFFFFFFFFFFEFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFL}; -const BIG ROI= {0xFFFFFFFFFFFFFEEL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFL}; -const BIG R2modp= {0x121000L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const chunk MConst= 0x11L; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F25519.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F25519.cpp deleted file mode 100644 index 67ae9e2..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F25519.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_F25519.h" - - -namespace F25519 { -/* Curve 25519 */ - -#if CHUNK==16 - -using namespace B256_13; - -// Base Bits= 13 -const BIG Modulus= {0x1FED,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0xFF}; -const BIG ROI= {0xB0,0x1075,0x9D2,0x1C36,0xC4E,0x123C,0x14BF,0xD5,0x318,0x197A,0x15E9,0x1BF7,0x993,0x680,0xCAD,0x1BE1,0xFC1,0x402,0xC9,0x57}; -const BIG R2modp= {0x400,0x2D,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0x13; - -#endif - -#if CHUNK==32 - -using namespace B256_29; - -// Base Bits= 29 -const BIG Modulus= {0x1FFFFFED,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFFF}; -const BIG ROI= {0xA0EA0B0,0x770D93A,0xBF91E31,0x6300D5A,0x1D7A72F4,0x4C9EFD,0x1C2CAD34,0x1009F83B,0x2B8324}; -const BIG R2modp= {0x169000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0x13; - - -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0xFFFFFFFFFFFFEDL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0x7FFFFFFFL}; -const BIG ROI= {0xEE1B274A0EA0B0L,0x1806AD2FE478C4L,0x993DFBD7A72F43L,0x4FC1DF0B2B4D00L,0x2B832480L}; -const BIG R2modp= {0xA4000000000000L,0x5L,0x0L,0x0L,0x0L}; -const chunk MConst= 0x13L; - - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F256PME.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F256PME.cpp deleted file mode 100644 index 4fc103f..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F256PME.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_F256PME.h" - -namespace F256PME { - -/* NUMS 256-bit modulus */ - - -#if CHUNK==16 - -using namespace B256_13; - -// Base Bits= 13 -const BIG Modulus= {0x1F43,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FF}; -const BIG ROI= {0x1F42,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FF}; -const BIG R2modp= {0x900,0x45C,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0xBD; -#endif - -#if CHUNK==32 - -using namespace B256_29; - -// Base Bits= 29 -const BIG Modulus= {0x1FFFFF43,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0xFFFFFF}; -const BIG ROI= {0x1FFFFF42,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0xFFFFFF}; -const BIG R2modp= {0x22E2400,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0xBD; - -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0xFFFFFFFFFFFF43L,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG ROI= {0xFFFFFFFFFFFF42L,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG R2modp= {0x89000000000000L,0x8BL,0x0L,0x0L,0x0L}; -const chunk MConst= 0xBDL; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F256PMW.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F256PMW.cpp deleted file mode 100644 index 8314087..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F256PMW.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_F256PMW.h" - -namespace F256PMW { - -/* NUMS 256-bit modulus */ - - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -// Base Bits= 28 -const BIG Modulus= {0xFFFFF43,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xF}; -const BIG ROI= {0xFFFFF42,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xF}; -const BIG R2modp= {0x0,0x8900000,0x8B,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0xBD; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0xFFFFFFFFFFFF43L,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG ROI= {0xFFFFFFFFFFFF42L,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG R2modp= {0x89000000000000L,0x8BL,0x0L,0x0L,0x0L}; -const chunk MConst= 0xBDL; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F384PM.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F384PM.cpp deleted file mode 100644 index 4331717..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F384PM.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_F384PM.h" - -namespace F384PM { - -/* NUMS 384-bit modulus */ - - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B384_29; - -// Base Bits= 29 -const BIG Modulus= {0x1FFFFEC3,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7F}; -const BIG ROI= {0x1FFFFEC2,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7F}; -const BIG R2modp= {0x0,0x4448000,0x6,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0x13D; -#endif - -#if CHUNK==64 - -using namespace B384_58; - -// Base Bits= 58 -const BIG Modulus= {0x3FFFFFFFFFFFEC3L,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0xFFFFFFFFFL}; -const BIG R2modp= {0x88900000000000L,0x6L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG ROI= {0x3FFFFFFFFFFFEC2L,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0xFFFFFFFFFL}; -const chunk MConst= 0x13DL; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F448.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F448.cpp deleted file mode 100644 index 15d291e..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F448.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_F448.h" - -namespace F448 { - -/* Curve Ed448 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B448_29; - -// Base Bits= 29 -const BIG Modulus= {0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FDFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFF}; -const BIG ROI= {0x1FFFFFFE,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FDFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFF}; -const BIG R2modp= {0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x3000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0x1; -//const int BTset= 224; - -#endif - -#if CHUNK==64 - -using namespace B448_58; - -// Base Bits= 58 -const BIG Modulus= {0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FBFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFL}; -const BIG ROI= {0x3FFFFFFFFFFFFFEL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FBFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFFFFFL,0x3FFFFFFFFFFL}; -const BIG R2modp= {0x200000000L,0x0L,0x0L,0x0L,0x3000000L,0x0L,0x0L,0x0L}; -const chunk MConst= 0x1L; -//const int BTset=224; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F512PM.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F512PM.cpp deleted file mode 100644 index 40388c3..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_F512PM.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_F512PM.h" - -namespace F512PM { - -/* NUMS 512-bit modulus */ - - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B512_29; - -// Base Bits= 29 -const BIG Modulus= {0x1FFFFDC7,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -const BIG ROI= {0x1FFFFDC6,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -const BIG R2modp= {0xB100000,0x278,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0x239; -#endif - -#if CHUNK==64 - -using namespace B512_60; - -// Base Bits= 60 -const BIG Modulus= {0xFFFFFFFFFFFFDC7L,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG R2modp= {0x100000000000000L,0x4F0BL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG ROI= {0xFFFFFFFFFFFFDC6L,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const chunk MConst= 0x239L; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_FP256BN.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_FP256BN.cpp deleted file mode 100644 index fa66c7a..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_FP256BN.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_FP256BN.h" - -namespace FP256BN { - -/* Curve FP512BN - Pairing friendly BN curve */ - -/* ISO curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -// Base Bits= 28 - -const BIG Modulus= {0xED33013,0x292DDBA,0x80A82D3,0x65FB129,0x49F0CDC,0x5EEE71A,0xD46E5F2,0xFFFCF0C,0xFFFFFFF,0xF}; -const BIG ROI= {0xED33012,0x292DDBA,0x80A82D3,0x65FB129,0x49F0CDC,0x5EEE71A,0xD46E5F2,0xFFFCF0C,0xFFFFFFF,0xF}; -const BIG R2modp= {0x3B9F8B,0xEDE3363,0xFEC54E8,0x92FFEE9,0x3C55F79,0x13C1C06,0xC0123FA,0xA12F2EA,0xE559B2A,0x8}; -const chunk MConst= 0x537E5E5; -const BIG CRu= {0x3A1B807,0x1C0A24A,0x32D1EDB,0xD79DF19,0x8659BCD,0x4092101,0x13988E1,0x0,0x0,0x0}; -const BIG Fra= {0xF943106,0x760328A,0xAB28F74,0x71511E3,0x7CF39A1,0x8DDB086,0x52D1A6E,0xCA786F3,0xD617662,0x3}; -const BIG Frb= {0xF3EFF0D,0xB32AB2F,0xD57F35E,0xF4A9F45,0xCCFD33A,0xD113693,0x819CB83,0x3584819,0x29E899D,0xC}; -const BIG SQRTm3= {0x78FC004,0xF119926,0x1B0451C,0xB6BF2F7,0x3D3D540,0xDDCA517,0xAD3D42F,0xFFFCF0C,0xFFFFFFF,0xF}; - -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0x292DDBAED33013L,0x65FB12980A82D3L,0x5EEE71A49F0CDCL,0xFFFCF0CD46E5F2L,0xFFFFFFFFL}; -const BIG ROI= {0x292DDBAED33012L,0x65FB12980A82D3L,0x5EEE71A49F0CDCL,0xFFFCF0CD46E5F2L,0xFFFFFFFFL}; -const BIG R2modp= {0xEDE336303B9F8BL,0x92FFEE9FEC54E8L,0x13C1C063C55F79L,0xA12F2EAC0123FAL,0x8E559B2AL}; -const chunk MConst= 0x6C964E0537E5E5L; -const BIG CRu= {0x1C0A24A3A1B807L,0xD79DF1932D1EDBL,0x40921018659BCDL,0x13988E1L,0x0L}; -const BIG Fra= {0x760328AF943106L,0x71511E3AB28F74L,0x8DDB0867CF39A1L,0xCA786F352D1A6EL,0x3D617662L}; -const BIG Frb= {0xB32AB2FF3EFF0DL,0xF4A9F45D57F35EL,0xD113693CCFD33AL,0x3584819819CB83L,0xC29E899DL}; -const BIG SQRTm3= {0xF11992678FC004L,0xB6BF2F71B0451CL,0xDDCA5173D3D540L,0xFFFCF0CAD3D42FL,0xFFFFFFFFL}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_FP512BN.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_FP512BN.cpp deleted file mode 100644 index e26c498..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_FP512BN.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_FP512BN.h" - -namespace FP512BN { - -/* Curve FP512BN - Pairing friendly BN curve */ - -/* ISO curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B512_29; - -// Base Bits= 29 - -const BIG Modulus= {0x2ADEF33,0x7594049,0x131919ED,0x14AB9CBE,0x16FE1916,0x12EF5591,0x2E39231,0x3D597D3,0x55146CF,0x88D877A,0x102EF8F0,0x1196A60F,0x1C60BA1D,0x1CF63F80,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -const BIG ROI= {0x2ADEF32,0x7594049,0x131919ED,0x14AB9CBE,0x16FE1916,0x12EF5591,0x2E39231,0x3D597D3,0x55146CF,0x88D877A,0x102EF8F0,0x1196A60F,0x1C60BA1D,0x1CF63F80,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -const BIG R2modp= {0xFD68B47,0xFCF5D2C,0x437675A,0x1BBC3FBF,0x1411E413,0x13453559,0x10B5639,0x1C34CE79,0x6D476BF,0xFD05F2B,0x15D17C28,0x6C9F76E,0x1C2375B3,0x78CCE9B,0x15F0AB33,0x1960F32E,0x1A8D44E,0x57A38}; -const chunk MConst= 0x1CCC5C05; -const BIG CRu= {0x1C79298A,0x1838B104,0x2C5F052,0x1DCCF337,0x6092AEC,0x4B35F29,0x1EB361E,0x11384EA,0x3074B20,0x17BB08FD,0x3A8B3E3,0xD70D66F,0x3D2A614,0x1CF63EE4,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; -const BIG Fra= {0x14B73AB2,0x4B0BD8F,0xABB47D,0x2A29EC4,0x18681E17,0x104069DE,0x12EED67D,0x1553D0A5,0x398E9F8,0x7971034,0xAC9AF23,0x52DEF23,0x14EA18A5,0x1463E345,0x6DE465A,0x17F212B4,0x1AA9CF5B,0xF7B8}; -const BIG Frb= {0xDF6B481,0x2A882B9,0x126D6570,0x1208FDFA,0x1E95FAFF,0x2AEEBB2,0xFF4BBB4,0xE81C72D,0x1B85CD6,0xF67746,0x56549CD,0xC68B6EC,0x776A178,0x8925C3B,0x1921B9A5,0x80DED4B,0x55630A4,0x70847}; -const BIG SQRTm3= {0x164463E2,0x91821C0,0x1272C6B8,0x6EE49AF,0x15143CC3,0x167768C0,0xF2DA0A,0x1E517201,0xBD4F70,0x6E88A80,0x17226ED7,0x94B06CE,0xB44920B,0x1CF63E47,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFFF}; - - -#endif - -#if CHUNK==64 - -using namespace B512_60; - -// Base Bits= 60 - -const BIG Modulus= {0x4EB280922ADEF33L,0x6A55CE5F4C6467BL,0xC65DEAB236FE191L,0xCF1EACBE98B8E48L,0x3C111B0EF455146L,0xA1D8CB5307C0BBEL,0xFFFF9EC7F01C60BL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG ROI= {0x4EB280922ADEF32L,0x6A55CE5F4C6467BL,0xC65DEAB236FE191L,0xCF1EACBE98B8E48L,0x3C111B0EF455146L,0xA1D8CB5307C0BBEL,0xFFFF9EC7F01C60BL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG R2modp= {0x1FA6DCEF99812E9L,0xAB3452895A0B74EL,0xC53EA988C079E1EL,0x1E90E033BA630B9L,0xF1EA41C0714D8B0L,0xE72785387509E28L,0xD86794F834DAB00L,0x9757C2ACCD342A1L,0x44ECB079L}; -const chunk MConst= 0x692A189FCCC5C05L; -const BIG CRu= {0xB0716209C79298AL,0xCEE6799B8B17C14L,0x78966BE526092AEL,0x20089C27507ACD8L,0xF8EF7611FA3074BL,0x6146B86B378EA2CL,0xFFFF9EC7DC83D2AL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG Fra= {0x49617B1F4B73AB2L,0x71514F6202AED1FL,0xF6080D3BD8681E1L,0xF8AA9E852CBBB59L,0xC8CF2E2068398E9L,0x8A5296F791AB26BL,0x196A8C7C68B4EA1L,0xCF5BBF9095A1B79L,0x1EF71AA9L}; -const BIG Frb= {0x5510572DF6B481L,0xF9047EFD49B595CL,0xD055DD765E95FAFL,0xD6740E396BFD2EEL,0x7341ECEE8C1B85CL,0x1786345B7615952L,0xE695124B876776AL,0x30A4406F6A5E486L,0xE108E556L}; -const BIG SQRTm3= {0x1230438164463E2L,0x337724D7C9CB1AEL,0x2ACEED1815143CCL,0x70F28B90083CB68L,0xB5CDD115000BD4FL,0x20B4A583675C89BL,0xFFFF9EC7C8EB449L,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFL}; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_HIFIVE.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_HIFIVE.cpp deleted file mode 100644 index 924cd1f..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_HIFIVE.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_HIFIVE.h" - -namespace HIFIVE { - -/* Curve HIFIVE */ - - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B336_29; - -// Base Bits= 29 -const BIG Modulus= {0x1FFFFFFD,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFF}; -const BIG ROI= {0x1559D3B8,0x1C02413F,0xFAB18DA,0x128A7172,0xB95DA4C,0x16D4FE54,0x3107D87,0xAA7BEF3,0x1C38B2B4,0x1A93C08F,0x10F80C7B,0x1F27F}; -const BIG R2modp= {0x9000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0x3; -#endif - -#if CHUNK==64 - -using namespace B336_60; - -// Base Bits= 60 -const BIG Modulus= {0xFFFFFFFFFFFFFFDL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFL}; -const BIG ROI= {0xB804827F559D3B8L,0xC94538B93EAC636L,0x1EDA9FCA8B95DA4L,0xB4553DF798C41F6L,0x1EF527811FC38B2L,0xF93FC3E03L}; -const BIG R2modp= {0x9000000000000L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const chunk MConst= 0x3L; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_JUBJUB.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_JUBJUB.cpp deleted file mode 100644 index a20171f..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_JUBJUB.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_JUBJUB.h" - -namespace JUBJUB { - -/* JUBJUB Modulus */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_29; - -// Base Bits= 29 -const BIG Modulus= {0x1,0x1FFFFFF8,0x1F96FFBF,0x1B4805FF,0x1D80553B,0xC0404D0,0x1520CCE7,0xA6533AF,0x73EDA7}; -const BIG ROI= {0xB912F1F,0x1BC47A80,0xCF82506,0x49FE4E1,0xD6C0C40,0x16E468B4,0xDBC3F55,0x13CB682D,0x212D7}; -const BIG R2modp= {0xA71B3C0,0x1D32207E,0x1663D999,0x1C5ABC93,0x3B58C44,0xBE37438,0x829F771,0x1660139E,0x27FD91}; -const chunk MConst= 0x1FFFFFFF; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0xFFFFFF00000001L,0xA402FFFE5BFEFFL,0x809A1D80553BDL,0x299D7D483339D8L,0x73EDA753L}; -const BIG ROI= {0x788F500B912F1FL,0x4FF270B3E0941BL,0xC8D168D6C0C402L,0x5B416B6F0FD56DL,0x212D79EL}; -const BIG R2modp= {0x3B3440EC31BBA9L,0x8929657E045FB0L,0x2D645CF57C6E1AL,0xEA6A1C5012ECF5L,0x3C7B9D12L}; -const chunk MConst= 0xFFFFFEFFFFFFFFL; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_MDC.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_MDC.cpp deleted file mode 100644 index a193694..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_MDC.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_MDC.h" - -namespace MDC { - -/* Million Dollar Curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -// Base Bits= 28 -const BIG Modulus= {0x779EC13,0x3710405,0x7AF9EC1,0x9037EF0,0xD4F086A,0xFDD7A5F,0x4532F92,0xD456AFB,0x13B68B9,0xF}; -const BIG R2modp= {0xDA5D1FE,0xDE5B77F,0x2985975,0x3228385,0x95FA423,0xA24A9FC,0xA869FAE,0x6853D0E,0xEC4B765,0x3}; -const BIG ROI= {0x779EC12,0x3710405,0x7AF9EC1,0x9037EF0,0xD4F086A,0xFDD7A5F,0x4532F92,0xD456AFB,0x13B68B9,0xF}; -const chunk MConst= 0xAE541E5; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0x3710405779EC13L,0x9037EF07AF9EC1L,0xFDD7A5FD4F086AL,0xD456AFB4532F92L,0xF13B68B9L}; -const BIG R2modp= {0xDE5B77FDA5D1FEL,0x32283852985975L,0xA24A9FC95FA423L,0x6853D0EA869FAEL,0x3EC4B765L}; -const BIG ROI= {0x3710405779EC12L,0x9037EF07AF9EC1L,0xFDD7A5FD4F086AL,0xD456AFB4532F92L,0xF13B68B9L}; -const chunk MConst= 0xF10FDDAAE541E5L; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_NIST256.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_NIST256.cpp deleted file mode 100644 index 234638e..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_NIST256.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_NIST256.h" - -namespace NIST256 { - -/* Curve NIST256 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -// Base Bits= 28 -const BIG Modulus= {0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFF,0x0,0x0,0x1000000,0x0,0xFFFFFFF,0xF}; -const BIG ROI= {0xFFFFFFE,0xFFFFFFF,0xFFFFFFF,0xFFF,0x0,0x0,0x1000000,0x0,0xFFFFFFF,0xF}; -const BIG R2modp= {0x50000,0x300000,0x0,0x0,0xFFFFFFA,0xFFFFFBF,0xFFFFEFF,0xFFFAFFF,0x2FFFF,0x0}; -const chunk MConst= 0x1; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFL,0x0L,0x1000000L,0xFFFFFFFFL}; -const BIG ROI= {0xFFFFFFFFFFFFFEL,0xFFFFFFFFFFL,0x0L,0x1000000L,0xFFFFFFFFL}; -const BIG R2modp= {0x3000000050000L,0x0L,0xFFFFFBFFFFFFFAL,0xFFFAFFFFFFFEFFL,0x2FFFFL}; -const chunk MConst= 0x1L; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_NIST384.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_NIST384.cpp deleted file mode 100644 index 59d5672..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_NIST384.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_NIST384.h" - -namespace NIST384 { - -/* Curve NIST384 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B384_29; - -// Base Bits= 29 -const BIG Modulus= {0x1FFFFFFF,0x7,0x0,0x1FFFFE00,0x1FFFEFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7F}; -const BIG ROI= {0x1FFFFFFE,0x7,0x0,0x1FFFFE00,0x1FFFEFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7F}; -const BIG R2modp= {0x0,0x8000,0x1FF80000,0x1FFFFF,0x2000000,0x0,0x0,0x1FFFFFFC,0xF,0x100,0x400,0x0,0x0,0x0}; -const chunk MConst= 0x1; -#endif - -#if CHUNK==64 - -using namespace B384_56; - -// Base Bits= 56 -const BIG Modulus= {0xFFFFFFFFL,0xFFFF0000000000L,0xFFFFFFFFFEFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFL}; -const BIG ROI= {0xFFFFFFFEL,0xFFFF0000000000L,0xFFFFFFFFFEFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFL}; -const BIG R2modp= {0xFE000000010000L,0xFFFFFFL,0x2L,0xFFFFFFFE00L,0x1000000020000L,0x0L,0x0L}; -const chunk MConst= 0x100000001L; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_NIST521.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_NIST521.cpp deleted file mode 100644 index 29ce9c1..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_NIST521.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_NIST521.h" - -namespace NIST521 { - -/* Curve NIST521 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B528_28; - -// Base Bits= 28 -const BIG Modulus= {0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0x1FFFF}; -const BIG ROI= {0xFFFFFFE,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0x1FFFF}; -const BIG R2modp= {0x400000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0x1; -#endif - -#if CHUNK==64 - -using namespace B528_60; - -// Base Bits= 60 -const BIG Modulus= {0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0x1FFFFFFFFFFL}; -const BIG ROI= {0xFFFFFFFFFFFFFFEL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFFL,0x1FFFFFFFFFFL}; -const BIG R2modp= {0x4000000000L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const chunk MConst= 0x1L; -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_SECP160R1.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_SECP160R1.cpp deleted file mode 100644 index 71fdf8e..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_SECP160R1.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_SECP160R1.h" - -namespace SECP160R1 { - -/* Curve SECP160R1 */ - -#if CHUNK==16 -using namespace B160_13; -// Base Bits= 13 -const BIG Modulus= {0x1FFF,0x1FFF,0x1FDF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0xF}; -const BIG R2modp= {0x0,0x20,0x0,0x800,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG ROI= {0x1FFE,0x1FFF,0x1FDF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0x1FFF,0xF}; -const chunk MConst= 0x1; - -#endif - -#if CHUNK==32 - -using namespace B160_29; - -// Base Bits= 29 - - -const BIG Modulus= {0x1FFFFFFF,0x1FFFFFFB,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFF}; -const BIG R2modp= {0x10000000,0x0,0x4,0x8,0x0,0x0}; -const BIG ROI= {0x1FFFFFFE,0x1FFFFFFB,0x1FFFFFFF,0x1FFFFFFF,0x1FFFFFFF,0x7FFF}; -const chunk MConst= 0x1; - - -#endif - -#if CHUNK==64 - -using namespace B160_56; - -// Base Bits= 56 -const BIG Modulus= {0xFFFFFF7FFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFL}; -const BIG R2modp= {0x1000000010000L,0x400000L,0x0L}; -const BIG ROI= {0xFFFFFF7FFFFFFEL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFL}; -const chunk MConst= 0xFFFFFF80000001L; - - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_SECP256K1.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_SECP256K1.cpp deleted file mode 100644 index 5d19274..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_SECP256K1.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_SECP256K1.h" - -namespace SECP256K1 { - -/* Curve SECP256K1 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -// Base Bits= 28 -const BIG Modulus= {0xFFFFC2F,0xFFFFFEF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xF}; -const BIG ROI= {0xFFFFC2E,0xFFFFFEF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xF}; -const BIG R2modp= {0x0,0xA100000,0x2000E90,0x7A,0x1,0x0,0x0,0x0,0x0,0x0}; -const chunk MConst= 0x2253531; -const BIG SQRTm3= {0x4,0x0,0x60C,0x0,0x3CF0F,0x0,0x126CD89,0x4000000,0x5236482,0x2}; - - -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0xFFFFFEFFFFFC2FL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG ROI= {0xFFFFFEFFFFFC2EL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFL}; -const BIG R2modp= {0xA1000000000000L,0x7A2000E90L,0x1L,0x0L,0x0L}; -const chunk MConst= 0x38091DD2253531L; -const BIG SQRTm3= {0x8D27AE1CD5F852L,0x6D15DA14ECD47DL,0xC2A797962CC61FL,0x3507F1DF233770L,0xA2D2BA9L}; - - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_SM2.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_SM2.cpp deleted file mode 100644 index de85654..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_SM2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_SM2.h" - -namespace SM2 { - -/* Curve SM2 */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_28; - -// Base Bits= 28 -const BIG Modulus= {0xFFFFFFF,0xFFFFFFF,0xFF,0xFFFF000,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFE,0xF}; -const BIG ROI= {0xFFFFFFE,0xFFFFFFF,0xFF,0xFFFF000,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFF,0xFFFFFFE,0xF}; -const BIG R2modp= {0x40000,0x300000,0xE000000,0xFFFFFFF,0x2,0x30,0x100,0x1000,0x60000,0x0}; -const chunk MConst= 0x1; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base Bits= 56 -const BIG Modulus= {0xFFFFFFFFFFFFFFL,0xFFFF00000000FFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFEL}; -const BIG ROI= {0xFFFFFFFFFFFFFEL,0xFFFF00000000FFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFFFFFFFFL,0xFFFFFFFEL}; -const BIG R2modp= {0x3000000040000L,0xFFFFFFFE000000L,0x300000002L,0x10000000100L,0x60000L}; -const chunk MConst= 0x1L; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_TWEEDLEDEE.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_TWEEDLEDEE.cpp deleted file mode 100644 index 2b13555..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_TWEEDLEDEE.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_TWEEDLEDEE.h" - -namespace TWEEDLEDEE { - -/* TWEEDLEDEE Curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_29; - -// Base bits= 29 -const BIG Modulus= {0x1,0x1657EA0,0x18A1B261,0x15424ED2,0x38,0x0,0x0,0x0,0x400000}; -const BIG R2modp= {0x3FF4,0xE8E1080,0xA9C2909,0xC128269,0x89F8301,0x19607541,0x1F4C0E6F,0x3443009,0x22B644}; -const BIG ROI= {0x69D57EC,0x5E991A4,0x213EFC7,0x10FBA370,0x72930A2,0x5B22D4C,0x102FC76F,0xA21B807,0x113EFC}; -const BIG SQRTm3= {0x91F49FA,0x17E6AD31,0x19F5AE40,0x8F54DB0,0x3FFCD01,0xB5FF973,0x12C43D6C,0xE878126,0x2D8CDA}; -const chunk MConst= 0x1FFFFFFF; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base bits= 56 -const BIG Modulus= {0x2CAFD400000001L,0xA127696286C984L,0x38AL,0x0L,0x40000000L}; -const BIG R2modp= {0x21CA8949BBE5DFL,0x717E3D9E719200L,0xB8A93694FCEE5L,0xE6FCB03AA0A27EL,0x2013F4C0L}; -const BIG ROI= {0xBD3234869D57ECL,0x7DD1B8084FBF1CL,0x645A9872930A28L,0xDC03C0BF1DBCBL,0x113EFC51L}; -const BIG SQRTm3= {0xFCD5A6291F49FAL,0x7AA6D867D6B902L,0xBFF2E63FFCD014L,0x3C0934B10F5B16L,0x2D8CDA74L}; -const chunk MConst= 0x2CAFD3FFFFFFFFL; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_TWEEDLEDUM.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_TWEEDLEDUM.cpp deleted file mode 100644 index 9e9f6e5..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rom_field_TWEEDLEDUM.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "arch.h" -#include "fp_TWEEDLEDUM.h" - -namespace TWEEDLEDUM { - -/* TWEEDLEDUM Curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -using namespace B256_29; - -// Base bits= 29 -const BIG Modulus= {0x1,0xA032710,0xFD66E68,0x15424ED8,0x38,0x0,0x0,0x0,0x400000}; -const BIG R2modp= {0x3FF4,0x1B622B40,0x1166FB28,0x5BEEDDF,0x16646668,0x321298C,0xDD7B28E,0x3E66507,0x22B644}; -const BIG ROI= {0x188837CE,0x1EF4F98D,0x1AA67594,0xDD1E7E7,0x2D57FF4,0x197557C6,0xBF3D893,0x2F121DC,0x2AE451}; -const BIG SQRTm3= {0x17DE6C70,0x10786BD5,0x1DC95B25,0xD55C069,0x184CB128,0x16EB9107,0x1B5B20A1,0x95285A0,0x15EF7D}; -const chunk MConst= 0x1FFFFFFF; -#endif - -#if CHUNK==64 - -using namespace B256_56; - -// Base bits= 56 -const BIG Modulus= {0x4064E200000001L,0xA1276C3F59B9A1L,0x38AL,0x0L,0x40000000L}; -const BIG R2modp= {0xFC85D749BBE0CDL,0x64ED6614FCA69BL,0x9925C8F6AC3D6DL,0x28E19094C65991L,0xA0EDD7BL}; -const BIG ROI= {0xDE9F31B88837CEL,0xE8F3F3EA99D653L,0xEAAF8C2D57FF46L,0x890EE2FCF624F2L,0x2AE45117L}; -const BIG SQRTm3= {0xF0D7AB7DE6C70L,0xAAE034F7256C96L,0xD7220F84CB1286L,0x942D06D6C8286DL,0x15EF7D4AL}; -const chunk MConst= 0x4064E1FFFFFFFFL; - -#endif - -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rsa.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rsa.cpp deleted file mode 100644 index 3665a48..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/rsa.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* RSA Functions - see main program below */ - -#include -#include -#include -#include - -#include "rsa_WWW.h" - -using namespace XXX; - -/* generate an RSA key pair */ -void WWW::RSA_KEY_PAIR(csprng *RNG, sign32 e, rsa_private_key *PRIV, rsa_public_key *PUB, octet *P, octet* Q) -{ - /* IEEE1363 A16.11/A16.12 more or less */ - BIG t[HFLEN_WWW], p1[HFLEN_WWW], q1[HFLEN_WWW]; - - if (RNG != NULL) - { - - for (;;) - { - - FF_random(PRIV->p, RNG, HFLEN_WWW); - while (FF_lastbits(PRIV->p, 2) != 3) FF_inc(PRIV->p, 1, HFLEN_WWW); - while (!FF_prime(PRIV->p, RNG, HFLEN_WWW)) - FF_inc(PRIV->p, 4, HFLEN_WWW); - - FF_copy(p1, PRIV->p, HFLEN_WWW); - FF_dec(p1, 1, HFLEN_WWW); - - if (FF_cfactor(p1, e, HFLEN_WWW)) continue; - break; - } - - for (;;) - { - FF_random(PRIV->q, RNG, HFLEN_WWW); - while (FF_lastbits(PRIV->q, 2) != 3) FF_inc(PRIV->q, 1, HFLEN_WWW); - while (!FF_prime(PRIV->q, RNG, HFLEN_WWW)) - FF_inc(PRIV->q, 4, HFLEN_WWW); - - FF_copy(q1, PRIV->q, HFLEN_WWW); - FF_dec(q1, 1, HFLEN_WWW); - if (FF_cfactor(q1, e, HFLEN_WWW)) continue; - - break; - } - - } - else - { - FF_fromOctet(PRIV->p, P, HFLEN_WWW); - FF_fromOctet(PRIV->q, Q, HFLEN_WWW); - - FF_copy(p1, PRIV->p, HFLEN_WWW); - FF_dec(p1, 1, HFLEN_WWW); - - FF_copy(q1, PRIV->q, HFLEN_WWW); - FF_dec(q1, 1, HFLEN_WWW); - } - - FF_mul(PUB->n, PRIV->p, PRIV->q, HFLEN_WWW); - PUB->e = e; - -// Only works for 3 mod 4 primes (as always generated above) - - FF_copy(t, p1, HFLEN_WWW); - FF_shr(t, HFLEN_WWW); - FF_init(PRIV->dp, e, HFLEN_WWW); - FF_invmodp(PRIV->dp, PRIV->dp, t, HFLEN_WWW); - if (FF_parity(PRIV->dp) == 0) FF_add(PRIV->dp, PRIV->dp, t, HFLEN_WWW); - FF_norm(PRIV->dp, HFLEN_WWW); - - FF_copy(t, q1, HFLEN_WWW); - FF_shr(t, HFLEN_WWW); - FF_init(PRIV->dq, e, HFLEN_WWW); - FF_invmodp(PRIV->dq, PRIV->dq, t, HFLEN_WWW); - if (FF_parity(PRIV->dq) == 0) FF_add(PRIV->dq, PRIV->dq, t, HFLEN_WWW); - FF_norm(PRIV->dq, HFLEN_WWW); - - FF_invmodp(PRIV->c, PRIV->p, PRIV->q, HFLEN_WWW); - - return; -} - -// Input private key from OpenSSL format -// e.g as in openssl rsa -in privkey.pem -noout -text -// Note order swap - For MIRACL c=1/p mod q, for OpenSSL c=1/q mod p -void WWW::RSA_PRIVATE_KEY_FROM_OPENSSL(octet *P,octet* Q,octet *DP,octet *DQ,octet *C,rsa_private_key *PRIV) -{ - FF_fromOctet(PRIV->p,Q,HFLEN_WWW); - FF_fromOctet(PRIV->q,P,HFLEN_WWW); - FF_fromOctet(PRIV->dp,DQ,HFLEN_WWW); - FF_fromOctet(PRIV->dq,DP,HFLEN_WWW); - FF_fromOctet(PRIV->c,C,HFLEN_WWW); -} - -void WWW::RSA_KEY_PAIR_FROM_OPENSSL(sign32 e,octet *P,octet* Q,octet *DP,octet *DQ,octet *C,rsa_private_key *PRIV,rsa_public_key *PUB) -{ - RSA_PRIVATE_KEY_FROM_OPENSSL(P,Q,DP,DQ,C,PRIV); - FF_mul(PUB->n, PRIV->p, PRIV->q, HFLEN_WWW); - PUB->e = e; -} - -/* destroy the Private Key structure */ -void WWW::RSA_PRIVATE_KEY_KILL(rsa_private_key *PRIV) -{ - FF_zero(PRIV->p, HFLEN_WWW); - FF_zero(PRIV->q, HFLEN_WWW); - FF_zero(PRIV->dp, HFLEN_WWW); - FF_zero(PRIV->dq, HFLEN_WWW); - FF_zero(PRIV->c, HFLEN_WWW); -} - -void WWW::RSA_fromOctet(BIG x[], octet *w) -{ - FF_fromOctet(x, w, FFLEN_WWW); -} - -/* RSA encryption with the public key */ -void WWW::RSA_ENCRYPT(rsa_public_key *PUB, octet *F, octet *G) -{ - BIG f[FFLEN_WWW]; - FF_fromOctet(f, F, FFLEN_WWW); - - FF_power(f, f, PUB->e, PUB->n, FFLEN_WWW); - - FF_toOctet(G, f, FFLEN_WWW); -} - -/* RSA decryption with the private key */ -void WWW::RSA_DECRYPT(rsa_private_key *PRIV, octet *G, octet *F) -{ - BIG g[FFLEN_WWW], t[FFLEN_WWW], jp[HFLEN_WWW], jq[HFLEN_WWW]; - - FF_fromOctet(g, G, FFLEN_WWW); - - FF_dmod(jp, g, PRIV->p, HFLEN_WWW); - FF_dmod(jq, g, PRIV->q, HFLEN_WWW); - - FF_skpow(jp, jp, PRIV->dp, PRIV->p, HFLEN_WWW); - FF_skpow(jq, jq, PRIV->dq, PRIV->q, HFLEN_WWW); - - - FF_zero(g, FFLEN_WWW); - FF_copy(g, jp, HFLEN_WWW); - FF_mod(jp, PRIV->q, HFLEN_WWW); - if (FF_comp(jp, jq, HFLEN_WWW) > 0) - FF_add(jq, jq, PRIV->q, HFLEN_WWW); - FF_sub(jq, jq, jp, HFLEN_WWW); - FF_norm(jq, HFLEN_WWW); - - FF_mul(t, PRIV->c, jq, HFLEN_WWW); - FF_dmod(jq, t, PRIV->q, HFLEN_WWW); - - FF_mul(t, jq, PRIV->p, HFLEN_WWW); - FF_add(g, t, g, FFLEN_WWW); - FF_norm(g, FFLEN_WWW); - - FF_toOctet(F, g, FFLEN_WWW); - - return; -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/share.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/share.cpp deleted file mode 100644 index 103c7cc..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/share.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Shamir threshold secret sharing module */ -/* Split any octet into number of shares <256 */ -/* Specify number of shares required for recovery - nsr */ - -/* See testmpin.cpp for an example of use */ - -#include "arch.h" -#include "core.h" - -using namespace core; -/* Field GF(2^8) precalculated tables */ - -static const uchar ptab[] = -{ - 1, 3, 5, 15, 17, 51, 85, 255, 26, 46, 114, 150, 161, 248, 19, 53, - 95, 225, 56, 72, 216, 115, 149, 164, 247, 2, 6, 10, 30, 34, 102, 170, - 229, 52, 92, 228, 55, 89, 235, 38, 106, 190, 217, 112, 144, 171, 230, 49, - 83, 245, 4, 12, 20, 60, 68, 204, 79, 209, 104, 184, 211, 110, 178, 205, - 76, 212, 103, 169, 224, 59, 77, 215, 98, 166, 241, 8, 24, 40, 120, 136, - 131, 158, 185, 208, 107, 189, 220, 127, 129, 152, 179, 206, 73, 219, 118, 154, - 181, 196, 87, 249, 16, 48, 80, 240, 11, 29, 39, 105, 187, 214, 97, 163, - 254, 25, 43, 125, 135, 146, 173, 236, 47, 113, 147, 174, 233, 32, 96, 160, - 251, 22, 58, 78, 210, 109, 183, 194, 93, 231, 50, 86, 250, 21, 63, 65, - 195, 94, 226, 61, 71, 201, 64, 192, 91, 237, 44, 116, 156, 191, 218, 117, - 159, 186, 213, 100, 172, 239, 42, 126, 130, 157, 188, 223, 122, 142, 137, 128, - 155, 182, 193, 88, 232, 35, 101, 175, 234, 37, 111, 177, 200, 67, 197, 84, - 252, 31, 33, 99, 165, 244, 7, 9, 27, 45, 119, 153, 176, 203, 70, 202, - 69, 207, 74, 222, 121, 139, 134, 145, 168, 227, 62, 66, 198, 81, 243, 14, - 18, 54, 90, 238, 41, 123, 141, 140, 143, 138, 133, 148, 167, 242, 13, 23, - 57, 75, 221, 124, 132, 151, 162, 253, 28, 36, 108, 180, 199, 82, 246, 1 -}; - -static const uchar ltab[] = -{ - 0, 255, 25, 1, 50, 2, 26, 198, 75, 199, 27, 104, 51, 238, 223, 3, - 100, 4, 224, 14, 52, 141, 129, 239, 76, 113, 8, 200, 248, 105, 28, 193, - 125, 194, 29, 181, 249, 185, 39, 106, 77, 228, 166, 114, 154, 201, 9, 120, - 101, 47, 138, 5, 33, 15, 225, 36, 18, 240, 130, 69, 53, 147, 218, 142, - 150, 143, 219, 189, 54, 208, 206, 148, 19, 92, 210, 241, 64, 70, 131, 56, - 102, 221, 253, 48, 191, 6, 139, 98, 179, 37, 226, 152, 34, 136, 145, 16, - 126, 110, 72, 195, 163, 182, 30, 66, 58, 107, 40, 84, 250, 133, 61, 186, - 43, 121, 10, 21, 155, 159, 94, 202, 78, 212, 172, 229, 243, 115, 167, 87, - 175, 88, 168, 80, 244, 234, 214, 116, 79, 174, 233, 213, 231, 230, 173, 232, - 44, 215, 117, 122, 235, 22, 11, 245, 89, 203, 95, 176, 156, 169, 81, 160, - 127, 12, 246, 111, 23, 196, 73, 236, 216, 67, 31, 45, 164, 118, 123, 183, - 204, 187, 62, 90, 251, 96, 177, 134, 59, 82, 161, 108, 170, 85, 41, 157, - 151, 178, 135, 144, 97, 190, 220, 252, 188, 149, 207, 205, 55, 63, 91, 209, - 83, 57, 132, 60, 65, 162, 109, 71, 20, 42, 158, 93, 86, 242, 211, 171, - 68, 17, 146, 217, 35, 32, 46, 137, 180, 124, 184, 38, 119, 153, 227, 165, - 103, 74, 237, 222, 197, 49, 254, 24, 13, 99, 140, 128, 192, 247, 112, 7 -}; - -/* field addition */ -static uchar add(uchar x,uchar y) -{ - return (x^y); -} - -/* x.y= AntiLog(Log(x) + Log(y)) */ -static uchar mul(uchar x,uchar y) -{ - if (x && y) return ptab[(ltab[x]+ltab[y])%255]; - else return 0; -} - -/* multiplicative inverse */ -static uchar inv(uchar x) -{ - return ptab[255-ltab[x]]; -} - -/* Lagrange interpolation */ -static int interpolate(int n, uchar x[], uchar y[]) -{ - int i,j; - uchar p,yp=0; - for(i=0;i=256 || nsr<2 || nsr>=256) - { - Sh.id=0; - Sh.nsr=0; - Sh.B=NULL; - return Sh; - } - RAND_clean(&rng); - RAND_seed(&rng,R->len,R->val); - Sh.id=id; - Sh.nsr=nsr; - Sh.B=S; - m=M->len; - S->len=m; - for (j=0;jval[j]=M->val[j]; - for (n=1;nval[j]=add(S->val[j],mul(RAND_byte(&rng),x)); - x=mul(x,(uchar)id); - } - } - return Sh; -} - -/* Recover message from shares */ - -int core::recover(octet *M,share S[]) -{ - uchar x[256],y[256]; - int i,j,res=0; - int len=S[0].B->len; - int nsr=S[0].nsr; - for (i=1;ilen!=len) - { - res=-1; - break; - } - } - if (res) return res; - - for (j=0;jval[j]; - } - M->val[j]=interpolate(nsr,x,y); - } - M->len=len; - return res; -} - -/* -#include -#include - -int main() -{ // test driver - int ii,j,k,l,m,n,nsr; - char mc[10],b1c[10],b2c[10],b3c[10],b4c[10],r[30]; - octet M={0,sizeof(mc),mc}; - octet B1={0,sizeof(b1c),b1c}; - octet B2={0,sizeof(b2c),b2c}; - octet B3={0,sizeof(b3c),b3c}; - octet B4={0,sizeof(b4c),b4c}; - octet R={0,sizeof(r),r}; - share S[3]; - - nsr=3; - - srand(time(NULL)); - - M.len=5; - M.val[0]=rand()%128; M.val[1]=rand()%128; M.val[2]=rand()%128; M.val[3]=rand()%128; M.val[4]=rand()%128; - - printf("Message= "); OCT_output(&M); - - R.len=(nsr-1)*M.len; - for (j=0;j -#include -#include -#include -#include "bls_BN254.h" - -#if CHUNK==32 || CHUNK==64 -#include "bls_BLS12383.h" -#include "bls192_BLS24479.h" -#include "bls256_BLS48556.h" -#endif - -#include "randapi.h" - -/* To reverse the groups G1 and G2, edit BLS*.cpp - -Swap G1 <-> G2 -Swap ECP <-> ECPn -Disable G2 precomputation -Switch G1/G2 parameter order in pairing function calls - -#define REVERSE here - -See BLSREV*.cpp - -*/ - -//#define REVERSE - -using namespace core; - -static char message[] = "This is a test message"; - -int bls_BN254(csprng *RNG) -{ - using namespace BN254; - - int i,res; - char s[BGS_BN254]; - char ikm[64]; -#ifdef REVERSE - char w[BFS_BN254+1], sig[4 * BFS_BN254 + 1]; // w is 2* if not compressed else 1*. sig is 4* if not compressed, else 2* -#else - char w[4 * BFS_BN254 + 1], sig[BFS_BN254 + 1]; // w is 4* if not compressed else 2*. sig is 2* if not compressed, else 1* -#endif - octet S = {0, sizeof(s), s}; - octet W = {0, sizeof(w), w}; - octet SIG = {0, sizeof(sig), sig}; - octet IKM = {0, sizeof(ikm), ikm}; - octet M = {0,sizeof(message), message}; - - OCT_jstring(&M,message); - - res = BLS_INIT(); - if (res == BLS_FAIL) - { - printf("Failed to initialize\n"); - return res; - } - - OCT_rand(&IKM,RNG,32); - //IKM.len=32; - //for (i=0;i> 8; - RAW.val[2] = ran >> 16; - RAW.val[3] = ran >> 24; - for (i = 4; i < 100; i++) RAW.val[i] = i; - - CREATE_CSPRNG(&RNG, &RAW); // initialise strong RNG - - printf("%d bit build\n", CHUNK); - - printf("\nTesting BLS signature for curve BN254\n"); - bls_BN254(&RNG); - -#if CHUNK!=16 - printf("\nTesting BLS signature for curve BLS12383\n"); - bls_BLS12383(&RNG); - - printf("\nTesting BLS signature for curve BLS24479\n"); - bls_BLS24479(&RNG); - - printf("\nTesting BLS signature for curve BLS48556\n"); - bls_BLS48556(&RNG); -#endif - - KILL_CSPRNG(&RNG); -} - - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testdlthm b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testdlthm deleted file mode 100644 index a50d538..0000000 Binary files a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testdlthm and /dev/null differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testdlthm.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testdlthm.cpp deleted file mode 100644 index f7326a0..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testdlthm.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2012-2021 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* test driver and function exerciser for Dilithium functions */ - -// See https://eprint.iacr.org/2017/633 (Ducas, Lepoint, Lyubashevsky, Schwabe, Seiler, Stehle) - -/* g++ -O2 testdlthm.cpp core.a -o testdlthm */ - -#include -#include -#include "dilithium.h" - -using namespace core; - -#define LOOPS 100 - -int main() { - int i,j,attempts; - unsigned long ran; - bool result; - char raw[100]; - byte tau[32]; - csprng RNG; - char sk[DL_SK_SIZE_3], pk[DL_PK_SIZE_3], sig[DL_SIG_SIZE_3],m[128]; - octet SK = {0, sizeof(sk), sk}; - octet PK = {0, sizeof(pk), pk}; - octet SIG = {0, sizeof(sig), sig}; - octet M = {0, sizeof(m), m}; - - time((time_t *)&ran); - - raw[0] = ran; - raw[1] = ran >> 8; - raw[2] = ran >> 16; - raw[3] = ran >> 24; - - for (i = 0; i < 100; i++) raw[i] = i + 1; // change to i = 4 to randomize - RAND_seed(&RNG, 100, raw); - - printf("Testing Dilithium signature\n"); - int tats=0; - for (i=0;i1) - printf("Average= %d\n",tats/LOOPS); - return 0; -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testecc b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testecc deleted file mode 100644 index 3fbf9e6..0000000 Binary files a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testecc and /dev/null differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testecc.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testecc.cpp deleted file mode 100644 index e3a61c3..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testecc.cpp +++ /dev/null @@ -1,623 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* test driver and function exerciser for ECDH/ECIES/ECDSA API Functions */ - -#include -#include -#include -#include -#include "ecdh_Ed25519.h" -#include "rsa_RSA2048.h" -#include "randapi.h" - -#if CHUNK==32 || CHUNK==64 -#include "ecdh_NIST256.h" -#include "ecdh_Ed448.h" -#endif - -using namespace core; - -int ecdh_Ed25519(csprng *RNG) -{ - using namespace Ed25519; - - int i, res; - unsigned long ran; - char *pp = (char *)"M0ng00se"; - // These octets are automatically protected against buffer overflow attacks - // Note salt must be big enough to include an appended word - // Note ECIES ciphertext C must be big enough to include at least 1 appended block - // Recall EFS_Ed25519 is field size in bytes. So EFS_Ed25519=32 for 256-bit curve - char s0[2 * EGS_Ed25519], s1[EGS_Ed25519], w0[2 * EFS_Ed25519 + 1], w1[2 * EFS_Ed25519 + 1], z0[EFS_Ed25519], z1[EFS_Ed25519], key[AESKEY_Ed25519], salt[40], pw[40]; - octet S0 = {0, sizeof(s0), s0}; - octet S1 = {0, sizeof(s1), s1}; - octet W0 = {0, sizeof(w0), w0}; - octet W1 = {0, sizeof(w1), w1}; - octet Z0 = {0, sizeof(z0), z0}; - octet Z1 = {0, sizeof(z1), z1}; - octet KEY = {0, sizeof(key), key}; - octet SALT = {0, sizeof(salt), salt}; - octet PW = {0, sizeof(pw), pw}; - - SALT.len = 8; - for (i = 0; i < 8; i++) SALT.val[i] = i + 1; // set Salt - - printf("Alice's Passphrase= %s\n", pp); - - OCT_empty(&PW); - OCT_jstring(&PW, pp); // set Password from string - - // private key S0 of size EGS_Ed25519 bytes derived from Password and Salt - - PBKDF2(MC_SHA2,HASH_TYPE_Ed25519, &S0, EGS_Ed25519, &PW, &SALT, 1000); - - printf("Alices private key= 0x"); - OCT_output(&S0); - - // Generate Key pair S/W - - ECP_KEY_PAIR_GENERATE(NULL, &S0, &W0); - printf("Alices public key= 0x"); - OCT_output(&W0); - - res = ECP_PUBLIC_KEY_VALIDATE(&W0); - if (res != 0) - { - printf("ECP Public Key is invalid!\n"); - return 0; - } - - // Random private key for other party - ECP_KEY_PAIR_GENERATE(RNG, &S1, &W1); - res = ECP_PUBLIC_KEY_VALIDATE(&W1); - if (res != 0) - { - printf("ECP Public Key is invalid!\n"); - return 0; - } - printf("Servers private key= 0x"); - OCT_output(&S1); - printf("Servers public key= 0x"); - OCT_output(&W1); - - // Calculate common key using DH - IEEE 1363 method - - ECP_SVDP_DH(&S0, &W1, &Z0, 0); - ECP_SVDP_DH(&S1, &W0, &Z1, 0); - - if (!OCT_comp(&Z0, &Z1)) - { - printf("*** ECPSVDP-DH Failed\n"); - return 0; - } - - KDF2(MC_SHA2, HASH_TYPE_Ed25519, &KEY, AESKEY_Ed25519, &Z0, NULL); - - printf("Alice's DH Key= 0x"); - OCT_output(&KEY); - printf("Servers DH Key= 0x"); - OCT_output(&KEY); - -#if CURVETYPE_Ed25519 != MONTGOMERY - - char ds[EGS_Ed25519], p1[30], p2[30], v[2 * EFS_Ed25519 + 1], m[32], c[64], t[32], cs[EGS_Ed25519]; - octet DS = {0, sizeof(ds), ds}; - octet CS = {0, sizeof(cs), cs}; - octet P1 = {0, sizeof(p1), p1}; - octet P2 = {0, sizeof(p2), p2}; - octet V = {0, sizeof(v), v}; - octet M = {0, sizeof(m), m}; - octet C = {0, sizeof(c), c}; - octet T = {0, sizeof(t), t}; - - printf("Testing ECIES\n"); - - P1.len = 3; - P1.val[0] = 0x0; - P1.val[1] = 0x1; - P1.val[2] = 0x2; - P2.len = 4; - P2.val[0] = 0x0; - P2.val[1] = 0x1; - P2.val[2] = 0x2; - P2.val[3] = 0x3; - - M.len = 17; - for (i = 0; i <= 16; i++) M.val[i] = i; - - ECP_ECIES_ENCRYPT(HASH_TYPE_Ed25519, &P1, &P2, RNG, &W1, &M, 12, &V, &C, &T); - - printf("Ciphertext= \n"); - printf("V= 0x"); - OCT_output(&V); - printf("C= 0x"); - OCT_output(&C); - printf("T= 0x"); - OCT_output(&T); - - if (!ECP_ECIES_DECRYPT(HASH_TYPE_Ed25519, &P1, &P2, &V, &C, &T, &S1, &M)) - { - printf("*** ECIES Decryption Failed\n"); - return 0; - } - else printf("Decryption succeeded\n"); - - printf("Message is 0x"); - OCT_output(&M); - - - printf("Testing ECDSA\n"); - - if (ECP_SP_DSA(HASH_TYPE_Ed25519, RNG, NULL, &S0, &M, &CS, &DS) != 0) - { - printf("***ECDSA Signature Failed\n"); - return 0; - } - - printf("Signature C = 0x"); - OCT_output(&CS); - printf("Signature D = 0x"); - OCT_output(&DS); - - if (ECP_VP_DSA(HASH_TYPE_Ed25519, &W0, &M, &CS, &DS) != 0) - { - printf("***ECDSA Verification Failed\n"); - return 0; - } - else - { - printf("ECDSA Signature/Verification succeeded\n"); - } - -#endif - - return 1; -} - -#if CHUNK==32 || CHUNK==64 -int ecdh_NIST256(csprng *RNG) -{ - using namespace NIST256; - - int i, res; - unsigned long ran; - char *pp = (char *)"M0ng00se"; - // These octets are automatically protected against buffer overflow attacks - // Note salt must be big enough to include an appended word - // Note ECIES ciphertext C must be big enough to include at least 1 appended block - // Recall EFS_NIST256 is field size in bytes. So EFS_NIST256=32 for 256-bit curve - char s0[2 * EGS_NIST256], s1[EGS_NIST256], w0[2 * EFS_NIST256 + 1], w1[2 * EFS_NIST256 + 1], z0[EFS_NIST256], z1[EFS_NIST256], key[AESKEY_NIST256], salt[40], pw[40]; - octet S0 = {0, sizeof(s0), s0}; - octet S1 = {0, sizeof(s1), s1}; - octet W0 = {0, sizeof(w0), w0}; - octet W1 = {0, sizeof(w1), w1}; - octet Z0 = {0, sizeof(z0), z0}; - octet Z1 = {0, sizeof(z1), z1}; - octet KEY = {0, sizeof(key), key}; - octet SALT = {0, sizeof(salt), salt}; - octet PW = {0, sizeof(pw), pw}; - - SALT.len = 8; - for (i = 0; i < 8; i++) SALT.val[i] = i + 1; // set Salt - - printf("Alice's Passphrase= %s\n", pp); - - OCT_empty(&PW); - OCT_jstring(&PW, pp); // set Password from string - - // private key S0 of size EGS_NIST256 bytes derived from Password and Salt - - PBKDF2(MC_SHA2, HASH_TYPE_NIST256, &S0, EGS_NIST256, &PW, &SALT, 1000); - - printf("Alices private key= 0x"); - OCT_output(&S0); - - // Generate Key pair S/W - - ECP_KEY_PAIR_GENERATE(NULL, &S0, &W0); - printf("Alices public key= 0x"); - OCT_output(&W0); - - res = ECP_PUBLIC_KEY_VALIDATE(&W0); - if (res != 0) - { - printf("ECP Public Key is invalid!\n"); - return 0; - } - - // Random private key for other party - ECP_KEY_PAIR_GENERATE(RNG, &S1, &W1); - res = ECP_PUBLIC_KEY_VALIDATE(&W1); - if (res != 0) - { - printf("ECP Public Key is invalid!\n"); - return 0; - } - printf("Servers private key= 0x"); - OCT_output(&S1); - printf("Servers public key= 0x"); - OCT_output(&W1); - - // Calculate common key using DH - IEEE 1363 method - - ECP_SVDP_DH(&S0, &W1, &Z0, 0); - ECP_SVDP_DH(&S1, &W0, &Z1, 0); - - if (!OCT_comp(&Z0, &Z1)) - { - printf("*** ECPSVDP-DH Failed\n"); - return 0; - } - - KDF2(MC_SHA2, HASH_TYPE_NIST256, &KEY, AESKEY_NIST256, &Z0, NULL); - - printf("Alice's DH Key= 0x"); - OCT_output(&KEY); - printf("Servers DH Key= 0x"); - OCT_output(&KEY); - -#if CURVETYPE_NIST256 != MONTGOMERY - - char ds[EGS_NIST256], p1[30], p2[30], v[2 * EFS_NIST256 + 1], m[32], c[64], t[32], cs[EGS_NIST256]; - octet DS = {0, sizeof(ds), ds}; - octet CS = {0, sizeof(cs), cs}; - octet P1 = {0, sizeof(p1), p1}; - octet P2 = {0, sizeof(p2), p2}; - octet V = {0, sizeof(v), v}; - octet M = {0, sizeof(m), m}; - octet C = {0, sizeof(c), c}; - octet T = {0, sizeof(t), t}; - - printf("Testing ECIES\n"); - - P1.len = 3; - P1.val[0] = 0x0; - P1.val[1] = 0x1; - P1.val[2] = 0x2; - P2.len = 4; - P2.val[0] = 0x0; - P2.val[1] = 0x1; - P2.val[2] = 0x2; - P2.val[3] = 0x3; - - M.len = 17; - for (i = 0; i <= 16; i++) M.val[i] = i; - - ECP_ECIES_ENCRYPT(HASH_TYPE_NIST256, &P1, &P2, RNG, &W1, &M, 12, &V, &C, &T); - - printf("Ciphertext= \n"); - printf("V= 0x"); - OCT_output(&V); - printf("C= 0x"); - OCT_output(&C); - printf("T= 0x"); - OCT_output(&T); - - if (!ECP_ECIES_DECRYPT(HASH_TYPE_NIST256, &P1, &P2, &V, &C, &T, &S1, &M)) - { - printf("*** ECIES Decryption Failed\n"); - return 0; - } - else printf("Decryption succeeded\n"); - - printf("Message is 0x"); - OCT_output(&M); - - - printf("Testing ECDSA\n"); - - if (ECP_SP_DSA(HASH_TYPE_NIST256, RNG, NULL, &S0, &M, &CS, &DS) != 0) - { - printf("***ECDSA Signature Failed\n"); - return 0; - } - - printf("Signature C = 0x"); - OCT_output(&CS); - printf("Signature D = 0x"); - OCT_output(&DS); - - if (ECP_VP_DSA(HASH_TYPE_NIST256, &W0, &M, &CS, &DS) != 0) - { - printf("***ECDSA Verification Failed\n"); - return 0; - } - else - { - printf("ECDSA Signature/Verification succeeded\n"); - } - -#endif - - return 1; -} - -int ecdh_Ed448(csprng *RNG) -{ - using namespace Ed448; - - int i, res; - unsigned long ran; - char *pp = (char *)"M0ng00se"; - // These octets are automatically protected against buffer overflow attacks - // Note salt must be big enough to include an appended word - // Note ECIES ciphertext C must be big enough to include at least 1 appended block - // Recall EFS_Ed448 is field size in bytes. So EFS_Ed448=32 for 256-bit curve - char s0[2 * EGS_Ed448], s1[EGS_Ed448], w0[2 * EFS_Ed448 + 1], w1[2 * EFS_Ed448 + 1], z0[EFS_Ed448], z1[EFS_Ed448], key[AESKEY_Ed448], salt[40], pw[40]; - octet S0 = {0, sizeof(s0), s0}; - octet S1 = {0, sizeof(s1), s1}; - octet W0 = {0, sizeof(w0), w0}; - octet W1 = {0, sizeof(w1), w1}; - octet Z0 = {0, sizeof(z0), z0}; - octet Z1 = {0, sizeof(z1), z1}; - octet KEY = {0, sizeof(key), key}; - octet SALT = {0, sizeof(salt), salt}; - octet PW = {0, sizeof(pw), pw}; - - SALT.len = 8; - for (i = 0; i < 8; i++) SALT.val[i] = i + 1; // set Salt - - printf("Alice's Passphrase= %s\n", pp); - - OCT_empty(&PW); - OCT_jstring(&PW, pp); // set Password from string - - // private key S0 of size EGS_Ed448 bytes derived from Password and Salt - - PBKDF2(MC_SHA2, HASH_TYPE_Ed448, &S0, EGS_Ed448, &PW, &SALT, 1000); - - printf("Alices private key= 0x"); - OCT_output(&S0); - - // Generate Key pair S/W - - ECP_KEY_PAIR_GENERATE(NULL, &S0, &W0); - printf("Alices public key= 0x"); - OCT_output(&W0); - - res = ECP_PUBLIC_KEY_VALIDATE(&W0); - if (res != 0) - { - printf("ECP Public Key is invalid!\n"); - return 0; - } - - // Random private key for other party - ECP_KEY_PAIR_GENERATE(RNG, &S1, &W1); - res = ECP_PUBLIC_KEY_VALIDATE(&W1); - if (res != 0) - { - printf("ECP Public Key is invalid!\n"); - return 0; - } - printf("Servers private key= 0x"); - OCT_output(&S1); - printf("Servers public key= 0x"); - OCT_output(&W1); - - // Calculate common key using DH - IEEE 1363 method - - ECP_SVDP_DH(&S0, &W1, &Z0, 0); - ECP_SVDP_DH(&S1, &W0, &Z1, 0); - - if (!OCT_comp(&Z0, &Z1)) - { - printf("*** ECPSVDP-DH Failed\n"); - return 0; - } - - KDF2(MC_SHA2, HASH_TYPE_Ed448, &KEY, AESKEY_Ed448, &Z0, NULL); - - printf("Alice's DH Key= 0x"); - OCT_output(&KEY); - printf("Servers DH Key= 0x"); - OCT_output(&KEY); - -#if CURVETYPE_Ed448 != MONTGOMERY - - char ds[EGS_Ed448], p1[30], p2[30], v[2 * EFS_Ed448 + 1], m[32], c[64], t[32], cs[EGS_Ed448]; - octet DS = {0, sizeof(ds), ds}; - octet CS = {0, sizeof(cs), cs}; - octet P1 = {0, sizeof(p1), p1}; - octet P2 = {0, sizeof(p2), p2}; - octet V = {0, sizeof(v), v}; - octet M = {0, sizeof(m), m}; - octet C = {0, sizeof(c), c}; - octet T = {0, sizeof(t), t}; - - printf("Testing ECIES\n"); - - P1.len = 3; - P1.val[0] = 0x0; - P1.val[1] = 0x1; - P1.val[2] = 0x2; - P2.len = 4; - P2.val[0] = 0x0; - P2.val[1] = 0x1; - P2.val[2] = 0x2; - P2.val[3] = 0x3; - - M.len = 17; - for (i = 0; i <= 16; i++) M.val[i] = i; - - ECP_ECIES_ENCRYPT(HASH_TYPE_Ed448, &P1, &P2, RNG, &W1, &M, 12, &V, &C, &T); - - printf("Ciphertext= \n"); - printf("V= 0x"); - OCT_output(&V); - printf("C= 0x"); - OCT_output(&C); - printf("T= 0x"); - OCT_output(&T); - - if (!ECP_ECIES_DECRYPT(HASH_TYPE_Ed448, &P1, &P2, &V, &C, &T, &S1, &M)) - { - printf("*** ECIES Decryption Failed\n"); - return 0; - } - else printf("Decryption succeeded\n"); - - printf("Message is 0x"); - OCT_output(&M); - - - printf("Testing ECDSA\n"); - - if (ECP_SP_DSA(HASH_TYPE_Ed448, RNG, NULL, &S0, &M, &CS, &DS) != 0) - { - printf("***ECDSA Signature Failed\n"); - return 0; - } - - printf("Signature C = 0x"); - OCT_output(&CS); - printf("Signature D = 0x"); - OCT_output(&DS); - - if (ECP_VP_DSA(HASH_TYPE_Ed448, &W0, &M, &CS, &DS) != 0) - { - printf("***ECDSA Verification Failed\n"); - return 0; - } - else - { - printf("ECDSA Signature/Verification succeeded\n"); - } - -#endif - - return 1; -} -#endif - -int rsa_2048(csprng *RNG) -{ - using namespace RSA2048; - - int i,valid; - unsigned long ran; - char m[RFS_RSA2048], ml[RFS_RSA2048], c[RFS_RSA2048], e[RFS_RSA2048], s[RFS_RSA2048]; - rsa_public_key pub; - rsa_private_key priv; - - octet M = {0, sizeof(m), m}; - octet ML = {0, sizeof(ml), ml}; - octet C = {0, sizeof(c), c}; - octet E = {0, sizeof(e), e}; - octet S = {0, sizeof(s), s}; - - printf("Generating public/private key pair\n"); - RSA_KEY_PAIR(RNG, 65537, &priv, &pub, NULL, NULL); - - printf("Encrypting test string\n"); - OCT_jstring(&M, (char *)"Hello World\n"); - - OAEP_ENCODE(HASH_TYPE_RSA_RSA2048, &M, RNG, NULL, &E); // OAEP encode message m to e - - RSA_ENCRYPT(&pub, &E, &C); // encrypt encoded message - printf("Ciphertext= "); - OCT_output(&C); - - printf("Decrypting test string\n"); - RSA_DECRYPT(&priv, &C, &ML); // ... and then decrypt it - printf("Decrypted\n"); - OAEP_DECODE(HASH_TYPE_RSA_RSA2048, NULL, &ML); // decode it - printf("Decoded\n"); - OCT_output_string(&ML); - - - PSS_ENCODE(HASH_TYPE_RSA_RSA2048, &M, RNG, &C); - //printf("T= 0x");OCT_output(&C); - if (PSS_VERIFY(HASH_TYPE_RSA_RSA2048, &M, &C)) - printf("PSS encoding OK\n"); - else - printf("PSS Encoding FAILED\n"); - - -// Signature - printf("Signing message\n"); - PKCS15(HASH_TYPE_RSA_RSA2048, &M, &C); - - RSA_DECRYPT(&priv, &C, &S); // create signature in S - - printf("Signature= "); - OCT_output(&S); - - - -// Verification - valid=0; - RSA_ENCRYPT(&pub, &S, &ML); - PKCS15(HASH_TYPE_RSA_RSA2048, &M, &C); - - if (OCT_comp(&C, &ML)) valid=1; - else { - PKCS15b(HASH_TYPE_RSA_RSA2048, &M, &C); - if (OCT_comp(&C, &ML)) valid=1; - } - - if (valid) printf("Signature is valid\n"); - else printf("Signature is INVALID\n"); - - RSA_PRIVATE_KEY_KILL(&priv); - - OCT_clear(&M); - OCT_clear(&ML); // clean up afterwards - OCT_clear(&C); - OCT_clear(&E); - - return 1; -} - - -int main() -{ - int i, res; - unsigned long ran; - - char raw[100]; - octet RAW = {0, sizeof(raw), raw}; - csprng RNG; // Crypto Strong RNG - - time((time_t *)&ran); - - RAW.len = 100; // fake random seed source - RAW.val[0] = ran; - RAW.val[1] = ran >> 8; - RAW.val[2] = ran >> 16; - RAW.val[3] = ran >> 24; - for (i = 0; i < 100; i++) RAW.val[i] = i; - - CREATE_CSPRNG(&RNG, &RAW); // initialise strong RNG - - printf("\nTesting ECDH protocols for curve Ed25519\n"); - ecdh_Ed25519(&RNG); -#if CHUNK!=16 - printf("\nTesting ECDH protocols for curve NIST256\n"); - ecdh_NIST256(&RNG); - printf("\nTesting ECDH protocols for curve Ed448\n"); - ecdh_Ed448(&RNG); -#endif - printf("\nTesting RSA protocols for 2048-bit RSA\n"); - rsa_2048(&RNG); - - KILL_CSPRNG(&RNG); -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testeddsa b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testeddsa deleted file mode 100644 index 1e577d1..0000000 Binary files a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testeddsa and /dev/null differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testeddsa.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testeddsa.cpp deleted file mode 100644 index bd43d86..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testeddsa.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* test driver and function exerciser for EDDSA API Functions */ - -// Test Vectors from RFC8032 - -// Observe that NIST standard does not support Ed25519ctx - -#include -#include -#include -#include -#include "randapi.h" -#include "eddsa_Ed25519.h" -#include "eddsa_Ed448.h" - - -using namespace core; - -// prehash message -static void PH_Ed25519(octet *M,octet *HM) { - hash512 sh512; - HASH512_init(&sh512); - for (int i=0;ilen;i++ ) - HASH512_process(&sh512,M->val[i]); - HASH512_hash(&sh512,HM->val); - HM->len=64; -} - -static void PH_Ed448(octet *M,octet *HM) { - sha3 SHA3; - SHA3_init(&SHA3,SHAKE256); - for (int i=0;ilen;i++) - SHA3_process(&SHA3,M->val[i]); - SHA3_shake(&SHA3,HM->val,64); - HM->len=64; -} - -int eddsa_Ed25519(csprng *RNG) -{ - using namespace Ed25519; - - char d[EGS_Ed25519], q[EFS_Ed25519], m[256], sig[2*EFS_Ed25519], hm[64]; - octet D = {0, sizeof(d), d}; - octet Q = {0, sizeof(q), q}; - octet M = {0, sizeof(m), m}; - octet SIG = {0, sizeof(sig), sig}; - octet HM={0,sizeof(hm),hm}; - bool prehash=false; - bool verify; - -// 32 bytes -// OCT_fromHex(&D,(char *)"9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60"); - OCT_fromHex(&D,(char *)"c5aa8df43f9f837bedb7442f31dcb7b166d38535076f094b85ce3a2e0b4458f7"); -// OCT_fromHex(&D,(char *)"833fe62409237b9d62ec77587520911e9a759cec1d19755b7da901b96dca3d42"); - - EDDSA_KEY_PAIR_GENERATE(NULL, &D, &Q); - printf("Secret key= 0x"); - OCT_output(&D); - printf("Public key= 0x"); - OCT_output(&Q); - printf("\n"); - - M.len=2; M.val[0]=0xaf; M.val[1]=0x82; -// M.len=3; M.val[0]=0x61; M.val[1]=0x62; M.val[2]=0x63; - - if (prehash) { - PH_Ed25519(&M,&HM); - EDDSA_SIGNATURE(true,&D, NULL,&HM, &SIG); - } else { - EDDSA_SIGNATURE(false,&D, NULL,&M, &SIG); - } - printf("Signature= 0x"); - OCT_output(&SIG); - - - if (prehash) { - PH_Ed25519(&M,&HM); - verify=EDDSA_VERIFY(true,&Q, NULL ,&HM, &SIG); - } else { - verify=EDDSA_VERIFY(false,&Q, NULL ,&M, &SIG); - } - if (verify) - printf("Signature is verified\n"); - else - printf("Signature is NOT verified\n"); - - return 1; -} - -int eddsa_Ed448(csprng *RNG) -{ - using namespace Ed448; - - char d[EGS_Ed448+1], q[EFS_Ed448 + 1], m[256], sig[2*EFS_Ed448+2], ctx[256], hm[64]; - octet D = {0, sizeof(d), d}; - octet Q = {0, sizeof(q), q}; - octet M = {0, sizeof(m), m}; - octet SIG = {0, sizeof(sig), sig}; - octet CTX = {0, sizeof(ctx), ctx}; - octet HM={0,sizeof(hm),hm}; - bool prehash=false; - bool verify; - -// 57 bytes -// OCT_fromHex(&D,(char *)"6c82a562cb808d10d632be89c8513ebf6c929f34ddfa8c9f63c9960ef6e348a3528c8a3fcc2f044e39a3fc5b94492f8f032e7549a20098f95b"); - OCT_fromHex(&D,(char *)"c4eab05d357007c632f3dbb48489924d552b08fe0c353a0d4a1f00acda2c463afbea67c5e8d2877c5e3bc397a659949ef8021e954e0a12274e"); -// OCT_fromHex(&D,(char *)"833fe62409237b9d62ec77587520911e9a759cec1d19755b7da901b96dca3d42ef7822e0d5104127dc05d6dbefde69e3ab2cec7c867c6e2c49"); - - - EDDSA_KEY_PAIR_GENERATE(NULL, &D, &Q); - printf("Secret key= 0x"); - OCT_output(&D); - printf("Public key= 0x"); - OCT_output(&Q); - printf("\n"); - - M.len=1; M.val[0]=0x03; -// M.len=3; M.val[0]=0x61; M.val[1]=0x62; M.val[2]=0x63; - CTX.len=3; CTX.val[0]=0x66; CTX.val[1]=0x6F; CTX.val[2]=0x6f; - - - if (prehash) { - PH_Ed448(&M,&HM); - EDDSA_SIGNATURE(true,&D, NULL,&HM, &SIG); - } else { - EDDSA_SIGNATURE(false,&D, NULL,&M, &SIG); - } - - printf("Signature= 0x"); - OCT_output(&SIG); - - if (prehash) { - PH_Ed448(&M,&HM); - verify=EDDSA_VERIFY(true,&Q, NULL ,&HM, &SIG); - } else { - verify=EDDSA_VERIFY(false,&Q, NULL ,&M, &SIG); - } - if (verify) - printf("Signature is verified\n"); - else - printf("Signature is NOT verified\n"); - - return 1; -} - -int main() -{ - int i, res; - unsigned long ran; - - char raw[100]; - octet RAW = {0, sizeof(raw), raw}; - csprng RNG; // Crypto Strong RNG - - time((time_t *)&ran); - - RAW.len = 100; // fake random seed source - RAW.val[0] = ran; - RAW.val[1] = ran >> 8; - RAW.val[2] = ran >> 16; - RAW.val[3] = ran >> 24; - for (i = 4; i < 100; i++) RAW.val[i] = i; - - CREATE_CSPRNG(&RNG, &RAW); // initialise strong RNG - - printf("\nTesting EDDSA protocols for curve Ed25519\n"); - eddsa_Ed25519(&RNG); - printf("\nTesting EDDSA protocols for curve Ed448\n"); - eddsa_Ed448(&RNG); - - KILL_CSPRNG(&RNG); -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testhpke.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testhpke.cpp deleted file mode 100644 index e761e3a..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testhpke.cpp +++ /dev/null @@ -1,590 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* test driver and function exerciser for HPKE API Functions */ - -#include -#include -#include -#include -#include "hpke_C25519.h" -#include "hpke_NIST521.h" -#include "hpke_NIST256.h" - -using namespace core; - -int hpke_C25519() -{ - using namespace C25519; - - int res=0; - int config_id=0x520; // 01|01|00100000 = 1, 1, 32 - int i,mode; - char info[32]; - - char seede[EGS_C25519]; - char seedr[EGS_C25519]; - char seeds[EGS_C25519]; - octet seedE = {0, sizeof(seede), seede}; - octet seedR = {0, sizeof(seedr), seedr}; - octet seedS = {0, sizeof(seeds), seeds}; - - char skr[EGS_C25519]; - char sks[EGS_C25519]; - char ske[EGS_C25519]; - char psks[32]; - char pskid[32]; - char pkr[EFS_C25519]; - char pks[EFS_C25519]; - char pke[EFS_C25519]; - char z[72]; - char plain[80]; - char cipher[80]; - char aad[32]; - char tag[32]; - char exporter_secret[128]; - - octet INFO = {0, sizeof(info), info}; - octet skR = {0, sizeof(skr), skr}; - octet skS = {0, sizeof(sks), sks}; - octet skE = {0, sizeof(ske), ske}; - octet psk = {0, sizeof(psks), psks}; - octet pskID = {0,sizeof(pskid), pskid}; - octet pkR = {0, sizeof(pkr), pkr}; - octet pkS = {0, sizeof(pks), pks}; - octet pkE = {0, sizeof(pke), pke}; - octet Z = {0, sizeof(z), z}; - octet PLAIN = {0,sizeof(plain),plain}; - octet CIPHER = {0,sizeof(cipher),cipher}; - octet AAD = {0,sizeof(aad),aad}; - octet TAG = {0,sizeof(tag),tag}; - octet EXPORTER_SECRET = {0,sizeof(exporter_secret),exporter_secret}; - - OCT_fromHex(&INFO,(char *)"4f6465206f6e2061204772656369616e2055726e"); - OCT_fromHex(&psk,(char *)"0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82"); - OCT_fromHex(&pskID,(char *)"456e6e796e20447572696e206172616e204d6f726961"); - OCT_fromHex(&PLAIN,(char *)"4265617574792069732074727574682c20747275746820626561757479"); - OCT_fromHex(&AAD,(char *)"436f756e742d30"); - - char key[32]; - char nonce[12]; - octet KEY = {0, sizeof(key), key}; - octet NONCE = {0, sizeof(nonce), nonce}; - -// Mode 0 - - mode=0; - printf("\nMode 0\n"); - - OCT_fromHex(&seedE,(char *)"7268600d403fce431561aef583ee1613527cff655c1343f29812e66706df3234"); - OCT_fromHex(&seedR,(char *)"6db9df30aa07dd42ee5e8181afdb977e538f5e1fec8a06223f33f7013e525037"); - - DeriveKeyPair(config_id,&skE,&pkE,&seedE); - DeriveKeyPair(config_id,&skR,&pkR,&seedR); - - HPKE_Encap(config_id,&skE,&Z,&pkE,&pkR); - - printf("pkE= "); OCT_output(&pkE); - printf("Encapsulated Secret= "); OCT_output(&Z); - - HPKE_Decap(config_id,&skR,&Z,&pkE,&pkR); - printf("Decapsulated Secret= "); OCT_output(&Z); - - HPKE_KeySchedule(config_id,&KEY,&NONCE,&EXPORTER_SECRET,mode,&Z,&INFO,NULL,NULL); - - printf("Key= "); OCT_output(&KEY); - printf("Nonce= "); OCT_output(&NONCE); - printf("Exporter Secret= "); OCT_output(&EXPORTER_SECRET); - - AES_GCM_ENCRYPT(&KEY,&NONCE,&AAD,&PLAIN,&CIPHER,&TAG); - - printf("Cipher= "); OCT_output(&CIPHER); - printf("Tag= "); OCT_output(&TAG); - -// Mode 1 - mode=1; - printf("\nMode 1\n"); - OCT_fromHex(&seedE,(char *)"78628c354e46f3e169bd231be7b2ff1c77aa302460a26dbfa15515684c00130b"); - OCT_fromHex(&seedR,(char *)"d4a09d09f575fef425905d2ab396c1449141463f698f8efdb7accfaff8995098"); - DeriveKeyPair(config_id,&skE,&pkE,&seedE); - DeriveKeyPair(config_id,&skR,&pkR,&seedR); - - HPKE_Encap(config_id,&skE,&Z,&pkE,&pkR); - - printf("pkE= "); OCT_output(&pkE); - printf("Encapsulated Z= "); OCT_output(&Z); - - HPKE_Decap(config_id,&skR,&Z,&pkE,&pkR); - printf("Decapsulated Z= "); OCT_output(&Z); - - HPKE_KeySchedule(config_id,&KEY,&NONCE,&EXPORTER_SECRET,mode,&Z,&INFO,&psk,&pskID); - - printf("Key= "); OCT_output(&KEY); - printf("Nonce= "); OCT_output(&NONCE); - printf("Exporter Secret= "); OCT_output(&EXPORTER_SECRET); - - AES_GCM_ENCRYPT(&KEY,&NONCE,&AAD,&PLAIN,&CIPHER,&TAG); - - printf("Cipher= "); OCT_output(&CIPHER); - printf("Tag= "); OCT_output(&TAG); - -// Mode 2 - mode=2; - printf("\nMode 2\n"); - OCT_fromHex(&seedE,(char *)"6e6d8f200ea2fb20c30b003a8b4f433d2f4ed4c2658d5bc8ce2fef718059c9f7"); - OCT_fromHex(&seedR,(char *)"f1d4a30a4cef8d6d4e3b016e6fd3799ea057db4f345472ed302a67ce1c20cdec"); - OCT_fromHex(&seedS,(char *)"94b020ce91d73fca4649006c7e7329a67b40c55e9e93cc907d282bbbff386f58"); - DeriveKeyPair(config_id,&skE,&pkE,&seedE); - DeriveKeyPair(config_id,&skR,&pkR,&seedR); - DeriveKeyPair(config_id,&skS,&pkS,&seedS); - - - HPKE_AuthEncap(config_id,&skE,&skS,&Z,&pkE,&pkR,&pkS); - - printf("pkE= "); OCT_output(&pkE); - printf("Encapsulated Z= "); OCT_output(&Z); - - HPKE_AuthDecap(config_id,&skR,&Z,&pkE,&pkR,&pkS); - printf("Decapsulated Z= "); OCT_output(&Z); - - HPKE_KeySchedule(config_id,&KEY,&NONCE,&EXPORTER_SECRET,mode,&Z,&INFO,NULL,NULL); - - printf("Key= "); OCT_output(&KEY); - printf("Nonce= "); OCT_output(&NONCE); - printf("Exporter Secret= "); OCT_output(&EXPORTER_SECRET); - - AES_GCM_ENCRYPT(&KEY,&NONCE,&AAD,&PLAIN,&CIPHER,&TAG); - - printf("Cipher= "); OCT_output(&CIPHER); - printf("Tag= "); OCT_output(&TAG); - -// Mode 3 - mode=3; - printf("\nMode 3\n"); - - OCT_fromHex(&seedE,(char *)"4303619085a20ebcf18edd22782952b8a7161e1dbae6e46e143a52a96127cf84"); - OCT_fromHex(&seedR,(char *)"4b16221f3b269a88e207270b5e1de28cb01f847841b344b8314d6a622fe5ee90"); - OCT_fromHex(&seedS,(char *)"62f77dcf5df0dd7eac54eac9f654f426d4161ec850cc65c54f8b65d2e0b4e345"); - DeriveKeyPair(config_id,&skE,&pkE,&seedE); - DeriveKeyPair(config_id,&skR,&pkR,&seedR); - DeriveKeyPair(config_id,&skS,&pkS,&seedS); - - HPKE_AuthEncap(config_id,&skE,&skS,&Z,&pkE,&pkR,&pkS); - - printf("pkE= "); OCT_output(&pkE); - printf("Encapsulated Z= "); OCT_output(&Z); - - HPKE_AuthDecap(config_id,&skR,&Z,&pkE,&pkR,&pkS); - printf("Decapsulated Z= "); OCT_output(&Z); - - HPKE_KeySchedule(config_id,&KEY,&NONCE,&EXPORTER_SECRET,mode,&Z,&INFO,&psk,&pskID); - - printf("Key= "); OCT_output(&KEY); - printf("Nonce= "); OCT_output(&NONCE); - printf("Exporter Secret= "); OCT_output(&EXPORTER_SECRET); - - AES_GCM_ENCRYPT(&KEY,&NONCE,&AAD,&PLAIN,&CIPHER,&TAG); - - printf("Cipher= "); OCT_output(&CIPHER); - printf("Tag= "); OCT_output(&TAG); - - return res; -} - -int hpke_NIST521() -{ - using namespace NIST521; - - int res=0; - int config_id=0xB12; // 10|11|00010010 = 2, 3, 18 - int i,mode; - char info[64]; - - char seede[EGS_NIST521]; - char seedr[EGS_NIST521]; - char seeds[EGS_NIST521]; - octet seedE = {0, sizeof(seede), seede}; - octet seedR = {0, sizeof(seedr), seedr}; - octet seedS = {0, sizeof(seeds), seeds}; - - char skr[EGS_NIST521]; - char sks[EGS_NIST521]; - char ske[EGS_NIST521]; - char psks[64]; - char pskid[64]; - char pkr[2*EFS_NIST521+1]; - char pks[2*EFS_NIST521+1]; - char pke[2*EFS_NIST521+1]; - char z[256]; - char plain[80]; - char cipher[80]; - char aad[32]; - char tag[32]; - char exporter_secret[128]; - - octet INFO = {0, sizeof(info), info}; - octet skR = {0, sizeof(skr), skr}; - octet skS = {0, sizeof(sks), sks}; - octet skE = {0, sizeof(ske), ske}; - octet psk = {0, sizeof(psks), psks}; - octet pskID = {0,sizeof(pskid), pskid}; - octet pkR = {0, sizeof(pkr), pkr}; - octet pkS = {0, sizeof(pks), pks}; - octet pkE = {0, sizeof(pke), pke}; - octet Z = {0, sizeof(z), z}; - octet PLAIN = {0,sizeof(plain),plain}; - octet CIPHER = {0,sizeof(cipher),cipher}; - octet AAD = {0,sizeof(aad),aad}; - octet TAG = {0,sizeof(tag),tag}; - octet EXPORTER_SECRET = {0,sizeof(exporter_secret),exporter_secret}; - - OCT_fromHex(&INFO,(char *)"4f6465206f6e2061204772656369616e2055726e"); - OCT_fromHex(&psk,(char *)"0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82"); - OCT_fromHex(&pskID,(char *)"456e6e796e20447572696e206172616e204d6f726961"); - OCT_fromHex(&PLAIN,(char *)"4265617574792069732074727574682c20747275746820626561757479"); - OCT_fromHex(&AAD,(char *)"436f756e742d30"); - - char key[64]; - char nonce[24]; - octet KEY = {0, sizeof(key), key}; - octet NONCE = {0, sizeof(nonce), nonce}; - -// Mode 0 - - mode=0; - printf("\nMode 0\n"); - - OCT_fromHex(&seedE,(char *)"7f06ab8215105fc46aceeb2e3dc5028b44364f960426eb0d8e4026c2f8b5d7e7a986688f1591abf5ab753c357a5d6f0440414b4ed4ede71317772ac98d9239f70904"); - OCT_fromHex(&seedR,(char *)"2ad954bbe39b7122529f7dde780bff626cd97f850d0784a432784e69d86eccaade43b6c10a8ffdb94bf943c6da479db137914ec835a7e715e36e45e29b587bab3bf1"); - - DeriveKeyPair(config_id,&skE,&pkE,&seedE); - DeriveKeyPair(config_id,&skR,&pkR,&seedR); - - HPKE_Encap(config_id,&skE,&Z,&pkE,&pkR); - - printf("pkE= "); OCT_output(&pkE); - printf("Encapsulated Z= "); OCT_output(&Z); - - HPKE_Decap(config_id,&skR,&Z,&pkE,&pkR); - printf("Decapsulated Z= "); OCT_output(&Z); - - HPKE_KeySchedule(config_id,&KEY,&NONCE,&EXPORTER_SECRET,mode,&Z,&INFO,NULL,NULL); - - printf("Key= "); OCT_output(&KEY); - printf("Nonce= "); OCT_output(&NONCE); - printf("Exporter Secret= "); OCT_output(&EXPORTER_SECRET); - - AES_GCM_ENCRYPT(&KEY,&NONCE,&AAD,&PLAIN,&CIPHER,&TAG); - - printf("Cipher= "); OCT_output(&CIPHER); - printf("Tag= "); OCT_output(&TAG); - -// Mode 1 - mode=1; - printf("\nMode 1\n"); - - OCT_fromHex(&seedE,(char *)"f3ebfa9a69a924e672114fcd9e06fa9559e937f7eccce4181a2b506df53dbe514be12f094bb28e01de19dd345b4f7ede5ad7eaa6b9c3019592ec68eaae9a14732ce0"); - OCT_fromHex(&seedR,(char *)"a2a2458705e278e574f835effecd18232f8a4c459e7550a09d44348ae5d3b1ea9d95c51995e657ad6f7cae659f5e186126a471c017f8f5e41da9eba74d4e0473e179"); - DeriveKeyPair(config_id,&skE,&pkE,&seedE); - DeriveKeyPair(config_id,&skR,&pkR,&seedR); - - HPKE_Encap(config_id,&skE,&Z,&pkE,&pkR); - - printf("pkE= "); OCT_output(&pkE); - printf("Encapsulated Z= "); OCT_output(&Z); - - HPKE_Decap(config_id,&skR,&Z,&pkE,&pkR); - printf("Decapsulated Z= "); OCT_output(&Z); - - HPKE_KeySchedule(config_id,&KEY,&NONCE,&EXPORTER_SECRET,mode,&Z,&INFO,&psk,&pskID); - - printf("Key= "); OCT_output(&KEY); - printf("Nonce= "); OCT_output(&NONCE); - printf("Exporter Secret= "); OCT_output(&EXPORTER_SECRET); - - AES_GCM_ENCRYPT(&KEY,&NONCE,&AAD,&PLAIN,&CIPHER,&TAG); - - printf("Cipher= "); OCT_output(&CIPHER); - printf("Tag= "); OCT_output(&TAG); - -// Mode 2 - mode=2; - printf("\nMode 2\n"); - - OCT_fromHex(&seedE,(char *)"fe1c589c2a05893895a537f38c7cb4300b5a7e8fef3d6ccb8f07a498029c61e90262e009dc254c7f6235f9c6b2fd6aeff0a714db131b09258c16e217b7bd2aa619b0"); - OCT_fromHex(&seedR,(char *)"8feea0438481fc0ecd470d6adfcda334a759c6b8650452c5a5dd9b2dd2cc9be33d2bb7ee64605fc07ab4664a58bb9a8de80defe510b6c97d2daf85b92cd4bb0a66bf"); - OCT_fromHex(&seedS,(char *)"2f66a68b85ef04822b054ef521838c00c64f8b6226935593b69e13a1a2461a4f1a74c10c836e87eed150c0db85d4e4f506cbb746149befac6f5c07dc48a615ef92db"); - DeriveKeyPair(config_id,&skE,&pkE,&seedE); - DeriveKeyPair(config_id,&skR,&pkR,&seedR); - DeriveKeyPair(config_id,&skS,&pkS,&seedS); - - HPKE_AuthEncap(config_id,&skE,&skS,&Z,&pkE,&pkR,&pkS); - - printf("pkE= "); OCT_output(&pkE); - printf("Encapsulated Z= "); OCT_output(&Z); - - HPKE_AuthDecap(config_id,&skR,&Z,&pkE,&pkR,&pkS); - printf("Decapsulated Z= "); OCT_output(&Z); - - HPKE_KeySchedule(config_id,&KEY,&NONCE,&EXPORTER_SECRET,mode,&Z,&INFO,NULL,NULL); - - printf("Key= "); OCT_output(&KEY); - printf("Nonce= "); OCT_output(&NONCE); - printf("Exporter Secret= "); OCT_output(&EXPORTER_SECRET); - - AES_GCM_ENCRYPT(&KEY,&NONCE,&AAD,&PLAIN,&CIPHER,&TAG); - - printf("Cipher= "); OCT_output(&CIPHER); - printf("Tag= "); OCT_output(&TAG); - -// Mode 3 - mode=3; - printf("\nMode 3\n"); - - OCT_fromHex(&seedE,(char *)"54272797b1fbc128a6967ff1fd606e0c67868f7762ce1421439cbc9e90ce1b28d566e6c2acbce712e48eebf236696eb680849d6873e9959395b2931975d61d38bd6c"); - OCT_fromHex(&seedR,(char *)"3db434a8bc25b27eb0c590dc64997ab1378a99f52b2cb5a5a5b2fa540888f6c0f09794c654f4468524e040e6b4eca2c9dcf229f908b9d318f960cc9e9baa92c5eee6"); - OCT_fromHex(&seedS,(char *)"65d523d9b37e1273eb25ad0527d3a7bd33f67208dd1666d9904c6bc04969ae5831a8b849e7ff642581f2c3e56be84609600d3c6bbdaded3f6989c37d2892b1e978d5"); - DeriveKeyPair(config_id,&skE,&pkE,&seedE); - DeriveKeyPair(config_id,&skR,&pkR,&seedR); - DeriveKeyPair(config_id,&skS,&pkS,&seedS); - - HPKE_AuthEncap(config_id,&skE,&skS,&Z,&pkE,&pkR,&pkS); - - printf("pkE= "); OCT_output(&pkE); - printf("Encapsulated Z= "); OCT_output(&Z); - - HPKE_AuthDecap(config_id,&skR,&Z,&pkE,&pkR,&pkS); - printf("Decapsulated Z= "); OCT_output(&Z); - - HPKE_KeySchedule(config_id,&KEY,&NONCE,&EXPORTER_SECRET,mode,&Z,&INFO,&psk,&pskID); - - printf("Key= "); OCT_output(&KEY); - printf("Nonce= "); OCT_output(&NONCE); - printf("Exporter Secret= "); OCT_output(&EXPORTER_SECRET); - - AES_GCM_ENCRYPT(&KEY,&NONCE,&AAD,&PLAIN,&CIPHER,&TAG); - - printf("Cipher= "); OCT_output(&CIPHER); - printf("Tag= "); OCT_output(&TAG); - - return res; -} - -int hpke_NIST256() -{ - using namespace NIST256; - - int res=0; - int config_id=0x510; // 10|11|00010010 = 2, 3, 18 // 01|01|00010000 = 1, 1, 16 - int i,mode; - char info[64]; - - char seede[EGS_NIST256]; - char seedr[EGS_NIST256]; - char seeds[EGS_NIST256]; - octet seedE = {0, sizeof(seede), seede}; - octet seedR = {0, sizeof(seedr), seedr}; - octet seedS = {0, sizeof(seeds), seeds}; - - char skr[EGS_NIST256]; - char sks[EGS_NIST256]; - char ske[EGS_NIST256]; - char psks[64]; - char pskid[64]; - char pkr[2*EFS_NIST256+1]; - char pks[2*EFS_NIST256+1]; - char pke[2*EFS_NIST256+1]; - char z[256]; - char plain[80]; - char cipher[80]; - char aad[32]; - char tag[32]; - char exporter_secret[128]; - - octet INFO = {0, sizeof(info), info}; - octet skR = {0, sizeof(skr), skr}; - octet skS = {0, sizeof(sks), sks}; - octet skE = {0, sizeof(ske), ske}; - octet psk = {0, sizeof(psks), psks}; - octet pskID = {0,sizeof(pskid), pskid}; - octet pkR = {0, sizeof(pkr), pkr}; - octet pkS = {0, sizeof(pks), pks}; - octet pkE = {0, sizeof(pke), pke}; - octet Z = {0, sizeof(z), z}; - octet PLAIN = {0,sizeof(plain),plain}; - octet CIPHER = {0,sizeof(cipher),cipher}; - octet AAD = {0,sizeof(aad),aad}; - octet TAG = {0,sizeof(tag),tag}; - octet EXPORTER_SECRET = {0,sizeof(exporter_secret),exporter_secret}; - - OCT_fromHex(&INFO,(char *)"4f6465206f6e2061204772656369616e2055726e"); - OCT_fromHex(&psk,(char *)"0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82"); - OCT_fromHex(&pskID,(char *)"456e6e796e20447572696e206172616e204d6f726961"); - OCT_fromHex(&PLAIN,(char *)"4265617574792069732074727574682c20747275746820626561757479"); - OCT_fromHex(&AAD,(char *)"436f756e742d30"); - - char key[64]; - char nonce[24]; - octet KEY = {0, sizeof(key), key}; - octet NONCE = {0, sizeof(nonce), nonce}; - -// Mode 0 - - mode=0; - printf("\nMode 0\n"); - - OCT_fromHex(&seedE,(char *)"4270e54ffd08d79d5928020af4686d8f6b7d35dbe470265f1f5aa22816ce860e"); - OCT_fromHex(&seedR,(char *)"668b37171f1072f3cf12ea8a236a45df23fc13b82af3609ad1e354f6ef817550"); - - //printf("seedE= "); OCT_output(&seedE); - - DeriveKeyPair(config_id,&skE,&pkE,&seedE); - - //printf("1. pkE= "); OCT_output(&pkE); - - DeriveKeyPair(config_id,&skR,&pkR,&seedR); - - HPKE_Encap(config_id,&skE,&Z,&pkE,&pkR); - printf("pkE= "); OCT_output(&pkE); - - - printf("Encapsulated Z= "); OCT_output(&Z); - - HPKE_Decap(config_id,&skR,&Z,&pkE,&pkR); - printf("Decapsulated Z= "); OCT_output(&Z); - - HPKE_KeySchedule(config_id,&KEY,&NONCE,&EXPORTER_SECRET,mode,&Z,&INFO,NULL,NULL); - - printf("Key= "); OCT_output(&KEY); - printf("Nonce= "); OCT_output(&NONCE); - printf("Exporter Secret= "); OCT_output(&EXPORTER_SECRET); - - AES_GCM_ENCRYPT(&KEY,&NONCE,&AAD,&PLAIN,&CIPHER,&TAG); - - printf("Cipher= "); OCT_output(&CIPHER); - printf("Tag= "); OCT_output(&TAG); - -// Mode 1 - mode=1; - printf("\nMode 1\n"); - - OCT_fromHex(&seedE,(char *)"2afa611d8b1a7b321c761b483b6a053579afa4f767450d3ad0f84a39fda587a6"); - OCT_fromHex(&seedR,(char *)"d42ef874c1913d9568c9405407c805baddaffd0898a00f1e84e154fa787b2429"); - DeriveKeyPair(config_id,&skE,&pkE,&seedE); - DeriveKeyPair(config_id,&skR,&pkR,&seedR); - - HPKE_Encap(config_id,&skE,&Z,&pkE,&pkR); - - printf("pkE= "); OCT_output(&pkE); - printf("Encapsulated Z= "); OCT_output(&Z); - - HPKE_Decap(config_id,&skR,&Z,&pkE,&pkR); - printf("Decapsulated Z= "); OCT_output(&Z); - - HPKE_KeySchedule(config_id,&KEY,&NONCE,&EXPORTER_SECRET,mode,&Z,&INFO,&psk,&pskID); - - printf("Key= "); OCT_output(&KEY); - printf("Nonce= "); OCT_output(&NONCE); - printf("Exporter Secret= "); OCT_output(&EXPORTER_SECRET); - - AES_GCM_ENCRYPT(&KEY,&NONCE,&AAD,&PLAIN,&CIPHER,&TAG); - - printf("Cipher= "); OCT_output(&CIPHER); - printf("Tag= "); OCT_output(&TAG); - -// Mode 2 - mode=2; - printf("\nMode 2\n"); - - OCT_fromHex(&seedE,(char *)"798d82a8d9ea19dbc7f2c6dfa54e8a6706f7cdc119db0813dacf8440ab37c857"); - OCT_fromHex(&seedR,(char *)"7bc93bde8890d1fb55220e7f3b0c107ae7e6eda35ca4040bb6651284bf0747ee"); - OCT_fromHex(&seedS,(char *)"874baa0dcf93595a24a45a7f042e0d22d368747daaa7e19f80a802af19204ba8"); - DeriveKeyPair(config_id,&skE,&pkE,&seedE); - DeriveKeyPair(config_id,&skR,&pkR,&seedR); - DeriveKeyPair(config_id,&skS,&pkS,&seedS); - - HPKE_AuthEncap(config_id,&skE,&skS,&Z,&pkE,&pkR,&pkS); - - printf("pkE= "); OCT_output(&pkE); - printf("Encapsulated Z= "); OCT_output(&Z); - - HPKE_AuthDecap(config_id,&skR,&Z,&pkE,&pkR,&pkS); - printf("Decapsulated Z= "); OCT_output(&Z); - - HPKE_KeySchedule(config_id,&KEY,&NONCE,&EXPORTER_SECRET,mode,&Z,&INFO,NULL,NULL); - - printf("Key= "); OCT_output(&KEY); - printf("Nonce= "); OCT_output(&NONCE); - printf("Exporter Secret= "); OCT_output(&EXPORTER_SECRET); - - AES_GCM_ENCRYPT(&KEY,&NONCE,&AAD,&PLAIN,&CIPHER,&TAG); - - printf("Cipher= "); OCT_output(&CIPHER); - printf("Tag= "); OCT_output(&TAG); - -// Mode 3 - mode=3; - printf("\nMode 3\n"); - - OCT_fromHex(&seedE,(char *)"3c1fceb477ec954c8d58ef3249e4bb4c38241b5925b95f7486e4d9f1d0d35fbb"); - OCT_fromHex(&seedR,(char *)"abcc2da5b3fa81d8aabd91f7f800a8ccf60ec37b1b585a5d1d1ac77f258b6cca"); - OCT_fromHex(&seedS,(char *)"6262031f040a9db853edd6f91d2272596eabbc78a2ed2bd643f770ecd0f19b82"); - DeriveKeyPair(config_id,&skE,&pkE,&seedE); - DeriveKeyPair(config_id,&skR,&pkR,&seedR); - DeriveKeyPair(config_id,&skS,&pkS,&seedS); - - HPKE_AuthEncap(config_id,&skE,&skS,&Z,&pkE,&pkR,&pkS); - - printf("pkE= "); OCT_output(&pkE); - printf("Encapsulated Z= "); OCT_output(&Z); - - HPKE_AuthDecap(config_id,&skR,&Z,&pkE,&pkR,&pkS); - printf("Decapsulated Z= "); OCT_output(&Z); - - HPKE_KeySchedule(config_id,&KEY,&NONCE,&EXPORTER_SECRET,mode,&Z,&INFO,&psk,&pskID); - - printf("Key= "); OCT_output(&KEY); - printf("Nonce= "); OCT_output(&NONCE); - printf("Exporter Secret= "); OCT_output(&EXPORTER_SECRET); - - AES_GCM_ENCRYPT(&KEY,&NONCE,&AAD,&PLAIN,&CIPHER,&TAG); - - printf("Cipher= "); OCT_output(&CIPHER); - printf("Tag= "); OCT_output(&TAG); - - return res; -} - -int main() -{ - printf("\n%d bit build", CHUNK); - - printf("\nTesting HPKE for curve C25519\n"); - hpke_C25519(); - - printf("\nTesting HPKE for curve NIST521\n"); - hpke_NIST521(); - - printf("\nTesting HPKE for curve NIST256\n"); - hpke_NIST256(); -} - - - - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testhtp.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testhtp.cpp deleted file mode 100644 index 3f21370..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testhtp.cpp +++ /dev/null @@ -1,714 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* test driver and function exerciser for HTP API Functions */ - -#include -#include -#include -#include -#include "core.h" -#include "randapi.h" -#include "ecp_NIST256.h" -#include "ecp_Ed25519.h" -#include "ecp_C25519.h" -#include "ecp_Ed448.h" -#include "ecp_SECP256K1.h" -#include "ecp_BLS12381.h" -#include "ecp2_BLS12381.h" - -using namespace core; - -#define CEIL(a,b) (((a)-1)/(b)+1) - -/* Select curves 1,2,3,7,17,29 */ - -/* https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/ */ - -static void hash_to_field_Ed25519(int hash,int hlen,F25519::FP *u,octet *DST,octet *M, int ctr) -{ - using namespace Ed25519; - using namespace Ed25519_BIG; - using namespace Ed25519_FP; - - int i,j,L,k,m; - BIG q,w,r; - DBIG dx; - char okm[512],fd[256]; - octet OKM = {0,sizeof(okm),okm}; - - BIG_rcopy(q, Modulus); - k=BIG_nbits(q); - BIG_rcopy(r, CURVE_Order); - m=BIG_nbits(r); - L=CEIL(k+CEIL(m,2),8); - - XMD_Expand(hash,hlen,&OKM,L*ctr,DST,M); - for (i=0;i> 8; - RAW.val[2] = ran >> 16; - RAW.val[3] = ran >> 24; - for (i = 4; i < 100; i++) RAW.val[i] = i; - - CREATE_CSPRNG(&RNG, &RAW); // initialise strong RNG - - printf("%d bit build", CHUNK); - - printf("\nTesting HTP for curve Ed25519\n"); - htp_Ed25519((char *)""); - htp_Ed25519((char *)"abc"); - htp_Ed25519((char *)"abcdef0123456789"); - htp_Ed25519((char *)"q128_qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"); - htp_Ed25519((char *)"a512_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); - - printf("\nTesting HTP for curve C25519\n"); - htp_C25519((char *)""); - htp_C25519((char *)"abc"); - htp_C25519((char *)"abcdef0123456789"); - htp_C25519((char *)"q128_qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"); - htp_C25519((char *)"a512_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); - - - printf("\nTesting HTP for curve NIST256\n"); - htp_NIST256((char *)""); - htp_NIST256((char *)"abc"); - htp_NIST256((char *)"abcdef0123456789"); - htp_NIST256((char *)"q128_qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"); - htp_NIST256((char *)"a512_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); - - printf("\nTesting HTP for curve Ed448\n"); - htp_Ed448((char *)""); - htp_Ed448((char *)"abc"); - htp_Ed448((char *)"abcdef0123456789"); - htp_Ed448((char *)"q128_qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"); - htp_Ed448((char *)"a512_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); - - printf("\nTesting HTP for curve SECP256K1\n"); - htp_SECP256K1((char *)""); - htp_SECP256K1((char *)"abc"); - htp_SECP256K1((char *)"abcdef0123456789"); - htp_SECP256K1((char *)"q128_qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"); - htp_SECP256K1((char *)"a512_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); - - printf("\nTesting HTP for curve BLS12381_G1\n"); - htp_BLS12381((char *)""); - htp_BLS12381((char *)"abc"); - htp_BLS12381((char *)"abcdef0123456789"); - htp_BLS12381((char *)"q128_qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"); - htp_BLS12381((char *)"a512_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); - - printf("\nTesting HTP for curve BLS12381_G2\n"); - htp_BLS12381_G2((char *)""); - htp_BLS12381_G2((char *)"abc"); - htp_BLS12381_G2((char *)"abcdef0123456789"); - htp_BLS12381_G2((char *)"q128_qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"); - htp_BLS12381_G2((char *)"a512_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); - - - KILL_CSPRNG(&RNG); -} - - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testkyber b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testkyber deleted file mode 100644 index 3c75b81..0000000 Binary files a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testkyber and /dev/null differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testkyber.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testkyber.cpp deleted file mode 100644 index ca961c9..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testkyber.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2012-2021 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* test driver and function exerciser for Kyber functions */ -/* g++ -O2 testkyber.cpp core.a -o testkyber */ - -#include -#include -#include "kyber.h" - -using namespace core; - -#define LOOPS 100 - -int main() { - int i,j; - unsigned long ran; - bool result; - char raw[100]; - csprng RNG; - char sk[KYBER_SECRET_CPA_SIZE_768], pk[KYBER_PUBLIC_SIZE_768],ct[KYBER_CIPHERTEXT_SIZE_768],skc[KYBER_SECRET_CCA_SIZE_768],ss[KYBER_SHARED_SECRET_768]; - octet SKC = {0, sizeof(skc), skc}; - octet SK = {0, sizeof(sk), sk}; - octet PK = {0, sizeof(pk), pk}; - octet CT = {0, sizeof(ct), ct}; - octet SS = {0, sizeof(ss), ss}; - - byte tau[32],r64[64],r32[32]; - byte coins[32]; - - time((time_t *)&ran); - - raw[0] = ran; - raw[1] = ran >> 8; - raw[2] = ran >> 16; - raw[3] = ran >> 24; - - for (i = 0; i < 100; i++) raw[i] = i + 1; - RAND_seed(&RNG, 100, raw); - - printf("Testing Kyber Encryption\n"); - - for (j=0;j -#include -#include -#include -#include "mpin_BN254.h" -#include "randapi.h" - -#if CHUNK==32 || CHUNK==64 -#include "mpin_BLS12383.h" -#include "mpin192_BLS24479.h" -#include "mpin256_BLS48556.h" -#endif - -using namespace core; - -int mpin_BN254(csprng *RNG) -{ - - using namespace BN254; - int i, pin, rtn; - char x[PGS_BN254], s[PGS_BN254], y[PGS_BN254], client_id[100], sst[4 * PFS_BN254 + 1], token[2 * PFS_BN254 + 1], sec[2 * PFS_BN254 + 1], u[2 * PFS_BN254 + 1]; - char hcid[2*PFS_BN254+1], hsid[2*PFS_BN254+1], dst[256]; - - octet S = {0, sizeof(s), s}; - octet X = {0, sizeof(x), x}; - octet Y = {0, sizeof(y), y}; - octet CLIENT_ID = {0, sizeof(client_id), client_id}; - octet SST = {0, sizeof(sst), sst}; - octet TOKEN = {0, sizeof(token), token}; - octet SEC = {0, sizeof(sec), sec}; - octet U = {0, sizeof(u), u}; - octet HCID = {0, sizeof(hcid), hcid}; - octet HSID = {0, sizeof(hsid), hsid}; - octet DST = {0, sizeof(dst), dst}; - OCT_jstring(&DST,(char *)"BN254G1_XMD:SHA-256_SVDW_NU_MPIN"); // Domain Separation Tag - - // Trusted Authority (TA) set-up - MPIN_RANDOM_GENERATE(RNG, &S); - printf("Master Secret= "); - OCT_output(&S); - -// Client Identity - OCT_jstring(&CLIENT_ID, (char *)"testUser@miracl.com"); - MPIN_ENCODE_TO_CURVE(&DST,&CLIENT_ID,&HCID); - printf("Client ID Hashed to Curve= "); - OCT_output(&HCID); -// printf("\n"); - -// Client approaches Trusted Authority and is issued secret - - MPIN_GET_CLIENT_SECRET(&S, &HCID, &TOKEN); - printf("Client Secret= "); - OCT_output(&TOKEN); - -// TA sends Client secret to Client - -// Server is issued secret by TA - MPIN_GET_SERVER_SECRET(&S, &SST); -// printf("Server Secret= "); -// OCT_output(&SST); - -// TA sends Server secret to Server - -// Client extracts PIN from secret to create Token - //pin = 1234; - //printf("Client extracts PIN= %d\n", pin); - pin=0; printf("Client chooses PIN= "); - if (scanf("%d", &pin)) {}; // to avoid silly compile error - getchar(); - MPIN_EXTRACT_PIN(&HCID, pin, &TOKEN); - printf("Client Token= "); - OCT_output(&TOKEN); - - -// Exercise Secret Sharing - char s1[2 * PFS_BN254 + 1],s2[2 * PFS_BN254 + 1],s3[2 * PFS_BN254 + 1],s4[2 * PFS_BN254 + 1],r[128]; - octet S1 = {0, sizeof(s1), s1}; - octet S2 = {0, sizeof(s2), s2}; - octet S3 = {0, sizeof(s3), s3}; - octet S4 = {0, sizeof(s4), s4}; - octet R = {0,sizeof(r),r}; - OCT_rand(&R,RNG,128); - - // create 4 unique shares of TOKEN - share Sh1=getshare(1,3,&S1,&TOKEN,&R); // indicate 3 shares required for recovery - share Sh2=getshare(2,3,&S2,&TOKEN,&R); - share Sh3=getshare(3,3,&S3,&TOKEN,&R); - share Sh4=getshare(4,3,&S4,&TOKEN,&R); - - OCT_clear(&TOKEN); // kill token - - share Shares[3]; - Shares[0]=Sh1; // any 3 shares to recover TOKEN - Shares[1]=Sh2; - Shares[2]=Sh4; - recover(&TOKEN,Shares); // recover token - -// MPin Protocol - -// Client enters ID and PIN - OCT_clear(&CLIENT_ID); - OCT_jstring(&CLIENT_ID, (char *)"testUser@miracl.com"); - MPIN_ENCODE_TO_CURVE(&DST,&CLIENT_ID,&HCID); - pin=0; printf("Client enters PIN= "); - if (scanf("%d", &pin)) {}; // to avoid silly compile error - getchar(); - -// Client First pass: Inputs H(CLIENT_ID), RNG, pin, and TOKEN. Output x and U = x.H(CLIENT_ID) and re-combined secret SEC - - if (MPIN_CLIENT_1(&HCID, RNG, &X, pin, &TOKEN, &SEC, &U) != 0) - { - printf("Error from Client side - First Pass\n"); - return 1; - } - -// Send CLIENT_ID and U=x.ID to server. Server hashes ID to curve. - MPIN_ENCODE_TO_CURVE(&DST,&CLIENT_ID,&HSID); - -// Server generates Random number Y and sends it to Client - MPIN_RANDOM_GENERATE(RNG, &Y); - -// Client Second Pass: Inputs Client secret SEC, x and y. Sends -(x+y)*SEC to Server - if (MPIN_CLIENT_2(&X, &Y, &SEC) != 0) - { - printf("Error from Client side - Second Pass\n"); - return 1; - } - -// Server Second phase. Inputs H(CLIENT_ID), Y, -(x+y)*SEC, U and Server secret SST. - - rtn = MPIN_SERVER(&HSID, &Y, &SST, &U, &SEC); - if (rtn != 0) - { - printf("Server says - Bad Pin.\n"); - return 1; - } - else - { - printf("Server says - PIN is good! You really are "); - OCT_output_string(&CLIENT_ID); - printf(".\n"); - } - printf("\n"); - - return 0; -} - -#if CHUNK==32 || CHUNK==64 - -int mpin_BLS12383(csprng *RNG) -{ - using namespace BLS12383; - int pin, rtn; - - char x[PGS_BLS12383], s[PGS_BLS12383], y[PGS_BLS12383], client_id[100], sst[4 * PFS_BLS12383 + 1], token[2 * PFS_BLS12383 + 1], sec[2 * PFS_BLS12383 + 1], u[2 * PFS_BLS12383 + 1]; - char hcid[2*PFS_BLS12383+1], hsid[2*PFS_BLS12383+1], dst[256]; - - octet S = {0, sizeof(s), s}; - octet X = {0, sizeof(x), x}; - octet Y = {0, sizeof(y), y}; - octet CLIENT_ID = {0, sizeof(client_id), client_id}; - octet SST = {0, sizeof(sst), sst}; - octet TOKEN = {0, sizeof(token), token}; - octet SEC = {0, sizeof(sec), sec}; - octet U = {0, sizeof(u), u}; - octet HCID = {0, sizeof(hcid), hcid}; - octet HSID = {0, sizeof(hsid), hsid}; - octet DST = {0, sizeof(dst), dst}; - OCT_jstring(&DST,(char *)"BLS12383G1_XMD:SHA-256_SVDW_NU_MPIN"); // Domain Separation Tag - - // Trusted Authority (TA) set-up - MPIN_RANDOM_GENERATE(RNG, &S); - printf("Master Secret= "); - OCT_output(&S); - -// Client Identity - OCT_jstring(&CLIENT_ID, (char *)"testUser@miracl.com"); - MPIN_ENCODE_TO_CURVE(&DST,&CLIENT_ID,&HCID); - printf("Client ID Hashed to Curve= "); - OCT_output(&HCID); -// printf("\n"); - -// Client approaches Trusted Authority and is issued secret - - MPIN_GET_CLIENT_SECRET(&S, &HCID, &TOKEN); - printf("Client Secret= "); - OCT_output(&TOKEN); - -// TA sends Client secret to Client - -// Server is issued secret by TA - MPIN_GET_SERVER_SECRET(&S, &SST); -// printf("Server Secret= "); -// OCT_output(&SST); - -// TA sends Server secret to Server - -// Client extracts PIN from secret to create Token - //pin = 1234; - //printf("Client extracts PIN= %d\n", pin); - pin=0; printf("Client chooses PIN= "); - if (scanf("%d", &pin)) {}; // to avoid silly compile error - getchar(); - MPIN_EXTRACT_PIN(&HCID, pin, &TOKEN); - printf("Client Token= "); - OCT_output(&TOKEN); - -// MPin Protocol - -// Client enters ID and PIN - OCT_clear(&CLIENT_ID); - OCT_jstring(&CLIENT_ID, (char *)"testUser@miracl.com"); - MPIN_ENCODE_TO_CURVE(&DST,&CLIENT_ID,&HCID); - pin=0; printf("Client enters PIN= "); - if (scanf("%d", &pin)) {}; // to avoid silly compile error - getchar(); - -// Client First pass: Inputs H(CLIENT_ID), RNG, pin, and TOKEN. Output x and U = x.H(CLIENT_ID) and re-combined secret SEC - - if (MPIN_CLIENT_1(&HCID, RNG, &X, pin, &TOKEN, &SEC, &U) != 0) - { - printf("Error from Client side - First Pass\n"); - return 1; - } - -// Send CLIENT_ID and U=x.ID to server. Server hashes ID to curve. - MPIN_ENCODE_TO_CURVE(&DST,&CLIENT_ID,&HSID); - -// Server generates Random number Y and sends it to Client - MPIN_RANDOM_GENERATE(RNG, &Y); - -// Client Second Pass: Inputs Client secret SEC, x and y. Sends -(x+y)*SEC to Server - if (MPIN_CLIENT_2(&X, &Y, &SEC) != 0) - { - printf("Error from Client side - Second Pass\n"); - return 1; - } - -// Server Second phase. Inputs H(CLIENT_ID), Y, -(x+y)*SEC, U and Server secret SST. - - rtn = MPIN_SERVER(&HSID, &Y, &SST, &U, &SEC); - if (rtn != 0) - { - printf("Server says - Bad Pin.\n"); - return 1; - } - else - { - printf("Server says - PIN is good! You really are "); - OCT_output_string(&CLIENT_ID); - printf(".\n"); - } - printf("\n"); - return 0; -} - -int mpin192_BLS24479(csprng *RNG) -{ - using namespace BLS24479; - int pin, rtn; - char x[PGS_BLS24479], s[PGS_BLS24479], y[PGS_BLS24479], client_id[100], sst[8 * PFS_BLS24479 + 1], token[2 * PFS_BLS24479 + 1], sec[2 * PFS_BLS24479 + 1], u[2 * PFS_BLS24479 + 1]; - char hcid[2*PFS_BLS24479+1], hsid[2*PFS_BLS24479+1], dst[256]; - - octet S = {0, sizeof(s), s}; - octet X = {0, sizeof(x), x}; - octet Y = {0, sizeof(y), y}; - octet CLIENT_ID = {0, sizeof(client_id), client_id}; - octet SST = {0, sizeof(sst), sst}; - octet TOKEN = {0, sizeof(token), token}; - octet SEC = {0, sizeof(sec), sec}; - octet U = {0, sizeof(u), u}; - octet HCID = {0, sizeof(hcid), hcid}; - octet HSID = {0, sizeof(hsid), hsid}; - octet DST = {0, sizeof(dst), dst}; - OCT_jstring(&DST,(char *)"BLS24479G1_XMD:SHA-384_SVDW_NU_MPIN"); // Domain Separation Tag - - - // Trusted Authority (TA) set-up - MPIN_RANDOM_GENERATE(RNG, &S); - printf("Master Secret= "); - OCT_output(&S); - -// Client Identity - OCT_jstring(&CLIENT_ID, (char *)"testUser@miracl.com"); - MPIN_ENCODE_TO_CURVE(&DST,&CLIENT_ID,&HCID); - printf("Client ID Hashed to Curve= "); - OCT_output(&HCID); -// printf("\n"); - -// Client approaches Trusted Authority and is issued secret - - MPIN_GET_CLIENT_SECRET(&S, &HCID, &TOKEN); - printf("Client Secret= "); - OCT_output(&TOKEN); - -// TA sends Client secret to Client - -// Server is issued secret by TA - MPIN_GET_SERVER_SECRET(&S, &SST); -// printf("Server Secret= "); -// OCT_output(&SST); - -// TA sends Server secret to Server - -// Client extracts PIN from secret to create Token - //pin = 1234; - //printf("Client extracts PIN= %d\n", pin); - pin=0; printf("Client chooses PIN= "); - if (scanf("%d", &pin)) {}; // to avoid silly compile error - getchar(); - MPIN_EXTRACT_PIN(&HCID, pin, &TOKEN); - printf("Client Token= "); - OCT_output(&TOKEN); - -// MPin Protocol - -// Client enters ID and PIN - OCT_clear(&CLIENT_ID); - OCT_jstring(&CLIENT_ID, (char *)"testUser@miracl.com"); - MPIN_ENCODE_TO_CURVE(&DST,&CLIENT_ID,&HCID); - pin=0; printf("Client enters PIN= "); - if (scanf("%d", &pin)) {}; // to avoid silly compile error - getchar(); - -// Client First pass: Inputs H(CLIENT_ID), RNG, pin, and TOKEN. Output x and U = x.H(CLIENT_ID) and re-combined secret SEC - - if (MPIN_CLIENT_1(&HCID, RNG, &X, pin, &TOKEN, &SEC, &U) != 0) - { - printf("Error from Client side - First Pass\n"); - return 1; - } - -// Send CLIENT_ID and U=x.ID to server. Server hashes ID to curve. - MPIN_ENCODE_TO_CURVE(&DST,&CLIENT_ID,&HSID); - -// Server generates Random number Y and sends it to Client - MPIN_RANDOM_GENERATE(RNG, &Y); - -// Client Second Pass: Inputs Client secret SEC, x and y. Sends -(x+y)*SEC to Server - if (MPIN_CLIENT_2(&X, &Y, &SEC) != 0) - { - printf("Error from Client side - Second Pass\n"); - return 1; - } - -// Server Second phase. Inputs H(CLIENT_ID), Y, -(x+y)*SEC, U and Server secret SST. - - rtn = MPIN_SERVER(&HSID, &Y, &SST, &U, &SEC); - if (rtn != 0) - { - printf("Server says - Bad Pin.\n"); - return 1; - } - else - { - printf("Server says - PIN is good! You really are "); - OCT_output_string(&CLIENT_ID); - printf(".\n"); - } - printf("\n"); - return 0; -} - -int mpin256_BLS48556(csprng *RNG) -{ - using namespace BLS48556; - int pin, rtn; - char x[PGS_BLS48556], s[PGS_BLS48556], y[PGS_BLS48556], client_id[100], sst[16 * PFS_BLS48556 + 1], token[2 * PFS_BLS48556 + 1], sec[2 * PFS_BLS48556 + 1], u[2 * PFS_BLS48556 + 1]; - char hcid[2*PFS_BLS48556+1], hsid[2*PFS_BLS48556+1], dst[256]; - - octet S = {0, sizeof(s), s}; - octet X = {0, sizeof(x), x}; - octet Y = {0, sizeof(y), y}; - octet CLIENT_ID = {0, sizeof(client_id), client_id}; - octet SST = {0, sizeof(sst), sst}; - octet TOKEN = {0, sizeof(token), token}; - octet SEC = {0, sizeof(sec), sec}; - octet U = {0, sizeof(u), u}; - octet HCID = {0, sizeof(hcid), hcid}; - octet HSID = {0, sizeof(hsid), hsid}; - octet DST = {0, sizeof(dst), dst}; - OCT_jstring(&DST,(char *)"BLS48556G1_XMD:SHA-512_SVDW_NU_MPIN"); // Domain Separation Tag - - - // Trusted Authority (TA) set-up - MPIN_RANDOM_GENERATE(RNG, &S); - printf("Master Secret= "); - OCT_output(&S); - -// Client Identity - OCT_jstring(&CLIENT_ID, (char *)"testUser@miracl.com"); - MPIN_ENCODE_TO_CURVE(&DST,&CLIENT_ID,&HCID); - printf("Client ID Hashed to Curve= "); - OCT_output(&HCID); -// printf("\n"); - -// Client approaches Trusted Authority and is issued secret - - MPIN_GET_CLIENT_SECRET(&S, &HCID, &TOKEN); - printf("Client Secret= "); - OCT_output(&TOKEN); - -// TA sends Client secret to Client - -// Server is issued secret by TA - MPIN_GET_SERVER_SECRET(&S, &SST); -// printf("Server Secret= "); -// OCT_output(&SST); - -// TA sends Server secret to Server - -// Client extracts PIN from secret to create Token - //pin = 1234; - //printf("Client extracts PIN= %d\n", pin); - pin=0; printf("Client chooses PIN= "); - if (scanf("%d", &pin)) {}; // to avoid silly compile error - getchar(); - MPIN_EXTRACT_PIN(&HCID, pin, &TOKEN); - printf("Client Token= "); - OCT_output(&TOKEN); - -// MPin Protocol - -// Client enters ID and PIN - OCT_clear(&CLIENT_ID); - OCT_jstring(&CLIENT_ID, (char *)"testUser@miracl.com"); - MPIN_ENCODE_TO_CURVE(&DST,&CLIENT_ID,&HCID); - pin=0; printf("Client enters PIN= "); - if (scanf("%d", &pin)) {}; // to avoid silly compile error - getchar(); - -// Client First pass: Inputs H(CLIENT_ID), RNG, pin, and TOKEN. Output x and U = x.H(CLIENT_ID) and re-combined secret SEC - - if (MPIN_CLIENT_1(&HCID, RNG, &X, pin, &TOKEN, &SEC, &U) != 0) - { - printf("Error from Client side - First Pass\n"); - return 1; - } - -// Send CLIENT_ID and U=x.ID to server. Server hashes ID to curve. - MPIN_ENCODE_TO_CURVE(&DST,&CLIENT_ID,&HSID); - -// Server generates Random number Y and sends it to Client - MPIN_RANDOM_GENERATE(RNG, &Y); - -// Client Second Pass: Inputs Client secret SEC, x and y. Sends -(x+y)*SEC to Server - if (MPIN_CLIENT_2(&X, &Y, &SEC) != 0) - { - printf("Error from Client side - Second Pass\n"); - return 1; - } - -// Server Second phase. Inputs H(CLIENT_ID), Y, -(x+y)*SEC, U and Server secret SST. - - rtn = MPIN_SERVER(&HSID, &Y, &SST, &U, &SEC); - if (rtn != 0) - { - printf("Server says - Bad Pin.\n"); - return 1; - } - else - { - printf("Server says - PIN is good! You really are "); - OCT_output_string(&CLIENT_ID); - printf(".\n"); - } - printf("\n"); - return 0; -} -#endif - -int main() -{ - int i, res; - unsigned long ran; - - char raw[100]; - octet RAW = {0, sizeof(raw), raw}; - csprng RNG; // Crypto Strong RNG - - time((time_t *)&ran); - - RAW.len = 100; // fake random seed source - RAW.val[0] = ran; - RAW.val[1] = ran >> 8; - RAW.val[2] = ran >> 16; - RAW.val[3] = ran >> 24; - for (i = 0; i < 100; i++) RAW.val[i] = i; - - CREATE_CSPRNG(&RNG, &RAW); // initialise strong RNG - - printf("\nTesting MPIN 2-factor authentication protocol on curve BN254\n"); - mpin_BN254(&RNG); - -#if CHUNK!=16 - printf("\nTesting MPIN 2-factor authentication protocol on curve BLS12383\n"); - mpin_BLS12383(&RNG); - printf("\nTesting MPIN 2-factor authentication protocol on curve BLS24479\n"); - mpin192_BLS24479(&RNG); - printf("\nTesting MPIN 2-factor authentication protocol on curve BLS48556\n"); - mpin256_BLS48556(&RNG); -#endif - - KILL_CSPRNG(&RNG); -} - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testnhs b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testnhs deleted file mode 100644 index 21270d4..0000000 Binary files a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testnhs and /dev/null differ diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testnhs.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testnhs.cpp deleted file mode 100644 index 31478ac..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testnhs.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* test driver and function exerciser for NewHope Functions */ - -// See https://eprint.iacr.org/2016/1157 (Alkim, Ducas, Popplemann and Schwabe) - -/* gcc -O2 testnhs.c core.a -o testnhs.exe */ - -#include -#include -#include "newhope.h" - -using namespace core; - -int main() -{ - int i, ii, j, err; - unsigned long ran; - char raw[100]; - csprng SRNG, CRNG; - RAND_clean(&SRNG); RAND_clean(&CRNG); - char s[1792], sb[1824], uc[2176], keyA[32], keyB[32]; - - octet S = {0, sizeof(s), s}; - octet SB = {0, sizeof(sb), sb}; - octet UC = {0, sizeof(uc), uc}; - octet KEYA = {0, sizeof(keyA), keyA}; - octet KEYB = {0, sizeof(keyB), keyB}; - - printf("\nTesting New Hope Key Exchange\n"); - -// initialise random number generators - time((time_t *)&ran); - - raw[0] = ran; - raw[1] = ran >> 8; - raw[2] = ran >> 16; - raw[3] = ran >> 24; - - for (i = 4; i < 100; i++) raw[i] = i + 1; - RAND_seed(&SRNG, 100, raw); - for (i = 4; i < 100; i++) raw[i] = i + 2; - RAND_seed(&CRNG, 100, raw); - -// NewHope Simple key exchange - see https://eprint.iacr.org/2016/1157.pdf Protocol 1 - - NHS_SERVER_1(&SRNG, &SB, &S); - NHS_CLIENT(&CRNG, &SB, &UC, &KEYB); - NHS_SERVER_2(&S, &UC, &KEYA); - - printf("Alice key= 0x"); - OCT_output(&KEYA); - printf("Bob's key= 0x"); - OCT_output(&KEYB); - - return 0; -} - - diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testx509.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testx509.cpp deleted file mode 100644 index c6381e3..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/testx509.cpp +++ /dev/null @@ -1,504 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// To run test program -// g++ -O2 testx509.cpp core.a -o testx509 - -#include -#include "core.h" // for octet support only -#include "x509.h" - -// assumes library support for all of these -#include "eddsa_Ed448.h" -#include "eddsa_Ed25519.h" -#include "ecdh_NIST256.h" -#include "ecdh_NIST521.h" -#include "rsa_RSA4096.h" -#include "rsa_RSA2048.h" - -/* This simple driver program is hard-wired to support just one elliptic curve and one - RSA bit length. To change replace the text string NIST256 in the main program to - another curve and 2048 to some other value, where the curve and the RSA bit length - are suppported by the library. Of course a more elaborate program could support - muliple curves simultaneously */ - -#define CHOICE USE_NIST256 - -/* test driver program */ -// Sample Certs. Uncomment one CA cert and one example cert. Note that CORE library must be built to support given curve. -// Sample Certs all created using OpenSSL - see http://blog.didierstevens.com/2008/12/30/howto-make-your-own-cert-with-openssl/ -// Note - SSL currently only supports NIST curves. Howevever version 1.1.0 of OpenSSL now supports C25519 - -#if CHOICE==USE_NIST256 - -// ** CA is RSA 2048-bit based - for use with NIST256 build of library - assumes use of SHA256 in Certs -// RSA 2048 Self-Signed CA cert -char ca_b64[] = "MIIDuzCCAqOgAwIBAgIJAP44jcM1MOROMA0GCSqGSIb3DQEBCwUAMHQxCzAJBgNVBAYTAklFMRAwDgYDVQQIDAdJcmVsYW5kMQ8wDQYDVQQHDAZEdWJsaW4xITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEfMB0GCSqGSIb3DQEJARYQbXNjb3R0QGluZGlnby5pZTAeFw0xNTExMjYwOTUwMzlaFw0yMDExMjUwOTUwMzlaMHQxCzAJBgNVBAYTAklFMRAwDgYDVQQIDAdJcmVsYW5kMQ8wDQYDVQQHDAZEdWJsaW4xITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEfMB0GCSqGSIb3DQEJARYQbXNjb3R0QGluZGlnby5pZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANUs7/nri9J8zw8rW8JVszXP0ZqeLoQJaq2X28ebm8x5VT3okr9rnBjFjpx0YKQCAFQf8iSOOYuNpDvtZ/YpsjPbk2rg5sLY9G0eUMqrTuZ7moPSxnrXS5evizjD9Z9HqaqeNEYD3sPouPg+lhU1oAUQjUTJVFhEr1x0EnSEYbbrWtY9ZDSuZv+d4NIeqqPOYFd1yZc+LYZyQbAAQqwRLNPZH/rnIykLa6I7w7mGT7H6SBz2O09BtgpTHhalL40ecXa4ZOEze0xwzlc+mEFIrnmdadg3vQrJt42RVbo3LN6RfDIqUZOMOtQW/53pUR1lIpCwVWJTiOpmSEIEqhhjFq0CAwEAAaNQME4wHQYDVR0OBBYEFJrz6LHeT6FcjRahpUC3hAMxKRTCMB8GA1UdIwQYMBaAFJrz6LHeT6FcjRahpUC3hAMxKRTCMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADqkqCYVa3X8XO9Ufu6XIUoZafFPRjSeJXvEIWqlbm7ixJZ2FPOvf2eMc5RCZYigNKhsxru5Ojw0lPcpa8DDmEsdZDf7p0vlmf7T7xH9gtoInh4DzgI8HRHFc8R/z2/jLX7nlLoopKX5yp7F1gRACg0pd4tGpQ6EnBNcYZZghFH9UIRDmx+vDlwDCu8vyRPt35orrEiI4XGq/QkvxxAb5YWxQ4i06064ULfyCI7suu3KoobdM1aAaA8zhpOOBXKbq+Wi9IGFe/wiEMHLmfHdt9CBTjIWb//IHji4RT05kCmTVrx97pb7EHafuL3L10mM5cpTyBWKnb4kMFtx9yw+S2U="; -// an RSA 2048 CA-signed cert -//char cert_b64[]="MIIDcjCCAloCAQEwDQYJKoZIhvcNAQELBQAwdDELMAkGA1UEBhMCSUUxEDAOBgNVBAgMB0lyZWxhbmQxDzANBgNVBAcMBkR1YmxpbjEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMR8wHQYJKoZIhvcNAQkBFhBtc2NvdHRAaW5kaWdvLmllMB4XDTE1MTEyNjEwMzQzMFoXDTE3MTEyNTEwMzQzMFowgYkxCzAJBgNVBAYTAklFMRAwDgYDVQQIDAdJcmVsYW5kMQ8wDQYDVQQHDAZEdWJsaW4xETAPBgNVBAoMCENlcnRpVm94MQ0wCwYDVQQLDARMYWJzMQ0wCwYDVQQDDARNSUtFMSYwJAYJKoZIhvcNAQkBFhdtaWtlLnNjb3R0QGNlcnRpdm94LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMIoxaQHFQzfyNChrw+3i7FjRFMHZ4zspkjkAcJW21LdBCqrxU+sdjyBoSFlrlafQOHshbrEP93AKX1bfaYbuV4fzq7OlRaLxaK+b+xrOJdewMI2WZ5OwEzj3onZATISogIoB6dTdzJ41NuxuMqQ/DqOnVrRA0SoIespbQhB8FGHBLw0hJATBzUk+bqOIt0HmnMp2EbYgtuG4lYINU/lD3Qt16SunUukWRLtxqJkioie+dkhP2zm+bOlSVmeQb4Wp8AI14OKkTfkdYC8qCxb5eabg90Q33rQUhNwRQHhHwopZwD/BgodasoSrPfwUlj0awh6y87eMGcik5Q/mjkCk5MCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAFrd7R/67ClkbLhpiX++6QTOa47siUAB9v+Qil9hZfhPNeeM589ixYkD4zH5pOK2B0ea+CXEKkanQ6lXx9KV86yS7fq6Yww7wO0diecusHd0+P82i46Tq0nm8nlsnAuhYoFRUGa2m2DkB1HSsB0ts8DjzFLySonFjSSLHDU0ox9/uFbJMzipy3ijAA4XM0N4jRrUfrmxpA7DOOsbEbGkvvB7VK9+s9PHE/4dJTwhSteplUnhxVFkkDo/JwaLx4/IEQRlCF3KEQ5s3AwRHnbrIjOY2yONxHBtJEp7QN5aOHruwvMNRNheCBPiQJyLitUsFGr4voANmobkrFgYtu0tRMQ=="; -// an ECDSA 256 CA-signed cert -char cert_b64[] = "MIICojCCAYoCAQMwDQYJKoZIhvcNAQELBQAwdDELMAkGA1UEBhMCSUUxEDAOBgNVBAgMB0lyZWxhbmQxDzANBgNVBAcMBkR1YmxpbjEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMR8wHQYJKoZIhvcNAQkBFhBtc2NvdHRAaW5kaWdvLmllMB4XDTE1MTEyNjEzNDcyOVoXDTE3MTEyNTEzNDcyOVowgYQxCzAJBgNVBAYTAklFMRAwDgYDVQQIDAdJcmVsYW5kMQ8wDQYDVQQHDAZEdWJsaW4xETAPBgNVBAoMCENlcnRpdm94MQ0wCwYDVQQLDARMYWJzMQ8wDQYDVQQDDAZtc2NvdHQxHzAdBgkqhkiG9w0BCQEWEG1zY290dEBpbmRpZ28uaWUwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATO2iZiQZsXxzwBKnufKfZcsctNXZ4PmfJm638PmX9DQ3Xdb+nD5VxiOakNcB9xf5im8CriiOF5Z/7yPGyzUMbdMA0GCSqGSIb3DQEBCwUAA4IBAQAK5fMgGCCiPts8hMUZvYDpu8hd7qtPKPBc10QUccHb7PGrhqf/Ex2Gpj1aaURmx7SGZG0HX97LtkdW8KQpEoyaa60r7cjVA589TznxXKSGg5ggVoFJNpuZUm7VcolLjwIgTxtGbPzrvVMiZ4cl4PwFePXVKTl4f8XkOFX5gLmVSuCf729lEBmpx3IzqGmTjmnBixaApUElOKVeL7hiUKP3TqMUxZN+QNJBq4Mh9K9h4Sks2oneLwBwhMqQvpmcOb/7SucJn5N0IgJoGaMbfX0oCJJID1NSbagUSbFD1XciR2Ng9VtvnRP+htmEQ7jtww8phFdrWt5M5zPGOHUppqDx"; - -// ** CA is ECC 256 based - for use with NIST256 build of library -// ECDSA 256 Self-Signed CA cert -//char ca_b64[]="MIIB7TCCAZOgAwIBAgIJANp4nGS/VYj2MAoGCCqGSM49BAMCMFMxCzAJBgNVBAYTAklFMRAwDgYDVQQIDAdJcmVsYW5kMQ8wDQYDVQQHDAZEdWJsaW4xITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0xNTExMjYxMzI0MTBaFw0yMDExMjUxMzI0MTBaMFMxCzAJBgNVBAYTAklFMRAwDgYDVQQIDAdJcmVsYW5kMQ8wDQYDVQQHDAZEdWJsaW4xITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABPb6IjYNKyfbEtL1aafzW1jrn6ALn3PnGm7AyX+pcvwG0GKmb3Z/uHzhT4GysNE0/GB1n4Y/mrORQIm2X98rRs6jUDBOMB0GA1UdDgQWBBSfXUNkgJVklIhuXq4DCnVYhsdzwDAfBgNVHSMEGDAWgBSfXUNkgJVklIhuXq4DCnVYhsdzwDAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0gAMEUCIQDrZJ1tshwTl/jabU2i49EOgbWe0ZgE3QZywJclf5IVwwIgVmz79AAf7e098lyrOKYAqbwjHVyMZGfmkNNGIuIhp/Q="; -// an ECDSA 256 CA-signed cert -//char cert_b64[]="MIIBvjCCAWQCAQEwCgYIKoZIzj0EAwIwUzELMAkGA1UEBhMCSUUxEDAOBgNVBAgMB0lyZWxhbmQxDzANBgNVBAcMBkR1YmxpbjEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMB4XDTE1MTEyNjEzMjc1N1oXDTE3MTEyNTEzMjc1N1owgYIxCzAJBgNVBAYTAklFMRAwDgYDVQQIDAdJcmVsYW5kMQ8wDQYDVQQHDAZEdWJsaW4xETAPBgNVBAoMCENlcnRpdm94MQ0wCwYDVQQLDARMYWJzMQ0wCwYDVQQDDARtaWtlMR8wHQYJKoZIhvcNAQkBFhBtc2NvdHRAaW5kaWdvLmllMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEY42H52TfWMLueKB1o2Sq8uKaKErbHJ2GRAxrnJdNxex0hxZF5FUx7664BbPUolKhpvKTnJxDq5/gMqXzpKgR6DAKBggqhkjOPQQDAgNIADBFAiEA0ew08Xg32g7BwheslVKwXo9XRRx4kygYha1+cn0tvaUCIEKCEwnosZlAckjcZt8aHN5zslE9K9Y7XxTErTstthKc"; -// an RSA 2048 CA-signed cert -//char cert_b64[]="MIICiDCCAi4CAQIwCgYIKoZIzj0EAwIwUzELMAkGA1UEBhMCSUUxEDAOBgNVBAgMB0lyZWxhbmQxDzANBgNVBAcMBkR1YmxpbjEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMB4XDTE1MTEyNjEzMzcwNVoXDTE3MTEyNTEzMzcwNVowgYExCzAJBgNVBAYTAklFMQ8wDQYDVQQIDAZJZWxhbmQxDzANBgNVBAcMBkR1YmxpbjERMA8GA1UECgwIQ2VydGl2b3gxDTALBgNVBAsMBExhYnMxDTALBgNVBAMMBE1pa2UxHzAdBgkqhkiG9w0BCQEWEG1zY290dEBpbmRpZ28uaWUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCjPBVwmPg8Gwx0+8xekmomptA0BDwS7NUfBetqDqNMNyji0bSe8LAfpciU7NW/HWfUE1lndCqSDDwnMJmwC5e3GAl/Bus+a+z8ruEhWGbn95xrHXFkOawbRlXuS7UcEQCvPr8KQHhNsg4cyV7Hn527CPUl27n+WN8/pANo01cTN/dQaK87naU0Mid09vktlMKSN0zyJOnc5CsaTLs+vCRKJ9sUL3d4IQIA2y7gvrTe+iY/QI26nqhGpNWYyFkAdy9PdHUEnDI6JsfF7jFh37yG7XEgDDA3asp/oi1T1+ZoASj2boL++opdqCzDndeWwzDWAWuvJ9wULd80ti6x737ZAgMBAAEwCgYIKoZIzj0EAwIDSAAwRQIgCDwgl98+9moBo+etaLt8MvB/z5Ti6i9neRTZkvoFl7YCIQDq//M3OB757fepErRzIQo3aFAFYjOooi6WdSqP3XqGIg=="; - -#endif - -#if CHOICE==USE_ED25519 - -// **CA is EDDSA Ed25519 based. Self-signed cert -char ca_b64[]= "MIIBRTCB+KADAgECAhNBrGyCRdfc0WyPpPd+LB8LEiK4MAUGAytlcDAZMRcwFQYDVQQDDA5NaWtlJ3Mgcm9vdCBDQTAeFw0yMzA1MDExNjAwMDlaFw0yNDA0MzAxNjAwMDlaMBkxFzAVBgNVBAMMDk1pa2UncyByb290IENBMCowBQYDK2VwAyEAh8YXRWdICdF8CcR1P0RCO4xD+s5i8Pzpq8KHid/TQaajUzBRMB0GA1UdDgQWBBQAS56sNYWyao4k6DS/M81i+wqjIzAfBgNVHSMEGDAWgBQAS56sNYWyao4k6DS/M81i+wqjIzAPBgNVHRMBAf8EBTADAQH/MAUGAytlcANBAJWIicxVB6ynhjjkJgNtcL/kmixU7l/V1j/N0AtenDgT+yrMhDW9n9JC+Ze5qpX3Eu3VkdkpN3G9anmBXp3LtAk="; -// EDDSA Ed25519 CA-signed Cert -char cert_b64[]="MIHdMIGQAgEBMAUGAytlcDAZMRcwFQYDVQQDDA5NaWtlJ3Mgcm9vdCBDQTAeFw0yMzA1MDExNjA1NDhaFw0yNDA0MzAxNjA1NDhaMB0xGzAZBgNVBAMMEk1pa2UncyBzZXJ2ZXIgY2VydDAqMAUGAytlcAMhANvhwg8UhnGMGt0bKoGt5IHkvHwyEwWj4GkLQ7XIqJeVMAUGAytlcANBAESWzTJbz/YVwLFrDKVqYxHc86YGjPa8lekAC8UciIKu9d1Xoko3ssfhNiXkYkl3M0yEnIkD2F2DfGKbt8LSmQE="; - -#endif - -#if CHOICE==USE_ED448 - -// **CA is EDDSA Ed448 based. Self-signed cert -char ca_b64[]= "MIIBkjCCARKgAwIBAgIUWnfFe8sR7CGIz3eN1CfyHdTz14kwBQYDK2VxMBkxFzAVBgNVBAMMDk1pa2UncyByb290IENBMB4XDTIzMDUwMTE2NDQxMloXDTI0MDQzMDE2NDQxMlowGTEXMBUGA1UEAwwOTWlrZSdzIHJvb3QgQ0EwQzAFBgMrZXEDOgACd4YB/lGYUck4KxQMJ+lshkHnBuigmwPALPQGARv26SK/EOi0DIMMpyp3oG+pnPpnqbqtDtesCYCjUzBRMB0GA1UdDgQWBBRygDXbx5h57oo1D91LitQV2PE2dzAfBgNVHSMEGDAWgBRygDXbx5h57oo1D91LitQV2PE2dzAPBgNVHRMBAf8EBTADAQH/MAUGAytlcQNzAI17NGvKrGAH5hKLUHC1+Qv5RvT4IKlWg5GnRGTccc5tCrimveoMbu2KTlNXaOHS8y/sZT1qddukAFLzR/1ehZqOnYLM7dwlgYdksAx0olo5+/MYfj3hw5noh1pMObnJREfTPTSg1gqFI+gObB1UoSsBAA=="; -// EDDSA Ed448 CA-signed Cert -char cert_b64[]="MIIBIzCBpAIBATAFBgMrZXEwGTEXMBUGA1UEAwwOTWlrZSdzIHJvb3QgQ0EwHhcNMjMwNTAxMTY0NjQzWhcNMjQwNDMwMTY0NjQzWjAYMRYwFAYDVQQDDA1NaWtlJ3Mgc2VydmVyMEMwBQYDK2VxAzoAgYh3CQP+EgId5/TZjAsuxh7Y9nPYtN5CYeN8vLjPuRqQncja3MyhRJaOrUEKSnBK+zYbkdXMQQwAMAUGAytlcQNzAPcm8DVSRZA1r0QqsSsHv6xBy1ASaoz4RFyelFMUD4f6ERMaxTzs0LKQHtcx5G9vqOxvQyCgkEu2AOcUQLtEXcoOSLH8fy0+5yEbbs6uPA1hi/oGpy580SR/5K5odY35fe1kwhz9YUvT4suTRHocnpcsAA=="; -#endif - -char io[5000]; -octet IO = {0, sizeof(io), io}; - -#define MAXMODBYTES 72 -#define MAXFFLEN 16 - -char sig[MAXMODBYTES * MAXFFLEN]; -octet SIG = {0, sizeof(sig), sig}; - -char r[MAXMODBYTES]; -octet R = {0, sizeof(r), r}; - -char s[MAXMODBYTES]; -octet S = {0, sizeof(s), s}; - -char cakey[MAXMODBYTES * MAXFFLEN]; -octet CAKEY = {0, sizeof(cakey), cakey}; - -char certkey[MAXMODBYTES * MAXFFLEN]; -octet CERTKEY = {0, sizeof(certkey), certkey}; - -char h[5000]; -octet H = {0, sizeof(h), h}; - -char hh[5000]; -octet HH = {0, sizeof(hh), hh}; - -char hp[RFS_RSA2048]; -octet HP = {0, sizeof(hp), hp}; - - -void print_out(char *des, octet *c, int index, int len) -{ - int i; - printf("%s [", des); - for (i = 0; i < len; i++) - printf("%c", c->val[index + i]); - printf("]\n"); -} - -void print_date(char *des, octet *c, int index) -{ - int i = index; - printf("%s [", des); - if (i == 0) printf("]\n"); - else printf("20%c%c-%c%c-%c%c %c%c:%c%c:%c%c]\n", c->val[i], c->val[i + 1], c->val[i + 2], c->val[i + 3], c->val[i + 4], c->val[i + 5], c->val[i + 6], c->val[i + 7], c->val[i + 8], c->val[i + 9], c->val[i + 10], c->val[i + 11]); -} - -int main() -{ - int res, len, sha; - int c, ic; - RSA2048::rsa_public_key PK; - pktype st, ca, pt; - - printf("First check signature on self-signed cert and extract CA public key\n"); - OCT_frombase64(&IO, ca_b64); - printf("CA Self-Signed Cert= \n"); - OCT_output(&IO); - printf("\n"); - - st = X509_extract_cert_sig(&IO, &SIG); // returns signature type - - if (st.type == 0) - { - printf("Unable to extract cert signature\n"); - return 0; - } - - if (st.type == X509_ECC) - { - OCT_chop(&SIG, &S, SIG.len / 2); - OCT_copy(&R, &SIG); - printf("ECDSA SIG= \n"); - OCT_output(&R); - OCT_output(&S); - printf("\n"); - } - - if (st.type == X509_ECD) - { - printf("EDDSA SIG= \n"); - OCT_output(&SIG); - printf("\n"); - } - - if (st.type == X509_RSA) - { - printf("RSA SIG= \n"); - OCT_output(&SIG); - printf("\n"); - } - - if (st.hash == X509_H256) printf("Hashed with SHA256\n"); - if (st.hash == X509_H384) printf("Hashed with SHA384\n"); - if (st.hash == X509_H512) printf("Hashed with SHA512\n"); - -// Extract Cert from signed Cert - - c = X509_extract_cert(&IO, &H); - - printf("\nCert= \n"); - OCT_output(&H); - printf("\n"); - -// show some details - printf("Issuer Details\n"); - ic = X509_find_issuer(&H,&len); - c = X509_find_entity_property(&H, &X509_ON, ic, &len); - print_out((char *)"owner=", &H, c, len); - c = X509_find_entity_property(&H, &X509_CN, ic, &len); - print_out((char *)"country=", &H, c, len); - c = X509_find_entity_property(&H, &X509_EN, ic, &len); - print_out((char *)"email=", &H, c, len); - c = X509_find_entity_property(&H, &X509_MN, ic, &len); - print_out((char *)"Common Name=", &H, c, len); - printf("\n"); - - ca = X509_extract_public_key(&H, &CAKEY); - - if (ca.type == 0) - { - printf("Not supported by library\n"); - return 0; - } - //if (ca.type != st.type) - if (!X509_self_signed(&H)) - { - printf("Not self-signed\n"); - } - - if (ca.type == X509_ECD) - { - printf("EXTRACTED EDDSA PUBLIC KEY= \n"); - OCT_output(&CAKEY); - } - if (ca.type == X509_ECC) - { - printf("EXTRACTED ECDSA PUBLIC KEY= \n"); - OCT_output(&CAKEY); - } - if (ca.type == X509_RSA) - { - printf("EXTRACTED RSA PUBLIC KEY= \n"); - OCT_output(&CAKEY); - } - printf("\n"); - -// Cert is self-signed - so check signature - - printf("Checking Self-Signed Signature\n"); - if (ca.type == X509_ECC) - { - if (ca.curve != CHOICE) - { - printf("Curve is not supported\n"); - return 0; - } - res = NIST256::ECP_PUBLIC_KEY_VALIDATE(&CAKEY); - if (res != 0) - { - printf("ECP Public Key is invalid!\n"); - return 0; - } - else printf("ECP Public Key is Valid\n"); - - sha = 0; - - if (st.hash == X509_H256) sha = SHA256; - if (st.hash == X509_H384) sha = SHA384; - if (st.hash == X509_H512) sha = SHA512; - if (sha == 0) - { - printf("Hash Function not supported\n"); - return 0; - } - - if (NIST256::ECP_VP_DSA(sha, &CAKEY, &H, &R, &S) != 0) - { - printf("***ECDSA Verification Failed\n"); - return 0; - } - else - printf("ECDSA Signature/Verification succeeded \n"); - } - - if (ca.type == X509_ECD) - { - if (ca.curve != CHOICE) - { - printf("Curve is not supported %d\n",ca.curve); - return 0; - } - if (ca.curve == USE_ED25519) - { - if (!Ed25519::EDDSA_VERIFY(false,&CAKEY,NULL,&H,&SIG)) - { - printf("***EDDSA Verification Failed\n"); - return 0; - } - else - printf("EDDSA Signature/Verification succeeded \n"); - } - if (ca.curve == USE_ED448) - { - if (!Ed448::EDDSA_VERIFY(false,&CAKEY,NULL,&H,&SIG)) - { - printf("***EDDSA Verification Failed %d\n",SIG.len); - return 0; - } - else - printf("EDDSA Signature/Verification succeeded \n"); - } - } - if (ca.type == X509_RSA) - { - if (ca.curve != 2048) - { - printf("RSA bit size is not supported\n"); - return 0; - } - PK.e = 65537; // assuming this! - RSA2048::RSA_fromOctet(PK.n, &CAKEY); - - sha = 0; - - if (st.hash == X509_H256) sha = SHA256; - if (st.hash == X509_H384) sha = SHA384; - if (st.hash == X509_H512) sha = SHA512; - if (sha == 0) - { - printf("Hash Function not supported\n"); - return 0; - } - core::PKCS15(sha, &H, &HP); - - RSA2048::RSA_ENCRYPT(&PK, &SIG, &HH); - - if (OCT_comp(&HP, &HH)) - printf("RSA Signature/Verification succeeded \n"); - else - { - printf("***RSA Verification Failed\n"); - return 0; - } - } - - printf("\nNext check CA signature on cert, and extract public key\n"); - - OCT_frombase64(&IO, cert_b64); - printf("Example Cert= \n"); - OCT_output(&IO); - printf("\n"); - - st = X509_extract_cert_sig(&IO, &SIG); - - if (st.type == 0) - { - printf("Unable to check cert signature\n"); - return 0; - } - - if (st.type == X509_ECC) - { - OCT_chop(&SIG, &S, SIG.len / 2); - OCT_copy(&R, &SIG); - printf("SIG= \n"); - OCT_output(&R); - - OCT_output(&S); - - printf("\n"); - } - - if (st.type == X509_ECD) - { - printf("SIG= \n"); - OCT_output(&SIG); - printf("\n"); - } - - if (st.type == X509_RSA) - { - printf("SIG= \n"); - OCT_output(&SIG); - printf("\n"); - } - - c = X509_extract_cert(&IO, &H); - - printf("Cert= \n"); - OCT_output(&H); - printf("\n"); - - printf("Subject Details\n"); - ic = X509_find_subject(&H,&len); - c = X509_find_entity_property(&H, &X509_ON, ic, &len); - print_out((char *)"owner=", &H, c, len); - c = X509_find_entity_property(&H, &X509_CN, ic, &len); - print_out((char *)"country=", &H, c, len); - c = X509_find_entity_property(&H, &X509_EN, ic, &len); - print_out((char *)"email=", &H, c, len); - c = X509_find_entity_property(&H, &X509_MN, ic, &len); - print_out((char *)"Common Name=", &H, c, len); - printf("\n"); - - ic = X509_find_validity(&H); - c = X509_find_start_date(&H, ic); - print_date((char *)"start date= ", &H, c); - c = X509_find_expiry_date(&H, ic); - print_date((char *)"expiry date=", &H, c); - printf("\n"); - - pt = X509_extract_public_key(&H, &CERTKEY); - - if (pt.type == 0) - { - printf("Not supported by library\n"); - return 0; - } - - if (pt.type == X509_ECC) - { - printf("EXTRACTED ECDSA PUBLIC KEY= \n"); - OCT_output(&CERTKEY); - } - if (pt.type == X509_ECD) - { - printf("EXTRACTED EDDSA PUBLIC KEY= \n"); - OCT_output(&CERTKEY); - } - if (pt.type == X509_RSA) - { - printf("EXTRACTED RSA PUBLIC KEY= \n"); - OCT_output(&CERTKEY); - } - - printf("\n"); - - /* Check CA signature */ - - if (ca.type == X509_ECC) - { - printf("Checking CA's ECDSA Signature on Cert\n"); - res = NIST256::ECP_PUBLIC_KEY_VALIDATE(&CAKEY); - if (res != 0) - printf("ECP Public Key is invalid!\n"); - else printf("ECP Public Key is Valid\n"); - - sha = 0; - - if (st.hash == X509_H256) sha = SHA256; - if (st.hash == X509_H384) sha = SHA384; - if (st.hash == X509_H512) sha = SHA512; - if (sha == 0) - { - printf("Hash Function not supported\n"); - return 0; - } - - if (NIST256::ECP_VP_DSA(sha, &CAKEY, &H, &R, &S) != 0) - printf("***ECDSA Verification Failed\n"); - else - printf("ECDSA Signature/Verification succeeded \n"); - } - - if (ca.type == X509_ECD) - { - printf("Checking CA's EDDSA Signature on Cert\n"); - if (ca.curve == USE_ED25519) - { - if (!Ed25519::EDDSA_VERIFY(false,&CAKEY,NULL,&H,&SIG)) - { - printf("***EDDSA Verification Failed\n"); - return 0; - } - else - printf("EDDSA Signature/Verification succeeded \n"); - } - if (ca.curve == USE_ED448) - { - if (!Ed448::EDDSA_VERIFY(false,&CAKEY,NULL,&H,&SIG)) - { - printf("***EDDSA Verification Failed\n"); - return 0; - } - else - printf("EDDSA Signature/Verification succeeded \n"); - } - } - - if (ca.type == X509_RSA) - { - printf("Checking CA's RSA Signature on Cert\n"); - PK.e = 65537; // assuming this! - RSA2048::RSA_fromOctet(PK.n, &CAKEY); - - sha = 0; - - if (st.hash == X509_H256) sha = SHA256; - if (st.hash == X509_H384) sha = SHA384; - if (st.hash == X509_H512) sha = SHA512; - if (sha == 0) - { - printf("Hash Function not supported\n"); - return 0; - } - core::PKCS15(sha, &H, &HP); - - RSA_ENCRYPT(&PK, &SIG, &HH); - - if (OCT_comp(&HP, &HH)) - printf("RSA Signature/Verification succeeded \n"); - else - printf("***RSA Verification Failed\n"); - - } - - return 0; -} diff --git a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/x509.cpp b/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/x509.cpp deleted file mode 100644 index ea0d07f..0000000 --- a/TIIGER_TLS/PQ_TIIGER_TLS/sal/miraclhgj/includes/x509.cpp +++ /dev/null @@ -1,1170 +0,0 @@ -/* - * Copyright (c) 2012-2020 MIRACL UK Ltd. - * - * This file is part of MIRACL Core - * (see https://github.com/miracl/core). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* CORE X.509 Functions */ - -#include -#include "core.h" // for octet support only -#include "x509.h" - -// Some ASN.1 tags - -#define ANY 0x00 -#define SEQ 0x30 -#define OID 0x06 -#define INT 0x02 -#define NUL 0x05 -#define ZER 0x00 -#define UTF 0x0C -#define UTC 0x17 -#define GTM 0x18 -#define LOG 0x01 -#define BIT 0x03 -#define OCT 0x04 -#define STR 0x13 -#define SET 0x31 -#define IA5 0x16 -#define EXT 0xA3 -#define DNS 0x82 - -// Define some OIDs - -// Elliptic Curve with SHA256 -static unsigned char eccsha256[8] = {0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02}; -static octet ECCSHA256 = {8, sizeof(eccsha256), (char *)eccsha256}; - -// Elliptic Curve with SHA384 -static unsigned char eccsha384[8] = {0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x03}; -static octet ECCSHA384 = {8, sizeof(eccsha384), (char *)eccsha384}; - -// Elliptic Curve with SHA512 -static unsigned char eccsha512[8] = {0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x04}; -static octet ECCSHA512 = {8, sizeof(eccsha512), (char *)eccsha512}; - -// EC Public Key - Elliptic curve public key cryptography -static unsigned char ecpk[7] = {0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01}; -static octet ECPK = {7, sizeof(ecpk), (char *)ecpk}; - -// ED25519 Public Key - Elliptic curve EdDSA (Ed25519) Signature -static unsigned char edpk25519[3] = {0x2B, 0x65, 0x70}; -static octet EDPK25519 = {3, sizeof(edpk25519),(char *)edpk25519}; - -// ED448 Public Key - Elliptic curve EdDSA (Ed448) Signature -static unsigned char edpk448[3] = {0x2B, 0x65, 0x71}; -static octet EDPK448 = {3, sizeof(edpk448),(char *)edpk448}; - -// C25519 curve -static unsigned char prime25519[9] = {0x2B, 0x06, 0x01, 0x04, 0x01, 0xDA, 0x47, 0x0F, 0x01}; /*****/ -static octet PRIME25519 = {9, sizeof(prime25519), (char *)prime25519}; - -// NIST256 curve - (NIST) P-256 -static unsigned char prime256v1[8] = {0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07}; -static octet PRIME256V1 = {8, sizeof(prime256v1), (char *)prime256v1}; - -// NIST384 curve -static unsigned char secp384r1[5] = {0x2B, 0x81, 0x04, 0x00, 0x22}; -static octet SECP384R1 = {5, sizeof(secp384r1), (char *)secp384r1}; - -// NIST521 curve -static unsigned char secp521r1[5] = {0x2B, 0x81, 0x04, 0x00, 0x23}; -static octet SECP521R1 = {5, sizeof(secp521r1), (char *)secp521r1}; - -// RSA Public Key - RSAES-PKCS1-v1_5 -static unsigned char rsapk[9] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01}; -static octet RSAPK = {9, sizeof(rsapk), (char *)rsapk}; - -// RSA with SHA256 -static unsigned char rsasha256[9] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b}; -static octet RSASHA256 = {9, sizeof(rsasha256), (char *)rsasha256}; - -// RSA with SHA384 -static unsigned char rsasha384[9] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0c}; -static octet RSASHA384 = {9, sizeof(rsasha384), (char *)rsasha384}; - -// RSA with SHA512 -static unsigned char rsasha512[9] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0d}; -static octet RSASHA512 = {9, sizeof(rsasha512), (char *)rsasha512}; - -// DILITHIUM3 -static unsigned char dilithium3[11] = {0x2b, 0x06, 0x01, 0x04, 0x01, 0x02, 0x82, 0x0B, 0x07, 0x06, 0x05}; -static octet DILITHIUM3 = {11, sizeof(dilithium3), (char *)dilithium3}; - - -// Cert details -// countryName -static unsigned char cn[3] = {0x55, 0x04, 0x06}; -octet X509_CN = {3, sizeof(cn), (char *)cn}; - -// stateName -static char sn[3]= {0x55,0x04,0x08}; -octet X509_SN= {3,sizeof(sn),sn}; - -// localName -static char ln[3]= {0x55,0x04,0x07}; -octet X509_LN= {3,sizeof(ln),ln}; - -// orgName -static unsigned char on[3] = {0x55, 0x04, 0x0A}; -octet X509_ON = {3, sizeof(on), (char *)on}; - -// unitName -static char un[3]= {0x55,0x04,0x0B}; -octet X509_UN= {3,sizeof(un),un}; - -// myName -static char mn[3]= {0x55,0x04,0x03}; -octet X509_MN= {3,sizeof(mn),mn}; - -// emailName -static unsigned char en[9] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01}; -octet X509_EN = {9, sizeof(en), (char *)en}; - -// Extensions -// Alt Name -static char an[3]={0x55,0x1D,0x11}; -octet X509_AN = {3, sizeof(an),an}; - -// Key Usage -static char ku[3]={0x55,0x1d,0x0f}; -octet X509_KU = {3,sizeof(ku),ku}; - -// Basic Constraints -static char bc[3]={0x55,0x1d,0x13}; -octet X509_BC = {3,sizeof(bc),bc}; - -/* Check expected TAG and return ASN.1 field length. If tag=0 skip check. */ -static int getalen(int tag, char *b, int j) -{ - int len; - - if (tag != 0 && (unsigned char)b[j] != tag) return -1; // not a valid tag - j++; - - if ((unsigned char)b[j] == 0x81) - { - j++; - len = (unsigned char)b[j]; - } - else if ((unsigned char)b[j] == 0x82) - { - j++; - len = 256 * b[j++]; - len += (unsigned char)b[j]; - } - else - { - len = (unsigned char)b[j]; - if (len > 127) return -1; - } - return len; -} - -/* jump over length field */ -static int skip(int len) -{ - if (len < 128) return 2; - if (len < 256) return 3; - return 4; -} - -/* round length up to nearest 8-byte length */ -static int bround(int len) -{ - if (len % 8 == 0) return len; - return len + (8 - len % 8); - -} - -// Input private key in PKCS#8 format -// e.g. openssl req -x509 -nodes -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -// e.g. openssl req -x509 -nodes -days 3650 -newkey ec:<(openssl ecparam -name prime256v1) -keyout key.pem -out ecdsacert.pem -// extract private key from uncompressed key.pem into octet -// For RSA octet = p|q|dp|dq|c where pk->len is multiple of 5 -// For ECC octet = k -pktype X509_extract_private_key(octet *c,octet *pk) -{ - int i, j, k, fin, len, rlen, flen, tlen, sj, ex; - char soid[12]; - octet SOID = {0, sizeof(soid), soid}; - pktype ret; - - ret.type = 0; - ret.hash = 0; - j=0; - - len = getalen(SEQ, c->val, j); // Check for expected SEQ clause, and get length - if (len < 0) return ret; // if not a SEQ clause, there is a problem, exit - j += skip(len); // skip over length to clause contents. Add len to skip clause - - if (len + j != c->len) return ret; - - len = getalen(INT, c->val, j); - if (len < 0) return ret; - j += skip(len) + len; // jump over serial number clause (if there is one) - - len = getalen(SEQ, c->val, j); - if (len < 0) return ret; - j += skip(len); - -// extract OID - len = getalen(OID, c->val, j); - if (len < 0) return ret; - j += skip(len); - - fin = j + len; - if (len>SOID.max) return ret; - SOID.len = len; - for (i = 0; j < fin; j++) - SOID.val[i++] = c->val[j]; - j=fin; - - if (OCT_comp(&EDPK25519, &SOID)) - { // Its an Ed25519 key - len = getalen(OCT, c->val, j); - if (len < 0) return ret; - j += skip(len); - len = getalen(OCT, c->val, j); - if (len < 0) return ret; - j += skip(len); - rlen=32; - if (rlen>pk->max) return ret; - pk->len=rlen; - for (i=0;ival[i]=0; - for (i=rlen-len;ival[i]=c->val[j++]; - ret.type = X509_ECD; - ret.curve = USE_ED25519; - } - if (OCT_comp(&EDPK448, &SOID)) - { // Its an Ed448 key - len = getalen(OCT, c->val, j); - if (len < 0) return ret; - j += skip(len); - len = getalen(OCT, c->val, j); - if (len < 0) return ret; - j += skip(len); - rlen=57; - if (rlen>pk->max) return ret; - pk->len=rlen; - for (i=0;ival[i]=0; - for (i=rlen-len;ival[i]=c->val[j++]; - ret.type = X509_ECD; - ret.curve = USE_ED448; - } - if (OCT_comp(&DILITHIUM3, &SOID)) - { // Its a DILITHIUM3 key - len = getalen(OCT, c->val, j); - if (len < 0) return ret; - j += skip(len); - len = getalen(OCT, c->val, j); - if (len < 0) return ret; - j += skip(len); - tlen=len; - if (tlen>pk->max) - tlen=pk->max; - for (i=0;ival[i]=c->val[j++]; - pk->len=tlen; - ret.type=X509_PQ; - ret.curve=8*tlen; - } - if (OCT_comp(&ECPK, &SOID)) - { // Its an ECC key - len = getalen(OID, c->val, j); - if (len < 0) return ret; - j += skip(len); - - fin = j + len; - if (len>SOID.max) return ret; - SOID.len = len; - for (i = 0; j < fin; j++) - SOID.val[i++] = c->val[j]; - j=fin; - - len = getalen(OCT, c->val, j); - if (len < 0) return ret; - j += skip(len); - - len = getalen(SEQ, c->val, j); - if (len < 0) return ret; - j += skip(len); - - len = getalen(INT, c->val, j); - if (len < 0) return ret; - j += skip(len) + len; // jump over version - - len = getalen(OCT, c->val, j); - if (len < 0) return ret; - j += skip(len); - - ret.type = X509_ECC; - if (OCT_comp(&PRIME256V1, &SOID)) { - ret.curve = USE_NIST256; - rlen=32; - } - if (OCT_comp(&SECP384R1, &SOID)) { - ret.curve = USE_NIST384; - rlen=48; - } - if (OCT_comp(&SECP521R1, &SOID)) { - rlen=66; - ret.curve = USE_NIST521; - } - if (rlen>pk->max) - { - ret.curve=0; - return ret; - } - pk->len=rlen; - for (i=0;ival[i]=0; - for (i=rlen-len;ival[i]=c->val[j++]; - - } - if (OCT_comp(&RSAPK, &SOID)) - { // Its an RSA key - len = getalen(NUL, c->val, j); - if (len<0) return ret; - j += skip(len); - - len = getalen(OCT, c->val, j); - if (len < 0) return ret; - j += skip(len); - - len = getalen(SEQ, c->val, j); - if (len < 0) return ret; - j += skip(len); - - len = getalen(INT, c->val, j); - if (len < 0) return ret; - j += skip(len) + len; // jump over version - - len = getalen(INT, c->val, j); - if (len < 0) return ret; - j += skip(len) + len; // jump over n - - len = getalen(INT, c->val, j); - if (len < 0) return ret; - j += skip(len) + len; // jump over e - - len = getalen(INT, c->val, j); - if (len < 0) return ret; - j += skip(len) + len; // jump over d - - - len = getalen(INT, c->val, j); - if (len < 0) return ret; - j += skip(len); // get p - - if (c->val[j] == 0) - { // skip leading zero - j++; - len--; - } - rlen=bround(len); - - if (5*rlen>pk->max) - return ret; - - for (i=0;ival[i]=0; - - for (i=rlen-len;ival[i]=c->val[j++]; - - flen=rlen; // should be same length for all - for (k=1;k<5;k++) - { - len = getalen(INT,c->val,j); - if (len<0) return ret; - j += skip(len); // get q,dp,dq,c - if (c->val[j] == 0) - { // skip leading zero - j++; - len--; - } - rlen=bround(len); - if (rlen!=flen) return ret; - for (i=0;ival[i]=0; - for (i=rlen-len;ival[k*flen+i]=c->val[j++]; - } - pk->len=5*flen; - ret.type = X509_RSA; - ret.curve = 16 * flen; - } - return ret; -} - -// Input signed cert as octet, and extract signature -// Return 0 for failure, ECC for Elliptic Curve signature, RSA for RSA signature -// Note that signature type is not provided here - its the type of the public key that -// is used to verify it that matters, and which determines for example the curve to be used! - -pktype X509_extract_cert_sig(octet *sc, octet *sig) -{ - int i, j, k, fin, len, rlen, sj, ex; - char soid[12]; - octet SOID = {0, sizeof(soid), soid}; - pktype ret; - - ret.type = 0; - ret.hash = 0; - - j = 0; - - len = getalen(SEQ, sc->val, j); // Check for expected SEQ clause, and get length - if (len < 0) return ret; // if not a SEQ clause, there is a problem, exit - j += skip(len); // skip over length to clause contents. Add len to skip clause - - if (len + j != sc->len) return ret; - - len = getalen(SEQ, sc->val, j); - if (len < 0) return ret; - j += skip(len) + len; // jump over cert to signature OID - - len = getalen(SEQ, sc->val, j); - if (len < 0) return ret; - j += skip(len); - - sj = j + len; // Needed to jump over signature OID - -// dive in to extract OID - len = getalen(OID, sc->val, j); - if (len < 0) return ret; - j += skip(len); - - fin = j + len; - if (len>SOID.max) return ret; - SOID.len = len; - for (i = 0; j < fin; j++) - SOID.val[i++] = sc->val[j]; - - // check OID here.. - if (OCT_comp(&EDPK25519, &SOID)) - { - ret.type = X509_ECD; - ret.hash = X509_H512; - } - if (OCT_comp(&EDPK448, &SOID)) - { - ret.type = X509_ECD; - ret.hash = X509_SHAKE256; - } - if (OCT_comp(&ECCSHA256, &SOID)) - { - ret.type = X509_ECC; - ret.hash = X509_H256; - } - if (OCT_comp(&ECCSHA384, &SOID)) - { - ret.type = X509_ECC; - ret.hash = X509_H384; - } - if (OCT_comp(&ECCSHA512, &SOID)) - { - ret.type = X509_ECC; - ret.hash = X509_H512; - } - if (OCT_comp(&RSASHA256, &SOID)) - { - ret.type = X509_RSA; - ret.hash = X509_H256; - } - if (OCT_comp(&RSASHA384, &SOID)) - { - ret.type = X509_RSA; - ret.hash = X509_H384; - } - if (OCT_comp(&RSASHA512, &SOID)) - { - ret.type = X509_RSA; - ret.hash = X509_H512; - } - if (OCT_comp(&DILITHIUM3, &SOID)) - { - ret.type = X509_PQ; - ret.hash = 0; // hash type is implicit - } - if (ret.type == 0) return ret; // unsupported type - - j = sj; // jump out to signature - - len = getalen(BIT, sc->val, j); - if (len < 0) - { - ret.type = 0; - return ret; - } - j += skip(len); - j++; - len--; // skip bit shift (hopefully 0!) - - if (ret.type==X509_ECD) - { - if (len>sig->max) - { - ret.type=0; - return ret; - } - sig->len = len; - i = 0; - fin = j + len; - for (; j < fin; j++) - sig->val[i++] = sc->val[j]; - - if (ret.hash == X509_H512) ret.curve = USE_ED25519; - if (ret.hash == X509_SHAKE256) ret.curve = USE_ED448; - } - if (ret.type == X509_ECC) - { - // signature in the form (r,s) - len = getalen(SEQ, sc->val, j); - if (len < 0) - { - ret.type = 0; - return ret; - } - j += skip(len); - - // pick up r part of signature - len = getalen(INT, sc->val, j); - if (len < 0) - { - ret.type = 0; - return ret; - } - j += skip(len); - - if (sc->val[j] == 0) - { - // skip leading zero - j++; - len--; - } - rlen = bround(len); - - ex = rlen - len; - - if (2*rlen>sig->max) - { - ret.type=0; - return ret; - } - sig->len = 2 * rlen; - - i = 0; - for (k = 0; k < ex; k++) - sig->val[i++] = 0; - - fin = j + len; - for (; j < fin; j++) - sig->val[i++] = sc->val[j]; - - // pick up s part of signature - len = getalen(INT, sc->val, j); - if (len < 0) - { - ret.type = 0; - return ret; - } - j += skip(len); - - if (sc->val[j] == 0) - { - // skip leading zeros - j++; - len--; - } - rlen = bround(len); - ex = rlen - len; - for (k = 0; k < ex; k++) - sig->val[i++] = 0; - - fin = j + len; - for (; j < fin; j++) - sig->val[i++] = sc->val[j]; - - if (ret.hash == X509_H256) ret.curve = USE_NIST256; - if (ret.hash == X509_H384) ret.curve = USE_NIST384; - if (ret.hash == X509_H512) ret.curve = USE_NIST521; - } - if (ret.type == X509_RSA) - { - rlen = bround(len); - ex = rlen - len; - - if (rlen>sig->max) - { - ret.type=0; - return ret; - } - sig->len = rlen; - i = 0; - for (k = 0; k < ex; k++) - sig->val[i++] = 0; - - fin = j + len; - for (; j < fin; j++) - sig->val[i++] = sc->val[j]; - - ret.curve = 8*rlen; - } - if (ret.type == X509_PQ) - { - if (len>sig->max) - { - ret.type=0; - return ret; - } - sig->len = len; - fin = j + len; - for (i=0; j < fin; j++) - sig->val[i++] = sc->val[j]; - ret.curve = 8*len; - } - return ret; -} - -// Extract certificate from signed cert -int X509_extract_cert(octet *sc, octet *cert) -{ - int i, j, fin, len, k; - - j = 0; - len = getalen(SEQ, sc->val, j); - - if (len < 0) return 0; - j += skip(len); - - k = j; - - len = getalen(SEQ, sc->val, j); - if (len < 0) return 0; - j += skip(len); - - fin = j + len; - if (fin-k>cert->max) return 0; - - cert->len = fin - k; - - for (i = k; i < fin; i++) cert->val[i - k] = sc->val[i]; - - return 1; -} - -// find index to start of ASN.1 raw public key, and return its length -int X509_find_public_key(octet *c,int *ptr) -{ - int i, j, k, fin, len, sj; - - j = 0; - - len = getalen(SEQ, c->val, j); - if (len < 0) return 0; - j += skip(len); - - if (len + j != c->len) return 0; - - len = getalen(ANY, c->val, j); - if (len < 0) return 0; - j += skip(len) + len; //jump over version clause - - len = getalen(INT, c->val, j); - - if (len > 0) j += skip(len) + len; // jump over serial number clause (if there is one) - - len = getalen(SEQ, c->val, j); - if (len < 0) return 0; - j += skip(len) + len; // jump over signature algorithm - - len = getalen(SEQ, c->val, j); - if (len < 0) return 0; - j += skip(len) + len; // skip issuer - - len = getalen(SEQ, c->val, j); - if (len < 0) return 0; - j += skip(len) + len; // skip validity - - len = getalen(SEQ, c->val, j); - if (len < 0) return 0; - j += skip(len) + len; // skip subject - - k=j; - len = getalen(SEQ, c->val, j); // look ahead to determine length - if (len < 0) return 0; - j += skip(len); // - - fin=j+len; - *ptr=k; - return fin-k; -} - -// get Public Key details from ASN.1 description -pktype X509_get_public_key(octet *c,octet *key) -{ - int i, j, fin, len, sj, ptr; - char koid[12]; /*****/ - octet KOID = {0, sizeof(koid), koid}; - pktype ret; - - ret.type = ret.hash = 0; - ret.curve = -1; - - j=0; - - len = getalen(SEQ, c->val, j); - if (len < 0) return ret; - j += skip(len); // - - len = getalen(SEQ, c->val, j); - if (len < 0) return ret; - j += skip(len); - -// ** Maybe dive in and check Public Key OIDs here? -// ecpublicKey & prime256v1, secp384r1 or secp521r1 for ECC -// rsapublicKey for RSA - - sj = j + len; - - len = getalen(OID, c->val, j); - if (len < 0) return ret; - j += skip(len); - - fin = j + len; - if (len>KOID.max) return ret; - KOID.len = len; - for (i = 0; j < fin; j++) - KOID.val[i++] = c->val[j]; - - ret.type = 0; - if (OCT_comp(&ECPK, &KOID)) ret.type = X509_ECC; - if (OCT_comp(&EDPK25519, &KOID)) {ret.type = X509_ECD; ret.curve=USE_ED25519;} - if (OCT_comp(&EDPK448, &KOID)) {ret.type = X509_ECD; ret.curve=USE_ED448;} - if (OCT_comp(&RSAPK, &KOID)) ret.type = X509_RSA; - if (OCT_comp(&DILITHIUM3, &KOID)) ret.type = X509_PQ; - - if (ret.type == 0) return ret; - - if (ret.type == X509_ECC) - { - // which elliptic curve? - len = getalen(OID, c->val, j); - if (len < 0) - { - ret.type = 0; - return ret; - } - j += skip(len); - - fin = j + len; - if (len>KOID.max) - { - ret.type=0; - return ret; - } - KOID.len = len; - for (i = 0; j < fin; j++) - KOID.val[i++] = c->val[j]; - - if (OCT_comp(&PRIME25519, &KOID)) ret.curve = USE_ED25519; /*****/ - if (OCT_comp(&PRIME256V1, &KOID)) ret.curve = USE_NIST256; - if (OCT_comp(&SECP384R1, &KOID)) ret.curve = USE_NIST384; - if (OCT_comp(&SECP521R1, &KOID)) ret.curve = USE_NIST521; - } - - j = sj; // skip to actual Public Key - - len = getalen(BIT, c->val, j); - if (len < 0) - { - ret.type = 0; - return ret; - } - j += skip(len); // - j++; - len--; // skip bit shift (hopefully 0!) - -// extract key - if (ret.type == X509_ECC || ret.type == X509_ECD || ret.type == X509_PQ) - { - if (len>key->max) - { - ret.type=0; - return ret; - } - key->len = len; - fin = j + len; - for (i = 0; j < fin; j++) - key->val[i++] = c->val[j]; - } - if (ret.type == X509_PQ) - ret.curve=8*len; - if (ret.type == X509_RSA) - { - // Key is (modulus,exponent) - assume exponent is 65537 - len = getalen(SEQ, c->val, j); - if (len < 0) - { - ret.type = 0; - return ret; - } - j += skip(len); // - - len = getalen(INT, c->val, j); // get modulus - if (len < 0) - { - ret.type = 0; - return ret; - } - j += skip(len); // - if (c->val[j] == 0) - { - j++; - len--; // remove leading zero - } - if (len>key->max) - { - ret.type=0; - return ret; - } - key->len = len; - fin = j + len; - for (i = 0; j < fin; j++) - key->val[i++] = c->val[j]; - - ret.curve = 8 * len; - } - return ret; -} - -// Extract Public Key from inside Certificate -pktype X509_extract_public_key(octet *c, octet *key) -{ - int ptr=0; - int pklen=X509_find_public_key(c,&ptr); - octet CC={pklen,pklen,&c->val[ptr]}; - return X509_get_public_key(&CC,key); -} - -// Find pointer to main sections of cert, before extracting individual field -// Find index to issuer in cert, and its length -// This is the certificate DER encoded distinguished issuer name -int X509_find_issuer(octet *c,int *flen) -{ - int j, len; - *flen=0; - j = 0; - len = getalen(SEQ, c->val, j); - if (len < 0) return 0; - j += skip(len); - - if (len + j != c->len) return 0; - - len = getalen(ANY, c->val, j); - if (len < 0) return 0; - j += skip(len) + len; //jump over version clause - - len = getalen(INT, c->val, j); - - if (len > 0) j += skip(len) + len; // jump over serial number clause (if there is one) - - len = getalen(SEQ, c->val, j); - if (len < 0) return 0; - j += skip(len) + len; // jump over signature algorithm - - len=getalen(SEQ,c->val,j); - *flen=len+skip(len); // length of issuer - - return j; -} - -// Find index to validity period -int X509_find_validity(octet *c) -{ - int j, len; - j = X509_find_issuer(c,&len); - j+=len; // skip issuer - - //len = getalen(SEQ, c->val, j); - //if (len < 0) return 0; - //j += skip(len) + len; // skip issuer - - return j; -} - -// Find index to subject in cert, and its length -// This is the certificate DER encoded distinguished subject name -int X509_find_subject(octet *c,int *flen) -{ - int j, len; - *flen=0; - j = X509_find_validity(c); - - len = getalen(SEQ, c->val, j); - if (len < 0) return 0; - j += skip(len) + len; // skip validity - - len=getalen(SEQ,c->val,j); - *flen=len+skip(len); - - return j; -} - -int X509_self_signed(octet *c) -{ - int i,m,slen,ilen; - int ksub=X509_find_subject(c,&slen); - int kiss=X509_find_issuer(c,&ilen); - - if (slen!=ilen) return 0; - - //int sublen=getalen(SEQ,c->val,ksub); - //int isslen=getalen(SEQ,c->val,kiss); - //if (isslen!=sublen) return 0; - //ksub+=skip(sublen); - //kiss+=skip(isslen); - for (i=m=0;ival[i+ksub] - c->val[i+kiss]; - if (m!=0) return 0; - return 1; -} - -// NOTE: When extracting cert information, we actually return just an index to the data inside the cert, and maybe its length -// So no memory is assigned to store cert info. It is the callers responsibility to allocate such memory if required, and copy -// cert information into it. - -// Find entity property indicated by SOID, given start of issuer or subject field. Return index in cert, flen=length of field - -int X509_find_entity_property(octet *c, octet *SOID, int start, int *flen) -{ - int i, j, k, fin, len, tlen; - char foid[50]; /*****/ - octet FOID = {0, sizeof(foid), foid}; - - j = start; - - tlen = getalen(SEQ, c->val, j); - if (tlen < 0) return 0; - j += skip(tlen); - - for (k = j; j < k + tlen;) - { - // search for Owner OID - len = getalen(SET, c->val, j); - if (len < 0) return 0; - j += skip(len); - len = getalen(SEQ, c->val, j); - if (len < 0) return 0; - j += skip(len); - len = getalen(OID, c->val, j); - if (len < 0) return 0; - j += skip(len); - fin = j + len; // extract OID - if (len>FOID.max) return 0; - FOID.len = len; - for (i = 0; j < fin; j++) - FOID.val[i++] = c->val[j]; - len = getalen(ANY, c->val, j); // get text, could be any type - if (len < 0) return 0; - - j += skip(len); - if (OCT_comp(&FOID, SOID)) - { - // if its the right one return - *flen = len; - return j; - } - j += len; // skip over it - } - *flen = 0; /*****/ - return 0; -} - -// Find start date of certificate validity period -int X509_find_start_date(octet *c, int start) -{ - int j, len; - j = start; - - len = getalen(SEQ, c->val, j); - if (len < 0) return 0; - j += skip(len); - - len = getalen(UTC, c->val, j); - if (len < 0) - { // could be generalised time - len = getalen(GTM, c->val, j); - if (len<0) return 0; - j += skip(len); - j += 2; // skip century - } - else j += skip(len); - return j; -} - -// Find expiry date of certificate validity period -int X509_find_expiry_date(octet *c, int start) -{ - int j, len; - j = start; - - len = getalen(SEQ, c->val, j); - if (len < 0) return 0; - j += skip(len); - - len = getalen(UTC, c->val, j); - if (len < 0) - { - len = getalen(GTM,c->val,j); - if (len<0) return 0; - } - j += skip(len) + len; - - len = getalen(UTC, c->val, j); - if (len < 0) - { - len = getalen(GTM, c->val,j); - if (len<0) return 0; - j+=skip(len); - j+=2; // skip century - } - else j += skip(len); - - return j; -} - -int X509_find_extensions(octet *c) -{ - int j, len; - j=X509_find_subject(c,&len); - j+=len; // skip subject - - //len = getalen(SEQ, c->val, j); - //if (len<0) return 0; - //j += skip(len)+len; // skip subject - - len = getalen(SEQ, c->val, j); - if (len<0) return 0; - j += skip(len)+len; // skip public key - - if (j>=c->len) return 0; - return j; -} - -int X509_find_extension(octet *c, octet *SOID, int start, int *flen) -{ - int i, j, k, fin, len, tlen, nj; - char foid[50]; /*****/ - octet FOID = {0, sizeof(foid), foid}; - - j = start; - - tlen = getalen(EXT, c->val, j); - if (tlen < 0) return 0; - j += skip(tlen); - - tlen = getalen(SEQ, c->val, j); - if (tlen < 0) return 0; - j += skip(tlen); - - for (k = j; j < k + tlen;) - { - // search for Owner OID - len = getalen(SEQ, c->val, j); - if (len < 0) return 0; - j += skip(len); nj=j+len; - len = getalen(OID, c->val, j); - if (len < 0) return 0; - j += skip(len); - fin = j + len; // extract OID - if (len>FOID.max) return 0; - FOID.len = len; - for (i = 0; j < fin; j++) - FOID.val[i++] = c->val[j]; - if (OCT_comp(&FOID, SOID)) - { - // if its the right one return - *flen = nj-j; - return j; - } - j = nj; // skip over this extension - } - *flen = 0; /*****/ - return 0; -} - -// return 1 if name found, else 0, where name is URL -// input cert, and pointer to SAN extension -// Takes wild-card into consideration -int X509_find_alt_name(octet *c,int start,char *name) -{ - int i,j,len,k,m,tlen,cmp,tag; - - if (start==0) return 0; - j=start; - tlen = getalen(OCT, c->val, j); - if (tlen < 0) return 0; - j += skip(tlen); - - tlen = getalen(SEQ, c->val, j); - if (tlen < 0) return 0; - j += skip(tlen); - - for (k=j;jval[j]; tag&=0xff; - len = getalen(ANY, c->val, j); - if (len < 0) return 0; - j += skip(len); // ?? If its not dns, skip over it j+=len - if (tag!=DNS) - { // only interested in URLs - j+=len; - continue; - } - cmp=1; m=0; - if (c->val[j]=='*') - { // wildcard - j++; len--; // skip over * - while (name[m]!='.' && name[m]!=0) // advance to first . - m++; - } - for (i=0;ival[j++]!=name[m++]) // mismatch - cmp=0; - } - if (name[m]!=0) cmp=0; // name should have ended - if (cmp) return 1; - } - return 0; -} - -