Skip to content

Commit

Permalink
develop: make it build
Browse files Browse the repository at this point in the history
  • Loading branch information
asiegel-jt committed Oct 17, 2023
1 parent 674e437 commit 1dcaed0
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 49 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# Common compilation flags and warning configuration
set(
CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wfatal-errors"
"${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wextra -Wfatal-errors"
)
if("${MULTICORE}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
Expand Down Expand Up @@ -233,4 +233,4 @@ if ("${IS_LIBFF_PARENT}")
# Add a 'make clang-tidy' target that runs clang-tidy using checks specified in .clang-tidy
include(clang-tidy.cmake)
endif()
add_subdirectory(libff)
add_subdirectory(libff)
2 changes: 1 addition & 1 deletion depends/ate-pairing
2 changes: 1 addition & 1 deletion depends/gtest
Submodule gtest updated 385 files
2 changes: 1 addition & 1 deletion depends/xbyak
Submodule xbyak updated 109 files
29 changes: 0 additions & 29 deletions libff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,35 +80,6 @@ target_include_directories(
PUBLIC ..
)

# Sodium for binary fields.
find_path(
SODIUM_INCLUDE_DIR
sodium.h
HINTS ${LIBSODIUM_INCLUDE_DIRS}
/usr/local/include /opt/local/include /opt/include
)
find_library(
SODIUM_LIBRARY
NAMES sodium
HINTS ${LIBSODIUM_LIBRARY_DIRS}
/usr/local/lib /opt/local/lib /opt/lib
)

target_include_directories(
ff
PUBLIC
${SODIUM_INCLUDE_DIR}
)
target_compile_options(
ff
PUBLIC
${LIBSODIUM_CFLAGS} ${LIBSODIUM_CFLAGS_OTHER}
)
target_link_libraries(
ff
${SODIUM_LIBRARY} ${LIBSODIUM_LDFLAGS_OTHER}
)

install(
DIRECTORY "" DESTINATION "include/libff"
FILES_MATCHING
Expand Down
5 changes: 2 additions & 3 deletions libff/algebra/fields/binary/gf128.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

#define __STDC_FORMAT_MACROS
#include <inttypes.h>

#include <sodium/randombytes.h>
#include <sys/random.h>

#include "libff/algebra/field_utils/algorithms.hpp"
#include "libff/algebra/fields/binary/gf128.hpp"
Expand Down Expand Up @@ -243,7 +242,7 @@ gf128 gf128::sqrt() const

void gf128::randomize()
{
randombytes_buf(&this->value_, 128/8);
getrandom(&this->value_, 128/8, 0);
}

void gf128::clear()
Expand Down
5 changes: 2 additions & 3 deletions libff/algebra/fields/binary/gf192.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

#define __STDC_FORMAT_MACROS
#include <inttypes.h>

#include <sodium/randombytes.h>
#include <sys/random.h>

#include "libff/algebra/field_utils/algorithms.hpp"
#include "libff/algebra/fields/binary/gf192.hpp"
Expand Down Expand Up @@ -294,7 +293,7 @@ gf192 gf192::sqrt() const

void gf192::randomize()
{
randombytes_buf(&this->value_, 192/8);
getrandom(&this->value_, 192/8, 0);
}

void gf192::clear()
Expand Down
5 changes: 2 additions & 3 deletions libff/algebra/fields/binary/gf256.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

#define __STDC_FORMAT_MACROS
#include <inttypes.h>

#include <sodium/randombytes.h>
#include <sys/random.h>

#include "libff/algebra/field_utils/algorithms.hpp"
#include "libff/algebra/fields/binary/gf256.hpp"
Expand Down Expand Up @@ -366,7 +365,7 @@ gf256 gf256::sqrt() const

void gf256::randomize()
{
randombytes_buf(&this->value_, 256/8);
getrandom(&this->value_, 256/8, 0);
}

void gf256::clear()
Expand Down
5 changes: 2 additions & 3 deletions libff/algebra/fields/binary/gf32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

#define __STDC_FORMAT_MACROS
#include <inttypes.h>

#include <sodium/randombytes.h>
#include <sys/random.h>

#include "libff/algebra/field_utils/algorithms.hpp"
#include "libff/algebra/fields/binary/gf32.hpp"
Expand Down Expand Up @@ -204,7 +203,7 @@ gf32 gf32::sqrt() const

void gf32::randomize()
{
randombytes_buf(&this->value_, 32/8);
getrandom(&this->value_, 32/8, 0);
}

void gf32::clear()
Expand Down
5 changes: 2 additions & 3 deletions libff/algebra/fields/binary/gf64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

#define __STDC_FORMAT_MACROS
#include <inttypes.h>

#include <sodium/randombytes.h>
#include <sys/random.h>

#include "libff/algebra/field_utils/algorithms.hpp"
#include "libff/algebra/fields/binary/gf64.hpp"
Expand Down Expand Up @@ -245,7 +244,7 @@ gf64 gf64::sqrt() const

void gf64::randomize()
{
randombytes_buf(&this->value_, 64/8);
getrandom(&this->value_, 64/8, 0);
}

void gf64::clear()
Expand Down

0 comments on commit 1dcaed0

Please sign in to comment.