Skip to content

Commit b6487dc

Browse files
committed
Squashed 'src/minisketch/' content from commit 89629eb2c7
git-subtree-dir: src/minisketch git-subtree-split: 89629eb2c7e262b39ba489b93b111760baded4b3
0 parents  commit b6487dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+8652
-0
lines changed

.cirrus.yml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
env:
2+
BUILD: check
3+
HOST:
4+
MAKEFLAGS: -j4
5+
BENCH: yes
6+
TESTRUNS:
7+
EXEC_CMD:
8+
ENABLE_FIELDS:
9+
10+
cat_logs_snippet: &CAT_LOGS
11+
on_failure:
12+
cat_test_log_script:
13+
- cat test-suite.log || true
14+
cat_config_log_script:
15+
- cat config.log || true
16+
cat_test_env_script:
17+
- cat test_env.log || true
18+
cat_ci_env_script:
19+
- env
20+
21+
merge_base_script_snippet: &MERGE_BASE
22+
merge_base_script:
23+
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
24+
- git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH
25+
- git config --global user.email "[email protected]"
26+
- git config --global user.name "ci"
27+
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
28+
29+
env_matrix_snippet: &ENV_MATRIX_VALGRIND
30+
- env:
31+
ENABLE_FIELDS: "7,32,58"
32+
- env:
33+
BUILD: distcheck
34+
- env:
35+
EXEC_CMD: valgrind --error-exitcode=42
36+
TESTRUNS: 1
37+
BUILD:
38+
39+
env_matrix_snippet: &ENV_MATRIX_SAN
40+
- env:
41+
ENABLE_FIELDS: 28
42+
- env:
43+
BUILD: distcheck
44+
- env:
45+
CXXFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
46+
LDFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
47+
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
48+
BENCH: no
49+
50+
env_matrix_snippet: &ENV_MATRIX_SAN_VALGRIND
51+
- env:
52+
ENABLE_FIELDS: "11,64,37"
53+
- env:
54+
BUILD: distcheck
55+
- env:
56+
EXEC_CMD: valgrind --error-exitcode=42
57+
TESTRUNS: 1
58+
BUILD:
59+
- env:
60+
CXXFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
61+
LDFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
62+
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
63+
BENCH: no
64+
65+
task:
66+
name: "x86_64: Linux (Debian stable)"
67+
container:
68+
dockerfile: ci/linux-debian.Dockerfile
69+
memory: 2G
70+
cpu: 4
71+
matrix:
72+
<< : *ENV_MATRIX_SAN_VALGRIND
73+
matrix:
74+
- env:
75+
CC: gcc
76+
- env:
77+
CC: clang
78+
<< : *MERGE_BASE
79+
test_script:
80+
- ./ci/cirrus.sh
81+
<< : *CAT_LOGS
82+
83+
task:
84+
name: "i686: Linux (Debian stable)"
85+
container:
86+
dockerfile: ci/linux-debian.Dockerfile
87+
memory: 2G
88+
cpu: 4
89+
env:
90+
HOST: i686-linux-gnu
91+
matrix:
92+
<< : *ENV_MATRIX_VALGRIND
93+
matrix:
94+
- env:
95+
CC: i686-linux-gnu-gcc
96+
- env:
97+
CC: clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
98+
test_script:
99+
- ./ci/cirrus.sh
100+
<< : *CAT_LOGS
101+
102+
task:
103+
name: "x86_64: macOS Catalina"
104+
macos_instance:
105+
image: catalina-base
106+
env:
107+
# Cirrus gives us a fixed number of 12 virtual CPUs.
108+
MAKEFLAGS: -j13
109+
matrix:
110+
<< : *ENV_MATRIX_SAN
111+
matrix:
112+
- env:
113+
CC: gcc-9
114+
- env:
115+
CC: clang
116+
brew_script:
117+
- brew update
118+
- brew install automake libtool gcc@9
119+
<< : *MERGE_BASE
120+
test_script:
121+
- ./ci/cirrus.sh
122+
<< : *CAT_LOGS
123+
124+
task:
125+
name: "s390x (big-endian): Linux (Debian stable, QEMU)"
126+
container:
127+
dockerfile: ci/linux-debian.Dockerfile
128+
cpu: 4
129+
memory: 2G
130+
env:
131+
EXEC_CMD: qemu-s390x -L /usr/s390x-linux-gnu
132+
HOST: s390x-linux-gnu
133+
BUILD:
134+
<< : *MERGE_BASE
135+
test_script:
136+
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
137+
- rm /etc/ld.so.cache
138+
- ./ci/cirrus.sh
139+
<< : *CAT_LOGS
140+
141+
task:
142+
name: "x86_64-w64-mingw32: Linux (Debian stable, Wine)"
143+
container:
144+
dockerfile: ci/linux-debian.Dockerfile
145+
cpu: 4
146+
memory: 2G
147+
env:
148+
EXEC_CMD: wine
149+
HOST: x86_64-w64-mingw32
150+
BUILD:
151+
<< : *MERGE_BASE
152+
test_script:
153+
- ./ci/cirrus.sh
154+
<< : *CAT_LOGS

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
*.o
2+
*.lo
3+
*.la
4+
*.dll
5+
*.dylib
6+
*.so.*
7+
.*
8+
*.a
9+
*~
10+
11+
Makefile
12+
Makefile.in
13+
aclocal.m4
14+
autom4te.cache/
15+
build-aux/config.guess
16+
build-aux/config.sub
17+
build-aux/depcomp
18+
build-aux/install-sh
19+
build-aux/ltmain.sh
20+
build-aux/m4/libtool.m4
21+
build-aux/m4/lt~obsolete.m4
22+
build-aux/m4/ltoptions.m4
23+
build-aux/m4/ltsugar.m4
24+
build-aux/m4/ltversion.m4
25+
build-aux/missing
26+
build-aux/compile
27+
build-aux/test-driver
28+
config.log
29+
config.status
30+
configure
31+
libtool
32+
stamp-h1
33+
34+
test*
35+
bench

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Pieter Wuille, Greg Maxwell, Gleb Naumenko
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile.am

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
ACLOCAL_AMFLAGS = -I build-aux/m4
2+
AM_CXXFLAGS = $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS)
3+
4+
include sources.mk
5+
6+
include_HEADERS = $(MINISKETCH_DIST_HEADERS_INT)
7+
noinst_HEADERS = $(MINISKETCH_LIB_HEADERS_INT) $(MINISKETCH_FIELD_GENERIC_HEADERS_INT) $(MINISKETCH_FIELD_CLMUL_HEADERS_INT)
8+
9+
LIBMINISKETCH = libminisketch.la
10+
LIBMINISKETCH_FIELD_GENERIC = libminisketch_field_generic.la
11+
if ENABLE_CLMUL
12+
LIBMINISKETCH_FIELD_CLMUL = libminisketch_field_clmul.la
13+
endif
14+
if USE_TESTS
15+
LIBMINISKETCH_VERIFY=libminisketch_verify.la
16+
LIBMINISKETCH_FIELD_GENERIC_VERIFY=libminisketch_field_generic_verify.la
17+
if ENABLE_CLMUL
18+
LIBMINISKETCH_FIELD_CLMUL_VERIFY=libminisketch_field_clmul_verify.la
19+
endif
20+
endif
21+
22+
lib_LTLIBRARIES =
23+
lib_LTLIBRARIES += $(LIBMINISKETCH)
24+
25+
noinst_LTLIBRARIES =
26+
noinst_LTLIBRARIES += $(LIBMINISKETCH_FIELD_GENERIC)
27+
noinst_LTLIBRARIES += $(LIBMINISKETCH_FIELD_GENERIC_VERIFY)
28+
noinst_LTLIBRARIES += $(LIBMINISKETCH_FIELD_CLMUL)
29+
noinst_LTLIBRARIES += $(LIBMINISKETCH_FIELD_CLMUL_VERIFY)
30+
noinst_LTLIBRARIES += $(LIBMINISKETCH_VERIFY)
31+
32+
# Release libs
33+
libminisketch_field_generic_la_SOURCES = $(MINISKETCH_FIELD_GENERIC_SOURCES_INT)
34+
libminisketch_field_generic_la_CPPFLAGS = $(AM_CPPFLAGS) $(RELEASE_DEFINES)
35+
36+
libminisketch_field_clmul_la_SOURCES = $(MINISKETCH_FIELD_CLMUL_SOURCES_INT)
37+
libminisketch_field_clmul_la_CPPFLAGS = $(AM_CPPFLAGS) $(RELEASE_DEFINES)
38+
libminisketch_field_clmul_la_CXXFLAGS = $(AM_CXXFLAGS) $(CLMUL_CXXFLAGS)
39+
40+
libminisketch_la_SOURCES = $(MINISKETCH_LIB_SOURCES_INT)
41+
libminisketch_la_CPPFLAGS = $(AM_CPPFLAGS) $(RELEASE_DEFINES)
42+
libminisketch_la_LIBADD = $(LIBMINISKETCH_FIELD_CLMUL) $(LIBMINISKETCH_FIELD_GENERIC)
43+
44+
# Libs with extra verification checks
45+
libminisketch_field_generic_verify_la_SOURCES = $(MINISKETCH_FIELD_GENERIC_SOURCES_INT)
46+
libminisketch_field_generic_verify_la_CPPFLAGS = $(AM_CPPFLAGS) $(VERIFY_DEFINES)
47+
48+
libminisketch_field_clmul_verify_la_SOURCES = $(MINISKETCH_FIELD_CLMUL_SOURCES_INT)
49+
libminisketch_field_clmul_verify_la_CPPFLAGS = $(AM_CPPFLAGS) $(VERIFY_DEFINES)
50+
libminisketch_field_clmul_verify_la_CXXFLAGS = $(AM_CXXFLAGS) $(CLMUL_CXXFLAGS)
51+
52+
libminisketch_verify_la_SOURCES = $(MINISKETCH_LIB_SOURCES_INT)
53+
libminisketch_verify_la_CPPFLAGS = $(AM_CPPFLAGS) $(VERIFY_DEFINES)
54+
libminisketch_verify_la_LIBADD = $(LIBMINISKETCH_FIELD_CLMUL_VERIFY) $(LIBMINISKETCH_FIELD_GENERIC_VERIFY)
55+
56+
noinst_PROGRAMS =
57+
if USE_BENCHMARK
58+
noinst_PROGRAMS += bench
59+
endif
60+
if USE_TESTS
61+
noinst_PROGRAMS += test test-verify
62+
TESTS = test test-verify
63+
endif
64+
65+
bench_SOURCES = $(MINISKETCH_BENCH_SOURCES_INT)
66+
bench_CPPFLAGS = $(AM_CPPFLAGS) $(RELEASE_DEFINES)
67+
bench_LDADD = $(LIBMINISKETCH)
68+
bench_LDFLAGS = $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
69+
70+
test_SOURCES = $(MINISKETCH_TEST_SOURCES_INT)
71+
test_CPPFLAGS = $(AM_CPPFLAGS) $(RELEASE_DEFINES)
72+
test_LDADD = $(LIBMINISKETCH)
73+
test_LDFLAGS = $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
74+
75+
test_verify_SOURCES = $(MINISKETCH_TEST_SOURCES_INT)
76+
test_verify_CPPFLAGS = $(AM_CPPFLAGS) $(VERIFY_DEFINES)
77+
test_verify_LDADD = $(LIBMINISKETCH_VERIFY)
78+
test_verify_LDFLAGS = $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
79+
80+
EXTRA_DIST=
81+
EXTRA_DIST += LICENSE
82+
EXTRA_DIST += README.md
83+
EXTRA_DIST += doc/example.c
84+
EXTRA_DIST += doc/gen_params.sage
85+
EXTRA_DIST += doc/math.md
86+
EXTRA_DIST += doc/moduli.md
87+
EXTRA_DIST += doc/plot_bits.png
88+
EXTRA_DIST += doc/plot_capacity.png
89+
EXTRA_DIST += doc/plot_diff.png
90+
EXTRA_DIST += doc/plot_size.png
91+
EXTRA_DIST += doc/protocoltips.md
92+
EXTRA_DIST += tests/pyminisketch.py

0 commit comments

Comments
 (0)