Skip to content

Commit

Permalink
meson: build extra static lib without randomness.c
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastinas committed Jul 12, 2023
1 parent 128fc95 commit d65aabe
Show file tree
Hide file tree
Showing 14 changed files with 105 additions and 43 deletions.
10 changes: 7 additions & 3 deletions faest_128f/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ libfaest_128f_dependency = declare_dependency(
include_directories: include_directories
)
if openssl.found()
tv_sources = files(join_paths(meson.project_source_root(), 'tools', 'rng.c'), join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp'))
test_vector_generator = executable('faest_128f_test_vectors', [sources] + faest_sources + tv_sources,
dependencies: [openssl],
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_128f_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
Expand Down
10 changes: 7 additions & 3 deletions faest_128s/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ libfaest_128s_dependency = declare_dependency(
include_directories: include_directories
)
if openssl.found()
tv_sources = files(join_paths(meson.project_source_root(), 'tools', 'rng.c'), join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp'))
test_vector_generator = executable('faest_128s_test_vectors', [sources] + faest_sources + tv_sources,
dependencies: [openssl],
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_128s_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
Expand Down
10 changes: 7 additions & 3 deletions faest_192f/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ libfaest_192f_dependency = declare_dependency(
include_directories: include_directories
)
if openssl.found()
tv_sources = files(join_paths(meson.project_source_root(), 'tools', 'rng.c'), join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp'))
test_vector_generator = executable('faest_192f_test_vectors', [sources] + faest_sources + tv_sources,
dependencies: [openssl],
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_192f_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
Expand Down
10 changes: 7 additions & 3 deletions faest_192s/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ libfaest_192s_dependency = declare_dependency(
include_directories: include_directories
)
if openssl.found()
tv_sources = files(join_paths(meson.project_source_root(), 'tools', 'rng.c'), join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp'))
test_vector_generator = executable('faest_192s_test_vectors', [sources] + faest_sources + tv_sources,
dependencies: [openssl],
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_192s_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
Expand Down
10 changes: 7 additions & 3 deletions faest_256f/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ libfaest_256f_dependency = declare_dependency(
include_directories: include_directories
)
if openssl.found()
tv_sources = files(join_paths(meson.project_source_root(), 'tools', 'rng.c'), join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp'))
test_vector_generator = executable('faest_256f_test_vectors', [sources] + faest_sources + tv_sources,
dependencies: [openssl],
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_256f_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
Expand Down
10 changes: 7 additions & 3 deletions faest_256s/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ libfaest_256s_dependency = declare_dependency(
include_directories: include_directories
)
if openssl.found()
tv_sources = files(join_paths(meson.project_source_root(), 'tools', 'rng.c'), join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp'))
test_vector_generator = executable('faest_256s_test_vectors', [sources] + faest_sources + tv_sources,
dependencies: [openssl],
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_256s_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
Expand Down
10 changes: 7 additions & 3 deletions faest_em_128f/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ libfaest_em_128f_dependency = declare_dependency(
include_directories: include_directories
)
if openssl.found()
tv_sources = files(join_paths(meson.project_source_root(), 'tools', 'rng.c'), join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp'))
test_vector_generator = executable('faest_em_128f_test_vectors', [sources] + faest_sources + tv_sources,
dependencies: [openssl],
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_em_128f_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
Expand Down
10 changes: 7 additions & 3 deletions faest_em_128s/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ libfaest_em_128s_dependency = declare_dependency(
include_directories: include_directories
)
if openssl.found()
tv_sources = files(join_paths(meson.project_source_root(), 'tools', 'rng.c'), join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp'))
test_vector_generator = executable('faest_em_128s_test_vectors', [sources] + faest_sources + tv_sources,
dependencies: [openssl],
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_em_128s_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
Expand Down
10 changes: 7 additions & 3 deletions faest_em_192f/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ libfaest_em_192f_dependency = declare_dependency(
include_directories: include_directories
)
if openssl.found()
tv_sources = files(join_paths(meson.project_source_root(), 'tools', 'rng.c'), join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp'))
test_vector_generator = executable('faest_em_192f_test_vectors', [sources] + faest_sources + tv_sources,
dependencies: [openssl],
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_em_192f_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
Expand Down
10 changes: 7 additions & 3 deletions faest_em_192s/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ libfaest_em_192s_dependency = declare_dependency(
include_directories: include_directories
)
if openssl.found()
tv_sources = files(join_paths(meson.project_source_root(), 'tools', 'rng.c'), join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp'))
test_vector_generator = executable('faest_em_192s_test_vectors', [sources] + faest_sources + tv_sources,
dependencies: [openssl],
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_em_192s_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
Expand Down
10 changes: 7 additions & 3 deletions faest_em_256f/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ libfaest_em_256f_dependency = declare_dependency(
include_directories: include_directories
)
if openssl.found()
tv_sources = files(join_paths(meson.project_source_root(), 'tools', 'rng.c'), join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp'))
test_vector_generator = executable('faest_em_256f_test_vectors', [sources] + faest_sources + tv_sources,
dependencies: [openssl],
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_em_256f_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
Expand Down
10 changes: 7 additions & 3 deletions faest_em_256s/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ libfaest_em_256s_dependency = declare_dependency(
include_directories: include_directories
)
if openssl.found()
tv_sources = files(join_paths(meson.project_source_root(), 'tools', 'rng.c'), join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp'))
test_vector_generator = executable('faest_em_256s_test_vectors', [sources] + faest_sources + tv_sources,
dependencies: [openssl],
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_em_256s_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
Expand Down
18 changes: 14 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ faest_sources = files(
'instances.c',
'owf.c',
'random_oracle.c',
'randomness.c',
'universal_hashing.c',
'vc.c',
'vole.c'
Expand Down Expand Up @@ -514,12 +513,23 @@ foreach parameter_set : parameter_sets
endforeach

# static faest library
libfaest_static = static_library('faest',
libfaest_no_random_static = static_library('faest_no_random',
faest_sources,
dependencies: build_dependencies + [valgrind],
include_directories: include_directories,
c_args: defines + c_flags + ['-DFAEST_STATIC', '-DFAEST_EXPORT=', '-DFAEST_TESTS'] + valgrind_defines,
install: true
)
libfaest_no_random_static_dependency = declare_dependency(
link_with: libfaest_no_random_static,
include_directories: include_directories,
compile_args: ['-DFAEST_EXPORT=']
)

libfaest_static = static_library('faest',
files('randomness.c'),
dependencies: build_dependencies + [libfaest_no_random_static_dependency, valgrind],
include_directories: include_directories,
c_args: defines + c_flags + ['-DFAEST_STATIC', '-DFAEST_EXPORT=', '-DFAEST_TESTS'] + valgrind_defines,
)
libfaest_static_dependency = declare_dependency(
link_with: libfaest_static,
Expand All @@ -535,7 +545,7 @@ elif cc.has_function_attribute('visibility:default')
visibility_define += '-DFAEST_EXPORT=__attribute__((visibility("default")))'
endif
libfaest = shared_library('faest',
faest_sources,
faest_sources + files('randomness.c'),
dependencies: build_dependencies,
include_directories: include_directories,
c_args: defines + c_flags + visibility_define,
Expand Down
10 changes: 7 additions & 3 deletions tools/crypto_sign_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ def generate(param_name):
include_directories: include_directories
)
if openssl.found()
tv_sources = files(join_paths(meson.project_source_root(), 'tools', 'rng.c'), join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp'))
test_vector_generator = executable('faest_{param_name}_test_vectors', [sources] + faest_sources + tv_sources,
dependencies: [openssl],
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_{param_name}_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
Expand Down

0 comments on commit d65aabe

Please sign in to comment.