| 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,cbase="$(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 | nodist_libsymm_la_SOURCES += ../precomp/symm/blowfish-tab.c |
| 106 | PRECOMPS += $(precomp)/symm/blowfish-tab.c |
| 107 | PRECOMP_PROGS += blowfish-mktab |
| 108 | blowfish_mktab_CPPFLAGS = $(AM_CPPFLAGS) -DQUIET |
| 109 | if !CROSS_COMPILING |
| 110 | $(precomp)/symm/blowfish-tab.c: |
| 111 | $(AM_V_at)$(MKDIR_P) $(precomp)/symm |
| 112 | $(AM_V_at)$(MAKE) blowfish-mktab$(EXEEXT) |
| 113 | $(AM_V_GEN)./blowfish-mktab >$(precomp)/symm/blowfish-tab.c.new && \ |
| 114 | mv $(precomp)/symm/blowfish-tab.c.new \ |
| 115 | $(precomp)/symm/blowfish-tab.c |
| 116 | endif |
| 117 | |
| 118 | ## Adams and Tavares' `CAST' block ciphers. |
| 119 | BLKCS += cast128 cast256 |
| 120 | libsymm_la_SOURCES += cast-s.c cast-sk.c cast-base.h |
| 121 | cast256.log: t/cast256 |
| 122 | EXTRA_DIST += t/cast256.aes |
| 123 | MAINTAINERCLEANFILES += $(srcdir)/t/cast256 |
| 124 | t/cast256: t/cast256.aes |
| 125 | $(AM_V_GEN)$(srcdir)/aes-trans CAST256 \ |
| 126 | <$(srcdir)/t/cast256.aes \ |
| 127 | >$(srcdir)/t/cast256.new && \ |
| 128 | mv $(srcdir)/t/cast256.new $(srcdir)/t/cast256 |
| 129 | |
| 130 | ## IBM's `DES' block cipher, by Feistel, Coppersmith, and others. |
| 131 | BLKCS += des des3 |
| 132 | libsymm_la_SOURCES += des-base.h |
| 133 | nodist_libsymm_la_SOURCES += ../precomp/symm/des-tab.c |
| 134 | PRECOMPS += $(precomp)/symm/des-tab.c |
| 135 | PRECOMP_PROGS += des-mktab |
| 136 | if !CROSS_COMPILING |
| 137 | $(precomp)/symm/des-tab.c: |
| 138 | $(AM_V_at)$(MKDIR_P) $(precomp)/symm |
| 139 | $(AM_V_at)$(MAKE) des-mktab$(EXEEXT) |
| 140 | $(AM_V_GEN)./des-mktab >$(precomp)/symm/des-tab.c.new && \ |
| 141 | mv $(precomp)/symm/des-tab.c.new $(precomp)/symm/des-tab.c |
| 142 | endif |
| 143 | |
| 144 | ## Rivest's `DESX' variant, with pre- and post-whitening. |
| 145 | BLKCS += desx |
| 146 | libsymm_la_SOURCES += desx-tab.c |
| 147 | |
| 148 | ## Lai and Massey's IDEA. |
| 149 | BLKCS += idea |
| 150 | |
| 151 | ## IBM's `MARS' block cipher. |
| 152 | BLKCS += mars |
| 153 | nodist_libsymm_la_SOURCES += ../precomp/symm/mars-tab.c |
| 154 | PRECOMPS += $(precomp)/symm/mars-tab.c |
| 155 | PRECOMP_PROGS += mars-mktab |
| 156 | if !CROSS_COMPILING |
| 157 | $(precomp)/symm/mars-tab.c: |
| 158 | $(AM_V_at)$(MKDIR_P) $(precomp)/symm |
| 159 | $(AM_V_at)$(MAKE) mars-mktab$(EXEEXT) |
| 160 | $(AM_V_GEN)./mars-mktab >$(precomp)/symm/mars-tab.c.new && \ |
| 161 | mv $(precomp)/symm/mars-tab.c.new $(precomp)/symm/mars-tab.c |
| 162 | endif |
| 163 | mars.log: t/mars |
| 164 | EXTRA_DIST += t/mars.aes |
| 165 | MAINTAINERCLEANFILES += $(srcdir)/t/mars |
| 166 | t/mars: t/mars.aes |
| 167 | $(AM_V_GEN)$(srcdir)/aes-trans Mars \ |
| 168 | <$(srcdir)/t/mars.aes \ |
| 169 | >$(srcdir)/t/mars.new && \ |
| 170 | mv $(srcdir)/t/mars.new $(srcdir)/t/mars |
| 171 | |
| 172 | ## Daemen, Peeters, Van Assche and Rijmen's `Noekeon'. |
| 173 | BLKCS += noekeon |
| 174 | |
| 175 | ## Rivest's `RC2' block cipher. |
| 176 | BLKCS += rc2 |
| 177 | libsymm_la_SOURCES += rc2-tab.c |
| 178 | |
| 179 | ## Rivest's `RC5'. |
| 180 | BLKCS += rc5 |
| 181 | |
| 182 | ## Daemen and Rijmen's `Rijndael' block cipher, selected as AES. |
| 183 | BLKCS += rijndael rijndael192 rijndael256 |
| 184 | libsymm_la_SOURCES += rijndael-base.h rijndael-base.c |
| 185 | if CPUFAM_X86 |
| 186 | libsymm_la_SOURCES += rijndael-x86ish-aesni.S |
| 187 | endif |
| 188 | if CPUFAM_AMD64 |
| 189 | libsymm_la_SOURCES += rijndael-x86ish-aesni.S |
| 190 | endif |
| 191 | if HAVE_AS_ARMV8_CRYPTO |
| 192 | if CPUFAM_ARMEL |
| 193 | libsymm_la_SOURCES += rijndael-arm-crypto.S |
| 194 | endif |
| 195 | endif |
| 196 | nodist_libsymm_la_SOURCES += ../precomp/symm/rijndael-tab.c |
| 197 | PRECOMPS += $(precomp)/symm/rijndael-tab.c |
| 198 | PRECOMP_PROGS += rijndael-mktab |
| 199 | if !CROSS_COMPILING |
| 200 | $(precomp)/symm/rijndael-tab.c: |
| 201 | $(AM_V_at)$(MKDIR_P) $(precomp)/symm |
| 202 | $(AM_V_at)$(MAKE) rijndael-mktab$(EXEEXT) |
| 203 | $(AM_V_GEN)./rijndael-mktab >$(precomp)/symm/rijndael-tab.c.new && \ |
| 204 | mv $(precomp)/symm/rijndael-tab.c.new \ |
| 205 | $(precomp)/symm/rijndael-tab.c |
| 206 | endif |
| 207 | rijndael.log: t/rijndael |
| 208 | EXTRA_DIST += t/rijndael.aes |
| 209 | MAINTAINERCLEANFILES += $(srcdir)/t/rijndael |
| 210 | t/rijndael: t/rijndael.aes |
| 211 | $(AM_V_GEN)$(srcdir)/aes-trans Rijndael \ |
| 212 | <$(srcdir)/t/rijndael.aes \ |
| 213 | >$(srcdir)/t/rijndael.new && \ |
| 214 | mv $(srcdir)/t/rijndael.new $(srcdir)/t/rijndael |
| 215 | |
| 216 | ## Massey's `SAFER' block ciphers. |
| 217 | BLKCS += safer safersk |
| 218 | nodist_libsymm_la_SOURCES += ../precomp/symm/safer-tab.c |
| 219 | PRECOMPS += $(precomp)/symm/safer-tab.c |
| 220 | PRECOMP_PROGS += safer-mktab |
| 221 | STUBS_HDR += SAFER-SK,safersk,safer |
| 222 | STUBS_SRC += safersk,safer |
| 223 | if !CROSS_COMPILING |
| 224 | $(precomp)/symm/safer-tab.c: |
| 225 | $(AM_V_at)$(MKDIR_P) $(precomp)/symm |
| 226 | $(AM_V_at)$(MAKE) safer-mktab$(EXEEXT) |
| 227 | $(AM_V_GEN)./safer-mktab >$(precomp)/symm/safer-tab.c.new && \ |
| 228 | mv $(precomp)/symm/safer-tab.c.new \ |
| 229 | $(precomp)/symm/safer-tab.c |
| 230 | endif |
| 231 | |
| 232 | ## Anderson, Biham and Knudsen's `Serpent' block cipher. |
| 233 | BLKCS += serpent |
| 234 | libsymm_la_SOURCES += serpent-sbox.h |
| 235 | check_PROGRAMS += serpent-check |
| 236 | TESTS += serpent-check |
| 237 | serpent.log: t/serpent |
| 238 | EXTRA_DIST += t/serpent.aes |
| 239 | MAINTAINERCLEANFILES += $(srcdir)/t/serpent |
| 240 | t/serpent: t/serpent.aes |
| 241 | $(AM_V_GEN)$(srcdir)/aes-trans Serpent -v rev=1 \ |
| 242 | <$(srcdir)/t/serpent.aes \ |
| 243 | >$(srcdir)/t/serpent.new && \ |
| 244 | mv $(srcdir)/t/serpent.new $(srcdir)/t/serpent |
| 245 | |
| 246 | ## The National Security Agency's `Skipjack' block cipher. You don't want to |
| 247 | ## use this. |
| 248 | BLKCS += skipjack |
| 249 | libsymm_la_SOURCES += skipjack-tab.c |
| 250 | |
| 251 | ## Daemen and Rijmen's `Square' block cipher. |
| 252 | BLKCS += square |
| 253 | nodist_libsymm_la_SOURCES += ../precomp/symm/square-tab.c |
| 254 | PRECOMPS += $(precomp)/symm/square-tab.c |
| 255 | PRECOMP_PROGS += square-mktab |
| 256 | if !CROSS_COMPILING |
| 257 | $(precomp)/symm/square-tab.c: |
| 258 | $(AM_V_at)$(MKDIR_P) $(precomp)/symm |
| 259 | $(AM_V_at)$(MAKE) square-mktab$(EXEEXT) |
| 260 | $(AM_V_GEN)./square-mktab >$(precomp)/symm/square-tab.c.new && \ |
| 261 | mv $(precomp)/symm/square-tab.c.new \ |
| 262 | $(precomp)/symm/square-tab.c |
| 263 | endif |
| 264 | |
| 265 | ## Wheeler and Needham's `TEA' and `XTEA' block ciphers. |
| 266 | BLKCS += tea xtea |
| 267 | |
| 268 | ## Schneier, Kelsey, Whiting, Wagner, Hall and Ferguson's `Twofish' block |
| 269 | ## cipher. |
| 270 | BLKCS += twofish |
| 271 | nodist_libsymm_la_SOURCES += ../precomp/symm/twofish-tab.c |
| 272 | PRECOMPS += $(precomp)/symm/twofish-tab.c |
| 273 | PRECOMP_PROGS += twofish-mktab |
| 274 | if !CROSS_COMPILING |
| 275 | $(precomp)/symm/twofish-tab.c: |
| 276 | $(AM_V_at)$(MKDIR_P) $(precomp)/symm |
| 277 | $(AM_V_at)$(MAKE) twofish-mktab$(EXEEXT) |
| 278 | $(AM_V_GEN)./twofish-mktab >$(precomp)/symm/twofish-tab.c.new && \ |
| 279 | mv $(precomp)/symm/twofish-tab.c.new \ |
| 280 | $(precomp)/symm/twofish-tab.c |
| 281 | endif |
| 282 | twofish.log: t/twofish |
| 283 | EXTRA_DIST += t/twofish.aes |
| 284 | MAINTAINERCLEANFILES += $(srcdir)/t/twofish |
| 285 | t/twofish: t/twofish.aes |
| 286 | $(AM_V_GEN)$(srcdir)/aes-trans Twofish \ |
| 287 | <$(srcdir)/t/twofish.aes \ |
| 288 | >$(srcdir)/t/twofish.new && \ |
| 289 | mv $(srcdir)/t/twofish.new $(srcdir)/t/twofish |
| 290 | |
| 291 | ## The old NIST modes for DES. |
| 292 | BLKCCIPHERMODES += cbc cfb ecb ofb |
| 293 | |
| 294 | ## Counter mode. |
| 295 | BLKCCIPHERMODES += counter |
| 296 | |
| 297 | ###-------------------------------------------------------------------------- |
| 298 | ### Hash functions. |
| 299 | |
| 300 | HASHES = |
| 301 | HASHMODES = |
| 302 | |
| 303 | HASHCIPHERMODES = |
| 304 | HASHMODES += $(HASHCIPHERMODES) |
| 305 | |
| 306 | HASHMACMODES = |
| 307 | HASHMODES += $(HASHMACMODES) |
| 308 | |
| 309 | ## Common definitions for hash functions. |
| 310 | pkginclude_HEADERS += hash.h |
| 311 | |
| 312 | ## Source code and headers for the hash functions. |
| 313 | libsymm_la_SOURCES += $(HASH_C) |
| 314 | pkginclude_HEADERS += $(HASH_H) |
| 315 | |
| 316 | ## Lim and KISA's `HAS-160', recommended for use with KCDSA. |
| 317 | HASHES += has160 |
| 318 | |
| 319 | ## Rivest's `MD' series of hash functions |
| 320 | HASHES += md2 md4 md5 |
| 321 | libsymm_la_SOURCES += md2-tab.c |
| 322 | |
| 323 | ## Dobbertin, Bosselaers and Preneel's `RIPEMD' suite. |
| 324 | HASHES += rmd128 rmd160 rmd256 rmd320 |
| 325 | |
| 326 | ## The National Security Agency's `SHA-1' hash function. |
| 327 | HASHES += sha |
| 328 | |
| 329 | ## The National Security Agency's `SHA-2' suite. |
| 330 | HASHES += sha224 sha256 |
| 331 | HASHES += sha384 sha512 sha512/224 sha512/256 |
| 332 | STUBS_HDR += SHA-224,sha224,sha256 |
| 333 | STUBS_HDR += SHA-384,sha384,sha512 |
| 334 | STUBS_HDR += SHA-512/256,sha512-256,sha512 |
| 335 | STUBS_HDR += SHA-512/224,sha512-224,sha512 |
| 336 | STUBS_SRC += sha224,sha256 |
| 337 | STUBS_SRC += sha384,sha512 |
| 338 | STUBS_SRC += sha512-256,sha512 |
| 339 | STUBS_SRC += sha512-224,sha512 |
| 340 | |
| 341 | ## Anderson and Biham's `Tiger' hash function. |
| 342 | HASHES += tiger |
| 343 | libsymm_la_SOURCES += tiger-base.h |
| 344 | nodist_libsymm_la_SOURCES += ../precomp/symm/tiger-tab.c |
| 345 | PRECOMPS += $(precomp)/symm/tiger-tab.c |
| 346 | PRECOMP_PROGS += tiger-mktab |
| 347 | if !CROSS_COMPILING |
| 348 | $(precomp)/symm/tiger-tab.c: |
| 349 | $(AM_V_at)$(MKDIR_P) $(precomp)/symm |
| 350 | $(AM_V_at)$(MAKE) tiger-mktab$(EXEEXT) |
| 351 | $(AM_V_GEN)./tiger-mktab >$(precomp)/symm/tiger-tab.c.new && \ |
| 352 | mv $(precomp)/symm/tiger-tab.c.new \ |
| 353 | $(precomp)/symm/tiger-tab.c |
| 354 | endif |
| 355 | |
| 356 | ## Barreto and Rijmen's `Whirlpool' hash function. |
| 357 | HASHES += whirlpool whirlpool256 |
| 358 | nodist_libsymm_la_SOURCES += ../precomp/symm/whirlpool-tab.c |
| 359 | PRECOMPS += $(precomp)/symm/whirlpool-tab.c |
| 360 | PRECOMP_PROGS += whirlpool-mktab |
| 361 | STUBS_HDR += Whirlpool-256,whirlpool256,whirlpool |
| 362 | STUBS_SRC += whirlpool256,whirlpool |
| 363 | if !CROSS_COMPILING |
| 364 | $(precomp)/symm/whirlpool-tab.c: |
| 365 | $(AM_V_at)$(MKDIR_P) $(precomp)/symm |
| 366 | $(AM_V_at)$(MAKE) whirlpool-mktab$(EXEEXT) |
| 367 | $(AM_V_GEN)./whirlpool-mktab \ |
| 368 | >$(precomp)/symm/whirlpool-tab.c.new && \ |
| 369 | mv $(precomp)/symm/whirlpool-tab.c.new \ |
| 370 | $(precomp)/symm/whirlpool-tab.c |
| 371 | endif |
| 372 | |
| 373 | ## Bertoni, Daemen, Peeters, and Van Assche's `Keccak', selected as the basis |
| 374 | ## for SHA-3. |
| 375 | pkginclude_HEADERS += keccak1600.h |
| 376 | libsymm_la_SOURCES += keccak1600.c |
| 377 | TESTS += keccak1600.t$(EXEEXT) |
| 378 | EXTRA_DIST += t/keccak1600 |
| 379 | |
| 380 | pkginclude_HEADERS += sha3.h |
| 381 | libsymm_la_SOURCES += sha3.c |
| 382 | |
| 383 | HASHES += sha3-224 sha3-256 sha3-384 sha3-512 |
| 384 | STUBS_HDR += SHA3-224,sha3-224,sha3 |
| 385 | STUBS_HDR += SHA3-256,sha3-256,sha3 |
| 386 | STUBS_HDR += SHA3-384,sha3-384,sha3 |
| 387 | STUBS_HDR += SHA3-512,sha3-512,sha3 |
| 388 | STUBS_SRC += sha3-224,sha3 |
| 389 | STUBS_SRC += sha3-256,sha3 |
| 390 | STUBS_SRC += sha3-384,sha3 |
| 391 | STUBS_SRC += sha3-512,sha3 |
| 392 | |
| 393 | STUBS_HDR += SHAKE128,shake128,sha3 |
| 394 | STUBS_HDR += SHAKE256,shake256,sha3 |
| 395 | |
| 396 | STUBS_HDR += SHAKE128-XOF,shake128-xof,sha3 |
| 397 | STUBS_HDR += SHAKE256-XOF,shake256-xof,sha3 |
| 398 | |
| 399 | STUBS_HDR += KMAC128,kmac128,sha3 |
| 400 | STUBS_HDR += KMAC256,kmac256,sha3 |
| 401 | |
| 402 | ALL_HASHES += shake128 shake256 |
| 403 | ALL_CIPHERS += shake128-xof shake256-xof |
| 404 | ALL_MACS += kmac128 kmac256 |
| 405 | |
| 406 | TESTS += sha3.t$(EXEEXT) |
| 407 | SHA3_TESTS = t/SHA3_224ShortMsg.rsp |
| 408 | SHA3_TESTS += t/SHA3_224LongMsg.rsp |
| 409 | SHA3_TESTS += t/SHA3_256ShortMsg.rsp |
| 410 | SHA3_TESTS += t/SHA3_256LongMsg.rsp |
| 411 | SHA3_TESTS += t/SHA3_384ShortMsg.rsp |
| 412 | SHA3_TESTS += t/SHA3_384LongMsg.rsp |
| 413 | SHA3_TESTS += t/SHA3_512ShortMsg.rsp |
| 414 | SHA3_TESTS += t/SHA3_512LongMsg.rsp |
| 415 | SHA3_TESTS += t/SHA3_224Monte.rsp |
| 416 | SHA3_TESTS += t/SHA3_256Monte.rsp |
| 417 | SHA3_TESTS += t/SHA3_384Monte.rsp |
| 418 | SHA3_TESTS += t/SHA3_512Monte.rsp |
| 419 | SHA3_TESTS += t/SHAKE128ShortMsg.rsp |
| 420 | SHA3_TESTS += t/SHAKE128LongMsg.rsp |
| 421 | SHA3_TESTS += t/SHAKE128VariableOut.rsp |
| 422 | SHA3_TESTS += t/SHAKE256ShortMsg.rsp |
| 423 | SHA3_TESTS += t/SHAKE256LongMsg.rsp |
| 424 | SHA3_TESTS += t/SHAKE256VariableOut.rsp |
| 425 | EXTRA_DIST += $(SHA3_TESTS) sha3-trans t/sha3.local t/sha3 |
| 426 | MAINTAINERCLEANFILES += $(srcdir)/t/sha3 |
| 427 | sha3.log: t/sha3 |
| 428 | $(srcdir)/t/sha3: $(SHA3_TESTS) sha3-trans t/sha3.local |
| 429 | $(AM_V_GEN)cd $(srcdir) && \ |
| 430 | { ./sha3-trans $(SHA3_TESTS); \ |
| 431 | cat t/sha3.local; } >t/sha3.new && \ |
| 432 | mv t/sha3.new t/sha3 |
| 433 | |
| 434 | ## Bellare, Canetti and Krawczyk's `HMAC' mode for message authentication. |
| 435 | HASHMACMODES += hmac |
| 436 | |
| 437 | ## MGF1, used in OAEP and PSS. |
| 438 | HASHCIPHERMODES += mgf |
| 439 | |
| 440 | ###-------------------------------------------------------------------------- |
| 441 | ### Other symmetric primitives. |
| 442 | |
| 443 | ## The CRC32 algorithm, which is useful, but has no worthwhile security. |
| 444 | pkginclude_HEADERS += crc32.h |
| 445 | libsymm_la_SOURCES += crc32.c |
| 446 | ALL_HASHES += crc32=gcrc32 |
| 447 | |
| 448 | ## Rivest's `RC4' stream cipher. |
| 449 | pkginclude_HEADERS += rc4.h |
| 450 | libsymm_la_SOURCES += rc4.c |
| 451 | TESTS += rc4.t$(EXEEXT) |
| 452 | EXTRA_DIST += t/rc4 |
| 453 | ALL_CIPHERS += rc4 |
| 454 | |
| 455 | ## Coppersmith and Rogaway's `SEAL' pseudorandom function. |
| 456 | pkginclude_HEADERS += seal.h |
| 457 | libsymm_la_SOURCES += seal.c |
| 458 | TESTS += seal.t$(EXEEXT) |
| 459 | EXTRA_DIST += t/seal |
| 460 | ALL_CIPHERS += seal |
| 461 | |
| 462 | ## Bernstein's `Salsa20' stream cipher. Most of the test vectors come from |
| 463 | ## the eSTREAM project, captured by the Internet Archive's Wayback Machine at |
| 464 | ## |
| 465 | ## http://web.archive.org/web/20070814004154/http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20.tar.gz?view=tar |
| 466 | ## |
| 467 | ## and automatically converted into the format we want. |
| 468 | EXTRA_DIST += salsa20-tvconv |
| 469 | pkginclude_HEADERS += salsa20.h salsa20-core.h |
| 470 | libsymm_la_SOURCES += salsa20.c |
| 471 | if CPUFAM_X86 |
| 472 | libsymm_la_SOURCES += salsa20-x86ish-sse2.S |
| 473 | endif |
| 474 | if CPUFAM_AMD64 |
| 475 | libsymm_la_SOURCES += salsa20-x86ish-sse2.S |
| 476 | endif |
| 477 | if CPUFAM_ARMEL |
| 478 | libsymm_la_SOURCES += salsa20-arm-neon.S |
| 479 | endif |
| 480 | TESTS += salsa20.t$(EXEEXT) |
| 481 | ALL_CIPHERS += salsa20 salsa2012 salsa208 |
| 482 | ALL_CIPHERS += salsa20-ietf salsa2012-ietf salsa208-ietf |
| 483 | ALL_CIPHERS += xsalsa20 xsalsa2012 xsalsa208 |
| 484 | STUBS_HDR += Salsa20/12,salsa2012,salsa20 |
| 485 | STUBS_HDR += Salsa20/8,salsa208,salsa20 |
| 486 | STUBS_HDR += Salsa20-IETF,salsa20-ietf,salsa20 |
| 487 | STUBS_HDR += Salsa20/12-IETF,salsa2012-ietf,salsa20 |
| 488 | STUBS_HDR += Salsa20/8-IETF,salsa208-ietf,salsa20 |
| 489 | STUBS_HDR += XSalsa20,xsalsa20,salsa20 |
| 490 | STUBS_HDR += XSalsa20/12,xsalsa2012,salsa20 |
| 491 | STUBS_HDR += XSalsa20/8,xsalsa208,salsa20 |
| 492 | EXTRA_DIST += t/salsa20 |
| 493 | MAINTAINERCLEANFILES += t/salsa20 |
| 494 | salsa20.log: t/salsa20 |
| 495 | SALSA20_ESTREAM_TV = t/salsa20.estream |
| 496 | SALSA20_ESTREAM_TV += t/salsa2012.estream |
| 497 | SALSA20_ESTREAM_TV += t/salsa208.estream |
| 498 | EXTRA_DIST += t/salsa20.local $(SALSA20_ESTREAM_TV) |
| 499 | t/salsa20: salsa20-tvconv t/salsa20.local $(SALSA20_ESTREAM_TV) |
| 500 | $(AM_V_GEN)cd $(srcdir) && \ |
| 501 | { echo "### GENERATED by salsa20-tvconv" && \ |
| 502 | cat t/salsa20.local && \ |
| 503 | ./salsa20-tvconv $(SALSA20_ESTREAM_TV); \ |
| 504 | } >t/salsa20.new && \ |
| 505 | mv t/salsa20.new t/salsa20 |
| 506 | |
| 507 | ## Bernstein's `ChaCha' stream cipher. |
| 508 | pkginclude_HEADERS += chacha.h chacha-core.h |
| 509 | libsymm_la_SOURCES += chacha.c |
| 510 | if CPUFAM_X86 |
| 511 | libsymm_la_SOURCES += chacha-x86ish-sse2.S |
| 512 | endif |
| 513 | if CPUFAM_AMD64 |
| 514 | libsymm_la_SOURCES += chacha-x86ish-sse2.S |
| 515 | endif |
| 516 | if CPUFAM_ARMEL |
| 517 | libsymm_la_SOURCES += chacha-arm-neon.S |
| 518 | endif |
| 519 | TESTS += chacha.t$(EXEEXT) |
| 520 | EXTRA_DIST += t/chacha |
| 521 | ALL_CIPHERS += chacha20 chacha12 chacha8 |
| 522 | ALL_CIPHERS += chacha20-ietf chacha12-ietf chacha8-ietf |
| 523 | ALL_CIPHERS += xchacha20 xchacha12 xchacha8 |
| 524 | STUBS_HDR += ChaCha20,chacha20,chacha |
| 525 | STUBS_HDR += ChaCha12,chacha12,chacha |
| 526 | STUBS_HDR += ChaCha8,chacha8,chacha |
| 527 | STUBS_HDR += ChaCha20-IETF,chacha20-ietf,chacha |
| 528 | STUBS_HDR += ChaCha12-IETF,chacha12-ietf,chacha |
| 529 | STUBS_HDR += ChaCha8-IETF,chacha8-ietf,chacha |
| 530 | STUBS_HDR += XChaCha20,xchacha20,chacha |
| 531 | STUBS_HDR += XChaCha12,xchacha12,chacha |
| 532 | STUBS_HDR += XChaCha8,xchacha8,chacha |
| 533 | |
| 534 | ## Bernstein's `Poly1305' message authentication code. |
| 535 | pkginclude_HEADERS += poly1305.h |
| 536 | libsymm_la_SOURCES += poly1305.c |
| 537 | TESTS += poly1305.t$(EXEEXT) |
| 538 | TESTS += poly1305-p11.t$(EXEEXT) |
| 539 | EXTRA_DIST += t/poly1305 |
| 540 | |
| 541 | check_PROGRAMS += poly1305-p11.t |
| 542 | poly1305_p11_t_SOURCES = poly1305.c |
| 543 | poly1305_p11_t_CPPFLAGS = $(AM_CPPFLAGS) -DTEST_RIG -DSRCDIR="\"$(srcdir)\"" |
| 544 | poly1305_p11_t_CPPFLAGS += -DPOLY1305_IMPL=11 |
| 545 | poly1305_p11_t_LDADD = $(TEST_LIBS) $(top_builddir)/libcatacomb.la |
| 546 | poly1305_p11_t_LDADD += $(mLib_LIBS) $(CATACOMB_LIBS) $(LIBS) |
| 547 | |
| 548 | ###-------------------------------------------------------------------------- |
| 549 | ### Autogenerated mode implementations. |
| 550 | |
| 551 | ## The master stamp file, indicating that we generated all of the sources. |
| 552 | EXTRA_DIST += mode.h.in mode.c.in |
| 553 | EXTRA_DIST += modes/gen-stamp |
| 554 | MAINTAINERCLEANFILES += modes/gen-stamp |
| 555 | modes/gen-stamp: Makefile.am |
| 556 | $(AM_V_at)$(MKDIR_P) $(srcdir)/modes |
| 557 | $(AM_V_GEN)$(multigen) -g $(srcdir)/mode.c.in \ |
| 558 | $(srcdir)/modes/@{base:f}-@mode.c \ |
| 559 | base="$(BLKCS)" mode="$(BLKCMODES)" |
| 560 | $(AM_V_at)$(multigen) -g $(srcdir)/mode.h.in \ |
| 561 | $(srcdir)/modes/@{base:f}-@mode.h \ |
| 562 | base="$(BLKCS)" mode="$(BLKCMODES)" |
| 563 | $(AM_V_at)$(multigen) -g $(srcdir)/mode.c.in \ |
| 564 | $(srcdir)/modes/@{base:f}-@mode.c \ |
| 565 | base="$(HASHES)" mode="$(HASHMODES)" |
| 566 | $(AM_V_at)$(multigen) -g $(srcdir)/mode.h.in \ |
| 567 | $(srcdir)/modes/@{base:f}-@mode.h \ |
| 568 | base="$(HASHES)" mode="$(HASHMODES)" |
| 569 | $(AM_V_at)touch $(srcdir)/modes/gen-stamp |
| 570 | |
| 571 | ## The individual mode interfaces and implementations. |
| 572 | pkginclude_HEADERS += $(MODE_H) |
| 573 | |
| 574 | ## Generated implementations. |
| 575 | BUILT_SOURCES += $(GENMODES_C) |
| 576 | MAINTAINERCLEANFILES += $(GENMODES_C) |
| 577 | libsymm_la_SOURCES += $(GENMODES_C) |
| 578 | $(GENMODES_C): modes/gen-stamp |
| 579 | |
| 580 | ## Generated interfaces. |
| 581 | BUILT_SOURCES += $(GENMODES_H) |
| 582 | MAINTAINERCLEANFILES += $(GENMODES_H) |
| 583 | pkginclude_HEADERS += $(GENMODES_H) |
| 584 | $(GENMODES_H): modes/gen-stamp |
| 585 | |
| 586 | ###-------------------------------------------------------------------------- |
| 587 | ### Autogenerated stub headers. |
| 588 | |
| 589 | ## The master stamp file. |
| 590 | EXTRA_DIST += stub.h.in |
| 591 | EXTRA_DIST += stubs.gen-stamp |
| 592 | MAINTAINERCLEANFILES += stubs.gen-stamp |
| 593 | stubs.gen-stamp: Makefile.am |
| 594 | $(AM_V_at)$(MKDIR_P) $(srcdir)/stubs |
| 595 | $(AM_V_GEN)$(multigen) -g $(srcdir)/stub.h.in \ |
| 596 | $(srcdir)/@name.h descr,name,base="$(STUBS_HDR)" |
| 597 | $(AM_V_GEN)$(multigen) -g $(srcdir)/stub.c.in \ |
| 598 | $(srcdir)/@name.c name,base="$(STUBS_SRC)" |
| 599 | $(AM_V_at)touch $(srcdir)/stubs.gen-stamp |
| 600 | |
| 601 | ## Generated stub headers. |
| 602 | BUILT_SOURCES += $(STUB_H) $(STUB_C) |
| 603 | MAINTAINERCLEANFILES += $(STUB_H) $(STUB_C) |
| 604 | pkginclude_HEADERS += $(STUB_H) |
| 605 | $(STUB_H) $(STUB_C): stubs.gen-stamp |
| 606 | |
| 607 | ###-------------------------------------------------------------------------- |
| 608 | ### Tables of classes for encryption, hashing, and message authentication. |
| 609 | |
| 610 | ## The skeleton for the class tables. |
| 611 | EXTRA_DIST += gthingtab.c.in |
| 612 | |
| 613 | ## Table of cipher classes. |
| 614 | pkginclude_HEADERS += gcipher.h |
| 615 | CLEANFILES += gciphertab.c |
| 616 | nodist_libsymm_la_SOURCES += gciphertab.c |
| 617 | gciphertab.c: gthingtab.c.in Makefile.am |
| 618 | $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in gciphertab.c \ |
| 619 | what=gcipher cls=gccipher thing="$(ALL_CIPHERS)" |
| 620 | |
| 621 | ## Table of hash classes. |
| 622 | pkginclude_HEADERS += ghash.h ghash-def.h |
| 623 | CLEANFILES += ghashtab.c |
| 624 | nodist_libsymm_la_SOURCES += ghashtab.c |
| 625 | ghashtab.c: gthingtab.c.in Makefile.am |
| 626 | $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in ghashtab.c \ |
| 627 | what=ghash cls=gchash thing="$(ALL_HASHES)" |
| 628 | |
| 629 | ## Table of MAC classes. |
| 630 | pkginclude_HEADERS += gmac.h |
| 631 | CLEANFILES += gmactab.c |
| 632 | nodist_libsymm_la_SOURCES += gmactab.c |
| 633 | gmactab.c: gthingtab.c.in Makefile.am |
| 634 | $(AM_V_GEN)$(multigen) -g $(srcdir)/gthingtab.c.in gmactab.c \ |
| 635 | what=gmac cls=gcmac thing="$(ALL_MACS)" |
| 636 | |
| 637 | ###-------------------------------------------------------------------------- |
| 638 | ### Testing. |
| 639 | |
| 640 | ## Run the test programs. |
| 641 | TESTS += $(SYMM_TESTS) |
| 642 | EXTRA_DIST += $(SYMM_TEST_FILES) |
| 643 | |
| 644 | ## A piece of sample text for round-trip testing encryption modes. |
| 645 | EXTRA_DIST += daftstory.h |
| 646 | |
| 647 | ## Clean the debris from the `modes' subdirectory. |
| 648 | CLEANFILES += modes/*.to modes/*.t$(EXEEXT) |
| 649 | |
| 650 | ###----- That's all, folks -------------------------------------------------- |