| 1 | ### -*-makefile-*- |
| 2 | ### |
| 3 | ### Build script for symmetric cryptography |
| 4 | ### |
| 5 | ### (c) 2013 Straylight/Edgeware |
| 6 | ### |
| 7 | |
| 8 | ###----- Licensing notice --------------------------------------------------- |
| 9 | ### |
| 10 | ### This file is part of Catacomb. |
| 11 | ### |
| 12 | ### Catacomb is free software; you can redistribute it and/or modify |
| 13 | ### it under the terms of the GNU Library General Public License as |
| 14 | ### published by the Free Software Foundation; either version 2 of the |
| 15 | ### License, or (at your option) any later version. |
| 16 | ### |
| 17 | ### Catacomb is distributed in the hope that it will be useful, |
| 18 | ### but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | ### GNU Library General Public License for more details. |
| 21 | ### |
| 22 | ### You should have received a copy of the GNU Library General Public |
| 23 | ### License along with Catacomb; if not, write to the Free |
| 24 | ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
| 25 | ### MA 02111-1307, USA. |
| 26 | |
| 27 | include $(top_srcdir)/vars.am |
| 28 | |
| 29 | noinst_LTLIBRARIES = libsymm.la |
| 30 | libsymm_la_SOURCES = |
| 31 | nodist_libsymm_la_SOURCES = |
| 32 | |
| 33 | TEST_LIBS = libsymm.la |
| 34 | |
| 35 | VPATH += $(srcdir)/modes |
| 36 | |
| 37 | ###-------------------------------------------------------------------------- |
| 38 | ### Autogenerated lists. |
| 39 | |
| 40 | ## Fancy template substitutions. |
| 41 | multigen = $(PYTHON) $(srcdir)/multigen |
| 42 | EXTRA_DIST += multigen |
| 43 | |
| 44 | ## The heart of this is an enormous cross-product of crypto primitives and |
| 45 | ## the corresponding modes of operation. Rather than write it out longhand, |
| 46 | ## we generate it using `multigen'. Unfortunately, this needs to be done |
| 47 | ## at the Automake level, which causes some interesting bootstrapping |
| 48 | ## problems. |
| 49 | ## |
| 50 | ## Of course, now that we have this machinery for the complicated modes |
| 51 | ## generation, we might as well use it for simpler things. |
| 52 | include modes.am |
| 53 | include stubs.am |
| 54 | |
| 55 | EXTRA_DIST += modes.am.in modes.am |
| 56 | EXTRA_DIST += stubs.am.in stubs.am |
| 57 | MAINTAINERCLEANFILES += $(srcdir)/modes.am |
| 58 | MAINTAINERCLEANFILES += $(srcdir)/stubs.am |
| 59 | |
| 60 | ## Generate the lists. |
| 61 | $(srcdir)/modes.am: modes.am.in Makefile.am |
| 62 | $(AM_V_GEN)$(multigen) -g $(srcdir)/modes.am.in $(srcdir)/modes.am \ |
| 63 | blkc="$(BLKCS)" \ |
| 64 | blkcmode="$(BLKCMODES)" \ |
| 65 | blkcciphermode="$(BLKCCIPHERMODES)" \ |
| 66 | hash="$(HASHES)" \ |
| 67 | hashmode="$(HASHMODES)" \ |
| 68 | hashciphermode="$(HASHCIPHERMODES)" \ |
| 69 | hashmacmode="$(HASHMACMODES)" |
| 70 | $(srcdir)/stubs.am: stubs.am.in Makefile.am |
| 71 | $(AM_V_GEN)$(multigen) -g $(srcdir)/stubs.am.in $(srcdir)/stubs.am \ |
| 72 | descr,hname,base="$(STUBS_HDR)" cname="$(STUBS_SRC)" |
| 73 | |
| 74 | ## Initialize lists of known classes. |
| 75 | ALL_CIPHERS = $(CIPHER_MODES) |
| 76 | ALL_HASHES = $(HASHES) |
| 77 | ALL_MACS = $(MAC_MODES) |
| 78 | |
| 79 | ## Stub headers and sources. |
| 80 | STUBS_HDR = |
| 81 | STUBS_SRC = |
| 82 | |
| 83 | ###-------------------------------------------------------------------------- |
| 84 | ### Block ciphers. |
| 85 | |
| 86 | BLKCS = |
| 87 | BLKCMODES = |
| 88 | |
| 89 | BLKCCIPHERMODES = |
| 90 | BLKCMODES += $(BLKCCIPHERMODES) |
| 91 | |
| 92 | ## A tool for translating the AES-contest test vectors into a form our test |
| 93 | ## rigs understand. |
| 94 | EXTRA_DIST += aes-trans |
| 95 | |
| 96 | ## Block cipher utility macros, mainly used in mode implementations. |
| 97 | pkginclude_HEADERS += blkc.h |
| 98 | |
| 99 | ## Source code and headers for the block ciphers. |
| 100 | libsymm_la_SOURCES += $(BLKC_C) |
| 101 | pkginclude_HEADERS += $(BLKC_H) |
| 102 | |
| 103 | ## Schneier's `Blowfish' block cipher. |
| 104 | BLKCS += blowfish |
| 105 | libsymm_la_SOURCES += $(precomp)/blowfish-tab.c |
| 106 | PRECOMPS += $(precomp)/blowfish-tab.c |
| 107 | PRECOMP_PROGS += blowfish-mktab |
| 108 | blowfish_mktab_CPPFLAGS = $(AM_CPPFLAGS) -DQUIET |
| 109 | if !CROSS_COMPILING |
| 110 | $(precomp)/blowfish-tab.c: |
| 111 | $(AM_V_at)$(MKDIR_P) $(precomp) |
| 112 | $(AM_V_at)$(MAKE) blowfish-mktab$e |
| 113 | $(AM_V_GEN)./blowfish-mktab >$(precomp)/blowfish-tab.c.new && \ |
| 114 | mv $(precomp)/blowfish-tab.c.new $(precomp)/blowfish-tab.c |
| 115 | endif |
| 116 | |
| 117 | ## Adams and Tavares' `CAST' block ciphers. |
| 118 | BLKCS += cast128 cast256 |
| 119 | libsymm_la_SOURCES += cast-s.c cast-sk.c cast-base.h |
| 120 | cast256.$t: t/cast256 |
| 121 | EXTRA_DIST += t/cast256.aes |
| 122 | MAINTAINERCLEANFILES += $(srcdir)/t/cast256 |
| 123 | t/cast256: t/cast256.aes |
| 124 | $(AM_V_GEN)$(srcdir)/aes-trans CAST256 \ |
| 125 | <$(srcdir)/t/cast256.aes \ |
| 126 | >$(srcdir)/t/cast256.new && \ |
| 127 | mv $(srcdir)/t/cast256.new $(srcdir)/t/cast256 |
| 128 | |
| 129 | ## IBM's `DES' block cipher, by Feistel, Coppersmith, and others. |
| 130 | BLKCS += des des3 |
| 131 | libsymm_la_SOURCES += des-base.h $(precomp)/des-tab.c |
| 132 | PRECOMPS += $(precomp)/des-tab.c |
| 133 | PRECOMP_PROGS += des-mktab |
| 134 | if !CROSS_COMPILING |
| 135 | $(precomp)/des-tab.c: |
| 136 | $(AM_V_at)$(MKDIR_P) $(precomp) |
| 137 | $(AM_V_at)$(MAKE) des-mktab$e |
| 138 | $(AM_V_GEN)./des-mktab >$(precomp)/des-tab.c.new && \ |
| 139 | mv $(precomp)/des-tab.c.new $(precomp)/des-tab.c |
| 140 | endif |
| 141 | |
| 142 | ## Rivest's `DESX' variant, with pre- and post-whitening. |
| 143 | BLKCS += desx |
| 144 | libsymm_la_SOURCES += desx-tab.c |
| 145 | |
| 146 | ## Lai and Massey's IDEA. |
| 147 | BLKCS += idea |
| 148 | |
| 149 | ## IBM's `MARS' block cipher. |
| 150 | BLKCS += mars |
| 151 | libsymm_la_SOURCES += $(precomp)/mars-tab.c |
| 152 | PRECOMPS += $(precomp)/mars-tab.c |
| 153 | PRECOMP_PROGS += mars-mktab |
| 154 | if !CROSS_COMPILING |
| 155 | $(precomp)/mars-tab.c: |
| 156 | $(AM_V_at)$(MKDIR_P) $(precomp) |
| 157 | $(AM_V_at)$(MAKE) mars-mktab$e |
| 158 | $(AM_V_GEN)./mars-mktab >$(precomp)/mars-tab.c.new && \ |
| 159 | mv $(precomp)/mars-tab.c.new $(precomp)/mars-tab.c |
| 160 | endif |
| 161 | mars.$t: t/mars |
| 162 | EXTRA_DIST += t/mars.aes |
| 163 | MAINTAINERCLEANFILES += $(srcdir)/t/mars |
| 164 | t/mars: t/mars.aes |
| 165 | $(AM_V_GEN)$(srcdir)/aes-trans Mars \ |
| 166 | <$(srcdir)/t/mars.aes \ |
| 167 | >$(srcdir)/t/mars.new && \ |
| 168 | mv $(srcdir)/t/mars.new $(srcdir)/t/mars |
| 169 | |
| 170 | ## Daemen, Peeters, Van Assche and Rijmen's `Noekeon'. |
| 171 | BLKCS += noekeon |
| 172 | |
| 173 | ## Rivest's `RC2' block cipher. |
| 174 | BLKCS += rc2 |
| 175 | libsymm_la_SOURCES += rc2-tab.c |
| 176 | |
| 177 | ## Rivest's `RC5'. |
| 178 | BLKCS += rc5 |
| 179 | |
| 180 | ## Daemen and Rijmen's `Rijndael' block cipher, selected as AES. |
| 181 | BLKCS += rijndael rijndael192 rijndael256 |
| 182 | libsymm_la_SOURCES += rijndael-base.h rijndael-base.c |
| 183 | if CPUFAM_X86 |
| 184 | libsymm_la_SOURCES += rijndael-x86ish-aesni.S |
| 185 | endif |
| 186 | if CPUFAM_AMD64 |
| 187 | libsymm_la_SOURCES += rijndael-x86ish-aesni.S |
| 188 | endif |
| 189 | libsymm_la_SOURCES += $(precomp)/rijndael-tab.c |
| 190 | PRECOMPS += $(precomp)/rijndael-tab.c |
| 191 | PRECOMP_PROGS += rijndael-mktab |
| 192 | if !CROSS_COMPILING |
| 193 | $(precomp)/rijndael-tab.c: |
| 194 | $(AM_V_at)$(MKDIR_P) $(precomp) |
| 195 | $(AM_V_at)$(MAKE) rijndael-mktab$e |
| 196 | $(AM_V_GEN)./rijndael-mktab >$(precomp)/rijndael-tab.c.new && \ |
| 197 | mv $(precomp)/rijndael-tab.c.new $(precomp)/rijndael-tab.c |
| 198 | endif |
| 199 | rijndael.$t: t/rijndael |
| 200 | EXTRA_DIST += t/rijndael.aes |
| 201 | MAINTAINERCLEANFILES += $(srcdir)/t/rijndael |
| 202 | t/rijndael: t/rijndael.aes |
| 203 | $(AM_V_GEN)$(srcdir)/aes-trans Rijndael \ |
| 204 | <$(srcdir)/t/rijndael.aes \ |
| 205 | >$(srcdir)/t/rijndael.new && \ |
| 206 | mv $(srcdir)/t/rijndael.new $(srcdir)/t/rijndael |
| 207 | |
| 208 | ## Massey's `SAFER' block ciphers. |
| 209 | BLKCS += safer safersk |
| 210 | libsymm_la_SOURCES += $(precomp)/safer-tab.c |
| 211 | PRECOMPS += $(precomp)/safer-tab.c |
| 212 | PRECOMP_PROGS += safer-mktab |
| 213 | STUBS_HDR += SAFER-SK,safersk,safer |
| 214 | if !CROSS_COMPILING |
| 215 | $(precomp)/safer-tab.c: |
| 216 | $(AM_V_at)$(MKDIR_P) $(precomp) |
| 217 | $(AM_V_at)$(MAKE) safer-mktab$e |
| 218 | $(AM_V_GEN)./safer-mktab >$(precomp)/safer-tab.c.new && \ |
| 219 | mv $(precomp)/safer-tab.c.new $(precomp)/safer-tab.c |
| 220 | endif |
| 221 | |
| 222 | ## Anderson, Biham and Knudsen's `Serpent' block cipher. |
| 223 | BLKCS += serpent |
| 224 | libsymm_la_SOURCES += serpent-sbox.h |
| 225 | check_PROGRAMS += serpent-check |
| 226 | TESTS += serpent-check |
| 227 | serpent.$t: t/serpent |
| 228 | EXTRA_DIST += t/serpent.aes |
| 229 | MAINTAINERCLEANFILES += $(srcdir)/t/serpent |
| 230 | t/serpent: t/serpent.aes |
| 231 | $(AM_V_GEN)$(srcdir)/aes-trans Serpent -v rev=1 \ |
| 232 | <$(srcdir)/t/serpent.aes \ |
| 233 | >$(srcdir)/t/serpent.new && \ |
| 234 | mv $(srcdir)/t/serpent.new $(srcdir)/t/serpent |
| 235 | |
| 236 | ## The National Security Agency's `Skipjack' block cipher. You don't want to |
| 237 | ## use this. |
| 238 | BLKCS += skipjack |
| 239 | libsymm_la_SOURCES += skipjack-tab.c |
| 240 | |
| 241 | ## Daemen and Rijmen's `Square' block cipher. |
| 242 | BLKCS += square |
| 243 | libsymm_la_SOURCES += $(precomp)/square-tab.c |
| 244 | PRECOMPS += $(precomp)/square-tab.c |
| 245 | PRECOMP_PROGS += square-mktab |
| 246 | if !CROSS_COMPILING |
| 247 | $(precomp)/square-tab.c: |
| 248 | $(AM_V_at)$(MKDIR_P) $(precomp) |
| 249 | $(AM_V_at)$(MAKE) square-mktab$e |
| 250 | $(AM_V_GEN)./square-mktab >$(precomp)/square-tab.c.new && \ |
| 251 | mv $(precomp)/square-tab.c.new $(precomp)/square-tab.c |
| 252 | endif |
| 253 | |
| 254 | ## Wheeler and Needham's `TEA' and `XTEA' block ciphers. |
| 255 | BLKCS += tea xtea |
| 256 | |
| 257 | ## Schneier, Kelsey, Whiting, Wagner, Hall and Ferguson's `Twofish' block |
| 258 | ## cipher. |
| 259 | BLKCS += twofish |
| 260 | libsymm_la_SOURCES += $(precomp)/twofish-tab.c |
| 261 | PRECOMPS += $(precomp)/twofish-tab.c |
| 262 | PRECOMP_PROGS += twofish-mktab |
| 263 | if !CROSS_COMPILING |
| 264 | $(precomp)/twofish-tab.c: |
| 265 | $(AM_V_at)$(MKDIR_P) $(precomp) |
| 266 | $(AM_V_at)$(MAKE) twofish-mktab$e |
| 267 | $(AM_V_GEN)./twofish-mktab >$(precomp)/twofish-tab.c.new && \ |
| 268 | mv $(precomp)/twofish-tab.c.new $(precomp)/twofish-tab.c |
| 269 | endif |
| 270 | twofish.$t: t/twofish |
| 271 | EXTRA_DIST += t/twofish.aes |
| 272 | MAINTAINERCLEANFILES += $(srcdir)/t/twofish |
| 273 | t/twofish: t/twofish.aes |
| 274 | $(AM_V_GEN)$(srcdir)/aes-trans Twofish \ |
| 275 | <$(srcdir)/t/twofish.aes \ |
| 276 | >$(srcdir)/t/twofish.new && \ |
| 277 | mv $(srcdir)/t/twofish.new $(srcdir)/t/twofish |
| 278 | |
| 279 | ## The old NIST modes for DES. |
| 280 | BLKCCIPHERMODES += cbc cfb ecb ofb |
| 281 | |
| 282 | ## Counter mode. |
| 283 | BLKCCIPHERMODES += counter |
| 284 | |
| 285 | ###-------------------------------------------------------------------------- |
| 286 | ### Hash functions. |
| 287 | |
| 288 | HASHES = |
| 289 | HASHMODES = |
| 290 | |
| 291 | HASHCIPHERMODES = |
| 292 | HASHMODES += $(HASHCIPHERMODES) |
| 293 | |
| 294 | HASHMACMODES = |
| 295 | HASHMODES += $(HASHMACMODES) |
| 296 | |
| 297 | ## Common definitions for hash functions. |
| 298 | pkginclude_HEADERS += hash.h |
| 299 | |
| 300 | ## Source code and headers for the hash functions. |
| 301 | libsymm_la_SOURCES += $(HASH_C) |
| 302 | pkginclude_HEADERS += $(HASH_H) |
| 303 | |
| 304 | ## Lim and KISA's `HAS-160', recommended for use with KCDSA. |
| 305 | HASHES += has160 |
| 306 | |
| 307 | ## Rivest's `MD' series of hash functions |
| 308 | HASHES += md2 md4 md5 |
| 309 | libsymm_la_SOURCES += md2-tab.c |
| 310 | |
| 311 | ## Dobbertin, Bosselaers and Preneel's `RIPEMD' suite. |
| 312 | HASHES += rmd128 rmd160 rmd256 rmd320 |
| 313 | |
| 314 | ## The National Security Agency's `SHA-1' hash function. |
| 315 | HASHES += sha |
| 316 | |
| 317 | ## The National Security Agency's `SHA-2' suite. |
| 318 | HASHES += sha224 sha256 |
| 319 | HASHES += sha384 sha512 |
| 320 | STUBS_HDR += SHA-224,sha224,sha256 |
| 321 | STUBS_HDR += SHA-384,sha384,sha512 |
| 322 | |
| 323 | ## Anderson and Biham's `Tiger' hash function. |
| 324 | HASHES += tiger |
| 325 | libsymm_la_SOURCES += tiger-base.h $(precomp)/tiger-tab.c |
| 326 | PRECOMPS += $(precomp)/tiger-tab.c |
| 327 | PRECOMP_PROGS += tiger-mktab |
| 328 | if !CROSS_COMPILING |
| 329 | $(precomp)/tiger-tab.c: |
| 330 | $(AM_V_at)$(MKDIR_P) $(precomp) |
| 331 | $(AM_V_at)$(MAKE) tiger-mktab$e |
| 332 | $(AM_V_GEN)./tiger-mktab >$(precomp)/tiger-tab.c.new && \ |
| 333 | mv $(precomp)/tiger-tab.c.new $(precomp)/tiger-tab.c |
| 334 | endif |
| 335 | |
| 336 | ## Barreto and Rijmen's `Whirlpool' hash function. |
| 337 | HASHES += whirlpool whirlpool256 |
| 338 | libsymm_la_SOURCES += $(precomp)/whirlpool-tab.c |
| 339 | PRECOMPS += $(precomp)/whirlpool-tab.c |
| 340 | PRECOMP_PROGS += whirlpool-mktab |
| 341 | STUBS_HDR += Whirlpool-256,whirlpool256,whirlpool |
| 342 | if !CROSS_COMPILING |
| 343 | $(precomp)/whirlpool-tab.c: |
| 344 | $(AM_V_at)$(MKDIR_P) $(precomp) |
| 345 | $(AM_V_at)$(MAKE) whirlpool-mktab$e |
| 346 | $(AM_V_GEN)./whirlpool-mktab >$(precomp)/whirlpool-tab.c.new && \ |
| 347 | mv $(precomp)/whirlpool-tab.c.new $(precomp)/whirlpool-tab.c |
| 348 | endif |
| 349 | |
| 350 | ## Bellare, Canetti and Krawczyk's `HMAC' mode for message authentication. |
| 351 | HASHMACMODES += hmac |
| 352 | |
| 353 | ## MGF1, used in OAEP and PSS. |
| 354 | HASHCIPHERMODES += mgf |
| 355 | |
| 356 | ###-------------------------------------------------------------------------- |
| 357 | ### Other symmetric primitives. |
| 358 | |
| 359 | ## The CRC32 algorithm, which is useful, but has no worthwhile security. |
| 360 | pkginclude_HEADERS += crc32.h |
| 361 | libsymm_la_SOURCES += crc32.c |
| 362 | ALL_HASHES += crc32=gcrc32 |
| 363 | |
| 364 | ## Rivest's `RC4' stream cipher. |
| 365 | pkginclude_HEADERS += rc4.h |
| 366 | libsymm_la_SOURCES += rc4.c |
| 367 | TESTS += rc4.$t |
| 368 | EXTRA_DIST += t/rc4 |
| 369 | ALL_CIPHERS += rc4 |
| 370 | |
| 371 | ## Coppersmith and Rogaway's `SEAL' pseudorandom function. |
| 372 | pkginclude_HEADERS += seal.h |
| 373 | libsymm_la_SOURCES += seal.c |
| 374 | TESTS += seal.$t |
| 375 | EXTRA_DIST += t/seal |
| 376 | ALL_CIPHERS += seal |
| 377 | |
| 378 | ## Bernstein's `Salsa20' stream cipher. Most of the test vectors come from |
| 379 | ## the eSTREAM project, captured by the Internet Archive's Wayback Machine at |
| 380 | ## |
| 381 | ## http://web.archive.org/web/20070814004154/http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20.tar.gz?view=tar |
| 382 | ## |
| 383 | ## and automatically converted into the format we want. |
| 384 | EXTRA_DIST += salsa20-tvconv |
| 385 | pkginclude_HEADERS += salsa20.h salsa20-core.h |
| 386 | libsymm_la_SOURCES += salsa20.c |
| 387 | if CPUFAM_X86 |
| 388 | libsymm_la_SOURCES += salsa20-x86ish-sse2.S |
| 389 | endif |
| 390 | if CPUFAM_AMD64 |
| 391 | libsymm_la_SOURCES += salsa20-x86ish-sse2.S |
| 392 | endif |
| 393 | TESTS += salsa20.$t |
| 394 | ALL_CIPHERS += salsa20 salsa2012 salsa208 |
| 395 | ALL_CIPHERS += xsalsa20 xsalsa2012 xsalsa208 |
| 396 | STUBS_HDR += Salsa20/12,salsa2012,salsa20 |
| 397 | STUBS_HDR += Salsa20/8,salsa208,salsa20 |
| 398 | STUBS_HDR += XSalsa20,xsalsa20,salsa20 |
| 399 | STUBS_HDR += XSalsa20/12,xsalsa2012,salsa20 |
| 400 | STUBS_HDR += XSalsa20/8,xsalsa208,salsa20 |
| 401 | EXTRA_DIST += t/salsa20 |
| 402 | MAINTAINERCLEANFILES += t/salsa20 |
| 403 | salsa20.$t: t/salsa20 |
| 404 | SALSA20_ESTREAM_TV = t/salsa20.estream |
| 405 | SALSA20_ESTREAM_TV += t/salsa2012.estream |
| 406 | SALSA20_ESTREAM_TV += t/salsa208.estream |
| 407 | EXTRA_DIST += t/salsa20.local $(SALSA20_ESTREAM_TV) |
| 408 | t/salsa20: salsa20-tvconv t/salsa20.local $(SALSA20_ESTREAM_TV) |
| 409 | $(AM_V_GEN)cd $(srcdir) && \ |
| 410 | { echo "### GENERATED by salsa20-tvconv" && \ |
| 411 | cat t/salsa20.local && \ |
| 412 | ./salsa20-tvconv $(SALSA20_ESTREAM_TV); \ |
| 413 | } >t/salsa20.new && \ |
| 414 | mv t/salsa20.new t/salsa20 |
| 415 | |
| 416 | ## Bernstein's `ChaCha' stream cipher. |
| 417 | pkginclude_HEADERS += chacha.h chacha-core.h |
| 418 | libsymm_la_SOURCES += chacha.c |
| 419 | if CPUFAM_X86 |
| 420 | libsymm_la_SOURCES += chacha-x86ish-sse2.S |
| 421 | endif |
| 422 | if CPUFAM_AMD64 |
| 423 | libsymm_la_SOURCES += chacha-x86ish-sse2.S |
| 424 | endif |
| 425 | TESTS += chacha.$t |
| 426 | EXTRA_DIST += t/chacha |
| 427 | ALL_CIPHERS += chacha20 chacha12 chacha8 |
| 428 | ALL_CIPHERS += xchacha20 xchacha12 xchacha8 |
| 429 | STUBS_HDR += ChaCha20,chacha20,chacha |
| 430 | STUBS_HDR += ChaCha12,chacha12,chacha |
| 431 | STUBS_HDR += ChaCha8,chacha8,chacha |
| 432 | STUBS_HDR += XChaCha20,xchacha20,chacha |
| 433 | STUBS_HDR += XChaCha12,xchacha12,chacha |
| 434 | STUBS_HDR += XChaCha8,xchacha8,chacha |
| 435 | |
| 436 | ###-------------------------------------------------------------------------- |
| 437 | ### Autogenerated mode implementations. |
| 438 | |
| 439 | ## The master stamp file, indicating that we generated all of the sources. |
| 440 | EXTRA_DIST += mode.h.in mode.c.in |
| 441 | EXTRA_DIST += modes/gen-stamp |
| 442 | MAINTAINERCLEANFILES += modes/gen-stamp |
| 443 | modes/gen-stamp: Makefile.am |
| 444 | $(AM_V_at)$(MKDIR_P) $(srcdir)/modes |
| 445 | $(AM_V_GEN)$(multigen) -g $(srcdir)/mode.c.in \ |
| 446 | $(srcdir)/modes/@base-@mode.c \ |
| 447 | base="$(BLKCS)" mode="$(BLKCMODES)" |
| 448 | $(AM_V_at)$(multigen) -g $(srcdir)/mode.h.in \ |
| 449 | $(srcdir)/modes/@base-@mode.h \ |
| 450 | base="$(BLKCS)" mode="$(BLKCMODES)" |
| 451 | $(AM_V_at)$(multigen) -g $(srcdir)/mode.c.in \ |
| 452 | $(srcdir)/modes/@base-@mode.c \ |
| 453 | base="$(HASHES)" mode="$(HASHMODES)" |
| 454 | $(AM_V_at)$(multigen) -g $(srcdir)/mode.h.in \ |
| 455 | $(srcdir)/modes/@base-@mode.h \ |
| 456 | base="$(HASHES)" mode="$(HASHMODES)" |
| 457 | $(AM_V_at)touch $(srcdir)/modes/gen-stamp |
| 458 | |
| 459 | ## The individual mode interfaces and implementations. |
| 460 | pkginclude_HEADERS += $(MODE_H) |
| 461 | |
| 462 | ## Generated implementations. |
| 463 | BUILT_SOURCES += $(GENMODES_C) |
| 464 | MAINTAINERCLEANFILES += $(GENMODES_C) |
| 465 | libsymm_la_SOURCES += $(GENMODES_C) |
| 466 | $(GENMODES_C): modes/gen-stamp |
| 467 | |
| 468 | ## Generated interfaces. |
| 469 | BUILT_SOURCES += $(GENMODES_H) |
| 470 | MAINTAINERCLEANFILES += $(GENMODES_H) |
| 471 | pkginclude_HEADERS += $(GENMODES_H) |
| 472 | $(GENMODES_H): modes/gen-stamp |
| 473 | |
| 474 | ###-------------------------------------------------------------------------- |
| 475 | ### Autogenerated stub headers. |
| 476 | |
| 477 | ## The master stamp file. |
| 478 | EXTRA_DIST += stub.h.in |
| 479 | EXTRA_DIST += stubs.gen-stamp |
| 480 | MAINTAINERCLEANFILES += stubs.gen-stamp |
| 481 | stubs.gen-stamp: Makefile.am |
| 482 | $(AM_V_at)$(MKDIR_P) $(srcdir)/stubs |
| 483 | $(AM_V_GEN)$(multigen) -g $(srcdir)/stub.h.in \ |
| 484 | $(srcdir)/@name.h descr,name,base="$(STUBS_HDR)" |
| 485 | $(AM_V_GEN)$(multigen) -g $(srcdir)/stub.c.in \ |
| 486 | $(srcdir)/@name.c name="$(STUBS_SRC)" |
| 487 | $(AM_V_at)touch $(srcdir)/stubs.gen-stamp |
| 488 | |
| 489 | ## Generated stub headers. |
| 490 | BUILT_SOURCES += $(STUB_H) $(STUB_C) |
| 491 | MAINTAINERCLEANFILES += $(STUB_H) $(STUB_C) |
| 492 | pkginclude_HEADERS += $(STUB_H) |
| 493 | $(STUB_H) $(STUB_C): stubs.gen-stamp |
| 494 | |
| 495 | ###-------------------------------------------------------------------------- |
| 496 | ### Tables of classes for encryption, hashing, and message authentication. |
| 497 | |
| 498 | ## The skeleton for the class tables. |
| 499 | EXTRA_DIST += gthingtab.c.in |
| 500 | |
| 501 | ## Table of cipher classes. |
| 502 | pkginclude_HEADERS += gcipher.h |
| 503 | CLEANFILES += gciphertab.c |
| 504 | nodist_libsymm_la_SOURCES += gciphertab.c |
| 505 | gciphertab.c: gthingtab.c.in Makefile.am |
| 506 | $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in gciphertab.c \ |
| 507 | what=gcipher cls=gccipher thing="$(ALL_CIPHERS)" |
| 508 | |
| 509 | ## Table of hash classes. |
| 510 | pkginclude_HEADERS += ghash.h ghash-def.h |
| 511 | CLEANFILES += ghashtab.c |
| 512 | nodist_libsymm_la_SOURCES += ghashtab.c |
| 513 | ghashtab.c: gthingtab.c.in Makefile.am |
| 514 | $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in ghashtab.c \ |
| 515 | what=ghash cls=gchash thing="$(ALL_HASHES)" |
| 516 | |
| 517 | ## Table of MAC classes. |
| 518 | pkginclude_HEADERS += gmac.h |
| 519 | CLEANFILES += gmactab.c |
| 520 | nodist_libsymm_la_SOURCES += gmactab.c |
| 521 | gmactab.c: gthingtab.c.in Makefile.am |
| 522 | $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in gmactab.c \ |
| 523 | what=gmac cls=gcmac thing="$(ALL_MACS)" |
| 524 | |
| 525 | ###-------------------------------------------------------------------------- |
| 526 | ### Testing. |
| 527 | |
| 528 | ## Run the test programs. |
| 529 | TESTS += $(SYMM_TESTS) |
| 530 | EXTRA_DIST += $(SYMM_TEST_FILES) |
| 531 | |
| 532 | ## A piece of sample text for round-trip testing encryption modes. |
| 533 | EXTRA_DIST += daftstory.h |
| 534 | |
| 535 | ## Clean the debris from the `modes' subdirectory. |
| 536 | CLEANFILES += modes/*.to modes/*.$t |
| 537 | |
| 538 | ###----- That's all, folks -------------------------------------------------- |