Skip to content

Commit

Permalink
Fix CMakeLists.txt when use emp-tool as a submodule. (#127)
Browse files Browse the repository at this point in the history
* Fix CMakeLists.txt when use emp-tool as a submodule.

* update cmakelist

Co-authored-by: Xiao Wang <[email protected]>
  • Loading branch information
ujnss and wangxiao1254 authored May 12, 2021
1 parent 1b5e6da commit 95cb70d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ project (emptool)
set(NAME "emp-tool")

ADD_CUSTOM_COMMAND(
OUTPUT emp-tool/circuits/files/bristol_fashion/Keccak_f.txt.cpp
OUTPUT ${CMAKE_SOURCE_DIR}/emp-tool/circuits/files/bristol_fashion/Keccak_f.txt.cpp
COMMAND xxd -i emp-tool/circuits/files/bristol_fashion/Keccak_f.txt emp-tool/circuits/files/bristol_fashion/Keccak_f.txt.hex
COMMAND echo "#include \"emp-tool/circuits/sha3_256.h\"" > emp-tool/circuits/files/bristol_fashion/Keccak_f.txt.cpp
COMMAND echo "\\#include \\\"emp-tool/circuits/sha3_256.h\\\"" > emp-tool/circuits/files/bristol_fashion/Keccak_f.txt.cpp
COMMAND cat emp-tool/circuits/files/bristol_fashion/Keccak_f.txt.hex >> emp-tool/circuits/files/bristol_fashion/Keccak_f.txt.cpp
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Compiling Keccak circuit file to binary")

ADD_CUSTOM_COMMAND(
OUTPUT emp-tool/circuits/files/bristol_fashion/aes_128.txt.cpp
OUTPUT ${CMAKE_SOURCE_DIR}/emp-tool/circuits/files/bristol_fashion/aes_128.txt.cpp
COMMAND xxd -i emp-tool/circuits/files/bristol_fashion/aes_128.txt emp-tool/circuits/files/bristol_fashion/aes_128.txt.hex
COMMAND echo "#include \"emp-tool/circuits/aes_128_ctr.h\"" > emp-tool/circuits/files/bristol_fashion/aes_128.txt.cpp
COMMAND echo "\\#include \\\"emp-tool/circuits/aes_128_ctr.h\\\"" > emp-tool/circuits/files/bristol_fashion/aes_128.txt.cpp
COMMAND cat emp-tool/circuits/files/bristol_fashion/aes_128.txt.hex >> emp-tool/circuits/files/bristol_fashion/aes_128.txt.cpp
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Compiling aes_128 circuit file to binary")

set(sources
Expand Down
2 changes: 2 additions & 0 deletions emp-tool/circuits/aes_128_ctr.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "emp-tool/execution/protocol_execution.h"
#include "emp-tool/utils/block.h"
#include "emp-tool/circuits/bit.h"
#include "emp-tool/circuits/integer.h"
#include "emp-tool/circuits/circuit_file.h"
#include <stdio.h>
#include <fstream>

Expand Down

0 comments on commit 95cb70d

Please sign in to comment.