-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile.am
More file actions
214 lines (193 loc) · 6.03 KB
/
Copy pathMakefile.am
File metadata and controls
214 lines (193 loc) · 6.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
ACLOCAL_AMFLAGS = -I build-aux/m4
# Use serial test harness to show test output in real-time
AUTOMAKE_OPTIONS = color-tests serial-tests
AM_CFLAGS = -Wall -g -O3
lib_LTLIBRARIES = liburcrypt.la
noinst_LTLIBRARIES = libaes_siv.la \
libed25519.la \
libge_additions.la \
libargon2.la \
libblake3.la \
libmonocypher.la \
libkeccak_tiny.la \
libscrypt.la
include_HEADERS = urcrypt/urcrypt.h
noinst_HEADERS = urcrypt/util.h \
aes_siv/aes_siv.h \
ed25519/src/ed25519.h \
ed25519/src/ge.h \
ge-additions/ge-additions.h \
argon2/include/argon2.h \
argon2/src/blake2/blake2.h \
blake3/blake3.h \
blake3/blake3_impl.h \
monocypher/monocypher.h \
scrypt/sha256.h \
scrypt/libscrypt.h
# main library
pkgconfig_DATA = liburcrypt-$(URCRYPT_API_VERSION).pc
DISTCLEANFILES = $(pkgconfig_DATA)
liburcrypt_la_CPPFLAGS = -I$(srcdir)/aes_siv \
-I$(srcdir)/ed25519/src \
-I$(srcdir)/ge-additions \
-I$(srcdir)/argon2/include \
-I$(srcdir)/argon2/src/blake2 \
-I$(srcdir)/blake3 \
-I$(srcdir)/monocypher \
-I$(srcdir)/keccak-tiny \
-I$(srcdir)/scrypt
liburcrypt_la_LIBADD = $(NETTLE_LIBS) \
$(LIBSECP256K1_LIBS) \
libaes_siv.la \
libed25519.la \
libge_additions.la \
libargon2.la \
libblake3.la \
libmonocypher.la \
libkeccak_tiny.la \
libscrypt.la
liburcrypt_la_CFLAGS = $(NETTLE_CFLAGS) \
$(LIBSECP256K1_CFLAGS)
# urcrypt_ is used for public symbols, urcrypt__ for internal.
liburcrypt_la_LDFLAGS = -export-symbols-regex '^urcrypt_[^_]' \
-version-info $(URCRYPT_LT_VERSION)
liburcrypt_la_SOURCES = urcrypt/aes_cbc.c \
urcrypt/aes_ecb.c \
urcrypt/aes_siv.c \
urcrypt/argon.c \
urcrypt/blake3.c \
urcrypt/chacha.c \
urcrypt/ed25519.c \
urcrypt/ge_additions.c \
urcrypt/ripemd.c \
urcrypt/scrypt.c \
urcrypt/keccak.c \
urcrypt/secp256k1.c \
urcrypt/sha.c \
urcrypt/util.c \
urcrypt/util.h
# aes-siv (RFC 5297), retargeted from libaes_siv onto nettle
libaes_siv_la_CPPFLAGS = -I$(srcdir)/aes_siv
libaes_siv_la_CFLAGS = $(NETTLE_CFLAGS)
libaes_siv_la_SOURCES = aes_siv/aes_siv.c \
aes_siv/aes_siv.h
# ed25519
libed25519_la_CFLAGS = -Wno-unused-result
libed25519_la_SOURCES = ed25519/src/fixedint.h \
ed25519/src/sha512.h \
ed25519/src/fe.h \
ed25519/src/precomp_data.h \
ed25519/src/sc.h \
ed25519/src/add_scalar.c \
ed25519/src/keypair.c \
ed25519/src/sc.c \
ed25519/src/seed.c \
ed25519/src/verify.c \
ed25519/src/ge.c \
ed25519/src/fe.c \
ed25519/src/key_exchange.c \
ed25519/src/sha512.c \
ed25519/src/sign.c
# ge-additions
libge_additions_la_CPPFLAGS = -I$(srcdir)/ed25519/src
libge_additions_la_CFLAGS = -Werror -pedantic -std=gnu99
libge_additions_la_SOURCES = ge-additions/ge-additions.c
# argon2
libargon2_la_CPPFLAGS = -I$(srcdir)/argon2/include -DARGON2_NO_THREADS
libargon2_la_CFLAGS = -Wno-unused-value -Wno-unused-function
libargon2_la_SOURCES = argon2/src/core.h \
argon2/src/thread.h \
argon2/src/encoding.h \
argon2/src/blake2/blake2-impl.h \
argon2/src/blake2/blamka-round-opt.h \
argon2/src/blake2/blamka-round-ref.h \
argon2/src/argon2.c \
argon2/src/core.c \
argon2/src/blake2/blake2b.c \
argon2/src/thread.c \
argon2/src/encoding.c
# argon2 different sources for different CPU architectures
# opt.c requires SSE instructions and won't work on AArch64 et al.
if ARCH_X86_64
libargon2_la_SOURCES += \
argon2/src/opt.c
endif
if ARCH_GENERIC
libargon2_la_SOURCES += \
argon2/src/ref.c
endif
# blake3
libblake3_la_CPPFLAGS = -I$(srcdir)/blake3
libblake3_la_SOURCES = blake3/blake3.c \
blake3/blake3_dispatch.c \
blake3/blake3_portable.c
if ARCH_X86_64
libblake3_la_SOURCES += \
blake3/blake3_sse2_x86-64_unix.S \
blake3/blake3_sse41_x86-64_unix.S \
blake3/blake3_avx2_x86-64_unix.S \
blake3/blake3_avx512_x86-64_unix.S
endif
if ARCH_GENERIC
libblake3_la_CPPFLAGS += -DBLAKE3_USE_NEON=1
libblake3_la_SOURCES += \
blake3/blake3_neon.c
endif
# monocypher
libmonocypher_la_CPPFLAGS = -I$(srcdir)/monocypher
libmonocypher_la_SOURCES = monocypher/monocypher.c
# scrypt
# Vendored libscrypt uses K&R-style function definitions, which are removed in
# C23. Newer compilers (e.g. recent Apple clang) default to C23 and reject them,
# so pin a pre-C23 standard.
libscrypt_la_CPPFLAGS = -D_FORTIFY_SOURCE=2
libscrypt_la_CFLAGS = -std=gnu17
libscrypt_la_SOURCES = scrypt/b64.c \
scrypt/crypto-mcf.c \
scrypt/crypto-scrypt-saltgen.c \
scrypt/crypto_scrypt-check.c \
scrypt/crypto_scrypt-hash.c \
scrypt/crypto_scrypt-hexconvert.c \
scrypt/crypto_scrypt-nosse.c \
scrypt/main.c \
scrypt/sha256.c \
scrypt/slowequals.c \
scrypt/b64.h \
scrypt/crypto_scrypt-hexconvert.h \
scrypt/slowequals.h \
scrypt/sysendian.h
# keccak-tiny
libkeccak_tiny_la_CFLAGS = -std=c11 -Wextra -Wpedantic -Wall
libkeccak_tiny_la_SOURCES = keccak-tiny/keccak-tiny.c \
keccak-tiny/define-macros.h \
keccak-tiny/keccak-tiny.h
# test suite
TESTS = test_runner
check_PROGRAMS = test_runner
test_runner_SOURCES = tests/test_runner.c \
tests/test_aes.c \
tests/test_argon2.c \
tests/test_blake3.c \
tests/test_ed25519.c \
tests/test_ge_additions.c \
tests/test_keccak.c \
tests/test_monocypher.c \
tests/test_ripemd.c \
tests/test_scrypt.c \
tests/test_secp256k1.c \
tests/test_sha.c
test_runner_CPPFLAGS = -I$(srcdir) \
-I$(srcdir)/ed25519/src \
-I$(srcdir)/ge-additions \
-I$(srcdir)/argon2/include \
-I$(srcdir)/blake3 \
-I$(srcdir)/monocypher \
-I$(srcdir)/keccak-tiny \
-I$(srcdir)/scrypt \
-I$(srcdir)/urcrypt
test_runner_CFLAGS = $(NETTLE_CFLAGS) \
$(LIBSECP256K1_CFLAGS)
test_runner_LDADD = liburcrypt.la \
urcrypt/liburcrypt_la-util.o \
$(NETTLE_LIBS) \
$(LIBSECP256K1_LIBS)