From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C812BC25B74 for ; Thu, 16 May 2024 18:28:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7fq9-0003ru-5G; Thu, 16 May 2024 14:28:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s7fpu-0003pd-J6 for grub-devel@gnu.org; Thu, 16 May 2024 14:28:16 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s7fpl-0000A2-KF for grub-devel@gnu.org; Thu, 16 May 2024 14:28:14 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a59b81d087aso328799166b.3 for ; Thu, 16 May 2024 11:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715884081; x=1716488881; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MVGNO/626SXsttf4C3wt+pGhEngqBd+FjV6m1XQJjk4=; b=FkumJplLOiXxD1wCN1irMxKnCB1HnSUJ7gdVvko/6doywYVlvPY91PTQlvQd621rn4 Y7YhJhi6HIpsNUQgRl65X06lPVg0J6YtgWspFFFGEQ7tayMNvJh8uKI+yd8g70EwgRRP PScvllQr8eYdTE9RRM30Ip2q3cVtf4kLflKivMKIIIrVBBZgxuwTTA9JYCFhaIqqs2l6 Z6yfNxyxWTuEvpkri9Xd6elr08tcSVMrZP8PDf5sDPlp/hvx2+Bs8aT1aBhUDZUsUc5g AEg5P7pjOBB93/rpqPDsrdwWAykOHPQMz3cV2X/yWjOKOE3DGk1HyYq9g85pKhCb+YbK cqqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715884082; x=1716488882; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MVGNO/626SXsttf4C3wt+pGhEngqBd+FjV6m1XQJjk4=; b=IpqDhrcc1hU0LilplYbSY1kgdQMtFivSKdO7Tvqgf8G+/sq6e311tQB/CeP+I2NJeR OdcQ3BeO5YYfsBr195NdafqITm8NTG5/mojXUNuOzV7X0KujjF1VxEmVcXyQZl9bfmlm c2d1tCTZ7mocPOese2u46slmG/WAoICvB1uuYrw3mnyPzspza1IS8aNpmwt3bMS4RFq8 ONT7IRFc3JYz4j3AC2fvQu4akQNAxcUMNek3BCNJ/sxqxQqVNDTKSiudD/eSnxtf47wb 6bzyFQ7Lp9EpNTsiKxK2AMrz5yZcR8Z+xqQmzaKmAQGLjGKPjffQoQJLvFsDgfYOpy+1 5cKg== X-Gm-Message-State: AOJu0YwtPkwSAIZNuaHR7zTvtTIBuBP809PZERdI28yA3yOnJ1T6M7d9 jTP9XNg2f9VMFAdLdZfZa8i+0wWYDFN7V+HewkvIFEfviHVFVqFpwakH7wNG X-Google-Smtp-Source: AGHT+IERSanQHddloMYgZtAkjwJMIeF0DBrD6+EYDpAYazwiD8OIzhOJSAbDMfHjEJO4DvfDKUvlUw== X-Received: by 2002:a17:906:1714:b0:a59:b02a:90da with SMTP id a640c23a62f3a-a5a2d67647fmr1708849966b.68.1715884073324; Thu, 16 May 2024 11:27:53 -0700 (PDT) Received: from localhost ([5.253.206.60]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b0195dsm999608666b.184.2024.05.16.11.27.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 11:27:48 -0700 (PDT) From: Vladimir Serbinenko To: grub-devel@gnu.org Cc: Vladimir Serbinenko Subject: [PATCH 1/3] Import libgcrypt 1.10.3 Date: Thu, 16 May 2024 21:27:41 +0300 Message-Id: <20240516182743.2350-1-phcoder@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=phcoder@gmail.com; helo=mail-ej1-x631.google.com X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Content-Type: multipart/mixed; boundary="===============1928892727908298122==" Errors-To: grub-devel-bounces+grub-devel=archiver.kernel.org@gnu.org Sender: grub-devel-bounces+grub-devel=archiver.kernel.org@gnu.org --===============1928892727908298122== Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable --- grub-core/lib/libgcrypt/AUTHORS | 264 + grub-core/lib/libgcrypt/COPYING | 340 + grub-core/lib/libgcrypt/COPYING.LIB | 510 + grub-core/lib/libgcrypt/ChangeLog | 17275 +++++++++++ grub-core/lib/libgcrypt/ChangeLog-2011 | 1499 + grub-core/lib/libgcrypt/INSTALL | 234 + grub-core/lib/libgcrypt/LICENSES | 287 + grub-core/lib/libgcrypt/Makefile.am | 160 + grub-core/lib/libgcrypt/NEWS | 1688 ++ grub-core/lib/libgcrypt/README | 280 + grub-core/lib/libgcrypt/README.GIT | 49 + grub-core/lib/libgcrypt/THANKS | 168 + grub-core/lib/libgcrypt/TODO | 59 + grub-core/lib/libgcrypt/VERSION | 1 + grub-core/lib/libgcrypt/acinclude.m4 | 392 + grub-core/lib/libgcrypt/aclocal.m4 | 1216 + grub-core/lib/libgcrypt/autogen.rc | 13 + grub-core/lib/libgcrypt/autogen.sh | 513 + .../lib/libgcrypt/build-aux/ChangeLog-2011 | 169 + grub-core/lib/libgcrypt/build-aux/compile | 347 + .../lib/libgcrypt/build-aux/config.guess | 1456 + .../lib/libgcrypt/build-aux/config.rpath | 690 + grub-core/lib/libgcrypt/build-aux/config.sub | 1823 ++ grub-core/lib/libgcrypt/build-aux/depcomp | 791 + grub-core/lib/libgcrypt/build-aux/git-log-fix | 14 + .../lib/libgcrypt/build-aux/git-log-footer | 14 + grub-core/lib/libgcrypt/build-aux/install-sh | 527 + .../lib/libgcrypt/build-aux/libtool-patch.sed | 68 + grub-core/lib/libgcrypt/build-aux/ltmain.sh | 9664 ++++++ grub-core/lib/libgcrypt/build-aux/missing | 215 + grub-core/lib/libgcrypt/build-aux/texinfo.tex | 8638 ++++++ grub-core/lib/libgcrypt/cipher/ChangeLog | 3990 --- grub-core/lib/libgcrypt/cipher/ChangeLog-2011 | 40 +- grub-core/lib/libgcrypt/cipher/Makefile.am | 271 +- grub-core/lib/libgcrypt/cipher/Manifest | 73 - grub-core/lib/libgcrypt/cipher/ac.c | 3301 -- .../lib/libgcrypt/cipher/arcfour-amd64.S | 108 + grub-core/lib/libgcrypt/cipher/arcfour.c | 87 +- .../lib/libgcrypt/cipher/asm-common-aarch64.h | 108 + .../lib/libgcrypt/cipher/asm-common-amd64.h | 193 + .../lib/libgcrypt/cipher/asm-common-s390x.h | 90 + .../lib/libgcrypt/cipher/asm-inline-s390x.h | 205 + .../libgcrypt/cipher/asm-poly1305-aarch64.h | 245 + .../lib/libgcrypt/cipher/asm-poly1305-amd64.h | 171 + .../lib/libgcrypt/cipher/asm-poly1305-s390x.h | 140 + grub-core/lib/libgcrypt/cipher/bithelp.h | 111 +- grub-core/lib/libgcrypt/cipher/blake2.c | 1045 + .../lib/libgcrypt/cipher/blake2b-amd64-avx2.S | 300 + .../lib/libgcrypt/cipher/blake2s-amd64-avx.S | 278 + .../lib/libgcrypt/cipher/blowfish-amd64.S | 601 + grub-core/lib/libgcrypt/cipher/blowfish-arm.S | 743 + grub-core/lib/libgcrypt/cipher/blowfish.c | 847 +- grub-core/lib/libgcrypt/cipher/bufhelp.h | 458 +- .../lib/libgcrypt/cipher/camellia-aarch64.S | 586 + .../cipher/camellia-aesni-avx-amd64.S | 2618 ++ .../cipher/camellia-aesni-avx2-amd64.S | 34 + .../cipher/camellia-aesni-avx2-amd64.h | 1794 ++ grub-core/lib/libgcrypt/cipher/camellia-arm.S | 626 + .../lib/libgcrypt/cipher/camellia-glue.c | 1014 +- .../cipher/camellia-vaes-avx2-amd64.S | 35 + grub-core/lib/libgcrypt/cipher/camellia.c | 172 +- grub-core/lib/libgcrypt/cipher/camellia.h | 14 + grub-core/lib/libgcrypt/cipher/cast5-amd64.S | 663 + grub-core/lib/libgcrypt/cipher/cast5-arm.S | 728 + grub-core/lib/libgcrypt/cipher/cast5.c | 822 +- .../lib/libgcrypt/cipher/chacha20-aarch64.S | 648 + .../libgcrypt/cipher/chacha20-amd64-avx2.S | 601 + .../libgcrypt/cipher/chacha20-amd64-ssse3.S | 1012 + .../libgcrypt/cipher/chacha20-armv7-neon.S | 393 + grub-core/lib/libgcrypt/cipher/chacha20-ppc.c | 646 + .../lib/libgcrypt/cipher/chacha20-s390x.S | 1561 + grub-core/lib/libgcrypt/cipher/chacha20.c | 1306 + .../lib/libgcrypt/cipher/cipher-aeswrap.c | 380 + grub-core/lib/libgcrypt/cipher/cipher-cbc.c | 292 + grub-core/lib/libgcrypt/cipher/cipher-ccm.c | 415 + grub-core/lib/libgcrypt/cipher/cipher-cfb.c | 317 + grub-core/lib/libgcrypt/cipher/cipher-cmac.c | 292 + grub-core/lib/libgcrypt/cipher/cipher-ctr.c | 131 + grub-core/lib/libgcrypt/cipher/cipher-eax.c | 289 + .../libgcrypt/cipher/cipher-gcm-armv7-neon.S | 341 + .../cipher/cipher-gcm-armv8-aarch32-ce.S | 588 + .../cipher/cipher-gcm-armv8-aarch64-ce.S | 652 + .../cipher/cipher-gcm-intel-pclmul.c | 914 + .../lib/libgcrypt/cipher/cipher-gcm-ppc.c | 551 + .../lib/libgcrypt/cipher/cipher-gcm-siv.c | 664 + grub-core/lib/libgcrypt/cipher/cipher-gcm.c | 1263 + .../lib/libgcrypt/cipher/cipher-internal.h | 946 + grub-core/lib/libgcrypt/cipher/cipher-ocb.c | 762 + grub-core/lib/libgcrypt/cipher/cipher-ofb.c | 108 + .../lib/libgcrypt/cipher/cipher-poly1305.c | 379 + .../lib/libgcrypt/cipher/cipher-selftest.c | 512 + .../lib/libgcrypt/cipher/cipher-selftest.h | 69 + grub-core/lib/libgcrypt/cipher/cipher-siv.c | 375 + grub-core/lib/libgcrypt/cipher/cipher-xts.c | 189 + grub-core/lib/libgcrypt/cipher/cipher.c | 2621 +- .../libgcrypt/cipher/crc-armv8-aarch64-ce.S | 497 + grub-core/lib/libgcrypt/cipher/crc-armv8-ce.c | 229 + .../lib/libgcrypt/cipher/crc-intel-pclmul.c | 939 + grub-core/lib/libgcrypt/cipher/crc-ppc.c | 656 + grub-core/lib/libgcrypt/cipher/crc.c | 188 +- grub-core/lib/libgcrypt/cipher/des-amd64.S | 1111 + grub-core/lib/libgcrypt/cipher/des.c | 365 +- grub-core/lib/libgcrypt/cipher/dsa-common.c | 473 + grub-core/lib/libgcrypt/cipher/dsa.c | 1207 +- grub-core/lib/libgcrypt/cipher/ecc-common.h | 143 + grub-core/lib/libgcrypt/cipher/ecc-curves.c | 1585 + grub-core/lib/libgcrypt/cipher/ecc-ecdh.c | 127 + grub-core/lib/libgcrypt/cipher/ecc-ecdsa.c | 297 + grub-core/lib/libgcrypt/cipher/ecc-eddsa.c | 1079 + grub-core/lib/libgcrypt/cipher/ecc-gost.c | 218 + grub-core/lib/libgcrypt/cipher/ecc-misc.c | 469 + grub-core/lib/libgcrypt/cipher/ecc-sm2.c | 569 + grub-core/lib/libgcrypt/cipher/ecc.c | 2940 +- grub-core/lib/libgcrypt/cipher/elgamal.c | 829 +- grub-core/lib/libgcrypt/cipher/gost-s-box.c | 266 + grub-core/lib/libgcrypt/cipher/gost-sb.h | 2128 ++ grub-core/lib/libgcrypt/cipher/gost.h | 34 + grub-core/lib/libgcrypt/cipher/gost28147.c | 553 + grub-core/lib/libgcrypt/cipher/gostr3411-94.c | 383 + grub-core/lib/libgcrypt/cipher/hash-common.c | 112 +- grub-core/lib/libgcrypt/cipher/hash-common.h | 35 +- grub-core/lib/libgcrypt/cipher/hmac-tests.c | 732 - grub-core/lib/libgcrypt/cipher/idea.c | 24 +- grub-core/lib/libgcrypt/cipher/kdf-internal.h | 43 + grub-core/lib/libgcrypt/cipher/kdf.c | 1074 +- .../lib/libgcrypt/cipher/keccak-armv7-neon.S | 945 + grub-core/lib/libgcrypt/cipher/keccak.c | 1561 + .../lib/libgcrypt/cipher/keccak_permute_32.h | 536 + .../lib/libgcrypt/cipher/keccak_permute_64.h | 385 + grub-core/lib/libgcrypt/cipher/mac-cmac.c | 524 + grub-core/lib/libgcrypt/cipher/mac-gmac.c | 187 + grub-core/lib/libgcrypt/cipher/mac-hmac.c | 1471 + grub-core/lib/libgcrypt/cipher/mac-internal.h | 275 + grub-core/lib/libgcrypt/cipher/mac-poly1305.c | 364 + grub-core/lib/libgcrypt/cipher/mac.c | 802 + grub-core/lib/libgcrypt/cipher/md.c | 1517 +- grub-core/lib/libgcrypt/cipher/md4.c | 167 +- grub-core/lib/libgcrypt/cipher/md5.c | 173 +- .../lib/libgcrypt/cipher/poly1305-internal.h | 64 + .../lib/libgcrypt/cipher/poly1305-s390x.S | 87 + grub-core/lib/libgcrypt/cipher/poly1305.c | 763 + grub-core/lib/libgcrypt/cipher/primegen.c | 555 +- .../lib/libgcrypt/cipher/pubkey-internal.h | 107 + grub-core/lib/libgcrypt/cipher/pubkey-util.c | 1369 + grub-core/lib/libgcrypt/cipher/pubkey.c | 4315 +-- grub-core/lib/libgcrypt/cipher/rfc2268.c | 51 +- .../lib/libgcrypt/cipher/rijndael-aarch64.S | 514 + .../lib/libgcrypt/cipher/rijndael-aesni.c | 4880 +++ .../lib/libgcrypt/cipher/rijndael-amd64.S | 477 + grub-core/lib/libgcrypt/cipher/rijndael-arm.S | 581 + .../cipher/rijndael-armv8-aarch32-ce.S | 1988 ++ .../cipher/rijndael-armv8-aarch64-ce.S | 1921 ++ .../lib/libgcrypt/cipher/rijndael-armv8-ce.c | 431 + .../lib/libgcrypt/cipher/rijndael-gcm-p10le.s | 1401 + .../lib/libgcrypt/cipher/rijndael-internal.h | 204 + .../lib/libgcrypt/cipher/rijndael-p10le.c | 119 + .../lib/libgcrypt/cipher/rijndael-padlock.c | 110 + .../libgcrypt/cipher/rijndael-ppc-common.h | 342 + .../libgcrypt/cipher/rijndael-ppc-functions.h | 2020 ++ grub-core/lib/libgcrypt/cipher/rijndael-ppc.c | 259 + .../lib/libgcrypt/cipher/rijndael-ppc9le.c | 102 + .../lib/libgcrypt/cipher/rijndael-s390x.c | 1166 + .../cipher/rijndael-ssse3-amd64-asm.S | 874 + .../libgcrypt/cipher/rijndael-ssse3-amd64.c | 743 + .../lib/libgcrypt/cipher/rijndael-tables.h | 1839 +- .../cipher/rijndael-vaes-avx2-amd64.S | 3021 ++ .../lib/libgcrypt/cipher/rijndael-vaes.c | 197 + grub-core/lib/libgcrypt/cipher/rijndael.c | 2611 +- grub-core/lib/libgcrypt/cipher/rmd160.c | 588 +- grub-core/lib/libgcrypt/cipher/rsa-common.c | 1115 + grub-core/lib/libgcrypt/cipher/rsa.c | 1733 +- .../lib/libgcrypt/cipher/salsa20-amd64.S | 940 + .../lib/libgcrypt/cipher/salsa20-armv7-neon.S | 899 + grub-core/lib/libgcrypt/cipher/salsa20.c | 600 + grub-core/lib/libgcrypt/cipher/scrypt.c | 322 + grub-core/lib/libgcrypt/cipher/seed.c | 28 +- .../lib/libgcrypt/cipher/serpent-armv7-neon.S | 1124 + .../lib/libgcrypt/cipher/serpent-avx2-amd64.S | 1160 + .../lib/libgcrypt/cipher/serpent-sse2-amd64.S | 1211 + grub-core/lib/libgcrypt/cipher/serpent.c | 1800 +- .../lib/libgcrypt/cipher/sha1-armv7-neon.S | 526 + .../libgcrypt/cipher/sha1-armv8-aarch32-ce.S | 220 + .../libgcrypt/cipher/sha1-armv8-aarch64-ce.S | 201 + .../lib/libgcrypt/cipher/sha1-avx-amd64.S | 429 + .../libgcrypt/cipher/sha1-avx-bmi2-amd64.S | 441 + .../libgcrypt/cipher/sha1-avx2-bmi2-amd64.S | 573 + .../lib/libgcrypt/cipher/sha1-intel-shaext.c | 292 + .../lib/libgcrypt/cipher/sha1-ssse3-amd64.S | 437 + grub-core/lib/libgcrypt/cipher/sha1.c | 571 +- grub-core/lib/libgcrypt/cipher/sha1.h | 47 + .../cipher/sha256-armv8-aarch32-ce.S | 231 + .../cipher/sha256-armv8-aarch64-ce.S | 215 + .../lib/libgcrypt/cipher/sha256-avx-amd64.S | 506 + .../libgcrypt/cipher/sha256-avx2-bmi2-amd64.S | 527 + .../libgcrypt/cipher/sha256-intel-shaext.c | 363 + grub-core/lib/libgcrypt/cipher/sha256-ppc.c | 795 + .../lib/libgcrypt/cipher/sha256-ssse3-amd64.S | 528 + grub-core/lib/libgcrypt/cipher/sha256.c | 775 +- grub-core/lib/libgcrypt/cipher/sha512-arm.S | 464 + .../lib/libgcrypt/cipher/sha512-armv7-neon.S | 452 + .../lib/libgcrypt/cipher/sha512-avx-amd64.S | 461 + .../libgcrypt/cipher/sha512-avx2-bmi2-amd64.S | 502 + grub-core/lib/libgcrypt/cipher/sha512-ppc.c | 969 + .../lib/libgcrypt/cipher/sha512-ssse3-amd64.S | 467 + .../lib/libgcrypt/cipher/sha512-ssse3-i386.c | 404 + grub-core/lib/libgcrypt/cipher/sha512.c | 1232 +- grub-core/lib/libgcrypt/cipher/sm3-aarch64.S | 657 + .../lib/libgcrypt/cipher/sm3-avx-bmi2-amd64.S | 553 + grub-core/lib/libgcrypt/cipher/sm3.c | 537 + .../libgcrypt/cipher/sm4-aesni-avx-amd64.S | 987 + .../libgcrypt/cipher/sm4-aesni-avx2-amd64.S | 851 + grub-core/lib/libgcrypt/cipher/sm4.c | 1251 + grub-core/lib/libgcrypt/cipher/stribog.c | 1362 + .../lib/libgcrypt/cipher/test-getrusage.c | 105 - grub-core/lib/libgcrypt/cipher/tiger.c | 307 +- .../lib/libgcrypt/cipher/twofish-aarch64.S | 321 + .../lib/libgcrypt/cipher/twofish-amd64.S | 1184 + grub-core/lib/libgcrypt/cipher/twofish-arm.S | 363 + .../lib/libgcrypt/cipher/twofish-avx2-amd64.S | 1048 + grub-core/lib/libgcrypt/cipher/twofish.c | 893 +- .../libgcrypt/cipher/whirlpool-sse2-amd64.S | 348 + grub-core/lib/libgcrypt/cipher/whirlpool.c | 334 +- grub-core/lib/libgcrypt/compat/Makefile.am | 48 + grub-core/lib/libgcrypt/compat/clock.c | 36 + grub-core/lib/libgcrypt/compat/compat.c | 40 + grub-core/lib/libgcrypt/compat/getpid.c | 29 + grub-core/lib/libgcrypt/compat/libcompat.h | 37 + grub-core/lib/libgcrypt/config.h.in | 823 + grub-core/lib/libgcrypt/configure | 25141 ++++++++++++++++ grub-core/lib/libgcrypt/configure.ac | 3394 +++ grub-core/lib/libgcrypt/doc/ChangeLog-2011 | 488 + grub-core/lib/libgcrypt/doc/DCO | 29 + grub-core/lib/libgcrypt/doc/HACKING | 143 + grub-core/lib/libgcrypt/doc/Makefile.am | 104 + grub-core/lib/libgcrypt/doc/README.apichanges | 115 + grub-core/lib/libgcrypt/doc/fips-fsm.fig | 199 + grub-core/lib/libgcrypt/doc/fips-fsm.pdf | Bin 0 -> 11911 bytes grub-core/lib/libgcrypt/doc/fips-fsm.png | Bin 0 -> 6874 bytes grub-core/lib/libgcrypt/doc/gcrypt.info | 142 + grub-core/lib/libgcrypt/doc/gcrypt.info-1 | 7416 +++++ grub-core/lib/libgcrypt/doc/gcrypt.info-2 | Bin 0 -> 37137 bytes grub-core/lib/libgcrypt/doc/gcrypt.texi | 7287 +++++ grub-core/lib/libgcrypt/doc/gpl.texi | 392 + grub-core/lib/libgcrypt/doc/lgpl.texi | 560 + .../lib/libgcrypt/doc/libgcrypt-modules.fig | 193 + .../lib/libgcrypt/doc/libgcrypt-modules.pdf | Bin 0 -> 6755 bytes .../lib/libgcrypt/doc/libgcrypt-modules.png | Bin 0 -> 2520 bytes grub-core/lib/libgcrypt/doc/stamp-vti | 4 + grub-core/lib/libgcrypt/doc/version.texi | 4 + grub-core/lib/libgcrypt/doc/yat2m.c | 1649 + grub-core/lib/libgcrypt/m4/ChangeLog-2011 | 50 + grub-core/lib/libgcrypt/m4/Makefile.am | 2 + grub-core/lib/libgcrypt/m4/ax_cc_for_build.m4 | 77 + grub-core/lib/libgcrypt/m4/gpg-error.m4 | 225 + grub-core/lib/libgcrypt/m4/libtool.m4 | 8026 +++++ grub-core/lib/libgcrypt/m4/ltoptions.m4 | 384 + grub-core/lib/libgcrypt/m4/ltsugar.m4 | 123 + grub-core/lib/libgcrypt/m4/ltversion.m4 | 23 + grub-core/lib/libgcrypt/m4/lt~obsolete.m4 | 98 + grub-core/lib/libgcrypt/m4/noexecstack.m4 | 55 + grub-core/lib/libgcrypt/m4/socklen.m4 | 76 + grub-core/lib/libgcrypt/mkinstalldirs | 161 + grub-core/lib/libgcrypt/mpi/ChangeLog-2011 | 17 +- grub-core/lib/libgcrypt/mpi/Makefile.am | 9 +- grub-core/lib/libgcrypt/mpi/Manifest | 41 - .../mpi/{pentium4/sse2 =3D> aarch64}/distfiles | 1 + .../lib/libgcrypt/mpi/aarch64/mpi-asm-defs.h | 4 + .../lib/libgcrypt/mpi/aarch64/mpih-add1.S | 74 + .../lib/libgcrypt/mpi/aarch64/mpih-mul1.S | 99 + .../lib/libgcrypt/mpi/aarch64/mpih-mul2.S | 111 + .../lib/libgcrypt/mpi/aarch64/mpih-mul3.S | 124 + .../lib/libgcrypt/mpi/aarch64/mpih-sub1.S | 74 + grub-core/lib/libgcrypt/mpi/alpha/README | 4 +- grub-core/lib/libgcrypt/mpi/amd64/distfiles | 1 + grub-core/lib/libgcrypt/mpi/amd64/func_abi.h | 34 + .../lib/libgcrypt/mpi/amd64/mpi-asm-defs.h | 2 +- grub-core/lib/libgcrypt/mpi/amd64/mpih-add1.S | 4 +- .../lib/libgcrypt/mpi/amd64/mpih-lshift.S | 47 +- grub-core/lib/libgcrypt/mpi/amd64/mpih-mul1.S | 3 +- grub-core/lib/libgcrypt/mpi/amd64/mpih-mul2.S | 46 +- grub-core/lib/libgcrypt/mpi/amd64/mpih-mul3.S | 4 +- .../lib/libgcrypt/mpi/amd64/mpih-rshift.S | 49 +- grub-core/lib/libgcrypt/mpi/amd64/mpih-sub1.S | 3 +- .../lib/libgcrypt/mpi/{i586 =3D> arm}/distfiles | 6 +- .../lib/libgcrypt/mpi/arm/mpi-asm-defs.h | 4 + grub-core/lib/libgcrypt/mpi/arm/mpih-add1.S | 76 + grub-core/lib/libgcrypt/mpi/arm/mpih-mul1.S | 80 + grub-core/lib/libgcrypt/mpi/arm/mpih-mul2.S | 94 + grub-core/lib/libgcrypt/mpi/arm/mpih-mul3.S | 100 + grub-core/lib/libgcrypt/mpi/arm/mpih-sub1.S | 77 + .../lib/libgcrypt/mpi/asm-common-aarch64.h | 26 + .../lib/libgcrypt/mpi/asm-common-amd64.h | 26 + grub-core/lib/libgcrypt/mpi/config.links | 174 +- .../{cipher/rmd.h =3D> mpi/ec-ed25519.c} | 35 +- grub-core/lib/libgcrypt/mpi/ec-hw-s390x.c | 412 + grub-core/lib/libgcrypt/mpi/ec-inline.h | 1065 + grub-core/lib/libgcrypt/mpi/ec-internal.h | 49 + grub-core/lib/libgcrypt/mpi/ec-nist.c | 817 + grub-core/lib/libgcrypt/mpi/ec.c | 2053 +- grub-core/lib/libgcrypt/mpi/generic/Manifest | 29 - grub-core/lib/libgcrypt/mpi/generic/distfiles | 1 - .../lib/libgcrypt/mpi/generic/mpi-asm-defs.h | 16 +- .../lib/libgcrypt/mpi/generic/mpih-add1.c | 6 +- .../lib/libgcrypt/mpi/generic/mpih-lshift.c | 2 +- .../lib/libgcrypt/mpi/generic/mpih-mul1.c | 4 +- .../lib/libgcrypt/mpi/generic/mpih-mul2.c | 6 +- .../lib/libgcrypt/mpi/generic/mpih-mul3.c | 4 +- .../lib/libgcrypt/mpi/generic/mpih-sub1.c | 4 +- grub-core/lib/libgcrypt/mpi/i386/Manifest | 28 - grub-core/lib/libgcrypt/mpi/i386/distfiles | 1 - grub-core/lib/libgcrypt/mpi/i386/mpih-add1.S | 47 +- .../lib/libgcrypt/mpi/i386/mpih-lshift.S | 12 +- grub-core/lib/libgcrypt/mpi/i386/mpih-mul1.S | 12 +- grub-core/lib/libgcrypt/mpi/i386/mpih-mul2.S | 12 +- grub-core/lib/libgcrypt/mpi/i386/mpih-mul3.S | 12 +- .../lib/libgcrypt/mpi/i386/mpih-rshift.S | 14 +- grub-core/lib/libgcrypt/mpi/i386/mpih-sub1.S | 47 +- grub-core/lib/libgcrypt/mpi/i386/syntax.h | 32 +- grub-core/lib/libgcrypt/mpi/i586/Manifest | 27 - grub-core/lib/libgcrypt/mpi/i586/README | 26 - grub-core/lib/libgcrypt/mpi/i586/mpih-add1.S | 135 - .../lib/libgcrypt/mpi/i586/mpih-lshift.S | 229 - grub-core/lib/libgcrypt/mpi/i586/mpih-mul1.S | 89 - grub-core/lib/libgcrypt/mpi/i586/mpih-mul2.S | 93 - grub-core/lib/libgcrypt/mpi/i586/mpih-mul3.S | 93 - .../lib/libgcrypt/mpi/i586/mpih-rshift.S | 228 - grub-core/lib/libgcrypt/mpi/i586/mpih-sub1.S | 142 - grub-core/lib/libgcrypt/mpi/longlong.h | 686 +- grub-core/lib/libgcrypt/mpi/m68k/Manifest | 25 - grub-core/lib/libgcrypt/mpi/m68k/distfiles | 1 - .../lib/libgcrypt/mpi/m68k/mc68020/Manifest | 23 - .../lib/libgcrypt/mpi/m68k/mc68020/distfiles | 1 - grub-core/lib/libgcrypt/mpi/m68k/syntax.h | 2 +- grub-core/lib/libgcrypt/mpi/mips3/Manifest | 28 - grub-core/lib/libgcrypt/mpi/mips3/README | 2 +- grub-core/lib/libgcrypt/mpi/mips3/distfiles | 1 - grub-core/lib/libgcrypt/mpi/mpi-add.c | 23 +- grub-core/lib/libgcrypt/mpi/mpi-bit.c | 119 +- grub-core/lib/libgcrypt/mpi/mpi-cmp.c | 41 +- grub-core/lib/libgcrypt/mpi/mpi-div.c | 19 +- grub-core/lib/libgcrypt/mpi/mpi-gcd.c | 11 +- grub-core/lib/libgcrypt/mpi/mpi-internal.h | 54 +- grub-core/lib/libgcrypt/mpi/mpi-inv.c | 312 +- grub-core/lib/libgcrypt/mpi/mpi-mod.c | 16 +- grub-core/lib/libgcrypt/mpi/mpi-mpow.c | 8 +- grub-core/lib/libgcrypt/mpi/mpi-mul.c | 12 +- grub-core/lib/libgcrypt/mpi/mpi-pow.c | 458 +- grub-core/lib/libgcrypt/mpi/mpi-scan.c | 132 +- grub-core/lib/libgcrypt/mpi/mpicoder.c | 763 +- grub-core/lib/libgcrypt/mpi/mpih-const-time.c | 240 + grub-core/lib/libgcrypt/mpi/mpih-div.c | 10 +- grub-core/lib/libgcrypt/mpi/mpih-mul.c | 19 +- grub-core/lib/libgcrypt/mpi/mpiutil.c | 481 +- grub-core/lib/libgcrypt/mpi/pa7100/Manifest | 22 - grub-core/lib/libgcrypt/mpi/pa7100/distfiles | 1 - grub-core/lib/libgcrypt/mpi/pentium4/README | 115 - .../lib/libgcrypt/mpi/pentium4/distfiles | 3 - .../lib/libgcrypt/mpi/pentium4/mmx/distfiles | 2 - .../libgcrypt/mpi/pentium4/mmx/mpih-lshift.S | 457 - .../libgcrypt/mpi/pentium4/mmx/mpih-rshift.S | 453 - .../libgcrypt/mpi/pentium4/sse2/mpih-add1.S | 91 - .../libgcrypt/mpi/pentium4/sse2/mpih-mul1.S | 96 - .../libgcrypt/mpi/pentium4/sse2/mpih-mul2.S | 136 - .../libgcrypt/mpi/pentium4/sse2/mpih-mul3.S | 127 - .../libgcrypt/mpi/pentium4/sse2/mpih-sub1.S | 112 - grub-core/lib/libgcrypt/mpi/power/Manifest | 27 - grub-core/lib/libgcrypt/mpi/power/distfiles | 1 - .../lib/libgcrypt/mpi/powerpc32/Manifest | 28 - .../lib/libgcrypt/mpi/powerpc32/distfiles | 1 - grub-core/lib/libgcrypt/mpi/sparc32/Manifest | 24 - grub-core/lib/libgcrypt/mpi/sparc32/distfiles | 1 - .../lib/libgcrypt/mpi/sparc32v8/Manifest | 23 - .../lib/libgcrypt/mpi/sparc32v8/distfiles | 1 - .../lib/libgcrypt/mpi/supersparc/Manifest | 21 - .../lib/libgcrypt/mpi/supersparc/distfiles | 1 - grub-core/lib/libgcrypt/random/ChangeLog-2011 | 191 + grub-core/lib/libgcrypt/random/Makefile.am | 80 + .../random/jitterentropy-base-user.h | 320 + .../lib/libgcrypt/random/jitterentropy-base.c | 734 + .../lib/libgcrypt/random/jitterentropy-base.h | 34 + .../lib/libgcrypt/random/jitterentropy-gcd.c | 188 + .../lib/libgcrypt/random/jitterentropy-gcd.h | 42 + .../libgcrypt/random/jitterentropy-health.c | 438 + .../libgcrypt/random/jitterentropy-health.h | 51 + .../libgcrypt/random/jitterentropy-noise.c | 387 + .../libgcrypt/random/jitterentropy-noise.h | 39 + .../lib/libgcrypt/random/jitterentropy-sha3.c | 382 + .../lib/libgcrypt/random/jitterentropy-sha3.h | 56 + .../libgcrypt/random/jitterentropy-timer.c | 234 + .../libgcrypt/random/jitterentropy-timer.h | 92 + .../lib/libgcrypt/random/jitterentropy.h | 451 + .../lib/libgcrypt/random/rand-internal.h | 152 + .../lib/libgcrypt/random/random-csprng.c | 1318 + grub-core/lib/libgcrypt/random/random-drbg.c | 2675 ++ .../lib/libgcrypt/random/random-system.c | 255 + grub-core/lib/libgcrypt/random/random.c | 562 + grub-core/lib/libgcrypt/random/random.h | 69 + grub-core/lib/libgcrypt/random/rndegd.c | 290 + .../lib/libgcrypt/random/rndgetentropy.c | 126 + grub-core/lib/libgcrypt/random/rndhw.c | 230 + grub-core/lib/libgcrypt/random/rndjent.c | 409 + grub-core/lib/libgcrypt/random/rndoldlinux.c | 349 + grub-core/lib/libgcrypt/random/rndunix.c | 937 + grub-core/lib/libgcrypt/random/rndw32.c | 1030 + grub-core/lib/libgcrypt/random/rndw32ce.c | 199 + grub-core/lib/libgcrypt/src/ChangeLog-2011 | 75 +- grub-core/lib/libgcrypt/src/Makefile.am | 87 +- grub-core/lib/libgcrypt/src/Manifest | 58 - grub-core/lib/libgcrypt/src/ath.c | 344 - grub-core/lib/libgcrypt/src/ath.h | 147 - grub-core/lib/libgcrypt/src/cipher-proto.h | 248 +- grub-core/lib/libgcrypt/src/cipher.h | 150 +- grub-core/lib/libgcrypt/src/const-time.c | 88 + grub-core/lib/libgcrypt/src/const-time.h | 167 + grub-core/lib/libgcrypt/src/context.c | 139 + grub-core/lib/libgcrypt/src/context.h | 32 + grub-core/lib/libgcrypt/src/dumpsexp.c | 24 +- grub-core/lib/libgcrypt/src/ec-context.h | 107 + grub-core/lib/libgcrypt/src/fips.c | 802 +- grub-core/lib/libgcrypt/src/g10lib.h | 265 +- grub-core/lib/libgcrypt/src/gcrypt-int.h | 563 + grub-core/lib/libgcrypt/src/gcrypt-module.h | 240 - grub-core/lib/libgcrypt/src/gcrypt-testapi.h | 69 + grub-core/lib/libgcrypt/src/gcrypt.h.in | 1173 +- .../lib/libgcrypt/src/gen-note-integrity.sh | 123 + grub-core/lib/libgcrypt/src/global.c | 890 +- grub-core/lib/libgcrypt/src/hmac256.c | 85 +- grub-core/lib/libgcrypt/src/hwf-arm.c | 393 + grub-core/lib/libgcrypt/src/hwf-common.h | 28 + grub-core/lib/libgcrypt/src/hwf-ppc.c | 247 + grub-core/lib/libgcrypt/src/hwf-s390x.c | 231 + grub-core/lib/libgcrypt/src/hwf-x86.c | 414 + grub-core/lib/libgcrypt/src/hwfeatures.c | 314 +- .../lib/libgcrypt/src/libgcrypt-config.in | 16 +- grub-core/lib/libgcrypt/src/libgcrypt.def | 154 +- grub-core/lib/libgcrypt/src/libgcrypt.m4 | 96 +- grub-core/lib/libgcrypt/src/libgcrypt.pc.in | 18 + grub-core/lib/libgcrypt/src/libgcrypt.vers | 76 +- grub-core/lib/libgcrypt/src/misc.c | 345 +- grub-core/lib/libgcrypt/src/module.c | 212 - grub-core/lib/libgcrypt/src/mpi.h | 215 +- grub-core/lib/libgcrypt/src/mpicalc.c | 648 + grub-core/lib/libgcrypt/src/secmem.c | 616 +- grub-core/lib/libgcrypt/src/secmem.h | 11 +- grub-core/lib/libgcrypt/src/sexp.c | 1364 +- grub-core/lib/libgcrypt/src/stdmem.c | 44 +- grub-core/lib/libgcrypt/src/stdmem.h | 4 +- grub-core/lib/libgcrypt/src/types.h | 154 +- grub-core/lib/libgcrypt/src/versioninfo.rc.in | 2 +- grub-core/lib/libgcrypt/src/visibility.c | 951 +- grub-core/lib/libgcrypt/src/visibility.h | 1220 +- grub-core/lib/libgcrypt/tests/ChangeLog-2011 | 944 + grub-core/lib/libgcrypt/tests/Makefile.am | 129 + grub-core/lib/libgcrypt/tests/README | 9 + grub-core/lib/libgcrypt/tests/aeswrap.c | 470 + .../libgcrypt/tests/basic-disable-all-hwf.in | 4 + grub-core/lib/libgcrypt/tests/basic.c | 16557 ++++++++++ .../tests/basic_all_hwfeature_combinations.sh | 111 + grub-core/lib/libgcrypt/tests/bench-slope.c | 3176 ++ grub-core/lib/libgcrypt/tests/benchmark.c | 2063 ++ grub-core/lib/libgcrypt/tests/blake2b.h | 1539 + grub-core/lib/libgcrypt/tests/blake2s.h | 1027 + grub-core/lib/libgcrypt/tests/curves.c | 353 + grub-core/lib/libgcrypt/tests/dsa-rfc6979.c | 995 + grub-core/lib/libgcrypt/tests/fips186-dsa.c | 588 + grub-core/lib/libgcrypt/tests/fipsdrv.c | 2865 ++ grub-core/lib/libgcrypt/tests/gchash.c | 123 + grub-core/lib/libgcrypt/tests/genhashdata.c | 160 + .../lib/libgcrypt/tests/hashtest-256g.in | 7 + grub-core/lib/libgcrypt/tests/hashtest.c | 451 + grub-core/lib/libgcrypt/tests/hmac.c | 203 + grub-core/lib/libgcrypt/tests/keygen.c | 795 + grub-core/lib/libgcrypt/tests/keygrip.c | 404 + grub-core/lib/libgcrypt/tests/mpitests.c | 715 + grub-core/lib/libgcrypt/tests/pkbench.c | 485 + grub-core/lib/libgcrypt/tests/pkcs1v2-oaep.h | 781 + grub-core/lib/libgcrypt/tests/pkcs1v2-pss.h | 968 + grub-core/lib/libgcrypt/tests/pkcs1v2-v15c.h | 3919 +++ grub-core/lib/libgcrypt/tests/pkcs1v2-v15s.h | 3660 +++ grub-core/lib/libgcrypt/tests/pkcs1v2.c | 773 + grub-core/lib/libgcrypt/tests/prime.c | 241 + grub-core/lib/libgcrypt/tests/pubkey.c | 1348 + grub-core/lib/libgcrypt/tests/random.c | 826 + grub-core/lib/libgcrypt/tests/rsa-16k.key | 18 + grub-core/lib/libgcrypt/tests/rsacvt.c | 399 + grub-core/lib/libgcrypt/tests/sha3-224.h | 1025 + grub-core/lib/libgcrypt/tests/sha3-256.h | 1025 + grub-core/lib/libgcrypt/tests/sha3-384.h | 1025 + grub-core/lib/libgcrypt/tests/sha3-512.h | 1025 + grub-core/lib/libgcrypt/tests/stopwatch.h | 113 + grub-core/lib/libgcrypt/tests/t-common.h | 198 + grub-core/lib/libgcrypt/tests/t-convert.c | 712 + grub-core/lib/libgcrypt/tests/t-cv25519.c | 683 + grub-core/lib/libgcrypt/tests/t-dsa.c | 630 + grub-core/lib/libgcrypt/tests/t-dsa.inp | 2224 ++ grub-core/lib/libgcrypt/tests/t-ecdsa.c | 678 + grub-core/lib/libgcrypt/tests/t-ecdsa.inp | 2626 ++ grub-core/lib/libgcrypt/tests/t-ed25519.c | 518 + grub-core/lib/libgcrypt/tests/t-ed25519.inp | 6172 ++++ grub-core/lib/libgcrypt/tests/t-ed448.c | 547 + grub-core/lib/libgcrypt/tests/t-ed448.inp | 75 + grub-core/lib/libgcrypt/tests/t-kdf.c | 1641 + grub-core/lib/libgcrypt/tests/t-lock.c | 465 + grub-core/lib/libgcrypt/tests/t-mpi-bit.c | 362 + grub-core/lib/libgcrypt/tests/t-mpi-point.c | 4437 +++ grub-core/lib/libgcrypt/tests/t-rsa-15.c | 481 + grub-core/lib/libgcrypt/tests/t-rsa-15.inp | 576 + grub-core/lib/libgcrypt/tests/t-rsa-pss.c | 528 + grub-core/lib/libgcrypt/tests/t-rsa-pss.inp | 676 + .../lib/libgcrypt/tests/t-rsa-testparm.c | 130 + grub-core/lib/libgcrypt/tests/t-secmem.c | 218 + grub-core/lib/libgcrypt/tests/t-sexp.c | 1344 + grub-core/lib/libgcrypt/tests/t-x448.c | 626 + grub-core/lib/libgcrypt/tests/testapi.c | 132 + grub-core/lib/libgcrypt/tests/testdrv.c | 901 + grub-core/lib/libgcrypt/tests/version.c | 165 + 516 files changed, 331589 insertions(+), 31107 deletions(-) create mode 100644 grub-core/lib/libgcrypt/AUTHORS create mode 100644 grub-core/lib/libgcrypt/COPYING create mode 100644 grub-core/lib/libgcrypt/COPYING.LIB create mode 100644 grub-core/lib/libgcrypt/ChangeLog create mode 100644 grub-core/lib/libgcrypt/ChangeLog-2011 create mode 100644 grub-core/lib/libgcrypt/INSTALL create mode 100644 grub-core/lib/libgcrypt/LICENSES create mode 100644 grub-core/lib/libgcrypt/Makefile.am create mode 100644 grub-core/lib/libgcrypt/NEWS create mode 100644 grub-core/lib/libgcrypt/README create mode 100644 grub-core/lib/libgcrypt/README.GIT create mode 100644 grub-core/lib/libgcrypt/THANKS create mode 100644 grub-core/lib/libgcrypt/TODO create mode 100644 grub-core/lib/libgcrypt/VERSION create mode 100644 grub-core/lib/libgcrypt/acinclude.m4 create mode 100644 grub-core/lib/libgcrypt/aclocal.m4 create mode 100644 grub-core/lib/libgcrypt/autogen.rc create mode 100755 grub-core/lib/libgcrypt/autogen.sh create mode 100644 grub-core/lib/libgcrypt/build-aux/ChangeLog-2011 create mode 100755 grub-core/lib/libgcrypt/build-aux/compile create mode 100755 grub-core/lib/libgcrypt/build-aux/config.guess create mode 100755 grub-core/lib/libgcrypt/build-aux/config.rpath create mode 100755 grub-core/lib/libgcrypt/build-aux/config.sub create mode 100755 grub-core/lib/libgcrypt/build-aux/depcomp create mode 100644 grub-core/lib/libgcrypt/build-aux/git-log-fix create mode 100644 grub-core/lib/libgcrypt/build-aux/git-log-footer create mode 100755 grub-core/lib/libgcrypt/build-aux/install-sh create mode 100644 grub-core/lib/libgcrypt/build-aux/libtool-patch.sed create mode 100644 grub-core/lib/libgcrypt/build-aux/ltmain.sh create mode 100755 grub-core/lib/libgcrypt/build-aux/missing create mode 100644 grub-core/lib/libgcrypt/build-aux/texinfo.tex delete mode 100644 grub-core/lib/libgcrypt/cipher/ChangeLog delete mode 100644 grub-core/lib/libgcrypt/cipher/Manifest delete mode 100644 grub-core/lib/libgcrypt/cipher/ac.c create mode 100644 grub-core/lib/libgcrypt/cipher/arcfour-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/asm-common-aarch64.h create mode 100644 grub-core/lib/libgcrypt/cipher/asm-common-amd64.h create mode 100644 grub-core/lib/libgcrypt/cipher/asm-common-s390x.h create mode 100644 grub-core/lib/libgcrypt/cipher/asm-inline-s390x.h create mode 100644 grub-core/lib/libgcrypt/cipher/asm-poly1305-aarch64.h create mode 100644 grub-core/lib/libgcrypt/cipher/asm-poly1305-amd64.h create mode 100644 grub-core/lib/libgcrypt/cipher/asm-poly1305-s390x.h create mode 100644 grub-core/lib/libgcrypt/cipher/blake2.c create mode 100644 grub-core/lib/libgcrypt/cipher/blake2b-amd64-avx2.S create mode 100644 grub-core/lib/libgcrypt/cipher/blake2s-amd64-avx.S create mode 100644 grub-core/lib/libgcrypt/cipher/blowfish-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/blowfish-arm.S create mode 100644 grub-core/lib/libgcrypt/cipher/camellia-aarch64.S create mode 100644 grub-core/lib/libgcrypt/cipher/camellia-aesni-avx-amd64= .S create mode 100644 grub-core/lib/libgcrypt/cipher/camellia-aesni-avx2-amd6= 4.S create mode 100644 grub-core/lib/libgcrypt/cipher/camellia-aesni-avx2-amd6= 4.h create mode 100644 grub-core/lib/libgcrypt/cipher/camellia-arm.S create mode 100644 grub-core/lib/libgcrypt/cipher/camellia-vaes-avx2-amd64= .S create mode 100644 grub-core/lib/libgcrypt/cipher/cast5-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/cast5-arm.S create mode 100644 grub-core/lib/libgcrypt/cipher/chacha20-aarch64.S create mode 100644 grub-core/lib/libgcrypt/cipher/chacha20-amd64-avx2.S create mode 100644 grub-core/lib/libgcrypt/cipher/chacha20-amd64-ssse3.S create mode 100644 grub-core/lib/libgcrypt/cipher/chacha20-armv7-neon.S create mode 100644 grub-core/lib/libgcrypt/cipher/chacha20-ppc.c create mode 100644 grub-core/lib/libgcrypt/cipher/chacha20-s390x.S create mode 100644 grub-core/lib/libgcrypt/cipher/chacha20.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-aeswrap.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-cbc.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-ccm.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-cfb.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-cmac.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-ctr.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-eax.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-gcm-armv7-neon.S create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-gcm-armv8-aarch32= -ce.S create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-gcm-armv8-aarch64= -ce.S create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-gcm-intel-pclmul.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-gcm-ppc.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-gcm-siv.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-gcm.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-internal.h create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-ocb.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-ofb.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-poly1305.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-selftest.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-selftest.h create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-siv.c create mode 100644 grub-core/lib/libgcrypt/cipher/cipher-xts.c create mode 100644 grub-core/lib/libgcrypt/cipher/crc-armv8-aarch64-ce.S create mode 100644 grub-core/lib/libgcrypt/cipher/crc-armv8-ce.c create mode 100644 grub-core/lib/libgcrypt/cipher/crc-intel-pclmul.c create mode 100644 grub-core/lib/libgcrypt/cipher/crc-ppc.c create mode 100644 grub-core/lib/libgcrypt/cipher/des-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/dsa-common.c create mode 100644 grub-core/lib/libgcrypt/cipher/ecc-common.h create mode 100644 grub-core/lib/libgcrypt/cipher/ecc-curves.c create mode 100644 grub-core/lib/libgcrypt/cipher/ecc-ecdh.c create mode 100644 grub-core/lib/libgcrypt/cipher/ecc-ecdsa.c create mode 100644 grub-core/lib/libgcrypt/cipher/ecc-eddsa.c create mode 100644 grub-core/lib/libgcrypt/cipher/ecc-gost.c create mode 100644 grub-core/lib/libgcrypt/cipher/ecc-misc.c create mode 100644 grub-core/lib/libgcrypt/cipher/ecc-sm2.c create mode 100644 grub-core/lib/libgcrypt/cipher/gost-s-box.c create mode 100644 grub-core/lib/libgcrypt/cipher/gost-sb.h create mode 100644 grub-core/lib/libgcrypt/cipher/gost.h create mode 100644 grub-core/lib/libgcrypt/cipher/gost28147.c create mode 100644 grub-core/lib/libgcrypt/cipher/gostr3411-94.c delete mode 100644 grub-core/lib/libgcrypt/cipher/hmac-tests.c create mode 100644 grub-core/lib/libgcrypt/cipher/kdf-internal.h create mode 100644 grub-core/lib/libgcrypt/cipher/keccak-armv7-neon.S create mode 100644 grub-core/lib/libgcrypt/cipher/keccak.c create mode 100644 grub-core/lib/libgcrypt/cipher/keccak_permute_32.h create mode 100644 grub-core/lib/libgcrypt/cipher/keccak_permute_64.h create mode 100644 grub-core/lib/libgcrypt/cipher/mac-cmac.c create mode 100644 grub-core/lib/libgcrypt/cipher/mac-gmac.c create mode 100644 grub-core/lib/libgcrypt/cipher/mac-hmac.c create mode 100644 grub-core/lib/libgcrypt/cipher/mac-internal.h create mode 100644 grub-core/lib/libgcrypt/cipher/mac-poly1305.c create mode 100644 grub-core/lib/libgcrypt/cipher/mac.c create mode 100644 grub-core/lib/libgcrypt/cipher/poly1305-internal.h create mode 100644 grub-core/lib/libgcrypt/cipher/poly1305-s390x.S create mode 100644 grub-core/lib/libgcrypt/cipher/poly1305.c create mode 100644 grub-core/lib/libgcrypt/cipher/pubkey-internal.h create mode 100644 grub-core/lib/libgcrypt/cipher/pubkey-util.c create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-aarch64.S create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-aesni.c create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-arm.S create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-armv8-aarch32-c= e.S create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-armv8-aarch64-c= e.S create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-armv8-ce.c create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-gcm-p10le.s create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-internal.h create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-p10le.c create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-padlock.c create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-ppc-common.h create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-ppc-functions.h create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-ppc.c create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-ppc9le.c create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-s390x.c create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-ssse3-amd64-asm= .S create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-ssse3-amd64.c create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-vaes-avx2-amd64= .S create mode 100644 grub-core/lib/libgcrypt/cipher/rijndael-vaes.c create mode 100644 grub-core/lib/libgcrypt/cipher/rsa-common.c create mode 100644 grub-core/lib/libgcrypt/cipher/salsa20-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/salsa20-armv7-neon.S create mode 100644 grub-core/lib/libgcrypt/cipher/salsa20.c create mode 100644 grub-core/lib/libgcrypt/cipher/scrypt.c create mode 100644 grub-core/lib/libgcrypt/cipher/serpent-armv7-neon.S create mode 100644 grub-core/lib/libgcrypt/cipher/serpent-avx2-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/serpent-sse2-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha1-armv7-neon.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha1-armv8-aarch32-ce.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha1-armv8-aarch64-ce.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha1-avx-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha1-avx-bmi2-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha1-avx2-bmi2-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha1-intel-shaext.c create mode 100644 grub-core/lib/libgcrypt/cipher/sha1-ssse3-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha1.h create mode 100644 grub-core/lib/libgcrypt/cipher/sha256-armv8-aarch32-ce.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha256-armv8-aarch64-ce.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha256-avx-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha256-avx2-bmi2-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha256-intel-shaext.c create mode 100644 grub-core/lib/libgcrypt/cipher/sha256-ppc.c create mode 100644 grub-core/lib/libgcrypt/cipher/sha256-ssse3-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha512-arm.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha512-armv7-neon.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha512-avx-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha512-avx2-bmi2-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha512-ppc.c create mode 100644 grub-core/lib/libgcrypt/cipher/sha512-ssse3-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sha512-ssse3-i386.c create mode 100644 grub-core/lib/libgcrypt/cipher/sm3-aarch64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sm3-avx-bmi2-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sm3.c create mode 100644 grub-core/lib/libgcrypt/cipher/sm4-aesni-avx-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sm4-aesni-avx2-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/sm4.c create mode 100644 grub-core/lib/libgcrypt/cipher/stribog.c delete mode 100644 grub-core/lib/libgcrypt/cipher/test-getrusage.c create mode 100644 grub-core/lib/libgcrypt/cipher/twofish-aarch64.S create mode 100644 grub-core/lib/libgcrypt/cipher/twofish-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/twofish-arm.S create mode 100644 grub-core/lib/libgcrypt/cipher/twofish-avx2-amd64.S create mode 100644 grub-core/lib/libgcrypt/cipher/whirlpool-sse2-amd64.S create mode 100644 grub-core/lib/libgcrypt/compat/Makefile.am create mode 100644 grub-core/lib/libgcrypt/compat/clock.c create mode 100644 grub-core/lib/libgcrypt/compat/compat.c create mode 100644 grub-core/lib/libgcrypt/compat/getpid.c create mode 100644 grub-core/lib/libgcrypt/compat/libcompat.h create mode 100644 grub-core/lib/libgcrypt/config.h.in create mode 100755 grub-core/lib/libgcrypt/configure create mode 100644 grub-core/lib/libgcrypt/configure.ac create mode 100644 grub-core/lib/libgcrypt/doc/ChangeLog-2011 create mode 100644 grub-core/lib/libgcrypt/doc/DCO create mode 100644 grub-core/lib/libgcrypt/doc/HACKING create mode 100644 grub-core/lib/libgcrypt/doc/Makefile.am create mode 100644 grub-core/lib/libgcrypt/doc/README.apichanges create mode 100644 grub-core/lib/libgcrypt/doc/fips-fsm.fig create mode 100644 grub-core/lib/libgcrypt/doc/fips-fsm.pdf create mode 100644 grub-core/lib/libgcrypt/doc/fips-fsm.png create mode 100644 grub-core/lib/libgcrypt/doc/gcrypt.info create mode 100644 grub-core/lib/libgcrypt/doc/gcrypt.info-1 create mode 100644 grub-core/lib/libgcrypt/doc/gcrypt.info-2 create mode 100644 grub-core/lib/libgcrypt/doc/gcrypt.texi create mode 100644 grub-core/lib/libgcrypt/doc/gpl.texi create mode 100644 grub-core/lib/libgcrypt/doc/lgpl.texi create mode 100644 grub-core/lib/libgcrypt/doc/libgcrypt-modules.fig create mode 100644 grub-core/lib/libgcrypt/doc/libgcrypt-modules.pdf create mode 100644 grub-core/lib/libgcrypt/doc/libgcrypt-modules.png create mode 100644 grub-core/lib/libgcrypt/doc/stamp-vti create mode 100644 grub-core/lib/libgcrypt/doc/version.texi create mode 100644 grub-core/lib/libgcrypt/doc/yat2m.c create mode 100644 grub-core/lib/libgcrypt/m4/ChangeLog-2011 create mode 100644 grub-core/lib/libgcrypt/m4/Makefile.am create mode 100644 grub-core/lib/libgcrypt/m4/ax_cc_for_build.m4 create mode 100644 grub-core/lib/libgcrypt/m4/gpg-error.m4 create mode 100644 grub-core/lib/libgcrypt/m4/libtool.m4 create mode 100644 grub-core/lib/libgcrypt/m4/ltoptions.m4 create mode 100644 grub-core/lib/libgcrypt/m4/ltsugar.m4 create mode 100644 grub-core/lib/libgcrypt/m4/ltversion.m4 create mode 100644 grub-core/lib/libgcrypt/m4/lt~obsolete.m4 create mode 100644 grub-core/lib/libgcrypt/m4/noexecstack.m4 create mode 100644 grub-core/lib/libgcrypt/m4/socklen.m4 create mode 100755 grub-core/lib/libgcrypt/mkinstalldirs delete mode 100644 grub-core/lib/libgcrypt/mpi/Manifest rename grub-core/lib/libgcrypt/mpi/{pentium4/sse2 =3D> aarch64}/distfiles = (80%) create mode 100644 grub-core/lib/libgcrypt/mpi/aarch64/mpi-asm-defs.h create mode 100644 grub-core/lib/libgcrypt/mpi/aarch64/mpih-add1.S create mode 100644 grub-core/lib/libgcrypt/mpi/aarch64/mpih-mul1.S create mode 100644 grub-core/lib/libgcrypt/mpi/aarch64/mpih-mul2.S create mode 100644 grub-core/lib/libgcrypt/mpi/aarch64/mpih-mul3.S create mode 100644 grub-core/lib/libgcrypt/mpi/aarch64/mpih-sub1.S create mode 100644 grub-core/lib/libgcrypt/mpi/amd64/func_abi.h rename grub-core/lib/libgcrypt/mpi/{i586 =3D> arm}/distfiles (57%) create mode 100644 grub-core/lib/libgcrypt/mpi/arm/mpi-asm-defs.h create mode 100644 grub-core/lib/libgcrypt/mpi/arm/mpih-add1.S create mode 100644 grub-core/lib/libgcrypt/mpi/arm/mpih-mul1.S create mode 100644 grub-core/lib/libgcrypt/mpi/arm/mpih-mul2.S create mode 100644 grub-core/lib/libgcrypt/mpi/arm/mpih-mul3.S create mode 100644 grub-core/lib/libgcrypt/mpi/arm/mpih-sub1.S create mode 100644 grub-core/lib/libgcrypt/mpi/asm-common-aarch64.h create mode 100644 grub-core/lib/libgcrypt/mpi/asm-common-amd64.h rename grub-core/lib/libgcrypt/{cipher/rmd.h =3D> mpi/ec-ed25519.c} (52%) create mode 100644 grub-core/lib/libgcrypt/mpi/ec-hw-s390x.c create mode 100644 grub-core/lib/libgcrypt/mpi/ec-inline.h create mode 100644 grub-core/lib/libgcrypt/mpi/ec-internal.h create mode 100644 grub-core/lib/libgcrypt/mpi/ec-nist.c delete mode 100644 grub-core/lib/libgcrypt/mpi/generic/Manifest delete mode 100644 grub-core/lib/libgcrypt/mpi/i386/Manifest delete mode 100644 grub-core/lib/libgcrypt/mpi/i586/Manifest delete mode 100644 grub-core/lib/libgcrypt/mpi/i586/README delete mode 100644 grub-core/lib/libgcrypt/mpi/i586/mpih-add1.S delete mode 100644 grub-core/lib/libgcrypt/mpi/i586/mpih-lshift.S delete mode 100644 grub-core/lib/libgcrypt/mpi/i586/mpih-mul1.S delete mode 100644 grub-core/lib/libgcrypt/mpi/i586/mpih-mul2.S delete mode 100644 grub-core/lib/libgcrypt/mpi/i586/mpih-mul3.S delete mode 100644 grub-core/lib/libgcrypt/mpi/i586/mpih-rshift.S delete mode 100644 grub-core/lib/libgcrypt/mpi/i586/mpih-sub1.S delete mode 100644 grub-core/lib/libgcrypt/mpi/m68k/Manifest delete mode 100644 grub-core/lib/libgcrypt/mpi/m68k/mc68020/Manifest delete mode 100644 grub-core/lib/libgcrypt/mpi/mips3/Manifest create mode 100644 grub-core/lib/libgcrypt/mpi/mpih-const-time.c delete mode 100644 grub-core/lib/libgcrypt/mpi/pa7100/Manifest delete mode 100644 grub-core/lib/libgcrypt/mpi/pentium4/README delete mode 100644 grub-core/lib/libgcrypt/mpi/pentium4/distfiles delete mode 100644 grub-core/lib/libgcrypt/mpi/pentium4/mmx/distfiles delete mode 100644 grub-core/lib/libgcrypt/mpi/pentium4/mmx/mpih-lshift.S delete mode 100644 grub-core/lib/libgcrypt/mpi/pentium4/mmx/mpih-rshift.S delete mode 100644 grub-core/lib/libgcrypt/mpi/pentium4/sse2/mpih-add1.S delete mode 100644 grub-core/lib/libgcrypt/mpi/pentium4/sse2/mpih-mul1.S delete mode 100644 grub-core/lib/libgcrypt/mpi/pentium4/sse2/mpih-mul2.S delete mode 100644 grub-core/lib/libgcrypt/mpi/pentium4/sse2/mpih-mul3.S delete mode 100644 grub-core/lib/libgcrypt/mpi/pentium4/sse2/mpih-sub1.S delete mode 100644 grub-core/lib/libgcrypt/mpi/power/Manifest delete mode 100644 grub-core/lib/libgcrypt/mpi/powerpc32/Manifest delete mode 100644 grub-core/lib/libgcrypt/mpi/sparc32/Manifest delete mode 100644 grub-core/lib/libgcrypt/mpi/sparc32v8/Manifest delete mode 100644 grub-core/lib/libgcrypt/mpi/supersparc/Manifest create mode 100644 grub-core/lib/libgcrypt/random/ChangeLog-2011 create mode 100644 grub-core/lib/libgcrypt/random/Makefile.am create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy-base-user.h create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy-base.c create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy-base.h create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy-gcd.c create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy-gcd.h create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy-health.c create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy-health.h create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy-noise.c create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy-noise.h create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy-sha3.c create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy-sha3.h create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy-timer.c create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy-timer.h create mode 100644 grub-core/lib/libgcrypt/random/jitterentropy.h create mode 100644 grub-core/lib/libgcrypt/random/rand-internal.h create mode 100644 grub-core/lib/libgcrypt/random/random-csprng.c create mode 100644 grub-core/lib/libgcrypt/random/random-drbg.c create mode 100644 grub-core/lib/libgcrypt/random/random-system.c create mode 100644 grub-core/lib/libgcrypt/random/random.c create mode 100644 grub-core/lib/libgcrypt/random/random.h create mode 100644 grub-core/lib/libgcrypt/random/rndegd.c create mode 100644 grub-core/lib/libgcrypt/random/rndgetentropy.c create mode 100644 grub-core/lib/libgcrypt/random/rndhw.c create mode 100644 grub-core/lib/libgcrypt/random/rndjent.c create mode 100644 grub-core/lib/libgcrypt/random/rndoldlinux.c create mode 100644 grub-core/lib/libgcrypt/random/rndunix.c create mode 100644 grub-core/lib/libgcrypt/random/rndw32.c create mode 100644 grub-core/lib/libgcrypt/random/rndw32ce.c delete mode 100644 grub-core/lib/libgcrypt/src/Manifest delete mode 100644 grub-core/lib/libgcrypt/src/ath.c delete mode 100644 grub-core/lib/libgcrypt/src/ath.h create mode 100644 grub-core/lib/libgcrypt/src/const-time.c create mode 100644 grub-core/lib/libgcrypt/src/const-time.h create mode 100644 grub-core/lib/libgcrypt/src/context.c create mode 100644 grub-core/lib/libgcrypt/src/context.h create mode 100644 grub-core/lib/libgcrypt/src/ec-context.h create mode 100644 grub-core/lib/libgcrypt/src/gcrypt-int.h delete mode 100644 grub-core/lib/libgcrypt/src/gcrypt-module.h create mode 100644 grub-core/lib/libgcrypt/src/gcrypt-testapi.h create mode 100755 grub-core/lib/libgcrypt/src/gen-note-integrity.sh create mode 100644 grub-core/lib/libgcrypt/src/hwf-arm.c create mode 100644 grub-core/lib/libgcrypt/src/hwf-common.h create mode 100644 grub-core/lib/libgcrypt/src/hwf-ppc.c create mode 100644 grub-core/lib/libgcrypt/src/hwf-s390x.c create mode 100644 grub-core/lib/libgcrypt/src/hwf-x86.c create mode 100644 grub-core/lib/libgcrypt/src/libgcrypt.pc.in delete mode 100644 grub-core/lib/libgcrypt/src/module.c create mode 100644 grub-core/lib/libgcrypt/src/mpicalc.c create mode 100644 grub-core/lib/libgcrypt/tests/ChangeLog-2011 create mode 100644 grub-core/lib/libgcrypt/tests/Makefile.am create mode 100644 grub-core/lib/libgcrypt/tests/README create mode 100644 grub-core/lib/libgcrypt/tests/aeswrap.c create mode 100644 grub-core/lib/libgcrypt/tests/basic-disable-all-hwf.in create mode 100644 grub-core/lib/libgcrypt/tests/basic.c create mode 100755 grub-core/lib/libgcrypt/tests/basic_all_hwfeature_combi= nations.sh create mode 100644 grub-core/lib/libgcrypt/tests/bench-slope.c create mode 100644 grub-core/lib/libgcrypt/tests/benchmark.c create mode 100644 grub-core/lib/libgcrypt/tests/blake2b.h create mode 100644 grub-core/lib/libgcrypt/tests/blake2s.h create mode 100644 grub-core/lib/libgcrypt/tests/curves.c create mode 100644 grub-core/lib/libgcrypt/tests/dsa-rfc6979.c create mode 100644 grub-core/lib/libgcrypt/tests/fips186-dsa.c create mode 100644 grub-core/lib/libgcrypt/tests/fipsdrv.c create mode 100644 grub-core/lib/libgcrypt/tests/gchash.c create mode 100644 grub-core/lib/libgcrypt/tests/genhashdata.c create mode 100755 grub-core/lib/libgcrypt/tests/hashtest-256g.in create mode 100644 grub-core/lib/libgcrypt/tests/hashtest.c create mode 100644 grub-core/lib/libgcrypt/tests/hmac.c create mode 100644 grub-core/lib/libgcrypt/tests/keygen.c create mode 100644 grub-core/lib/libgcrypt/tests/keygrip.c create mode 100644 grub-core/lib/libgcrypt/tests/mpitests.c create mode 100644 grub-core/lib/libgcrypt/tests/pkbench.c create mode 100644 grub-core/lib/libgcrypt/tests/pkcs1v2-oaep.h create mode 100644 grub-core/lib/libgcrypt/tests/pkcs1v2-pss.h create mode 100644 grub-core/lib/libgcrypt/tests/pkcs1v2-v15c.h create mode 100644 grub-core/lib/libgcrypt/tests/pkcs1v2-v15s.h create mode 100644 grub-core/lib/libgcrypt/tests/pkcs1v2.c create mode 100644 grub-core/lib/libgcrypt/tests/prime.c create mode 100644 grub-core/lib/libgcrypt/tests/pubkey.c create mode 100644 grub-core/lib/libgcrypt/tests/random.c create mode 100644 grub-core/lib/libgcrypt/tests/rsa-16k.key create mode 100644 grub-core/lib/libgcrypt/tests/rsacvt.c create mode 100644 grub-core/lib/libgcrypt/tests/sha3-224.h create mode 100644 grub-core/lib/libgcrypt/tests/sha3-256.h create mode 100644 grub-core/lib/libgcrypt/tests/sha3-384.h create mode 100644 grub-core/lib/libgcrypt/tests/sha3-512.h create mode 100644 grub-core/lib/libgcrypt/tests/stopwatch.h create mode 100644 grub-core/lib/libgcrypt/tests/t-common.h create mode 100644 grub-core/lib/libgcrypt/tests/t-convert.c create mode 100644 grub-core/lib/libgcrypt/tests/t-cv25519.c create mode 100644 grub-core/lib/libgcrypt/tests/t-dsa.c create mode 100644 grub-core/lib/libgcrypt/tests/t-dsa.inp create mode 100644 grub-core/lib/libgcrypt/tests/t-ecdsa.c create mode 100644 grub-core/lib/libgcrypt/tests/t-ecdsa.inp create mode 100644 grub-core/lib/libgcrypt/tests/t-ed25519.c create mode 100644 grub-core/lib/libgcrypt/tests/t-ed25519.inp create mode 100644 grub-core/lib/libgcrypt/tests/t-ed448.c create mode 100644 grub-core/lib/libgcrypt/tests/t-ed448.inp create mode 100644 grub-core/lib/libgcrypt/tests/t-kdf.c create mode 100644 grub-core/lib/libgcrypt/tests/t-lock.c create mode 100644 grub-core/lib/libgcrypt/tests/t-mpi-bit.c create mode 100644 grub-core/lib/libgcrypt/tests/t-mpi-point.c create mode 100644 grub-core/lib/libgcrypt/tests/t-rsa-15.c create mode 100644 grub-core/lib/libgcrypt/tests/t-rsa-15.inp create mode 100644 grub-core/lib/libgcrypt/tests/t-rsa-pss.c create mode 100644 grub-core/lib/libgcrypt/tests/t-rsa-pss.inp create mode 100644 grub-core/lib/libgcrypt/tests/t-rsa-testparm.c create mode 100644 grub-core/lib/libgcrypt/tests/t-secmem.c create mode 100644 grub-core/lib/libgcrypt/tests/t-sexp.c create mode 100644 grub-core/lib/libgcrypt/tests/t-x448.c create mode 100644 grub-core/lib/libgcrypt/tests/testapi.c create mode 100644 grub-core/lib/libgcrypt/tests/testdrv.c create mode 100644 grub-core/lib/libgcrypt/tests/version.c diff --git a/grub-core/lib/libgcrypt/AUTHORS b/grub-core/lib/libgcrypt/AUTH= ORS new file mode 100644 index 000000000..bc6182ec1 --- /dev/null +++ b/grub-core/lib/libgcrypt/AUTHORS @@ -0,0 +1,264 @@ +Library: Libgcrypt +Homepage: https://www.gnupg.org/related_software/libgcrypt/ +Download: https://ftp.gnupg.org/ftp/gcrypt/libgcrypt/ + ftp://ftp.gnupg.org/gcrypt/libgcrypt/ +Repository: git://git.gnupg.org/libgcrypt.git +Maintainer: Werner Koch +Bug reports: https://bugs.gnupg.org +Security related bug reports: +End-of-life: TBD +License (library): LGPLv2.1+ +License (manual and tools): GPLv2+ + + +Libgcrypt is free software. See the files COPYING.LIB and COPYING for +copying conditions, and LICENSES for notices about a few contributions +that require these additional notices to be distributed. License +copyright years may be listed using range notation, e.g., 2000-2013, +indicating that every year in the range, inclusive, is a copyrightable +year that would otherwise be listed individually. + + +List of Copyright holders +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + + Copyright (C) 1989,1991-2018 Free Software Foundation, Inc. + Copyright (C) 1994 X Consortium + Copyright (C) 1996 L. Peter Deutsch + Copyright (C) 1997 Werner Koch + Copyright (C) 1998 The Internet Society + Copyright (C) 1996-1999 Peter Gutmann, Paul Kendall, and Chris Wedgwood + Copyright (C) 1996-2006 Peter Gutmann, Matt Thomlinson and Blake Coverett + Copyright (C) 2003 Nikos Mavroyanopoulos + Copyright (c) 2006 CRYPTOGAMS + Copyright (C) 2006-2007 NTT (Nippon Telegraph and Telephone Corporation) + Copyright (C) 2012-2023 g10 Code GmbH + Copyright (C) 2012 Simon Josefsson, Niels M=C3=B6ller + Copyright (c) 2012 Intel Corporation + Copyright (C) 2013 Christian Grothoff + Copyright (C) 2013-2022 Jussi Kivilinna + Copyright (C) 2013-2014 Dmitry Eremin-Solenikov + Copyright (C) 2014 Stephan Mueller + Copyright (C) 2017 Jia Zhang + Copyright (C) 2018 Bundesamt f=C3=BCr Sicherheit in der Informationstech= nik + Copyright (C) 2020 Alibaba Group. + Copyright (C) 2020 Tianjia Zhang + + +Authors with a FSF copyright assignment +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +LIBGCRYPT Werner Koch 2001-06-07 +Assigns past and future changes. +Assignment for future changes terminated on 2012-12-04. +wk@gnupg.org +Designed and implemented Libgcrypt. + +GNUPG Matthew Skala 1998-08-10 +Disclaims changes. +mskala@ansuz.sooke.bc.ca +Wrote cipher/twofish.c. + +GNUPG Natural Resources Canada 1998-08-11 +Disclaims changes by Matthew Skala. + +GNUPG Michael Roth Germany 1998-09-17 +Assigns changes. +mroth@nessie.de +Wrote cipher/des.c. +Changes and bug fixes all over the place. + +GNUPG Niklas Hernaeus 1998-09-18 +Disclaims changes. +nh@df.lth.se +Weak key patches. + +GNUPG R=C3=A9mi Guyomarch 1999-05-25 +Assigns past and future changes. (g10/compress.c, g10/encr-data.c, +g10/free-packet.c, g10/mdfilter.c, g10/plaintext.c, util/iobuf.c) +rguyom@mail.dotcom.fr + +ANY g10 Code GmbH 2001-06-07 +Assignment for future changes terminated on 2012-12-04. +Code marked with ChangeLog entries of g10 Code employees. + +LIBGCRYPT Timo Schulz 2001-08-31 +Assigns past and future changes. +twoaday@freakmail.de + +LIBGCRYPT Simon Josefsson 2002-10-25 +Assigns past and future changes to FSF (cipher/{md4,crc}.c, CTR mode, +CTS/MAC flags, self test improvements) +simon@josefsson.org + +LIBGCRYPT Moritz Schulte 2003-04-17 +Assigns past and future changes. +moritz@g10code.com + +GNUTLS Nikolaos Mavrogiannopoulos 2003-11-22 +nmav@gnutls.org +Original code for cipher/rfc2268.c. + +LIBGCRYPT The Written Word 2005-04-15 +Assigns past and future changes. (new: src/libgcrypt.pc.in, +src/Makefile.am, src/secmem.c, mpi/hppa1.1/mpih-mul3.S, +mpi/hppa1.1/udiv-qrnnd.S, mpi/hppa1.1/mpih-mul2.S, +mpi/hppa1.1/mpih-mul1.S, mpi/Makefile.am, tests/prime.c, +tests/register.c, tests/ac.c, tests/basic.c, tests/tsexp.c, +tests/keygen.c, tests/pubkey.c, configure.ac, acinclude.m4) + +LIBGCRYPT Brad Hards 2006-02-09 +Assigns Past and Future Changes +bradh@frogmouth.net +(Added OFB mode. Changed cipher/cipher.c, test/basic.c doc/gcrypt.tex. + added SHA-224, changed cipher/sha256.c, added HMAC tests.) + +LIBGCRYPT Hye-Shik Chang 2006-09-07 +Assigns Past and Future Changes +perky@freebsd.org +(SEED cipher) + +LIBGCRYPT Werner Dittmann 2009-05-20 +Assigns Past and Future Changes +werner.dittmann@t-online.de +(mpi/amd64, tests/mpitests.c) + +GNUPG David Shaw +Assigns past and future changes. +dshaw@jabberwocky.com +(cipher/camellia-glue.c and related stuff) + +LIBGCRYPT Andrey Jivsov 2010-12-09 +Assigns Past and Future Changes +openpgp@brainhub.org +(cipher/ecc.c and related files) + +LIBGCRYPT Ulrich M=C3=BCller 2012-02-15 +Assigns Past and Future Changes +ulm@gentoo.org +(Changes to cipher/idea.c and related files) + +LIBGCRYPT Vladimir Serbinenko 2012-04-26 +Assigns Past and Future Changes +phcoder@gmail.com +(cipher/serpent.c) + + +Authors with a DCO +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Andrei Scherer +2014-08-22:BF7CEF794F9.000003F0andsch@inbox.com: + +Christian Aistleitner +2013-02-26:20130226110144.GA12678@quelltextlich.at: + +Christian Grothoff +2013-03-21:514B5D8A.6040705@grothoff.org: + +Clemens Lang +2022-02-10:20220210133844.46581-1-cllang@redhat.com: + +Danny Tsen +2021-12-20:OF85D11C2F.7A339D7D-ON002587B1.0042A81E-002587B1.0042B94D@ibm.c= om + +Dmitry Baryshkov +Dmitry Eremin-Solenikov +2013-07-13:20130713144407.GA27334@fangorn.rup.mentorg.com: + +Dmitry Kasatkin +2012-12-14:50CAE2DB.80302@intel.com: + +H.J. Lu +2020-01-19:20200119135241.GA4970@gmail.com: + +Jia Zhang +2017-10-17:59E56E30.9060503@alibaba-inc.com: + +J=C3=A9r=C3=A9mie Courr=C3=A8ges-Anglas +2016-05-26:87bn3ssqg0.fsf@ritchie.wxcvbn.org: + +Jussi Kivilinna +2012-11-15:20121115172331.150537dzb5i6jmy8@www.dalek.fi: + +Jussi Kivilinna +2013-05-06:5186720A.4090101@iki.fi: + +Markus Teich +2014-10-08:20141008180509.GA2770@trolle: + +Martin Storsj=C3=B6 +2018-03-28:dc1605ce-a47d-34c5-8851-d9569f9ea5d3@martin.st: + +Mathias L. Baumann +2017-01-30:07c06d79-0828-b564-d604-fd16c7c86ebe@sociomantic.com: + +Milan Broz +2014-01-13:52D44CC6.4050707@gmail.com: + +Paul Wolneykien +2019-11-19:20191119204459.312927aa@rigel.localdomain: + +Peter Wu +2015-07-22:20150722191325.GA8113@al: + +Rafa=C3=ABl Carr=C3=A9 +2012-04-20:4F91988B.1080502@videolan.org: + +Sergey V. +2013-11-07:2066221.5IYa7Yq760@darkstar: + +Shawn Landden +2019-07-09:2794651562684255@iva4-64850291ca1c.qloud-c.yandex.net: + +Stephan Mueller +2014-08-22:2008899.25OeoelVVA@myon.chronox.de: + +Tianjia Zhang +2020-01-08:dcda0127-2f45-93a3-0736-27259a33bffa@linux.alibaba.com: + +Tom=C3=A1=C5=A1 Mr=C3=A1z +2012-04-16:1334571250.5056.52.camel@vespa.frost.loc: + +Vitezslav Cizek +2015-11-05:20151105131424.GA32700@kolac.suse.cz: + +Werner Koch (g10 Code GmbH) +2012-12-05:87obi8u4h2.fsf@vigenere.g10code.de: + + +More credits +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Libgcrypt used to be part of GnuPG but has been taken out into its own +package on 2000-12-21. + +Most of the stuff in mpi has been taken from an old GMP library +version by Torbjorn Granlund . + +The files cipher/rndunix.c and cipher/rndw32.c are based on those +files from Cryptlib. Copyright Peter Gutmann, Paul Kendall, and Chris +Wedgwood 1996-1999. + +The ECC code cipher/ecc.c was based on code by Sergi Blanch i Torne, +sergi at calcurco dot org. + +The implementation of the Camellia cipher has been been taken from the +original NTT provided GPL source. + +The CAVS testing program tests/cavs_driver.pl is not to be considered +a part of libgcrypt proper. We distribute it merely for convenience. +It has a permissive license and is copyrighted by atsec information +security corporation. See the file for details. + +The file salsa20.c is based on D.J. Bernstein's public domain code and +taken from Nettle. Copyright 2012 Simon Josefsson and Niels M=C3=B6ller. + + + This file is free software; as a special exception the author gives + unlimited permission to copy and/or distribute it, with or without + modifications, as long as this notice is preserved. + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY, to the extent permitted by law; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/grub-core/lib/libgcrypt/COPYING b/grub-core/lib/libgcrypt/COPY= ING new file mode 100644 index 000000000..d60c31a97 --- /dev/null +++ b/grub-core/lib/libgcrypt/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. +=0C + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) +=0C +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; o= r, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. +=0C + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. +=0C + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Softwa= re +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS +=0C + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 = USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show = w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/grub-core/lib/libgcrypt/COPYING.LIB b/grub-core/lib/libgcrypt/= COPYING.LIB new file mode 100644 index 000000000..cf9b6b997 --- /dev/null +++ b/grub-core/lib/libgcrypt/COPYING.LIB @@ -0,0 +1,510 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. +^L + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. +^L + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. +=0C + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. +^L + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. +^L + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. +^L + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. +^L + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. +^L + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS +^L + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 U= SA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/grub-core/lib/libgcrypt/ChangeLog b/grub-core/lib/libgcrypt/Ch= angeLog new file mode 100644 index 000000000..53fec8d8b --- /dev/null +++ b/grub-core/lib/libgcrypt/ChangeLog @@ -0,0 +1,17275 @@ +2023-11-14 Werner Koch + + Release 1.10.3. + + commit aa1610866f8e42bdc272584f0a717f32ee050a22 + + +2023-11-07 Jussi Kivilinna + + mpih_mod: avoid unintentional conditional branch. + + commit 11973c2219da0f732338cf080a4edeb6a89c313e + * mpi/mpih-const-time.c (_gcry_mpih_mod): Avoid conditional branch + on the_bit extraction. + + mpih-const-time: use constant-time comparisons conditional add/sub/abs. + + commit 74588de441fd98f6dd99132e67e0c2632cb2a6bd + * mpi/mpih-const-time.c (mpih_ct_limb_greater_than) + (mpih_ct_limb_less_than): New. + (_gcry_mpih_add_n_cond, _gcry_mpih_sub_n_cond, _gcry_mpih_abs_cond): Use + mpih_ct_limb_greater_than and mpih_ct_limb_less_than for comparisons. + + const-time: add functions for generating masks from 0/1 input. + + commit 01e7052cb245619280769f683d697d6b2f68e041 + * mpi/ec-nist.c (_gcry_mpi_ec_nist192_mod, _gcry_mpi_ec_nist224_mod) + (_gcry_mpi_ec_nist256_mod, _gcry_mpi_ec_nist384_mod): Use mask + generating functions. + * mpi/mpi-internal.h (ct_limb_gen_mask, ct_limb_gen_inv_mask): New. + * mpi/mpih-const-time.c (_gcry_mpih_set_cond, _gcry_mpih_add_n_cond) + (_gcry_mpih_sub_n_cond, _gcry_mpih_sub_n_cond, _gcry_mpih_swap_cond): + Use mask generating functions. + * mpi/mpiutil.c (_gcry_mpi_set_cond, _gcry_mpi_swap_cond): Use mask + generating functions. + * src/const-time.h (DEFINE_CT_TYPE_GEN_MASK, ct_uintptr_gen_mask) + (ct_ulong_gen_mask, DEFINE_CT_TYPE_GEN_INV_MASK) + (ct_uintptr_gen_inv_mask, ct_ulong_gen_inv_mask): New. + (DEFINE_CT_TYPE_SELECT_FUNC): Use mask generating functions. + * src/const-time.c (_gcry_ct_memmov_cond): Use mask generating + functions. + + ec: avoid unintentional condition branches for 25519, 448 and 256k1. + + commit 237523b49f423be66261fa769e4558a36b84d15f + * mpi/ec.c (ec_addm_25519, ec_subm_25519, ec_mulm_25519, ec_addm_448) + (ec_subm_448, ec_mulm_448, ec_secp256k1_mod): Use mpih_limb_is_zero + and mpih_limb_is_not_zero instead of comparison to zero. + + ec-nist: avoid unintentional conditional branch by comparison. + + commit 2ed34074474650a50592fa86d9639614aa86476b + * mpi/ec-nist.c (_gcry_mpi_ec_nist521_mod): Use mpih_limb_is_not_zero. + * mpi/mpi-internal.h (mpih_limb_is_not_zero): New. + + mpih_cmp_ui: avoid unintentional conditional branch. + + commit 9acddd8b95e14fb7c82c96881c1ac9000a46d703 + * mpi/mpi-internal.h (mpih_limb_is_zero): New. + * mpi/mpih-const-time.c (_gcry_mpih_cmp_ui): Use mpih_limb_is_zero + instead of comparison. + + ec-nist: use global vone and vzero. + + commit 610667fb2558ac5aae1393b99ceec3e50199e901 + * mpi/ec-nist.c (vzero, vone): Remove. + (_gcry_mpi_ec_nist192_mod, _gcry_mpi_ec_nist224_mod) + (_gcry_mpi_ec_nist256_mod, _gcry_mpi_ec_nist384_mod): Use _gcry_ct_vzero + and _gcry_ct_vone. + + mpiutil: use global vone and vzero. + + commit 6377725ed01e090bea1223256f58eae0bfcc2021 + * mpi/mpiutil.c (_gcry_mpi_set_cond, _gcry_mpi_swap_cond): Use + _gcry_ct_vzero and _gcry_ct_vone. + + mpih-const-time: use global vzero/vone variable. + + commit 15cd08ae4c1e7fccda89a42bb3e87f15dab4452f + * mpi/mpih-const-time.c (vzero, vone): Remove. + (_gcry_mpih_set_cond, _gcry_mpih_add_n_cond, _gcry_mpih_sub_n_cond) + (_gcry_mpih_swap_cond, _gcry_mpih_abs_cond): Use _gcry_ct_vzero and + _gcry_ct_vone. + +2023-11-06 Jussi Kivilinna + + const-time: ct_memmov_cond: switch to use dual mask approach. + + commit 9c0984ed2c553289a744197791a6683f4bd2ce18 + * src/const-time.c (_gcry_ct_memmov_cond): Use dual mask + AND/OR + instead of single mask + XOR. + + const-time: prefix global symbols with _gcry_ + + commit 3fa1b81c92e5694ef0f2d01885eccbbc9944d267 + * cipher/const-time.c (ct_not_memequal, ct_memequal) + (ct_memmov_cond): Rename these to ... + (_gcry_ct_not_memequal, _gcry_ct_memequal) + (_gcry_ct_memmov_cond): ... these. + * cipher/const-time.h (ct_not_memequal, ct_memequal) + (ct_memmov_cond): Rename these to ... + (_gcry_ct_not_memequal, _gcry_ct_memequal) + (_gcry_ct_memmov_cond): ... these. + (ct_not_memequal, ct_memequal, ct_memmov_cond): New macros. + + mpih_set_cond: restore EM leakage mitigation. + + commit 7f0eb519897b05e41fe43b0981453181266d457c + * mpi/mpih-const-time.c (_gcry_mpih_set_cond): Replace single mask + XOR + with dual mask + AND/OR; Add comment about reason for dual mask usage. + (_gcry_mpih_add_n_cond, _gcry_mpih_sub_n_cond, _gcry_mpih_swap_cond) + (_gcry_mpih_abs_cond): Add comment about reason for dual mask usage. + + rsa, elgamal: avoid logical not operator in constant-time code. + + commit 3583e2ebcad55bde178acc7a862cda30d1f2cd97 + * cipher/elgamal.c (elg_decrypt): Replace ! operator with calls to + ct_is_not_zero/ct_is_zero/ct_ulong_select. + * cipher/rsa-common.c (_gcry_rsa_pkcs1_decode_for_enc): Replace ! + operator with call to ct_is_zero. + * cipher/rsa.c (rsa_decrypt): Replace ! operator with calls to + ct_is_not_zero/ct_is_zero/ct_ulong_select. + * src/const-time.c (_gcry_ct_vzero, _gcry_ct_vone): New. + * src/const-time.h (_gcry_ct_vzero, _gcry_ct_vone): New. + (ct_is_not_zero, ct_is_zero, DEFINE_CT_TYPE_SELECT_FUNC) + (ct_uintptr_select, ct_ulong_select): New. + (sexp_null_cond): Use ct_uintptr_select. + + const-time: always avoid comparison operator for byte comparison. + + commit 5e9ba851948f97cd3fb70de474b87609b150d06a + * configure.ac: Remove POSSIBLE_CONDITIONAL_BRANCH_IN_BYTE_COMPARISON + macro. + * src/const-time.h (ct_not_equal_byte): Remove + POSSIBLE_CONDITIONAL_BRANCH_IN_BYTE_COMPARISON ifdef. + + Use single constant-time memory comparison implementation. + + commit 892bc25ff74b1fb84259babd4292da399dc3b185 + * src/const-time.c (ct_not_memequal): Use original 'buf_eq_const' + implementation here. + (ct_memequal): New. + * cipher/bufhelp.h (buf_eq_const): Call to 'ct_memequal'. + +2023-11-06 NIIBE Yutaka + + cipher: Fix ElGamal decryption. + + commit 2839aaee3e6eed6a96f0a798b02eef7e0302c7e7 + * cipher/elgamal.c (elg_decrypt): Call sexp_build always. + * cipher/rsa.c (rsa_decrypt): Return an error code of sexp_build + when RC !=3D 0. + + rsa: Use memmov_independently when unpadding. + + commit c98b5e4a147170d578504498ba355a77de00b0f1 + * cipher/rsa-common.c (memmov_independently): New. + (_gcry_rsa_pkcs1_decode_for_enc): Use memmov_independently. + (_gcry_rsa_oaep_decode): Use memmov_independently. + + const-time: Add ct_memmov_cond, fix _gcry_mpih_set_cond. + + commit 45945be8f3c3a77ce3e86ebda7d814defcd3f76b + * src/const-time.c (ct_memmov_cond): New. + * src/const-time.h (ct_memmov_cond): New. + * mpi/mpih-const-time.c (_gcry_mpih_set_cond): Use XOR and a MASK. + + const-time: Use ct_not_memequal, instead. Tested with AVR. + + commit e8072d8d32558c289ad4cf7b5be26a25eda03c20 + * cipher/rsa-common.c (_gcry_rsa_oaep_decode): Use ct_not_memequal. + * src/const-time.c (ct_not_memequal): Use ct_not_equal_byte. + * src/const-time.h (ct_not_memequal): Rename from ct_memequal. + + build: Check if arch is VAX or compiler is MSVC. + + commit fee1e63c7286cb12ff973ea446bc019f575887d2 + * configure.ac (AH_BOTTOM): Add check for VAX and MSVC. + * src/const-time.h (POSSIBLE_CONDITIONAL_BRANCH_IN_BYTE_COMPARISON): + Rename. + + rsa: Fix decoding of PKCS#1 v1.5 and OAEP padding. + + commit 45c9920201687754719ddc15a88a25018a552695 + * src/Makefile.am (libgcrypt_la_SOURCES): Add const-time.h and + const-time.c. + * src/const-time.h (ct_not_equal_byte, sexp_null_cond): New. + (ct_memequal): New from NetBSD, modified return type and name. + * src/const-time.c: New. + * cipher/rsa-common.c (_gcry_rsa_pkcs1_decode_for_enc): Examine whole + sequence of the byte-array. Use N0 to find the separator position, with + ct_not_equal_byte. Return the MPI even when the case of an error. + * cipher/rsa-common.c (_gcry_rsa_oaep_decode): Use ct_memequal to + check LHASH. Examine all the sequence of the byte-array. Use N1 to + find the separator of 0x01. Return the MPI even when the case of an + error. + * cipher/rsa.c (rsa_decrypt): Always build a SEXP. + +2023-10-06 NIIBE Yutaka + + sexp: String with \0 is considered "binary". + + commit 49e1e67f4e4e9f520586dc4ea8a8f2630bbf6e9c + * src/sexp.c (suitable_encoding): It's "binary" when + the buffer contains '\0'. + +2023-09-01 NIIBE Yutaka + + build: Change the default for --with-libtool-modification. + + commit 09ab619488455b0f9f27f2c8291ea646b089c13e + * configure.ac (--with-libtool-modification): default=3Dnever. + +2023-08-22 NIIBE Yutaka + + build: New configure option --with-libtool-modification. + + commit 0ddc823e331c2a38b71f887abc917d8a5a9003af + * Makefile.am (EXTRA_DIST): Add build-aux/libtool-patch.sed. + * build-aux/libtool-patch.sed: New. + * configure.ac (--with-libtool-modification): New. + +2023-07-14 Bernhard Reiter + + build: Fix the notice in configure.ac. + + commit c8ee15dfe8696c58ba493b118f6eff1c095e02ae + * configure.ac: Fix typo. + +2023-06-19 NIIBE Yutaka + + cipher:pubkey: Check digest size which should not be zero. + + commit 8cdd0d353e19a4514dfe3c99146d17f07bf0fb4d + * cipher/pubkey.c (gcry_pk_sign_md): Check the digest size + before calling _gcry_md_read. + +2023-06-16 NIIBE Yutaka + + tests: Allow KDF measurement in FIPS mode. + + commit 5547e5255c465e99ccd3ffce2b7622e75f2d89a4 + * tests/bench-slope.c (bench_kdf_init): Tweak the iterations in FIPS + mode. + (bench_kdf_do_bench): Use larger values to avoid rejection in FIPS + mode. + + cipher:kdf: Move FIPS mode check to _gcry_kdf_derive. + + commit 2c8562ca5a49edc0c82c8c4775edebabc31cf09e + * cipher/kdf.c (_gcry_kdf_pkdf2): Move the checks to... + (_gcry_kdf_derive): ... here. + + Remove out of core handler setting message in FIPS mode. + + commit d37ad2823f849ce71b509245ecc169835cf80d1e + * src/global.c (_gcry_set_outofcore_handler): Don't call log_info. + + cipher:ecc: Fix an error-path to release the KEY correctly. + + commit 31adc78fa503be388af430e9b218a83fb4b1ea7f + * cipher/ecc.c (ecc_generate): Set *R_SKEY to NULL. + +2023-06-15 NIIBE Yutaka + + cipher:pubkey: Fix non-use of flexible array member. + + commit 297c5a47837cfd94ed5b317b45f6e776502dd2cd + * cipher/pubkey.c (struct pk_single_data): Use 1 as the size. + (_gcry_pk_single_data_push): Use offsetof. + + cipher:ecc: Fix public key computation for EdDSA. + + commit b863ec507dae17fe2c38653e1ccf22de62b68ac4 + * cipher/ecc-misc.c (_gcry_ecc_compute_public): Fix hard-coded length + for digest lower bits. + +2023-06-02 Werner Koch + + mpicalc: Allow for addm and subm. + + commit 2974a635e5d3ca477508527f5c401619879cb19f + * src/mpicalc.c (do_add, do_sub): Add arg usemod. + (main): Add oeprator 'M'. + +2023-04-21 Jussi Kivilinna + + doc: add documentation for GCRYCTL_SET_ALLOW_WEAK_KEY. + + commit 7cdfc869b7afa057839fd361bfff9140cfbe63ed + * doc/gcrypt.texi: Add 'GCRYCTL_SET_ALLOW_WEAK_KEY' under + 'gcry_cipher_ctl'. + + Revert "cipher: Fix edge case for SET_ALLOW_WEAK_KEY." + + commit 9b1ee0574ed96800429aa9488b6dcb11a5407542 + * cipher/cipher.c (cipher_setkey): Do not reset RC. + +2023-04-16 Werner Koch + + cipher: Fix edge case for SET_ALLOW_WEAK_KEY. + + commit b75a58df84a5137954cb678adf8c202b39ee1def + * cipher/cipher.c (cipher_setkey): Reset RC. + +2023-04-11 NIIBE Yutaka + + random: Use getrandom only when it's appropriate. + + commit d41177937cea4aa1e9042ebcd195a349c40e8071 + * random/rndgetentropy.c (_gcry_rndgetentropy_gather_random) + [GRND_RANDOM]: Conditionalize the use of getrandom, as it's + not a portable function. + +2023-04-06 Werner Koch + + Release 1.10.2. + + commit 1c5cbacf3d88dded5063e959ee68678ff7d0fa56 + + +2023-04-04 NIIBE Yutaka + + cipher: Enable the fast path to ChaCha20 only when supported. + + commit 4128f73d3a83c7f901924488c3bbf047b75db20f + cipher/cipher-poly1305.c (_gcry_cipher_poly1305_encrypt) + (_gcry_cipher_poly1305_decrypt) [USE_CHACHA20]: Conditionalize. + + build: Allow build with -Oz. + + commit f2ab06bc3cccd1f6c9a012275d90df9f3956572b + * cipher/Makefile.am [ENABLE_O_FLAG_MUNGING]: Support -Oz. + * random/Makefile.am [ENABLE_O_FLAG_MUNGING]: Support -Oz. + +2023-04-03 NIIBE Yutaka + + m4: Update gpg-error.m4. + + commit c118a8ddd0224f951f26ae78d58d0eed5ee35779 + * m4/gpg-error.m4: Update from libgpg-error master. + +2023-03-24 NIIBE Yutaka + + fips: More elaborate way of getting FIPS pk flags indicators. + + commit f6f345fe89b0a61408bbc72058ab42ac6e6a7577 + * src/fips.c (_gcry_fips_indicator_pk_flags): List more allowed string + in the S-expression. + * doc/gcrypt.texi: Add document for the FIPS service indicator + GCRYCTL_FIPS_SERVICE_INDICATOR_PK_FLAGS with example. + +2023-03-23 NIIBE Yutaka + + build: Update gpg-error.m4. + + commit f815ae113a2a914b0d20f0eb36d91c0351d5a797 + * m4/gpg-error.m4: Update from libgpg-error master. + +2023-03-14 Jakub Jelen + + tests: Improve test coverage for FIPS service indicators. + + commit 22cb410dd4456a84b5bde8be6a907afdc38a792b + * tests/basic.c (check_digests): Check the FIPS indicators. + (check_mac): Ditto. + + fips: Explicitly disable overriding random in FIPS mode. + + commit 251f1749900e355ee6b027ee6a5c070eba16c85f + * src/fips.c: (_gcry_fips_indicator_function): Mark using random + override non-approved in FIPS mode. + + fips: Mark gcry_pk_encrypt/decrypt function non-approved. + + commit 051bbe84d889b413f158c665e5cc25b26c820388 + * src/fips.c (_gcry_fips_indicator_function): Add + gcry_pk_encrypt/decrypt as non-approved. + + fips: Fix fips indicator function. + + commit 6805d76b7ed4886f00bf704c77b0549408097219 + * src/fips.c (_gcry_fips_indicator_function): Fix typo in sign/verify + function names. + + fips: Explicitly allow only some PK flags. + + commit 0b2b30c0c42fa2fea646a83a1f21a99f7a902853 + * src/fips.c (_gcry_fips_indicator_pk_flags): New function for explicit + FIPS indicator for public key algorithm flags. + * src/g10lib.h (_gcry_fips_indicator_pk_flags): New. + * src/gcrypt.h.in (GCRYCTL_FIPS_SERVICE_INDICATOR_PK_FLAGS): New. + * src/global.c (_gcry_vcontrol): Handle the new option. + * doc/gcrypt.texi: Document new options. + +2023-03-14 Tobias Heider + + doc: Document the new FIPS indicators. + + commit fcb9ec67a11763ca10fa1b64166c206da95eb006 + * doc/gcrypt.texi: Document the new options for FIPS indicators. + +2023-03-08 Tobias Heider + + fips: Unblock MD5 in fips mode but mark non-approved in indicator. + + commit 0024db5afee825185ddf26cd9a91f563b8c11b1a + * cipher/mac-hmac.c (_gcry_mac_type_spec_hmac_md5): Allow in fips mode. + * cipher/md5.c (_gcry_digest_spec_md5): Allow in fips mode. + + fips: Add explicit indicators for md and mac algorithms. + + commit a51f0e66842ae989cd3966e5ef5eb1f62a3576b1 + * src/fips.c (_gcry_fips_indicator_mac): New function indicating + non-approved mac algorithms. + (_gcry_fips_indicator_md): new functions indicating non-approved + message digest algorithms. + * src/g10lib.h (_gcry_fips_indicator_mac): New function. + (_gcry_fips_indicator_md): Ditto. + * src/gcrypt.h.in (enum gcry_ctl_cmds): New symbols, + GCRYCTL_FIPS_SERVICE_INDICATOR_MAC and + GCRYCTL_FIPS_SERVICE_INDICATOR_MD. + * src/global.c (_gcry_vcontrol): Handle new FIPS indicators. + +2023-03-07 Jakub Jelen + + kdf: Update tests in regards to the allowed parameters in FIPS mode. + + commit 397ff085749e5b47095827d19561332a67007c02 + * cipher/kdf.c (check_one): run selftests for more approved parameters + and check that wrong parameters correctly fail in FIPS mode. + + fips: Check return value from ftell. + + commit 076dd2ffcd953d80172770d8bb98c2c945dad7c9 + * src/fips.c (get_file_offset): Check return value of ftell to be able + to detect errors. + + random: Remove unused SHA384 DRBGs. + + commit 4cff7e739829294d5f4a364d35584b42ef81af9f + * random/random-drbg.c (global): Remove unused SHA384-based defines. + (drbg_cores): Remove SHA384 configurations. + (drbg_sec_strength): Remove unused SHA384. + + visibility: Check FIPS operational status for MD+Sign operation. + + commit fc19b27b543910833096a738dae0703b3dc57d51 + * src/visibility.c (gcry_pk_hash_sign): Check fips status before + calling the operation itself. + (gcry_pk_hash_verify): Ditto. + + ecc: Make the PCT recoverable in FIPS mode and consistent with RSA. + + commit c41d4f502f1b8aa08b2a79cbee3c8cd73e73adbe + * cipher/ecc.c (test_keys_fips): Replace calls to log_fatal with + return code on error. + (ecc_generate): Signal error when PCT fails in FIPS mode. + + ecc: Do not allow skipping tests in FIPS Mode. + + commit 44a3f26539f7e88a77bbf4fe5d35ddd24f87ffcd + * cipher/ecc.c (ecc_generate): Do not allow skipping tests PCT tests + in FIPS mode. + +2023-01-23 Jakub Jelen + + fips: Remove GCM mode from the allowed FIPS indicators. + + commit 1540698389ba2091baab6e020e5ec7b0d0eead59 + * src/fips.c (_gcry_fips_indicator_cipher): Do not mark GCM mode as + FIPS approved. + +2022-12-16 NIIBE Yutaka + + build: Fix m4 macros for strict C compiler. + + commit b1a3424e7f8030361c2e4806920e60ec06c1d9e3 + * m4/ax_cc_for_build.m4: Fix for no arg. + * m4/noexecstack.m4: Likewise. + + build: Fix configure.ac for strict C99. + + commit 83ea195b61d571e48f53803d2d297ec02035ae36 + * configure.ac: Add function declarations for asm functions. + +2022-12-07 Jussi Kivilinna + + t-rsa-testparm: fix 'function declaration isn=E2=80=99t a prototype' warn= ing. + + commit bdeea2a53e9ef869caa2f8ae2dd876ad397aed12 + * cipher/t-rsa-testparm.c (check_rsa_testparm): Define parameters as + void. + +2022-12-07 Jakub Jelen + + fips,rsa: Prevent usage of X9.31 keygen in FIPS mode. + + commit 392e0ccd25f397d789a1cb59fae2f3faae46e78b + * cipher/rsa.c (rsa_generate): Do not accept use-x931 or derive-parms + in FIPS mode. + * tests/pubkey.c (get_keys_x931_new): Expect failure in FIPS mode. + (check_run): Skip checking X9.31 keys in FIPS mode. + * doc/gcrypt.texi: Document "test-parms" and clarify some cases around + the X9.31 keygen. + +2022-12-05 Jakub Jelen + + rsa: Prevent usage of long salt in FIPS mode. + + commit fdd2a8b3329eb892f90d2cd803762ef06222c226 + * cipher/rsa-common.c (_gcry_rsa_pss_encode): Prevent usage of large + salt lengths + (_gcry_rsa_pss_verify): Ditto. + * tests/basic.c (check_pubkey_sign): Check longer salt length fails in + FIPS mode + * tests/t-rsa-pss.c (one_test_sexp): Fix function name in error message + +2022-11-18 Jakub Jelen + + fips: Mark AES key wrapping as approved. + + commit 20ad5df60b035e721de7cfc40cd76a1a13051072 + * src/fips.c (_gcry_fips_indicator_cipher): Add key wrapping mode as + approved. + + pkdf2: Add checks for FIPS. + + commit 057844700ec2e652249b0b80136229c049d41975 + * cipher/kdf.c (_gcry_kdf_pkdf2): Require 8 chars passphrase for FIPS. + Set bounds for salt length and iteration count in FIPS mode. + +2022-11-01 NIIBE Yutaka + + build: Prefer gpgrt-config when available. + + commit 5191379da3ad653fcf08ab1babb486ca952d1643 + * src/libgcrypt.m4: Overriding the decision by + --with-libgcrypt-prefix, use gpgrt-config libgcrypt when gpgrt-config + is available. + +2022-10-27 Jakub Jelen + + hmac,hkdf: Check the HMAC key length in FIPS mode. + + commit e7b1fbda6a9e0b6bf99062fc86139445a4e0766e + * src/visibility.c (gcry_md_setkey): Add the check here, too. + + Revert "kdf:pkdf2: Require longer input when FIPS mode." + + commit 7f4fafb5564dec6fe65f0e93a1125cb6ddb4d1ed + * cipher/kdf.c (_gcry_kdf_pkdf2): Remove the length limitation of + passphrase input length. + +2022-10-24 NIIBE Yutaka + + build: Update gpg-error.m4. + + commit e2c0920fd7dea6e254badd12958982c66080b7db + * m4/gpg-error.m4: Update from libgpg-error 1.46. + +2022-10-06 Jakub Jelen + + tests: Reproducer for short dklen in FIPS mode. + + commit e235f38f9b9fc3cd4464bbf9081da765d46ce87d + * tests/t-kdf.c (check_pbkdf2): Add test vector with short dklen and + verify it fails in FIPS mode + + random: Extend the comment about FIPS specifics. + + commit 96615490c7b1d5f77de7f7f2b77e775540f7f6bf + * random/rndgetentropy.c (_gcry_rndgetentropy_gather_random): Clarify + description of the chainging DRBG in FIPS mode. + +2022-10-04 Jakub Jelen + + random: Get maximum 32B of entropy at once in FIPS Mode. + + commit ce0df08bbab741cd2ad19a5a0e8b65fb62774f87 + * random/rndgetentropy.c (_gcry_rndgetentropy_gather_random): In fips + mode, gather max 32 B of strong entropy for initialization. + + keccak: Use size_t to avoid integer overflow. + + commit 9ee2d56e806b8018fa3ae354a65f1e70bf73dede + * cipher/keccak-armv7-neon.S: Fix function name in comment and change + parameter type to size_t. + * cipher/keccak.c (keccak_ops_t): Change absorb function signature to + use size_t. + (keccak_absorb_lanes64_avx512): Change nlanes type to size_t. + (_gcry_keccak_absorb_lanes64_armv7_neon): Ditto. + (keccak_absorb_lanes64_armv7_neon): Ditto. + (keccak_absorb_lanes32bi): Ditto. + (keccak_absorb_lanes32bi_bmi2): Ditto. + (keccak_write): Change nlanes variable to use size_t and avoid + overflow when calculating count. + * cipher/keccak_permute_64.h (KECCAK_F1600_ABSORB_FUNC_NAME): Change + nlanes argument to use size_t. + +2022-10-04 Tobias Heider + + kdf:pkdf2: Check minimum allowed key size when running in FIPS mode. + + commit 52d48b710470dd48dd2a32a439898ece10ef05fd + * cipher/kdf.c (_gcry_kdf_pkdf2): Add output length check. + +2022-10-04 NIIBE Yutaka + + kdf:pkdf2: Require longer input when FIPS mode. + + commit d09d3d33c79daa2f8d385dfedf3f20ad205b0fba + * cipher/kdf.c (_gcry_kdf_pkdf2): Add length check. + +2022-09-22 NIIBE Yutaka + + build: Fix configure script. + + commit 44812a1d96fc003e6e0d01270c514b91e295d300 + * configure.ac (AC_USE_SYSTEM_EXTENSIONS): Use it earlier. + +2022-09-22 Clemens Lang + + fips: Skip PCT if RSA keygen test-parms specified. + + commit 4963c127ae698d98f30483ba9d15d093aae4e51d + * cipher/rsa.c (rsa_generate): Skip PCT is test-parms were specified. + * tests/t-rsa-testparm.c: Add test for this functionality + * tests/Makefile.am: Add test to build system + + build: Skip PK-specific tests if algo is disabled. + + commit 1524b60a7ccc17fb82e91b90236a88a27b113175 + * configure.ac: Define AM_CONDITIONALs for USE_DSA, USE_RSA, + USE_ELGAMAL, USE_ECC so Makefiles can depend on them. + * tests/Makefile.am: Skip tests that test only one public key algorithm + if that algorithm is disabled. + +2022-09-20 NIIBE Yutaka + + Fix _gcry_err_code_to_errno. + + commit 16ac1850b854abe9b6f693a489ceeb0048777bfa + * src/gcrypt-int.h: Use gpg_err_code_to_errno. + +2022-08-30 Jakub Jelen + + tests: Expect the OEAP tests to fail in FIPS mode. + + commit 658679e0ec8be9693a3deb6b85c2b39cb112218c + * tests/basic.c (check_pubkey_crypt): Expect the OAEP padding encryption + to fail in FIPS mode + * tests/pkcs1v2.c (check_oaep): Expect the OAEP tests to fail in FIPS + mode + + fips: Disable RSA-OAEP padding in FIPS mode. + + commit e5bfda492ab9496ed3d856a9f36250a2cc07ce70 + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): Block OAEP padding + in FIPS mode for encryption + * cipher/rsa.c (rsa_decrypt): Block OAEP padding in FIPS mode for + decryption + + random: Use getrandom (GRND_RANDOM) in FIPS mode. + + commit cf10c74bd9d5aa80798f1c0e23a9126f381b26b3 + * random/rndgetentropy.c (_gcry_rndgetentropy_gather_random): Use + GRND_RANDOM in FIPS Mode + + Simplify the PCT for RSA and ECDSA. + + commit 285bf54b1ac7b5609a675655fe2cb9117ab78d3d + Could be squashed. + + * cipher/ecc.c (test_keys_fips): Simplify to accept key in SEXP format + (nist_generate_key): Skip call to test keys + (ecc_generate): Call test keys in FIPS mode later, when we have + complete SEXP key structure. + * cipher/rsa.c (test_keys_fips): Simplify to accept key in SEXP format + (generate_fips): Skip selftest at this stage + (rsa_generate): Test the keys later when we already have key in SEXP + format + + ecc: Run PCT also with the digest step. + + commit 076a8adaf314d593ca25c245d2a74207710a4fe7 + * cipher/ecc.c (test_keys_fips): New function + (nist_generate_key): In FIPS mode, execute new PCT test + --- + + Cherry-picked from master commit: + 505f048cac8e5af92d3431bd97ade492d1a30bc2 + + rsa: Run PCT in FIPS mode also with digest step. + + commit 78151e6d6bbbbf1248b7c32cbab0b9b638ad6c11 + * cipher/rsa.c (test_keys_fips): New. + (generate_fips): Call test_keys_fips. + + fips: Add function-name based FIPS indicator. + + commit 822ee57f07cad6b32fac265a1a9e195d7cf99fa9 + * doc/gcrypt.texi: Document the new function-based fips indicator + GCRYCTL_FIPS_SERVICE_INDICATOR_FUNCTION + * src/fips.c (_gcry_fips_indicator_function): New function indicating + non-approved functions. + * src/gcrypt.h.in (enum gcry_ctl_cmds): New symbol + GCRYCTL_FIPS_SERVICE_INDICATOR_FUNCTION + * src/global.c (_gcry_vcontrol): Handle new FIPS indicator. + + fips: Run digest&sign self tests for RSA and ECC in FIPS mode. + + commit 06c9350165d7284cd9fe569fd23e6c6cf371dba2 + * cipher/ecc.c (selftest_hash_sign): Implement digest & sign KAT + (selftests_ecdsa): Run the original basic test only with extended tests + (run_selftests): Pass-through the extended argument + * cipher/rsa.c (selftest_hash_sign_2048): Implement digest & sign KAT + (selftests_rsa): Run the original basic test only with extended tests + (run_selftests): Pass-through the extended argument + +2022-08-15 NIIBE Yutaka + + hmac: Allow use of shorter salt. + + commit ab5aef9b7b6ef757eff7bea4a17ade0ce3d3191b + * cipher/md.c (prepare_macpads): Move the check to... + * src/visibility.c (gcry_mac_setkey): ... here. + +2022-07-13 NIIBE Yutaka + + cipher: Fix gcry_pk_hash_verify for explicit hash. + + commit 1d3a90a4d118eafa6b2f777c998e85327a77fb3c + * cipher/pubkey.c (_gcry_pk_verify_md): Implement support of explicit + hash. + * tests/t-ecdsa.c (one_test_sexp): Use explicit hash. + +2022-07-13 Clemens Lang + + tests/t-kdf: Test KDF FIPS indicator. + + commit 3bbcf16e0b8b63d70893f6d9cc0fe77f7d8bc17b + * tests/t-kdf.c (check_fips_indicators): Add test for gcry_control + (GCRYCTL_FIPS_SERVICE_INDICATOR_KDF). + + tests: Test gcry_pk_hash_sign w/explicit hash algo. + + commit 04960f5179cd9732931b9f245a902a8a34bde964 + * tests/t-ecdsa.c (one_test_sexp): Re-run signature operation with hash + algorithm explicitly specified in data_tmpl as documented in the + manpage. + +2022-07-13 NIIBE Yutaka + + random: Fix rndjent for Windows. + + commit bc01c770c75703992fc0585d76d84107bdcd9fea + * random/jitterentropy-base-user.h [HAVE_W32_SYSTEM] (jent_ncpu): + Implement. + * random/rndjent.c (_WIN32_WINNT): Define for GetNativeSystemInfo. + (EOPNOTSUPP): Define when not available. + +2022-06-16 NIIBE Yutaka + + mpi: Allow building with --disable-asm for HPPA. + + commit d1cb2599e9d746bb3a088c63b24f8191072e11ef + * mpi/longlong.h [__hppa] (udiv_qrnnd): Only define + when assembler is enabled. + +2022-05-31 Jakub Jelen + + tests: Fix copy paste error. + + commit 4b85bf33cce7ee331d4da1b99620aed6f9fbf846 + * tests/basic.c (check_ocb_cipher_checksum): Check the right value for + errors + + Fix memory leaks in tests. + + commit 735601494adb22a6ec8b1a4eacf1f75480a7c203 + * tests/aeswrap.c (check_one_with_padding): Free hd on error paths + * tests/basic.c (check_ccm_cipher): Free context on error paths + (check_ocb_cipher_checksum): Ditto. + (do_check_xts_cipher): Ditto. + (check_gost28147_cipher_basic): Ditto. + * tests/bench-slope.c (bench_ecc_init): Free memory on invalid input. + * tests/t-cv25519.c (test_it): Free memory on error path + * tests/t-dsa.c (hex2buffer): Free memory on error path + * tests/t-ecdsa.c (hex2buffer): Free memory on error path + (one_test_sexp): Cleanup memory on exit + * tests/t-mpi-point.c (check_ec_mul): Free memory on error + (check_ec_mul_reduction): Ditto + * tests/t-rsa-15.c (hex2buffer): Ditto + * tests/t-rsa-pss.c (hex2buffer): Ditto + * tests/t-x448.c (test_it): Free memory on error path + * tests/testdrv.c (my_spawn): Free memory on error paths + +2022-05-19 Jakub Jelen + + cipher: Allow verification of small RSA signatures in FIPS mode. + + commit 468ffa8f9c471c910280e0d0ade521d0184ed533 + * cipher/rsa.c (rsa_check_keysize): Formatting. + (rsa_check_verify_keysize): New function. + (rsa_verify): Allow using smaller keys for verification. + +2022-05-17 NIIBE Yutaka + + Fix internal declaration of _gcry_kdf_compute. + + commit 6d3708942f846e389bd87fe3d7c6e7a1b3615bca + * src/gcrypt-int.h (_gcry_kdf_compute): Return gcry_err_code_t. + +2022-05-10 NIIBE Yutaka + + mpi: Fix for 64-bit for _gcry_mpih_cmp_ui. + + commit 03af3d5cc5d54b6f810264568d6de22cd9e7d34f + * mpi/mpih-const-time.c (_gcry_mpih_cmp_ui): Compare 64-bit + value correctly. + +2022-05-06 NIIBE Yutaka + + random:drbg: Fix the behavior for child process. + + commit 019a40c99011390f12168e79e3bebd0ff52cc003 + * random/random-drbg.c (_gcry_rngdrbg_randomize): Update change of PID + detection. + +2022-05-06 Jakub Jelen + + tests: Expect the RSA PKCS #1.5 encryption to fail in FIPS mode. + + commit 1a270cda2ee5fe345f480b4eda13b92a7b7f556e + * tests/basic.c (check_pubkey_crypt): Expect RSA PKCS #1.5 encryption to + fail in FIPS mode. Expect failure when wrong padding is selected + * tests/pkcs1v2.c (check_v15crypt): Expect RSA PKCS #1.5 encryption to + fail in FIPS mode + + tests: Replace custom bit with more generic flags. + + commit 9c55ba3bc1ce72307886f6d88f37d908e3fad39a + * tests/basic.c (global): New flag FLAG_SPECIAL + (check_pubkey_crypt): Change to use bitfield flags + + Do not allow PKCS #1.5 padding for encryption in FIPS. + + commit d8a13d97ccb62c8f7564192f0c8dcdc0b4d9745a + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): Block PKCS #1.5 + padding for encryption in FIPS mode + * cipher/rsa.c (rsa_decrypt): Block PKCS #1.5 decryption in FIPS mode + +2022-05-06 NIIBE Yutaka + + random: Not use secure memory for DRBG instance. + + commit 9452640125d239937dfb9cde49be7c0dde2f65ee + * random/random-drbg.c (drbg_instance): New at BSS. + (_drbg_init_internal): Don't allocate at secure memory. + (_gcry_rngdrbg_close_fds): Follow the change. + + cipher: Change the bounds for RSA key generation round. + + commit f6a67c2215310e9463267e15569697d3103b27f7 + * cipher/rsa.c (generate_fips): Use 10 for p, 20 for q. + +2022-04-19 NIIBE Yutaka + + cipher: Fix rsa key generation. + + commit 26df4b8d8c938fd837b99355de5163b9364d49a5 + * cipher/rsa.c (generate_fips): Set the least significant bit. + +2022-04-02 Jussi Kivilinna + + hwf-ppc: fix missing HWF_PPC_ARCH_3_10 in HW feature. + + commit e073f0ed446601bffe787912462119a98e797fa3 + * src/hwf-ppc.c (ppc_features): Add HWF_PPC_ARCH_3_10. + +2022-03-29 NIIBE Yutaka + + kdf:argon2: Fix for the case output > 64. + + commit 13b5454d2620701863f6e89221f5f4c98d2aba8e + * cipher/blake2.c (blake2b_vl_hash): Fix the last step. + * cipher/kdf.c (argon2_open): Check the value. + +2022-03-28 Werner Koch + + Release 1.10.1. + + commit ae0e567820c37f9640440b3cff77d7c185aa6742 + + + hash: Add more OIDs. + + commit 52fd2305ba8a0c53214016c11fdf03d47761ee8e + * cipher/sha256.c: Add X9.62 OID. + * cipher/sha512.c: Ditto. + + tests: Add brainpoolP256r1 to bench-slope. + + commit eeddd578120c6c28cf600016aae124223ef99e8b + * tests/bench-slope.c (ECC_ALGO_BRAINP256R1): New. + (ecc_algo_fips_allowed): Support this curve. + (ecc_algo_name): Ditto. + (ecc_algo_curve): Ditto. + (ecc_nbits): Ditto. + (bench_ecc_init): Ditto. + +2022-02-22 NIIBE Yutaka + + fips: Clarify what to be hashed for the integrity check. + + commit 9fa4c8946ac5e79c37941c6264ac3d6314d9a3c0 + * src/fips.c (get_file_offset): Compute the maximum offset + of segments. + * src/gen-note-integrity.sh: Likewise. + + fips: Fix gen-note-integrity.sh script not to use cmp utility. + + commit ad8b67f9e21982c841f31e92d2639f726f7ea4be + * src/gen-note-integrity.sh: Simplify detecting 32-bit machine + or 64-bit machine. + + fips: More portable integrity check. + + commit dcc6979fd2ed32bb5a5e448e2c9da1158c1d93c2 + * src/Makefile.am (EXTRA_DIST): Change the name of the script. + (libgcrypt.la.done): Invoce OBJCOPY with --add-section. + (libgcrypt.so.hmac): Specify ECHO_N. + * src/fips.c (get_file_offset): Rename from get_file_offsets. + Find the note section and return the value in HMAC. + (hmac256_check): Simplify by HMAC from the note section, not loaded. + (check_binary_integrity): Use dladdr instead of dladdr1. + * src/gen-note-integrity.sh: Rename from genhmac.sh. + Generate ElfN_Nhdr, and then the hmac. + + fips: Integrity check improvement, with only loadable segments. + + commit 974f4c7e698b0c1ffe3de82bad9b3f8813d1f42b + * configure.ac (READELF): Check the tool. + * src/Makefile.am (libgcrypt.so.hmac): Use genhmac.sh with hmac256. + * src/fips.c (get_file_offsets): Rename from get_file_offset. + Determine the OFFSET2 at the end of loadable segments, too. + Add fixup of the ELF header to exclude section information. + (hmac256_check): Finish scanning at the end of loadble segments. + * src/genhmac.sh: New. + +2022-02-22 Clemens Lang + + fips: Use ELF header to find hmac file offset. + + commit 4ed49a917212507de8679aaf08504922a95cf6ef + * src/fips.c [ENABLE_HMAC_BINARY_CHECK] (hmac256_check): Use ELF headers + to locate the file offset for the HMAC in addition to information from + the loader + +2022-02-21 NIIBE Yutaka + + Silence compiler warnings for possible alignment problem. + + commit 64fef214025949a1b0a76355b99c85594caea4ca + * cipher/kdf.c (_gcry_kdf_compute, _gcry_kdf_final, _gcry_kdf_close): + Fix the cast. + +2022-02-18 NIIBE Yutaka + + build: Fix m4/gpg-error.m4. + + commit b5b7b8c5c76838350f1857a40c428c9092f9da8e + * m4/gpg-error.m4: Unset GPGRT_CONFIG when it doesn't work well. + +2022-02-14 Clemens Lang via Gcrypt-devel + + hmac: Fix memory leak. + + commit 2bdc6614c866b0197f534e5cf3ec35d9f024facd + * src/hmac.c: Release HMAC256 context + + fips: Fix memory leaks in FIPS mode. + + commit a60f8e43dd1b02adf7d1fd54c2e1d27564dd12c1 + * cipher/pubkey.c (_gcry_pk_sign_md): Fix memory leak in FIPS mode when + used with SHA1 + * tests/basic.c (check_one_cipher_core): Add missing free in error code + triggered in FIPS mode + * tests/dsa-rfc6979.c (check_dsa_rfc6979): Likewise + * tests/pubkey.c (check_x931_derived_key): Likewise + +2022-02-14 NIIBE Yutaka + + kdf: Use u64. + + commit 6683007d696dfe64640dc741c4332784ec246388 + * cipher/kdf.c (rotr64): We use u64 in libgcrypt. + +2022-02-04 Heiko Becker + + jitterentropy: Include and + + commit ffaef0be613121d3ee37867d82932a7a30c2bc6d + * random/jitterentropy-base-user.h: Include for O_RDONLY + * random/jitterentropy-base-user.h: Include for LONG_MAX + +2022-02-01 Werner Koch + + Release 1.10.0. + + commit e4ab2147f3e236f7be95f9709ce09193b2ca5c1a + + +2022-01-31 Werner Koch + + rsa: Fix regression in not returning an error for prime generation. + + commit 217bf0a0e7be4a216a405a4bfb719e0fd437c2a3 + * cipher/rsa.c (generate_fips): Set the default EC again. + +2022-01-31 Jakub Jelen + + cipher: Initialize values not to confuse static analyzers. + + commit cb9df21fcbb05d9650df7b45671d335eefad405b + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_sign): Initialize integer values + not to confuse static analyzers. + (_gcry_ecc_eddsa_verify): Ditto. + + fips: Remove unused assignment. + + commit d2003618e6bf733f0c913f5c8961779f8e4dc05c + * src/fips.c (hmac256_check): Remove unused assignment. + + cipher: Remove dead code in for the siv mode. + + commit 0f38e6a877f19db303672ca899b36333fb84c8fa + * cipher/cipher-siv.c (_gcry_cipher_siv_setkey): Remove dead code + + random: Avoid dereference of the ec before checking for NULL. + + commit 904e168bdb2ac4cbfe32db86a6cd11ab462340ad + * random/jitterentropy-noise.c (jent_memaccess): Move check before + dereferencing the pointer. + +2022-01-31 NIIBE Yutaka + + kdf: Fix computation by big-endian machine. + + commit 77512c510bf744b341d3173e65e22b9dd0b5df03 + * cipher/kdf.c (beswap64_block): New. + (argon2_fill_first_blocks): Convert to native endian. + (pseudo_random_generate): Run in native endian. + (argon2_compute_segment): Run in native endian. + (argon2_final): Convert from native endian. + + ciper/blake2: Make sure to clean up the stack. + + commit 7dc488ae036addd69878681a4eab6d25e9d99c8e + * cipher/blake2.c (blake2b_vl_hash): Wipe the memory. + +2022-01-28 Jussi Kivilinna + + kdf: handle errors from thread dispatch/wait functions. + + commit 54369c66bedd20d6846ed8fab678082ec8eecf5d + * cipher/kdf.c (argon2_compute): Handle failed job dispatch/wait. + * tests/t-kdf.c (pthread_jobs_launch_job) + (wait_all_jobs_completion): Handle errors returned from pthread functions. + + kdf/argon2: use BLAKE2b hash_buffers function instead of _gcry_md_* + + commit 409f69167983deacee6d6c85c80a4be0e4b5d7c1 + * cipher/kdf.c (argon2_fill_first_blocks): Convert to use iov + hash_buffers API instead of _gcry_md_*. + + Rename KDF job functions and function types. + + commit c5aead8aebc7dfb699597eb6adf334bd2edbc374 + * src/gcrypt.h.in (gcry_kdf_job_fn_t): New. + (gcry_kdf_dispatch_job_fn_t): Renamed from 'gcry_kdf_lauch_job_t'; Use + 'gcry_kdf_job_fn_t' for function pointer parameter. + (gcry_kdf_wait_all_jobs_fn_t): Renamed from + 'gcry_kdf_wait_all_jobs_completion_t'. + (gcry_kdf_thread_ops_t): Rename functions to 'dispatch_job' and + 'wait_all_jobs'. + * cipher/kdf.c (argon2_compute): Change to use 'dispatch_job' and + 'wait_all_jobs'. + * tests/t-kdf.c (job_thread_param, pthread_jobs_launch_job): Use + 'gcry_kdf_job_fn_t' type for 'job'. + + tests/t-kdf: few changes to pthread example and fix win32/win64 builds. + + commit 03a0eedefe3e8b979aee6fb9800fe8e794f50089 + * src/gcrypt.h.in (gcry_kdf_thread_ops_t): New based on + 'struct gcry_kdf_thread_ops'. + (gcry_kdf_compute): Use 'gcry_kdf_thread_ops_t' instead of + 'struct gcry_kdf_thread_ops'. + * tests/Makefile.am: Define 't_kdf_LDADD' and 't_kdf_CFLAGS' on + win32/win64 target too. + * tests/t-kdf.c (pthread_jobs_launch_job): Set 'oldest_thread_idx' on + first thread creation. + (wait_all_jobs_completion): Reset 'oldest_thread_idx' to -1. + (my_kdf_derive): Merge HAVE_PTHREAD ifdefs; Initialize 'oldest_thread_idx' + to -1. + +2022-01-28 NIIBE Yutaka + Jussi Kivilinna + + kdf: Change new KDF API. + + commit 254fb14044cfce87b619138dec7bb78a2534d1b3 + * cipher/kdf.c (argon2_ctl): Remove. + (argon2_iterator): Remove. + (argon2_compute_segment): Change the API. + (argon2_compute): New. + (argon2_open): No optional N_THERADS any more. + (_gcry_kdf_ctl): Remove. + (_gcry_kdf_iterator, _gcry_kdf_compute_segment): Remove. + (_gcry_kdf_compute): New. + * src/gcrypt-int.h: Update declarations. + * src/gcrypt.h.in: Likewise. + * src/libgcrypt.def: Update. + * src/libgcrypt.vers: Update. + * src/visibility.c: Update. + * src/visibility.h: Update. + * tests/t-kdf.c (check_argon2): Update the test with change of new + API. + +2022-01-28 NIIBE Yutaka + + kdf: Implement Argon2 KDF using blake2b_vl_hash function. + + commit 4cbbd87e2af00c7b3f0236a56f12bd51e9295816 + * cipher/kdf.c (hash): Remove, as it's not possible to implement with + _gcry_md_* programming interface. + (xor_block): New. + (argon2_fill_first_blocks): Rename from argon2_genh0_first_blocks. + (argon2_init): Don't use ->HD any more. + (fill_block, pseudo_random_generate, index_alpha): New. + (argon2_compute_segment): Implement ARGOND, ARGON2I and ARGON2ID. + (argon2_final): Fix using blake2b_vl_hash. + (argon2_open): Fix for parameters and the restriction for output length. + * tests/t-kdf.c (check_argon2): Update test vector for version 0x13. + (main): Enable the test. + + cipher: Implement variable-length hash function for Argon2. + + commit 6467287ba121df9e5965d5a3a7a4f349793d49d2 + * cipher/blake2.c (blake2b_vl_hash): New. + +2022-01-26 NIIBE Yutaka + + kdf: Improve new KDF API. + + commit 5d1da2c61981243729365724f14e3d4abacb0e6a + * cipher/kdf.c (struct argon2_thread_data): Change layout. + (argon2_iterator): Use struct gcry_kdf_pt_head. + (argon2_compute_segment): Rename from argon2_compute_row. + (argon2_open): Handle N_THREAD maximum. + (_gcry_kdf_iterator): Use struct gcry_kdf_pt_head. + (_gcry_kdf_compute_segment): Rename from _gcry_kdf_compute_row. + * src/gcrypt-int.h: Update declarations. + * src/gcrypt.h.in (struct gcry_kdf_pt_head): Expose the data type. + * src/libgcrypt.def, src/libgcrypt.vers: Update. + * src/visibility.c, src/visibility.h: Update. + * tests/t-kdf.c (start_thread, my_kdf_derive): Follow the change. + + kdf: Improve new KDF API. + + commit f21871e241e96148cef3ad4314ad596178cf8967 + * cipher/kdf.c (struct argon2_thread_data): Change layout. + (argon2_iterator): Use struct gcry_kdf_pt_head. + (argon2_compute_segment): Rename from argon2_compute_row. + (argon2_open): Handle N_THREAD maximum. + (_gcry_kdf_iterator): Use struct gcry_kdf_pt_head. + (_gcry_kdf_compute_segment): Rename from _gcry_kdf_compute_row. + * src/gcrypt-int.h: Update declarations. + * src/gcrypt.h.in (struct gcry_kdf_pt_head): Expose the data type. + * src/libgcrypt.def, src/libgcrypt.vers: Update. + * src/visibility.c, src/visibility.h: Update. + * tests/t-kdf.c (start_thread, my_kdf_derive): Follow the change. + +2022-01-25 NIIBE Yutaka + + random: Include sys/random.h when available. + + commit 5e2d792eb8d9e5aaf1b71205f9298286b8145462 + * configure.ac (AC_CHECK_HEADERS): Check sys/random.h. + * random/rndgetentropy.c [HAVE_SYS_RANDOM_H]: Include it. + + cipher: Add new API for modern KDF function. + + commit bafdb90d97b65db541ea917088ca956e6a364f6b + * cipher/kdf.c (hash, argon2_genh0_first_blocks): New for Argon2. + (argon2_init, argon2_ctl, argon2_iterator): Likewise. + (argon2_compute_row, argon2_final, argon2_close): Likewise. + (argon2_open): Likewise. + (balloon_open): New for Balloon. + (_gcry_kdf_open, _gcry_kdf_ctl, _gcry_kdf_iterator): Add new API. + (_gcry_kdf_compute_row, _gcry_kdf_final, _gcry_kdf_close): Likewise. + * src/gcrypt-int.h: Add declarations for new API. + * src/gcrypt.h.in: Likewise. + (enum gcry_kdf_algos): Add GCRY_KDF_ARGON2 and GCRY_KDF_BALLOON. + (enum gcry_kdf_subalgo_argon2): Add GCRY_KDF_ARGON2D, + GCRY_KDF_ARGON2I, and GCRY_KDF_ARGON2ID. + * src/libgcrypt.def, src/libgcrypt.vers: Update. + * src/visibility.h: Likewise. + * src/visibility.c: Add new API. + * tests/Makefile.am (t_kdf_LDADD, t_kdf_CFLAGS): Enable use of pthread. + * tests/t-kdf.c (check_argon2): New, not enabled yet. + + Prefer uint64_t for the definition of u64. + + commit 3d353782d84b9720262d7b05adfae3aef7ff843b + * src/types.h (u64): Prefer use of uint64_t with C99 compliant + compiler. + + tests: Fix variable initialization for tests. + + commit 99642f18ccbe45fb4cae55945af49f7884bcaceb + * tests/t-rsa-15.c (one_test_sexp): Initialize OUT_LEN. + * tests/t-rsa-pss.c (one_test_sexp): Initialize CTX and OUT_LEN. + Fix the if condition. + +2022-01-25 Jakub Jelen + + mpi: Add missing header file to the tarball. + + commit 08f3e0909f8c4fefc2c020dca206037693282186 + * mpi/Makefile.am: Add missing header file. + + doc: Update more information about FIPS selftests and algorithms. + + commit 1f299cb16afdfd0ccc3cd9e9ae65a789be6514f7 + * doc/gcrypt.texi: List implemented GOST curves. + Update location of the HMAC selftests and add SHA3 ones. + Add information about ECC selftests. + Add information about KDF selftests. + Update information about additional MAC selftests. + Update ifnromation about FIPS allowed algorithms. + +2022-01-22 Jussi Kivilinna + + tests/t-kdf: fix format string argument type mismatch. + + commit e9e723d5e320ff2c67bf9a9841777749a44e54d0 + * tests/t-kdf.c (check_pbkdf2, check_scrypt): Change fprintf format + for plen from "%ld" to "%u" and cast plen to 'unsigned int'. + + Fix building GCM when GCM_USE_ARM_NEON defined but GCM_USE_ARM_PMULL not + + commit a35ac62ee7b5a6e799eb4a89a934da0313fb1158 + * cipher/cipher-gcm.c (setupM): Remove ifdef around 'features'. + +2022-01-20 NIIBE Yutaka + + scrypt: Fix the last step of SCRYPT. + + commit 867435cf8847fb80e922eb818fbcfac131863b8c + * cipher/scrypt.c (_gcry_kdf_scrypt): Single call to PBKDF2. + + fips: Recover test cases for selftest, add skipping in FIPS mode. + + commit 535a4d345872aa2cd2ab3a5f9c4411d0a0313328 + * cipher/kdf.c (check_one): Skip a test with shorter passphrase in + FIPS mode. + (selftest_pbkdf2): Recover selftest cases. + * cipher/mac-hmac.c (check_one): Skip a test with shorter key in FIPS + mode. + (selftests_sha224, selftests_sha256): Recover selftest cases. + (selftests_sha384, selftests_sha512, selftests_sha3): Likewise. + +2022-01-19 NIIBE Yutaka + + fips: Reject shorter key for HMAC in FIPS mode. + + commit 76aad97dd312e83f2f9b8d086553f2b72ab6546f + * cipher/md.c (prepare_macpads): Reject < 112-bit key. + * cipher/kdf.c (selftest_pbkdf2): Remove selftest cases with shorter + key. + * cipher/mac-hmac.c (selftests_sha224, selftests_sha256): Likewise. + (selftests_sha384, selftests_sha512, selftests_sha3): Likewise. + * tests/basic.c (check_one_hmac) Handle an error when shorter key + is rejected. + (check_one_mac): Likewise. + * tests/t-kdf.c (check_pbkdf2, check_scrypt): Likewise. + +2022-01-18 NIIBE Yutaka + + build: Fix .m4 files in distribution. + + commit 6f225308d3e59f8749403ad743d8e6c591142f8f + * m4/Makefile.am (EXTRA_DIST): Remove sys_socket_h.m4. + +2022-01-17 NIIBE Yutaka + + fips: Remove GCRYCTL_FIPS_SERVICE_INDICATOR and renumber the enum. + + commit d0db6a5abf7b8cc5637de5a080a7ed986e3ff63f + * src/gcrypt.h.in (enum gcry_ctl_cmds): Remove + GCRYCTL_FIPS_SERVICE_INDICATOR. + * src/fips.c (_gcry_fips_indicator_cipher): Use gcry_kdf_algos. + * tests/basic.c: Use GCRYCTL_FIPS_SERVICE_INDICATOR_CIPHER. + +2022-01-17 Jakub Jelen + + Update documentation related to FIPS. + + commit e023e10ee89baf5d5909de4d8c13ba6dfbc8ed99 + * cipher/rsa.c (selftest_encr_2048): Fix error message + * doc/gcrypt.texi: Add missing hwfeatures + Add description of the service indicator API + Fix typo in tampered word + Add some missing curves + Remove algoriths no longer used in FIPS mode and update claims given + + fips: Add support for KDF FIPS indicators. + + commit 8611c9f276ad0f51fcdd4da0481108880104338f + * src/fips.c (_gcry_fips_indicator): rename to + _gcry_fips_indicator_cipher(). + (_gcry_fips_indicator_kdf): New function. + * src/g10lib.h: Rename _gcry_fips_indicator to + _gcry_fips_indicator_cipher() and add _gcry_fips_indicator_kdf() + * src/gcrypt.h.in (enum gcry_ctl_cmds): Add + GCRYCTL_FIPS_SERVICE_INDICATOR_CIPHER and + GCRYCTL_FIPS_SERVICE_INDICATOR_KDF. + * src/global.c (_gcry_vcontrol): Implement support for KDF FIPS + Indicator separate from the cipher one. + +2022-01-11 Jussi Kivilinna + + rijndael-aesni: small optimization for cbc-enc and cfb-enc. + + commit dfd53c7eddf0beaf9e85daaed92c0bd756112470 + * cipher/rijndael-aesni.c (_gcry_aes_aesni_cfb_enc) + (_gcry_aes_aesni_cbc_enc): Copy contents of 'do_aesni_enc' here and + merge input/output and first/last round key xoring to shorten critical + path. + + mpi/amd64: remove extra 'ret' from assembly functions. + + commit 0c0f27a89205842b5ef8e56a9726074f6b738f73 + * mpi/amd64/mpih-add1.S: Remove 'ret' as it is already included by + FUNC_EXIT macro. + * mpi/amd64/mpih-lshift.S: Likewise. + * mpi/amd64/mpih-mul1.S: Likewise. + * mpi/amd64/mpih-mul2.S: Likewise. + * mpi/amd64/mpih-mul3.S: Likewise. + * mpi/amd64/mpih-rshift.S: Likewise. + * mpi/amd64/mpih-sub1.S: Likewise. + + mpi/config.links: merge i586 targets with rest i*86 targets. + + commit 9bbb6c2c5d03c19b7f4356628a76eb8bde3ab026 + * mpi/config.links: Merge i586 targets with rest i[3467]86 targets. + + mpi: remove unused i586 and pentium4 assembly. + + commit 2800de892585c405099039d6f9dc346c3a71c16e + * mpi/config.links: Remove 'i586' from paths. + * mpi/i586*: Remove. + * mpi/pentium4/*: Remove. + + Add straight-line speculation hardening for aarch64 assembly. + + commit 34bcc102158a651781f4e7639e2654068a39db6d + * cipher/asm-common-aarch64.h (ret_spec_stop): New. + * cipher/asm-poly1305-aarch64.h: Use 'ret_spec_stop' for 'ret' + instruction. + * cipher/camellia-aarch64.S: Likewise. + * cipher/chacha20-aarch64.S: Likewise. + * cipher/cipher-gcm-armv8-aarch64-ce.S: Likewise. + * cipher/crc-armv8-aarch64-ce.S: Likewise. + * cipher/rijndael-aarch64.S: Likewise. + * cipher/rijndael-armv8-aarch64-ce.S: Likewise. + * cipher/sha1-armv8-aarch64-ce.S: Likewise. + * cipher/sha256-armv8-aarch64-ce.S: Likewise. + * cipher/sm3-aarch64.S: Likewise. + * cipher/twofish-aarch64.S: Likewise. + * mpi/aarch64/mpih-add1.S: Likewise. + * mpi/aarch64/mpih-mul1.S: Likewise. + * mpi/aarch64/mpih-mul2.S: Likewise. + * mpi/aarch64/mpih-mul3.S: Likewise. + * mpi/aarch64/mpih-sub1.S: Likewise. + + Add straight-line speculation hardening for amd64 and i386 assembly. + + commit 11ade08efbfbc36dbf3571f1026946269950bc40 + * cipher/asm-common-amd64.h (ret_spec_stop): New. + * cipher/arcfour-amd64.S: Use 'ret_spec_stop' for 'ret' instruction. + * cipher/blake2b-amd64-avx2.S: Likewise. + * cipher/blake2s-amd64-avx.S: Likewise. + * cipher/blowfish-amd64.S: Likewise. + * cipher/camellia-aesni-avx-amd64.S: Likewise. + * cipher/camellia-aesni-avx2-amd64.h: Likewise. + * cipher/cast5-amd64.S: Likewise. + * cipher/chacha20-amd64-avx2.S: Likewise. + * cipher/chacha20-amd64-ssse3.S: Likewise. + * cipher/des-amd64.S: Likewise. + * cipher/rijndael-aarch64.S: Likewise. + * cipher/rijndael-amd64.S: Likewise. + * cipher/rijndael-ssse3-amd64-asm.S: Likewise. + * cipher/rijndael-vaes-avx2-amd64.S: Likewise. + * cipher/salsa20-amd64.S: Likewise. + * cipher/serpent-avx2-amd64.S: Likewise. + * cipher/serpent-sse2-amd64.S: Likewise. + * cipher/sha1-avx-amd64.S: Likewise. + * cipher/sha1-avx-bmi2-amd64.S: Likewise. + * cipher/sha1-avx2-bmi2-amd64.S: Likewise. + * cipher/sha1-ssse3-amd64.S: Likewise. + * cipher/sha256-avx-amd64.S: Likewise. + * cipher/sha256-avx2-bmi2-amd64.S: Likewise. + * cipher/sha256-ssse3-amd64.S: Likewise. + * cipher/sha512-avx-amd64.S: Likewise. + * cipher/sha512-avx2-bmi2-amd64.S: Likewise. + * cipher/sha512-ssse3-amd64.S: Likewise. + * cipher/sm3-avx-bmi2-amd64.S: Likewise. + * cipher/sm4-aesni-avx-amd64.S: Likewise. + * cipher/sm4-aesni-avx2-amd64.S: Likewise. + * cipher/twofish-amd64.S: Likewise. + * cipher/twofish-avx2-amd64.S: Likewise. + * cipher/whirlpool-sse2-amd64.S: Likewise. + * mpi/amd64/func_abi.h (CFI_*): Remove, include from "asm-common-amd64.h" + instead. + (FUNC_EXIT): Use 'ret_spec_stop' for 'ret' instruction. + * mpi/asm-common-amd64.h: New. + * mpi/i386/mpih-add1.S: Use 'ret_spec_stop' for 'ret' instruction. + * mpi/i386/mpih-lshift.S: Likewise. + * mpi/i386/mpih-mul1.S: Likewise. + * mpi/i386/mpih-mul2.S: Likewise. + * mpi/i386/mpih-mul3.S: Likewise. + * mpi/i386/mpih-rshift.S: Likewise. + * mpi/i386/mpih-sub1.S: Likewise. + * mpi/i386/syntax.h (ret_spec_stop): New. + + Optimizations for AES aarch64-ce assembly implementation. + + commit ff2a647d36677f6ad9edbe992a6c0ab0f7cf9510 + * cipher/rijndael-armv8-aarch64-ce.S (vk14): Remove. + (vklast, __, _): New. + (aes_preload_keys): Setup vklast. + (do_aes_one128/192/256): Split to ... + (do_aes_one_part1, do_aes_part2_128/192/256): ... these and add + interleave ops. + (do_aes_one128/192/256): New using above part1 and part2 macros. + (aes_round_4): Rename to ... + (aes_round_4_multikey): ... this and allow different key used for + parallel blocks. + (aes_round_4): New using above multikey macro. + (aes_lastround_4): Reorder AES round and xor instructions, allow + different last key for parallel blocks. + (do_aes_4_128/192/256): Split to ... + (do_aes_4_part1_multikey, do_aes_4_part1) + (do_aes_4_part2_128/192/256): ... these. + (do_aes_4_128/192/256): New using above part1 and part2 macros. + (CLEAR_REG): Use movi for clearing registers. + (aes_clear_keys): Remove branching and clear all key registers. + (_gcry_aes_enc_armv8_ce, _gcry_aes_dec_armv8_ce): Adjust to macro + changes. + (_gcry_aes_cbc_enc_armv8_ce, _gcry_aes_cbc_dec_armv8_ce) + (_gcry_aes_cfb_enc_armv8_ce, _gcry_aes_cfb_enc_armv8_ce) + (_gcry_aes_ctr32le_enc_armv8_ce): Apply entry/loop-body/exit + optimization for better interleaving of input/output processing; + First/last round key and input/output xoring optimization to reduce + critical path length. + (_gcry_aes_ctr_enc_armv8_ce): Add fast path for counter incrementing + without byte-swaps when counter does not overflow 8-bit; Apply + entry/loop-body/exit optimization for better interleaving of + input/output processing; First/last round key and input/output + xoring optimization to reduce critical path length. + (_gcry_aes_ocb_enc_armv8_ce, _gcry_aes_ocb_dec_armv8_ce): Add aligned + processing for nblk and OCB offsets; Apply entry/loop-body/exit + optimization for better interleaving of input/output processing; + First/last round key and input/output xoring optimization to reduce + critical path length; Change to use same function body macro for + both encryption and decryption. + (_gcry_aes_xts_enc_armv8_ce, _gcry_aes_xts_dec_armv8_ce): Apply + entry/loop-body/exit optimization for better interleaving of + input/output processing; First/last round key and input/output + xoring optimization to reduce critical path length; Change to use + same function body macro for both encryption and decryption. + + Add armv8/pmull accelerated POLYVAL for GCM-SIV. + + commit 4e6f1ef5a00e15128e5f2398e2c282d31152d276 + * cipher/cipher-gcm-armv8-aarch32-ce.S + (_gcry_polyval_armv8_ce_pmull): New. + * cipher/cipher-gcm-armv8-aarch64-ce.S + (_gcry_polyval_armv8_ce_pmull): New. + * cipher/cipher-gcm.c (_gcry_polyval_armv8_ce_pmull) + (polyval_armv8_ce_pmull): New. + (setupM) [GCM_USE_ARM_PMULL]: Setup 'polyval_armv8_ce_pmull' as POLYVAL + function. + + Use 'vmov' and 'movi' for vector register clearing in ARM assembly. + + commit 859b6ac7fbdb6ec18d1536e14b9ee83c1add224e + * cipher/chacha20-aarch64.S (clear): Use 'movi'. + * cipher/chacha20-armv7-neon.S (clear): Use 'vmov'. + * cipher/cipher-gcm-armv7-neon.S (clear): Use 'vmov'. + * cipher/cipher-gcm-armv8-aarch32-ce.S (CLEAR_REG): Use 'vmov'. + * cipher/cipher-gcm-armv8-aarch64-ce.S (CLEAR_REG): Use 'movi'. + * cipher/rijndael-armv8-aarch32-ce.S (CLEAR_REG): Use 'vmov'. + * cipher/sha1-armv7-neon.S (clear): Use 'vmov'. + * cipher/sha1-armv8-aarch32-ce.S (CLEAR_REG): Use 'vmov'. + * cipher/sha1-armv8-aarch64-ce.S (CLEAR_REG): Use 'movi'. + * cipher/sha256-armv8-aarch32-ce.S (CLEAR_REG): Use 'vmov'. + * cipher/sha256-armv8-aarch64-ce.S (CLEAR_REG): Use 'movi'. + * cipher/sha512-armv7-neon.S (CLEAR_REG): New using 'vmov'. + (_gcry_sha512_transform_armv7_neon): Use CLEAR_REG for clearing + registers. + + Add SM3 ARM/AArch64 assembly implementation. + + commit f664333a4749eab03c6b19bae2f28863b8501a24 + * cipher/Makefile.am: Add 'sm3-aarch64.S'. + * cipher/sm3-aarch64.S: New. + * cipher/sm3.c (USE_AARCH64_SIMD): New. + [USE_AARCH64_SIMD] (_gcry_sm3_transform_aarch64) + (do_sm3_transform_aarch64): New. + (sm3_init) [USE_AARCH64_SIMD]: New. + * configure.ac: Add 'sm3-aarch64.lo'. + * tests/basic.c (main): Add command-line option '--hash' for running + only hash algorithm tests. + +2022-01-11 NIIBE Yutaka + + random: Rename rndlinux module to rndoldlinux. + + commit 560943805a525a6f479b666578b0ff7d51e6f833 + * configure.ac (USE_RNDOLDLINUX): Rename from USE_RNDLINUX. + (GCRYPT_RANDOM): Use rndoldlinux.lo. + * doc/gcrypt.texi: Update. + * random/Makefile.am (EXTRA_librandom_la_SOURCES): Update. + * random/rndoldlinux.c: Rename from rndlinux.c. Rename the function. + * random/rand-internal.h: Update the function name. + * random/random-csprng.c: Update the calls to the function. + * random/random-drbg.c: Likewise. + * random/random-system.c: Likewise. + * src/global.c: Use USE_RNDOLDLINUX. + +2022-01-11 Jakub Jelen + + configure: Fix help text for the fips module version. + + commit 83e58191d3d960b3efda960dd6fe50e8f0b02bda + * configure.ac: Fix unmatched parenthesis and add more verbose + description of the --with-fips-module-version configure option. + +2022-01-11 NIIBE Yutaka + + fips: Provide a mechanizm to put libgcrypt in non-FIPS mode. + + commit 2a8b3fed1a80e74dfb12c03e426373a300407eda + * doc/gcrypt.texi (Disabling FIPS mode): Add. + * src/gcrypt.h.in (GCRYCTL_NO_FIPS_MODE): New. + * src/global.c (_gcry_vcontrol): Support GCRYCTL_NO_FIPS_MODE. + * tests/t-ed25519.c: Add --no-fips option to test non-FIPS mode. + + cipher: Keep original behavior of Key Unwrap when not extended. + + commit 383866f014f2ae8487d15e3fd99fe688b489d364 + * cipher/cipher-aeswrap.c (_gcry_cipher_keywrap_decrypt_auto): Only + allow unwrapping by KWP when GCRY_CIPHER_EXTENDED is specified. + +2022-01-05 NIIBE Yutaka + + cipher: Add an API to retrieve unwrapped key length for KWP. + + commit 746b8e29969be56e086191dbe93978f7e0355aa0 + * cipher/cipher-aeswrap.c (_gcry_cipher_keywrap_decrypt) + (_gcry_cipher_keywrap_decrypt_padding): Merged into... + (_gcry_cipher_keywrap_decrypt_auto): ... this. + Write length information to struct gcry_cipher_handle. + * cipher/cipher-internal.h (struct gcry_cipher_handle): Add + u_mode.wrap. + * cipher/cipher.c (_gcry_cipher_setup_mode_ops): Use + _gcry_cipher_keywrap_decrypt_auto. + (_gcry_cipher_info): Support GCRYCTL_GET_KEYLEN for + GCRY_CIPHER_MODE_AESWRAP. Not that it's not length of KEK, + but length of unwrapped key. + * tests/aeswrap.c (check_one_with_padding): Add check + for length of unwrapped key. + +2022-01-04 NIIBE Yutaka + + cipher: Use const for *_spec_t, if possible. + + commit f9ba07942b10c72af50bd73c92c4851b6981546e + * cipher/blake2.c: Use const. + * cipher/camellia-glue.c, cipher/cipher.c, cipher/crc.c: Likewise. + * cipher/des.c, cipher/gost28147.c, cipher/gostr3411-94.c: Likewise. + * cipher/keccak.c, cipher/mac-cmac.c, cipher/mac-gmac.c: Likewise. + * cipher/mac-hmac.c, cipher/mac-internal.h: Likewise. + * cipher/mac-poly1305.c, cipher/mac.c, cipher/md.c: Likewise. + * cipher/md.c, cipher/md2.c, cipher/md4.c, cipher/md5.c: Likewise. + * cipher/pubkey.c, cipher/rfc2268.c, cipher/rijndael.c: Likewise. + * cipher/rmd160.c, cipher/seed.c, cipher/serpent.c: Likewise. + * cipher/sha1.c, cipher/sha256.c, cipher/sha512.c: Likewise. + * cipher/sm3.c, cipher/sm4.c, cipher/stribog.c: Likewise. + * cipher/pubkey.c, cipher/rfc2268.c, cipher/rijndael.c: Likewise. + * src/cipher-proto.h, src/cipher.h: Likewise. + + fips: Use flags.fips to check algo availability. + + commit 034e4402dade7a4bcc239913b78c702c5c6f0dbb + * cipher/cipher.c (check_cipher_algo): Check ->flags.fips. + (_gcry_cipher_open_internal, _gcry_cipher_selftest): Likewise. + (_gcry_cipher_init): Don't modify ->flags.disabled. + * cipher/mac.c (_gcry_mac_init): Don't modify ->flags.disabled. + (check_mac_algo): Check ->flags.fips. + (mac_open, _gcry_mac_selftest): Likewise. + * cipher/md.c (check_digest_algo): Check ->flags.fips. + (md_enable, _gcry_md_hash_buffer): Likewise. + (_gcry_md_hash_buffers_extract, _gcry_md_selftest): Likewise. + (_gcry_md_init): Don't modify ->flags.disabled. + + doc: Update doc/gcrypt.texi for random/. + + commit 11ef7b50a708b92d94e1e1f47433fc53b3fd2cf3 + * doc/gcrypt.texi: Address rndgetentropy module. Remove X9.31 RPNG + documentation, as the implementation has been removed already. + +2022-01-03 NIIBE Yutaka + + cipher: Add support of Key wrap with padding (KWP). + + commit 2914f169f95467b9c789000105773b38ad2dea5a + * src/gcrypt.h.in (GCRY_CIPHER_EXTENDED): New enum value. + * cipher/cipher-aeswrap.c (wrap): New. + (_gcry_cipher_keywrap_encrypt, unwrap): Use wrap. + (_gcry_cipher_keywrap_encrypt_padding): New. + (_gcry_cipher_keywrap_decrypt): Use unwrap. + (_gcry_cipher_keywrap_decrypt_padding): New. + * cipher/cipher-internal.h: Add declarations. + * cipher/cipher.c (_gcry_cipher_open_internal): Support + GCRY_CIPHER_EXTENDED. + (_gcry_cipher_setup_mode_ops): Extend for GCRY_CIPHER_MODE_AESWRAP. + * tests/aeswrap.c: Add two tests from RFC5649. + +2021-12-22 NIIBE Yutaka + + build: Update for newer autoconf. + + commit 3204c3827e9840915af2b6cbf603f3cf51664568 + * configure.ac (AC_PREREQ): Require >=3D 2.69. + (AC_CONFIG_HEADERS): Use it, instead of AC_CONFIG_HEADER. + (AC_HEADER_STDC): Remove. + * m4/sys_socket_h.m4: Remove. + +2021-12-21 Danny Tsen + + AES-GCM: Bulk implementation of AES-GCM acceleration for ppc64le. + + commit 7205c715b3e0f6fd0b853e8916d174048f43c03b + * configure.ac: Added p10 assembly implementation file and assiciated fil= e. + * cipher/Makefile.am: Added p10 assembly implementation file and associat= ed + file. + * cipher/rijndael.c: Added p10 function. + * cipher/rijndael-p10le.c: New wrapper file for AES-GCM call. + * cipher/rijndael-gcm-p10le.s: New implementation of AES-GCM bulk functio= n in + Power Assembly. + * src/g10lib.h: Added Power arch 3.1 definition for p10. + * src/hwf-ppc.c: Added Power arch 3.1 definition for p10. + * src/hwfeatures.c: Added Power arch 3.1 definition for p10. + +2021-12-21 Tianjia Zhang + + cipher: Fix SM3 avx/bmi2 compilation error. + + commit 3b9f746c2fb16234dffe0582059dfe36b2c21bf8 + * cipher/sm3-avx-bmi2-amd64.S: Change K0-K63 macros to signed decimal. + +2021-12-17 NIIBE Yutaka + + random: Keep --enable-random-daemon, but not its use from runtime. + + commit 27d945084f6926d0ebe8066fb60db785f3a8fb57 + * configure.ac (--enable-random-daemon): Don't define + USE_RANDOM_DAEMON, but use the conditional ENABLE_RANDOM_DAEMON. + * src/Makefile.am: Use the conditional ENABLE_RANDOM_DAEMON. + + random: Remove random-daemon use remained. + + commit 14f5d73e2731b83b18e9771eb3068c6dbba6f069 + * configure.ac (--enable-random-daemon): Fix the message. + * random/random-csprng.c [USE_RANDOM_DAEMON] (initialize_basics): + Remove the dependency to random daemon. + * random/random.h [USE_RANDOM_DAEMON]: Likewise. + + fips: Add constructor to run selftests. + + commit 45974d87753978b953940045280e9f28f951dbe0 + * src/fips.c (_gcry_fips_to_activate): New. + * src/g10lib.h (_gcry_fips_to_activate): New. + * src/global.c [ENABLE_HMAC_BINARY_CHECK] (_gcry_global_constructor): + New. + +2021-12-16 NIIBE Yutaka + + Simplify the logic for no_secure_memory. + + commit 209d98dcf66bd7baeca37cd6b13b31c7f00f4625 + * src/global.c (_gcry_vcontrol): Don't set NO_SECURE_MEMORY when + FIPS mode is enabled. + (get_no_secure_memory): Remove. Don't touch NO_SECURE_MEMORY, + when examining the variable. + (do_malloc, _gcry_is_secure): Just use NO_SECURE_MEMORY. + +2021-12-14 Jussi Kivilinna + + Add SM3 x86-64 AVX/BMI2 assembly implementation. + + commit 0c1d55a84c8970b8568ae645f24ce534bebdb5a4 + * cipher/Makefile.am: Add 'sm3-avx-bmi2-amd64.S'. + * cipher/sm3-avx-bmi2-amd64.S: New. + * cipher/sm3.c (USE_AVX_BMI2, ASM_FUNC_ABI, ASM_EXTRA_STACK): New. + (SM3_CONTEXT): Define 'h' as array instead of separate fields 'h1', + 'h2', etc. + [USE_AVX_BMI2] (_gcry_sm3_transform_amd64_avx_bmi2) + (do_sm3_transform_amd64_avx_bmi2): New. + (sm3_init): Select AVX/BMI2 transform function if support by HW; Update + to use 'hd->h' as array. + (transform_blk, sm3_final): Update to use 'hd->h' as array. + * configure.ac: Add 'sm3-avx-bmi2-amd64.lo'. + +2021-12-10 Jakub Jelen + + tests: Include the new input files for tests. + + commit 02583e1216bc7e6f9f4219771bb274d1fe4491c8 + * tests/Makefile.am: Include the new .inp files needed for tests + +2021-12-09 NIIBE Yutaka + + tests,fips: Align the use of variable in_fips_mode. + + commit 7d8403b59a105d2d3e5d0fd9d5d25b7e3b2d2787 + * tests/pubkey.c (check_run): Fix use of pkey and skey. + * tests/*.c (in_fips_mode): No initialize by 0. + +2021-12-09 Jakub Jelen + + Adjust tests for proper disablement of non-approve PK operations. + + commit 5b82f4b4dbf393d0ce901fc9e0c559c488b013cb + * cipher/pubkey.c (_gcry_pk_genkey): Do not allow key generation of + disabled key types + * tests/benchmark.c (elg_bench): Skip Elgamal keys benchmark in FIPS + mode + (dsa_bench): Skip DSA keys benchmarking in FIPS mode + * tests/dsa-rfc6979.c (check_dsa_rfc6979): DSA keys are no longer + allowed in FIPS mode + * tests/fips186-dsa.c (global): Use global in_fips_mode flag + (check_dsa_gen_186_2): Expect DSA keygen fail in FIPS mode + (check_dsa_gen_186_3): Ditto. + (main): Use global fips mode flag. + * tests/keygen.c (check_elg_keys): Verify Elgamal keys can not be + generated in FIPS mode + (check_dsa_keys): Verify DSA keys can not be generated in FIPS mode. + * tests/pubkey.c (get_elg_key_new): Expect key generation to fail in + FIPS mode + (get_dsa_key_new): Expect DSA key generation to fail in FIPS mode + (get_dsa_key_fips186_new): Ditto. + (get_dsa_key_with_domain_new): Ditto. + (get_dsa_key_fips186_with_seed_new): Ditto. + (check_run): Do not try the Elgamal and DSA key operations in FIPS + mode. + * tests/t-dsa.c (one_test_sexp): Skip the DSA tests in FIPS mode. + +2021-12-08 NIIBE Yutaka + + tests: Add tests for gcry_pk_hash_sign/verify API. + + commit a0a2b6796f58f9aac0fe49100b1ee4c68f9bdc72 + * tests/Makefile.am (tests_bin): Add t-dsa t-ecdsa t-rsa-pss t-rsa-15. + * tests/t-dsa.c, tests/t-ecdsa.c: New tests. + * tests/t-rsa-15.c, tests/t-rsa-pss.c: New tests. + * tests/t-dsa.inp, tests/t-ecdsa.inp: New data for tests. + * tests/t-rsa-15.inp, tests/t-rsa-pss.inp: New data for tests. + +2021-12-08 Jakub Jelen + + fips: Disable DSA in FIPS mode. + + commit ea362090fc11caa28643153fc6444442243c8765 + * cipher/dsa.c (run_selftests): Disable DSA spec in FIPS mode. + * src/fips.c (run_pubkey_selftests): Skip DSA power-on selftests. + +2021-12-08 NIIBE Yutaka + + random: Remove random-fips.c from repo. + + commit 5521cac32d75f2b94894cd5a94deb2c5d25f43a5 + * random/random-fips.c: Remove. + +2021-12-07 Alexander Kanavin + + build: cipher/Makefile.am, doc/Makefile.am: add a missing space. + + commit 05472c1882df2fb84b867c0bdbbff510065785ba + * cipher/Makefile.am: Add a space. + * doc/Makefile.am: Ditto. + +2021-12-07 NIIBE Yutaka + + md: Fix disabled check. + + commit 8ca3fe07d03e9329ee97534f40208593cde11bf7 + * cipher/md.c (md_enable): Fix accessing the disabled flag. + +2021-12-07 Jakub Jelen + + Properly enforce disablement in other pubkey API. + + commit e96980022e5ec079c9d4e3492eb6a1131c68e0f2 + * cipher/pubkey.c (_gcry_pk_encrypt): Fail if algo is disabled + (_gcry_pk_decrypt): Ditto. + (_gcry_pk_sign): Ditto. + (_gcry_pk_sign_md): Ditto. + (_gcry_pk_verify): Ditto. + (_gcry_pk_verify_md): Ditto. + (_gcry_pk_testkey): Ditto. + (_gcry_pk_get_nbits): Ditto. + (_gcry_pk_get_curve): Ditto. + * tests/basic.c (check_pubkey): Test also other API in FIPS mode to + verify they fail as expected. + +2021-12-07 NIIBE Yutaka + + tests: Add paren for readability. + + commit bea8b9672c3c47c9bffb7edc52fb32cf9091c231 + * tests/basic.c (check_pubkey): Add parentheses. + + md: Fix checking to use ->disabled instead of ->fips directly. + + commit 3152a565d9a426b6c984e161d1a95a8df347dc15 + * cipher/md.c (md_enable): Check by ->disabled. + (_gcry_md_hash_buffer, _gcry_md_hash_buffers_extract): Likewise. + + random: Remove use of experimental random daemon. + + commit 754ad5815b5bb7462260414f2bc5f449bee0b1c6 + * random/Makefile.am (librandom_la_SOURCES): Remove random-daemon.c. + * random/random-daemon.c: Remove. + * random/rand-internal.h: Remove declarations. + * random/random-csprng.c (_gcry_rngcsprng_set_daemon_socket) + (_gcry_rngcsprng_use_daemon): Remove. + [USE_RANDOM_DAEMON] (_gcry_rngcsprng_randomize): Don't call + _gcry_daemon_randomize. + * random/random.c (_gcry_set_random_daemon_socket) + (_gcry_use_random_daemon): Remove. + * src/global.c (_gcry_vcontrol): Return GPG_ERR_NOT_SUPPORTED. + * tests/benchmark.c (main): Remove support of use_random_daemon. + +2021-12-06 NIIBE Yutaka + + random: Release memory in DRBG. + + commit 751fcadd34ed42b2e595664e9ec3f88fd074d7b7 + * random/random-drbg.c (_gcry_rngdrbg_close_fds): Release DRBG_STATE. + + fips: Factor out check_fips_system_setting function. + + commit 5425052f38cd41a99469e4c3245a1c3e037410fe + * src/fips.c (check_fips_system_setting): New. + (_gcry_initialize_fips_mode): Use the new function. + + cipher,tests: Consitent use of #if/#endif for algo selection. + + commit b14aaf1a2dc71560e1f7c19ac88a7b16cc491f25 + * cipher/cipher.c: Use #if instead of #ifdef for algo. + * cipher/mac-cmac.c: Likewise. + * cipher/mac-hmac.c: Likewise. + * cipher/mac-internal.h: Likewise. + * cipher/mac.c: Likewise. + * tests/basic.c: Likewise. + +2021-12-06 Jakub Jelen + + tests: Conditionalize other algorithms that might not be built-in. + + commit 57b61b0f4f1be7513ed064a90321849bb9f47f29 + * tests/basic.c (check_cbc_mac_cipher): Do not run DES tests without DES + being built-in. + (check_ecb_cipher): Do not run blowfish and DES tests without them + being built-in + (check_cfb_cipher): Do not run DES tests without DES being built-in. + (check_ccm_cipher): Do not run camellia tests without it being + built-in. + (check_ocb_cipher): Do not run Camellia, Twofish and Serpent tests + without them being built-in. + (check_digests): Do not run SM3 tests without them being built-in. + (check_digests): Do not run DES, Camellia and GOST tests without them + being built-in. + + tests: Unbreak tests with SM4 disabled. + + commit b601ef4dc9f9a337e3019fc5ad3c7b31fcdc43f3 + * tests/basic.c (check_ecb_cipher): Do not run SM4 tests when SM4 is not + built. + (check_ctr_cipher): Ditto. + (check_cfb_cipher): Ditto. + (check_ofb_cipher): Ditto. + (check_ocb_cipher): Ditto. + +2021-12-03 NIIBE Yutaka + Jakub Jelen + + rsa: Allow e=3D0 to select 65537 for keygeneration under X931. + + commit e4a450d1d966cf19cc5ba4d772254be08782e463 + * cipher/rsa.c (generate_x931): Use e=3D65537. + +2021-12-03 Jakub Jelen + + random: Add missing header file to the release tarball. + + commit 78ce1f9e0afe296eab916f1b547f967166f80e10 + * random/Makefile.am: Add missing header file. + +2021-12-01 Jussi Kivilinna + + gcry_mpi_sub_ui: fix subtracting from negative value. + + commit d5bf106468e6c6b0f33b193abf04590e4e9fc011 + * mpi/mpi-add.c (_gcry_mpi_sub_ui): Set output sign bit when 'u' + is negative. + * tests/mpitests.c (test_add): Additional tests for mpi_add_ui; Check + test output and fail if output does not match expected. + (test_sub): Additional tests for mpi_sub_ui; Check test output and fail + if output does not match expected. + (test_mul): Additional tests for mpi_mul_ui; Check test output and fail + if output does not match expected. + +2021-12-01 NIIBE Yutaka + + tests: Fix basic.c to show useful information on error. + + commit bff9ed54285b9a332382589d89e317da987b5b38 + * tests/basic.c (check_ctr_cipher): Assign return value to ERR. + (check_siv_cipher, check_ccm_cipher): Likewise. + +2021-12-01 Jakub Jelen + + tests: Improve error checking in regards to FIPS. + + commit c8d2b0069e3cc97138c4e09224a84bb6ccf1b6b5 + * tests/basic.c (check_cbc_mac_cipher): Improve verbose alignment + (check_ecb_cipher): Improve verbose message alignment. + (check_ctr_cipher): Improve verbose message alignment. + (check_cfb_cipher): Improve verbose message alignment and error + reporting. + (check_ofb_cipher): Improve verbose message alignment and error + reporting. + (_check_gcm_cipher): Improve error checking. + (_check_eax_cipher): Improve error checking. + (check_siv_cipher): Improve error checking. + (check_gcm_siv_cipher): Improve error checking and indentation. + (_check_poly1305_cipher): Improve verbose message alignment. + (check_ccm_cipher): Improve verbose message alignment. + (do_check_ocb_cipher): Improve error checking. + (check_ocb_cipher_largebuf_split): Improve error checking. + (check_ocb_cipher_checksum): Improve error checking. + (check_ocb_cipher_splitaad): Improve error checking. + (check_gost28147_cipher_basic): Improve verbose message alignment. + (check_stream_cipher): Improve verbose message alignment. + (check_one_cipher_core): Improve error checking. + (check_ciphers): Improve error checking. + (check_pubkey): Check explicitly the for failure in FIPS mode. + + Disable 3DES in FIPS mode. + + commit 23a58b779e31e6244a481c26096d1ad061eb024c + * cipher/des.c (_gcry_cipher_spec_tripledes): Mark as non-FIPS + * cipher/mac-cmac.c ( _gcry_mac_type_spec_cmac_tripledes): Mark non-FIPS + * src/fips.c (run_cipher_selftests): skip 3DES selftests) + (run_mac_selftests): skip CMAC_3DES selftests + * tests/basic.c (check_cfb_cipher): Do not expect the 3DES working in + FIPS mode + +2021-11-30 Jakub Jelen + + Implement explicit FIPS indicators for cipher modes. + + commit 3d38968f4b751c5561679040c055c34a690bed75 + * src/fips.c (_gcry_fips_indicator): New. + * src/g10lib.h (_gcry_fips_indicator): New declaration. + * src/gcrypt.h.in (gcry_ctl_cmds): New GCRYCTL_FIPS_SERVICE_INDICATOR + * src/global.c (_gcry_vcontrol): Handle GCRYCTL_FIPS_SERVICE_INDICATOR + * tests/basic.c (do_check_ocb_cipher): Check excplicit FIPS indicator + (check_ocb_cipher_largebuf_split): Ditto. + (check_ocb_cipher_checksum): Ditto. + (check_ocb_cipher_splitaad): Ditto. + (check_bulk_cipher_modes): Ditto. + +2021-11-24 NIIBE Yutaka + + fips: Release random resources after selftests. + + commit 40ab39966650489449bee3e2a68f43a9d38c4dd4 + * src/fips.c (_gcry_fips_is_operational): Call _cgry_random_close_fds. + + random: Extend semantics of _gcry_random_close_fds. + + commit 204be8a385ae6140175e3b495989a261410c34d0 + * random/random-csprng.c (_gcry_rngcsprng_close_fds): Add + de-initialization. + * random/random-drbg.c (_gcry_rngdrbg_close_fds): Likewise. + +2021-11-18 Jussi Kivilinna + + Do not build 'cipher/' assembly files when --disable-asm used. + + commit 33f1a7ad3cd13602d8bffe156f383c3a704dfd67 + * configure.ac: Collect assembly implementation *.lo files under + GCRYPT_ASM_CIPHERS and GCRYPT_ASM_DIGEST for --disable-asm + selection. + + Do not build poly1305-s390x.S on foreign architectures. + + commit f10fa6b9a6ca7565408c4685d88a38893396d02b + * configure.ac [host=3Ds390x-*-*]: Add 'poly1305-s390x.lo'. + * cipher/Makefile.am: Move 'poly1305-s390x.S' to + 'EXTRA_libcipher_la_SOURCES'. + + jitterentropy: use wipememory for jent_memset_secure. + + commit a44301f6d2051b6b4e20b4459f41aa2b95f8b2b7 + * random/jitterentropy-base-user.h (jent_memset_secure): Use wipememory. + + jitterentropy: fix building on Win32. + + commit c38ebc3b6c7d6844209a58677379b61750b6504d + * random/jitterentropy.h (jent_notime_ctx): Add #ifdef + JENT_CONF_ENABLE_INTERNAL_TIMER around pthread variables. + +2021-11-18 NIIBE Yutaka + + tests: Remove tweak for FIPS enabled. + + commit 1183ffdd7a242955c1cc34eef0b02c002202a9ec + * tests/t-secmem.c (test_secmem): Remove the tweak. + + jitternetropy: Put our local change to use non-secure memory. + + commit 85cb7375fec39bb9fb195ca0bbe95bbbfd6deb98 + * random/jitterentropy-base.c (jent_entropy_collector_alloc_internal): + Let jent_memaccess use normal memory. + + build: Fix excess quotation to enable config.status --recheck works. + + commit 17f9eb20c94fd6711370546437b7150dc11a6335 + * configure.ac (DEF_HMAC_BINARY_CHECK): Fix quatation. + + random: Fix rndgetentropy correctly uses rndjent. + + commit 5493282b4aacd6b466c4ddd366ce9eb4036b3562 + * random/rndgetentropy.c (_gcry_rndgetentropy_gather_random): Call + _gcry_rndjent_poll for GCRY_VERY_STRONG_RANDOM. + +2021-11-17 NIIBE Yutaka + + jitterentropy: Use jent_read_entropy_safe for rndjent. + + commit 2101da04924b1361e2a1021b406a519a3bde9aee + * random/rndjent.c (_gcry_rndjent_poll): Use jent_read_entropy_safe. + + Fix jent_read_entropy for JENT_CPU_JITTERENTROPY_SECURE_MEMORY. + + commit d0fcb4da98a05097bc0cd6dc7377cb02aaa8b61c + * random/jitterentropy-base.c (jent_read_entropy): Fix conditional + compile. + + jitterentropy: Fix for C90 compiler. + + commit cf85258e6aff87f5b0614097b4ff2972ceb703fd + * random/jitterentropy-noise.c (jent_hash_time): Declare hash_loop_cnt + at the beginning of the function. + + jitterentropy: Disable use of pthread. + + commit 964c9c5eee30cc45488b88ec4c0199a41861e4aa + * random/jitterentropy.h (JENT_CONF_ENABLE_INTERNAL_TIMER): Undefine. + * random/jitterentropy-base.c [JENT_CONF_ENABLE_INTERNAL_TIMER] + (jent_entropy_switch_notime_impl): Add conditional compilation. + * random/jitterentropy-base-user.h [JENT_CONF_ENABLE_INTERNAL_TIMER] + (jent_yield): Likewise. + * random/jitterentropy.h [JENT_CONF_ENABLE_INTERNAL_TIMER] + (jent_entropy_switch_notime_impl): Likewise. + + jitterentropy: Fix building rndjent. + + commit d5ae5229db70f71301a3f3eefdd38a73a4fde499 + * random/Makefile.am: Update for new jitterentropy. + * random/rndjent.c: Update to include the other files. + + jitterentropy: Merge from jitterentropy-library-3.3.0. + + commit 3bacdac611b9eb3bd5ae8d78156b1110e77e9518 + * random/jitterentropy-base.h: New. + * random/jitterentropy-gcd.c: New. + * random/jitterentropy-gcd.h: New. + * random/jitterentropy-health.c: New. + * random/jitterentropy-health.h: New. + * random/jitterentropy-noise.c: New. + * random/jitterentropy-noise.h: New. + * random/jitterentropy-sha3.c: New. + * random/jitterentropy-sha3.h: New. + * random/jitterentropy-timer.c: New. + * random/jitterentropy-timer.h: New. + * random/jitterentropy-base.c: Update. + * random/jitterentropy.h: Update. + * random/jitterentropy-base-user.h: Update, keeping ours mostly. + +2021-11-15 Jussi Kivilinna + + Add intel-pclmul accelerated POLYVAL for GCM-SIV. + + commit 5e0187d84fc16d9ff0fbb0ccd4348657fea90d36 + * cipher/cipher-gcm-intel-pclmul.c (gfmul_pclmul_aggr4) + (gfmul_pclmul_aggr8): Move assembly to new GFMUL_AGGRx_ASM* macros. + (GFMUL_AGGR4_ASM_1, GFMUL_AGGR4_ASM_2, gfmul_pclmul_aggr4_le) + (GFMUL_AGGR8_ASM, gfmul_pclmul_aggr8_le) + (_gcry_polyval_intel_pclmul): New. + * cipher/cipher-gcm-siv.c (do_polyval_buf): Use polyval function + if available. + * cipher/cipher-gcm.c (_gcry_polyval_intel_pclmul): New. + (setupM): Setup 'c->u_mode.gcm.polyval_fn' with accelerated polyval + function if available. + * cipher/cipher-internal.h (gcry_cipher_handle): Add member + 'u_mode.gcm.polyval_fn'. + +2021-11-15 NIIBE Yutaka + + random: Include getentropy random module. + + commit ec671cfa239888b67fcafda40b19006b61d9bbf2 + * random/rand-internal.h (_gcry_rndgetentropy_gather_random): Add. + * random/random-csprng.c [USE_RNDLINUX] (_gcry_rngcsprng_close_fds) + (getfnc_gather_random): Support getentropy random module. + * random/random-drbg.c: Likewise. + * random/random-fips.c: Likewise. + * random/random-system.c: Likewise. + * src/global.c [USE_RNDLINUX] (print_config): Show getentropy. + + build: Support rndgetentropy random module. + + commit e562e34c824dda9ce1c4a0af58e8366699a3d88b + * configure.ac: Add getentropy random module. + * random/Makefile.am (EXTRA_librandom_la_SOURCES): Add. + + random:getentropy: Simplify more. + + commit 6de43f11c625de381e75f01ce83cbb2d2634fb35 + * random/rndgetentropy.c (_gcry_rndgetentropy_gather_random): Remove + 'if'. + + random:getentropy: Limit the size of buffer in exact size. + + commit cebe5c78a9493c7b4ee894305c0ede0899815e6a + * random/rndgetentropy.c (_gcry_rndgetentropy_gather_random): + Redundant space had no sense. + + random: Simplify rndgetentropy. + + commit a8395fd7a40f4d9a8f57154a28cd1cae97e708f2 + * random/rndgetentropy.c (_gcry_rndgetentropy_gather_random): Simply + call getentropy. + + random: Start rnd-getentropy.c. + + commit f36bfe7ec1b2cef7760aa338292fadb93783ced4 + * random/rnd-getentropy.c: Copied from rndlinux.c. + +2021-11-11 NIIBE Yutaka + + tests:pkcs1v2: Skip tests with small keys in FIPS mode. + + commit 1481607cb9db977468a75f9f4638dc1cf3ade007 + * tests/pkcs1v2.c (in_fips_mode): New. + (check_oaep): Skip when key size is less than 2048 in FIPS mode. + (check_pss, check_v15crypt, check_v15sign): Likewise. + + tests:pubkey: Replace RSA key to one of 2k. + + commit 66119e0c1a024f7cf059393c3db827eb338339b0 + * tests/pubkey.c (sample_private_key_1): Use 2k key from basic.c. + (sample_private_key_1_1): Likewise. + (sample_private_key_1_2): Likewise. + +2021-11-09 Jakub Jelen + + tests: Benchmark also larger RSA keys in FIPS mode. + + commit 2a899b5b84583f2e68bd8564034aa10846810e85 + * tests/benchmark.c (rsa_bench): Test also large RSA keys in FIPS mode + + tests: Explicit FIPS checking for symmetric algorithms. + + commit fb931073707ed521366f0e4a2e54b3935ce649a3 + * tests/basic.c (FLAG_CFB8): New. + (check_ecb_cipher): Introduce new flag and explicitly check for + algorithm functionality in regards to FIPS. + (check_ctr_cipher): Ditto. + (check_cfb_cipher): Replace the cfb8 flag with generic flag and + explicitly check for algorithm funcionality in regards to FIPS. + (check_ofb_cipher): Introduce new flag and explicitly check for + algorithm functionality in regards to FIPS. + (_check_poly1305_cipher): Explicitly check functionality in regards to + FIPS mode. + (check_ccm_cipher): Introduce new flag and explicitly check for + algorithm functionality in regards to FIPS. + (check_gost28147_cipher_basic): Explicitly check functionality in + regards to FIPS mode. + (check_stream_cipher_large_block): Explicitly check functionality in + regards to FIPS mode. + +2021-11-08 NIIBE Yutaka + + dsa: Add checks in FIPS mode. + + commit df66bd94e6e3650216b0d179d79d4c296f173855 + * cipher/dsa.c (dsa_check_keysize): New. + (generate_fips186): Add call to dsa_check_keysize. + (dsa_sign, dsa_verify): Likewise. + * tests/benchmark.c (dsa_bench): Skip 1024-bit. + * tests/dsa-rfc6979.c (check_dsa_rfc6979): 1024-bit + now fails. + * tests/fips186-dsa.c (main): Only test check_dsa_gen_186_3 in FIPS + mode. + +2021-11-08 Jakub Jelen + + tests: Add 2k RSA key working in FIPS mode. + + commit 1f45fec2082247f3634af050f1fdbf0a5858cf46 + * tests/basic.c (check_pubkey): The 1k RSA keys are no longer supposed + to be working so have a new 2k one that should work. Taken from + ciper/rsa.c's sample_secret_key. + +2021-11-08 Jakub Jelen + NIIBE Yutaka + + rsa: Check keylen constraints for key operations. + + commit 40d63d09b2d06631f4d2c3d1b167a620d50c99f8 + * cipher/rsa.c (rsa_check_keysize): New. + (generate_fips): Factor out the bits check. + (rsa_encrypt): Add checking key length. + (rsa_decrypt, rsa_sign, rsa_verify): Likewise. + +2021-11-08 NIIBE Yutaka + NIIBE Yutaka + + tests: Expect errors from algorithms not supported in FIPS mode. + + commit cc3571a1f2244bdf829d7d16dd546131711eb8a9 + * tests/basic.c (FLAG_NOFIPS): New. + (check_pubkey_sign): Pass and handle NOFIPS flag. + (check_pubkey_sign_ecdsa): Likewise. + (check_pubkey_crypt): Likewise. + (do_check_one_pubkey): Pass flags. + (check_pubkey): Mark explicitly algorithms expected not to work in + FIPS mode and make sure they fail. + +2021-11-08 NIIBE Yutaka + + tests: Fix basic.c:check_pubkey. + + commit 1b29be8e7e49a6ee04734b86db5732dc3eaca84b + * tests/basic.c (check_pubkey): Don't call check_one_pubkey_new + multiple times. + +2021-11-08 Jakub Jelen + + cipher: Respect the disabled flag of pubkey algorithms. + + commit ff5ab6a809345112f02a6037957ef21bc4bf3bce + * cipher/pubkey.c (check_pubkey_algo): Check the disabled flag before + using the algorithm. + +2021-11-05 Jakub Jelen + + doc: Reference the new FIPS 140-3. + + commit 976673425784eb2d056a4dbbe13b6d2ca5f8cbf2 + * doc/gcrypt.texi: Replace -2 with -3 + * cipher/ecc-curves.c: Replace -2 with -3 + +2021-11-01 NIIBE Yutaka + + cipher:md: Check digest algo is supported when FIPS enabled. + + commit cfd1dd6a838f70324a749dad0d589bc2dbe33651 + * cipher/md.c (_gcry_md_hash_buffer): Check for FIPS for + hash_buffers method case. + (_gcry_md_hash_buffers_extract): Likewise. + +2021-10-29 NIIBE Yutaka + + mpi: Allow opaque MPI with zero length. + + commit 34d55589b7d91a239435d77e3d45cf0deeba59b6 + * mpi/mpiutil.c (_gcry_mpi_copy): Support zero length. + +2021-10-25 Jussi Kivilinna + + tests/bench-slope: avoid divide by zero. + + commit ecd4d348ac87c073ced38eb1e6dbec03b532cdf2 + * tests/bench-slope.c (safe_div): New. + (get_slope): Make static; Skip if number of points is too small; Use + safe_div. + (do_slope_benchmark): Retry benchmark if result does not make sense; + Limit retries to 4 for non-auto-ghz and 1000 for auto-ghz. + (get_auto_ghz, do_slope_benchmark, bench_print_result_csv) + (bench_print_result_std): Use safe_div. + + md: clear context with wipememory to avoid false warning. + + commit 5881114e08601745857a68bc3318f3421155f645 + * cipher/md.c (md_open): Initialize ctx with wipememory2 instead + of memset. + + cipher/sha512: fix 'accessing 64 bytes in a region of size 8' warnings. + + commit 6333cdeee5c1ca5bd4255f9cdcd266db314a2122 + * cipher/sha512.c (SHA512_STATESHA256_CONTEXT): Replace h0-h7 with h[8]. + (do_sha512_transform_i386_ssse3, do_sha512_transform_ppc8) + (do_sha512_transform_ppc9, do_sha512_transform_s390x) + (do_sha512_final_s390x, sha512_init, sha384_init, sha512_256_init) + (sha512_224_init, do_transform_generic, sha512_final): Convert use + of h0-h7 to h[0]-h[7]. + + poly1305: fix building with 'arm-linux-gnueabihf-gcc-11 -O3' + + commit e4ce7ad0ecf6c356fa377e139d08c4dbcf6bf533 + * cipher/poly1305.c [HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS] + (ADD_1305_32): Reduce number of register operands. + +2021-10-20 NIIBE Yutaka + + cipher: Reject SHA-1 for hash+sign/verify when FIPS enabled. + + commit a23cf78102f3200dc441a3123c3fbeaa28f38b50 + * cipher/pubkey.c (_gcry_pk_sign_md): Reject SHA-1 when FIPS. + (_gcry_pk_verify_md): Likewise. + +2021-10-15 NIIBE Yutaka + + doc: Add entries for hash+sign functions. + + commit 8f31f652d453f480d4d2559dfa17e7bd42145a49 + + +2021-10-15 Jakub Jelen + + fips: Improve selftests invocation. + + commit d45db4ad16fec0fe7d32aae60f356a386fbf909b + * src/fips.c (run_digest_selftests): Skip SHA256 selftest if they were + already executed as part of the integrity check. + (run_mac_selftests): Skip HMAC-SHA256 selftest if they were already + executed as part of the integrity check. + (run_hmac_sha256_selftests): Run SHA256 selftest too. + (_gcry_fips_run_selftests): Run the sha256 selftests regardless of the + fips mode status. + +2021-10-14 Jakub Jelen + + fips: Verify library integrity before running selftests. + + commit d2c68849d19bd0ed4c8c3c040c5939737aa15981 + * src/fips.c (run_hmac_sha256_selftests): New function. + (_gcry_fips_run_selftests): Move integrity check earlier and run + HMAC-SHA256 tests before that. + + cipher: Allow generation of RSA keys > 2k. + + commit bba63fab1a22232e494d3de93d74280d300faf8d + * cipher/rsa.c (generate_fips): Allow any larger key than 2k in FIPS + mode. + +2021-10-12 NIIBE Yutaka + + build: Support specifying HMAC key by --enable-hmac-binary-check. + + commit 10e02b90f65f3a85d72a719806b9d8873377c1a4 + * configure.ac (DEF_HMAC_BINARY_CHECK): New SUBSTITUTION. + (DL_LIBS): Fix the condition. + * src/Makefile.am (libgcrypt_la_CFLAGS): Use DEF_HMAC_BINARY_CHECK. + (hmac256_CFLAGS): Likewise. + +2021-10-11 NIIBE Yutaka + + build: Use KEY_FOR_BINARY_CHECK for --enable-hmac-binary-check. + + commit 0709359657633271c8c018d67b40d9052c630022 + * src/fips.c (KEY_FOR_BINARY_CHECK): Allow supplying externally. + * src/hmac256.c: Use KEY_FOR_BINARY_CHECK macro. + +2021-10-08 Jussi Kivilinna + + cipher/sha256: fix 'accessing 32 bytes in a region of size 4' warnings. + + commit 95425c6b0b96a4d2eae4e2a55a23d293b08f7993 + * cipher/sha256.c (SHA256_CONTEXT): Replace h0-h7 with h[8]. + (do_sha256_transform_amd64_ssse3, do_sha256_transform_amd64_avx) + (do_sha256_transform_amd64_avx2, do_sha256_transform_intel_shaext) + (do_sha256_transform_armv8_ce, do_sha256_transform_ppc8) + (do_sha256_transform_ppc9, do_sha256_transform_s390x) + (do_sha256_final_s390x, sha256_init, sha224_init) + (do_transform_generic, sha256_final): Convert use of h0-h7 to h[0]-h[7]. + +2021-10-07 NIIBE Yutaka + + cipher: Add sign+hash, verify+hash, and random-override API. + + commit 082ea0efa9b129e8ca7703eeb6b1c9325caeedfd + * cipher/pubkey.c (_gcry_pk_sign_md, _gcry_pk_verify_md): New. + (_gcry_pk_random_override_new): New. + (_gcry_pk_get_random_override): New. + * src/gcrypt-int.h: Add those routines. + * src/context.h (CONTEXT_TYPE_RANDOM_OVERRIDE): New. + * src/context.c (_gcry_ctx_alloc, _gcry_ctx_release): Handle + CONTEXT_TYPE_RANDOM_OVERRIDE. + * src/gcrypt.h.in (gcry_error_t gcry_pk_hash_sign): New. + (gcry_error_t gcry_pk_hash_verify): New. + (gcry_pk_random_override_new): New. + * src/libgcrypt.def, src/libgcrypt.vers: Update. + * src/visibility.c (gcry_pk_hash_sign, gcry_pk_hash_verify): New. + (gcry_pk_random_override_new): New. + * src/visibility.h: Add those routines. + + cipher:dsa,ecdsa: Support supplying K externally. + + commit 16a9eaad5d1add3a95b1da6e037b074f18b094c7 + * cipher/dsa.c (sign): Add an argument K for DSA. + (test_keys, dsa_sign): Follow the change. + * cipher/ecc-common.h (_gcry_ecc_ecdsa_sign): Likewise for ECDSA. + * cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_sign): Likewise for ECDSA. + * cipher/ecc.c (test_keys, ecc_sign): Follow the change. + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): Support "label" + for K. + +2021-10-06 Jussi Kivilinna + + Fix building for Win64 target. + + commit 9fc0d145278d46bb129660a57b7ca2f94577d461 + * random/random-csprng.c [HAVE_W32_SYSTEM]: Include . + * tests/bench-slope.c [_WIN32]: Include . + +2021-10-05 NIIBE Yutaka + + build,gcrypt.h: Don't define gcry_socklen_t. + + commit 71d4d592d8910ea6f9e091ae578cf68907cb5758 + * configure.ac (FALLBACK_SOCKLEN_T): Remove. + * src/gcrypt.h.in: Remove FALLBACK_SOCKLEN_T. + + build,gcrypt.h: Remove INSERT_SYS_SELECT_H. + + commit 0f43570af93e56bdd4a4b2bf6eef722d0bff4a4f + * configure.ac (INSERT_SYS_SELECT_H): Remove. + Remove checking sys/select.h. + * src/gcrypt.h.in: Remove INSERT_SYS_SELECT_H. + +2021-10-05 NIIBE Yutaka + Tom=C3=A1=C5=A1 Mr=C3=A1z + + random: Use poll instead of select. + + commit 7da42a8e8cc587ced46dffefc8448c8a286b1ca0 + * random/rndlinux.c (open_device): Use poll. + (_gcry_rndlinux_gather_random): Use poll. + +2021-09-27 Werner Koch + + tests: Remove old CAVS test scripts. + + commit db928d97b4b69f9aa1fee3c2a38a138534608c89 + * tests/cavs_driver.pl: Remove. + * tests/cavs_tests.sh: Remove + * tests/Makefile.am: (EXTRA_DIST): Remove them. + +2021-09-27 NIIBE Yutaka + + libtool: Link without -flat_namespace for macOS. + + commit c9cebf3d1824d6ec90fd864a744bb81c97ac7d31 + * m4/libtool.m4: Not setting 10.0 to MACOSX_DEPLOYMENT_TARGET when not + defined. Only specify -flat_namespace to linker for specific + (older) versions and hosts. + +2021-09-24 NIIBE Yutaka + + build: Add hmac256.h to distribution. + + commit 9511f469363b629a06e1f3dab6ee4ba333e72b93 + * src/Makefile.am (hmac256_SOURCES): Add hmac256.h. + +2021-09-20 Jakub Jelen + + Allow passing FIPS module version. + + commit c74fde0c3f6114c594332fb28a09c7b817969231 + * README: Document new --with-fips-module-version=3Dversion switch + * configure.ac: Implementation of the --with-fips-module-version + * src/global.c (print_config): Print FIPS module version from above + + Remove the forced fips mode. + + commit 3f4dd47ba74e0a9f18feba1809eeddff8790707e + * cipher/rsa.c (generate_fips): Drop reference to enforced fips mode and + use normal FIPS mode check + * doc/gcrypt.texi: Drop references to enforced FIPS mode + * src/fips.c (enforced_fips_mode): Removed + (_gcry_initialize_fips_mode): Remove reading of the FIPS_FORCE_FILE + to enforce FIPS mode + (_gcry_enforced_fips_mode): Remove + (_gcry_set_enforced_fips_mode): Remove + * src/g10lib.h (_gcry_enforced_fips_mode): Remove declaration + (_gcry_set_enforced_fips_mode): Remova declaration + * src/global.c (print_config): Remove the forced fips flag + (_gcry_vcontrol): Deprecate GCRYCTL_SET_ENFORCED_FIPS_FLAG + (get_no_secure_memory): Ignore the option in FIPS mode + + Remove a way to inactive FIPS mode. + + commit edbc1dd10bc3e1fcc0e355fe1a9c4c8769f51daf + * cipher/md.c (_gcry_md_hash_buffer): Remove inactivation of FIPS mode + when MD5 is used + (_gcry_md_hash_buffers_extract): Ditto. + * src/fips.c (gcry_is_fips_mode_inactive): Removed + (_gcry_inactivate_fips_mode): Removed + (_gcry_is_fips_mode_inactive): Removed + * src/g10lib.h (_gcry_inactivate_fips_mode): Remove declaration + (_gcry_is_fips_mode_inactive): Remove declaration + * global.c (_gcry_vcontrol): Update the GCRYCTL_FIPS_MODE_P + (_gcry_set_allocation_handler): Silently ignore custom alocation + handlers in FIPS mode + +2021-09-16 Jakub Jelen + + tests: Improve FIPS detection in curves test. + + commit fd116968ef2dcecb4058be2b2b3e8ab90f1e3181 + * tests/curves.c (check_matching): When FIPS mode enabled, skip a test + with sample_key_2, which uses brainpoolP160r1 curve. + (check_get_params): Replace "error_expected" filed to "flags" to hold + TEST_ERROR_EXPECTED and/or TEST_NOFIPS. Put TEST_NOFIPS flags for + non-FIPS curves. When FIPS mode enabled, don't skip supported curves. + + tests: Fix typo in comment. + + commit f9ae351c954c01a382c8ac915298efa25fc45177 + * tests/curves.c: Typo in comment + +2021-09-14 NIIBE Yutaka + + cipher: Fix support of sha512-224 and sha512-256. + + commit d04b1be9edacd7be6f03faba6f4d6c44c4247eb7 + * cipher/pubkey-util.c (get_hash_algo): Add. + + * cipher/sha512.c (sha512_256_asn, sha512_224_asn): Fill correct values. + + cipher: Support internal hashing with "prehash" for RSA PKCS#1. + + commit 422031a5943f2e698036e3c0df5955c585f22c16 + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): Support internal + hashing. + +2021-09-13 Werner Koch + + cipher: Clear AESWRAP scratch area immediately after use. + + commit df4fe02794bb3511f7006d641e99736bad091c58 + * cipher/cipher-aeswrap.c (_gcry_cipher_aeswrap_decrypt): Call + wipememory. + +2021-08-26 Jussi Kivilinna + + Add ARMv8-CE HW acceleration for GCM-SIV counter mode. + + commit 47e425e07995454573e28c13c08229d2f8a75642 + * cipher/rijndael-armv8-aarch32-ce.S + (_gcry_aes_ctr32le_enc_armv8_ce): New. + * cipher/rijndael-armv8-aarch64-ce.S + (_gcry_aes_ctr32le_enc_armv8_ce): New. + * cipher/rijndael-armv8-ce.c + (_gcry_aes_ctr32le_enc_armv8_ce) + (_gcry_aes_armv8_ce_ctr32le_enc): New. + * cipher/rijndael.c + (_gcry_aes_armv8_ce_ctr32le_enc): New prototype. + (do_setkey): Add setup of 'bulk_ops->ctr32le_enc' for ARMv8-CE. + + Add x86 HW acceleration for GCM-SIV counter mode. + + commit 33aebb30d210768d510a2843d9cc0c0ecd4237d1 + * cipher/cipher-gcm-siv.c (do_ctr_le32): Use bulk function if + available. + * cipher/cipher-internal.h (cipher_bulk_ops): Add 'ctr32le_enc'. + * cipher/rijndael-aesni.c (_gcry_aes_aesni_ctr32le_enc): New. + * cipher/rijndael-vaes-avx2-amd64.S + (_gcry_vaes_avx2_ctr32le_enc_amd64, .Lle_addd_*): New. + * cipher/rijndael-vaes.c (_gcry_vaes_avx2_ctr32le_enc_amd64) + (_gcry_aes_vaes_ctr32le_enc): New. + * cipher/rijndael.c (_gcry_aes_aesni_ctr32le_enc) + (_gcry_aes_vaes_ctr32le_enc): New prototypes. + (do_setkey): Add setup of 'bulk_ops->ctr32le_enc' for AES-NI and + VAES. + * tests/basic.c (check_gcm_siv_cipher): Add large test-vector for + bulk ops testing. + + Add AES-GCM-SIV mode (RFC 8452) + + commit 1b8994c4ecf2cb53fff46fa84a95a7c259e7cec7 + * cipher/Makefile.am: Add 'cipher-gcm-siv.c'. + * cipher/cipher-gcm-siv.c: New. + * cipher/cipher-gcm.c (_gcry_cipher_gcm_setupM): New. + * cipher/cipher-internal.h (gcry_cipher_handle): Add 'siv_keylen'. + (_gcry_cipher_gcm_setupM, _gcry_cipher_gcm_siv_encrypt) + (_gcry_cipher_gcm_siv_decrypt, _gcry_cipher_gcm_siv_set_nonce) + (_gcry_cipher_gcm_siv_authenticate) + (_gcry_cipher_gcm_siv_set_decryption_tag) + (_gcry_cipher_gcm_siv_get_tag, _gcry_cipher_gcm_siv_check_tag) + (_gcry_cipher_gcm_siv_setkey): New prototypes. + (cipher_block_bswap): New helper function. + * cipher/cipher.c (_gcry_cipher_open_internal): Add + 'GCRY_CIPHER_MODE_GCM_SIV'; Refactor mode requirement checks for + better size optimization (check pointers & blocksize in same order + for all). + (cipher_setkey, cipher_reset, _gcry_cipher_setup_mode_ops) + (_gcry_cipher_setup_mode_ops, _gcry_cipher_info): Add GCM-SIV. + (_gcry_cipher_ctl): Handle 'set decryption tag' for GCM-SIV. + * doc/gcrypt.texi: Add GCM-SIV. + * src/gcrypt.h.in (GCRY_CIPHER_MODE_GCM_SIV): New. + (GCRY_SIV_BLOCK_LEN, gcry_cipher_set_decryption_tag): Add to comment + that these are also for GCM-SIV in addition to SIV mode. + * tests/basic.c (check_gcm_siv_cipher): New. + (check_cipher_modes): Check for GCM-SIV. + * tests/bench-slope.c (bench_gcm_siv_encrypt_do_bench) + (bench_gcm_siv_decrypt_do_bench, bench_gcm_siv_authenticate_do_bench) + (gcm_siv_encrypt_ops, gcm_siv_decrypt_ops) + (gcm_siv_authenticate_ops): New. + (cipher_modes): Add GCM-SIV. + (cipher_bench_one): Check key length requirement for GCM-SIV. + + Add SIV mode (RFC 5297) + + commit 659a208cb065d686f60e2c4f51856f460d6b44f5 + * cipher/Makefile.am: Add 'cipher-siv.c'. + * cipher/cipher-ctr.c (_gcry_cipher_ctr_encrypt): Rename to + _gcry_cipher_ctr_encrypt_ctx and add algo context parameter. + (_gcry_cipher_ctr_encrypt): New using _gcry_cipher_ctr_encrypt_ctx. + * cipher/cipher-internal.h (gcry_cipher_handle): Add 'u_mode.siv'. + (_gcry_cipher_ctr_encrypt_ctx, _gcry_cipher_siv_encrypt) + (_gcry_cipher_siv_decrypt, _gcry_cipher_siv_set_nonce) + (_gcry_cipher_siv_authenticate, _gcry_cipher_siv_set_decryption_tag) + (_gcry_cipher_siv_get_tag, _gcry_cipher_siv_check_tag) + (_gcry_cipher_siv_setkey): New. + * cipher/cipher-siv.c: New. + * cipher/cipher.c (_gcry_cipher_open_internal, cipher_setkey) + (cipher_reset, _gcry_cipher_setup_mode_ops, _gcry_cipher_info): Add + GCRY_CIPHER_MODE_SIV handling. + (_gcry_cipher_ctl): Add GCRYCTL_SET_DECRYPTION_TAG handling. + * doc/gcrypt.texi: Add documentation for SIV mode. + * src/gcrypt.h.in (GCRYCTL_SET_DECRYPTION_TAG): New. + (GCRY_CIPHER_MODE_SIV): New. + (gcry_cipher_set_decryption_tag): New. + * tests/basic.c (check_siv_cipher): New. + (check_cipher_modes): Add call for 'check_siv_cipher'. + * tests/bench-slope.c (bench_encrypt_init): Use double size key for + SIV mode. + (bench_aead_encrypt_do_bench, bench_aead_decrypt_do_bench) + (bench_aead_authenticate_do_bench): Reset cipher context on each run. + (bench_aead_authenticate_do_bench): Support nonce-less operation. + (bench_siv_encrypt_do_bench, bench_siv_decrypt_do_bench) + (bench_siv_authenticate_do_bench, siv_encrypt_ops) + (siv_decrypt_ops, siv_authenticate_ops): New. + (cipher_modes): Add SIV mode benchmarks. + (cipher_bench_one): Restrict SIV mode testing to 16 byte block-size. + + mpi/longlong: fix variable shadowing from MIPS umul_ppmm macros. + + commit 9e3b0446653fda6912e91fae84883cdbefdc2195 + * mpi/longlong.h [__mips__ && W_TIPE_SIZE =3D=3D 32] (umul_ppmm): Rename + temporary variable '_r' to '__r'. + [__mips && W_TIPE_SIZE =3D=3D 64] (umul_ppmm): Ditto. + +2021-08-23 NIIBE Yutaka + + cipher: Use offsetof for allocation of gcry_md_context. + + commit 581e04386d875672ba6c3fc4a4232ca72bc46c8c + * cipher/md.c (md_open): Allocate exact space for the allocation and + use offsetof for the calculation. + +2021-08-19 NIIBE Yutaka + + hmac: Don't have the second implementation of hmac256. + + commit c9acca865ba4abaa4443712f87fb8926fe7ad8b7 + * src/Makefile.am (libgcrypt_la_SOURCES): Remove hmac256. + * cipher/mac-hmac.c (selftests_sha256): Remove the tests. + + fips: Don't use gcry_check_version for integrity check any more. + + commit c11788e5641be26371adc90f63e5a191cfc796f8 + * src/visibility.h [FIPS_FORCE_FILE]: Remove ifdef/endif. + + fips: Use a .rodata1 section integrity check with hmac256. + + commit f02dc5235e4751c57b16683ee9a8ef53014c6d13 + * src/fips.c (hmac256_check): New. + (check_binary_integrity): Use hmac256_check. + + build: Generate hash for integrity check with hmac256 (2). + + commit 24aaded244a2b9427f2e90e4bf7adf086e0e0fef + * src/Makefile.am (libgcrypt.la.done): Use the rodata1 section. + * src/fips.c (_gcry_fips_run_selftests): Only enable + check_binary_integrity by ENABLE_HMAC_BINARY_CHECK. + [ENABLE_HMAC_BINARY_CHECK] (hmac_for_the_implementation): New. + [ENABLE_HMAC_BINARY_CHECK] (check_binary_integrity): Use + hmac_for_the_implementation in rodata. + +2021-08-18 NIIBE Yutaka + + build: Generate hash for integrity check with hmac256. + + commit 3c89aad4a0d7f836fd747d4e2f0edfbf648ae318 + * configure.ac [ENABLE_HMAC_BINARY_CHECK]: Check objcopy. + (USE_HMAC_BINARY_CHECK): New Automake conditional. + + * src/Makefile.am (libgcrypt.la.done): New target. + [USE_HMAC_BINARY_CHECK] (libgcrypt.so.hmac): Compute the hash. + [USE_HMAC_BINARY_CHECK] (libgcrypt.la.done): Add .hmac section. + + hmac: Fix hmac256 command option handling. + + commit 07c21dd7d134e6403c9ee4e09250ec577c9b2867 + * src/hmac256.c (main): Fix use of --stdkey. + + cipher: Fix the order of fields of gcry_md_context. + + commit cbbdc015bf522d4aff656ff0417b83144ab4bb2a + * cipher/md.c (struct gcry_md_context): Fix for better memory usage. + +2021-08-17 Jakub Jelen + + tests: Generating large-enough DSA keys works in FIPS mode. + + commit 6e40fca726357f13790065a27e2a0b333129fc54 + The a93d678f previously added this condition, but the DSA key size + changed since then to 2k, which is still allowed. + + * tests/pubkey.c (get_dsa_key_with_domain_new): DSA keys still work in + FIPS mode. + + dsa: Drop dead code. + + commit 564e51fde71116757cdb6bc813aacf481bb826ed + * cipher/dsa.c (generate): This function is never called in FIPS mode + + rsa: Do not allow 1024 RSA keys in FIPS mode. + + commit 034055ffdca28602a40c4d0b5997173e8597af18 + Previously, the condition was in generate_std, which is never called in + FIPS mode. + + * cipher/rsa.c (generate_std): Remove dead code as FIPS is using + 'generate_fips' + (generate_fips): Do not allow 1024 bit key generation + + tests: Avoid confusing 'success' on error message. + + commit 588b8bb6ef091db299ff2eade295d3119b62283a + * tests/pubkey.c (get_dsa_key_with_domain_new): Remove bogus "success" + on error. + +2021-08-17 NIIBE Yutaka + + fips: Fix tests in fips mode and non-fips mode. + + commit 2ae56abd0eb60d755509d82155f52263bf2e37e8 + * tests/t-secmem.c (test_secmem): Only tweak when FIPS enabled. + +2021-08-16 NIIBE Yutaka + + tests: Skip tests when FIPS for keygrip computations. + + commit 44c7c41af21c668826280abfee1257853020ba2d + * tests/keygrip.c (check): Skip non-FIPS curves when FIPS. + (main): Check if FIPS is enabled. + + cipher: Raise an error for non-approved digests correctly. + + commit acc1598ea891180660d1a531823a1b5385e7f4e6 + * cipher/md.c (md_enable): Remove check if it's enforced or not. + + fips: Fix tests in fips mode. + + commit 347817438990b7adf22dc71e4fb581e3232f03a7 + * src/global.c (_gcry_vcontrol): Don't check NO_SECURE_MEMORY for + GCRYCTL_FIPS_MODE_P. + * tests/t-secmem.c (test_secmem): Use smaller value. + +2021-08-10 Jussi Kivilinna + + tests/bench-slope: allow non-FIPS ECC benchmarking in non-FIPS mode. + + commit a5982e35088a382b49c0e95e9a87365202267601 + * tests/bench-slope.c (_ecc_bench): Check for 'in_fips_mode'. + +2021-08-06 NIIBE Yutaka + + fips: Fix check_binary_integrity. + + commit ca6797c5c5c61a0eae1f5aa82988d4870fe5edab + * src/fips.c: Define FIPS_FORCE_FILE macro earlier. + (check_binary_integrity): Use the address of gcry_check_version. + * src/visibility.h [FIPS_FORCE_FILE] (gcry_check_version): Allow + internal use of exported function. + +2021-08-05 NIIBE Yutaka + + build: Update checking headers. + + commit 538090d829483696de6342f2ea564b2e25d6a294 + * configure.ac (AC_CHECK_HEADERS): Remove sys/msg.h. + +2021-08-03 NIIBE Yutaka + + tests: Fix values for DSA with larger key length. + + commit 8bf9ade071b80c1141d4a76d1b51b9a235b8b340 + * tests/pubkey.c (get_dsa_key_with_domain_new): Update. + + fips: Support LIBGCRYPT_FORCE_FIPS_MODE envvar. + + commit 7ac72ebaf7f723203c5fe9befa249e9bcc78ee92 + * src/fips.c (_gcry_initialize_fips_mode): Check the + environment variable LIBGCRYPT_FORCE_FIPS_MODE. + +2021-07-29 Jakub Jelen + + tests: Verify unsupported KDF tests fail in FIPS mode. + + commit 0ab4e8063729147fb9abd463055785aac831bf5c + * tests/t-kdf.c (check_pbkdf2): Verify tests based on algorithms + unsupported in FIPS mode fail. + + cipher: Do not use of non-approved digests in FIPS mode. + + commit 0f118c2dfb8e1236893c30a9b86e7e231c8e5758 + * cipher/md.c (md_enable): Block all non-approved digest algorithms, not + only the MD5 and do not drop from FIPS mode if not enforced. + + tests: Generating DSA from domain should fail in FIPS mode. + + commit a93d678fa5a349600fabdce3fbe5919837cdc282 + * tests/pubkey.c (get_dsa_key_with_domain_new): Expect failure in FIPS + mode + (check_x931_derived_key): Simplify testing for FIPS mode. + (main): Check for fips mode. + + tests: Transient DSA keys work in FIPS mode. + + commit 83893f3f77da986951be98306a82238c97522bc1 + * tests/pubkey.c (check_run): Enable tests with DSA transient keys which + work in FIPS. + + tests: Skip secmem overflow test in FIPS mode. + + commit 6df523bfb095bf4c3d9dc6a0699fefcdfc6cd594 + * tests/t-secmem.c (main): Skip overflow tests in FIPS mode because they + are fatal and there is no way to override the outofcore handler. + + tests: Expect the 192b ECDSA tests to fail in fips mode. + + commit d2a26b30b5dbfa7b26a606e5b2fe5c238ab1afa1 + * tests/dsa-rfc6979.c (check_dsa_rfc6979): Expect ECDSA 192b keys to + fail in FIPS mode. + (main): Detect FIPS mode. + + tests: Expect curves 25519/448 to fail in FIPS mode. + + commit 3026148331523ec7ca81031339b5629431cafa23 + * tests/t-cv25519.c (test_cv_hl): Expect the operation to fail in FIPS + mode. + (test_cv_x25519, test_it): Ditto. + (main) Detect FIPS mode. + * tests/t-ed25519.c (one_test): Expect the operation to fail in FIPS + mode. + (main) Detect FIPS mode. + * tests/t-ed448.c (one_test): Expect the operation to fail in FIPS + mode. + (main) Detect FIPS mode. + * tests/t-x448.c (test_cv_hl): Expect the operation to fail in FIPS + mode. + (test_cv_x448, test_cv): Ditto. + (main) Detect FIPS mode. + + tests: Skip unsupported mechanisms in FIPS mode. + + commit 55dbac435c5ba31ef140f72ce997662e5f9fe55b + * tests/bench-slope.c (cipher_bench_one): Skip GCM mode in FIPS mode + (ecc_algo_fips_allowed): New function + (_ecc_bench): Skip algorithms disabled in FIPS mode + (main): Check for FIPS mode + * tests/benchmark.c (cipher_bench): Skip GCM in FIPS mode + + tests: Do not expect GCM work in FIPS. + + commit f56a33df60dcce78c2b1aa5aeeee64549a26a0ce + * tests/basic.c (check_one_cipher_core): Expect GCM ciphers to fail in + FIPS mode + (check_cipher_modes): Skip GCM ciphers tests as they fail quite late + in gcry_cipher_gettag(). + + mac: Disable AES GMAC in FIPS mode. + + commit aa1e9ebf8bdbe6ed27c8667dbe4e1a69713210a5 + * cipher/mac-gmac.c (_gcry_mac_type_spec_gmac_aes): Remove FIPS flag + +2021-07-29 NIIBE Yutaka + + hwfeatures: Enable hardware support also in FIPS mode. + + commit 70e6cec07d86332f1aaf7a69bec75c7138306f6a + * src/hwfeatures.c (_gcry_detect_hw_features): Remove skipping in FIPS + mode. + + cipher: Support internal hashing for DSA and ECDSA signing. + + commit 4a3e71403225bd60a96d6747a8141a268bedda78 + * cipher/dsa-common.c (_gcry_dsa_compute_hash): New. + * cipher/pubkey-internal.h (_gcry_dsa_compute_hash): New. + * cipher/dsa.c (verify): Add FLAGS and HASHALGO. + (test_keys): Follow the change of verify API. + (sign, verify): Support PUBKEY_FLAG_PREHASH flag to hash internally. + (selftest_sign): Test with "prehash" flag. + * cipher/ecc-common.h (_gcry_ecc_ecdsa_verify): Add FLAGS and + HASHALGO. + * cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_sign): Support + PUBKEY_FLAG_PREHASH flag to hash internally. + (_gcry_ecc_ecdsa_verify): Likewise. + * cipher/ecc.c (test_keys): Follow the change of + _gcry_ecc_ecdsa_verify API. + (selftest_sign): Test with "prehash" flag. + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): Support handling + of "hash-algo" and "value" with "prehash" flag. + +2021-07-23 NIIBE Yutaka + + cipher: Support internal hashing for RSA-PSS. + + commit 877be1bf9df0b4e9aed9036db1592a64582a4bac + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): Support + "hash-algo" with "value" for internal hashing with RSA-PSS. + * tests/basic.c (check_pubkey_sign): Add test cases. + + cipher: Extend RSA-PSS internal function for verify, too. + + commit 285b4cb70df1553c60fb5da6c94e1106694d4f9e + * cipher/pubkey-internal.h (_gcry_rsa_pss_verify): Support internal + hashing. + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): Use opaque MPI for + RSA-PSS. + * cipher/rsa-common.c (_gcry_rsa_pss_verify): Support internal + hashing. + * cipher/rsa.c (rsa_verify): Allow opaque MPI for RSA-PSS. + + cipher: Extend RSA-PSS internal function. + + commit 51307b1ceaa752d5a737b06ab0217d310faea403 + * cipher/pubkey-internal.h (_gcry_rsa_pss_encode): Change the API. + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): Follow the change. + * cipher/rsa-common.c (_gcry_rsa_pss_encode): Support internal hashing. + + cipher: Check by caller instead, not by callee for RSA-PSS. + + commit 652e115e10f2bd53d1e1fbe161c2528f4ca89012 + * cipher/pubkey-internal.h (_gcry_rsa_pss_encode): Change the API. + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): Before the call to + _gcry_rsa_pss_encode, check the condition here, raise GPG_ERR_INV_ARG + if it's not good. + * cipher/rsa-common.c (_gcry_rsa_pss_encode): No check inside. + +2021-07-15 NIIBE Yutaka + + hmac: Use xfree. + + commit db9f7abb7af7b5c5bc2ec356c614a5cdb88d75a6 + * src/hmac256.c [STANDALONE] (xfree): Define. + (_gcry_hmac256_new, _gcry_hmac256_release): Use xfree. + (_gcry_hmac256_file): Likewise. + +2021-07-07 Jussi Kivilinna + + tests/basic: use SHA256 instead of RMD160 for SHAKE extract testing. + + commit b98ca3f798abd17696f52163665204c4e83d9092 + * tests/basic.c (check_one_md): Use GCRY_MD_SHA256 as 'crcalgo' for + SHAKE128/SHAKE256 testing. + +2021-07-07 NIIBE Yutaka + + tests: Fix tests/basic.c for FIPS mode. + + commit ccb076e8aabb9c49e7026258b3a36a8422f6bbe4 + * tests/basic.c (main): Use bare gcry_control for + GCRYCTL_FORCE_FIPS_MODE. + + tests: Skip unavailable ciphers in FIPS mode. + + commit 61c87070abc4baeb9d847db015e6a3031f349483 + * tests/basic.c (_check_poly1305_cipher): + (check_ocb_cipher_largebuf_split): Skip unavailable ciphers when + IN_FIPS_MODE. + (check_ocb_cipher_checksum, check_gost28147_cipher_basic): Likewise. + +2021-07-07 NIIBE Yutaka + Jakub Jelen + + tests: Fix messages to STDERR when FIPS mode is enabled. + + commit 297d31294333f39201ae6f387108300b311bedd1 + * tests/basic.c (check_digests): Emit message when IN_FIPS_MODE. + (check_hmac, check_mac): Likewise. + +2021-07-05 Jussi Kivilinna + + rinjdael-s390x: fix UBSAN warning on using index beyond end of array. + + commit 4b76fa6a1f924a56d2a8c323a9c2d95de763d0dc + * cipher/rijndael-s390x.c (aes_s390x_ocb_get_l): New. + (aes_s390x_ocb_enc, aes_s390x_ocb_dec, aes_s390x_ocb_auth): Use + 'aes_s390x_ocb_get_l'. + +2021-07-02 Jussi Kivilinna + + ec: add zSeries/s390x accelerated scalar multiplication. + + commit 69fdcb5433236c4fc5d24c1dcc269424a088086c + * cipher/asm-inline-s390x.h (PCC_FUNCTION_*): New. + (pcc_query, pcc_scalar_multiply): New. + * mpi/Makefile.am: Add 'ec-hw-s390x.c'. + * mpi/ec-hw-s390x.c: New. + * mpi/ec-internal.h (_gcry_s390x_ec_hw_mul_point) + (mpi_ec_hw_mul_point): New. + * mpi/ec.c (_gcry_mpi_ec_mul_point): Call 'mpi_ec_hw_mul_point'. + * src/g10lib.h (HWF_S390X_MSA_9): New. + * src/hwf-s390x.c (s390x_features): Add MSA9. + * src/hwfeatures.c (hwflist): Add 's390x-msa-9'. + + tests/t-mpi-point: add one more NIST P-256 reduction test-vector. + + commit 3f4a59299134c6804c5d29fb3f275ea0e04ac8ac + * tests/t-mpi-point.c (check_ec_mul_reduction): Add second NIST P-256 + test vector from T5510. + +2021-07-01 Jussi Kivilinna + + bench-slope: add X25519 and X448 scalar multiplication. + + commit 9911069388e762d2a85bc2a11ca6cfcc4c895e4f + * tests/bench-slope.c (ECC_ALGO_X25519, ECC_ALGO_X448): New. + (ecc_algo_name, ecc_algo_curve, ecc_nbits): Add X25519 and X448. + (bench_ecc_mult_do_bench): Pass Y as NULL to ec_get_affine with + X25519 and X448. + (cipher_ecc_one): Run only multiplication bench for X25519 and X448. + + mpi: optimizations for MPI scanning and printing. + + commit 2fcac487069f9e40ff30366546624a8aff355b55 + * mpi/mpicoder.c (mpi_read_from_buffer): Add word-size buffer + reading loop using 'buf_get_be(32|64)'. + (mpi_fromstr): Use look-up tables for HEX conversion; Add fast-path + loop for converting 8 hex-characters at once; Add string length + parameter. + (do_get_buffer): Use 'buf_put_be(32|64)' instead of byte writes; Add + fast-path for reversing buffer with 'buf_get_(be64|be32|le64|le32)'. + (_gcry_mpi_set_buffer): Use 'buf_get_be(32|64)' instead of byte reads. + (twocompl): Use _gcry_ctz instead of open-coded if-clauses to get + first bit set; Add fast-path for inverting buffer with + 'buf_get_(he64|he32)'. + (_gcry_mpi_scan): Use 'buf_get_be32' where possible; Provide string + length to 'mpi_fromstr'. + (_gcry_mpi_print): Use 'buf_put_be32' where possible; Use look-up + table for HEX conversion; Add fast-path loop for converting to + 8 hex-characters at once. + * tests/t-convert.c (check_formats): Add new tests for larger values. + + mpi/ec: cache converted field_table MPIs. + + commit ef676b9c14da1c45db8f8538b740a8bbf603652d + * mpi/ec.c (field_table_mpis): New. + (ec_p_init): Cache converted field table MPIs. + + mpi_ec_get_affine: fast path for Z=3D=3D1 case. + + commit 38d80fdfddd027fe87bf5508e453d3e2cdbaa337 + * mpi/ec.c (_gcry_mpi_ec_get_affine): Return X and Y as is + if Z is 1 (for Weierstrass and Edwards curves). + + tests/t-mpi-point: add reduction test-vectors for secp256k1. + + commit 1652377763892213fa2cd53aa64884934b2c900f + * tests/t-mpi-point.c (check_ec_mul_reduction): Add secp256k1 test + vectors. + +2021-06-30 Jussi Kivilinna + + ec-nist: fix 'mod p' carry adjustment and output masking. + + commit fc92c609dfdbcf59a09ca3aaf53a1c1b8408c351 + * mpi/ec-inline.h (MASK_AND64, LIMB_OR64): New. + [__x86_64__]: Use "rme" operand type instead of "g" to fix use + of large 32-bit constants. + * mpi/ec-nist.c (_gcry_mpi_ec_nist192_mod, _gcry_mpi_ec_nist224_mod) + (_gcry_mpi_ec_nist256_mod, _gcry_mpi_ec_nist384_mod): At end, + check if 's[]' is negative instead result of last addition, for + output masks; Use 'p_mult' table entry for P instead of 'ctx->p'. + (_gcry_mpi_ec_nist256_mod): Handle corner case were 2*P needs to be + added after carry based subtraction. + * tests/t-mpi-point.c (check_ec_mul_reduction): New. + (main): Call 'check_ec_mul_reduction'. + +2021-06-19 Jussi Kivilinna + + mpi/ec: add fast reduction for secp256k1. + + commit 6dfab8cfb94ccb485a15b13df3c499cbb06fddf2 + * mpi/ec.c (ec_secp256k1_mod): New. + (field_table): Add 'secp256k1'. + * tests/t-mpi-point.c (check_ec_mul): Add secp256k1 test vectors. + + mpi/ec: add fast reduction functions for NIST curves. + + commit 9d909cb67e70fd792926ac1e2ab305b2cc96bc27 + * configure.ac (ASM_DISABLED): New. + * mpi/Makefile.am: Add 'ec-nist.c' and 'ec-inline.h'. + * mpi/ec-nist.c: New. + * mpi/ec-inline.h: New. + * mpi/ec-internal.h (_gcry_mpi_ec_nist192_mod) + (_gcry_mpi_ec_nist224_mod, _gcry_mpi_ec_nist256_mod) + (_gcry_mpi_ec_nist384_mod, _gcry_mpi_ec_nist521_mod): New. + * mpi/ec.c (ec_addm, ec_subm, ec_mulm, ec_mul2): Use + 'ctx->mod'. + (field_table): Add 'mod' function; Add NIST reduction + functions. + (ec_p_init): Setup ctx->mod; Setup function pointers + from field_table only if pointer is not NULL; Resize + ctx->a and ctx->b only if set. + * mpi/mpi-internal.h (RESIZE_AND_CLEAR_IF_NEEDED): New. + * mpi/mpiutil.c (_gcry_mpi_resize): Clear all unused + limbs also in realloc case. + * src/ec-context.h (mpi_ec_ctx_s): Add 'mod' function. + + mpi/ec: small optimization for ec_mulm_448. + + commit ccfa9f2c1427b40483984198c3df41f8057f69f8 + * mpi/ec.c (ec_addm_448, ec_subm_448): Change order of sub_n and + set_cond to remove need to clear 'n'. + (ec_mulm_448): Use memcpy where possible; Use mpih_rshift where + possible; Use mpih_lshift for doubling a3; Remove one addition + at end. + + mpi/ec: small optimization for ec_mulm_25519. + + commit 9c12226c31d4fed4942c049724591a82c4428408 + * mpi/ec.c (ec_addm_25519): Remove one addition. + (ec_subm_25519): Change order of add_n and set_cond to remove + need to clear 'n'. + (ec_mulm_25519): Avoid extra memory copies; Use _gcry_mpih_addmul_1 + for multiplying by 19 and adding; Remove one addition at end. + + mpi/longlong.h: fix missing macro parameter parentheses. + + commit 9722da5bfc4a519365f081b75319e96c4dd238f2 + * mpi/longlong.h [__alpha] (umul_ppmm): Add parentheses around + used parameters. + [__i370__] (sdiv_qrnnd): Ditto. + [__mips__] (umul_ppmm): Ditto. + [__vax__] (sdiv_qrnnd): Ditto. + + tests/t-mpi-point: add NIST curve multiplication test vectors. + + commit a0871a1e817f49e81b36b52e6b629f044bbd902e + * tests/t-mpi-point.c (mpi_base10_scan, check_ec_mul): New. + (main): Call 'check_ec_mul'. + + tests/bench-slope: add ECC benchmarking. + + commit 57cf83834bc00a7431378aabda692bf700e4876c + * tests/bench-slope.c (bench_print_result_nsec_per_iteration): New. + (bench_print_header_nsec_per_iteration): New. + (kdf_bench_one, kdf_bench): Use new print helper functions. + [USE_ECC]: New ECC benchmarks. + (ecc_bench): New. + (print_help): Add 'ecc' option. + (main): Add ECC benchmarks. + + tests/benchmark: add benchmark for Ed448. + + commit b53abf7905e05c39a2bdeffb77414458d2697d89 + * tests/benchmark.c (ecc_bench): Add Ed448. + +2021-06-17 Werner Koch + + ecc: Fix bug in gcry_pk_get_param for Curve25519. + + commit 692e9b1935ed4ad9517077c1f87da41ddefb9937 + * cipher/ecc-curves.c (_gcry_ecc_get_param_sexp): Simplify. + + * cipher/pubkey.c (map_algo): Also map EDDSA to ECC. + * tests/curves.c (check_get_params): Add simple param lookup tests by + for all curves. + +2021-06-16 Johannes Schindelin via Gcrypt-devel + + build: Fix broken mlock detection. + + commit 66ff25ed4a8fd0c6897d8b18600be483c90ee436 + * acinclude.m4 [GNUPG_CHECK_MLOCK]: Use size_t for the ptr test. + +2021-06-02 Werner Koch + + cipher: Extend convenience OID mapping table for AES. + + commit 585f153e1f741c1952c8e8c1a7f3a89a1e641572 + * cipher/rijndael.c: Add OIDs for GCM and CCM. + + Minor tweak to gcry_free. + + commit b6de4080a97385423b6a78fd400606d31093806f + * src/global.c (_gcry_free): Avoid setting errno again if it did not + change. + +2021-06-01 NIIBE Yutaka + + random: Silence a warning for building rndjent by Clang. + + commit f6a4e22d86d2e2e03d164ec6515bb662eb762ef3 + * random/jitterentropy-base.c: Conditionalize by __OPTIMIZE__. + +2021-05-27 NIIBE Yutaka + + build: _DARWIN_C_SOURCE should be 1. + + commit b9a14725ec13747dab1d96658b2f7ce09b1ec874 + * configure.ac (*-apple-darwin*): Set _DARWIN_C_SOURCE 1. + +2021-05-26 NIIBE Yutaka + + cipher: Fix ElGamal encryption for other implementations. + + commit 632d80ef30e13de6926d503aa697f92b5dbfbc5e + * cipher/elgamal.c (gen_k): Remove support of smaller K. + (do_encrypt): Never use smaller K. + (sign): Folllow the change of gen_k. + +2021-05-17 Tianjia Zhang + + cipher: Fix memory leaks for EdDSA. + + commit 14bb6d4ea0dcb4db008057df93396d105d4a8672 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_genkey): Initialize point Q when us= ed. + +2021-05-17 H.J. Lu + + Always include in cipher assembly codes. + + commit a1f5d87ed49beaab2e4754532b84bd201ef3f68c + * cipher/poly1305-s390x.S: Always include . + +2021-05-06 NIIBE Yutaka + + ecc: Fix the input length check for Montgomery curve. + + commit 5f814e8a4968c01a7ffc7762bcaf3ce040594caf + * cipher/ecc-misc.c (_gcry_ecc_mont_decodepoint): Fix the condition. + +2021-04-28 Jussi Kivilinna + + hwf-x86: fix use of wrong operand type. + + commit ec87511d9cd2dc31434e939b6351d74a38d4ceaa + * src/hwf-x86.c (get_cpuid): Use xchg for swapping %ebx back + and forth between operand register. + +2021-04-27 NIIBE Yutaka + + ecc: Check the input length for the point. + + commit 060c378c050e7ec6206358c681a313d6e1967dcf + * cipher/ecc-misc.c (_gcry_ecc_mont_decodepoint): Check the length + of valid point representation. + +2021-04-26 Jussi Kivilinna + + keccak: add hash_buffers functions for SHAKE128 & SHAKE256. + + commit e866c01e645d35475614d892665ac1c09513156d + * cipher/keccak.c (_gcry_shake128_hash_buffers) + (_gcry_shake256_hash_buffers): New. + (_gcry_digest_spec_shake128, _gcry_digest_spec_shake256): Add + hash_buffers pointer. + + hash_buffers: add output length param for XOF support. + + commit eb96baf28473302b3d78187de92eb10093919f18 + * src/cipher-proto.h (gcry_md_hash_buffers_t): Add nbytes parameter + for outbuf size for XOF algorithms. + * cipher/md.c (_gcry_md_hash_buffer) + (_gcry_md_hash_buffers_extract): Adjust for spec->hash_buffers + parameter change. + * cipher/keccak.c (_gcry_sha3_hash_buffers): Add nbytes parameter and + handling for XOF output. + * cipher/blake2.c (DEFINE_BLAKE2_VARIANT): Add nbytes parameter for + hash_buffers. + * cipher/rmd160.c (_gcry_rmd160_hash_buffers): Add nbytes parameter. + * cipher/sha1.c (_gcry_sha1_hash_buffers): Add nbytes parameter. + (_gcry_sha1_hash_buffer): Pass nbytes to _gcry_sha1_hash_buffers. + * cipher/sha256.c (_gcry_sha256_hash_buffers) + (_gcry_sha224_hash_buffers): Add nbytes parameter. + * cipher/sha512.c (_gcry_sha512_hash_buffers) + (_gcry_sha384_hash_buffers, _gcry_sha512_256_hash_buffers) + (_gcry_sha512_224_hash_buffers): Add nbytes parameter. + * cipher/sm3.c (_gcry_sm3_hash_buffers): Add nbytes parameter. + + md: remove hash_buffer function from algorithms. + + commit 580ae61db5fe47b558135c2c794fd72c2680fa20 + * cipher/md.c (_gcry_md_hash_buffer): Remove used of + 'spec->hash_buffer'. + * cipher/blake2.c (DEFINE_BLAKE2_VARIANT): Remove *_hash_buffer. + * cipher/crc.c: Remove spec hash_buffer NULL pointers. + * cipher/gostr3411-94.c: Remove spec hash_buffer NULL pointers. + * cipher/keccak.c (_gcry_sha3_hash_buffer + (_gcry_sha3_224_hash_buffer, _gcry_sha3_256_hash_buffer): Remove. + (_gcry_sha3_384_hash_buffer, _gcry_sha3_512_hash_buffer): Remove. + * cipher/md2.c: Remove spec hash_buffer NULL pointers. + * cipher/md4.c: Remove spec hash_buffer NULL pointers. + * cipher/md5.c: Remove spec hash_buffer NULL pointers. + * cipher/rmd160.c (_gcry_rmd160_hash_buffer): Remove. + * cipher/sha1.c (_gcry_sha1_hash_buffer): Rewrite using + _gcry_sha1_hash_buffers. + (_gcry_sha1_hash_buffers): Make static. + (_gcry_digest_spec_sha1): Remove hash_buffer pointer. + * cipher/sha256.c (_gcry_sha256_hash_buffer) + (_gcry_sha224_hash_buffer): Remove. + (_gcry_sha256_hash_buffers): Make static. + * cipher/sha512.c (_gcry_sha512_hash_buffer) + (_gcry_sha384_hash_buffer, _gcry_sha512_256_hash_buffer) + (_gcry_sha512_224_hash_buffer): Remove. + (_gcry_sha512_hash_buffers): Make static. + * cipher/sm3.c (_gcry_sm3_hash_buffer): Remove. + (_gcry_sm3_hash_buffers): Make static. + * cipher/stribog.c: Remove spec hash_buffer NULL pointers. + * cipher/tiger.c: Remove spec hash_buffer NULL pointers. + * cipher/whirlpool.c: Remove spec hash_buffer NULL pointers. + * src/cipher-proto.h (gcry_md_hash_buffer_t): Remove. + (gcry_md_spec_t): Remove 'hash_buffer'. + * src/cipher.h (_gcry_rmd160_hash_buffer, _gcry_sha1_hash_buffers) + (_gcry_sha256_hash_buffer, _gcry_sha256_hash_buffers) + (_gcry_sha512_hash_buffer, _gcry_sha512_hash_buffers) + (_gcry_sm3_hash_buffer, _gcry_sm3_hash_buffers): Remove. + + Add XOF output support for internal _gcry_md_hash_buffers. + + commit f53d541d0947a894e6f09b4568658a859505a649 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_compute_h_d, _gcry_ecc_eddsa_sign) + (_gcry_ecc_eddsa_verify): Use same _gcry_md_hash_buffers_extract code + path for SHA512 and SHAKE256. + * cipher/md.c (_gcry_md_hash_buffers): Rename to ... + (_gcry_md_hash_buffers_extract): ... this; Add digestlen and handling + for XOF algorithms (SHAKE128, SHAKE256). + (_gcry_md_hash_buffers): New. + * src/gcrypt-int.h (_gcry_md_hash_buffers_extract): New. + + Use memset for constant length wipememory2. + + commit 4770ad72607f73b9d529511c687556a6b4109875 + * src/g10lib.h (fast_wipememory2_inline): New. + (wipememory2): Use 'fast_wipememory2_inline', remove 'fast_wipememory2' + use; Use _gcry_fast_wipememory* when _len or _set is not constant. + (fast_wipememory_s, fast_wipememory2): Remove. + +2021-04-19 Werner Koch + + Release 1.9.3. + + commit cb78627203705365d24b48ec4fc4cf2fc804b277 + + +2021-04-15 NIIBE Yutaka + Jakub Jelen + + cipher: Fix memory leaks for EdDSA. + + commit a8d6c6c1b258548260748eefba0532fd35c8ce47 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_genkey): Free the point Q. + (_gcry_ecc_eddsa_verify): Avoid memory leaks for points and MPIs. + +2021-04-13 NIIBE Yutaka + + api: Avoid use of C99 feature. + + commit 9c42db0b379c277ee976fcc696e84e31863a85a8 + * src/gcrypt.h.in (enum gcry_md_algos): Remove last comma. + + random: Fix for iOS. + + commit 0007f889bda884e40459ad86f13b6cd8b14c91df + * random/rndlinux.c [TARGET_OS_IPHONE]: Don't define HAVE_GETENTROPY. + + cipher: Hardening ElGamal by introducing exponent blinding too. + + commit e8b7f10be275bcedb5fc05ed4837a89bfd605c61 + * cipher/elgamal.c (do_encrypt): Also do exponent blinding. + +2021-04-09 Jussi Kivilinna + + mpi: harden add_n_cond, sub_n_cond and abs_cond against EM leakage. + + commit 9bc3d8de6e2a8cdef37c118f0a70376ed777eeee + * mpi/mpih-const-time.c (_gcry_mpih_add_n_cond) + (_gcry_mpih_sub_n_cond): Always perform calculation with both UP and + VP; Use two masks for selecting output. + (_gcry_mpih_abs_cond): Always calculate absolute value of UP; Use + two masks for selecting output. + + mpi: harden set_cond functions against EM leakage. + + commit c7c25b6e6e6b52bbed26d8016145c404eb118f19 + * mpi/mpih-const-time.c (_gcry_mpih_set_cond): Use two masks for + selecting output. + * mpi/mpiutil.c (_gcry_mpi_set_cond): Use two masks for selecting + output. + + mpi: harden swap_cond functions against EM leakage. + + commit 1266f5bb02b7f76f2e4697ecfb85ef19c2ae04a9 + * mpi/mpih-const-time.c (vzero, vone): New. + (_gcry_mpih_swap_cond): Use two masks for selecting output. + * mpi/mpiutil.c (vzero, vone): New. + (_gcry_mpi_swap_cond): Use to masks for selecting output. + +2021-04-02 NIIBE Yutaka + + cipher: Return GPG_ERR_INV_KEYLEN when wrong key length. + + commit 840713de1a685920b6b1e1379902d545eccc74cf + * cipher/idea.c (do_setkey): Return GPG_ERR_INV_KEYLEN. + * cipher/rfc2268.c (setkey_core): Likewise. + * cipher/serpent.c (serpent_setkey_internal): Likewise. + (serpent_setkey): Likewise. + +2021-04-01 Jussi Kivilinna + + cipher-gcm-ppc: add big-endian support. + + commit aaa30381eac3cdb49a21e279b2d89ef6e695a138 + * cipher/cipher-gcm-ppc.c (ALIGNED_16): New. + (vec_store_he, vec_load_he): Remove WORDS_BIGENDIAN ifdef. + (vec_dup_byte_elem): New. + (_gcry_ghash_setup_ppc_vpmsum): Match function declaration with + prototype in cipher-gcm.c; Load C2 with VEC_LOAD_BE; Use + vec_dup_byte_elem; Align constants to 16 bytes. + (_gcry_ghash_ppc_vpmsum): Match function declaration with + prototype in cipher-gcm.c; Align constant to 16 bytes. + * cipher/cipher-gcm.c (ghash_ppc_vpmsum): Return value from + _gcry_ghash_ppc_vpmsum. + * cipher/cipher-internal.h (GCM_USE_PPC_VPMSUM): Remove requirement + for !WORDS_BIGENDIAN. + + mpi/aarch64: use C_SYMBOL_NAME for assembly function names. + + commit 1cf5a568f2b2f2c3d83c154cdcf5a40aa1f83c50 + * mpi/aarch64/mpih-add1.S: Add missing C_SYMBOL_NAME. + * mpi/aarch64/mpih-mul1.S: Add missing C_SYMBOL_NAME. + * mpi/aarch64/mpih-mul2.S: Add missing C_SYMBOL_NAME. + * mpi/aarch64/mpih-mul3.S: Add missing C_SYMBOL_NAME. + * mpi/aarch64/mpih-sub1.S: Add missing C_SYMBOL_NAME. + +2021-03-31 NIIBE Yutaka + + build: Update gpg-error.m4. + + commit d2b3d046fc66a3166dc0c003a430ce756532ff74 + * m4/gpg-error.m4: Update from libgpg-error. + +2021-03-30 NIIBE Yutaka + + build: Fix for make distcheck, no EPS support. + + commit 35917373d64521d9c0d33b5fa9b60abd28964dd4 + * Makefile.am (AM_DISTCHECK_DVI_TARGET): Specify 'pdf'. + * doc/Makefile.am (EXTRA_DIST, BUILT_SOURCES): Remove .eps files. + + ecc: Fix the regression of gcry_mpi_ec_add. + + commit 45e88b8ec6dfbd8f981ca89ded80ef48eca6f0e9 + * mpi/ec.c (_gcry_mpi_ec_point_resize): Export the routine + for internal use. + (add_points_edwards, _gcry_mpi_ec_mul_point): Use mpi_point_resize. + * src/gcrypt-int.h (_gcry_mpi_ec_point_resize): Declare. + + * src/visibility.c (gcry_mpi_ec_dup, gcry_mpi_ec_add): Make sure for + the size of limb before calling the internal functions. + (gcry_mpi_ec_sub): Likewise. + +2021-03-25 Jussi Kivilinna + + rijndael-s390x: fix checksum calculation in OCB decryption. + + commit 68bb0ddc5504c9c0f3f52259a4085bb2fc1a02ad + * cipher/rijndael-s390x.c (aes_s390x_ocb_dec): Calculate checksum + after decryption instead of inlining. + + tests/basic: OCB large buffer check: make input buffer non-repeatable. + + commit 21c273cecfd58408b8d3287f5bc8c246c3010313 + * tests/basic.c (check_ocb_cipher_largebuf_split): Use SHA1 to + initialize input buffer. + (check_ocb_cipher): Update largebuf test vectors. + + tests/basic: add decryption check to check_ocb_cipher_checksum. + + commit 56da81ac47209dc41af08a129f5e0c15538261b2 + * tests/basic.c (check_ocb_cipher_checksum): Add decryption. + +2021-03-25 NIIBE Yutaka + + build: Remove intermediate PDF files from EXTRA_DIST. + + commit 52f6e95159885431f3c7e9f64290d0132ca547ef + * doc/Makefile.am (EXTRA_DIST): Remove PDF files. + (BUILT_SOURCES): Likewise. + +2021-03-24 Werner Koch + + ecc: Fix keygrip computation for compressed points. + + commit c8c38757c428871af980a548bc38f38e5d9238d1 + * cipher/ecc-misc.c (_gcry_ecc_ec2os): Factor most code out to ... + (_gcry_ecc_ec2os_buf): new. + * cipher/ecc.c (compute_keygrip): Handle compressed keys. + * tests/keygrip.c: Add new tests. + +2021-03-07 Jussi Kivilinna + + Compile arch specific GCM implementations only on target arch. + + commit 43302b960f546fd60ed7fefb2b0404ee69491e93 + * cipher/Makefile.am: Move arch specific 'cipher-gcm-*.[cS]' files + from libcipher_la_SOURCES to EXTRA_libcipher_la_SOURCES. + * configure.ac: Add 'cipher-gcm-intel-pclmul.lo' and + 'cipher-gcm-arm*.lo'. + + configure.ac: fix digest implementations going to cipher list. + + commit 8892510bb8f45438144a7449440fcb32ae4c5f7b + * configure.ac: Add 'crc-arm*.lo', 'crc-ppc.lo', 'sha*-ppc.lo' to + GCRYPT_DIGESTS instead of GCRYPT_CIPHERS. + + cipher-gcm-ppc: tweak for better performance. + + commit 760ef8baee06db5ce4da55eb5648e605aa511d2d + * cipher/cipher-gcm-ppc.c (asm_xor, asm_mergelo, asm_mergehi) + (vec_be_swap, vec_load_he, vec_store_he): New. + (vec_load_be, vec_perm2, vec_aligned_st, vec_aligned_ld): Remove. + (asm_vpmsumd, asm_swap_u64, vec_perm2, asm_rot_block_left) + (asm_rot_block_right, asm_ashl_128, vec_aligned_ld) + (_gcry_ghash_setup_ppc_vpmsum): Update 'bswap_const'. + (_gcry_ghash_ppc_vpmsum): Update 'bswap_const'; Use 'asm_mergehi' + and 'asm_mergelo' instead of vec_perm2; Use 'asm_xor' for + fast path to enforce instruction ordering; Use 'vec_load_he' and + 'vec_be_swap' for big-endian loads. + +2021-03-07 Shawn Landden + + VPMSUMD acceleration for GCM mode on PPC. + + commit 440332532a1c107e2baeafda5464e0707f634be1 + * cipher/Makefile.am: Add 'cipher-gcm-ppc.c'. + * cipher/cipher-gcm-ppc.c: New. + * cipher/cipher-gcm.c [GCM_USE_PPC_VPMSUM] (_gcry_ghash_setup_ppc_vpmsum) + (_gcry_ghash_ppc_vpmsum, ghash_setup_ppc_vpsum, ghash_ppc_vpmsum): New. + (setupM) [GCM_USE_PPC_VPMSUM]: Select ppc-vpmsum implementation if + HW feature "ppc-vcrypto" is available. + * cipher/cipher-internal.h (GCM_USE_PPC_VPMSUM): New. + (gcry_cipher_handle): Move 'ghash_fn' at end of 'gcm' block to align + 'gcm_table' to 16 bytes. + * configure.ac: Add 'cipher-gcm-ppc.lo'. + * tests/basic.c (_check_gcm_cipher): New AES256 test vector. + * AUTHORS: Add 'CRYPTOGAMS'. + * LICENSES: Add original license to 3-clause-BSD section. + +2021-03-06 Jussi Kivilinna + + src/hwfeatures: add reminder about documenting new HW features. + + commit 7c4c992fe96f781e387bd26a11b17e70a27aa3c0 + * src/hwfeatures.c (hwflist): Add comment about updating + 'doc/gcrypt.texi' with new HW features. + +2021-03-06 Jakub Jelen + + doc: Document newly added optimizations. + + commit 49ab649c69951cd7b6d40d3527e21db51d93a207 + * doc/gcrypt.texi: Add HW features 'intel-vaes-vpclmul', 'ppc-vcrypto', + 'ppc-arch_3_00', 'ppc-arch_2_07', 's390x-msa', 's390x-msa-4', + 's390x-msa-8' and 's390x-vx'. + +2021-03-03 Jussi Kivilinna + + poly1305: make --disable-asm work on x86, aarch64 and ppc. + + commit 2b84da922660918129c610f4d27cb5c510ab0489 + * cipher/poly1305.c [__aarch64__] (ADD_1305_64): Check for + HAVE_CPU_ARCH_ARM. + [__x86_64__] (ADD_1305_64): Check for HAVE_CPU_ARCH_X86. + [__powerpc__] (ADD_1305_64): Check for HAVE_CPU_ARCH_PPC. + [__i386__] (ADD_1305_32): Check for HAVE_CPU_ARCH_X86. + + poly1305: fix compiling on i386 gcc-4.7. + + commit bcb180190e8921356c039b0475fd71f2c45d986d + * cipher/poly1305.c [__i386__]: Limit i386 variant of ADD_1305_32 to + GCC-5 or newer. + + cipher-gcm-intel-pclmul: fix compiling with i386 gcc-4.7. + + commit d1fcf3975c57c5312890199832100c8c363d5b18 + * cipher/cipher-gcm-intel-pclmul.c (gcm_lsh): Pass '*pconst' instead of + 'pconst' to asm block. + +2021-02-28 Jussi Kivilinna + + rijndael: add x86_64 VAES/AVX2 accelerated implementation. + + commit e72498a54fdead503fb0c1c93e2b747cd91e7681 + * cipher/Makefile.am: Add 'rijndael-vaes.c' and + 'rijndael-vaes-avx2-amd64.S'. + * cipher/rijndael-internal.h (USE_VAES): New. + * cipher/rijndael-vaes-avx2-amd64.S: New. + * cipher/rijndael-vaes.c: New. + * cipher/rijndael.c (_gcry_aes_vaes_cfb_dec, _gcry_aes_vaes_cbc_dec) + (_gcry_aes_vaes_ctr_enc, _gcry_aes_vaes_ocb_crypt) + (_gcry_aes_vaes_xts_crypt): New. + (do_setkey) [USE_VAES]: Add detection for VAES. + (selftest_ctr_128, selftest_cbc_128, selftest_cfb_128) + [USE_VAES]: Increase number of selftest blocks. + * configure.ac: Add 'rijndael-vaes.lo' and + 'rijndael-vaes-avx2-amd64.lo'. + + rijndael-aesni: add 8-block parallel code path for XTS. + + commit ffe1d53197031eeb65601c5aeafe55e78079a75e + * cipher/rijndael-aesni.c (xts_gfmul_const): Fix array size from 16 + to 2. + (_gcry_aes_aesni_xts_enc, _gcry_aes_aesni_xts_dec) [__x86_64__]: Add + 8-block parallel code paths. + + camellia: add x86_64 VAES/AVX2 accelerated implementation. + + commit 0e7e60241a0d054eae7a98116636a831ec6ccc97 + * cipher/Makefile.am: Add 'camellia-aesni-avx2-amd64.h' and + 'camellia-vaes-avx2-amd64.S'. + * cipher/camellia-aesni-avx2-amd64.S: New, old content moved to... + * cipher/camellia-aesni-avx2-amd64.h: ...here. + (IF_AESNI, IF_VAES, FUNC_NAME): New. + * cipher/camellia-vaes-avx2-amd64.S: New. + * cipher/camellia-glue.c (USE_VAES_AVX2): New. + (CAMELLIA_context): New member 'use_vaes_avx2'. + (_gcry_camellia_vaes_avx2_ctr_enc, _gcry_camellia_vaes_avx2_cbc_dec) + (_gcry_camellia_vaes_avx2_cfb_dec, _gcry_camellia_vaes_avx2_ocb_enc) + (_gcry_camellia_vaes_avx2_ocb_dec) + (_gcry_camellia_vaes_avx2_ocb_auth): New. + (camellia_setkey): Check for HWF_INTEL_VAES. + (_gcry_camellia_ctr_enc, _gcry_camellia_cbc_dec) + (_gcry_camellia_cfb_dec, _gcry_camellia_ocb_crypt) + (_gcry_camellia_ocb_auth): Add USE_VAES_AVX2 code. + * configure.ac: Add 'camellia-vaes-avx2-amd64.lo'. + + hwf-x86: add "intel-vaes-vpclmul" HW feature. + + commit eb404d8904532f6dca82421c952be286a1f4e11c + * configure.ac (HAVE_GCC_INLINE_ASM_VAES_VPCLMUL): New. + * src/g10lib.h (HWF_INTEL_VAES_VPCLMUL): New. + * src/hwf-x86.c (detect_x86_gnuc): Check for VAES and VPCLMUL. + * src/hwfeatures.c (hwflist): Add "intel-vaes-vpclmul". + +2021-02-17 Werner Koch + + Release 1.9.2. + + commit 24bd7e8215f7982b0c8db46fd87b47b370a52ec6 + + +2021-02-16 NIIBE Yutaka + + build: Update gpg-error.m4. + + commit 8e3cd4c4677c3b10ac6265a1b31f84c63c95cac4 + * m4/gpg-error.m4: Update from libgpg-error. + +2021-02-12 NIIBE Yutaka + + random: Fix build for macOS. + + commit d78cdf42854b17e2216890e7b78f9e7e05c0b1f8 + * random/rndlinux.c [__APPLE__] (HAVE_GETENTROPY): Valid only when the + macro __MAC_10_11 is available. + +2021-02-08 Werner Koch + + tests: Fix minor glitches. + + commit 82395f11b444651f544f5e51c62fc6b65c04f9ef + * tests/basic.c (ALWAYS_INLINE): Make sure it is defined. + * tests/version.c (main): Print the config info to stdout. + + New test Makefile target xtestsuite. + + commit ebc4d5670a1ada54ad907a4836eb8f6f573c2c38 + * tests/Makefile.am (xtestsuite, xcheck): New targets. + + New test driver to allow for standalone regression tests. + + commit b142da4c88deef4798ef96061dac399df3ddd73d + * tests/testdrv.c: New. + +2021-02-03 Jussi Kivilinna + + sha256-avx2: fix reading beyond end of input buffer. + + commit 24af2a55d862d45fe3aef6b5626a52d9bb0fb17e + * cipher/sha256-avx2-bmi2-amd64.S + (_gcry_sha256_transform_amd64_avx2): Use 'last block' code path if + input length is only one block. + * tests/basic.c (check_one_md_final): Use dynamic allocated buffer + so that in future similar access errors get detected by + tests/basic + valgrind. + + ecc-ecdh: fix memory leak. + + commit 289543544e41cd5fe90352c5c7548ac09da533cc + * cipher/ecc-ecdh.c (_gcry_ecc_mul_point): Free 'ec' at function exit. + + tests: allow running 'make check' with ASAN. + + commit f46a6bd9b3d7ef7d1a72c5b6da5cf34ace2ff156 + * tests/t-secmem.c (main): Skip test if environment variable + GCRYPT_IN_ASAN_TEST is defined. + * tests/t-sexp.c (main): Do not initialize secmem if environment + variable GCRYPT_IN_ASAN_TEST is defined. + + global: make sure that bulk config string is null-terminated. + + commit 8716e4b2ada21456802aee67c2bc8edfec78f820 + * src/global.c (_gcry_get_config): Append null-terminator to output + in the 'what =3D=3D NULL' case. + + Add handling for -Og with O-flag munging. + + commit a71b7de32b0c7c41359335a488cfe4dd70c65121 + * cipher/Makefile.am (o_flag_munging): Add handling for '-Og'. + * random/Makefile.am (o_flag_munging): Add handling for '-Og'. + + jent: silence ubsan warning about signed overflow. + + commit 6fc11291282a668839040c72a1d558a6ebbd4972 + * random/jitterentropy-base.c (jent_stuck): Cast 'delta2' values to + 'uint64_t' for calculation. + + Fix ubsan warnings for i386 build. + + commit 364e9e9d10503b36f98fbb1b489e00026f22c9d7 + * mpi/mpicoder.c (_gcry_mpi_set_buffer) [BYTES_PER_MPI_LIMB =3D=3D 4]: Ca= st + "*p--" values to mpi_limb_t before left shifting. + * tests/t-lock.c (main): Cast 'time(NULL)' to unsigned type. + + Fix building with --disable-asm on x86. + + commit af23ab5c5482d625ff52e60606cf044e2b0106c8 + * cipher/keccak.c (USE_64BIT_BMI2, USE_64BIT_SHLD) + (USE_32BIT_BMI2): Depend also on HAVE_CPU_ARCH_X86. + * random/rndjent.c [__i386__ || __x86_64__] (USE_JENT): Depend + also on HAVE_CPU_ARCH_X86. + + md: clear bctx.count at final function. + + commit cb95fc53003e9f34ff80fc33627ceda605de223c + * cipher/md4.c (md4_final): Set bctx.count zero after + finalizing. + * cipher/md5.c (md5_final): Ditto. + * cipher/rmd160.c (rmd160_final): Ditto. + * cipher/sha1.c (sha1_final): Ditto. + * cipher/sha256.c (sha256_final): Ditto. + * cipher/sha512.c (sha512_final): Ditto. + * cipher/sm3.c (sm3_final): Ditto. + * cipher/stribog.c (stribog_final): Ditto. + * cipher/tiger.c (tiger_final): Ditto. + +2021-02-02 NIIBE Yutaka + + ecc: Add checking key for ECDSA. + + commit 598d0f3e0294a487e01b88cc714a8cd0a47329bb + * cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_verify): Validate public key. + * cipher/ecc-gost.c (_gcry_ecc_gost_verify): Likewise. + * cipher/ecc-sm2.c (_gcry_ecc_sm2_verify): Likewise. + +2021-01-29 Werner Koch + + Release 1.9.1. + + commit 466299b1ceb82ec7c4dd0ca376de50399a896adf + * configure.ac: Bump LT version to C23/A3/R1. + +2021-01-29 Jussi Kivilinna + + hash-common: fix heap overflow when writing more data after final. + + commit 512c0c75276949f13b6373b5c04f7065af750b08 + * tests/basic.c (check_one_md): Test writing to digest after read. + * cipher/hash-common.c (_gcry_md_block_write): Reset 'hd->count' if + greater than blocksize. + +2021-01-28 Werner Koch + + Add a compliance keyword to gcry_get_config. + + commit aa3f595341eb263980210776c7fe377b2ed24c5e + * src/global.c (print_config): New config line. + +2021-01-27 Jussi Kivilinna + + asm-common-aarch64: add MacOS support for GET_DATA_POINTER. + + commit 014fed5153647641376b9131ea1d87dc5e88cf42 + * cipher/asm-common-aarch64.h [__APPLE__] (GET_DATA_POINTER): Add MacOS + variant of macro. + +2021-01-27 NIIBE Yutaka + + random: Use getentropy on macOS when available. + + commit 6cb0faf6ceec5b2e799e6fb5f04b85d135a7da9b + * random/rndlinux.c [__APPLE__ && __MACH__] (getentropy): Declare. + (_gcry_rndlinux_gather_random): Check the symbol and use getentropy. + + mpi: Fix _gcry_mpih_mod implementation. + + commit f06ff4e31c8e162f4a59986241c7ab43d5085927 + * mpi/mpih-const-time.c (_gcry_mpih_mod): Handle the overflow. + + build: Check spawn.h for MacOS X Tiger. + + commit fc901e978a0c18a3524cad5d1ef3451ed11b9347 + * configure.ac: Add check for spawn.h. + * tests/random.c: Only use posix_spawn if available. + +2021-01-26 Jussi Kivilinna + + global: fix compile error at pragma GCC diagnostic. + + commit 3d095206c30d772d5fc68bf69bfc384e43f766e9 + * src/global.c (_gcry_vcontrol): Move "pragma GCC diagnostics" outside + function. + + cipher-proto: remove forward typedef of cipher_bulk_ops_t. + + commit 17aad639d29c7c835a7effb89181c7c99b16cb6a + * cipher/cipher-proto (cipher_bulk_ops_t): Remove typedef, leave + forward declaration of 'struct cipher_bulk_ops'. + (gcry_cipher_setkey_t): Change 'bulk_ops' to + 'struct cipher_bulk_ops *'. + * cipher/arcfour.c: Include 'cipher-internal.h'. + * cipher/gost28147.c: Ditto. + * cipher/idea.c: Ditto. + * cipher/rfc2268.c: Ditto. + * cipher/salsa20.c: Ditto. + * cipher/seed.c: Ditto. + * cipher/mac-internal.h (CTX_MAGIC_NORMAL): Rename to... + (CTX_MAC_MAGIC_NORMAL): ... this. + (CTX_MAGIC_SECURE): Rename to... + (CTX_MAC_MAGIC_SECURE): ... this. + * cipher/mac-cmac.c (cmac_open): Use CTX_MAC_MAGIC_SECURE. + * cipher/mac-gmac.c (gmac_open): Ditto. + * cipher/mac-hmac.c (hmac_open): Ditto. + * cipher/mac-poly1305.c (poly1305mac_open): Ditto. + * cipher/mac.c (mac_open): Use CTX_MAC_MAGIC_SECURE and + CTX_MAC_MAGIC_NORMAL. + +2021-01-26 David Michael + + cipher/sha512: Fix non-NEON ARM assembly implementation. + + commit 1e72c50f864ae1c77ba80c191224b9ef1d22a2e2 + * cipher/sha512.c (do_transform_generic) + [USE_ARM_ASM]: Switch to the non-NEON assembly implementation. + +2021-01-26 Jussi Kivilinna + + blake2: fix RIP register access for AVX/AVX2 implementations. + + commit b2f78ae034b8d4aa3d4cc7bf85262317832f6e0a + * cipher/blake2b-amd64-avx2.S: Use rRIP instead of (RIP). + * cipher/blake2s-amd64-avx.S: Use rRIP instead of (RIP). + + sha512/sha256: remove assembler macros from AMD64 implementations. + + commit 9f49e806f9506533236fd44b17f17b85961b20f1 + * configure.ac (gcry_cv_gcc_platform_as_ok_for_intel_syntax): Remove + assembler macro check from Intel syntax assembly support check. + * cipher/sha256-avx-amd64.S: Replace assembler macros with C + preprocessor counterparts. + * cipher/sha256-avx2-bmi2-amd64.S: Ditto. + * cipher/sha256-ssse3-amd64.S: Ditto. + * cipher/sha512-avx-amd64.S: Ditto. + * cipher/sha512-avx2-bmi2-amd64.S: Ditto. + * cipher/sha512-ssse3-amd64.S: Ditto. + + configure.ac: run assembler checks through linker for better LTO support + + commit 393bd6c3d1aa2b2a1b05be0e2d7fb2514e6c5ad0 + * configure.ac (gcry_cv_gcc_arm_platform_as_ok) + (gcry_cv_gcc_aarch64_platform_as_ok) + (gcry_cv_gcc_inline_asm_ssse3, gcry_cv_gcc_inline_asm_pclmul) + (gcry_cv_gcc_inline_asm_shaext, gcry_cv_gcc_inline_asm_sse41) + (gcry_cv_gcc_inline_asm_avx, gcry_cv_gcc_inline_asm_avx2) + (gcry_cv_gcc_inline_asm_bmi2, gcry_cv_gcc_as_const_division_ok) + (gcry_cv_gcc_as_const_division_with_wadivide_ok) + (gcry_cv_gcc_amd64_platform_as_ok, gcry_cv_gcc_win64_platform_as_ok) + (gcry_cv_gcc_platform_as_ok_for_intel_syntax) + (gcry_cv_gcc_inline_asm_neon, gcry_cv_gcc_inline_asm_aarch32_crypto) + (gcry_cv_gcc_inline_asm_aarch64_neon) + (gcry_cv_gcc_inline_asm_aarch64_crypto) + (gcry_cv_gcc_inline_asm_ppc_altivec) + (gcry_cv_gcc_inline_asm_ppc_arch_3_00) + (gcry_cv_gcc_inline_asm_s390x, gcry_cv_gcc_inline_asm_s390x): Use + AC_LINK_IFELSE check instead of AC_COMPILE_IFELSE. + + rijndael: remove unused use_xxx flags. + + commit a14447f8169aff30a49f5c2ab06bd5bbd1cc3531 + * cipher/rijndael-internal.h (RIJNDAEL_context_s): Remove unused + 'use_padlock', 'use_aesni', 'use_ssse3', 'use_arm_ce', 'use_ppc_crypto' + and 'use_ppc9le_crypto'. + * cipher/rijndael.c (do_setkey): Do not setup 'use_padlock', + 'use_aesni', 'use_ssse3', 'use_arm_ce', 'use_ppc_crypto' and + 'use_ppc9le_crypto'. + + Define HW-feature flags per architecture. + + commit 8d404a629167d67ed56e45de3e65d1e0b7cdeb24 + * random/rand-internal.h (_gcry_rndhw_poll_slow): Add requested length + parameter. + * random/rndhw.c (_gcry_rndhw_poll_slow): Limit accounted bytes to 50% + (or 25% for RDRAND) - this code is moved from caller side. + * random/rndlinux.c (_gcry_rndlinux_gather_random): Move + HWF_INTEL_RDRAND check to _gcry_rndhw_poll_slow. + * src/g10lib.h (HWF_PADLOCK_*, HWF_INTEL_*): Define only if + HAVE_CPU_ARCH_X86. + (HWF_ARM_*): Define only if HAVE_CPU_ARCH_ARM. + (HWF_PPC_*): Define only if HAVE_CPU_ARCH_PPC. + (HWF_S390X_*): Define only if HAVE_CPU_ARCH_S390X. + + Add configure option to force enable 'soft' HW feature bits. + + commit 3b34bd6e178614d6021ee7d1140646f7c8ed7519 + * configure.ac (force_soft_hwfeatures) + (ENABLE_FORCE_SOFT_HWFEATURES): New. + * src/hwf-x86.c (detect_x86_gnuc): Enable HWF_INTEL_FAST_SHLD + and HWF_INTEL_FAST_VPGATHER if ENABLE_FORCE_SOFT_HWFEATURES enabled. + +2021-01-26 NIIBE Yutaka + + ecc: Fix Ed25519 private key handling for preceding ZEROs. + + commit 1b74f633bd3e358fb07a856a70597019980651d2 + * cipher/ecc-curves.c (mpi_ec_setup_elliptic_curve): Fill-up or remove + preceding ZEROs correctly, fixing the third argument of mpi_set_opaque. + + ecc: Fix initialization of CTX for sign and verify. + + commit 652b102697cbfe2d7bc642fc7374cb21a9cf03e6 + * cipher/ecc.c (ecc_sign, ecc_verify): Call + _gcry_pk_util_init_encoding_ctx at first. + +2021-01-21 NIIBE Yutaka + + build: Fix build of tests with non-default installation. + + commit fa3420b011c105ca21894489e62c7e882a3ac4dd + * tests/Makefile.am: Add forgotten @LDADD_FOR_TESTS_KLUDGE@. + +2021-01-20 Jussi Kivilinna + + Split inline assembly blocks with many memory operands. + + commit 00df9f27181d77166ceb55f319329400bf2e6a48 + * cipher/rijndael-aesni.c (aesni_ocb_checksum, aesni_ocb_enc) + (aesni_ocb_dec, _gcry_aes_aesni_ocb_auth): Split assembly blocks + with more than 4 memory operands to smaller blocks. + * cipher/sha512-ssse3-i386.c (W2): Split big assembly block to + three smaller blocks. + + tests/basic: fix build on ARM32 when NEON disabled. + + commit 81354e911bfa3e135d3e07f6a8d9e98033cd921a + * tests/basic.c (CLUTTER_VECTOR_REGISTER_NEON) + (CLUTTER_VECTOR_REGISTER_AARCH64): Remove check for __ARM_FEATURE_SIMD32. + + kdf: make self-test test-vector array read-only. + + commit 097148bc89ec8c18b9e4795733e0f0b1ae0ecd1d + * cipher/kdf.c (selftest_pbkdf2): Make 'tv[]' constant. + + kdf: add missing null-terminator for self-test test-vector array. + + commit c6425a5537294dfe2beaafc9105f7af4ceac677f + * cipher/kdf.c (selftest_pbkdf2): Add null-terminator to TV array. + + cipher/bithelp: use __builtin_ctzl when available. + + commit 807827cda3bacf5f475167ee6d34657713111838 + * cipher/bithelp.h (_gcry_ctz64): Use __builtin_ctzl if available. + + mpi/longlong: make use of compiler provided __builtin_ctz/__builtin_clz. + + commit 477355047e5c75ad2b2238a8716e4646b861184c + * configure.ac (gcry_cv_have_builtin_ctzl, gcry_cv_have_builtin_clz) + (gcry_cv_have_builtin_clzl): New checks. + * mpi/longlong.h (count_leading_zeros, count_trailing_zeros): Use + __buildin_clz[l]/__builtin_ctz[l] if available and bit counting + macros not yet provided by inline assembly. + +2021-01-19 Werner Koch + + Release 1.9.0. + + commit 0dc49af9b5371c5e2f766b70c3bede2b10db9f7e + + +2021-01-19 NIIBE Yutaka + + Fix DSA for FIPS 186-3. + + commit 30ed9593f632c728d918598037358deaeccd1968 + * cipher/dsa.c (generate_fips186): Supply INITIAL_SEED to + _gcry_generate_fips186_3_prime. + * tests/fips186-dsa.c (check_dsa_gen_186_2): Add where tv comes from. + (check_dsa_gen_186_3): Implement tests. + * tests/pubkey.c (get_dsa_key_fips186_with_seed_new): Use the qbits + and seed of tests/fips186-dsa.c. + +2021-01-19 NIIBE Yutaka + Tom=C3=A1=C5=A1 Mr=C3=A1z + + Check if FIPS is operational and error return if not. + + commit ebeae53222648c637907f4b358888fc0e7123dc9 + * src/visibility.c (gcry_kdf_derive): Add the check. + (gcry_prime_generate, gcry_prime_group_generator): Likewise. + (gcry_mpi_randomize): Likewise, but no return. + +2021-01-18 Werner Koch + + ecc: Change an error code of gcry_ecc_mul_point. + + commit ca5a90bf70598247589078478d237287ca524453 + * cipher/ecc-ecdh.c (_gcry_ecc_mul_point): Return + GPG_ERR_UNKNOWN_CURVE. + +2021-01-15 NIIBE Yutaka + Tom=C3=A1=C5=A1 Mr=C3=A1z + + kdf: Add selftest. + + commit 7a0da24925361a3109474d0e433511467a9e35d1 + * src/cipher-proto.h (_gcry_kdf_selftest): New. + * cipher/kdf.c (check_one, selftest_pbkdf2): New. + (_gcry_kdf_selftest): New. + * src/fips.c (run_kdf_selftests): New. + (_gcry_fips_run_selftests): Call run_kdf_selftests. + +2021-01-13 NIIBE Yutaka + Tom=C3=A1=C5=A1 Mr=C3=A1z + + cmac: Add selftest. + + commit 385a89e35b0b95f15b4c6e4d5482b1fc6906f7c5 + * cipher/mac-cmac.c (check_one, selftests_cmac_3des): New. + (selftests_cmac_aes, cmac_selftest): New. + (cmac_ops): Add cmac_selftest. + * src/fips.c (run_mac_selftests): Add CMAC selftests. + +2021-01-13 NIIBE Yutaka + + sexp: Raise an error when an integer is negative with USG. + + commit 00d7c1c632019066a4884930d413ccc044d81af5 + * src/sexp.c (do_vsexp_sscan): Return GPG_ERR_INV_ARG if negative. + +2021-01-08 NIIBE Yutaka + + ecc: Add backward compatibility support for Ed25519 key in SEXP. + + commit 4768baf74be03d8973d004725f796aef329c45bf + * cipher/ecc-curves.c (_gcry_ecc_get_curve): Support Ed25519 keys with + parameter {p,a,b,g,n}. + + ecc: Minor implementation change for _gcry_ecc_get_curve. + + commit 3fe7036d05f283df9441d42242f0047b6ea11a32 + * cipher/ecc-curves.c (_gcry_ecc_get_curve): Flatten. + +2020-12-30 Jussi Kivilinna + + Add s390x/zSeries implementation of Poly1305. + + commit 1f75681cbba895ea2f7ea0637900721f4522e729 + * cipher/Makefile.am: Add 'poly1305-s390x.S' and + 'asm-poly1305-s390x.h'. + * cipher/asm-poly1305-s390x.h: New + * cipher/chacha20-s390x.S (_gcry_chacha20_poly1305_s390x_vx_blocks8) + (_gcry_chacha20_poly1305_s390x_vx_blocks4_2_1): New, stitched + chacha20-poly1305 implementation. + * cipher/chacha20.c (USE_S390X_VX_POLY1305): New. + (_gcry_chacha20_poly1305_s390x_vx_blocks8) + (_gcry_chacha20_poly1305_s390x_vx_blocks4_2_1): New prototypes. + (_gcry_chacha20_poly1305_encrypt, _gcry_chacha20_poly1305_decrypt): Add + s390x/VX stitched chacha20-poly1305 code-path. + * cipher/poly1305-s390x.S: New. + * cipher/poly1305.c (USE_S390X_ASM, HAVE_ASM_POLY1305_BLOCKS): New. + [USE_S390X_ASM] (_gcry_poly1305_s390x_blocks1, poly1305_blocks): New. + * configure.ac (gcry_cv_gcc_inline_asm_s390x): Check for 'risbgn' and + 'algrk' instructions. + * tests/basic.c (_check_poly1305_cipher): Add large chacha20-poly1305 + test vector. + + Add s390x/zSeries implementation of ChaCha20. + + commit 6a0bb9ab7f886087d7edb0725c90485086a1c0b4 + * cipher/Makefile.am: Add 'asm-common-s390x.h' and 'chacha20-s390x.S'. + * cipher/asm-common-s390x.h: New. + * cipher/chacha20-s390x.S: New. + * cipher/chacha20.c (USE_S390X_VX): New. + (CHACHA20_context_t): Change 'use_*' bit-field to unsigned type; Add + 'use_s390x'. + (_gcry_chacha20_s390x_vx_blocks8) + (_gcry_chacha20_s390x_vx_blocks4_2_1): New. + (chacha20_do_setkey): Add HW feature detect for s390x/VX. + (chacha20_blocks, do_chacha20_encrypt_stream_tail): Add s390x/VX + code-path. + * configure.ac: Add 'chacha20-s390x.lo'. + + hwf-s390x: add VX vector instruction set detection. + + commit 1d13794780e3d052cd5ed6f900bf5900cf44b377 + * configure.ac (gcry_cv_gcc_inline_asm_s390x_vx): New check. + * src/g10lib.h (HWF_S390X_VX): New. + * src/hwf-s390x.c (HWCAP_S390_VXRS): New. + (s390x_features) [HAVE_GCC_INLINE_ASM_S390X_VX]: Add VX feature check. + * src/hwfeatures.c (hwlist): Add "s390x-vx". + + mpi/longlong: add s390x/zSeries macros. + + commit 0252cc9b62dfe20c77211f093b4fda54786177d3 + * mpi/longlong.h [__s390x__] (add_ssaaaa, sub_ddmmss, UTItype) + (umul_ppmm, udiv_qrnnd): New. + +2020-12-22 Jussi Kivilinna + + hwf-arm: fix incorrect HWCAP2 for SHA1 and SHA2 on AArch32. + + commit 6b6bfd57d0a6b2b4577c084db35078cd9fadafa5 + * src/hwf-arm.c (HWCAP2_SHA1, HWCAP2_SHA2): Change from bit indexes to + flags. + + Add missing prototype for _gcry_mac_selftest. + + commit e47f04b4a28947c90db70ccaf93e149cfd5213c9 + * src/cipher-proto.h (_gcry_hmac_selftest): Rename to... + (_gcry_mac_selftest): ... this. + +2020-12-21 NIIBE Yutaka + + Merge hmac-tests.c into mac-hmac.c. + + commit 2ab14b23afc092fd25395954c2a94db932ca4d95 + * cipher/Makefile.am (EXTRA_DIST): Remove hmac-tests.c. + * cipher/hmac-tests.c: Remove, merge into... + * cipher/mac-hmac.c: ... here. + +2020-12-18 Jussi Kivilinna + + Add s390x/zSeries acceleration for SHA3. + + commit 7532e27cacb74c92fd561524a0897163b0fcd7f4 + * cipher/asm-inline-s390x.h (KLMD_PADDING_STATE): New. + (kimd_execute): Change 'reg0' from read-only to read/write. + (klmd_shake_execute): New. + * cipher/keccak.c (USE_S390X_CRYPTO): New. + (KECCAK_CONTEXT) [USE_S390X_CRYPTO]: New members. + [USE_S390X_CRYPTO] (keccak_bwrite_s390x, keccak_final_s390x) + (keccak_bextract_s390x, keccak_write_s390x, keccak_extract_s390x): New. + (keccak_write) [USE_S390X_CRYPTO]: Use accelerated function if enabled. + (keccak_final) [USE_S390X_CRYPTO]: Likewise. + (keccak_extract) [USE_S390X_CRYPTO]: Likewise. + (keccak_init) [USE_S390X_CRYPTO]: Detect and setup zSeries + acceleration. + + Add s390x/zSeries acceleration for SHA512. + + commit 45f0ec0c4e3b08627cbf7e65f5f110c321710d01 + * cipher/sha512.c (USE_S390X_CRYPTO): New. + (SHA512_CONTEXT) [USE_S390X_CRYPTO]: New members. + (do_sha512_transform_s390x, do_sha512_final_s390x): New. + (sha512_init_common) [USE_S390X_CRYPTO]: Detect and setup s390x/zSeries + acceleration. + (sha512_final) [USE_S390X_CRYPTO]: Use accelerated final function. + + Add s390x/zSeries acceleration for SHA256. + + commit 0b555c3cc7c2b80ec2628685946a6139a1996911 + * cipher/sha256.c (USE_S390X_CRYPTO): New. + (SHA256_CONTEXT) [USE_S390X_CRYPTO]: New members. + (do_sha256_transform_s390x, do_sha256_final_s390x): New. + (sha256_common_init) [USE_S390X_CRYPTO]: Detect and setup s390x/zSeries + acceleration. + (sha256_final) [USE_S390X_CRYPTO]: Use accelerated final function. + + Add s390x/zSeries acceleration for SHA1. + + commit 88570515b4ca92a44c4e40c31f877c11cc00ab68 + * cipher/asm-inline-s390x.h (ALWAYS_INLINE): New. + (klmd_query): New. + (km_function_to_mask, kimd_execute, klmd_execute): Mark as always + inline. + * cipher/rijndael-s390x.c (ALWAYS_INLINE): Remove. + * cipher/sha1.c (do_sha1_transform_s390x, do_sha1_final_s390x): New. + (sha1_init) [SHA1_USE_S390X_CRYPTO]: Detect and setup s390x/zSeries + acceleration. + (sha1_final) [SHA1_USE_S390X_CRYPTO]: Use accelerated final function. + * cipher/sha1.h (SHA1_USE_S390X_CRYPTO): New. + (SHA1_CONTEXT) [SHA1_USE_S390X_CRYPTO]: New. + + Add bulk AES-GCM acceleration for s390x/zSeries. + + commit 5aeb091f911398217b2e9facb9bdeb05c63d7844 + * cipher/Makefile.am: Add 'asm-inline-s390x.h'. + * cipher/asm-inline-s390x.h: New. + * cipher/cipher-gcm.c [GCM_USE_S390X_CRYPTO] (ghash_s390x_kimd): New. + (setupM) [GCM_USE_S390X_CRYPTO]: Add setup for s390x GHASH function. + * cipher/cipher-internal.h (GCM_USE_S390X_CRYPTO): New. + * cipher/rijndael-s390x.c (u128_t, km_functions_e): Move to + 'asm-inline-s390x.h'. + (aes_s390x_gcm_crypt): New. + (_gcry_aes_s390x_setup_acceleration): Use 'km_function_to_mask'; Add + setup for GCM bulk function. + + Add bulk function interface for GCM mode. + + commit f4e63e92dc0b79633f48b11d292dd7bdf2752ede + * cipher/cipher-gcm.c (do_ghash_buf): Proper handling for the case + where 'unused' gets filled to full blocksize. + (gcm_crypt_inner): New. + (_gcry_cipher_gcm_encrypt, _gcry_cipher_gcm_decrypt): Use + 'gcm_crypt_inner'. + * cipher/cipher-internal.h (cipher_bulk_ops_t): Add 'gcm_crypt'. + + Add s390x/zSeries acceleration for AES. + + commit 9219d9d1b60c01a4c7dbde05ee6b5b52e0d7d072 + * configure.ac: Add 'rijndael-s390x.lo'. + * cipher/Makefile.am: Add 'rijndael-s390x.c'. + * cipher/rijndael-internal.c (USE_S390X_CRYPTO): New. + (RIJNDAEL_context_s) [USE_S390X_CRYPTO]: New 'km*_func' members. + * cipher/rijndael-s390x.c: New. + * cipher/rijndael.c (_gcry_aes_s390x_setup_acceleration) + (_gcry_aes_s390x_setup_setkey) + (_gcry_aes_s390x_setup_prepare_decryption, _gcry_aes_s390x_encrypt) + (_gcry_aes_s390x_decrypt): New. + (do_setkey) [USE_S390X_CRYPTO]: Add s390x acceleration setup. + + Add bulk function interface for OFB mode. + + commit f12b6788f2297391265af93a7794bfbc503de6d7 + * cipher/cipher-internal.h (cipher_bulk_ops): Add 'ofb_enc'. + * cipher/cipher-ofb.c (_gcry_cipher_ofb_encrypt): Use bulk encryption + function if defined. + * cipher/basic.c (check_bulk_cipher_modes): Add OFB-AES test vectors. + + hwf: add detection of s390x/zSeries hardware features. + + commit 128054767d5f864798a39d432997f7d38c4bf729 + * configure.ac (gcry_cv_gcc_inline_asm_s390x) + (HAVE_CPU_ARCH_S390X): Add s390x detection support. + * mpi/config.links: Add setup for s390x links. + * src/Makefile.am: Add 'hwf-s390x.c'. + * src/g10lib.h (HWF_S390X_MSA, HWF_S390X_MSA_4, HWF_S390X_8): New. + * src/hwf_common.h (_gcry_hwf_detect_s390x): New. + * src/hwf-s390x.c: New. + * src/hwfeatures.c: Add "s390x-msa", "s390x-msa-4" and "s390x-msa-8". + + tests/bench-slope: use same benchmarking for XTS as for other modes. + + commit 0e37bb32e215feb4716341f7053c4f54806645cb + * tests/bench-slope.c (bench_xts_encrypt_init): Use same buffer + sizes as other tests. + (bench_xts_encrypt_do_bench, bench_xts_decrypt_do_bench): Remove. + (xts_encrypt_ops): Use 'bench_encrypt_do_bench'. + (xts_decrypt_ops): Use 'bench_decrypt_do_bench'. + + aarch64: mpi/longlong.h: fix operand size mismatch. + + commit c59b5b03a063ebc73935dbb10bc4f568faddbedf + * mpi/longlong.h [__aarch64__] (count_leading_zeros): Use correctly + sized temporary variable for asm output. + + aarch64: use configure check for assembly ELF directives support. + + commit 8352b0ece5237e3f86f1525b072e8f690ad0fa94 + * configure.ac (gcry_cv_gcc_asm_elf_directives): New check. + (HAVE_GCC_ASM_ELF_DIRECTIVES): New 'config.h' macro. + * cipher/asm-common-aarch64.h (ELF): Change feature macro check from + __ELF__ to HAVE_GCC_ASM_ELF_DIRECTIVES. + +2020-12-18 NIIBE Yutaka + + Reorganize self-tests for HMAC. + + commit c90fb0d8fb7a84bbcc8d6832de6a554405591850 + * cipher/Makefile.am: Prepare merge of hmac-test.c into mac-hmac.c. + * cipher/hmac-tests.c: Ifdef-out run_selftests and _gcry_hmac_selftest. + * cipher/mac-internal.h: Include cipher-proto.h for selftest. + (gcry_mac_spec_ops): Add selftest field. + * cipher/mac-hmac.c: Include hmac-tests.c for migration. + (hmac_selftest) New. + (hmac_ops): Add hmac_selftest. + * cipher/gost28147.c, cipher/mac-cmac.c: Add new field for selftest. + * cipher/mac-gmac.c, cipher/mac-poly1305.c: Likewise.. + * cipher/mac.c (_gcry_mac_selftest): New. + * src/fips.c (run_mac_selftests): Rename from run_hmac_selftests. + Use GCRY_MAC_HMAC_*, and call _gcry_mac_selftest. + (_gcry_fips_run_selftests): Use run_mac_selftests. + +2020-12-03 Jussi Kivilinna + + Prevent link-time optimization from inlining __gcry_burn_stack. + + commit 1a83df98b198902ee6d71549231a3af37088d452 + * src/g10lib.h (NOINLINE_FUNC): New attribute macro. + * src/misc.c (__gcry_burn_stack): Add NOINLINE_FUNC attribute. + + tests/basic: check 32-bit and 64-bit overflow for CTR and ChaCha20. + + commit 2065720b5b0642cc1a0e08086a434244ebb1abf2 + * tests/basic.c (check_one_cipher_ctr_reset) + (check_one_cipher_ctr_overflow): New. + (check_one_cipher): Add counter overflow tests for ChaCha20 and CTR + mode. + + chacha20-ppc: fix 32-bit counter overflow handling. + + commit ed45eac3b721c1313902b977379fbd4886ccca7b + * cipher/chacha20-ppc.c (vec_add_ctr_u64, ADD_U64): New. + (_gcry_chacha20_ppc8_blocks1, _gcry_chacha20_ppc8_blocks4) + (_gcry_chacha20_poly1305_ppc8_blocks4): Use ADD_U64 when incrementing + counter. + +2020-12-03 NIIBE Yutaka + + tests: Put a work around to tests/random for macOS. + + commit 9769b40b54cf010a0c41c4ab05a7a88e17d70613 + * configure.ac [*-apple-darwin*] (USE_POSIX_SPAWN_FOR_TESTS): New. + * tests/random.c [USE_POSIX_SPAWN_FOR_TESTS] (run_all_rng_tests): New. + +2020-11-18 NIIBE Yutaka + + build: Update to newer autoconf constructs. + + commit 9485ca7b5bf11194cff59edbfa6a0fba3bf6162a + * acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): Use AS_MESSAGE_LOG_FD + instead of AC_FD_CC. + (GNUPG_CHECK_MLOCK): Use AC_LINK_IFELSE instead of AC_TRY_LINK. + Use AC_RUN_IFELSE instead of AC_TRY_RUN. + * configure.ac (AC_ISC_POSIX): Replace by AC_SEARCH_LIBS. + Use AC_USE_SYSTEM_EXTENSIONS instead of AC_GNU_SOURCE. + Use AS_HELP_STRING instead of AC_HELP_STRING. + (AC_TYPE_SIGNAL): Remove. + (AC_DECL_SYS_SIGLIST): Remove. + * m4/Makefile.am (EXTRA_DIST): Update. + * m4/onceonly.m4: Remove. + * m4/socklen.m4: Update from gnulib. + * m4/libtool.m4: Update from libgpg-error. + * m4/gpg-error.m4: Update from libgpg-error. + * m4/noexecstack.m4: Use AS_HELP_STRING instead of AC_HELP_STRING. + + build: Use modern Autoconf check for type. + + commit 425bf499185d78aa8fcad6a30b8771e7865d449d + * configure.ac (byte, ushort, us6, u32, u64): Use AC_CHECK_TYPES. + * cipher/poly1305.c: Use HAVE_TYPE_U64. + * src/hmac256.c: HAVE_TYPE_U32. + * src/types.h: Use HAVE_TYPE_BYTE, HAVE_TYPE_USHORT, HAVE_TYPE_U16, + HAVE_TYPE_U32, and HAVE_TYPE_U64. + + m4: Update with newer autoconf constructs. + + commit 908e347fb68b28e180ac816b5050406358e81a0f + * src/libgcrypt.m4: Replace AC_HELP_STRING to AS_HELP_STRING. + +2020-10-30 NIIBE Yutaka + + ecc: Handle removed zeros at the beginning for Ed25519. + + commit 361a0588489cf4a539da8debd1771024a1faa218 + * cipher/ecc-curves.c (mpi_ec_setup_elliptic_curve): Accept private + key with removed zeros. + +2020-10-23 Werner Koch + + random: Allow for a Unicode random seed file on Windows. + + commit 24341f58f0d38bd62c45d285bcf8472f82b56135 + * random/random-csprng.c (utf8_to_wchar) [W32]: New. + (any8bitchar) [W32]: New. + (my_open): New. Replace all calls to open with this. + +2020-10-01 Tianjia Zhang + + tests: Fix typo in comment. + + commit 4a50c6b88d6d8d843e50add851a8a5e691349097 + * tests/basic.c: Fix typo in comment. + +2020-09-27 Jussi Kivilinna + + rijndael: clean-up prepare_decryption function. + + commit 2051d5bd6f732a36e5a536cba734531a9e2e915f + * cipher/rijndael-internal.h (rijndael_prepare_decfn_t): New. + (RIJNDAEL_context_s): New member 'prepare_decryption'. + * cipher/rijndael-padlock.c (_gcry_aes_padlock_prepare_decryption): New. + * cipher/rijndael.c (_gcry_aes_padlock_prepare_decryption): New. + (do_setkey): Setup 'ctx->prepare_decryption' for each acceleration type. + (prepare_decryption): Remove calls to other prepare decryption functions. + (check_decryption_preparation): Call 'ctx->prepare_decryption' instead + of 'prepare_decryption'. + + rijndael: clean-up generic bulk functions. + + commit 7679c918ade9d334bc80cb8c10916bbc847ff382 + * cipher/rijndael.c (_gcry_aes_cfb_enc, _gcry_aes_cbc_enc) + (_gcry_aes_ctr_enc, _gcry_aes_cfb_dec, _gcry_aes_cbc_dec) + (_gcry_aes_ocb_crypt, _gcry_aes_ocb_auth, _gcry_aes_xts_crypt): Remove + calls to hardware accelerated AES bulk functions. + + cipher: setup bulk functions at each algorithms key setup. + + commit 51271eb86bcb0eb89e55a2add9607c503f182c89 + * cipher/cipher-internal.h (cipher_mode_ops_t, cipher_bulk_ops_t): New. + (gcry_cipher_handle): Define members 'mode_ops' and 'bulk' using new + types. + * cipher/cipher.c (_gcry_cipher_open_internal): Remove bulk function + setup. + (cipher_setkey): Pass context bulk function pointer to algorithm setkey + function. + * cipher/cipher-selftest.c (_gcry_selftest_helper_cbc) + (_gcry_selftest_helper_cfb, _gcry_selftest_helper_ctr): Remove bulk + function parameter; Use bulk function returned by setkey function. + * cipher/cipher-selftest.h (_gcry_selftest_helper_cbc) + (_gcry_selftest_helper_cfb, _gcry_selftest_helper_ctr): Remove bulk + function parameter. + * cipher/arcfour.c (arcfour_setkey): Change 'hd' parameter to + 'bulk_ops'. + * cipher/blowfish.c (bf_setkey): Change 'hd' parameter to + 'bulk_ops'; Setup 'bulk_ops' with bulk acceleration functions. + (_gcry_blowfish_ctr_enc, _gcry_blowfish_cbc_dec) + (_gcry_blowfish_cfb_dec): Make static. + (selftest_ctr, selftest_cbc, selftest_cfb): Do not pass bulk function + to selftest helper. + (selftest): Pass 'bulk_ops' to setkey function. + * cipher/camellia.c (camellia_setkey): Change 'hd' parameter to + 'bulk_ops'; Setup 'bulk_ops' with bulk acceleration functions. + (_gcry_camellia_ctr_enc, _gcry_camellia_cbc_dec) + (_gcry_camellia_cfb_dec, _gcry_camellia_ocb_crypt) + (_gcry_camellia_ocb_auth): Make static. + (selftest_ctr, selftest_cbc, selftest_cfb): Do not pass bulk function + to selftest helper. + (selftest): Pass 'bulk_ops' to setkey function. + * cipher/cast5.c (cast_setkey): Change 'hd' parameter to + 'bulk_ops'; Setup 'bulk_ops' with bulk acceleration functions. + (_gcry_cast5_ctr_enc, _gcry_cast5_cbc_dec, _gcry_cast5_cfb_dec): Make + static. + (selftest_ctr, selftest_cbc, selftest_cfb): Do not pass bulk function + to selftest helper. + (selftest): Pass 'bulk_ops' to setkey function. + * cipher/chacha20.c (chacha20_setkey): Change 'hd' parameter to + 'bulk_ops'. + * cipher/cast5.c (do_tripledes_setkey): Change 'hd' parameter to + 'bulk_ops'; Setup 'bulk_ops' with bulk acceleration functions. + (_gcry_3des_ctr_enc, _gcry_3des_cbc_dec, _gcry_3des_cfb_dec): Make + static. + (bulk_selftest_setkey): Change 'hd' parameter to 'bulk_ops'. + (selftest_ctr, selftest_cbc, selftest_cfb): Do not pass bulk function + to selftest helper. + (do_des_setkey): Change 'hd' parameter to 'bulk_ops'. + * cipher/gost28147.c (gost_setkey): Change 'hd' parameter to + 'bulk_ops'. + * cipher/idea.c (idea_setkey): Change 'hd' parameter to 'bulk_ops'. + * cipher/rfc2268.c (do_setkey): Change 'hd' parameter to 'bulk_ops'. + * cipher/rijndael.c (do_setkey): Change 'hd' parameter to + 'bulk_ops'; Setup 'bulk_ops' with bulk acceleration functions. + (rijndael_setkey): Change 'hd' parameter to 'bulk_ops'. + (_gcry_aes_cfb_enc, _gcry_aes_cfb_dec, _gcry_aes_cbc_enc) + (_gcry_aes_cbc_dec, _gcry_aes_ctr_enc, _gcry_aes_ocb_crypt) + (_gcry_aes_ocb_auth, _gcry_aes_xts_crypt): Make static. + (selftest_basic_128, selftest_basic_192, selftest_basic_256): Pass + 'bulk_ops' to setkey function. + (selftest_ctr, selftest_cbc, selftest_cfb): Do not pass bulk function + to selftest helper. + * cipher/salsa20.c (salsa20_setkey): Change 'hd' parameter to + 'bulk_ops'. + * cipher/seed.c (seed_setkey): Change 'hd' parameter to 'bulk_ops'. + * cipher/serpent.c (serpent_setkey): Change 'hd' parameter to + 'bulk_ops'; Setup 'bulk_ops' with bulk acceleration functions. + (_gcry_serpent_ctr_enc, _gcry_serpent_cbc_dec, _gcry_serpent_cfb_dec) + (_gcry_serpent_ocb_crypt, _gcry_serpent_ocb_auth): Make static. + (selftest_ctr_128, selftest_cbc_128, selftest_cfb_128): Do not pass + bulk function to selftest helper. + * cipher/sm4.c (sm4_setkey): Change 'hd' parameter to 'bulk_ops'; Setup + 'bulk_ops' with bulk acceleration functions. + (_gcry_sm4_ctr_enc, _gcry_sm4_cbc_dec, _gcry_sm4_cfb_dec) + (_gcry_sm4_ocb_crypt, _gcry_sm4_ocb_auth): Make static. + (selftest_ctr_128, selftest_cbc_128, selftest_cfb_128): Do not pass + bulk function to selftest helper. + * cipher/twofish.c (twofish_setkey): Change 'hd' parameter to + 'bulk_ops'; Setup 'bulk_ops' with bulk acceleration functions. + (_gcry_twofish_ctr_enc, _gcry_twofish_cbc_dec) + (_gcry_twofish_cfb_dec, _gcry_twofish_ocb_crypt) + (_gcry_twofish_ocb_auth): Make static. + (selftest_ctr, selftest_cbc, selftest_cfb): Do not pass bulk function + to selftest helper. + (selftest, main): Pass 'bulk_ops' to setkey function. + * src/cipher-proto.h: Forward declare 'cipher_bulk_ops_t'. + (gcry_cipher_setkey_t): Replace 'hd' with 'bulk_ops'. + * src/cipher.h: Remove bulk acceleration function prototypes for + 'aes', 'blowfish', 'cast5', 'camellia', '3des', 'serpent', 'sm4' and + 'twofish'. + +2020-09-21 Jussi Kivilinna + + rijndael: tidy do_setkey little bit. + + commit e0829ae648d9d9da67cd8a8fae7aa05774a0d0f7 + * cipher/rijndael.c (do_setkey): Reduce number of ifdefs by using + function pointer for accelerated key-setup. + +2020-09-18 Jussi Kivilinna + + rijndael-aesni: tweak x86_64 AES-NI for better performance on AMD Zen2. + + commit f96989f0e9085fa58b475131d29b37f68ba564ec + * cipher/rijndael-aesni.c (do_aesni_enc_vec8, do_aesni_dec_vec8): Move + first round key xoring and last round out to caller. + (do_aesni_ctr_4): Change low 8-bit counter overflow check to 8-bit + addition to low-bits and detect overflow from carry flag; Adjust + slow path to restore counter. + (do_aesni_ctr_8): Same as above; Interleave first round key xoring and + first round with CTR generation on fast path; Interleave last round + with output xoring. + (_gcry_aes_aesni_cfb_dec, _gcry_aes_aesni_cbc_dec): Add first round + key xoring; Change order of last round xoring and output xoring + (shorten the dependency path). + (_gcry_aes_aesni_ocb_auth): Add first round key xoring and last round + handling. + +2020-08-26 Werner Koch + + build: Allow customization of the signing key. + + commit 9cd92ebae21900e54cc3d8b607c8ed1afbf2eb9b + * Makefile.am (sign-release): Read variabales from user configuration. + +2020-08-21 NIIBE Yutaka + + tests: Fix basic.c. + + commit fd51bc523d095168ee9367fe3f18d18f7a88ad90 + * tests/basic.c (check_one_hmac): Fix error paths. + (check_pubkey_crypt): Fix wrong call of gcry_sexp_new. + + ecc: Fix an error path. + + commit 65a2cd139e21250e6581a4f610015937e7b91451 + * cipher/ecc-ecdh.c (_gcry_ecc_mul_point): Avoid null dereference on + error. + +2020-07-23 Jussi Kivilinna + + chacha20-aarch64: improve performance through higher SIMD interleaving. + + commit 8d7b1d0a52bde173646e5b42b31d23593eabecf2 + * cipher/chacha20-aarch64.S (ROTATE2, ROTATE2_8, ROTATE2_16) + (QUARTERROUND2): Replace with... + (ROTATE4, ROTATE4_8, ROTATE4_16, QUARTERROUND4): ...these. + (_gcry_chacha20_aarch64_blocks4) + (_gcry_chacha20_poly1305_aarch64_blocks4): Adjust to use QUARTERROUND4. + + tests/bench-slope: improve CPU frequency auto-detection. + + commit f1c3db3bf40e07cfd1a6a92209865ee7a98129ca + * configure.ac (gcry_cv_have_asm_volatile_memory): Check also if + assembly memory barrier with input/output register is supported. + * tests/bench-slope.c (auto_ghz_bench): Change to use base operation + that takes two CPU cycles and unroll loop by 1024 operations. + + Enable jitter entropy also on non-x86 architectures. + + commit 886120f33bd3f10e6e6a09920eca1f9ed81044e7 + * configure.ac: Do not force jentsupport to "n/a" on non-x86 + architectures. + + random/jitterentropy: fix USE_JENT =3D=3D JENT_USES_GETTIME code path. + + commit 4ed9b949485448816a70d86260d572f08ae34621 + * random/jitterentropy-base-user.h (jent_get_nstime): Use 'tv' variable + instead of non-existing 'time'. + + Camellia AES-NI/AVX/AVX2 size optimization. + + commit 4c0e244fc53e0f7b927bfe4cf54695b5d282fd27 + * cipher/camellia-aesni-avx-amd64.S: Use loop for handling repeating + '(enc|dec)_rounds16/fls16' portions of encryption/decryption. + * cipher/camellia-aesni-avx2-amd64.S: Use loop for handling repeating + '(enc|dec)_rounds32/fls32' portions of encryption/decryption. + +2020-07-14 NIIBE Yutaka + + ecc: Support reading EC point in compressed format for good curves. + + commit e0dabf74bf276500257f15b85ded9cf24ccc8334 + * cipher/ecc-curves.c (gcry_ecc_get_curve): Handle G, differently. + * cipher/ecc-misc.c (_gcry_ecc_sec_decodepoint): Support compressed + representation of EC point. Rename from _gcry_ecc_os2ec. + * cipher/ecc-sm2.c (_gcry_ecc_sm2_decrypt) Follow the change. + * cipher/ecc.c (ecc_decrypt_raw): Likewise. + * mpi/ec.c (_gcry_mpi_ec_set_point): Likewise. + * src/ec-context.h: API change _gcry_ecc_sec_decodepoint from + _gcry_ecc_os2ec. + * tests/basic.c (check_pubkey): Use compressed representation + for two public keys of NIST P192 and NIST P256. + +2020-07-06 Werner Koch + + mpi: Consider +0 and -0 the same in mpi_cmp. + + commit 1f3a92e103d4a8e019d8d022647a2b9fb2681327 + * mpi/mpi-cmp.c (do_mpi_cmp): Check size of U an V. + +2020-06-23 NIIBE Yutaka + + ecc: Fix length computation. + + commit 1db1dc7945b111b6e20a8420ad38a358316681ab + * cipher/ecc-curves.c (mpi_ec_setup_elliptic_curve): Add one only for + Edwards case. + +2020-06-20 Jussi Kivilinna + + Add SM4 x86-64/AES-NI/AVX2 implementation. + + commit 35a78eb248d6bacd2a58477a122a0020d796ce63 + * cipher/Makefile.am: Add 'sm4-aesni-avx2-amd64.S'. + * cipher/sm4-aesni-avx2-amd64.S: New. + * cipher/sm4.c (USE_AESNI_AVX2): New. + (SM4_context) [USE_AESNI_AVX2]: Add 'use_aesni_avx2'. + [USE_AESNI_AVX2] (_gcry_sm4_aesni_avx2_ctr_enc) + (_gcry_sm4_aesni_avx2_cbc_dec, _gcry_sm4_aesni_avx2_cfb_dec) + (_gcry_sm4_aesni_avx2_ocb_enc, _gcry_sm4_aesni_avx2_ocb_dec) + (_gcry_sm4_aesni_avx_ocb_auth): New. + (sm4_setkey): Enable AES-NI/AVX2 if supported by HW. + (_gcry_sm4_ctr_enc, _gcry_sm4_cbc_dec, _gcry_sm4_cfb_dec) + (_gcry_sm4_ocb_crypt, _gcry_sm4_ocb_auth) [USE_AESNI_AVX2]: Add + AES-NI/AVX2 bulk functions. + * configure.ac: Add ''sm4-aesni-avx2-amd64.lo'. + + Add SM4 x86-64/AES-NI/AVX implementation. + + commit c9a3f1bb91e63033e3bf3e06bdd6075622626d0d + * cipher/Makefile.am: Add 'sm4-aesni-avx-amd64.S'. + * cipher/sm4-aesni-avx-amd64.S: New. + * cipher/sm4.c (USE_AESNI_AVX, ASM_FUNC_ABI): New. + (SM4_context) [USE_AESNI_AVX]: Add 'use_aesni_avx'. + [USE_AESNI_AVX] (_gcry_sm4_aesni_avx_expand_key) + (_gcry_sm4_aesni_avx_crypt_blk1_8, _gcry_sm4_aesni_avx_ctr_enc) + (_gcry_sm4_aesni_avx_cbc_dec, _gcry_sm4_aesni_avx_cfb_dec) + (_gcry_sm4_aesni_avx_ocb_enc, _gcry_sm4_aesni_avx_ocb_dec) + (_gcry_sm4_aesni_avx_ocb_auth, sm4_aesni_avx_crypt_blk1_8): New. + (sm4_expand_key) [USE_AESNI_AVX]: Use AES-NI/AVX key setup. + (sm4_setkey): Enable AES-NI/AVX if supported by HW. + (_gcry_sm4_ctr_enc, _gcry_sm4_cbc_dec, _gcry_sm4_cfb_dec) + (_gcry_sm4_ocb_crypt, _gcry_sm4_ocb_auth) [USE_AESNI_AVX]: Add + AES-NI/AVX bulk functions. + * configure.ac: Add ''sm4-aesni-avx-amd64.lo'. + + Optimizations for SM4 cipher. + + commit 81fee26bbbae820a311a3ce3ac55e304655c2acd + * cipher/cipher.c (_gcry_cipher_open_internal): Add SM4 bulk + functions. + * cipher/sm4.c (ATTR_ALIGNED_64): New. + (sbox): Convert to ... + (sbox_table): ... this structure for sbox hardening as is done + for AES and GCM. + (prefetch_sbox_table): New. + (sm4_t_non_lin_sub): Make inline; Optimize sbox access pattern. + (sm4_key_lin_sub): Make inline; Tune slightly. + (sm4_key_sub, sm4_enc_sub): Make inline. + (sm4_round): Make inline; Take 'x' as separate parameters instead + of array. + (sm4_expand_key): Return void; Drop keylen; Unroll loops by 4; + Wipe sensitive variables at end; Move key-length check to + 'sm4_setkey'. + (sm4_setkey): Add initial self-test step; Add key-length check; + Remove burn stack (as variables wiped in 'sm4_expand_key'). + (sm4_do_crypt): Return burn stack depth; Unroll loops by 4. + (sm4_encrypt, sm4_decrypt): Prefetch sbox table; Return burn + stack from 'sm4_do_crypt', as allows tail-call optimization + by compiler. + (sm4_do_crypt_blks2): New two parallel block function for greater + instruction level parallelism. + (sm4_crypt_blocks, _gcry_sm4_ctr_enc, _gcry_sm4_cbc_dec) + (_gcry_sm4_cfb_dec, _gcry_sm4_ocb_crypt, _gcry_sm4_ocb_auth): New + bulk processing functions. + (selftest_ctr_128, selftest_cbc_128, selftest_cfb_128): New + bulk processing self-tests. + (sm4_selftest): Clear SM4 context before use; Use 'sm4_expand_key' + instead of 'sm4_setkey'; Call bulk processing self-tests. + * src/cipher.h (_gcry_sm4_ctr_enc, _gcry_sm4_ctr_dec) + (_gcry_sm4_cfb_dec, _gcry_sm4_ocb_crypt, _gcry_sm4_ocb_auth): New. + * tests/basic.c (check_ocb_cipher): Add SM4-OCB test vector. + +2020-06-18 NIIBE Yutaka + + ecc: For Ed448, it's only for EdDSA. + + commit a6177e1bc948a7af052d62bcd62aa6b5825bfaff + * cipher/ecc.c (ecc_sign): Ed448 is only for EdDSA. + Hash algo is determined by the curve. + (ecc_verify): Likewise. + * tests/t-ed448.c (one_test): Don't specify (flags eddsa). + Don't specify hash-algo. + + ecc: Fix the condition for EdDSA data handling. + + commit f2847d56cce2afdd993f797812a673495a41c234 + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): It may be + the encoding context which determines EdDSA. Hash-algo can be + omitted. Flags are OR-ed. + + ecc: Support EdDSA with context and enabling PH(M). + + commit ba78ad8f19674b94edfdf4998f40feee081481bc + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_compute_h_d): Simplify. + (DOM4_0_NONE, DOM4_0_NONE_LEN): Remove. + (DOM25519, DOM25519_LEN): New. + (DOM448, DOM448_LEN): New. + (_gcry_ecc_eddsa_sign): Support EdDSA with context and PH. + (_gcry_ecc_eddsa_verify): Likewise. + * tests/t-ed448.c: Add tests with context and PH=3D1. + * tests/t-ed448.inp: Add test data. + + ecc: Change EdDSA internal API. + + commit 2856ac14ae3e4c9e6288e1f0d8bc1945bb874081 + * cipher/ecc-common.h (_gcry_ecc_eddsa_sign): Last arg is CTX. + (_gcry_ecc_eddsa_verify): Ditto. + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_sign): Get hash algo from CTX. + (_gcry_ecc_eddsa_verify): Ditto. + * cipher/ecc.c (ecc_sign, ecc_verify): Follow the change. + +2020-06-17 NIIBE Yutaka + + ecc: Support "label" for EdDSA context in data. + + commit 1cf49754694611620fd383327cf127e91f6883df + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): Handle ctx->label. + + ecc: Initialize key before handling data. + + commit d51a9c259d49c63121fab48bce48d826e9b57733 + * cipher/ecc.c (ecc_sign): Initialize key at first. + (ecc_verify): Likewise. + + ecc: Add new flag "prehash". + + commit 9a640eba6dd7504c90a65151cdaf1e4093a8b475 + * src/cipher.h (PUBKEY_FLAG_PREHASH): New. + * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist): Parse it. + + ecc: No (flags eddsa) required for Ed448. + + commit b1721f9b291a4c226caa2bfbe4fefe8fde5216e0 + * cipher/ecc.c (check_secret_key): Ed448 means EdDSA. + (ecc_generate): Likewise. + * tests/t-ed448.c (one_test): Remove the flag in key. + + ecc: Support Ed448 by _gcry_ecc_compute_public. + + commit 5585ee4947082f932ee01d93dfe295c769e96671 + * cipher/ecc-misc.c (_gcry_ecc_compute_public): Handle Ed448. + +2020-06-16 Tianjia Zhang + + tests: Add basic test-vectors for SM4. + + commit c1535d0b8797e9b3bbfb5193b6ab23bf788ffd36 + * tests/basic.c (check_ciphers): Add SM4 check and test-vectors. + + Add SM4 symmetric cipher algorithm. + + commit ddcce166ab8bc6f51f5b509bcbea13a8746384ec + * cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add sm4.c. + * cipher/cipher.c (cipher_list, cipher_list_algo301): Add + _gcry_cipher_spec_sm4. + * cipher/mac-cmac.c (map_mac_algo_to_cipher): Add cmac SM4. + (_gcry_mac_type_spec_cmac_sm4): Add cmac SM4. + * cipher/mac-internal.h: Declare spec_cmac_sm4. + * cipher/mac.c (mac_list, mac_list_algo201): Add cmac SM4. + * cipher/sm4.c: New. + * configure.ac (available_ciphers): Add sm4. + * doc/gcrypt.texi: Add SM4 document. + * src/cipher.h: Add declarations for SM4 and cmac SM4. + * src/gcrypt.h.in (gcry_cipher_algos): Add algorithm ID for SM4. + +2020-06-16 Jussi Kivilinna + + doc: add GCRY_MD_SM3, GCRY_MAC_HMAC_SM3 and GCRY_MAC_GOST28147_IMIT. + + commit 6c571bfda6409d7d668f5d44cea0c6c31e2688be + * doc/gcrypt.texi: add GCRY_MD_SM3, GCRY_MAC_HMAC_SM3 and + GCRY_MAC_GOST28147_IMIT. + +2020-06-16 NIIBE Yutaka + + ecc: Fix Ed448 key generation. + + commit c15cc1a38199cf0d758579eb01d0e88c99cd4b80 + * cipher/ecc.c (ecc_generate): Fix point representation for Ed448. + + ecc,test: Add testing Ed448. + + commit c7779e499e9051ee79ed720f576dbf40d90cdfb1 + + + ecc: Support Ed448 for verify. + + commit d1baad35c65030e41fcba69854c57032eee0d111 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_verify): Support Ed448. + + ecc: Support Ed448 signing. + + commit 951b37c5038667b461692454397bb058b5e1e184 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_sign): Support Ed448. + + ecc: Use SHAKE256 in EdDSA with Ed448. + + commit 32d6d73d44d372dd1ec0b08ba03f1b7b085c09d9 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_compute_h_d): Fix for SHAKE256. + + ecc: Support shake128 and shake256 for message digest. + + commit f6815a96e51be44a361ddcd3a20a5b969b1dab1b + * cipher/pubkey-util.c (get_hash_algo): Add shake128 and shake256. + + ecc: Support Ed448 for key generation. + + commit e25446ecc04442b399302ce72db6d5ea2e9e85e8 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_compute_h_d): Support Ed448. + (_gcry_ecc_eddsa_genkey): Support Ed448, using + _gcry_ecc_eddsa_compute_h_d. + + ecc: Support Ed448 in decoding point. + + commit bd22b029bbf50737f90535c506fba4f812bcf040 + * cipher/ecc-eddsa.c (ecc_ed448_recover_x): New. + (_gcry_ecc_eddsa_recover_x): Support Ed448. + (_gcry_ecc_eddsa_decodepoint): Support Ed448. + * mpi/ec.c (_gcry_mpi_ec_decode_point): For Ed448, use + _gcry_ecc_eddsa_decodepoint. + + ecc: Add new curve: Ed448. + + commit 339b03acf0971a31997901dd674fb75c4dde31d0 + * cipher/ecc-curves.c (curve_aliases): Add Ed448. + (domain_parms): Add domain parameters for Ed448. + * tests/curves.c (N_CURVES): Increment. + + ecc: Fix EdDSA encoding for Ed448. + + commit 3386aaf84d4d89b6ff931533df2ff82ed3f7c7f9 + * cipher/ecc-curves.c (mpi_ec_setup_elliptic_curve): Fix point/scalar + length condition. + * cipher/ecc-eddsa.c (eddsa_encodempi): The second argument is NBITS. + (eddsa_encode_x_y): Likewise. + (_gcry_ecc_eddsa_encodepoint): Follow the change. + (_gcry_ecc_eddsa_ensure_compact): Likewise. + (_gcry_ecc_eddsa_decodepoint): Likewise. + (_gcry_ecc_eddsa_sign): Likewise. Remove restriction of 256 bits. + +2020-06-12 NIIBE Yutaka + + ecc: Fix NBITS in domain_parms. + + commit db7b2c591004868abedbc2c19d3bb2efebf8529d + * cipher/ecc-curves.c (cipher/ecc-curves.c): It's NBITS of 'p'. + +2020-06-08 Jussi Kivilinna + + rijndael: fix UBSAN warning on left shift by 24 places with type 'int' + + commit 6cdd7268fe19b066ddb373e2f3c0b7ebf9b938dd + * cipher/rijndael.c (do_encrypt_fn, do_decrypt_fn): Cast final + sbox/inv_sbox look-ups to 'u32' type. + + Disable all assembly modules with --disable-asm. + + commit 3060aadec396802af13f08c4b2dd1b28f2a68c5d + * configure.ac (try_asm_modules): Update description, + "MPI" =3D> "MPI and cipher". + (gcry_cv_gcc_arm_platform_as_ok, gcry_cv_gcc_aarch64_platform_as_ok) + (gcry_cv_gcc_inline_asm_ssse3, gcry_cv_gcc_inline_asm_pclmul) + (gcry_cv_gcc_inline_asm_shaext, gcry_cv_gcc_inline_asm_sse41) + (gcry_cv_gcc_inline_asm_avx, gcry_cv_gcc_inline_asm_avx2) + (gcry_cv_gcc_inline_asm_bmi2, gcry_cv_gcc_amd64_platform_as_ok) + (gcry_cv_gcc_platform_as_ok_for_intel_syntax) + (gcry_cv_cc_arm_arch_is_v6, gcry_cv_gcc_inline_asm_neon) + (gcry_cv_gcc_inline_asm_aarch32_crypto) + (gcry_cv_gcc_inline_asm_aarch64_neon) + (gcry_cv_gcc_inline_asm_aarch64_crypto) + (gcry_cv_cc_ppc_altivec, gcry_cv_gcc_inline_asm_ppc_altivec) + (gcry_cv_gcc_inline_asm_ppc_arch_3_00): Check for "try_asm_modules". + * mpi/config.links: Set "mpi_cpu_arch" to "disabled" + with --disable-asm. + +2020-06-05 Dmitry Eremin-Solenikov + + mpicalc: fix typo. + + commit 2dd3e27fc53cf408f799d2e7b379c1441e0d62c8 + * src/mpicalc.c (print_help): fix typo in commands description. + +2020-06-04 NIIBE Yutaka + + mpi: Fix flags in mpi_copy for opaque MPI. + + commit 78a5a1aa7627afaa24e2ea1eb9b08f1cfdd71561 + * mpi/mpiutil.c (_gcry_mpi_copy): Copy flags. + +2020-06-03 NIIBE Yutaka + + ecc: Use opaque MPI for 'd' of Ed25519/EdDSA. + + commit 0d8346f84a1f5865da3375ce92420d92fb5ae652 + * cipher/ecc-curves.c (mpi_ec_setup_elliptic_curve): Add FLAGS. + Use opaque MPI for Ed25519/EdDSA, too. + (_gcry_mpi_ec_internal_new): Follow the change. + (_gcry_mpi_ec_new): Likewise. + +2020-06-01 Jussi Kivilinna + + cipher-ocb: fix out-of-array stack memory access. + + commit 8cfaeae42522778052c36fceccab504826a30cbf + * cipher/cipher-ocb.c (bit_copy): Do not access memory beyond + 's' array when bitoff > 8. + +2020-06-01 NIIBE Yutaka + + mpi: More fix of off-by-one mistake mpi_invm_pow2. + + commit 6a2cd0fe78a9cdc78911694a84b08762dd8658b4 + * mpi/mpi-inv.c (mpi_invm_pow2): Avoid out-of-band read/write. + + ecc: Consistently handle parameters as unsigned value. + + commit 6f8b1d4cb798375e6d830fd6b73c71da93ee5f3f + * cipher/ecc-curves.c (_gcry_ecc_get_curve): Parse as unsigned value. + +2020-05-27 NIIBE Yutaka + + sexp: Fix coding of line break. + + commit 33c972b6a6fe79aacb0a732d1df9a9deacafca29 + * src/sexp.c (_gcry_sexp_vextract_param): Add missing newline. + +2020-05-14 NIIBE Yutaka + + ecc: Make sure it's the fixed size bytes. + + commit eb2288f3b1f338a9aec11d559ec84bdb201960e1 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_decodepoint): Checking the size + of EC point representation, return GPG_ERR_INV_OBJ if not valid. + +2020-05-13 Werner Koch + + ecc: Detect the use of a Montgomery curve earlier in ecc_verify. + + commit d0f995afe2e0228d3b9e30b0fc7091631d7d0090 + * cipher/ecc.c (ecc_verify): Do not allow a Montgomery curve. + +2020-05-13 NIIBE Yutaka + + mpi: Fix off-by-one mistake mpi_invm_pow2. + + commit 69b55f87053ce2494cd4b38dc600f867bc4355be + * mpi/mpi-inv.c (mpi_invm_pow2): Avoid out-of-band read/write. + +2020-05-12 Werner Koch + + ecc: Initialize a dummy parameter. + + commit 75a7b17878e02c3882070d6c86e0d2efbc3d680a + * cipher/ecc.c (ecc_verify): Rename flags to dummy_flags and + initialize. + +2020-05-06 Dmitry Eremin-Solenikov + + tests/benchmark.c: fix error message for invalid MAC algo. + + commit 79e196a610b1b734a1f573288b148d62787f5281 + + +2020-04-27 Tianjia Zhang + + ecc: Fix typo error in ecc-gost. + + commit fe688ce7e14f14d7d3a7e16aa0304d24b5b1a179 + * cipher/ecc-gost.c (_gcry_ecc_gost_verify): Fix typo in comment. + +2020-04-27 NIIBE Yutaka + + mpi: Fix the return value of mpi_invm_generic. + + commit f10eb240a30ac115cfeb63848c67a936e1059ab9 + * mpi/mpi-inv.c (mpi_invm_generic): Return correct value. + +2020-04-24 NIIBE Yutaka + + mpi: Fix return value of mpi_invm_generic. + + commit bc3b6a6a45cf9fa6cc0556da870628c53570f52f + * mpi/mpi-inv.c (mpi_invm_generic): Return 0 if inverse does not exist. + + mpi: More use of mpih API for _gcry_mpi_invm. + + commit 559ba9b36c9cdf4762d28beb3b4c59665c671818 + * mpi/mpi-inv.c (mpi_invm_pow2): Remove. + (_gcry_mpi_invm): Use mpih_invm_pow2 instead. + + mpi: Use mpih interface internally for mpi-inv. + + commit beefbb90d71d7fbd0b4429472b7d4b39670ff64b + * mpi/mpi-inv.c (mpih_invm_pow2): Converted from mpi_invm_pow2. + (mpi_invm_pow2): Use mpih_invm_pow2. + + mpi: Fix size of A in mpi_invm_pow2. + + commit efa5151ea1c2a2c049b2651581e71b6becba4e16 + * mpi/mpi-inv.c (mpi_invm_pow2): Fix size of A. + +2020-04-23 NIIBE Yutaka + + mpi: More fix for _gcry_mpi_invm. + + commit f81a1dd7317513000e5bc4d1bfffd6d2bfb8c2a2 + * mpi/mpi-inv.c (_gcry_mpi_invm): Fix comments and use of CRT path. + +2020-04-22 NIIBE Yutaka + + mpi: Fix off-by-one mistake mpi_invm_pow2. + + commit 3bb9f74764b3626ed1116fc7e517921232d6be54 + * mpi/mpi-inv.c (mpi_invm_pow2): Fix computation of iterations. + +2020-04-21 NIIBE Yutaka + + mpi: Use mpi_invm_pow2 for mpi_invm. + + commit bac01a6cfb3d645ff8439cbd3b310d255735d792 + * mpi/mpi-inv.c (_gcry_mpi_invm): Use mpi_invm_pow2. + + mpi: Fix mpi_invm_pow2. + + commit 2a3c58a0b4db01c17da0bf8c035fb1def2af114c + * mpi/mpi-inv.c (mpi_invm_pow2): Fix the algo implementation. + +2020-04-19 Dmitry Baryshkov + + gost28147: implement special MAC mode called imitovstavka (IMIT) + + commit 45f21f871982753716d4a7676d948e8c7d644db5 + * src/gcrypt.h.in (GCRY_MAC_GOST28147_IMIT): New. + * cipher/gost28147.c (gost_imit_open, gost_imit_close) + (gost_imit_setkey, gost_imit_setiv, gost_imit_reset, _gost_imit_block) + (gost_imit_block, gost_imit_write, gost_imit_finish, gost_imit_read) + (gost_imit_verify, gost_imit_get_maclen, gost_imit_get_keylen) + (gost_imit_set_extra_info): New functions implementing GOST 28147-89 + MAC (imitovstavka, IMIT) mode. + * cipher/gost28147.c (gost_imit_ops) + (_gcry_mac_type_spec_gost28147_imit): declare GOST 28147-89 IMIT + handler. + * cipher/mac-internal.h (gcry_mac_handle): add fields to support GOST + 28147-89 IMIT mode. + * cipher/mac.c (mac_list): add _gcry_mac_type_spec_gost28147_imit. + (spec_from_algo): handle GCRY_MAC_GOST28147_IMIT. + * tests/basic.c (check_mac): add GOST28147-89 IMIT test vector. + + mac: add support for gcry_mac_ctl(GCRYCTL_SET_SBOX) + + commit d7fa70ed9ddc6e0189a8b59016b1f17717a26865 + * cipher/mac-internal.h (gcry_mac_spec_ops_t): add set_extra_info field + for providing additional settings. + * cipher/mac.c (_gcry_mac_ctl): support GCRYCTL_SET_SBOX call. + * cipher/mac-cmac.c (cmac_ops): set set_extra_info to NULL. + * cipher/mac-gmac.c (gmac_ops): the same. + * cipher/mac-hmac.c (hmac_ops): the same. + * cipher/mac-poly1305.c (poly1305mac_ops): the same. + +2020-04-17 NIIBE Yutaka + + mpi: Use mpi_invm_pow2 for N=3D2^k. + + commit 469e2fefb64e3a4bd80995935f82caf416e3a4ae + * mpi/mpi-inv.c (mpi_invm_pow2): Fix. + (_gcry_mpi_invm): Use mpi_invm_pow2. + + mpi: Rewrite mpi_invm_odd into mpih_invm_odd. + + commit 05ceac8e2f6f28f97428c005d0a318d71d7cf9d9 + * mpi/mpi-inv.c (mpih_invm_odd): Use mpi_ptr_t API. + (_gcry_mpi_invm): Use _gcry_mpih_mod and mpih_invm_odd. + + mpi: Add _gcry_mpih_cmp_ui. + + commit 128045a12139fe2e4be877df59da10c7d4857d9a + * mpi/mpih-const-time.c (_gcry_mpih_cmp_ui): New. + + mpi: Add internal functipn mpi_invm_pow2. + + commit 515bd6e9fae448e966f71e23635503716201158d + * mpi/mpi-inv.c (mpi_invm_pow2): New. + +2020-04-16 NIIBE Yutaka + + mpi: Add mpi_set_bit_cond. + + commit a91bd0211c4e5f0ce575b3a63a36049dd9edbf90 + * mpi/mpiutil.c (_gcry_mpi_set_bit_cond): New. + * src/mpi.h (mpi_set_bit_cond): New macro. + (_gcry_mpi_set_bit_cond): New. + + mpi: Add _gcry_mpih_mod. + + commit 95bdfd9ce9e114f447f3639e551e8f4f63d024fe + * mpi/mpi-internal.h (mpih_mod, _gcry_mpih_mod): New. + * mpi/mpih-const-time.c (_gcry_mpih_mod): New. + + mpih: Expose const-time MPI helper functions. + + commit 9b7e0d89006fce0641da05d8ef2696b1fb73145b + * mpi/Makefile.am (libmpi_la_SOURCES): Add mpih-const-time.c. + * mpi/ec.c (mpih_set_cond): Move to mpih-const-time.c. + * mpi/mpi-internal.h: Add macros and declarations. + * mpi/mpi-inv.c (mpih_add_n_cond): Likewise. + (mpih_sub_n_cond, mpih_swap_cond, mpih_abs_cond): Likewise. + * mpi/mpih-const-time.c: New. + +2020-04-14 Werner Koch + + sexp: Extend gcry_sexp_extract_param with a multi-string extractor. + + commit 32b08e38628b3ed409054db05a7f73b1ab86464a + * src/sexp.c (_gcry_sexp_vextract_param): Implement "%#s" control + sequence. + +2020-04-14 NIIBE Yutaka + + ecc: Remove hard-coded value for ECC_DIALECT_ED25519. + + commit 0ff36e04f7cdef961610e7bc674a9c9ef0fd4853 + * mpi/ec.c (ec_p_init): Remove special handling for Ed25519. + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_encodepoint): Fix assumption + ec->nbits is 256 for EdDSA. + (_gcry_ecc_eddsa_decodepoint): Likewise. + (_gcry_ecc_eddsa_verify): Likewise. + +2020-04-09 Werner Koch + + sexp: Extend gcry_sexp_extract_param with new format specifiers. + + commit 60c179b59e538aebb3a5f7621d92eee60b90c785 + * src/sexp.c (_gcry_sexp_vextract_param): Add new conversion methods. + * tests/t-sexp.c (check_extract_param): Add corresponding tests. + +2020-04-04 Jussi Kivilinna + + ppc: avoid using vec_vsx_ld/vec_vsx_st for 2x64-bit vectors. + + commit 1250a9cd859d99f487ca8d76a98d70d464324bbe + * cipher/crc-ppc.c (CRC_VEC_U64_LOAD, CRC_VEC_U64_LOAD_LE) + (CRC_VEC_U64_LOAD_BE): Remove vec_vsx_ld usage. + (asm_vec_u64_load, asm_vec_u64_load_le): New. + * cipher/sha512-ppc.c (vec_vshasigma_u64): Use '__asm__' instead of + 'asm' for assembly block. + (vec_u64_load, vec_u64_store): New. + (_gcry_sha512_transform_ppc8): Use vec_u64_load/store instead of + vec_vsx_ld/vec_vsx_st. + * configure.ac (gcy_cv_cc_ppc_altivec) + (gcy_cv_cc_ppc_altivec_cflags): Add check for vec_vsx_ld with + 'unsigned int *' pointer type. + +2020-04-02 Jussi Kivilinna + + asm-poly1305-aarch64: fix building with clang. + + commit 89b3ded8df969fe5fb31313c60419dd34d36b605 + * cipher/asm-poly1305-aarch64.h (POLY1305_BLOCK_PART25): Use correct + instruction format for right-shifting. + +2020-03-31 Daniel Kahn Gillmor + + libgcrypt.m4: Fix spelling. + + commit 6a5743469a4366b1e238d378e427442f04400950 + + + libgcrypt.m4: Fix spelling. + + commit e16e7e619183f36720d17855419860d1dc6fe3a5 + + +2020-03-20 Dmitry Baryshkov + + tests/basic: add GOST 28147 keymeshing testcase from LibreSSL testsuite. + + commit 3441f4c94c49a589c5e323b1526d2d6b5974cf2f + * tests/basic.c (check_cfb_cipher): add check for GOST 28147 CFB with + KeyMeshing enabled. + + gost28147: add support for CryptoPro key meshing per RFC 4357. + + commit dcee00adbd1c0a2cde1aeed1bb94421e81d0de3b + * cipher/gost28147.c (gost_do_set_sbox, cryptopro_key_meshing, + CryptoProMeshingKey, gost_encrypt_block_mesh): New. + (_gcry_cipher_spec_gost28147_mesh): New cipher with keymeshing, + (_gcry_cipher_spec_gost28147): Remove OIDs for this cipher should not + be selected using these OIDs (they are for CFB with keymeshing). + + * cipher/cipher.c (cipher_list, cipher_list_algo301): add + _gcry_cipher_spec_gost28147_mesh. + + * src/gcrypt.h.in (GCRY_CIPHER_GOST28147_MESH): New cipher with + keymeshing. + + * doc/gcrypt.texi (GCRY_CIPHER_GOST28147_MESH): Add definition. + + * tests/basic.c (check_gost28147_cipher, check_gost28147_cipher_basic): + Run basic tests on GCRY_CIPHER_GOST28147_MESH. + + gost: add keymeshing support per RFC 4357. + + commit 18cd3f0c473ae909cdaa5a820faef50d7670fcbb + * cipher/gost-s-box.c (gost_sbox): define if keymeshing should be + enabled or not. + (main): output whether we should enable or disable keymeshing for a + particular parameters set. + +2020-03-18 NIIBE Yutaka + + DSA,ECDSA: Fix use of mpi_invm. + + commit ada758e3019c2585213a132960613b1ac48502b8 + * cipher/dsa.c (sign): Call mpi_invm before _gcry_dsa_modify_k. + * cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_sign): Likewise. + + mpi: Constant time mpi_inv with some conditions. + + commit 20082ca965eab5665af60956c4ed72709836b1ed + * mpi/mpi-inv.c (mpih_add_n_cond, mpih_sub_n_cond, mpih_swap_cond) + (mpih_abs_cond): New. + (mpi_invm_odd): New. + (mpi_invm_generic): Rename from _gcry_mpi_invm. + (_gcry_mpi_invm): Use mpi_invm_odd for usual odd cases. + +2020-03-11 NIIBE Yutaka + + mpi: Support opaque MPI with gcry_mpi_print. + + commit b4b04ae6c2e55bc2b24efc663d1eeaa0b3613f4c + * mpi/mpicoder.c (_gcry_mpi_get_buffer): Return the bytes as-is. + +2020-03-09 Werner Koch + + mpi: Abort on division by zero also in _gcry_mpi_tdiv_qr. + + commit afbab896fa04d9481dbb9f4d01f607b12e31dcbf + * mpi/mpi-div.c (_gcry_mpi_tdiv_qr): Error out on division by zero. + +2020-02-25 NIIBE Yutaka + + build: More accurate dependency to -lgpg-error. + + commit 9b8ac13761f0407bd701e43b0a65fbada204958f + * configure.ac (LIBGCRYPT_CONFIG_LIBS): Remove DL_LIBS. + * src/libgcrypt.c.in: Distinguish static link use case. + * tests/Makefile.am: Fix use of -lgpg-error. + + build: Fix linking -ldl. + + commit c21e5d72e24e62752559f92b1825287298ae2f03 + * src/Makefile.am (libgcrypt_la_LIBADD): Add DL_LIBS. + (mpicalc_LDADD): Remove DL_LIBS. + * tests/Makefile.am (standard_ldadd): Remove DL_LIBS. + +2020-02-02 Jussi Kivilinna + + crc-ppc: fix bad register used for vector load/store assembly. + + commit b64b029318e7d0b66123015146614118f466a7a9 + * cipher/crc-ppc.c (CRC_VEC_U64_LOAD_BE): Move implementation to... + (asm_vec_u64_load_be): ...here; Add "r0" to clobber list for load + instruction when offset is not zero; Add zero offset path. + + rinjdael-aes: use zero offset vector load/store when possible. + + commit 89776d45c824032409f581e5fd1db6bf149df57f + * cipher/rijndael-ppc-common.h (asm_aligned_ld, asm_aligned_st): Use + zero offset instruction variant when input offset is constant zero. + * cipher/rijndael-ppc.c (asm_load_be_noswap) + (asm_store_be_noswap): Likewise. + + Add POWER9 little-endian variant of PPC AES implementation. + + commit 114bbc45e9717f9ad9641f64d8df8690db8da434 + * configure.ac: Add 'rijndael-ppc9le.lo'. + * cipher/Makefile.am: Add 'rijndael-ppc9le.c', 'rijndael-ppc-common.h' + and 'rijndael-ppc-functions.h'. + * cipher/rijndael-internal.h (USE_PPC_CRYPTO_WITH_PPC9LE): New. + (RIJNDAEL_context_s): Add 'use_ppc9le_crypto'. + * cipher/rijndael.c (_gcry_aes_ppc9le_encrypt) + (_gcry_aes_ppc9le_decrypt, _gcry_aes_ppc9le_cfb_enc) + (_gcry_aes_ppc9le_cfb_dec, _gcry_aes_ppc9le_ctr_enc) + (_gcry_aes_ppc9le_cbc_enc, _gcry_aes_ppc9le_cbc_dec) + (_gcry_aes_ppc9le_ocb_crypt, _gcry_aes_ppc9le_ocb_auth) + (_gcry_aes_ppc9le_xts_crypt): New. + (do_setkey, _gcry_aes_cfb_enc, _gcry_aes_cbc_enc) + (_gcry_aes_ctr_enc, _gcry_aes_cfb_dec, _gcry_aes_cbc_dec) + (_gcry_aes_ocb_crypt, _gcry_aes_ocb_auth, _gcry_aes_xts_crypt) + [USE_PPC_CRYPTO_WITH_PPC9LE]: New. + * cipher/rijndael-ppc.c: Split common code to headers + 'rijndael-ppc-common.h' and 'rijndael-ppc-functions.h'. + * cipher/rijndael-ppc-common.h: Split from 'rijndael-ppc.c'. + (asm_add_uint64, asm_sra_int64, asm_swap_uint64_halfs): New. + * cipher/rijndael-ppc-functions.h: Split from 'rijndael-ppc.c'. + (CFB_ENC_FUNC, CBC_ENC_FUNC): Unroll loop by 2. + (XTS_CRYPT_FUNC, GEN_TWEAK): Tweak generation without vperm + instruction. + * cipher/rijndael-ppc9le.c: New. + + Add gcry_cipher_ctl command to allow weak keys in testing use-cases. + + commit 5beadf201312d0c649971b0c1d4c3827b434a0b5 + * cipher/cipher-internal.h (gcry_cipher_handle): Add + 'marks.allow_weak_key' flag. + * cipher/cipher.c (cipher_setkey): Do not handle weak key as error when + weak keys are allowed. + (cipher_reset): Preserve 'marks.allow_weak_key' flag on object reset. + (_gcry_cipher_ctl): Add handling for GCRYCTL_SET_ALLOW_WEAK_KEY. + * src/gcrypt.h.in (gcry_ctl_cmds): Add GCRYCTL_SET_ALLOW_WEAK_KEY. + * tests/basic.c (check_ecb_cipher): Add tests for weak key errors and + for GCRYCTL_SET_ALLOW_WEAK_KEY. + +2020-01-23 NIIBE Yutaka + + random: Fix include of config.h. + + commit e0898d0628789414da23e0526c87df1885c8b3ae + * random/random-drbg.c: Include config.h earlier. + +2020-01-22 Jussi Kivilinna + + sexp: fix cast from 'int' pointer to 'size_t' pointer. + + commit 8b31091da092e22dba78b2402c2f436bbffc1c73 + * src/sexp.c (do_vsexp_sscan): Change 'datalen' from 'int' to + 'size_t'; Remove &datalen pointer cast to 'size_t *' type. + + mpi/i386: fix DWARF CFI for _gcry_mpih_sub_n and _gcry_mpih_add_n. + + commit 5f098f7e6ceb899ac27a0a30ee036de5f1be4e3d + * mpi/i386/mpih-add1.S (_gcry_mpih_add_n) [PIC]: Adjust CFI CFA offset + when making call and restoring stack pointer. + * mpi/i386/mpih-sub1.S (_gcry_mpih_sub_n) [PIC]: Ditto. + +2020-01-22 H.J. Lu + + i386: Add _CET_ENDBR to indirect jump targets. + + commit cb9f0a2df8225eed071ae0a56265e38e9f6ff184 + * mpi/i386/mpih-add1.S (_gcry_mpih_add_n): Save and restore + %ebx if IBT is enabed. Add _CET_ENDBR to indirect jump targets + and adjust jump destination for _CET_ENDBR. + * mpi/i386/mpih-sub1.S (_gcry_mpih_sub_n): Likewise. + + amd64: Always include in cipher assembly codes. + + commit 22e577071790834f07753c42a191a568c9f2644d + * cipher/camellia-aesni-avx-amd64.S: Always include . + * cipher/camellia-aesni-avx2-amd64.S: Likewise. + * cipher/serpent-avx2-amd64.S: Likewise. + + mpi: Add .note.gnu.property section for Intel CET. + + commit 24b4d5c10a97aaf82ac7402cc3a5b429d580cd66 + * mpi/config.links: Include in . + + x86: Add .note.gnu.property section for Intel CET. + + commit 4c88c2bd2a418435506325cd53246acaaa52750c + * configure.ac: Include in for assembly + codes. + +2020-01-22 Jussi Kivilinna + + tests/basic: add vector cluttering to detect implementation bugs. + + commit 4aa8ff904262f331abbb8c988069a7029ca13502 + * src/global.c (_gcry_check_version): Fix missing newline. + * src/basic.c (ALWAYS_INLINE, CLUTTER_REGISTER_*, prepare_vector_data) + (clutter_vector_registers): New. + (progress_handler): Make static function. + (check_bulk_cipher_modes, check_one_cipher_core_reset) + (check_one_cipher_core, check_one_md, check_one_md_multi) + (check_one_md_final, check_one_mac): Clutter vector registers before + gcry_* calls to cipher/md/mac algorithms. + +2020-01-22 Marvin W + + Set vZZ.16b register to zero before use in armv8 gcm implementation. + + commit 79ed620ec46adbb08f5cea6a4865a95a436e4109 + * cipher/cipher-gcm-armv8-aarch64-ce.S + (_gcry_ghash_setup_armv8_ce_pmull): Set vZZ to zero. + +2020-01-21 Tianjia Zhang + + tests: Add basic test cases for sm2. + + commit aa9c78afa1d867bb7b9b3c695cf31a832c9419e5 + * tests/basic.c (check_pubkey): Add test cases for ecc-sm2. + + Add elliptic curve SM2 implementation. + + commit 6b55246c77089dd372eb1807808111660fd789c7 + * configure.ac (enabled_pubkey_ciphers): Add ecc-sm2. + * cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add ecc-sm2.c. + * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist, + _gcry_pk_util_preparse_sigval): Add sm2 flags. + * cipher/ecc.c: Support ecc-sm2. + * cipher/ecc-common.h: Add declarations for ecc-sm2. + * cipher/ecc-sm2.c: New. + * src/cipher.h: Define PUBKEY_FLAG_SM2. + + ecc: Simplify signature code. + + commit 8d9958910e54f3fecbab6e133c3971843f6ef310 + * cipher/ecc-gost.c (_gcry_ecc_gost_sign): Use implemented function. + * cipher/ecc.c (ecc_verify): Remove redundant code. + +2020-01-21 NIIBE Yutaka + NIIBE Yutaka + + tests: Fix check_pubkey. + + commit 95e9cee802419adf6f4b01b29d7874793004fa8d + * tests/basic.c (check_pubkey): Fix constants of pubkeys. + +2020-01-21 NIIBE Yutaka + + Avoid use of ulong in internal code. + + commit 4997139b3e83761c9af0246cec829305c3d7d13b + * configure.ac (HAVE_ULONG_TYPEDEF): Remove. + * mpi/mpi-div.c (_gcry_mpi_fdiv_r_ui): Use unsigned long. + (_gcry_mpi_divisible_ui): Likewise. + * random/rndunix.c (_gcry_rndunix_gather_random): Likewise. + * random/rndw32.c (_gcry_rndw32_gather_random_fast): Likewise. + (ADDINT): Likewise. + * random/rndw32ce.c (_gcry_rndw32ce_gather_random_fast): Likewise. + * src/mpi.h: Follow the change. + * src/types.h (HAVE_ULONG_TYPEDEF): Remove. + +2020-01-19 Jussi Kivilinna + + gcrypt.texi: fix GCRYCTL_GET_ALGO_NENCR typo. + + commit 5ebb2f0671c902863eee91cbcfc85a72be506410 + * doc/gcrypt.texi: Fix GCRYCTL_GET_ALGO_NENC to GCRYCTL_GET_ALGO_NENCR. + +2020-01-19 Tianjia Zhang + + mpi: Fix error that point not uninitialized. + + commit 7e3aac7ba49b3b6e6c5ebe7c880b5b323c423ef7 + * cipher/ecc-curves.c (mpi_ec_get_elliptic_curve): Initialize E->G poing + + ecc: Wrong flag and elements_enc fix. + + commit 43cfc1632dd3a9579a906f31cd3b6c88d242d1a5 + * cipher/ecc.c (ecc_generate): Fix wrong flag and elements_enc. + + Update .gitignore. + + commit 176a5f162acd0cfebc5517d061205681bc3658d0 + + +2020-01-16 Tianjia Zhang + + Add new curve named sm2p256v1. + + commit d154c1e9e11019980253f0a65758932cd0656470 + * cipher/ecc-curves.c (domain_parms): Add sm2p256v1 for SM2. + * tests/curves.c (N_CURVES): Update N_CURVES for SM2. + +2019-12-23 Jussi Kivilinna + + rijndael-ppc: performance improvements. + + commit 110077505acacae62cec3d09b32a084b9cee0368 + * cipher/rijndael-ppc.c (ALIGNED_LOAD, ALIGNED_STORE, VEC_LOAD_BE) + (VEC_STORE_BE): Rewrite. + (VEC_BE_SWAP, VEC_LOAD_BE_NOSWAP, VEC_STORE_BE_NOSWAP): New. + (PRELOAD_ROUND_KEYS, AES_ENCRYPT, AES_DECRYPT): Adjust to new + input parameters for vector load macros. + (ROUND_KEY_VARIABLES_ALL, PRELOAD_ROUND_KEYS_ALL) + (AES_ENCRYPT_ALL): New. + (vec_bswap32_const_neg): New. + (vec_aligned_ld, vec_aligned_st, vec_load_be_const): Rename to... + (asm_aligned_ls, asm_aligned_st, asm_load_be_const): ...these. + (asm_be_swap, asm_vperm1, asm_load_be_noswap) + (asm_store_be_noswap): New. + (vec_add_uint128): Rename to... + (asm_add_uint128): ...this. + (asm_xor, asm_cipher_be, asm_cipherlast_be, asm_ncipher_be) + (asm_ncipherlast_be): New inline assembly functions with volatile + keyword to allow manual instruction ordering. + (_gcry_aes_ppc8_setkey, aes_ppc8_prepare_decryption) + (_gcry_aes_ppc8_encrypt, _gcry_aes_ppc8_decrypt) + (_gcry_aes_ppc8_cfb_enc, _gcry_aes_ppc8_cbc_enc) + (_gcry_aes_ppc8_ocb_auth): Update to use new&rewritten helper macros. + (_gcry_aes_ppc8_cfb_dec, _gcry_aes_ppc8_cbc_dec) + (_gcry_aes_ppc8_ctr_enc, _gcry_aes_ppc8_ocb_crypt) + (_gcry_aes_ppc8_xts_crypt): Update to use new&rewritten helper + macros; Tune 8-block parallel paths with manual instruction ordering. + + rijndael-ppc: fix bad register used for vector load/store assembly. + + commit 0837d7e6be3e604c1f7b86d18c582d8aa7ed858c + * cipher/rijndael-ppc.c (vec_aligned_ld, vec_load_be, vec_aligned_st) + (vec_store_be): Add "r0" to clobber list for load/store instructions. + +2019-12-22 Jussi Kivilinna + + cipher: fix typo in error log. + + commit 5b9ea3df0dc355d77b9f061f63064614a97b8b67 + * cipher/cipher.c (_gcry_cipher_encrypt): Fix log "cipher_decrypt: ..." + to "cipher_encrypt: ...". + +2019-11-21 Dmitry Eremin-Solenikov + + gost28147: inline gost_val function to speed up code. + + commit e5c4cf0efb8fd297963e6b4392ab98c41dbad536 + * cipher/gost28147.c (gost_val): mark function as inline + + gost28147: do not use GOST28147_CONTEXT outside of GOST 28147 calculation + + commit f9894240bed36eab17fabf5aa482799b148618e2 + * cipher/gost28147.c (_gcry_gost_enc_data): remove unused context + argument + * cipher/gostr3411-94.c (GOSTR3411_CONTEXT, gostr3411_init, + do_hash_step): remove unused GOST 28147-89 context. + + gost28147: simplify internal code. + + commit d164a8e7f6829163f1279517f07b61805311f8f2 + * cipher/gost28147.c (gost_val, _gost_encrypt_data): don't use gost + context internally + * cipher/gost28147.c (gost_encrypt_block, gost_decrypt_block, + _gcry_gost_enc_data): adapt to internal changes. + + gostr3411-94: small speedup. + + commit 8f573a67d12e6d9026f1676a6dae7813105bc490 + * cipher/gostr3411-94.c (do_p): unroll loop for a small spedup + +2019-11-18 Paul Wolneykien + + ecc: update GOST2012 curves. + + commit a3a866f63e7a527fe3c053758b84d70c142f8283 + * cipher/ecc-curves.c (domain_parms): rename GOST 2012 curves to contain + curve bit size + (curve_aliases): rename curves, provide backwards-compatible + aliases, add new OIDs and two new curves. + * cipher/ecc-curves.c (curve_aliases): add new OIDs and aliases for + * tests/basic.c (check_pubkey): use new name for GOST2012 512-bit test + curve. + * tests/benchmark.c (ecc_bench): use new name for GOST2012 512-bit test + curve. + +2019-11-05 Jussi Kivilinna + + ec: fix left shift overflows on WIN64 build. + + commit bdbd032d1626dbb34e1840e5f5393524dd546a1d + * mpi/ec.c (ec_mulm_448): Cast constants to (mpi_limb_t) before + shifting left by 32. + + mpi/amd64: use SSE2 for shifting instead of MMX. + + commit 1322c6a5d1e9aa0c69a2b259aa5ec7bcf5cb5653 + * mpi/amd64/mpih-lshift.S: Convert to SSE2. + * mpi/amd64/mpih-rshift.S: Ditto. + + Add i386/SSSE3 implementation of SHA512. + + commit b52dde860963c794b12d14b0a9c5848bca7ba51e + * LICENSES: Add 'sha512-ssse3-i386.c'. + * configure.ac: Add 'sha512-ssse3-i386.lo'. + * cipher/Makefile.am: Add 'sha512-ssse3-i386.c'. + * cipher/sha512-ssse3-i386.c: New. + * cipher/sha512.c (USE_SSSE3_I386, _gcry_sha512_transform_i386_ssse3) + (do_sha512_transform_i386_ssse3): New. + (_gcry_sha512_transform_arm) [USE_SSSE3_I386]: Use i386/SSSE3 transform + function if supported by CPU. + +2019-10-28 NIIBE Yutaka + + ecc: Add Curve for X448 with ECC_DIALECT_SAFECURVE. + + commit d9c418305e1053decebefbd5a98a95f845404a09 + * cipher/ecc-curves.c (domain_parms): Add X448. + * cipher/ecc-ecdh.c (_gcry_ecc_mul_point): Support X448. + * mpi/ec.c (ec_addm_448, ec_subm_448, ec_mulm_448): New. + (ec_mul2_448, ec_pow2_448): New. + (field_table): Add for X448. + (curve448_bad_points): New. + (bad_points_table): New. + (ec_p_init): Use bad_points_table. + * tests/Makefile.am (t-x448): Add. + * tests/curves.c (N_CURVES): Update. + * tests/t-x448.c: New. + +2019-10-25 NIIBE Yutaka + + ecc: Introduce new dialect: ECC_DIALECT_SAFECURVE. + + commit 498ab6d9f2f8b0775da41553be7868e59cf4cc2e + * src/mpi.h (ECC_DIALECT_SAFECURVE): New. + * cipher/ecc-misc.c (_gcry_ecc_dialect2str): Support the new dialect. + * cipher/ecc-curves.c (mpi_ec_setup_elliptic_curve): Support opaque + MPI handling of secret 'd' for ECC_DIALECT_SAFECURVE. + * cipher/ecc.c (nist_generate_key): Support opaque secret for + ECC_DIALECT_SAFECURVE. + (test_ecdh_only_keys): Likewise. + (ecc_generate): Support native point representation for + ECC_DIALECT_SAFECURVE. + (ecc_encrypt_raw): Support opaque MPI handling of secret and + native point representation for ECC_DIALECT_SAFECURVE. + (ecc_decrypt_raw): Support native point representation for + ECC_DIALECT_SAFECURVE. + (_gcry_pk_ecc_get_sexp): Likewise. + + ecc: Make _gcry_mpi_ec_mul_point friendly to X25519 computation. + + commit 2dfedafe08ac57a87e6892d1af4d72cbb398fe40 + * mpi/ec.c (_gcry_mpi_ec_mul_point): Support scalar input as an opaque + MPI in little-endian native format. + * cipher/ecc-ecdh.c (_gcry_ecc_mul_point): Use an opaque scalar. + + pubkey: Support a method to get data as an opaque MPI. + + commit 050e0b4accfae6a49dda6b1bac52749edec5ce22 + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): Support an + opaque MPI in old style. + +2019-10-24 NIIBE Yutaka + + ecc: Support an opaque MPI handling in mpi_from_keyparam. + + commit 05a7d2f262bc5c2d108dcfa6e3d907dd895a4074 + * cipher/ecc-curves.c (mpi_from_keyparam): Add OPAQUE argument. + + ecc: Fix handling of point representation in EdDSA. + + commit 3d5a05767b84e0f781ed5dfe434adb4d4e9d2aa5 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_ensure_compact): Use + GCRYMPI_FMT_USG, since integer is defined as unsigned in SEC1. + (_gcry_ecc_eddsa_decodepoint): Likewise. + + ecc: Return an opaque MPI by _gcry_ecc_ec2os. + + commit 8fce1027c2531127dd52a8b883f34333ffd3763b + * cipher/ecc-misc.c (_gcry_ecc_ec2os): Use mpi_set_opaque instead of + _gcry_mpi_scan to make an opaque MPI. + + ecc: String constant fix. + + commit 35c1faaea2b0aee9b127d02d93158826d17eb107 + * cipher/ecc-curves.c (domain_parms): Same string length for NIST + P-521. + + ecc: Simplify _gcry_ecc_compute_public. + + commit ad8927f40169364003f72fc188ea60b295ef5e59 + * cipher/ecc-misc.c (_gcry_ecc_compute_public): Don't need G and d. + Use ec->G and ec->d. + * cipher/ecc-curves.c (_gcry_ecc_get_mpi): Follow the change. + (_gcry_ecc_get_point): Likewise. + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_compute_h_d): Don't need d, + but use ec->d. + (_gcry_ecc_eddsa_sign): Follow the change. + +2019-10-23 NIIBE Yutaka + + ecc: Use opaque MPI for _gcry_ecc_mul_point. + + commit c5a7191c1bd18292a34ad4da45d743dfac035f9a + * cipher/ecc-ecdh.c (_gcry_ecc_mul_point): Use opaque MPI for U. + + ecc: Fix _gcry_ecc_mont_decodepoint for data by old implementation. + + commit bbe15758c893dbf546416c1a6bccdad1ab000ad7 + * cipher/ecc-misc.c (_gcry_ecc_mont_decodepoint): Support data by old + implementation by opaque public key. + Fix confusion of endian, in the handling of data by normal MPI key. + + ecc: ECDH clean up for use of ec->nbits. + + commit 27e848666b4a03939b0c8db15aa6e6f79bc7db30 + * cipher/ecc-ecdh.c (_gcry_ecc_mul_point): Use ec->nbits. + * cipher/ecc.c (test_ecdh_only_keys): Likewise. + (ecc_encrypt_raw): Likewise. + (ecc_generate): Fix debug output format. + +2019-10-22 NIIBE Yutaka + + ecc: Fix key generation for ECDH. + + commit 82441bbb82903c21cd2b9b4e2d50202b14fdc24c + * cipher/ecc.c (test_ecdh_only_keys): Don't free EC here. + + ecc: Fix debug output. + + commit 6d93812aa312a92d4de2dc034bdf87c276a24b8a + * cipher/ecc-curves.c (_gcry_mpi_ec_internal_new): Fix debug output. + + ecc: Simplify using mpi_ec_t directly. + + commit 6a30a9a2cc48d2343c3e9815567dbd4bf9eec058 + * cipher/ecc-common.h (ECC_public_key, ECC_secret_key): Remove. + (_gcry_ecc_ecdsa_sign, _gcry_ecc_ecdsa_verify): Use mpi_ec_t. + (_gcry_ecc_eddsa_genkey, gcry_ecc_eddsa_sign): Likewise. + (_gcry_ecc_eddsa_verify): Likewise. + (_gcry_ecc_gost_sign, _gcry_ecc_gost_verify): Likewise. + * cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_sign): Use mpi_ec_t directly. + (_gcry_ecc_ecdsa_verify): Likewise. + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_genkey): Likewise. + (_gcry_ecc_eddsa_sign, _gcry_ecc_eddsa_verify): Likewise. + * cipher/ecc-gost.c (_gcry_ecc_gost_sign): Likewise. + (_gcry_ecc_gost_verify): Likewise. + + ecc: Fix for NBITS support. + + commit 975de38796917392e83152447c6575648a5a5ee3 + * cipher/ecc-curves.c (mpi_ec_get_elliptic_curve): Fill curve + parameters by NBITS. + (_gcry_mpi_ec_internal_new): Show "EdDSA". + + ecc: Add NAME member to struct mpi_ec_ctx_s. + + commit e921ad5b3ad093304312aca90a3c971de05cbf03 + * src/ec-context.h (struct mpi_ec_ctx_s): Add NAME. + * cipher/ecc-curves.c (mpi_ec_setup_elliptic_curve): Initialize NAME. + + ecc: Add key generation support to mpi_ec_get_elliptic_curve. + + commit 488704be6e044e23770d95344511c5a347b533c5 + * cipher/ecc-curves.c (mpi_ec_get_elliptic_curve): Handle params for + key generation. + (_gcry_mpi_ec_internal_new): Remove duplication for handling of flags. + + ecc: Consolidate with _gcry_mpi_ec_internal_new. + + commit 5415bc578080018e1cd36aa44cf5c0a9995cbafc + * cipher/ecc-ecdh.c (prepare_ec): Use _gcry_mpi_ec_internal_new. + (_gcry_ecc_mul_point): Don't need to have E of elliptic_curve_t. + * cipher/ecc.c (ecc_encrypt_raw): Use _gcry_mpi_ec_internal_new. + (ecc_decrypt_raw): Likewise. + + ecc: Support flags and debug print in _gcry_mpi_ec_internal_new. + + commit c2aa333dd88b4cd337329128a2018dd3b00f5114 + * cipher/ecc-curves.c (mpi_ec_get_elliptic_curve): Don't set *r_flags. + (_gcry_mpi_ec_internal_new): Add r_flags argument. + Parse the flag list. + Output to debug channel when DBG_CIPHER. + +2019-10-21 NIIBE Yutaka + + ecc: Add new function _gcry_mpi_ec_internal_new. + + commit c7b97ac9bdf96f5a89ae553cac12954043ab174d + * cipher/ecc-curves.c (mpi_ec_get_elliptic_curve) + (mpi_ec_setup_elliptic_curve): Factor out from _gcry_mpi_ec_new. + (_gcry_mpi_ec_internal_new): New. + (_gcry_mpi_ec_new): Rewrite using mpi_ec_get_elliptic_curve and + mpi_ec_setup_elliptic_curve. + + ecc: Simplify ecc_encrypt_raw and ecc_decrypt_raw. + + commit 10b8cc280a535f14b017106c87f2b26bb68d9489 + * cipher/ecc.c (ecc_encrypt_raw): Use elliptic_curve_t directly. + (ecc_decrypt_raw): Likewise. + + ecc: More fixes for cofactor with PUBKEY_FLAG_PARAM. + + commit 61a0518282537ad52367354c96986c3d1b698d6f + * cipher/ecc.c (ecc_check_secret_key): Support "h" in KEYPARMS. + (ecc_sign, ecc_verify, ecc_encrypt_raw, ecc_decrypt_raw): Likewise. + + ecc: Simply use unsigned int for cofactor, not MPI. + + commit a258ae728de62607b3ef4eca940cfbcf9965fa5f + * cipher/ecc-common.h (elliptic_curve_t): Use unsigned int for H. + * src/ec-context.h (struct mpi_ec_ctx_s): Ditto. + * cipher/ecc-curves.c (ecc_domain_parms_t): Ditto. + (domain_parms): Update for the cofactors. + (_gcry_ecc_fill_in_curve): H is no longer MPI, but unsigned int. + (_gcry_ecc_get_curve): Remove handling for H. + (_gcry_mpi_ec_new): In KEYPARM, cofactor is still MPI. + (_gcry_ecc_get_param_sexp): H is no longer MPI, but unsigned int. + (_gcry_ecc_get_mpi): Keep the API, returning MPI for "h". + (_gcry_ecc_set_mpi): Likewise. + * cipher/ecc-ecdh.c (_gcry_ecc_mul_point): Fix for unsigned int. + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_genkey): Likewise. + * cipher/ecc-misc.c (_gcry_ecc_curve_free): Likewise. + * cipher/ecc.c (nist_generate_key, test_ecdh_only_keys): Likewise. + (test_ecdh_only_keys, ecc_generate, ecc_check_secret_key): Likewise. + (ecc_sign, ecc_verify, ecc_encrypt_raw, ecc_decrypt_raw): Likewise. + (_gcry_pk_ecc_get_sexp): Likewise. + * mpi/ec.c (ec_deinit): Likewise. + +2019-10-18 NIIBE Yutaka + + ecc: Simplify compute_keygrip. + + commit 579d5d6017d63b5eabec588b24d1a22566455bac + * cipher/ecc-curves.c (_gcry_ecc_update_curve_param): Remove H. + * cipher/ecc.c (compute_keygrip): Don't get H, since it's not + used in the computation. + + ecc: Clean up key generation code. + + commit 95cc9b8f4483fd7edfc7555199f6a05cfa68a236 + * cipher/ecc.c (test_ecdh_only_keys): No need to make PK by SK. + +2019-10-14 Jussi Kivilinna + + Fix building t-lock for WIN32. + + commit 7e1383cfd43fdc2b6f743e6a1304f0f0b2142847 + * tests/t-lock.c (external_lock_test_init, external_lock_test_lock) + (externel_lock_test_unlock, external_lock_test_destroy) + (nonce_thread, get_rand, pick_account, pick_value, revision_thread) + (accountant_thread): Build also if _WIN32 defined in addition to + HAVE_PTHREAD. + + hash-common: avoid integer division to reduce call overhead. + + commit f9d8b5a0369cc94e125d36d9c8864d5cd2eaa1d2 + * cipher/hash-common.h (gcry_md_block_ctx): Replace 'blocksize' with + 'blocksize_shift'. + * cipher/hash-common.c (_gcry_md_block_write): Use bit-level operations + instead of division to get number of blocks. + * cipher/gostr2411-94.c (gost3411_init): Initialize 'blocksize_shift' + instead of 'blocksize'. + * cipher/md2.c (md2_init): Ditto. + * cipher/md4.c (md4_init): Ditto. + * cipher/md5.c (md5_init): Ditto. + * cipher/rmd160.c (rmd160_init): Ditto. + * cipher/sha1.c (sha1_init): Ditto. + * cipher/sha256.c (sha256_common_init): Ditto. + * cipher/sha512.c (sha512_init_common): Ditto. + * cipher/sm3.c (sm3_init): Ditto. + * cipher/stribog.c (stribog_init_512): Ditto. + * cipher/tiger.c (do_init): Ditto. + * cipher/whirlpool.c (whirlpool_init): Ditto. + +2019-10-11 NIIBE Yutaka + + ecc: Handle ephemeral key as opaque octets. + + commit ff0f1782560eb45458d9a8dd97088dabeddb34e7 + * cipher/ecc.c (ecc_decrypt_raw): Extract an ephemeral key + as opaque octets. + +2019-10-10 NIIBE Yutaka + + ecc: Consolidate encoding a point for Montgomery curve. + + commit 80cf289905ace9f174eb06d7f55f38980f7e4dbd + * cipher/ecc-common.h (_gcry_ecc_mont_encodepoint): New. + * cipher/ecc-misc.c (_gcry_ecc_mont_encodepoint): New. + * cipher/ecc.c (ecc_generate): Use _gcry_ecc_mont_encodepoint. + (ecc_encrypt_raw, ecc_decrypt_raw, _gcry_pk_ecc_get_sexp): Likewise. + +2019-10-09 NIIBE Yutaka + + ecc: More clean-up for Ed25519 and Curve25519. + + commit ba0b31f2636632b1b39ebd2202de3ba5d60588b8 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_ensure_compact): Fix calc for + bytes. + * cipher/ecc.c (ecc_encrypt_raw): Use public key as opaque byte-string + with "/q" for both cases, since it is always fixed size with a prefix. + (compute_keygrip): Likewise. + Fix hard-coded value of 256 for Ed25519. + Handle Curve25519 differently. + +2019-10-08 NIIBE Yutaka + + ecc: Fix hard-coded value for 25519 to allow other modern curves. + + commit d66a4856eb0c39823bf3414b3ca4cf6322f32aef + * cipher/ecc.c (nist_generate_key): Support other modern curves. + (test_ecdh_only_keys): Likewise. + (check_secret_key): Don't use ECC_DIALECT_ED25519 for the check. + (_gcry_pk_ecc_get_sexp): Support Montgomery curve. + + ecc: Clean up for decoding point. + + commit 254c5279058f0aea2d3568d6e756002242e82f8f + * cipher/ecc-curves.c (point_from_keyparam): Possibly supporting + Montgomery curve, use _gcry_mpi_ec_decode_point. + (_gcry_ecc_set_mpi): Likewise. + * cipher/ecc.c (ecc_check_secret_key): Likewise. + + random: Clean up unused old internal API. + + commit 6e57242c61bca38b3cc8fdf424b5667ab953e4cd + * random/random.h (_gcry_get_random_bits): Remove. + +2019-10-02 NIIBE Yutaka + + ecc: Fix regression in keygrip computation for cv25519 (2). + + commit 1cfe2329b91cc7be30f7c3a14fc634ec89a1be96 + * cipher/ecc-curves.c (_gcry_ecc_fill_in_curve): Recover g_y + for Curve25519. + +2019-09-28 Werner Koch + + ecc: Fix regression in keygrip computation for cv25519. + + commit f67b6492e0b0a2a661cd53a08b20f23e6e3f9f89 + * cipher/ecc-curves.c (domain_parms): Revert g_y for cv25519. + * tests/keygrip.c: Add test case for cv25519. + +2019-09-24 Jussi Kivilinna + + Add stitched ChaCha20-Poly1305 ARMv8/AArch64 implementation. + + commit 4bebafb7bae8343f543728937caf7d3453c88b7c + * cipher/Makefile.am: Add 'asm-poly1305-aarch64.h'. + * cipher/asm-poly1305-aarch64.h: New. + * cipher/chacha20-aarch64.S (ROT8, _, ROTATE2_8): New. + (ROTATE2): Add interleave operator. + (QUARTERROUND2): Add interleave operators; Use ROTATE2_8. + (chacha20_data): Rename to... + (_gcry_chacha20_aarch64_blocks4_data_inc_counter): ...to this. + (_gcry_chacha20_aarch64_blocks4_data_rot8): New. + (_gcry_chacha20_aarch64_blocks4): Preload ROT8; Fill empty parameters + for QUARTERROUND2 interleave operators. + (_gcry_chacha20_poly1305_aarch64_blocks4): New. + * cipher/chacha20.c + [USE_AARCH64_SIMD] (_gcry_chacha20_poly1305_aarch64_blocks4): New. + (_gcry_chacha20_poly1305_encrypt, _gcry_chacha20_poly1305_decrypt) + [USE_AARCH64_SIMD]: Use stitched implementation if ctr->use_neon is + set. + +2019-09-22 Jussi Kivilinna + + Small tweak for PowerPC Chacha20-Poly1305 round loop. + + commit 96b91e164160dfbd913aefe258f472d386f5b642 + * cipher/chacha20-ppc.c (_gcry_chacha20_poly1305_ppc8_block4): Use + inner/outer round loop structure instead of two separate loops for + stitched and non-stitched parts. + + Reduce size of x86-64 stitched Chacha20-Poly1305 implementations. + + commit 664370ea02df883d16db1ffdd9ada023335b0f63 + * cipher/chacha20-amd64-avx2.c + (_gcry_chacha20_poly1305_amd64_avx2_blocks8): De-unroll round loop. + * cipher/chacha20-amd64-ssse3.c + (_gcry_chacha20_poly1305_amd64_ssse3_blocks4): + (_gcry_chacha20_poly1305_amd64_ssse3_blocks1): Ditto. + +2019-09-16 Jussi Kivilinna + + Add PowerPC extra CFLAGS also for chacha20-ppc and crc-ppc. + + commit 5516072451d46be8827455afff840eb6d49155fb + * cipher/Makefile.am: Add 'ppc_vcrypto_cflags' for chacha20-ppc.o/.lo + and crc-ppc.o/.lo. + +2019-09-15 Jussi Kivilinna + + Add PowerPC vpmsum implementation of CRC. + + commit 0486b85bd1fb65013e77f858cae9ea4530f868df + * cipher/Makefile.am: Add 'crc-ppc.c'. + * cipher/crc-armv8-ce.c: Remove 'USE_INTEL_PCLMUL' comment. + * cipher/crc-ppc.c: New. + * cipher/crc.c (USE_PPC_VPMSUM): New. + (CRC_CONTEXT): Add 'use_vpmsum'. + (_gcry_crc32_ppc8_vpmsum, _gcry_crc24rfc2440_ppc8_vpmsum): New. + (crc32_init, crc24rfc2440_init): Add HWF check for 'use_vpmsum'. + (crc32_write, crc24rfc2440_write): Add 'use_vpmsum' code-path. + * configure.ac: Add 'vpmsumd' instruction to PowerPC VSX inline + assembly check; Add 'crc-ppc.lo'. + + Add PowerPC vector implementation of ChaCha20. + + commit 557702f0d53a7ad1cf2ce0333c9df799a8abad59 + * cipher/Makefile.am: Add 'chacha20-ppc.c'. + * cipher/chacha20-ppc.c: New. + * cipher/chacha20.c (USE_PPC_VEC, _gcry_chacha20_ppc8_blocks4) + (_gcry_chacha20_ppc8_blocks1, USE_PPC_VEC_POLY1305) + (_gcry_chacha20_poly1305_ppc8_blocks4): New. + (CHACHA20_context_t): Add 'use_ppc'. + (chacha20_blocks, chacha20_keysetup) + (do_chacha20_encrypt_stream_tail): Add USE_PPC_VEC code. + (_gcry_chacha20_poly1305_encrypt, _gcry_chacha20_poly1305_decrypt): Add + USE_PPC_VEC_POLY1305 code. + * configure.ac: Add 'chacha20-ppc.lo'. + * src/g10lib.h (HWF_PPC_ARCH_2_07): New. + * src/hwf-ppc.c (PPC_FEATURE2_ARCH_2_07): New. + (ppc_features): Add HWF_PPC_ARCH_2_07. + * src/hwfeatures.c (hwflist): Add 'ppc-arch_2_07'. + +2019-09-06 Jussi Kivilinna + + poly1305: add fast addition macro for ppc64. + + commit 0564757b934d24c7fef10df8594099985fbbc0ac + * cipher/poly1305.c [USE_MPI_64BIT && __powerpc__] (ADD_1305_64): New. + +2019-09-03 Jussi Kivilinna + + Add SHA-512 implementations for POWER8 and POWER9. + + commit 93632f1adf57f142e5d9e9653c405f2ca8c601c0 + * cipher/Makefile.am: Add 'sha512-ppc.c'; Add extra CFLAG handling for + 'sha512-ppc.c'. + * cipher/sha512-ppc.c: New. + * cipher/sha512.c (USE_PPC_CRYPTO, _gcry_sha512_transform_ppc8) + (_gcry_sha512_transform_ppc9, do_sha512_transform_ppc8) + (do_sha512_transform_ppc9): New. + (sha512_init_common): Add PowerPC HW feature detection and + implementation selection. + * configure.ac: Add 'vshasigmad' instruction to PowerPC assembly + support check; Add 'sha512-ppc.lo'. + +2019-08-31 Jussi Kivilinna + + Add SHA-256 implementations for POWER8 and POWER9. + + commit e19dc973bc8e2a0ce92dd87515df3ee338265a8d + * cipher/Makefile.am: Add 'sha256-ppc.c'; Add extra CFLAG handling for + 'sha256-ppc.c'. + * cipher/sha256-ppc.c: New. + * cipher/sha256.c (USE_PPC_CRYPTO, _gcry_sha256_transform_ppc8) + (_gcry_sha256_transform_ppc9, do_sha256_transform_ppc8) + (do_sha256_transform_ppc9): New. + (sha256_init, sha224_init): Split common part to new function named... + (sha256_common_init): ...this; Add PowerPC HW feature detection and + implementation selection. + * configure.ac: Add 'vshasigmaw' instruction to PowerPC assembly + support check; Add 'sha256-ppc.lo'. + +2019-08-26 Jussi Kivilinna + + hwf-ppc: add detection for PowerISA 3.00. + + commit 418179593080f3028426657c4ef1941cdad85513 + * src/g10lib.h (HWF_PPC_ARCH_3_00): New. + * src/hwf-ppc.c (feature_map_s): Remove unused 'feature_match'. + (PPC_FEATURE2_ARCH_3_00): New. + (ppc_features, get_hwcap): Add PowerISA 3.00. + * src/hwfeatures.c (hwflist): Rename "ppc-crypto" to "ppc-vcrypto"; Add + "ppc-arch_3_00". + + rijndael-ppc: add bulk modes for CBC, CFB, CTR and XTS. + + commit 81d555d3473016eb9382fb1df153ba1effbbe32e + * cipher/rijndael-ppc.c (vec_add_uint128, _gcry_aes_ppc8_cfb_enc) + (_gcry_aes_ppc8_cfb_dec, _gcry_aes_ppc8_cbc_enc) + (_gcry_aes_ppc8_cbc_dec, _gcry_aes_ppc8_ctr_enc) + (_gcry_aes_ppc8_xts_crypt): New. + * cipher/rijndael.c [USE_PPC_CRYPTO] (_gcry_aes_ppc8_cfb_enc) + (_gcry_aes_ppc8_cfb_dec, _gcry_aes_ppc8_cbc_enc) + (_gcry_aes_ppc8_cbc_dec, _gcry_aes_ppc8_ctr_enc) + (_gcry_aes_ppc8_xts_crypt): New. + (do_setkey, _gcry_aes_cfb_enc, _gcry_aes_cfb_dec, _gcry_aes_cbc_enc) + (_gcry_aes_cbc_dec, _gcry_aes_ctr_enc) + (_gcry_aes_xts_crypto) [USE_PPC_CRYPTO]: Enable PowerPC AES + CFB/CBC/CTR/XTS bulk implementations. + * configure.ac (gcry_cv_gcc_inline_asm_ppc_altivec): Add 'vadduwm' + instruction. + + rijndael-ppc: add bulk mode for ocb_auth. + + commit bd1367bb607846d582ad09ded6c4ce4be4e52778 + * cipher/rijndael-ppc.c (_gcry_aes_ppc8_ocb_auth): New. + * cipher/rijndael.c [USE_PPC_CRYPTO] (_gcry_aes_ppc8_ocb_auth): New + prototype. + (do_setkey, _gcry_aes_ocb_auth) [USE_PPC_CRYPTO]: Add PowerPC AES + ocb_auth. + + rijndael-ppc: enable PowerPC AES-OCB implemention. + + commit 821602c60c7d144c978c335f91ae1641cf668df5 + * cipher/rijndael-ppc.c (ROUND_KEY_VARIABLES, PRELOAD_ROUND_KEYS) + (AES_ENCRYPT, AES_DECRYPT): New. + (_gcry_aes_ppc8_prepare_decryption): Rename to... + (aes_ppc8_prepare_decryption): ... this. + (_gcry_aes_ppc8_prepare_decryption): New. + (aes_ppc8_encrypt_altivec, aes_ppc8_decrypt_altivec): Remove. + (_gcry_aes_ppc8_encrypt): Use AES_ENCRYPT macro. + (_gcry_aes_ppc8_decrypt): Use AES_DECRYPT macro. + (_gcry_aes_ppc8_ocb_crypt): Uncomment; Optimizations for OCB offset + calculations, etc; Use new load/store and encryption/decryption macros. + * cipher/rijndaelc [USE_PPC_CRYPTO] (_gcry_aes_ppc8_ocb_crypt): New + prototype. + (do_setkey, _gcry_aes_ocb_crypt) [USE_PPC_CRYPTO]: Add PowerPC AES OCB + encryption/decryption. + + rijndael-ppc: add key setup and enable single block PowerPC AES. + + commit 9dca65ef71b4bdbd89a087f41f4dbba71e6d2822 + * cipher/Makefile.am: Add 'rijndael-ppc.c'. + * cipher/rijndael-internal.h (USE_PPC_CRYPTO): New. + (RIJNDAEL_context): Add 'use_ppc_crypto'. + * cipher/rijndael-ppc.c (backwards, swap_if_le): Remove. + (u128_t, ALWAYS_INLINE, NO_INLINE, NO_INSTRUMENT_FUNCTION) + (ASM_FUNC_ATTR, ASM_FUNC_ATTR_INLINE, ASM_FUNC_ATTR_NOINLINE) + (ALIGNED_LOAD, ALIGNED_STORE, VEC_LOAD_BE, VEC_STORE_BE) + (vec_bswap32_const, vec_aligned_ld, vec_load_be_const) + (vec_load_be, vec_aligned_st, vec_store_be, _gcry_aes_sbox4_ppc8) + (_gcry_aes_ppc8_setkey, _gcry_aes_ppc8_prepare_decryption) + (aes_ppc8_encrypt_altivec, aes_ppc8_decrypt_altivec): New. + (_gcry_aes_ppc8_encrypt, _gcry_aes_ppc8_decrypt): Rewrite. + (_gcry_aes_ppc8_ocb_crypt): Comment out. + * cipher/rijndael.c [USE_PPC_CRYPTO] (_gcry_aes_ppc8_setkey) + (_gcry_aes_ppc8_prepare_decryption, _gcry_aes_ppc8_encrypt) + (_gcry_aes_ppc8_decrypt): New prototypes. + (do_setkey) [USE_PPC_CRYPTO]: Add setup for PowerPC AES. + (prepare_decryption) [USE_PPC_CRYPTO]: Ditto. + * configure.ac: Add 'rijndael-ppc.lo'. + (gcry_cv_ppc_altivec, gcry_cv_cc_ppc_altivec_cflags) + (gcry_cv_gcc_inline_asm_ppc_altivec) + (gcry_cv_gcc_inline_asm_ppc_arch_3_00): New checks. + +2019-08-26 Shawn Landden + + rijndael/ppc: implement single-block mode, and implement OCB block cipher + + commit 92f38a619b1cf759057e9cd532ae7c1d0331100f + * cipher/rijndael-ppc.c: New implementation of single-block mode, and + implementation of OCB mode. + + hwf: add detection of PowerPC hardware features. + + commit b4a3c76fabfa07c10fd18b90230f60b806ad9620 + * src/Makefile.am: PowerPC hardware detection. + * src/g10lib.h: Likewise. + * src/hwf-common.h: Likewise. + * src/hwf-ppc.c: Likewise. + * src/hwfeatures.c: Likewise. + * configure.ac: Likewise. + +2019-08-20 NIIBE Yutaka + + pkgconfig: Fix libgcrypt.pc. + + commit 761d12f140b77b907087590646651d9578b68a54 + * src/libgcrypt.pc.in (Cflags, Libs): Have flags. + +2019-08-16 NIIBE Yutaka + + build: Fix build with !HAVE_PTHREAD. + + commit 900647d96cb7806cd9b2de343e4a4bd66c073fba + * tests/t-lock.c [!HAVE_PTHREAD]: Buildable now. + + ecdsa: Fix unblinding too early. + + commit cdaeb86f067b94d9dff4235ade20dde6479d9bb8 + * cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_sign): Keep the blinding until + the last step. + +2019-08-12 NIIBE Yutaka + + build: Fix testapi.c to be buildable. + + commit 376124f86097414cf1f9cbbc17af935d30064c82 + * tests/testapi.c: Fix for xgcry_control. + +2019-08-08 NIIBE Yutaka + + dsa,ecdsa: Fix use of nonce, use larger one. + + commit 7c2943309d14407b51c8166c4dcecb56a3628567 + * cipher/dsa-common.c (_gcry_dsa_modify_k): New. + * cipher/pubkey-internal.h (_gcry_dsa_modify_k): New. + * cipher/dsa.c (sign): Use _gcry_dsa_modify_k. + * cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_sign): Likewise. + * cipher/ecc-gost.c (_gcry_ecc_gost_sign): Likewise. + +2019-08-07 NIIBE Yutaka + J=C3=A1n Jan=C4=8D=C3=A1r + + ecc: Add mitigation against timing attack. + + commit b9577f7c89b4327edc09f2231bc8b31521102c79 + * cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_sign): Add the order N to K. + * mpi/ec.c (_gcry_mpi_ec_mul_point): Compute with NBITS of P or larger. + +2019-08-07 NIIBE Yutaka + + dsa,ecdsa: Allocate secure memory for RFC6979 generation. + + commit 75c2fbc43d2f2cf5f4c60cb28001fda7324185c2 + * cipher/dsa-common.c (_gcry_dsa_gen_rfc6979_k): Use secure memory + just like _gcry_dsa_gen_k does. + +2019-07-22 NIIBE Yutaka + + build: Fix previous commit. + + commit 6126fc2f180a9b61064cea5c838d2ff7e0b7774a + + + build: Use {CFLAGS,CPPFLAGS,LDFLAGS}_FOR_BUILD for helper programs. + + commit 6d80f3f12dc2ff04b0eaa3ba29ee8725b6fb4f69 + * configure.ac (CC_FOR_BUILD): Use AX_CC_FOR_BUILD. + * cipher/Makefile.am (gost-s-box): Add + {CFLAGS,CPPFLAGS,LDFLAGS}_FOR_BUILD. + * doc/Makefile.am (yat2m): Likewise. + * m4/ax_cc_for_build.m4: New. + +2019-07-18 Jussi Kivilinna + + Fix use of AVX instruction in SHA1/SSSE3 assembly. + + commit 320ed47963032aab7aadd8aefa054b9a7725c9f7 + * cipher/sha1-ssse3-amd64.S: Replace 'vmovdqa' with 'movdqa' + instruction. + +2019-07-15 Werner Koch + + sexp: Improve argument checking of sexp parser. + + commit 1c2cecbb35e1a0760121d76c327651fe7b2b791a + * src/sexp.c (do_vsexp_sscan): Check for bad length in '%b'. + +2019-07-15 NIIBE Yutaka + + tests: t-mpi-point: Remove implementation dependent checks. + + commit 8a0bde8c211c70756a2d8aa46e1bcf1f6f89e55d + * tests/t-mpi-point.c (basic_ec_math): Remove comparing X and Y, + only comparison of Z is relevant, mathematically. + Remove useless check, where different values in equivalence class + exist. + (basic_ec_math_simplified): Likewise. + +2019-06-25 NIIBE Yutaka + + sexp: Support reading base64. + + commit ab57613f10ad57d2fec648017c18d7abb189863b + * configure.ac (NEED_GPG_ERROR_VERSION): Require libgpg-error >=3D 1.27. + * src/sexp.c (do_vsexp_sscan): Support data in base64 format. + * tests/t-sexp.c (check_extract_param): Add a test case. + +2019-06-24 NIIBE Yutaka + + ecc: Correctly return an error. + + commit b4a1114dc77617f0e772ddc4faf8820399b4354a + * cipher/ecc-ecdh.c (_gcry_ecc_get_algo_keylen): Return 0 for + unknow algorithm. + (_gcry_ecc_mul_point): Return GPG_ERR_UNSUPPORTED_ALGORITHM for + GCRY_ECC_CURVE448 for now. + Return GPG_ERR_UNKNOWN_ALGORITHM, otherwise. + +2019-06-21 NIIBE Yutaka + + tests: Fix the Curve25519 test. + + commit 6934711d572e13e9e78fb2c53bb119034b088c5a + * tests/t-cv25519.c (test_cv_x25519): Initialize SCALAR. + + ecc: Improve new ECDH API. + + commit a658c9ccc2c741f40b0b5cdbcd184cfb9a841d17 + * cipher/ecc-ecdh.c (_gcry_ecc_get_algo_keylen): New. + (_gcry_ecc_mul_point): Fill into the RESULT buffer, instead of + allocating new buffer. + * src/gcrypt-int.h: Change the API. + * src/gcrypt.h.in: Likewise. + * src/libgcrypt.def (gcry_ecc_get_algo_keylen): New. + * src/libgcrypt.vers (gcry_ecc_get_algo_keylen): New. + * src/visibility.c (gcry_ecc_get_algo_keylen): New. + * src/visibility.h (gcry_ecc_get_algo_keylen): New. + * tests/t-cv25519.c: Fix the use case. + +2019-06-20 NIIBE Yutaka + + ecc: X25519 API change to allow NULL for POINT. + + commit 6d77c2054ea0358fb4c6f59b4c91c673c0a83b03 + * cipher/ecc-ecdh.c (_gcry_ecc_mul_point): Allow NULL for point, + meaning G. + + ecc: Add an API for X25519 function as gcry_ecc_mul_point. + + commit ec8c2cdf977aa8d9ca5af0a9bd25aeb9190570b3 + * configure.ac: Add ecc-ecdh.lo. + * cipher/Makefile.am: Add ecc-ecdh.c. + * cipher/ecc-common.h (reverse_buffer): Expose. + * cipher/ecc-eddsa.c (reverse_buffer): Expose. + * cipher/ecc-curves.c (domain_parms): Fix as the errata of RFC. + * cipher/ecc-ecdh.c: New. + * cipher/ecc-misc.c (_gcry_ecc_mont_decodepoint): Fix for other curves + than Curve25519. + * src/gcrypt-int.h (_gcry_ecc_mul_point): New. + * src/gcrypt.h.in (enum gcry_ecc_curves): New. + (gcry_ecc_mul_point): new. + * src/libgcrypt.def (gcry_ecc_mul_point): New. + * src/libgcrypt.vers (gcry_ecc_mul_point): New. + * src/visibility.h (gcry_ecc_mul_point): New. + * src/visibility.c (gcry_ecc_mul_point): New. + * tests/t-cv25519.c (test_cv_hl): Rename from test_cv. + (test_cv_x25519): New. + (test_cv): Call both of test_cv_hl and test_cv_x25519. + +2019-06-05 Jussi Kivilinna + + tests/basic: add CTR mode carry overflow test vectors. + + commit 971d372f512ff6805d5b8b54e9ac1446f3f66643 + * tests/basic.c (check_ctr_cipher): Change tv structure 'plaintext' + and 'out' to pointers; Add counter carry overflow test vectors; Make + temporary buffer large enough for new test vectors. + + GCM: move look-up table to .data section and unshare between processes. + + commit a4c561aab1014c3630bc88faf6f5246fee16b020 + * cipher/cipher-gcm.c (ATTR_ALIGNED_64): New. + (gcmR): Move to 'gcm_table' structure. + (gcm_table): New structure for look-up table with counters before and + after. + (gcmR): New macro. + (prefetch_table): Handle input with length not multiple of 256. + (do_prefetch_tables): Modify pre- and post-table counters to unshare + look-up table pages between processes. + + AES: move look-up tables to .data section and unshare between processes. + + commit daedbbb5541cd8ecda1459d3b843ea4d92788762 + * cipher/rijndael-internal.h (ATTR_ALIGNED_64): New. + * cipher/rijndael-tables.h (encT): Move to 'enc_tables' structure. + (enc_tables): New structure for encryption table with counters before + and after. + (encT): New macro. + (dec_tables): Add counters before and after encryption table; Move + from .rodata to .data section. + (do_encrypt): Change 'encT' to 'enc_tables.T'. + (do_decrypt): Change '&dec_tables' to 'dec_tables.T'. + * cipher/cipher-gcm.c (prefetch_table): Make inline; Handle input + with length not multiple of 256. + (prefetch_enc, prefetch_dec): Modify pre- and post-table counters + to unshare look-up table pages between processes. + +2019-05-19 Jussi Kivilinna + + cipher/Makefile.am: add '-fcoverage-*' to instrumentation munging. + + commit c6ffa216976d80a13486b13f64d6776cdb8b6ccf + * cipher/Makefile.am: Remove '-fcoverage-*' flag for mixed asm/C + i386+amd64 implementations. + +2019-05-15 Jussi Kivilinna + + md: fix UBSAN warning. + + commit dad94696d9c48c18b59576776c7caa95123dfa1b + * cipher/md.c (gcry_md_list): Define 'context' as array of + PROPERLY_ALIGNED_TYPE. + (md_enable, _gcry_md_reset, _gcry_md_close, md_final, md_set_key) + (prepare_macpads, md_read, md_extract): Access md context through + 'gcry_md_list->context' pointer instead of 'gcry_md_list->context.c'. + + Disable instrumentation on mixed Intel SSE C/assembly implementations. + + commit d24dae4538dbbda9e6c72a34fae69682cfb2fef0 + * cipher/Makefile.am: Make 'tiger.o' and 'tiger.lo' depend on Makefile; + Add instrumentation option munging. + * cipher/cipher-gcm-intel-pcmul.c (ALWAYS_INLINE) + (NO_INSTRUMENT_FUNCTION, ASM_FUNC_ATTR, ASM_FUNC_ATTR_INLINE): New. + (reduction, gfmul_pclmul, gfmul_pclmul_aggr4, gfmul_pclmul_aggr8) + (gcm_lsh): Define with 'ASM_FUNC_ATTR_INLINE' instead of 'inline'. + (_gcry_ghash_setup_intel_pclmul, _gcry_ghash_intel_pclmul): Define with + 'ASM_FUNC_ATTR'. + * cipher/crc-intel-pcmul.c (ALWAYS_INLINE, NO_INSTRUMENT_FUNCTION) + (ASM_FUNC_ATTR, ASM_FUNC_ATTR_INLINE): New. + (crc32_reflected_bulk, crc32_reflected_less_than_16, crc32_bulk) + (crc32_less_than_16): Define with 'ASM_FUNC_ATTR_INLINE' instead of + 'inline'. + (_gcry_crc32_intel_pclmul, _gcry_crc24rfc2440_intel_pclmul): Define + with 'ASM_FUNC_ATTR'. + * cipher/rijndael-aesni.c (NO_INSTRUMENT_FUNCTION, ASM_FUNC_ATTR) + (ASM_FUNC_ATTR_INLINE, ASM_FUNC_ATTR_NOINLINE): New. + (aes_ocb_get_l, do_aesni_prepare_decryption, do_aesni_enc) + (do_aesni_dec, do_aesni_enc_vec4, do_aesni_dec_vec4, do_aesni_enc_vec8) + (do_aesni_dec_vec8, aesni_ocb_checksum): Define with + 'ASM_FUNC_ATTR_INLINE' instead of 'inline'. + (do_aesni_ctr, do_aesni_ctr_4, do_aesni_ctr_8): Define wtih + 'ASM_FUNC_ATTR_INLINE'. + (aesni_ocb_enc, aesni_ocb_dec): Define with 'ASM_FUNC_ATTR_NOINLINE' + instead of 'NO_INLINE'. + (_gcry_aes_aesni_do_setkey, _gcry_aes_aesni_prepare_decryption) + (_gcry_aes_aesni_encrypt, _gcry_aes_aesni_cfg_enc) + (_gcry_aes_aesni_cbc_enc, _gcry_aes_aesni_ctr_enc) + (_gcry_aes_aesni_decrypt, _gcry_aes_aesni_cfb_dec) + (_gcry_aes_aesni_cbc_dec, _gcry_aes_aesni_ocb_crypt) + (_gcry_aes_aesni_ocb_auth, _gcry_aes_aesni_xts_enc) + (_gcry_aes_aesni_xts_dec, _gcry_aes_aesni_xts_crypt): Define with + 'ASM_FUNC_ATTR'. + * cipher/rijndael-ssse3-amd64.c (ALWAYS_INLINE, NO_INSTRUMENT_FUNCTION) + (ASM_FUNC_ATTR, ASM_FUNC_ATTR_INLINE): New. + (aes_ocb_get_l, do_ssse3_prepare_decryption, do_vpaes_ssse3_enc) + (do_vpaes_ssse3_dec): Define with 'ASM_FUNC_ATTR_INLINE' instead of + 'inline'. + (_gcry_aes_ssse3_do_setkey, _gcry_aes_ssse3_prepare_decryption) + (_gcry_aes_ssse3_encrypt, _gcry_aes_ssse3_cfb_enc) + (_gcry_aes_ssse3_cbc_enc, _gcry_aes_ssse3_ctr_enc) + (_gcry_aes_ssse3_decrypt, _gcry_aes_ssse3_cfb_dec) + (_gcry_aes_ssse3_cbc_dec, ssse3_ocb_enc, ssse3_ocb_dec) + (_gcry_aes_ssse3_ocb_crypt, _gcry_aes_ssse3_ocb_auth): Define with + 'ASM_FUNC_ATTR'. + * cipher/sha1-intel-shaext.c (NO_INSTRUMENT_FUNCTION) + (ASM_FUNC_ATTR): New. + (_gcry_sha1_transform_intel_shaext): Define with 'ASM_FUNC_ATTR'. + * cipher/sha256-intel-shaext.c (NO_INSTRUMENT_FUNCTION) + (ASM_FUNC_ATTR): New. + (_gcry_sha256_transform_intel_shaext): Define with 'ASM_FUNC_ATTR'. + * configure.ac (ENABLE_INSTRUMENTATION_MUNGING): New. + + tests/basic: fix signed interger overflow. + + commit 3c7ff6bd1c40d5216d6c12b6b28f77fd1a57baa7 + * tests/basic.c (check_ocb_cipher_largebuf_split): Cast to unsigned + when generating buffer values. + +2019-05-14 Jussi Kivilinna + + tests: do not use GCC variadic macro extension for xgcry_control. + + commit be567cb5dd629e9aa22d81b29d4326e5aa97efa7 + * tests/t-common.h (xgcry_control): Use doubly nested parenthesis for + passing arguments for gcry_control instead of GCC specific variadic + macro extension. + * tests/aeswrap.c: Change xgcry_control to use doubly nested + parenthesis. + * tests/basic.c: Ditto. + * tests/bench-slope.c: Ditto. + * tests/benchmark.c: Ditto. + * tests/curves.c: Ditto. + * tests/dsa-rfc6979.c: Ditto. + * tests/fips186-dsa: Ditto. + * tests/fipsdrv.c: Ditto. + * tests/fipsrngdrv.c: Ditto. + * tests/gchash.c: Ditto. + * tests/hashtest.c: Ditto. + * tests/hmac.c: Ditto. + * tests/keygen.c: Ditto. + * tests/keygrip.c: Ditto. + * tests/mpitests.c: Ditto. + * tests/pkbench.c: Ditto. + * tests/pkcs1v2.c: Ditto. + * tests/prime.c: Ditto. + * tests/pubkey.c: Ditto. + * tests/random.c: Ditto. + * tests/rsacvt.c: Ditto. + * tests/t-convert.c: Ditto. + * tests/t-cv25519.c: Ditto. + * tests/t-ed25519.c: Ditto. + * tests/t-kdf.c: Ditto. + * tests/t-lock.c: Ditto. + * tests/t-mpi-bit.c: Ditto. + * tests/t-mpi-point.c: Ditto. + * tests/t-secmem.c: Ditto. + * tests/t-sexp.c: Ditto. + * tests/version.c: Ditto. + +2019-05-10 Jussi Kivilinna + + tests/basic: mark CFB and CFB8 as stream block cipher modes. + + commit 34e9306a66b47785ddbab6594ae4c23581d35b5a + * tests/basic.c (get_algo_mode_blklen): Return '1' for CFB and CFB8. + +2019-05-09 Jussi Kivilinna + + Fix message digest final function for MD4, MD5 and RMD160. + + commit 15592cd52f543aadb2fab8f6c112c68075309ad6 + * cipher/md4.c (md4_final): Use buffer offset '64 + 56' for bit count + on 'need one extra block' path. + * cipher/md5.c (md5_final): Ditto. + * cipher/rmd160.c (rmd160_final): Ditto. + * tests/basic.c (check_one_md_final): New. + (check_digest): Add new '*' test vectors and handle them with + check_one_md_final. + +2019-05-06 Dmitry Eremin-Solenikov + + Fix carry overflow in Stribog in 512-bit addition. + + commit da6cd4fea30f79cf9d8f9b2f1c6daf3aea39fa9c + * cipher/stribog.c (transform_bits): properly calculate carry flag + * tests/basic.c (check_digests): add two more test cases + +2019-04-27 Jussi Kivilinna + + Add support for explicit_memset. + + commit 71b0eb3fb75d2e6bbd86df055dc667b2debab0c1 + * configure.ac: Add function check for 'explicit_memset'. + * src/misc.c (_gcry_fast_wipememory, _gcry_fast_wipememory2): Use + explicit_memset if available. + + Fix CFI_PUSH/CFI_POP redefine build warning with AMD64 MPI. + + commit 78b1047eded8d5f8a13162d13160fce1809f6ee4 + * mpi/amd64/func_abi.h: Move CFI macros into [__x86_64__] block. + * mpi/i386/syntax.h: Move CFI macros into [__i386__] block. + + Enable four block aggregated GCM Intel PCLMUL implementation on i386. + + commit a6e7c411e5f67a9473675ca8d49017a4d13a8d3e + * cipher/cipher-gcm-intel-pclmul.c (reduction): Change "%%xmm7" to + "%%xmm5". + (gfmul_pclmul_aggr4): Move outside [__x86_64__] block; Remove usage of + XMM8-XMM15 registers; Do not preload H-values and be_mask to reduce + register usage for i386. + (_gcry_ghash_setup_intel_pclmul): Enable calculation of H2, H3 and H4 + on i386. + (_gcry_ghash_intel_pclmul): Adjust to above gfmul_pclmul_aggr4 + changes; Move 'aggr4' code path outside [__x86_64__] block. + + Prefetch GCM look-up tables. + + commit 1374254c2904ab5b18ba4a890856824a102d4705 + * cipher/cipher-gcm.c (prefetch_table, do_prefetch_tables) + (prefetch_tables): New. + (ghash_internal): Call prefetch_tables. + + Optimizations for generic table-based GCM implementations. + + commit ecd02cdd61e8c690f48637656f0e1e08b750fe30 + * cipher/cipher-gcm.c [GCM_TABLES_USE_U64] (do_fillM): Precalculate + M[32..63] values. + [GCM_TABLES_USE_U64] (do_ghash): Split processing of two 64-bit halfs + of the input to two separate loops; Use precalculated M[] values. + [GCM_USE_TABLES && !GCM_TABLES_USE_U64] (do_fillM): Precalculate + M[64..127] values. + [GCM_USE_TABLES && !GCM_TABLES_USE_U64] (do_ghash): Use precalculated + M[] values. + [GCM_USE_TABLES] (bshift): Avoid conditional execution for mask + calculation. + * cipher/cipher-internal.h (gcry_cipher_handle): Double gcm_table size. + +2019-04-26 Jussi Kivilinna + + Optimizations for GCM Intel/PCLMUL implementation. + + commit af5f3fb08674608acf6617ea622ed0b9a2ee77a5 + * cipher/cipher-gcm-intel-pclmul.c (reduction): New. + (glmul_pclmul): Include shifting to left into pclmul operations; Use + 'reduction' helper function. + [__x86_64__] (gfmul_pclmul_aggr4): Reorder instructions and adjust + register usage to free up registers; Use 'reduction' helper function; + Include shifting to left into pclmul operations; Moving load H values + and input from caller into this function. + [__x86_64__] (gfmul_pclmul_aggr8): New. + (gcm_lsh): New. + (_gcry_ghash_setup_intel_pclmul): Left shift H values to left by + one; Preserve XMM6-XMM15 registers on WIN64. + (_gcry_ghash_intel_pclmul) [__x86_64__]: Use 8 block aggregated + reduction function. + + Move data pointer macro for 64-bit ARM assembly to common header. + + commit b9be297bb8eba7a09fa8413261de1587adcfd381 + * cipher/asm-common-aarch64.h (GET_DATA_POINTER): New. + * cipher/chacha20-aarch64.S (GET_DATA_POINTER): Remove. + * cipher/cipher-gcm-armv8-aarch64-ce.S (GET_DATA_POINTER): Remove. + * cipher/crc-armv8-aarch64-ce.S (GET_DATA_POINTER): Remove. + * cipher/rijndael-armv8-aarch64-ce.S (GET_DATA_POINTER): Remove. + * cipher/sha1-armv8-aarch64-ce.S (GET_DATA_POINTER): Remove. + * cipher/sha256-armv8-aarch64-ce.S (GET_DATA_POINTER): Remove. + + Add CFI unwind assembly directives for 64-bit ARM assembly. + + commit 5a2a96a63517838e04f9fc0fb2d932fac5124b8a + * cipher/asm-common-aarch64.h (CFI_STARTPROC, CFI_ENDPROC) + (CFI_REMEMBER_STATE, CFI_RESTORE_STATE, CFI_ADJUST_CFA_OFFSET) + (CFI_REL_OFFSET, CFI_DEF_CFA_REGISTER, CFI_REGISTER, CFI_RESTORE) + (DW_REGNO_SP, DW_SLEB128_7BIT, DW_SLEB128_28BIT, CFI_CFA_ON_STACK) + (CFI_REG_ON_STACK): New. + * cipher/camellia-aarch64.S: Add CFI directives. + * cipher/chacha20-aarch64.S: Add CFI directives. + * cipher/cipher-gcm-armv8-aarch64-ce.S: Add CFI directives. + * cipher/crc-armv8-aarch64-ce.S: Add CFI directives. + * cipher/rijndael-aarch64.S: Add CFI directives. + * cipher/rijndael-armv8-aarch64-ce.S: Add CFI directives. + * cipher/sha1-armv8-aarch64-ce.S: Add CFI directives. + * cipher/sha256-armv8-aarch64-ce.S: Add CFI directives. + * cipher/twofish-aarch64.S: Add CFI directives. + * mpi/aarch64/mpih-add1.S: Add CFI directives. + * mpi/aarch64/mpih-mul1.S: Add CFI directives. + * mpi/aarch64/mpih-mul2.S: Add CFI directives. + * mpi/aarch64/mpih-mul3.S: Add CFI directives. + * mpi/aarch64/mpih-sub1.S: Add CFI directives. + * mpi/asm-common-aarch64.h: Include "../cipher/asm-common-aarch64.h". + (ELF): Remove. + + Add 64-bit ARMv8/CE PMULL implementation of CRC. + + commit 14c8a593ede42f51f567ed7ba77b53124151aa38 + * cipher/Makefile.am: Add 'crc-armv8-ce.c' and + 'crc-armv8-aarch64-ce.S'. + * cipher/asm-common-aarch64.h [HAVE_GCC_ASM_CFI_DIRECTIVES]: Add CFI + helper macros. + * cipher/crc-armv8-aarch64-ce.S: New. + * cipher/crc-armv8-ce.c: New. + * cipher/crc.c (USE_ARM_PMULL): New. + (CRC_CONTEXT) [USE_ARM_PMULL]: Add 'use_pmull'. + [USE_ARM_PMULL] (_gcry_crc32_armv8_ce_pmull) + (_gcry_crc24rfc2440_armv8_ce_pmull): New prototypes. + (crc32_init, crc32rfc1510_init, crc24rfc2440_init): Enable ARM PMULL + implementations if supported by HW features. + (crc32_write, crc24rfc2440_write) [USE_ARM_PMULL]: Use ARM PMULL + implementations if enabled. + * configure.ac: Add 'crc-armv8-ce.lo' and 'crc-armv8-aarch64-ce.lo'. + +2019-04-18 Jussi Kivilinna + + mpi: make stack unwinding work at i386 mpi functions. + + commit b878a986f3ab2c35aff89c7f66f137a91542ed5b + * mpi/i386/syntax.h: Include 'config.h'. + (CFI_STARTPROC, CFI_ENDPROC, CFI_ADJUST_CFA_OFFSET, CFI_REL_OFFSET) + (CFI_RESTORE, CFI_PUSH, CFI_POP): New. + * mpi/i386/mpih-add1.S: Add CFI directives. + * mpi/i386/mpih-lshift.S: Add CFI directives. + * mpi/i386/mpih-mul1.S: Add CFI directives. + * mpi/i386/mpih-mul2.S: Add CFI directives. + * mpi/i386/mpih-mul3.S: Add CFI directives. + * mpi/i386/mpih-rshift.S: Add CFI directives. + * mpi/i386/mpih-sub1.S: Add CFI directives. + + hwf-x86: make stack unwinding work at i386 cpuid functions. + + commit 0bd18e8bf7d67072f8c77352140b4ed4cfde3c6c + * src/hwf-x86.c (FORCE_FUNC_FRAME_POINTER): New. + [__i386__] (is_cpuid_available): Force use of stack frame pointer as + inline assembly modifies stack register; Add 'memory' constraint for + inline assembly. + [__i386__] (get_cpuid): Avoid push/pop instruction when preserving + %ebx register over cpuid. + + Limit and document Blowfish key lengths to 8-576 bits. + + commit 3546599e5578f89f9e77b08bf599f9c44b23da5f + * cipher/blowfish.c (BLOWFISH_KEY_MIN_BITS) + (BLOWFISH_KEY_MAX_BITS): New. + (do_bf_setkey): Check input key length to MIN_BITS and MAX_BITS. + * doc/gcrypt.texi: Update supported Blowfish key lengths. + * tests/basic.c (check_ecb_cipher): New, with Blowfish test vectors + for different key lengths. + (check_cipher_modes): Call 'check_ecb_cipher'. + +2019-04-16 Jussi Kivilinna + + Add CFI unwind assembly directives for AMD64 assembly. + + commit d11ae95d05dc39ec6b825d1109afadd964589880 + * configure.ac (gcry_cv_gcc_asm_cfi_directives): New. + * cipher/asm-common-amd64.h (ADD_RIP, CFI_STARTPROC, CFI_ENDPROC) + (CFI_REMEMBER_STATE, CFI_RESTORE_STATE, CFI_ADJUST_CFA_OFFSET) + (CFI_REL_OFFSET, CFI_DEF_CFA_REGISTER, CFI_REGISTER, CFI_RESTORE) + (CFI_PUSH, CFI_POP, CFI_POP_TMP_REG, CFI_LEAVE, DW_REGNO) + (DW_SLEB128_7BIT, DW_SLEB128_28BIT, CFI_CFA_ON_STACK) + (CFI_REG_ON_STACK): New. + (ENTER_SYSV_FUNCPARAMS_0_4, EXIT_SYSV_FUNC): Add CFI directives. + * cipher/arcfour-amd64.S: Add CFI directives. + * cipher/blake2b-amd64-avx2.S: Add CFI directives. + * cipher/blake2s-amd64-avx.S: Add CFI directives. + * cipher/blowfish-amd64.S: Add CFI directives. + * cipher/camellia-aesni-avx-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/camellia-aesni-avx2-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/cast5-amd64.S: Add CFI directives. + * cipher/chacha20-amd64-avx2.S: Add CFI directives. + * cipher/chacha20-amd64-ssse3.S: Add CFI directives. + * cipher/des-amd64.S: Add CFI directives. + * cipher/rijndael-amd64.S: Add CFI directives. + * cipher/rijndael-ssse3-amd64-asm.S: Add CFI directives. + * cipher/salsa20-amd64.S: Add CFI directives; Use 'asm-common-amd64.h'. + * cipher/serpent-avx2-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/serpent-sse2-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/sha1-avx-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/sha1-avx-bmi2-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/sha1-avx2-bmi2-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/sha1-ssse3-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/sha256-avx-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/sha256-avx2-bmi2-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/sha256-ssse3-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/sha512-avx-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/sha512-avx2-bmi2-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/sha512-ssse3-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/twofish-amd64.S: Add CFI directives. + * cipher/twofish-avx2-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * cipher/whirlpool-sse2-amd64.S: Add CFI directives; Use + 'asm-common-amd64.h'. + * mpi/amd64/func_abi.h: Include 'config.h'. + (CFI_STARTPROC, CFI_ENDPROC, CFI_ADJUST_CFA_OFFSET, CFI_REL_OFFSET) + (CFI_RESTORE, CFI_PUSH, CFI_POP): New. + (FUNC_ENTRY, FUNC_EXIT): Add CFI directives. + +2019-04-15 Jussi Kivilinna + + twofish-amd64: do not use xchg instruction. + + commit 0903b215ef5a18332b740a24e6e2bfbed9e1d97b + * cipher/twofish-amd64.S (g1g2_3): Swap ab and cd registers using + 'movq' instructions instead of 'xchgq'. + +2019-04-09 Jussi Kivilinna + + Use FreeBSD's elf_aux_info for detecting ARM HW features. + + commit 2ffc689d4757f31f1e2c4961b94b0b0c8dc302b7 + * configure.ac: Add function check for 'elf_aux_info'. + * src/hwf-arm.c [HAVE_ELF_AUX_INFO]: Include 'sys/auxv.h'. + [HAVE_ELF_AUX_INFO && !HAVE_GETAUXVAL] (HAVE_GETAUXVAL) + (getauxval): New. + +2019-04-08 Jussi Kivilinna + + Use getauxval system function for detecting ARM HW features. + + commit 6812a2c5bd2d9129bfdf34f3daf89cd8543ed8e5 + * configure.ac: Add header check for 'sys/auxv.h'; Add function check + for 'getauxval'. + * src/hwf-arm.c [HAVE_SYS_AUXV_H && HAVE_GETAUXVAL]: Include + 'sys/auxv.h'. + (HAS_SYS_AT_HWCAP): Enable AT_HWCAP if have 'getauxval' in addition of + __linux__. + (AT_HWCAP, AT_HWCAP2, HWCAP_NEON, HWCAP2_AES, HWCAP2_PMULL) + (HWCAP2_SHA1, HWCAP2_SHA2, HWCAP_ASIMD, HWCAP_AES) + (HWCAP_PMULL, HWCAP_SHA1, HWCAP_SHA2): Define these macros only if not + already defined. + (get_hwcap) [HAVE_SYS_AUXV_H && HAVE_GETAUXVAL]: Use 'getauxval' to + fetch HW capability flags. + + Disable SM3 in FIPS mode. + + commit 04a6c3c7482dd1ecb5113a049b1765b0d5f212fb + * cipher/sm3.h (_gcry_digest_spec_sm3): Set flags.fips to zero. + +2019-04-07 Jussi Kivilinna + + Tune SHA-512/AVX2 and SHA-256/AVX2 implementations. + + commit 478581c5107ae75281c54e56cdcef5165f3155ca + * cipher/sha256-avx2-bmi2-amd64.S (ONE_ROUND_PART1, ONE_ROUND_PART2) + (ONE_ROUND): New round function. + (FOUR_ROUNDS_AND_SCHED, FOUR_ROUNDS): Use new round function. + (_gcry_sha256_transform_amd64_avx2): Exit early if number of blocks is + zero; Writing XFER to stack earlier and handle XREF writing in + FOUR_ROUNDS_AND_SCHED. + * cipher/sha512-avx2-bmi2-amd64.S (MASK_YMM_LO, MASK_YMM_LOx): New. + (ONE_ROUND_PART1, ONE_ROUND_PART2, ONE_ROUND): New round function. + (FOUR_ROUNDS_AND_SCHED, FOUR_ROUNDS): Use new round function. + (_gcry_sha512_transform_amd64_avx2): Writing XFER to stack earlier and + handle XREF writing in FOUR_ROUNDS_AND_SCHED. + +2019-04-05 Jussi Kivilinna + + Add SHA512/224 and SHA512/256 algorithms. + + commit a3683b6f623189a4b65bb584bb9e65e3ad7b3139 + * cipher/mac-hmac.c (map_mac_algo_to_md): Add mapping for SHA512/224 + and SHA512/256. + (_gcry_mac_type_spec_hmac_sha512_256) + (_gcry_mac_type_spec_hmac_sha512_224): New. + * cipher/mac-internal.h (_gcry_mac_type_spec_hmac_sha512_256) + (_gcry_mac_type_spec_hmac_sha512_224): New. + * cipher/mac.c (mac_list, mac_list_algo101): Add SHA512/224 and + SHA512/256. + * cipher/md.c (digest_list, digest_list_algo301) + (prepare_macpads): Ditto. + * cipher/sha512.c (run_selftests): Ditto. + (sha512_init_common): Move common initialization here. + (sha512_init, sha384_init): Use common initialization function. + (sha512_224_init, sha512_256_init, _gcry_sha512_224_hash_buffer) + (_gcry_sha512_224_hash_buffers, _gcry_sha512_256_hash_buffer) + (_gcry_sha512_256_hash_buffers, selftests_sha512_224) + (selftests_sha512_256, sha512_224_asn, oid_spec_sha512_224) + (_gcry_digest_spec_sha512_224, sha512_256_asn, oid_spec_sha512_256) + (_gcry_digest_spec_sha512_256): New. + * doc/gcrypt.texi: Add SHA512/224 and SHA512/256; Add missing + HMAC-BLAKE2s and HMAC-BLAKE2b. + * src/cipher.h (_gcry_digest_spec_sha512_224) + (_gcry_digest_spec_sha512_256): New. + * src/gcrypt.h.in (GCRY_MD_SHA512_256, GCRY_MD_SHA512_224): New. + (GCRY_MAC_HMAC_SHA512_256, GCRY_MAC_HMAC_SHA512_224): New. + * tests/basic.c (check_digests): Add SHA512/224 and SHA512/256 + test vectors. + + Remove extra buffer flush at begining of digest final functions. + + commit c6055aaccac86e1ca8a9d35c980d7abbacf2a9ff + * cipher/md2.c (md2_final): Remove _gcry_md_block_write flush call + from entry. + * cipher/md4.c (md4_final): Ditto. + * cipher/md5.c (md5_final): Ditto. + * cipher/rmd160.c (rmd160_final): Ditto. + * cipher/sha1.c (sha1_final): Ditto. + * cipher/sha256.c (sha256_final): Ditto. + * cipher/sha512.c (sha512_final): Ditto. + * cipher/sm3.c (sm3_final): Ditto. + * cipher/stribog.c (stribog_final): Ditto. + * cipher/tiger.c (tiger_final): Ditto. + + Optimizations for digest final functions. + + commit e76cd0e2b1f6025c1319576a5848815d1d231aeb + * cipher/md4.c (md4_final): Avoid byte-by-byte buffer setting when + padding; Merge extra and last block processing. + * cipher/md5.c (md5_final): Ditto. + * cipher/rmd160.c (rmd160_final): Ditto. + * cipher/sha1.c (sha1_final): Ditto. + * cipher/sha256.c (sha256_final): Ditto. + * cipher/sm3.c (sm3_final): Ditto. + * cipher/tiger.c (tiger_final): Ditto. + * cipher/sha512.c (sha512_final): Avoid byte-by-byte buffer setting + when padding. + * cipher/stribog.c (stribog_final): Ditto. + * cipher/whirlpool.c (whirlpool_final): Ditto. + + tests/basic: add hash test for small block sizes. + + commit c54b1c96c644c941f3eb3d2a09432b82f25b6ff1 + * tests/basic.c (check_one_md): Compare hashing buffers sizes from 1 to + 129 as full buffer input and byte-by-byte input. + + Burn stack in transform functions for SHA2 AMD64 implementations. + + commit 74ef3ecbf94e704975e238a99c0e0480cebf46ac + * cipher/sha256-avx-amd64.S: Burn stack inside transform functions. + * cipher/sha256-avx2-bmi2-amd64.S: Ditto. + * cipher/sha256-ssse3-amd64.S: Ditto. + * cipher/sha512-avx-amd64.S: Ditto. + * cipher/sha512-avx2-bmi2-amd64.S: Ditto. + * cipher/sha512-ssse3-amd64.S: Ditto. + + Burn stack in transform functions for SHA1 AMD64 implementations. + + commit f3d4bd90662faaedd37ce0dae1f9e7f91748e91e + * cipher/sha1-avx-amd64.S: Burn stack inside transform functions. + * cipher/sha1-avx-bmi2-amd64.S: Ditto. + * cipher/sha1-avx2-bmi2-amd64.S: Ditto. + * cipher/sha1-ssse3-amd64.S: Ditto. + + Add AVX2/BMI2 implementation of SHA1. + + commit b982900bfe6403e95a157271d8d811c9c573af9e + * cipher/Makefile.am: Add 'sha1-avx2-bmi2-amd64.S'. + * cipher/hash-common.h (MD_BLOCK_CTX_BUFFER_SIZE): New. + (gcry_md_block_ctx): Change buffer length to MD_BLOCK_CTX_BUFFER_SIZE. + * cipher/sha1-avx-amd64.S: Add missing .size for transform function. + * cipher/sha1-ssse3-amd64.S: Add missing .size for transform function. + * cipher/sha1-avx-bmi2-amd64.S: Add missing .size for transform + function; Tweak implementation for small ~1% speed increase. + * cipher/sha1-avx2-bmi2-amd64.S: New. + * cipher/sha1.c (USE_AVX2, _gcry_sha1_transform_amd64_avx2_bmi2) + (do_sha1_transform_amd64_avx2_bmi2): New. + (sha1_init) [USE_AVX2]: Enable AVX2 implementation if supported by + HW features. + (sha1_final): Merge processing of two last blocks when extra block is + needed. + +2019-03-31 Jussi Kivilinna + + blowfish: add three rounds parallel handling to generic C implementation + + commit ced7508c857c0cc37da2299a393e5b167dd28e54 + * cipher/blowfish.c (BLOWFISH_ROUNDS): Remove. + [BLOWFISH_ROUNDS !=3D 16] (function_F): Remove. + (F): Replace big-endian and little-endian version with single + endian-neutral version. + (R3, do_encrypt_3, do_decrypt_3): New. + (_gcry_blowfish_ctr_enc, _gcry_blowfish_cbc_dec) + (_gcry_blowfish_cfb_dec): Use new three block functions. + + cast5: add three rounds parallel handling to generic C implementation. + + commit 4ec566b3689eff4a712eacfcbb4161eb243bb1df + * cipher/cast5.c (do_encrypt_block_3, do_decrypt_block_3): New. + (_gcry_cast5_ctr_enc, _gcry_cast5_cbc_dec, _gcry_cast5_cfb_dec): Use + new three block functions. + + cast5: read Kr four blocks at time and shift for current round. + + commit 8a0e68be1020d0c359bf8191159ac1ebe32a5aa0 + * cipher/cast5.c (do_encrypt_block, do_decrypt_block): Read Kr as + 32-bit words instead of bytes and shift value for each round. + + Add helper function for adding value to cipher block. + + commit 0fe918fa897cca9e01cbdb80d14106cfe5af680e + * cipher/cipher-internal.h (cipher_block_add): New. + * cipher/blowfish.c (_gcry_blowfish_ctr_enc): Use new helper function + for CTR block increment. + * cipher/camellia-glue.c (_gcry_camellia_ctr_enc): Ditto. + * cipher/cast5.c (_gcry_cast5_ctr_enc): Ditto. + * cipher/cipher-ctr.c (_gcry_cipher_ctr_encrypt): Ditto. + * cipher/des.c (_gcry_3des_ctr_enc): Ditto. + * cipher/rijndael.c (_gcry_aes_ctr_enc): Ditto. + * cipher/serpent.c (_gcry_serpent_ctr_enc): Ditto. + * cipher/twofish.c (_gcry_twofish_ctr_enc): Ditto. + +2019-03-28 Jussi Kivilinna + + Optimize OCB set_key and set_nonce. + + commit efd700e31dc8e1e386d367d1b682000977e0c810 + * cipher/cipher-ocb.c (double_block): Change to input/output + host-endian block instead of big-endian buffer. + (double_block_cpy): Remove. + (bit_copy): Use fixed length copy and 'u64' for calculations. + (ocb_get_L_big): Handle block endian conversions for double_block. + (_gcry_cipher_ocb_setkey): Handle block endian conversions for + double_block. + (_gcry_cipher_ocb_set_nonce): Set full length of 'ktop' to zero; Drop + length parameter for bit_copy. + + AES-NI/OCB: Optimize last and first key XORing. + + commit eacbd59b1333b95858886999c8049e04bf72ad74 + * cipher/rijndael-aesni.c (aesni_ocb_enc, aesni_ocb_dec) + [__x86_64__]: Reorder and mix first and last key XORing with OCB offset + XOR operations. + + AES-NI/OCB: Perform checksumming inline with encryption. + + commit e924ce456d5728a81c148de4a6eb23373cb70ca0 + * cipher/rijndael-aesni.c (aesni_ocb_enc): Remove call to + 'aesni_ocb_checksum', instead perform checksumming inline with offset + calculations. + +2019-03-27 Jussi Kivilinna + + AES-NI/OCB: Use stack for temporary storage. + + commit b82dbbedf027327e0b4444a01edb045f51c4152b + * cipher/rijndael-aesni.c (aesni_ocb_enc, aesni_ocb_dec): Use stack + allocated 'tmpbuf' instead of output buffer as temporary storage. + +2019-03-26 Jussi Kivilinna + + tests/basic: add large buffer testing for ciphers. + + commit cabeebfc1179c8f5982834a8cbce02c55b3468e2 + * tests/basic.c (check_one_cipher_core): Allocate buffers from heap. + (check_one_cipher): Add testing with large buffer (~65 KiB) in addition + to medium size buffer (~2 KiB). + + chacha20-poly1305: fix wrong en/decryption on large input buffers. + + commit 049376470b31832d3331fc0037d273b4147e9d38 + * cipher/chacha20.c (_gcry_chacha20_poly1305_encrypt) + (_gcry_chacha20_poly1305_decrypt): Correctly use 'currlen' for chacha20 + on the non-stitched code path. + +2019-03-24 Jussi Kivilinna + + doc: add mention about aligning data to cachelines for best performance. + + commit bb03edcbba95e06686188957a65c1967ee07cd6a + * doc/gcrypt.text: Add mention about aligning data to cachelines for + best performance. + + random-drbg: do not use calloc for zero ctr. + + commit 5a20151213c2e496513c541c36e4ebd086b20be9 + * random/random-drbg.c (DRBG_CTR_NULL_LEN): Move to 'constants' + section. + (drbg_state_s): Remove 'ctr_null' member. + (drbg_ctr_generate): Add 'drbg_ctr_null'. + (drbg_sym_fini, drbg_sym_init): Remove 'drbg->ctr_null' usage. + +2019-03-23 Jussi Kivilinna + + Add ARMv7/NEON accelerated GCM implementation. + + commit 2445cf7431fab921f6c1870da7084ee698992064 + * cipher/Makefile.am: Add 'cipher-gcm-armv7-neon.S'. + * cipher/cipher-gcm-armv7-neon.S: New. + * cipher/cipher-gcm.c [GCM_USE_ARM_NEON] (_gcry_ghash_setup_armv7_neon) + (_gcry_ghash_armv7_neon, ghash_setup_armv7_neon) + (ghash_armv7_neon): New. + (setupM) [GCM_USE_ARM_NEON]: Use armv7/neon implementation if have + HWF_ARM_NEON. + * cipher/cipher-internal.h (GCM_USE_ARM_NEON): New. + + Use memset instead of setting buffers byte by byte. + + commit 6f2391d2df029b0e1a4e5dde17c3d97cc594a1c7 + * cipher/cipher-ccm.c (do_cbc_mac): Replace buffer setting loop with mems= et call. + * cipher/cipher-gcm.c (do_ghash_buf): Ditto. + * cipher/poly1305.c (poly1305_final): Ditto. + + Use buf_cpy instead of copying buffers byte by byte. + + commit 4db6d8796c0d95ab89e9ad69336509b604b957cd + * cipher/bufhelp.h (buf_cpy): Skip memcpy if length is zero. + * cipher/cipher-ccm.c (do_cbc_mac): Replace buffer copy loops with buf_cp= y call. + * cipher/cipher-cmac.c (_gcry_cmac_write): Ditto. + * cipher/cipher-ocb.c (_gcry_cipher_ocb_authenticate): Ditto. + + Reduce overhead on generic hash write function. + + commit e76617cbab018dd8f41fd6b4ec6740b5303f7e13 + * cipher/hash-common.c (_gcry_md_block_write): Remove recursive + function call; Use buf_cpy for copying buffers; Burn stack only once. + + sha1-avx: use vmovdqa instead of movdqa. + + commit f8d14df1abd645c3279b14da43b4a7983d87f89f + * cipher/sha1-avx-amd64.S: Replace 'movdqa' with 'vmovdqa'. + * cipher/sha1-avx-bmi2-amd64.S: Replace 'movdqa' with 'vmovdqa'. + + doc/gcrypt.texi: update HW feature list. + + commit 7abf65da84c7106250a5ed2de78b05610cf251f4 + * doc/gcrypt.texi: Update FW feature list. + +2019-03-20 Daniel Kahn Gillmor + + ecc: Adjust debugging output. + + commit 54db6a4b44124ed7e95897174f32262482b4b0cb + * cipher/ecc.c (ecc_check_secret_key): Adjust debugging output to use + full column titles. + +2019-02-25 NIIBE Yutaka + + fips: Only test check_binary_integrity when fips_mode is enabled. + + commit ad133fc79757236359252e92244fe16e9adb45a3 + * src/fips.c (_gcry_fips_run_selftests): Check the status of fips_mode + before calling check_binary_integrity. + +2019-02-07 Jussi Kivilinna + + Add 2-way path for SSSE3 version of ChaCha20. + + commit d455068988e5779b0200c51415ddab6b51e12dc4 + * cipher/chacha20-amd64-ssse3.S (_gcry_chacha20_amd64_ssse3_blocks1) + (_gcry_chacha20_poly1305_amd64_ssse3_blocks1): Add 2-way code paths. + * cipher/chacha20.c (_gcry_chacha20_poly1305_encrypt): Add + preprosessing of 2 blocks with SSSE3. + +2019-01-27 Jussi Kivilinna + + Do not precalculate OCB offset L0+L1+L0. + + commit afab94d222425ecb838eb56cb0723bdaf3e5de36 + * cipher/cipher-internal.h (gcry_cipher_handle): Remove OCB L0L1L0. + * cipher/cipher-ocb.c (_gcry_cipher_ocb_setkey): Ditto. + * cipher/rijndael-aesni.c (aesni_ocb_enc, aesni_ocb_dec) + (_gcry_aes_aesni_ocb_auth): Replace L0L1L0 use with L1. + + Calculate OCB L-tables when setting key instead of when setting nonce. + + commit c15409c49993166ab1325d45360b3a8fe72a5556 + * cipher/cipher-internal.h (gcry_cipher_handle): Mark areas of + u_mode.ocb that are and are not cleared by gcry_cipher_reset. + (_gcry_cipher_ocb_setkey): New. + * cipher/cipher-ocb.c (_gcry_cipher_ocb_set_nonce): Split + L-table generation to ... + (_gcry_cipher_ocb_setkey): ... this new function. + * cipher/cipher.c (cipher_setkey): Add handling for OCB mode. + (cipher_reset): Do not clear L-values for OCB mode. + + chacha20-amd64-avx2: optimize output xoring. + + commit 08e0650c21984bb9ddf5a1dabb1cc890fabf63ab + * cipher/chacha20-amd64-avx2.S (STACK_TMP2): Remove. + (transpose_16byte_2x2, xor_src_dst): New. + (BUF_XOR_256_TO_128): Remove. + (_gcry_chaha20_amd64_avx2_blocks8) + (_gcry_chacha20_poly1305_amd64_avx2_blocks8): Replace + BUF_XOR_256_TO_128 with transpose_16byte_2x2/xor_src_dst; Reduce stack + usage; Better interleave chacha20 state merging and output xoring. + + tests/bench-slope: prevent auto-mhz detection getting stuck. + + commit 28614a77a28190ab902a2b98039de2cd0635c7c7 + * cipher/bench-slope.c (bench_ghz, bench_ghz_diff): New static + variables. + (AUTO_GHZ_TARGET_DIFF): New macro. + (do_slope_benchmark): Reduce target auto-mhz accuracy after + repeated failures. + (bench_print_result_csv, bench_print_result_std): Print auto-ghz + different if 1 Mhz or more. + (do_slope_benchmark, bench_print_result_csv, bench_print_result_std) + (bench_print_result): Remove 'bench_ghz' parameter. + (cipher_bench_one, hash_bench_one, mac_bench_one) + (kdf_bench_one): Remove 'bench_ghz' variable. + + tests/bench-slope: add missing cipher context reset. + + commit 546f13ae08918726791600cdd0d0be56cc52c790 + * tests/bench-slope.c (bench_encrypt_do_bench) + (bench_decrypt_do_bench): Add call to 'gcry_cipher_reset'. + + Add stitched ChaCha20-Poly1305 SSSE3 and AVX2 implementations. + + commit d6330dfb4b0e9fb3f8eef65ea13146060b804a97 + * cipher/asm-poly1305-amd64.h: New. + * cipher/Makefile.am: Add 'asm-poly1305-amd64.h'. + * cipher/chacha20-amd64-avx2.S (QUATERROUND2): Add interleave + operators. + (_gcry_chacha20_poly1305_amd64_avx2_blocks8): New. + * cipher/chacha20-amd64-ssse3.S (QUATERROUND2): Add interleave + operators. + (_gcry_chacha20_poly1305_amd64_ssse3_blocks4) + (_gcry_chacha20_poly1305_amd64_ssse3_blocks1): New. + * cipher/chacha20.c (_gcry_chacha20_poly1305_amd64_ssse3_blocks4) + (_gcry_chacha20_poly1305_amd64_ssse3_blocks1) + (_gcry_chacha20_poly1305_amd64_avx2_blocks8): New prototypes. + (chacha20_encrypt_stream): Split tail to... + (do_chacha20_encrypt_stream_tail): ... new function. + (_gcry_chacha20_poly1305_encrypt) + (_gcry_chacha20_poly1305_decrypt): New. + * cipher/cipher-internal.h (_gcry_chacha20_poly1305_encrypt) + (_gcry_chacha20_poly1305_decrypt): New prototypes. + * cipher/cipher-poly1305.c (_gcry_cipher_poly1305_encrypt): Call + '_gcry_chacha20_poly1305_encrypt' if cipher is ChaCha20. + (_gcry_cipher_poly1305_decrypt): Call + '_gcry_chacha20_poly1305_decrypt' if cipher is ChaCha20. + * cipher/poly1305-internal.h (_gcry_cipher_poly1305_update_burn): New + prototype. + * cipher/poly1305.c (poly1305_blocks): Make static. + (_gcry_poly1305_update): Split main function body to ... + (_gcry_poly1305_update_burn): ... new function. + + Add SSSE3 optimized non-parallel ChaCha20 function. + + commit 7d9b2f114f3edf4d13640616cf34c79364234781 + * cipher/chacha20-amd64-ssse3.S (ROTATE_SHUF, ROTATE, WORD_SHUF) + (QUARTERROUND4, _gcry_chacha20_amd64_ssse3_blocks1): New. + * cipher/chacha20.c (_gcry_chacha20_amd64_ssse3_blocks1): New + prototype. + (chacha20_blocks): Rename to ... + (do_chacha20_blocks): ... this. + (chacha20_blocks): New. + (chacha20_encrypt_stream): Adjust for new chacha20_blocks function. + + tests/basic: increase buffer size for check_one_cipher. + + commit 88e482d16ee80de41b6f133e77f0d15423fcd266 + * tests/basic.c (check_one_cipher_core) + (check_one_cipher): Increase buffer from 1040 to 1904 bytes. + + tests/basic: check AEAD tags in check_one_cipher test. + + commit eee1f152a5b3040f6723d287d1b01fb939be67b7 + * tests/basic.c (get_algo_mode_taglen): New. + (check_one_cipher_core_reset): Check that tags are same with + AEAD modes. + +2019-01-15 NIIBE Yutaka + + build: With LD_LIBRARY_PATH defined, use --disable-new-dtags. + + commit e5c2f8a2cd2b89d90ea30de2dedb0e92498a5f70 + * configure.ac (LDADD_FOR_TESTS_KLUDGE): New for --disable-new-dtags. + * tests/Makefile.am (LDADD, t_lock_LDADD): Use LDADD_FOR_TESTS_KLUDGE. + + random: Fix previous commit for getentropy function. + + commit 17f246c7044ab9ed236f6ec73fc126654257f0f9 + * random/rndlinux.c [__NR_getrandom] (_gcry_rndlinux_gather_random): + Check return value only for use of syscall. + + random: Use getentropy when available for not GNU/Linux. + + commit 2677d7d482bf2d078c1dce64854747c5b148924b + * configure.ac: Detect getentropy. + * random/rndlinux.c [__linux__] (getentropy): Macro defined. + [HAVE_GETENTROPY] (_gcry_rndlinux_gather_random): Use getentropy. + +2019-01-14 Jussi Kivilinna + + camellia-aarch64: do not export look-up table globally. + + commit 09c27280cc09798d15369b3a143036b7ab5ddd69 + * cipher/camellia-aarch64.S (_gcry_camellia_arm_tables): Remove + '.globl' export. + +2019-01-02 Jussi Kivilinna + + Process CCM/EAX/GCM/Poly1305 AEAD cipher modes input in 24 KiB chucks. + + commit 3ee6588de8311b461ef8707c70ff86d2b252966d + * cipher/cipher-ccm.c (_gcry_cipher_ccm_encrypt) + (_gcry_cipher_ccm_decrypt): Process data in 24 KiB chunks. + * cipher/cipher-eax.c (_gcry_cipher_eax_encrypt) + (_gcry_cipher_eax_decrypt): Ditto. + * cipher/cipher-gcm.c (_gcry_cipher_gcm_encrypt) + (_gcry_cipher_gcm_decrypt): Ditto. + * cipher/cipher-poly1305.c (_gcry_cipher_poly1305_encrypt) + (_gcry_cipher_poly1305_decrypt): Ditto. + + tests/benchmark: add Chacha20-Poly1305 benchmarking. + + commit 4871f11745f33c5c5051bfe6f325ac1c10764b04 + * tests/benchmark.c (cipher_bench): Add Chacha20-Poly1305. + + tests/benchmark: add --huge-buffers option for cipher tests. + + commit edde61f325e4b345f17c47369f3b6b1400656f04 + * tests/benchmark.c (huge_buffers, cipher_encrypt, cipher_decrypt): New. + (cipher_bench): Add 'max_inlen' to modes structure; add huge buffers + mode selection. + (main): Add '--huge-buffers'. + +2018-12-19 NIIBE Yutaka + + random: Add finalizer for rndjent. + + commit 3028a221d39c1b593ea0c1bcbfccd33959769692 + * random/rand-internal.h (_gcry_rndjent_fini): New. + * random/rndjent.c (_gcry_rndjent_fini): New. + * random/rndlinux.c (_gcry_rndlinux_gather_random): Call the finalizer + when GCRYCTL_CLOSE_RANDOM_DEVICE. + +2018-12-12 Werner Koch + + secmem: Prepare for easier debugging. + + commit 876f7280e8604bc99ddda0526339ec5ec6b23c4b + * src/secmem.c (_gcry_secmem_dump_stats): Factor code out to ... + (secmem_dump_stats_internal): new. + +2018-12-01 Jussi Kivilinna + + rijndael-aesni: interleave last CTR encryption round with xoring. + + commit 66d2b7fc17258f1424f4ca4adb1096e48b818bd0 + * cipher/rijndael-aesni.c (do_aesni_ctr_8): Interleave aesenclast + with input xoring. + +2018-11-20 Jussi Kivilinna + + Use explicit_bzero for wipememory. + + commit 168668228c7c49e70612cb4d602d6d603a2add2c + * configure.ac (AC_CHECK_FUNCS): Check for 'explicit_bzero'. + * src/g10lib.h (wipememory2): Use _gcry_fast_wipememory if _SET is + zero. + (_gcry_fast_wipememory): New. + (_gcry_wipememory2): Rename to... + (_gcry_fast_wipememory2): ...this. + * src/misc.c (_gcry_wipememory): New. + (_gcry_wipememory2): Rename to... + (_gcry_fast_wipememory2): ...this. + (_gcry_fast_wipememory2) [HAVE_EXPLICIT_BZERO]: Use explicit_bzero if + SET is zero. + (_gcry_burn_stack): Use _gcry_fast_wipememory. + + Add clang target pragma for mixed C/assembly x86-64 implementations. + + commit 9d9c4fd18b445ff414d11678285d54af3afdb222 + * cipher/cipher-gcm-intel-pclmul.c: Add target 'no-sse' attribute + pragma for clang. + * cipher/crc-intel-pclmul.c: Ditto. + * cipher/rijndael-aesni.c: Ditto. + * cipher/rijndael-ssse3-amd64.c: Ditto. + * cipher/sha1-intel-shaext.c: Ditto. + * cipher/sha256-intel-shaext.c: Ditto. + + Optimizations for AES-NI OCB. + + commit b42de67f34871a2520cfe370af513f2aab6e4f75 + * cipher/cipher-internal.h (gcry_cipher_handle): New pre-computed OCB + values L0L1 and L0L1L0; Swap dimensions for OCB L table. + * cipher/cipher-ocb.c (_gcry_cipher_ocb_set_nonce): Setup L0L1 and + L0L1L0 values. + (ocb_crypt): Process input in 24KiB chunks for better cache locality + for checksumming. + * cipher/rijndael-aesni.c (ALWAYS_INLINE): New macro for always + inlining functions, change all functions with 'inline' to use + ALWAYS_INLINE. + (NO_INLINE): New macro. + (aesni_prepare_2_6_variable, aesni_prepare_7_15_variable): Rename to... + (aesni_prepare_2_7_variable, aesni_prepare_8_15_variable): ...these and + adjust accordingly (xmm7 moved from *_7_15 to *_2_7). + (aesni_prepare_2_6, aesni_prepare_7_15): Rename to... + (aesni_prepare_2_7, aesni_prepare_8_15): ...these and adjust + accordingly. + (aesni_cleanup_2_6, aesni_cleanup_7_15): Rename to... + (aesni_cleanup_2_7, aesni_cleanup_8_15): ...these and adjust + accordingly. + (aesni_ocb_checksum): New. + (aesni_ocb_enc, aesni_ocb_dec): Calculate OCB offsets in parallel + with help of pre-computed offsets L0+L1 ja L0+L1+L0; Do checksum + calculation as separate pass instead of inline; Use NO_INLINE. + (_gcry_aes_aesni_ocb_auth): Calculate OCB offsets in parallel + with help of pre-computed offsets L0+L1 ja L0+L1+L0. + * cipher/rijndael-internal.h (RIJNDAEL_context_s) [USE_AESNI]: Add + 'use_avx2' and 'use_avx'. + * cipher/rijndael.c (do_setkey) [USE_AESNI]: Set 'use_avx2' if + Intel AVX2 HW feature is available and 'use_avx' if Intel AVX HW + feature is available. + * tests/basic.c (do_check_ocb_cipher): New test vector; increase + size of temporary buffers for new test vector. + (check_ocb_cipher_largebuf_split): Make test plaintext non-uniform + for better checksum testing. + (check_ocb_cipher_checksum): New. + (check_ocb_cipher_largebuf): Call check_ocb_cipher_checksum. + (check_ocb_cipher): New expected tags for check_ocb_cipher_largebuf + test runs. + +2018-11-19 Andreas Metzler + + doc: Fix library initialization examples. + + commit af0bbdb9019e0b4a72e87e8b1b4a55506d349834 + + +2018-11-14 Werner Koch + + random: Initialize variable as requested by valgrind. + + commit aa686dfc9b563ff79c01d2f8560b88f69c42ecba + random/jitterentropy-base.c: Init. + +2018-11-13 NIIBE Yutaka + + libgcrypt.m4: Prefer gpgrt-config to SYSROOT support. + + commit 852245390ef7fd8ca9e36010886a4cf42cf710bf + * libgcrypt.m4: Move SYSROOT support after check of GPGRT_CONFIG. + + build: Update autogen.rc. + + commit bea193446351c24b10a4342466978d57bd53f599 + * autogen.rc: Remove obsolete --with-gpg-error-prefix option. + +2018-11-07 Jussi Kivilinna + + Fix 'variable may be used uninitialized' warning for CTR mode. + + commit 3f76319803a4abcd33fa29a0ac39f8ed9d646226 + * cipher/cipher-ctr.c (_gcry_cipher_ctr_encrypt): Set N to BLOCKSIZE + before counter loop. + +2018-11-06 Jussi Kivilinna + + Fix inlining of ocb_get_l for x86 AES implementations. + + commit 9d6431604b5ee21572c1c2cfa8376e6d81162cbb + * cipher/rijndael-aesni.c (aes_ocb_get_l): New. + (aesni_ocb_enc, aesni_ocb_dec, _gcry_aes_aesni_ocb_auth): Use + 'aes_ocb_get_l'. + * cipher/rijndael-ssse3-amd4.c (aes_ocb_get_l): New. + (ssse3_ocb_enc, ssse3_ocb_dec, _gcry_aes_ssse3_ocb_auth): Use + 'aes_ocb_get_l'. + +2018-11-05 Jussi Kivilinna + + stdmem: free: only call _gcry_secmem_free if needed. + + commit 23f56d3359ca7d152aa87874ddd6305171a91408 + * src/stdmem.c (_gcry_private_free): Check if memory is secure before + calling _gcry_secmem_free to avoid unnecessarily taking secmem lock. + + secmem: fix potential memory visibility issue. + + commit d6c6680ca31c05bafbb8becda56da051346eceb3 + * configure.ac (gcry_cv_have_sync_synchronize): New check. + * src/secmem.c (pooldesc_s): Make next pointer volatile. + (memory_barrier): New. + (_gcry_secmem_malloc_internal): Insert memory barrier between + pool->next and mainpool.next assigments. + (_gcry_private_is_secure): Update comments. + + wipememory: use memset for non-constant length or large buffer wipes. + + commit 4faeaa1cbd235a2560fa04a8ac3766a07029acd8 + * src/g10lib.h (CONSTANT_P): New. + (_gcry_wipememory2): New prototype. + (wipememory2): Use _gcry_wipememory2 if _len not constant expression or + lenght is larger than 64 bytes. + (FASTWIPE_T, FASTWIPE_MULT, fast_wipememory2_unaligned_head): Remove. + (fast_wipememory2): Always handle buffer as unaligned. + * src/misc.c (__gcry_burn_stack): Move memset_ptr variable to... + (memset_ptr): ... here. New. + (_gcry_wipememory2): New. + + Change buf_cpy and buf_xor* functions to use buf_put/buf_get helpers. + + commit 0068d41d9304ebcdb2caba1fa8848925e2bfaac7 + * cipher/bufhelp.h (BUFHELP_FAST_UNALIGNED_ACCESS) + (bufhelp_int_s, buf_xor_1): Remove. + (buf_cpy, buf_xor, buf_xor_2dst, buf_xor_n_copy_2): Use + buf_put/buf_get helpers to handle unaligned memory accesses. + + rijndael: fix unused parameter warning. + + commit 30e783ec487466132324673f197d36b85a91b060 + * cipher/rijndael.c (do_setkey): Silence unused 'hd' warning. + + mpi/longlong.h: enable inline assembly for powerpc64. + + commit ec49013d23d9a7b874c42d77ceb08bd313ba69e1 + * mpi/longlong.h [__powerpc__ && W_TYPE_SIZE =3D=3D 64]: Remove '#if 0'. + + Change remaining users of _gcry_fips_mode to use fips_mode. + + commit 2aece89d3967e692743541cea857f2e4771b0b62 + * src/fips.c (_gcry_fips_mode): Remove. + (_gcry_enforced_fips_mode, _gcry_inactivate_fips_mode) + (_gcry_is_fips_mode_inactive): Use fips_mode. + * src/g10lib.h (_gcry_fips_mode): Remove. + +2018-11-02 NIIBE Yutaka + + aarch64: mpi: Distribute the header file as a part of source. + + commit a2e0cb1542818ad8a71de34ccbf191adab0a0b86 + * mpi/Makefile.am (EXTRA_libmpi_la_SOURCES): Add asm-common-aarch64.h. + + build: Fix GCRYPT_HWF_MODULES. + + commit f7395338d71d4d82180a11707fd6e77787162e24 + * configure.ac (GCRYPT_HWF_MODULES): Add libgcrypt_la- prefix. + + build: Update gpg-error.m4 and libgcrypt.m4. + + commit f46286851158878d5041ac5381b2807ecec541eb + * m4/gpg-error.m4: Update to 2018-11-02. + * src/libgrypt.m4: Add AC_MSG_NOTICE. + Bump the version date. + +2018-10-29 NIIBE Yutaka + + build: Update gpg-error.m4 and ksba.m4. + + commit 4a4d4a284ca996df874e2534f8529c1611289943 + * m4/gpg-error.m4: Update to 2018-10-29. + * src/libgrypt.m4: Follow the change of gpgrt-config. + Bump the version date. + +2018-10-27 Jussi Kivilinna + + Fix missing global initialization in fips_is_operational. + + commit 6e669e09603e5a98b59dcf35f77f346db6c81eac + * src/g10lib.h (_gcry_global_any_init_done): New extern. + (fips_is_operational): Check for _gcry_global_any_init_done and call + _gcry_global_is_operational. + * src/global.c (any_init_done): Rename to ... + (_gcry_global_any_init_done): ... this and make externally available. + +2018-10-26 Daniel Kahn Gillmor + + random: use getrandom() on Linux where available. + + commit 7e662680c170968661ee0105d132813f8281d229 + * random/rndlinux.c (_gcry_rndlinux_gather_random): use the + getrandom() syscall on Linux if it exists, regardless of what kind of + entropy was requested. + +2018-10-26 Werner Koch + + random: Make sure to re-open /dev/random after a fork. + + commit 319f55e6e5793c59f1ba4cfe481b562bca42194d + * random/rndlinux.c (_gcry_rndlinux_gather_random): Detect fork and + re-open devices. + + primes: Avoid leaking bits of the prime test to pageable memory. + + commit 2e2e68ad4874a4678cfbe452b70ae987e0402eca + * cipher/primegen.c (gen_prime): Allocate MODS in secure memory. + +2018-10-26 NIIBE Yutaka + + libgcrypt.m4: Better compatibility support. + + commit a755bd0ea09af2ae5a66e3f5aeb8707673c687cf + * src/gpg-error.m4: Update. + * src/libgcrypt.m4: Don't assume libgcrypt-config is newer. + + build: Fix libgcrypt.m4. + + commit 630ece1b7e0a94442bca91d8e96d9b1d4cd3ec66 + * src/libgcrypt.m4: Use AC_PATH_PROG to detect libgcrypt-config. + + build: Relax build requirements. + + commit 8e5641ed65f86783542d5caccdeeee42eeb9457c + * m4/gpg-error.m4: Update from libgpg-error 1.33. + * src/libgcrypt.m4: Don't require AM_PATH_GPG_ERROR. Use GPGRT_CONFIG + instead of libgcrypt-config when it is confirmed that it is available + and working well. + * configure.ac (AM_PATH_GPG_ERROR): No requirement for newer version + (It was because of new gpgrt-config which supports *.pc files). + +2018-10-25 NIIBE Yutaka + + build: Require libgpg-error >=3D 1.33. + + commit b376dc2abbb208b10bbc76998ff39adb2f301905 + * configure.ac (NEED_GPG_ERROR_VERSION): Require 1.33. + * m4/gpg-error.m4: Update from libgpg-error 1.33. + * src/libgcrypt.m4: Bump version date. + Use --variable option. + +2018-10-24 Werner Koch + + build: Add release make target. + + commit 03bb25ee7ed6f1076bf788ab981ca68672880daa + * Makefile.am (release, sign-release): New targets. + + build: Make distcheck work again. + + commit b0ad66e48c46b79af69349606e276cf0a6b9a020 + * cipher/Makefile.am: Prettified source file lists. + EXTRA_libcipher_la_SOURCES): Add missing asm-common-aarch64.h. + + Fix memory leak in secmem in out of core conditions. + + commit f74687fd43f5772a372f54031d5a9527597f4ce4 + * src/secmem.c (_gcry_secmem_malloc_internal): Release pool descriptor + if the pool could not be allocated. + + ecc: Fix memory leak in the error case of ecc_encrypt_raw. + + commit e57e75ea517f32109b508113f18298fc69fd1192 + * cipher/ecc.c (ecc_encrypt_raw): Add proper error cleanup in the main + block. + + ecc: Fix possible memory leakage in parameter check of eddsa. + + commit 149ceb3cae03d0385341d32430aa5ae57de90007 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_verify): Fix mem leak. + +2018-10-24 NIIBE Yutaka + + build: Fix libgcrypt.pc. + + commit 0e071372fc0e6fed4a449955ed0789803ba5e709 + * src/libgcrypt.pc.in: Fix typo. + + build: Compatibility to pkg-config. + + commit c60eabb11435665fa84a3a82b2a15f48870cc4d7 + * src/libgcrypt-config.in: Support --variable and --modversion. + + build: Make libgcrypt.m4 use gpg-error-config. + + commit 7da887d69d72ea0ea0d106054c48a8c03e242a18 + * src/libgcrypt.m4: Use gpg-error-config. + + build: Provide libgcrypt.pc, generated by configure. + + commit 97194b422bc89a6137f4e218d4cdee118c63e96e + * configure.ac: Generate src/libgcrypt.pc. + * src/Makefile.am (pkgconfigdir, pkgconfig_DATA): New. + (EXTRA_DIST): Add libgcrypt.pc.in. + * src/libgcrypt-config.in: Use @PACKAGE_VERSION@. + * src/libgcrypt.pc.in: New. + + build: Update gpg-error.m4 from libgpg-error. + + commit 5b1febb5e40d92072bef425bd9e63f7a07edd57e + * m4/gpg-error.m4: Update from libgpg-error 1.33. + + build: Don't default to underscore=3Dyes for cross-build. + + commit 0f4545b441b6fbdd6e9c4e95f5f2a367483e78ad + * acinclude.m4: Don't set ac_cv_sys_symbol_underscore + for cross build. + +2018-10-23 Werner Koch + + ecc: Fix potential unintended freeing of an internal param. + + commit e2da4e8dee4b371804f3b2659b53431fb6380d93 + * cipher/ecc-curves.c (_gcry_ecc_get_mpi): Fix c+p error + + sexp: Fix uninitialized use of a var in the error case. + + commit 9f2c7ec4d8b07e82663ad084c90c016d3c3b80c2 + * src/sexp.c (_gcry_sexp_vextract_param): Initialize L1. + +2018-10-16 NIIBE Yutaka + + build: Let configure create the VERSION file. + + commit 0f2c6ce2c9504c6df435463243edaa669e57b109 + * autogen.sh: Update from libgpg-error. + * configure.ac: Use mym4_versoin to create VERSION file. + * Makefile.am (dist-hook): Do not create VERSION file. + (EXTRA_DIST): Add VERSION. + +2018-07-21 Jussi Kivilinna + + Add size optimized cipher block copy and xor functions. + + commit 86e5e06a97ae13b8bbf6923ecc76e02b9c429b46 + * cipher/bufhelp.h (buf_get_he32, buf_put_he32, buf_get_he64) + (buf_put_he64): New. + * cipher/cipher-internal.h (cipher_block_cpy, cipher_block_xor) + (cipher_block_xor_1, cipher_block_xor_2dst, cipher_block_xor_n_copy_2) + (cipher_block_xor_n_copy): New. + * cipher/cipher-gcm-intel-pclmul.c + (_gcry_ghash_setup_intel_pclmul): Use assembly for swapping endianness + instead of buf_get_be64 and buf_cpy. + * cipher/blowfish.c: Use new cipher_block_* functions for cipher block + sized buf_cpy/xor* operations. + * cipher/camellia-glue.c: Ditto. + * cipher/cast5.c: Ditto. + * cipher/cipher-aeswrap.c: Ditto. + * cipher/cipher-cbc.c: Ditto. + * cipher/cipher-ccm.c: Ditto. + * cipher/cipher-cfb.c: Ditto. + * cipher/cipher-cmac.c: Ditto. + * cipher/cipher-ctr.c: Ditto. + * cipher/cipher-eax.c: Ditto. + * cipher/cipher-gcm.c: Ditto. + * cipher/cipher-ocb.c: Ditto. + * cipher/cipher-ofb.c: Ditto. + * cipher/cipher-xts.c: Ditto. + * cipher/des.c: Ditto. + * cipher/rijndael.c: Ditto. + * cipher/serpent.c: Ditto. + * cipher/twofish.c: Ditto. + +2018-07-04 NIIBE Yutaka + + RFC-8439 was published. + + commit 9660c3fafd732b1857bb2697c6f43aed077b9ad6 + * cipher/cipher-poly1305.c: Update RFC reference. + +2018-06-19 Jussi Kivilinna + + Clean-up implementation selection for SHA1 and SHA2. + + commit 8a44c55d2fb758f726b8b436aa5c0b88a6c6f112 + * cipher/sha1.c (ASM_EXTRA_STACK): Increase by sizeof(void*)*4. + (do_sha1_transform_amd64_ssse3, do_sha1_transform_amd64_avx) + (do_sha1_transform_amd64_avx_bmi2, do_sha1_transform_intel_shaext) + (do_sha1_transform_armv7_neon, do_sha1_transform_armv8_ce): New. + (transform_blk, transform): Merge to ... + (do_transform_generic): ... this and remove calls to assembly + implementations. + (sha1_init): Select hd->bctx.bwrite based on HW features. + (_gcry_sha1_mixblock, sha1_final): Call hd->bctx.bwrite instead of + transform. + * cipher/sha1.h (SHA1_CONTEXT): Remove implementation selection bits. + * cipher/sha256.h (SHA256_CONTEXT): Remove implementation selection + bits. + (ASM_EXTRA_STACK): Increase by sizeof(void*)*4. + (do_sha256_transform_amd64_ssse3, do_sha256_transform_amd64_avx) + (do_sha256_transform_amd64_avx2, do_sha256_transform_intel_shaext) + (do_sha256_transform_armv8_ce): New. + (transform_blk, transform): Merge to ... + (do_transform_generic): ... this and remove calls to assembly + implementations. + (sha256_init, sha224_init): Select hd->bctx.bwrite based on HW + features. + (sha256_final): Call hd->bctx.bwrite instead of transform. + * cipher/sha512-armv7-neon.S + (_gcry_sha512_transform_armv7_neon): Return zero. + * cipher/sha512.h (SHA512_CONTEXT): Remove implementation selection + bits. + (ASM_EXTRA_STACK): Increase by sizeof(void*)*4. + (do_sha512_transform_armv7_neon, do_sha512_transform_amd64_ssse3) + (do_sha512_transform_amd64_avx, do_sha512_transform_amd64_avx2): New. + [USE_ARM_ASM] (do_transform_generic): New. + (transform_blk, transform): Merge to ... + [!USE_ARM_ASM] (do_transform_generic): ... this and remove calls to + assembly implementations. + (sha512_init, sha384_init): Select hd->bctx.bwrite based on HW + features. + (sha512_final): Call hd->bctx.bwrite instead of transform. + + Add hash_buffer and hash_buffers for SHA-224, SHA-385, SHA3 and BLAKE2. + + commit 59c4e344eec61cff45185e1caea6815b3266a0f8 + * cipher/blake2.c (DEFINE_BLAKE2_VARIANT): Add hash_buffer and + hash_buffers functions for BLAKE2 variants. + * cipher/keccak.c (_gcry_sha3_hash_buffer, _gcry_sha3_hash_buffers) + (_gcry_sha3_224_hash_buffer, _gcry_sha3_224_hash_buffers) + (_gcry_sha3_256_hash_buffer, _gcry_sha3_256_hash_buffers) + (_gcry_sha3_384_hash_buffer, _gcry_sha3_384_hash_buffers) + (_gcry_sha3_512_hash_buffer, _gcry_sha3_512_hash_buffers): New. + * cipher/sha256.c (_gcry_sha224_hash_buffer) + (_gcry_sha224_hash_buffers): New. + * cipher/sha512.c (_gcry_sha384_hash_buffer) + (_gcry_sha384_hash_buffers): New. + + Add hash_buffer and hash_buffers pointers to message digest spec. + + commit b136703ea0ddbd9fec6dfd1f8dfda8373653ba39 + * src/cipher-proto.h (gcry_md_hash_buffer_t) + (gcry_md_hash_buffers_t): New. + (gcry_md_spec): Add hash_buffer and hash_buffers. + * cipher/md.c (_gcry_md_hash_buffer, _gcry_md_hash_buffers): Use + hash_buffer/hash_buffers from MD spec instead of hard-coding supported + algorithms. + * cipher/blake2.c: Add NULL to MD spec hash_buffer and hash_buffers + pointers. + * cipher/crc.c: Ditto. + * cipher/gostr3411-94.c: Ditto. + * cipher/keccak.c: Ditto. + * cipher/md2.c: Ditto. + * cipher/md4.c: Ditto. + * cipher/md5.c: Ditto. + * cipher/stribog.c: Ditto. + * cipher/tiger.c: Ditto. + * cipher/whirlpool.c: Ditto. + * cipher/rmd160.c (_gcry_rmd160_hash_buffers): New. + (_gcry_digest_spec_rmd160): Add hash_buffer and hash_buffers functions. + * cipher/sha1.c (_gcry_digest_spec_sha1): Add hash_buffer and + hash_buffers functions. + * cipher/sha256.c (_gcry_digest_spec_sha256): Add hash_buffer and + hash_buffers functions. + (_gcry_digest_spec_sha224): Add NULL pointers for hash_buffer and + hash_buffers. + * cipher/sha512.c (_gcry_digest_spec_sha1): Add hash_buffer and + hash_buffers functions. + (_gcry_digest_spec_sha384): Add NULL pointers for hash_buffer and + hash_buffers. + * cipher/sm3.c (_gcry_digest_spec_sha1): Add hash_buffer and + hash_buffers functions. + + AES: setup cipher object bulk routines with optimized versions. + + commit a15c1def7e0f170f6663635db84fecab1cbfcca7 + * cipher/rijndael-aesni.c + (_gcry_aes_aesni_prepare_decryption): Rename... + (do_aesni_prepare_decryption): .. to this. + (_gcry_aes_aesni_prepare_decryption): New. + (_gcry_aes_aesni_cfb_enc, _gcry_aes_aesni_cbc_enc) + (_gcry_aes_aesni_ctr_enc, _gcry_aes_aesni_cfb_dec) + (_gcry_aes_aesni_cbc_dec): Reorder parameters to match bulk + operations. + (_gcry_aes_aesni_cbc_dec, aesni_ocb_dec) + (_gcry_aes_aesni_xts_dec): Check and prepare decryption. + (_gcry_aes_aesni_ocb_crypt, _gcry_aes_aesni_ocb_auth): Change return + type to size_t. + * cipher/rijndael-armv8-ce.c + (_gcry_aes_armv8_ce_cfb_enc, _gcry_aes_armv8_ce_cbc_enc) + (_gcry_aes_armv8_ce_ctr_enc, _gcry_aes_armv8_ce_cfb_dec) + (_gcry_aes_armv8_ce_cbc_dec): Reorder parameters to match bulk + operations. + (_gcry_aes_armv8_ce_cbc_dec, _gcry_aes_armv8_ce_ocb_crypt) + (_gcry_aes_armv8_ce_xts_dec): Check and prepare decryption. + (_gcry_aes_armv8_ce_ocb_crypt, _gcry_aes_armv8_ce_ocb_auth): Change + return type to size_t. + * cipher/rijndael-ssse3-amd64.c + (_gcry_ssse3_prepare_decryption): Rename... + (do_ssse3_prepare_decryption): .. to this. + (_gcry_ssse3_prepare_decryption): New. + (_gcry_aes_ssse3_cfb_enc, _gcry_aes_ssse3_cbc_enc) + (_gcry_aes_ssse3_ctr_enc, _gcry_aes_ssse3_cfb_dec) + (_gcry_aes_ssse3_cbc_dec): Reorder parameters to match bulk + operations. + (_gcry_aes_ssse3_cbc_dec, ssse3_ocb_dec): Check and prepare decryption. + (_gcry_aes_ssse3_ocb_crypt, _gcry_aes_ssse3_ocb_auth): Change return + type to size_t. + * cipher/rijndael.c + (_gcry_aes_aesni_cfb_enc, _gcry_aes_aesni_cbc_enc) + (_gcry_aes_aesni_ctr_enc, _gcry_aes_aesni_cfb_dec) + (_gcry_aes_aesni_cbc_dec, _gcry_aes_aesni_ocb_crypt) + (_gcry_aes_aesni_ocb_auth, _gcry_aes_aesni_xts_crypt) + (_gcry_aes_ssse3_cfb_enc, _gcry_aes_ssse3_cbc_enc) + (_gcry_aes_ssse3_ctr_enc, _gcry_aes_ssse3_cfb_dec) + (_gcry_aes_ssse3_cbc_dec, _gcry_aes_ssse3_ocb_crypt) + (_gcry_aes_ssse3_ocb_auth, _gcry_aes_ssse3_xts_crypt) + (_gcry_aes_armv8_ce_cfb_enc, _gcry_aes_armv8_ce_cbc_enc) + (_gcry_aes_armv8_ce_ctr_enc, _gcry_aes_armv8_ce_cfb_dec) + (_gcry_aes_armv8_ce_cbc_dec, _gcry_aes_armv8_ce_ocb_crypt) + (_gcry_aes_armv8_ce_ocb_auth, _gcry_aes_armv8_ce_xts_crypt): Change + prototypes to match bulk operations. + (do_setkey): Setup bulk operations with optimized implementations. + (_gcry_aes_cfb_enc, _gcry_aes_cbc_enc, _gcry_aes_ctr_enc) + (_gcry_aes_cfb_dec, _gcry_aes_cbc_dec, _gcry_aes_ocb_crypt) + (_gcry_aes_ocb_crypt, _gcry_aes_ocb_auth, _gcry_aes_xts_crypt): Update + usage to match new prototypes, avoid prefetch and decryption + preparation on optimized code paths. + + Pass cipher object pointer to setkey functions. + + commit ca21a24808efa5d562ac91f683504ae0d6dfa69f + * cipher/cipher.c (cipher_setkey): Pass cipher object pointer to + cipher's setkey function. + * cipher/arcfour.c: Add gcry_cipher_hd_t parameter for setkey + functions and update selftests to pass NULL pointer. + * cipher/blowfish.c: Ditto. + * cipher/camellia-glue.c: Ditto. + * cipher/cast5.c: Ditto. + * cipher/chacha20.c: Ditto. + * cipher/cipher-selftest.c: Ditto. + * cipher/des.c: Ditto. + * cipher/gost28147.c: Ditto. + * cipher/idea.c: Ditto. + * cipher/rfc2268.c: Ditto. + * cipher/rijndael.c: Ditto. + * cipher/salsa20.c: Ditto. + * cipher/seed.c: Ditto. + * cipher/serpent.c: Ditto. + * cipher/twofish.c: Ditto. + * src/cipher-proto.h: Ditto. + + Add fast path for _gcry_fips_is_operational. + + commit b6e6ace324440f564df664e27f8276ef01f76795 + * src/fips.c (no_fips_mode_required): Rename to... + (_gcry_no_fips_mode_required): ...this and make externally available. + * src/g10lib.h (_gcry_no_fips_mode_required): New extern. + (fips_mode): Inline _gcry_fips_mode to macro, use + _gcry_no_fips_mode_required directly. + (fips_is_operational): Inline fips_mode check from + _gcry_fips_in_operational. + + Access cipher mode routines through routine pointers. + + commit 233e2049a2cc1c1110f541b6a7ef145a737e2c65 + * cipher/cipher-internal.h (gcry_cipher_handle): Add function pointers + for mode operations. + (_gcry_cipher_xts_crypt): Remove. + (_gcry_cipher_xts_encrypt, _gcry_cipher_xts_decrypt): New. + * cipher/cipher-xts.c (_gcry_cipher_xts_encrypt) + (_gcry_cipher_xts_decrypt): New. + * cipher/cipher.c (_gcry_cipher_setup_mode_ops): New. + (_gcry_cipher_open_internal): Setup mode routines. + (cipher_encrypt, cipher_decrypt): Remove. + (do_stream_encrypt, do_stream_decrypt, do_encrypt_none_unknown) + (do_decrypt_none_unknown): New. + (_gcry_cipher_encrypt, _gcry_cipher_decrypt, _gcry_cipher_setiv) + (_gcry_cipher_authenticate, _gcry_cipher_gettag) + (_gcry_cipher_checktag): Adapted to use mode routines through pointers. + + Add separate handlers for CBC-CTS variant. + + commit 87d8caa47e00f1b1cea968fe38cf30c0ccc9749c + * cipher/cipher-cbc.c (cbc_encrypt_inner, cbc_decrypt_inner) + (_gcry_cipher_cbc_cts_encrypt, _gcry_cipher_cbc_cts_decrypt): New. + (_gcry_cipher_cbc_encrypt, _gcry_cipher_cbc_decrypt): Remove CTS + handling. + * cipher/cipher-internal.h (_gcry_cipher_cbc_cts_encrypt) + (_gcry_cipher_cbc_cts_decrypt): New. + * cipher/cipher.c (cipher_encrypt, cipher_decrypt): Call CBC-CTS + handler if CBC-CTS flag is set. + + Avoid division by spec->blocksize in cipher mode handlers. + + commit f5168091c1930e948af8f25da11cad5dfa62c7ba + * cipher/cipher-internal.h (_gcry_blocksize_shift): New. + * cipher/cipher-cbc.c (_gcry_cipher_cbc_encrypt) + (_gcry_cipherp_cbc_decrypt): Use bit-level operations instead of + division to get number of blocks and check input length against + blocksize. + * cipher/cipher-cfb.c (_gcry_cipher_cfb_encrypt) + (_gcry_cipher_cfb_decrypt): Ditto. + * cipher/cipher-cmac.c (_gcry_cmac_write): Ditto. + * cipher/cipher-ctr.c (_gcry_cipher_ctr_crypt): Ditto. + * cipher/cipher-ofb.c (_gcry_cipher_ofb_encrypt) + (_gcry_cipher_ofb_decrypt): Ditto. + + Fix CBC-CTS+CBC-MAC flag check. + + commit a69021535b472556651eb2bab65666206c56c24b + * cipher/cipher.c (_gcry_cipher_open_internal): Check flags separately + instead of AND masking two flags to zero. + + tests/basic: silence GCC-8 warning. + + commit 2a94bdfc0538a340a24c1a7b524bb0c5f606457c + * tests/basic.c (check_ofb_cipher, check_stream_cipher): Change + tv[].data[].inlen type from signed to unsigned integer. + +2018-06-19 Will Dietz + + random: Fix hang of _gcry_rndjent_get_version. + + commit 355f5b7f69075c010fe33aa5b10ac60c08fae0c7 + * random/rndjent.c (_gcry_rndjent_get_version): Move locking. + +2018-06-13 NIIBE Yutaka + + ecc: Add blinding for ECDSA. + + commit 9010d1576e278a4274ad3f4aa15776c28f6ba965 + * cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_sign): Blind secret D with + randomized nonce B. + +2018-06-06 Werner Koch + + ecc: Improve gcry_mpi_ec_curve_point. + + commit 7b6c2afd699e889f5f054cc3d202a61bd0ee1dcf + * mpi/ec.c (_gcry_mpi_ec_curve_point): Check range of coordinates. + * tests/t-mpi-point.c (point_on_curve): New. + +2018-06-05 Werner Koch + + mpi: New internal function _gcry_mpi_cmpabs. + + commit 6606ae44e0de1069b29dd4215ee9748280940e1b + * mpi/mpi-cmp.c (_gcry_mpi_cmp): Factor out to ... + (do_mpi_cmp): New. Add arg absmode. + (_gcry_mpi_cmpabs): New. + * src/gcrypt-int.h (mpi_cmpabs): New macro. + +2018-04-29 Werner Koch + + build: Convince gcc not to delete NULL ptr checks. + + commit 61dbb7c08ab11c10060e193b52e3e1d2ec6dd062 + * configure.ac: Try to use -fno-delete-null-pointer-checks. + +2018-04-28 Werner Koch + + prime: Avoid rare assertion failure in gcry_prime_check. + + commit f3362f10f6f671246c38115ed12b0047966c200e + * cipher/primegen.c (is_prime): Don't fail on the assert X > 1. + +2018-04-17 Werner Koch + + mpi: Fix for buidling for MIPS64 with Clang. + + commit e7ae0ae243c8978a67c802169183187d88557be8 + * mpi/longlong.h [MIPS64][__clang__]: Use the C version like we + already do for 32 bit MIPS. + +2018-04-11 NIIBE Yutaka + + hmac: Use xtrymalloc. + + commit 3e3b520fb32a37c5c23762531a7b3168e112ac36 + * src/hmac256.c (_gcry_hmac256_new): Use xtrymalloc. + (_gcry_hmac256_file): Likewise. + +2018-04-10 Jussi Kivilinna + + basic_all_hwfeature_combinations.sh: use $njobs to limit parallel tasks. + + commit 5e01705ca90830c27a4cbd8bad41243915f4538a + * tests/basic_all_hwfeature_combinations.sh: Use $njobs to limit + parallel tasks instead of fixed number "8". + + Faster look-up for spec by algo for digests, ciphers and MAC. + + commit 634a85412a4073aa1890589ce5e97eac7b0f3ca3 + * cipher/cipher.c (cipher_list_algo0, cipher_list_algo301): New cipher + spec lists with same order and spacing as 'gcry_cipher_algos' + enumeration. + (spec_from_algo): Use new spec lists for faster look-up. + * cipher/mac.c (mac_list_algo101, mac_list_algo201, mac_list_algo401) + (mac_list_algo501): New MAC spec lists with same order and spacing as + 'gcry_mac_algos' enumeration. + (spec_from_algo): Use new spec lists for faster look-up. + * cipher/md.c (digest_list_algo0, digest_list_algo301): New digest + spec lists with same order and spacing as 'gcry_md_algos' + enumeration. + (spec_from_algo): Use new spec lists for faster look-up. + + Fix building with BLAKE2 disabled. + + commit 35b59d0ea52e8a1c30c43554dc4dbca97da4bf87 + * cipher/md.c (md_setkey): Enclose Blake2 part with USE_BLAKE2. + + Add missing BLAKE2, SM3 and GOSTR3411_CP to MAC-HMAC interface. + + commit 52e52eb0e3e5541cfc86e04c5047500db5d538b7 + * cipher/mac-hmac.c (map_mac_algo_to_md): Add GOSTR3411_CP, BLAKE2 and + SM3. + (_gcry_mac_type_spec_hmac_gost3411_cp) + (_gcry_mac_type_spec_hmac_blake2b_512) + (_gcry_mac_type_spec_hmac_blake2b_384) + (_gcry_mac_type_spec_hmac_blake2b_256) + (_gcry_mac_type_spec_hmac_blake2b_160) + (_gcry_mac_type_spec_hmac_blake2s_256) + (_gcry_mac_type_spec_hmac_blake2s_224) + (_gcry_mac_type_spec_hmac_blake2s_160) + (_gcry_mac_type_spec_hmac_blake2s_128) + (_gcry_mac_type_spec_hmac_sm3): New. + * cipher/mac-internal.h (_gcry_mac_type_spec_hmac_gost3411_cp) + (_gcry_mac_type_spec_hmac_blake2b_512) + (_gcry_mac_type_spec_hmac_blake2b_384) + (_gcry_mac_type_spec_hmac_blake2b_256) + (_gcry_mac_type_spec_hmac_blake2b_160) + (_gcry_mac_type_spec_hmac_blake2s_256) + (_gcry_mac_type_spec_hmac_blake2s_224) + (_gcry_mac_type_spec_hmac_blake2s_160) + (_gcry_mac_type_spec_hmac_blake2s_128) + (_gcry_mac_type_spec_hmac_sm3): New. + * cipher/mac.c (mac_list): Add GOSTR3411_CP, BLAKE2 and SM3. + * src/gcrypt.h.in (GCRY_MAC_HMAC_GOSTR3411_CP) + (GCRY_MAC_HMAC_BLAKE2B_512, GCRY_MAC_HMAC_BLAKE2B_384) + (GCRY_MAC_HMAC_BLAKE2B_256, GCRY_MAC_HMAC_BLAKE2B_160) + (GCRY_MAC_HMAC_BLAKE2S_256, GCRY_MAC_HMAC_BLAKE2S_224) + (GCRY_MAC_HMAC_BLAKE2S_160, GCRY_MAC_HMAC_BLAKE2S_128) + (GCRY_MAC_HMAC_SM3): New. + +2018-04-10 NIIBE Yutaka + + random: Protect another use of jent_rng_collector. + + commit 0de2a22fcf6607d0aecb550feefa414cee3731b2 + * random/rndjent.c (_gcry_rndjent_get_version): Lock the access. + +2018-03-28 Jussi Kivilinna + + aarch64/assembly: only use the lower 32 bit of an int parameters. + + commit 9b58e4a03ba3aeff7bae3f40da706977870c9649 + * cipher/camellia-aarch64.S (_gcry_camellia_arm_encrypt_block) + (__gcry_camellia_arm_decrypt_block): Make comment section about input + registers match usage. + * cipher/rijndael-armv8-aarch64-ce.S (_gcry_aes_ocb_auth_armv8_ce): Use + 'w12' and 'w7' instead of 'x12' and 'x7'. + (_gcry_aes_xts_enc_armv8_ce, _gcry_aes_xts_dec_armv8_ce): Fix function + prototype in comments. + * mpi/aarch64/mpih-add1.S: Use 32-bit registers for 32-bit mpi_size_t + parameters. + * mpi/aarch64/mpih-mul1.S: Ditto. + * mpi/aarch64/mpih-mul2.S: Ditto. + * mpi/aarch64/mpih-mul3.S: Ditto. + * mpi/aarch64/mpih-sub1.S: Ditto. + + poly1305: silence compiler warning on clang/aarch64. + + commit 8cdb010f04528703a502344e00d52447de12547d + * cipher/poly1305.c (MUL_MOD_1305_64): cast zero constant to 64-bits. + +2018-03-28 Martin Storsj=C3=B6 + + aarch64: Enable building the aarch64 cipher assembly for windows. + + commit 0de2191a07d69ef1fa34ca4c5d5fc4985ff7b4c4 + * cipher/asm-common-aarch64.h: New. + * cipher/camellia-aarch64.S: Use ELF macro, use x19 instead of x18. + * cipher/chacha20-aarch64.S: Use ELF macro, don't use GOT on windows. + * cipher/cipher-gcm-armv8-aarch64-ce.S: Use ELF macro. + * cipher/rijndael-aarch64.S: Use ELF macro. + * cipher/rijndael-armv8-aarch64-ce.S: Use ELF macro. + * cipher/sha1-armv8-aarch64-ce.S: Use ELF macro. + * cipher/sha256-armv8-aarch64-ce.S: Use ELF macro. + * cipher/twofish-aarch64.S: Use ELF macro. + * configure.ac: Don't require .size and .type in aarch64 assembly check. + + aarch64: camellia: Only use the lower 32 bit of an int parameter. + + commit 4e1b628f492643d4e9b830bcdab7b49daaec5854 + * cipher/camellia-aarch64.S: Use 'w3' instead of 'x3'. + + aarch64: Fix assembling chacha20-aarch64.S with clang/llvm. + + commit 36e916fc332eda74963192b1c0bf6860a3e5d67b + * cipher/chacha20-aarch64.S: Remove superfluous lane counts. + + aarch64: mpi: Fix building the mpi aarch64 assembly for windows. + + commit ec0a2f25c0f64a7b65b373508ce9081e10461965 + * mpi/aarch64/mpih-add1.S: Use ELF macro. + * mpi/aarch64/mpih-mul1.S: Use ELF macro. + * mpi/aarch64/mpih-mul2.S: Use ELF macro. + * mpi/aarch64/mpih-mul3.S: Use ELF macro. + * mpi/aarch64/mpih-sub1.S: Use ELF macro. + * mpi/asm-common-aarch64.h: New. + + random: Don't assume that _WIN64 implies x86_64. + + commit ed41d6d6fb4551342b22ef763de1bd60e964e186 + * random/rndw32.c: Change _WIN64 ifdef into __x86_64__. + +2018-03-22 Jussi Kivilinna + + tests/aeswrap: add in-place encryption/decryption testing. + + commit 885f031fbd17abc1c0fedbb98df22823b647fc11 + * tests/aeswrap.c (check): Rename to... + (check_one): ...this and add in-place testing. + (check): New. + +2018-03-22 Stephan Mueller + + AES-KW: fix in-place encryption. + + commit 330ec66e0babdabb658dc7d6db78f37b2a1b996e + * cipher/cipher-aeswrap.c: move memmove call before KW IV setting + +2018-03-22 Jussi Kivilinna + + bench-slope: add CPU frequency auto-detection. + + commit 617f5e746f8295cc36d1002c8c53edc95d04d0f6 + * tests/bench-slope.c (bench_obj): Add 'hd'. + (bench_encrypt_init, bench_encrypt_free, bench_encrypt_do_bench) + (bench_decrypt_do_bench, bench_xts_encrypt_init) + (bench_xts_encrypt_do_bench, bench_xts_decrypt_do_bench) + (bench_ccm_encrypt_init, bench_ccm_encrypt_do_bench) + (bench_ccm_decrypt_do_bench, bench_aead_encrypt_init) + (bench_aead_encrypt_do_bench, bench_aead_decrypt_do_bench) + (bench_hash_init, bench_hash_free, bench_hash_do_bench) + (bench_mac_init, bench_mac_free, bench_mac_do_bench): Use 'obj->hd' + for storing pointer to crypto context. + (auto_ghz): New. + (do_slope_benchmark): Rename to... + (slope_benchmark): ...this. + (auto_ghz_init, auto_ghz_free, auto_ghz_bench, auto_ghz_detect_ops) + (get_auto_ghz, do_slope_benchmark): New. + (double_to_str): Round number larger than 1000 to integer. + (bench_print_result_csv, bench_print_result_std) + (bench_print_result, bench_print_header, cipher_bench_one) + (hash_bench_one, mac_bench_one, kdf_bench_one, kdf_bench): Add + auto-detected frequency printing. + (print_help): Help for CPU speed auto-detection mode. + (main): Add parsing for "--cpu-mhz auto". + + _gcry_burn_stack: use memset for clearing memory. + + commit 3841b23c0ccb24d555b7570083bba958e3126d26 + * src/misc.c (__gcry_burn_stack) [HAVE_VLA]: Use 'memset' for clearing + stack. + + Improve constant-time buffer compare. + + commit a1127dbbada4302abf09eec90fbaceca87bfcdf0 + * cipher/bufhelp.h (buf_eq_const): Rewrite logic. + +2018-02-16 Jussi Kivilinna + + Add Intel SHA Extensions accelerated SHA256 implementation. + + commit 0b3ec359e2279c3b46b171372b1b7733bba20cd7 + * cipher/Makefile.am: Add 'sha256-intel-shaext.c'. + * cipher/sha256-intel-shaext.c: New. + * cipher/sha256.c (USE_SHAEXT) + (_gcry_sha256_transform_intel_shaext): New. + (SHA256_CONTEXT): Add 'use_shaext'. + (sha256_init, sha224_init) [USE_SHAEXT]: Use shaext if supported. + (transform) [USE_SHAEXT]: Use shaext if enabled. + (transform): Only add ASM_EXTRA_STACK if returned burn length is not + zero. + * configure.ac: Add 'sha256-intel-shaext.lo'. + + Add Intel SHA Extensions accelerated SHA1 implementation. + + commit d02958bd300d2c80bc92b1e072103e95e256b297 + * cipher/Makefile.am: Add 'sha1-intel-shaext.c'. + * cipher/sha1-intel-shaext.c: New. + * cipher/sha1.c (USE_SHAEXT, _gcry_sha1_transform_intel_shaext): New. + (sha1_init) [USE_SHAEXT]: Use shaext implementation is supported. + (transform) [USE_SHAEXT]: Use shaext if enabled. + (transform): Only add ASM_EXTRA_STACK if returned burn length is not + zero. + * cipher/sha1.h (SHA1_CONTEXT): Add 'use_shaext'. + * configure.ac: Add 'sha1-intel-shaext.lo'. + (shaextsupport, gcry_cv_gcc_inline_asm_shaext): New. + * src/g10lib.h: Add HWF_INTEL_SHAEXT and reorder HWF flags. + * src/hwf-x86.c (detect_x86_gnuc): Detect SHA Extensions. + * src/hwfeatures.c (hwflist): Add 'intel-shaext'. + + AVX implementation of BLAKE2s. + + commit da58a62ac1b7a8d97b0895dcb41d15af531e45e5 + * cipher/Makefile.am: Add 'blake2s-amd64-avx.S'. + * cipher/blake2.c (USE_AVX, _gry_blake2s_transform_amd64_avx): New. + (BLAKE2S_CONTEXT) [USE_AVX]: Add 'use_avx'. + (blake2s_transform): Rename to ... + (blake2s_transform_generic): ... this. + (blake2s_transform): New. + (blake2s_final): Pass 'ctx' pointer to transform function instead of + 'S'. + (blake2s_init_ctx): Check HW features and enable AVX implementation + if supported. + * cipher/blake2s-amd64-avx.S: New. + * configure.ac: Add 'blake2s-amd64-avx.lo'. + +2018-02-04 Jussi Kivilinna + + AVX2 implementation of BLAKE2b. + + commit af7fc732f9a7af7a70276f1e8364d2132db314f1 + * cipher/Makefile.am: Add 'blake2b-amd64-avx2.S'. + * cipher/blake2.c (USE_AVX2, ASM_FUNC_ABI, ASM_EXTRA_STACK) + (_gry_blake2b_transform_amd64_avx2): New. + (BLAKE2B_CONTEXT) [USE_AVX2]: Add 'use_avx2'. + (blake2b_transform): Rename to ... + (blake2b_transform_generic): ... this. + (blake2b_transform): New. + (blake2b_final): Pass 'ctx' pointer to transform function instead of + 'S'. + (blake2b_init_ctx): Check HW features and enable AVX2 implementation + if supported. + * cipher/blake2b-amd64-avx2.S: New. + * configure.ac: Add 'blake2b-amd64-avx2.lo'. + +2018-01-31 Jussi Kivilinna + + Fix incorrect counter overflow handling for GCM. + + commit ffdc6f3623a0bcb41324d562340b2cd1c288e387 + * cipher/cipher-gcm.c (gcm_ctr_encrypt): New function to handle + 32-bit CTR increment for GCM. + (_gcry_cipher_gcm_encrypt, _gcry_cipher_gcm_decrypt): Do not use + generic CTR implementation directly, use gcm_ctr_encrypt instead. + * tests/basic.c (_check_gcm_cipher): Add test-vectors for 32-bit + CTR overflow. + (check_gcm_cipher): Add 'split input to 15 bytes and 17 bytes' + test-runs. + +2018-01-22 Jussi Kivilinna + + Fix use of AVX instructions in Chaha20 SSSE3 implementation. + + commit 0b55f349a8b8f4b0ac9ed724c2d5b8dcc9f5401c + * cipher/chacha20-amd64-ssse3.S: Replace two 'vmovdqa' instructions + with 'movdqa'. + +2018-01-20 Jussi Kivilinna + + doc: fix double "See" in front of reference. + + commit bd75f0e89817b5708c57efab49e3eb4e035186e2 + * doc/gcrypt.texi: Change @xref to @ref when text already has 'see' in + the front. + + Add EAX mode. + + commit e8629e535bd0e9711b07904d4501de8ad57aaecd + * cipher/Makefile.am: Add 'cipher-eax.c'. + * cipher/cipher-cmac.c (cmac_write): Rename to ... + (_gcry_cmac_write): ... this; Take CMAC context as new input + parameter; Return error code. + (cmac_generate_subkeys): Rename to ... + (_gcry_cmac_generate_subkeys): ... this; Take CMAC context as new + input parameter; Return error code. + (cmac_final): Rename to ... + (_gcry_cmac_final): ... this; Take CMAC context as new input + parameter; Return error code. + (cmac_tag): Take CMAC context as new input parameter. + (_gcry_cmac_reset): New. + (_gcry_cipher_cmac_authenticate): Remove duplicate tag flag check; + Adapt to changes above. + (_gcry_cipher_cmac_get_tag): Adapt to changes above. + (_gcry_cipher_cmac_check_tag): Ditto. + (_gcry_cipher_cmac_set_subkeys): Ditto. + * cipher-eax.c: New. + * cipher-internal.h (gcry_cmac_context_t): New. + (gcry_cipher_handle): Update u_mode.cmac; Add u_mode.eax. + (_gcry_cmac_write, _gcry_cmac_generate_subkeys, _gcry_cmac_final) + (_gcry_cmac_reset, _gcry_cipher_eax_encrypt, _gcry_cipher_eax_decrypt) + (_gcry_cipher_eax_set_nonce, _gcry_cipher_eax_authenticate) + (_gcry_cipher_eax_get_tag, _gcry_cipher_eax_check_tag) + (_gcry_cipher_eax_setkey): New prototypes. + * cipher/cipher.c (_gcry_cipher_open_internal, cipher_setkey) + (cipher_reset, cipher_encrypt, cipher_decrypt, _gcry_cipher_setiv) + (_gcry_cipher_authenticate, _gcry_cipher_gettag, _gcry_cipher_checktag) + (_gcry_cipher_info): Add EAX mode. + * doc/gcrypt.texi: Add EAX mode. + * src/gcrypt.h.in (GCRY_CIPHER_MODE_EAX): New. + * tests/basic.c (_check_gcm_cipher, _check_poly1305_cipher): Constify + test vectors array. + (_check_eax_cipher, check_eax_cipher): New. + (check_ciphers, check_cipher_modes): Add EAX mode. + * tests/bench-slope.c (bench_eax_encrypt_do_bench) + (bench_eax_decrypt_do_bench, bench_eax_authenticate_do_bench) + (eax_encrypt_ops, eax_decrypt_ops, eax_authenticate_ops): New. + (cipher_modes): Add EAX mode. + * tests/benchmark.c (cipher_bench): Add EAX mode. + + cipher: constify spec arrays. + + commit cd7ed2e3546b12dd98df4211949f1cdbf5827013 + * cipher/cipher.c (cipher_list): Constify array. + * cipher/mac.c (mac_list): Constify array. + * cipher/md.c (digest_list): Constify array. + * cipher/pubkey.c (pubkey_list): Constify array. + + Add ARMv8/CE acceleration for AES-XTS. + + commit 93503c127a52c1f6a193750e2bf181a744ba3e6b + * cipher/rijndael-armv8-aarch32-ce.S (_gcry_aes_xts_enc_armv8_ce) + (_gcry_aes_xts_dec_armv8_ce): New. + * cipher/rijndael-armv8-aarch64-ce.S (_gcry_aes_xts_enc_armv8_ce) + (_gcry_aes_xts_dec_armv8_ce): New. + * cipher/rijndael-armv8-ce.c (_gcry_aes_xts_enc_armv8_ce) + (_gcry_aes_xts_dec_armv8_ce, xts_crypt_fn_t) + (_gcry_aes_armv8_ce_xts_crypt): New. + * cipher/rijndael.c (_gcry_aes_armv8_ce_xts_crypt): New. + (_gcry_aes_xts_crypt) [USE_ARM_CE]: New. + +2018-01-09 Jussi Kivilinna + + rijndael-ssse3: call assembly functions directly. + + commit c3d60acc3ab5c6d60c2258882175bf31351cc998 + * cipher/rijndael-ssse3-amd64-asm.S (_gcry_aes_ssse3_enc_preload) + (_gcry_aes_ssse3_dec_preload, _gcry_aes_ssse3_encrypt_core) + (_gcry_aes_ssse3_decrypt_core, _gcry_aes_schedule_core): Add + ENTER_SYSV_FUNC_PARAMS_* at function entry and EXIT_SYSV_FUNC at exit. + (_gcry_aes_ssse3_encrypt_core, _gcry_aes_ssse3_decrypt_core): Change + to input parameters to RDI and RSI registers. + * cipher/rijndael-ssse3-amd64.c (_gcry_aes_ssse3_encrypt_core) + (_gcry_aes_ssse3_decrypt_core, _gcry_aes_schedule_core): Add parameters + for function prototypes. + (PUSH_STACK_PTR, POP_STACK_PTR): Remove. + (vpaes_ssse3_prepare_enc, vpaes_ssse3_prepare_dec) + (_gcry_aes_ssse3_do_setkey, _gcry_aes_ssse3_prepare_decryption) + (do_vpaes_ssse3_enc, do_vpaes_ssse3_dec): Remove inline assembly to + call functions, and call directly instead. + + Move AMD64 MS to SysV calling convention conversion to assembly side. + + commit a518b6680ea80a4325731028545a701c1d71fc02 + * cipher/Makefile.am: Add 'asm-common-amd64.h'. + * cipher/asm-common-amd64.h: New. + * cipher/blowfish-amd64.S: Add ENTER_SYSV_FUNC_* and EXIT_SYSV_FUNC for + each global function from 'asm-common-amd64.h'. + * cipher/cast5-amd64.S: Ditto. + * cipher/des-amd64.S: Ditto. + * cipher/rijndael-amd64.S: Ditto. + * cipher/twofish-amd64.S: Ditto. + * cipher/arcfour-amd64.S: Ditto. + * cipher/blowfish.c [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] + (call_sysv_fn): Remove. + * cipher/cast5.c [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] + (call_sysv_fn): Remove. + * cipher/twofish.c [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] + (call_sysv_fn, call_sysv_fn5, call_sysv_fn6): Remove. + * cipher/rijndael.c (do_encrypt, do_decrypt) + [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS]: Remove assembly block for + calling SysV ABI function. + * cipher/arcfour.c [USE_AMD64_ASM] (encrypt_stream): Ditto. + + Make BMI2 inline assembly check more robust. + + commit 135250e3060e79be698d4f36a819aa8a880789f8 + * configure.ac (gcry_cv_gcc_inline_asm_bmi2): New assembly test. + + Add AES-NI acceleration for AES-XTS. + + commit a00c5b2988cea256c7823a76ce601febf02c790f + * cipher/cipher-internal.h (gcry_cipher_handle): Change bulk + XTS function to take cipher context. + * cipher/cipher-xts.c (_gcry_cipher_xts_crypt): Ditto. + * cipher/cipher.c (_gcry_cipher_open_internal): Setup AES-NI + XTS bulk function. + * cipher/rijndael-aesni.c (xts_gfmul_const, _gcry_aes_aesni_xts_enc) + (_gcry_aes_aesni_xts_enc, _gcry_aes_aesni_xts_crypt): New. + * cipher/rijndael.c (_gcry_aes_aesni_xts_crypt) + (_gcry_aes_xts_crypt): New. + * src/cipher.h (_gcry_aes_xts_crypt): New. + + AES-NI improvements for AMD64. + + commit c9e9cb2eb6a1c659d3825ca627228b732f2f2152 + * cipher/rijndael-aesni.c [__x86_64__] (aesni_prepare_7_15_variable) + (aesni_prepare_7_15, aesni_cleanup_7_15, do_aesni_enc_vec8) + (do_aesni_dec_vec8, do_aesni_ctr_8): New. + (_gcry_aes_aesni_ctr_enc, _gcry_aes_aesni_cfb_dec) + (_gcry_aes_aesni_cbc_dec, aesni_ocb_enc, aesni_ocb_dec) + (_gcry_aes_aesni_ocb_auth) [__x86_64__]: Add 8 parallel blocks + processing. + + Add ARMv8/AArch64 implementation of chacha20. + + commit b3ec0f752c925cde36f560f0f9309ab6450bbfd9 + * cipher/Makefile.am: Add 'chacha20-aarch64.S'. + * cipher/chacha20-aarch64.S: New. + * cipher/chacha20.c (USE_AARCH64_SIMD): New. + (_gcry_chacha20_aarch_blocks4): New. + (chacha20_do_setkey): Add HWF selection for Aarch64 implementation. + * configure.ac: Add 'chacha20-aarch64.lo'. + + New ChaCha implementations. + + commit 172ad09cbedc893f147180875335f4c525393c0b + * cipher/Makefile.am: Remove 'chacha20-sse2-amd64.S', + 'chacha20-ssse3-amd64.S', 'chacha20-avx2-amd64.S'; Add + 'chacha20-amd64-ssse3.S', 'chacha20-amd64-avx2.S'. + * cipher/chacha20-amd64-avx2.S: New. + * cipher/chacha20-amd64-ssse3.S: New. + * cipher/chacha20-armv7-neon.S: Rewrite. + * cipher/chacha20-avx2-amd64.S: Remove. + * cipher/chacha20-sse2-amd64.S: Remove. + * cipher/chacha20-ssse3-amd64.S: Remove. + * cipher/chacha20.c (CHACHA20_INPUT_LENGTH, USE_SSE2, USE_NEON) + (ASM_EXTRA_STACK, chacha20_blocks_t, _gcry_chacha20_amd64_sse2_blocks) + (_gcry_chacha20_amd64_ssse3_blocks, _gcry_chacha20_amd64_avx2_blocks) + (_gcry_chacha20_armv7_neon_blocks, QROUND, QOUT, chacha20_core) + (chacha20_do_encrypt_stream): Remove. + (_gcry_chacha20_amd64_ssse3_blocks4, _gcry_chacha20_amd64_avx2_blocks8) + (_gcry_chacha20_armv7_neon_blocks4, ROTATE, XOR, PLUS, PLUSONE) + (QUARTERROUND, BUF_XOR_LE32): New. + (CHACHA20_context_s, chacha20_blocks, chacha20_keysetup) + (chacha20_encrypt_stream): Rewrite. + (chacha20_do_setkey): Adjust for new CHACHA20_context_s. + * configure.ac: Remove 'chacha20-sse2-amd64.lo', + 'chacha20-ssse3-amd64.lo', 'chacha20-avx2-amd64.lo'; Add + 'chacha20-amd64-ssse3.lo', 'chacha20-amd64-avx2.lo'. + + New Poly1305 implementations. + + commit b9a471ccf5f02f89e25c7ccc29898d0e4e486099 + * cipher/Makefile.am: Include '../mpi' for 'longlong.h'; Remove + 'poly1305-sse2-amd64.S', 'poly1305-avx2-amd64.S' and + 'poly1305-armv7-neon.S'. + * cipher/poly1305-armv7-neon.S: Remove. + * cipher/poly1305-avx2-amd64.S: Remove. + * cipher/poly1305-sse2-amd64.S: Remove. + * cipher/poly1305-internal.h (POLY1305_BLOCKSIZE) + (POLY1305_STATE): New. + (POLY1305_SYSV_FUNC_ABI, POLY1305_REF_BLOCKSIZE) + (POLY1305_REF_STATESIZE, POLY1305_REF_ALIGNMENT) + (POLY1305_USE_SSE2, POLY1305_SSE2_BLOCKSIZE, POLY1305_SSE2_STATESIZE) + (POLY1305_SSE2_ALIGNMENT, POLY1305_USE_AVX2, POLY1305_AVX2_BLOCKSIZE) + (POLY1305_AVX2_STATESIZE, POLY1305_AVX2_ALIGNMENT) + (POLY1305_USE_NEON, POLY1305_NEON_BLOCKSIZE, POLY1305_NEON_STATESIZE) + (POLY1305_NEON_ALIGNMENT, POLY1305_LARGEST_BLOCKSIZE) + (POLY1305_LARGEST_STATESIZE, POLY1305_LARGEST_ALIGNMENT) + (POLY1305_STATE_BLOCKSIZE, POLY1305_STATE_STATESIZE) + (POLY1305_STATE_ALIGNMENT, OPS_FUNC_ABI, poly1305_key_s) + (poly1305_ops_s): Remove. + (poly1305_context_s): Rewrite. + * cipher/poly1305.c (_gcry_poly1305_amd64_sse2_init_ext) + (_gcry_poly1305_amd64_sse2_finish_ext) + (_gcry_poly1305_amd64_sse2_blocks, poly1305_amd64_sse2_ops) + (poly1305_init_ext_ref32, poly1305_blocks_ref32) + (poly1305_finish_ext_ref32, poly1305_default_ops) + (_gcry_poly1305_amd64_avx2_init_ext) + (_gcry_poly1305_amd64_avx2_finish_ext) + (_gcry_poly1305_amd64_avx2_blocks) + (poly1305_amd64_avx2_ops, poly1305_get_state): Remove. + (poly1305_init): Rewrite. + (USE_MPI_64BIT, USE_MPI_32BIT): New. + [USE_MPI_64BIT] (ADD_1305_64, MUL_MOD_1305_64, poly1305_blocks) + (poly1305_final): New implementation using 64-bit limbs. + [USE_MPI_32BIT] (UMUL_ADD_32, ADD_1305_32, MUL_MOD_1305_32) + (poly1305_blocks): New implementation using 32-bit limbs. + (_gcry_poly1305_update, _gcry_poly1305_finish) + (_gcry_poly1305_init): Adapt to new implementation. + * configure.ac: Remove 'poly1305-sse2-amd64.lo', + 'poly1305-avx2-amd64.lo' and 'poly1305-armv7-neon.lo'. + + mpi/ec: fix when 'unsigned long' is 32-bit but limb size is 64-bit. + + commit d39deb0a41dbeec81174704904d3d29c66d10d7e + * mpi/ec.c (ec_addm_25519, ec_subm_25519, ec_mulm_25519): Cast '1' to + mpi_limb_t before left shift. + +2017-11-24 Werner Koch + + sexp: Avoid a fatal error in case of ENOMEM in called functions. + + commit 2ad912d5b7794fb32192fddab1b559c7b86303a2 + * src/sexp.c (do_vsexp_sscan): Replace BUG() by a proper error + return. Replace sprintf by snprintf. + (convert_to_hex): Replace sprintf by snprintf. + (convert_to_string): Ditto. + (_gcry_sexp_sprint): Ditto. + + api: Add GCRYCTL_AUTO_EXPAND_SECMEM. + + commit 1f6b2f6099ebcfd785e2d2ae0aeca810394dbbac + * src/gcrypt.h.in (GCRYCTL_AUTO_EXPAND_SECMEM): New enum. + * src/global.c (_gcry_vcontrol): Implement that. + * src/secmem.c (auto_expand): New var. + (_gcry_secmem_set_auto_expand): New. + (_gcry_secmem_malloc_internal): Act upon AUTO_EXPAND. + +2017-11-14 NIIBE Yutaka + + tests: Add HAVE_MMAP check for MinGW. + + commit c594f187bd457b757112adc551ffa4db92962dc1 + * tests/t-secmem.c (main): Conditionalize with HAVE_MMAP. + +2017-11-09 NIIBE Yutaka + + Fix secmem test for machine with larger page. + + commit 621f5c4e837347308a6b06a8cfbfc47ca9fae69e + * tests/t-secmem.c (main): Detect page size and setup chunk size. + * src/secmem.c (init_pool): Simplify the expression. + +2017-10-25 NIIBE Yutaka + + Add OID information for SM3. + + commit 94b84360ca55c407222a3eb8222d8b1816fc617f + * cipher/sm3.c (asn_sm3, oid_spec_sm3): New. + (_gcry_digest_spec_sm3): Add asn_sm3, oid_spec_sm3. + +2017-10-24 Jia Zhang + + Add crypto hash SM3. + + commit 4423bf3cc4432b9bfe801ff74cb05e6f0dd3eccd + * configure.ac (available_digests): Add sm3. + * src/cipher.h: Add declarations for SM3. + * cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add sm3.c. + * cipher/md.c [USE_SM3] (digest_list): Add _gcry_digest_spec_sm3. + * cipher/pubkey-util.c (hashnames): Add "sm3". + * cipher/sm3.c: New. + * tests/basic.c (check_digests): Add test vectors for SM3. + * tests/hashtest-256g.in (algos): Add SM3. + * tests/hashtest.c (testvectors): Add for SM3. + +2017-10-24 NIIBE Yutaka + + Add new constant GCRY_MD_SM3 for crypto hash SM3. + + commit 5b31e22d9fc542bdccb1586ef2c83d9794a731d3 + * src/gcrypt.h.in (GCRY_MD_SM3): New. + +2017-10-17 Werner Koch + + api: New function gcry_mpi_get_ui. + + commit c6e42e7ec3d1046969d783c443c13aad7cb61bb8 + * src/gcrypt.h.in (gcry_mpi_get_ui): New. + (mpi_get_ui): New macro. + * src/libgcrypt.def, src/libgcrypt.vers: Add new function. + * src/visibility.c (gcry_mpi_get_ui): New. + * src/visibility.h: Mark that function. + (gcry_mpi_get_ui): New. + * mpi/mpiutil.c (MY_UINT_MAX): New macro. + (_gcry_mpi_get_ui): Re-implemented. This function existed but was + never imported or used. + * tests/mpitests.c (test_maxsize): Add some test for this function. + +2017-08-29 NIIBE Yutaka + + Tweak GCC version check. + + commit e4dc458b0b7dc9b8417a2177ef17822d9b9064ec + * src/global.c (_gcry_vcontrol): It's GCC 4.2 which started to support + diagnostic pragma. + + random: Fix warnings on Windows. + + commit 8126a6717c80d4fc1766d7f975e872bee2f9f203 + * random/random-csprng.c (lock_seed_file): Vars with no use. + + tests: Fix warnings on Windows. + + commit a848ef44470a524c05624afb54b92cf25595acd2 + * tests/fipsdrv.c (print_dsa_domain_parameters, print_ecdsa_dq): Fix. + + ecc: Fix scratch MPI. + + commit db3a8d6890fb4a6436e082b49378c0bd891563ca + * mpi/ec.c (ec_p_init): Check if scratch MPI is allocated. + + ecc: Fix ec_mulm_25519. + + commit 1d5f726668b9cc32d6bb601f2329987058146c6c + * mpi/ec.c (ec_mulm_25519): Improve reduction to 25519. + + ecc: Use 25519 method also for ed25519. + + commit fab712d654b2ccd24696ed90bc239860a128ad5b + * cipher/ecc-curves.c (_gcry_ecc_fill_in_curve): Don't use mpi_add + since it resizes to have more limbs. + * mpi/ec.c (point_resize): Fix for Edwards curve. + (ec_p_init): Support Edwards curve. + (_gcry_mpi_ec_get_affine): Use the methods. + (dup_point_edwards, add_points_edwards, sub_points_edwards): Ditto. + (_gcry_mpi_ec_mul_point): Resize MPIs of point to fixed size. + (_gcry_mpi_ec_curve_point): Use the methods. + + ecc: Clean up curve specific method support. + + commit 1ac3d3637dd80013b78e03b9b9f582091710d908 + * src/ec-context.h (struct mpi_ec_ctx_s): Remove MOD method. + * mpi/ec.c (ec_mod_25519): Remove. + (ec_p_init): Follow the removal of the MOD method. + + ecc: Relax condition for 25519 computations. + + commit e9be23c4ad9f42c9d3198c706f912b7e27f574bc + * mpi/ec.c (ec_addm_25519, ec_subm_25519, ec_mulm_25519): Check number + of limbs, allocated more is OK. + + ecc: Fix ec_mulm_25519. + + commit 449459a2770d3aecb1f36502bf1903e0cbd2873e + * mpi/ec.c (ec_mulm_25519): Fix the cases of 0 to 18. + + ecc: field specific routines for 25519. + + commit 9ed0fb37bd637d1a2e9498c24097cfeadec682ec + * mpi/ec.c (point_resize): Improve for X25519. + (mpih_set_cond): New. + (ec_mod_25519, ec_addm_25519, ec_subm_25519, ec_mulm_25519) + (ec_mul2_25519, ec_pow2_25519): New. + (ec_p_init): Fill by FIELD_TABLE. + + ecc: Add field specific computation methods. + + commit d4cd381defe5b37dda19bbda0986bdd38065bd31 + * src/ec-context.h (struct mpi_ec_ctx_s): Add methods. + * mpi/ec.c (ec_p_init): Initialize the default methods. + (montgomery_ladder): Use the methods. + +2017-08-27 Werner Koch + + Release 1.8.1. + + commit 80fd8615048c3897b91a315cca22ab139b056ccd + * configure.ac: Set LT version to C22/A2/R1. + +2017-08-27 NIIBE Yutaka + + ecc: Add input validation for X25519. + + commit bf76acbf0da6b0f245e491bec12c0f0a1b5be7c9 + * cipher/ecc.c (ecc_decrypt_raw): Add input validation. + * mpi/ec.c (ec_p_init): Use scratch buffer for bad points. + (_gcry_mpi_ec_bad_point): New. + +2017-08-07 Marcus Brinkmann + + cipher: Add OID for SHA384WithECDSA. + + commit a7bd2cbd3eabda88fb3cac5cbc13c21c97a7b315 + * cipher/sha512.c (oid_spec_sha384): Add SHA384WithECDSA. + +2017-08-02 Werner Koch + + tests: Fix a printf glitch for a Windows test. + + commit df1e221b3012e96bbffbc7d5fd70836a9ae1cc19 + * tests/t-convert.c (check_formats): Fix print format glitch on + Windows. + * tests/t-ed25519.c: Typo fix. + + tests: Add benchmarking option to tests/random. + + commit 21d0f068a721c022f955084c28304934fd198c5e + * tests/random.c: Always include unistd.h. + (prepend_srcdir): New. + (run_benchmark): New. + (main): Add options --benchmark and --with-seed-file. Print whetehr + JENT has been used. + * tests/t-common.h (split_fields_colon): New. Taken from GnuPG. + License of that code changed to LGPLv2.1. + + random: Add more bytes to the pool in addition to the seed file. + + commit eea36574f37830a6a80b4fad884825e815b2912f + * random/random-csprng.c (read_seed_file): Read 128 or 32 butes + depending on whether we have the Jitter RNG. + +2017-08-01 Jussi Kivilinna + + Add script to run basic tests with all supported HWF combinations. + + commit 94a92a3db909aef0ebcc009c2d7f5a2663e99004 + * tests/basic_all_hwfeature_combinations.sh: New. + * tests/Makefile.am: Add basic_all_hwfeature_combinations.sh. + +2017-07-29 Jussi Kivilinna + + Fix return value type for _gcry_md_extract. + + commit cf1528e7f2761774d06ace0de48f39c96b52dc4f + * src/gcrypt-int.h (_gcry_md_extract): Use gpg_err_code_t instead of + gpg_error_t for internal function return type. + + Fix building AArch32 CE implementations when target is ARMv6 arch. + + commit 4a7aa30ae9f3ce798dd886c2f2d4164c43027748 + * cipher/cipher-gcm-armv8-aarch32-ce.S: Select ARMv8 architecure. + * cipher/rijndael-armv8-aarch32-ce.S: Ditto. + * cipher/sha1-armv8-aarch32-ce.S: Ditto. + * cipher/sha256-armv8-aarch32-ce.S: Ditto. + * configure.ac (gcry_cv_gcc_inline_asm_aarch32_crypto): Ditto. + +2017-07-25 NIIBE Yutaka + + sexp: Add fall through annotation. + + commit b7cd44335d9cde43be6f693dca6399ed0762649c + * src/dumpsexp.c (parse_and_print): It's fall through. + +2017-07-24 Werner Koch + + random: Fix the command line munging for jitterbase. + + commit ac39522ab08fcd2483edc223334c6ab9d19e91f3 + * random/Makefile.am (o_flag_munging): Make the first sed term also + global. + +2017-07-19 NIIBE Yutaka + + Remove byte order mark. + + commit 1d8e4c2c3a7d0a4154caf5bd720a9a0b04179390 + * random/jitterentropy-base.c, random/jitterentropy.h: Remove + byte order mark. + +2017-07-18 Werner Koch + + Release 1.8.0. + + commit 850aca744eeda5fd410f478a0778e353045ac962 + + + mac: Add selftests for HMAC-SHA3-xxx. + + commit 95194c550443e8d5558856633f920daec8a975c4 + * cipher/hmac-tests.c (check_one): Add arg trunc and change all + callers to pass false. + (selftests_sha3): New. + (run_selftests): Call new selftests. + + api: New function gcry_mpi_point_copy. + + commit ecf73dafb7aafed0d0f339d07235b58c2113f94c + * src/gcrypt.h.in (gcry_mpi_point_copy): New. + (mpi_point_copy): New macro. + * src/visibility.c (gcry_mpi_point_copy): New. + * src/libgcrypt.def, src/libgcrypt.vers: Add function. + * mpi/ec.c (_gcry_mpi_point_copy): New. + * tests/t-mpi-point.c (set_get_point): Add test. + +2017-07-17 Werner Koch + + random: Minor fix for getting the rndjent version. + + commit 9d99c6b973caa7fdf93b53cf764066214f763803 + * random/rndjent.c (_gcry_rndjent_get_version): Always set R_ACTIVE. + * tests/version.c (test_get_config): Check number of fields for + rng-type. + +2017-07-07 NIIBE Yutaka + + mpi: Minor fix of mpi_pow. + + commit 61b0f52c1cc85bf8c3cac9aba40e28682e4e1b8b + * mpi/mpi-pow.c (_gcry_mpi_powm): Allocate size fix. + + mpi: Fix mpi_pow alternative implementation. + + commit 66ed4d53789892def7b237756d8a0ab28df9d222 + * mpi/mpi-pow.c + [USE_ALGORITHM_SIMPLE_EXPONENTIATION] (_gcry_mpi_powm): Use + mpi_set_cond. + + Fix mpi_pow alternative implementation. + + commit 619ebae9847831f43314a95cc3180f4b329b4d3b + * mpi/mpi-pow.c [USE_ALGORITHM_SIMPLE_EXPONENTIATION] (_gcry_mpi_powm): + Allocate size fix. + +2017-07-06 Werner Koch + + rsa: Use modern MPI allocation function. + + commit 208aba6f9a0475ba049f5a66fe02cf9a6214a887 + * cipher/rsa.c (secret_core_crt): Use modern function _gcry_mpi_snew. + +2017-07-05 Werner Koch + + build: Minor API fixes to fix build problems on AIX. + + commit 85a9a913da9ecc6b2cd6f743e90e49983251d706 + * src/gcrypt.h.in (gcry_error_from_errno): Fix return type. + * src/visibility.c (gcry_md_extract): Change return type to match the + prototype. + + tools: Add left shift to mpicalc. + + commit 0d30a4a9791d20c8881b5b12bd44611d9f4274cd + * src/mpicalc.c (do_lshift): New. + (main): Handle '<'. + +2017-07-04 NIIBE Yutaka + + mpi: Fix mpi_set_secure. + + commit 5feaf1cc8f22c1f8d19a34850d86fe190f1432e2 + * mpi/mpiutil.c (mpi_set_secure): Allocate by ->alloced. + +2017-06-29 NIIBE Yutaka + Werner Koch + + rsa: Add exponent blinding. + + commit 8725c99ffa41778f382ca97233183bcd687bb0ce + * cipher/rsa.c (secret_core_crt): Blind secret D with randomized + nonce R for mpi_powm computation. + +2017-06-28 NIIBE Yutaka + + Same computation for square and multiply. + + commit 78130828e9a140a9de4dafadbc844dbb64cb709a + * mpi/mpi-pow.c (_gcry_mpi_powm): Compare msize for max_u_size. Move + the assignment to base_u into the loop. Copy content refered by RP to + BASE_U except the last of the loop. + +2017-06-24 Werner Koch + + rsa: Minor refactoring. + + commit e6a3dc9900433bbc8ad362a595a3837318c28fa9 + * cipher/rsa.c (secret): Factor code out to ... + (secret_core_std, secret_core_crt): new functions. + +2017-06-23 Werner Koch + + random: Add missing dependency. + + commit d091610377b2c92cf385282b1adfc30fa6cd5c75 + * random/Makefile.am (EXTRA_librandom_la_SOURCES): Fix file name. + (rndjent.o, rndjent.lo): Depend on jitterentropy-base-user.h. + + random: Update jitterentropy to 2.1.0. + + commit 8dfae89ecd3e9ae0967586cb38d12ef9111fc7cd + * random/rndjent.c (jent_get_nstime, jent_zfree) + (jent_fips_enabled, jent_zalloc): Move functions and macros to ... + * random/jitterentropy-base-user.h: this file. That files was not + used before. + * random/Makefile.am (EXTRA_librandom_la_SOURCES): Add + jitterentropy-base-user. + * random/jitterentropy-base.c: Update to version 2.1.0. + * random/jitterentropy.h: Ditto. + +2017-06-21 Werner Koch + + api: New function gcry_get_config. + + commit 27148e60ba15b0cb73b47a75c688fcb48a1a3444 + * src/misc.c (_gcry_log_info_with_dummy_fp): Remove. + * src/global.c (print_config): New arg WHAT. Remove arg FNC and use + gpgrt_fprintf directly. + (_gcry_get_config): New. + (_gcry_vcontrol) : Use _gcry_get_config instead + of print_config. + * src/gcrypt.h.in (gcry_get_config): New. + * src/libgcrypt.def, src/libgcrypt.vers: Add new function. + * src/visibility.c (gcry_get_config): New. + * src/visibility.h: Mark new function. + + * tests/version.c (test_get_config): New. + (main): Call new test. + + random: Allow building rndjent on non-x86. + + commit c2319464b03e61aaf34ef6d5f4b59b0c0483a373 + * random/jitterentropy-base.c (jent_version): Uncomment function. + * random/rndjent.c: Include time.h + (JENT_USES_RDTSC): New. + (JENT_USES_GETTIME): New. + (JENT_USES_READ_REAL_TIME): New. + (jent_get_nstime): Support clock_gettime and AIX specific + function. Taken from Stephan M=C3=BCller's code. + (is_rng_available): New. + (_gcry_rndjent_dump_stats): Use that function. + (_gcry_rndjent_poll): Use that fucntion. Allow an ADD of NULL for an + intialize only mode. + (_gcry_rndjent_get_version): New. + +2017-06-18 Jussi Kivilinna + + rijndael-padlock: change asm operands from read-only to read/write. + + commit 32b4ab209067f6f08b87b27bc78ec27dc497b708 + * cipher/rijndael-padlock.c (do_padlock): Change ESI/EDI/ECX to use + read/write operands as XCRYPT instruction modifies these registers. + +2017-06-16 Werner Koch + + random: Make rndjent.c NTG.1 compliant. + + commit 82bc052eda5b3897724c7ad11e54f8203e8e88e9 + * random/rndjent.c (_gcry_rndjent_poll): Hash the retrieved jitter. + + md: Optimize gcry_md_hash_buffers for SHA-256 and SHA-512. + + commit e6f90a392a1fd59b19b16f7a2bc7c439ae369d5f + * cipher/sha256.c (_gcry_sha256_hash_buffer): New. + (_gcry_sha256_hash_buffers): New. + * cipher/sha512.c (_gcry_sha512_hash_buffer): New. + (_gcry_sha512_hash_buffers): New. + * cipher/md.c (_gcry_md_hash_buffer): Optimize for SHA246 and SHA512. + (_gcry_md_hash_buffers): Ditto. + + random: Allow building rndjent.c with stats collecting enabled. + + commit ee3a74f5539cbc5182ce089994e37c16ce612149 + * random/rndjent.c: Change license to the one used by jitterentropy.h. + (jent_init_statistic): New. + (jent_bit_count): New. + (jent_statistic_copy_stat): new. + (jent_calc_statistic): New. + + New global config option "only-urandom". + + commit 8f6082e95f30c1ba68d2de23da90146f87f0c66c + * random/rand-internal.h (RANDOM_CONF_ONLY_URANDOM): New. + * random/random.c (_gcry_random_read_conf): Add option "only-urandom". + * random/rndlinux.c (_gcry_rndlinux_gather_random): Implement that + option. + * tests/keygen.c (main): Add option --no-quick for better manual + tests. + + Implement global config file /etc/gcrypt/random.conf. + + commit b05a4abc358b204dba343d9cfbd59fdc828c1686 + * src/hwfeatures.c (my_isascii): Move macro to ... + * src/g10lib.h: here. + * tests/random.c (main): Dump random stats. + * random/random.c (RANDOM_CONF_FILE): New. + (_gcry_random_read_conf): New. + (_gcry_random_dump_stats): Call rndjent stats. + * random/rndjent.c (jent_rng_totalcalls, jent_rng_totalbytes): New. + (_gcry_rndjent_poll): Take care of config option disable-jent. Wipe + buffer. Bump counters. + (_gcry_rndjent_dump_stats): New. + +2017-06-14 Werner Koch + + random: Add jitter RND based entropy collector. + + commit f5e7763ddca59dcd9ac9f2f4d50cb41b14a34a9e + * random/rndjent.c: New. + * random/rndlinux.c (_gcry_rndlinux_gather_random): Use rndjent. + * random/rndw32.c (_gcry_rndw32_gather_random): Use rndjent. + (slow_gatherer): Fix compiler warning. + * random/Makefile.am (librandom_la_SOURCES): Add rndjent.c + (EXTRA_librandom_la_SOURCES): Add jitterentropy-base.c and + jitterentropy.h. + (rndjent.o, rndjent.lo): New rules. + * configure.ac: New option --disbale-jent-support + (ENABLE_JENT_SUPPORT): New ac-define. + + cipher: New helper function rol64. + + commit 6c882fb1fdb6c7cba2215fa7391110d63e24b9dc + * cipher/bithelp.h (rol64): New inline functions. + + New hardware feature flag HWF_INTEL_RDTSC. + + commit 06f303a633ea2b992259688bef2b023c3f388f73 + * src/g10lib.h (HWF_INTEL_RDTSC): New. + * src/hwfeatures.c (hwflist): Add "intel-rdtsc". + * src/hwf-x86.c (detect_x86_gnuc): Get EDX features and test for TSC. + + random: Changes to original Jitter RNG implementation. + + commit a44c45675f8b631e11048a540bb1fbb7a022ebb4 + * random/jitterentropy-base.c: Change double underscore symbols and + make all functions static. + * random/jitterentropy.h: Likewise. + +2017-06-13 Stephan Mueller + + random: Add original Jitter RNG implementation. + + commit f0ae18ecf48fbe2da0b9fb3f354d0dd3173d91d3 + * random/jitterentropy-base-user.h: New. + * random/jitterentropy-base.c: New. + * random/jitterentropy.h: New. + +2017-06-08 Werner Koch + + build: Fix ChangeLog building for builds from other worktrees. + + commit cdfd7ea72a44657f037dd0dbba6e5ea0c2b344aa + * Makefile.am (gen-ChangeLog): Test for existance of ".git" regardless + on whether it is a file or directory. + +2017-06-02 NIIBE Yutaka + + secmem: Fix SEGV and stat calculation. + + commit e0958debe1a7db1bec1283115cdc6a14bf3b43e5 + * src/secmem (init_pool): Care about the header size. + (_gcry_secmem_malloc_internal): Likewise. + (_gcry_secmem_malloc_internal): Use mb->size for stats. + +2017-06-01 Jo Van Bulck + + ecc: Store EdDSA session key in secure memory. + + commit 5a22de904a0a366ae79f03ff1e13a1232a89e26b + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_sign): use mpi_snew to allocate + session key. + +2017-05-31 Werner Koch + + api: Deprecate gcry_md_info. + + commit 45c39340c9926c2c5801dbab7609687c41e9ff1f + + +2017-05-30 Werner Koch + + mpi: Distribute asm files for aarch64 and asm. + + commit c65f9558f12ffa2810538ef616e71b4052dacb81 + * mpi/aarch64/distfiles: New. + * mpi/arm/distfiles: New. + + mpi: Distribute asm definitions for amd64. + + commit 87e481137debabb7f989d7fa9b1c21c336e10c98 + * mpi/amd64/distfiles: Add mpi-asm-defs.h. + +2017-05-23 Werner Koch + + cipher: Fix compiler warnings. + + commit d764c9894013727ff82eb194da6030209c273528 + * cipher/poly1305.c (poly1305_default_ops): Move to the top. Add + prototypes and compile only if USE_SSE2 is not defined. + (poly1305_init_ext_ref32): Compile only if USE_SSE2 is not defined. + (poly1305_blocks_ref32): Ditto. + (poly1305_finish_ext_ref32): Ditto. + + doc: Comment fixes. + + commit c1bb3d9fdb6fe5f336af1d5a03fc42bfdc1f8b0b + + +2017-05-18 Jussi Kivilinna + + rijndael-ssse3: fix functions calls from assembly blocks. + + commit 4cd94994a9abec9b92fa5972869baf089a28fa76 + * cipher/rijndael-ssse3-amd64.c (PUSH_STACK_PTR, POP_STACK_PTR): New. + (vpaes_ssse3_prepare_enc, vpaes_ssse3_prepare_dec) + (_gcry_aes_ssse3_do_setkey, _gcry_aes_ssse3_prepare_decryption) + (do_vpaes_ssse3_enc, do_vpaes_ssse3_dec): Use PUSH_STACK_PTR and + POP_STACK_PTR. + + chacha20-armv7-neon: fix to use fast code path when memory is aligned. + + commit 68861ae5d3e007d7a39f14ea27dc3dd8ef13ba02 + * cipher/chacha20-armv7-neon.S (UNALIGNED_LDMIA4): Uncomment + instruction for jump to aligned code path. + + Move data in AMD64 assembly to text section. + + commit 1a094bc5b2aa730833faf593a931d4e5d7f9ab4d + * cipher/camellia-aesni-avx-amd64.S: Move data to .text section to + ensure that RIP relative addressing of data will work. + * cipher/camellia-aesni-avx2-amd64.S: Ditto. + * cipher/chacha20-avx2-amd64.S: Ditto. + * cipher/chacha20-ssse3-amd64.S: Ditto. + * cipher/des-amd64.S: Ditto. + * cipher/serpent-avx2-amd64.S: Ditto. + * cipher/sha1-avx-amd64.S: Ditto. + * cipher/sha1-avx-bmi2-amd64.S: Ditto. + * cipher/sha1-ssse3-amd64.S: Ditto. + * cipher/sha256-avx-amd64.S: Ditto. + * cipher/sha256-avx2-bmi2-amd64.S: Ditto. + * cipher/sha256-ssse3-amd64.S: Ditto. + * cipher/sha512-avx-amd64.S: Ditto. + * cipher/sha512-avx2-bmi2-amd64.S: Ditto. + * cipher/sha512-ssse3-amd64.S: Ditto. + + cast5-amd64: use 64-bit relocation with large PIC memory model. + + commit ff02fca39c83bcf30c79368611ac65e273e77f6c + * cipher/cast5-amd64.S [__code_model_large__] + (GET_EXTERN_POINTER): New. + +2017-05-13 Jussi Kivilinna + + Fix building with x86-64 medium and large memory models. + + commit 434d4f2af39033fc626044ba9a060da298522293 + * cipher/cast5-amd64.S [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] + (GET_EXTERN_POINTER): Load 64-bit address instead of 32-bit. + * cipher/rijndael.c (do_encrypt, do_decrypt) + [USE_AMD64_ASM && !HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS]: Load + table pointer through register instead of generic reference. + +2017-04-04 NIIBE Yutaka + + mpi: Simplify mpi_powm. + + commit 719468e53133d3bdf12156c5bfdea2bf15f9f6f1 + * mpi/mpi-pow.c (_gcry_mpi_powm): Simplify the loop. + +2017-03-08 Justus Winter + + build: Use macOS' compatibility macros to enable all features. + + commit 654024081cfa103c87bb163b117ea3568171d408 + * configure.ac: On macOS, use the compatibility macros to expose every + feature of the libc. This is the equivalent of _GNU_SOURCE on GNU + libc. + +2017-02-27 Jussi Kivilinna + + Add BLAKE2b and BLAKE2s hash algorithms (RFC 7693) + + commit 5bd530b8a4624f101b8d42e68f1b28bcc13f4f76 + * cipher/blake2.c: New. + * cipher/Makefile.am: Add 'blake2.c'. + * cipher/md.c (digest_list, prepare_macpads): Add BLAKE2. + (md_setkey): New. + (_gcry_md_setkey): Call 'md_setkey' for non-HMAC md. + * configure.ac: Add BLAKE2 digest. + * doc/gcrypt.texi: Add BLAKE2. + * src/cipher.h (_gcry_blake2_init_with_key) + (_gcry_digest_spec_blake2b_512, _gcry_digest_spec_blake2b_384) + (_gcry_digest_spec_blake2b_256, _gcry_digest_spec_blake2b_160) + (_gcry_digest_spec_blake2s_256, _gcry_digest_spec_blake2s_224) + (_gcry_digest_spec_blake2s_160, _gcry_digest_spec_blake2s_128): New. + * src/gcrypt.h.in (GCRY_MD_BLAKE2B_512, GCRY_MD_BLAKE2B_384) + (GCRY_MD_BLAKE2B_256, GCRY_MD_BLAKE2B_160, GCRY_MD_BLAKE2S_256) + (GCRY_MD_BLAKE2S_224, GCRY_MD_BLAKE2S_160, GCRY_MD_BLAKE2S_128): New. + * tests/basic.c (check_one_md): Add testing for keyed hashes. + (check_digests): Add BLAKE2 test vectors; Add testing for keyed hashes. + * tests/blake2b.h: New. + * tests/blake2s.h: New. + * tests/Makefile.am: Add 'blake2b.h' and 'blake2s.h'. + + Fix building with clang on ARM64/FreeBSD. + + commit da213db2c6cda6f57e5853e8c591d69bfa1cfa74 + * cipher/cipher-gcm-armv8-aarch64-ce.S: Use '.cpu generic+simd+crypto' + instead of '.arch armv8-a+crypto'. + * cipher/rijndael-armv8-aarch64-ce.S: Ditto. + * cipher/sha1-armv8-aarch64-ce.S: Ditto. + * cipher/sha256-armv8-aarch64-ce.S: Ditto. + * configure.ac (gcry_cv_gcc_inline_asm_aarch64_neon): Ditto. + (gcry_cv_gcc_inline_asm_aarch64_crypto): Ditto; and include NEON + instructions to crypto instructions check. + +2017-02-07 Justus Winter + + Fix building with a pre C99 compiler. + + commit 75d91ffeaf83098ade325bb3b6b2c8a76eb1f6a6 + * cipher/cipher-cfb.c (_gcry_cipher_cfb8_encrypt): Move the + declaration of 'i' out of the loop. + (_gcry_cipher_cfb8_decrypt): Likewise. + +2017-02-04 Mathias L. Baumann + + Implement CFB with 8-bit mode. + + commit d1ee9a660571ce4a998c9ab2299d4f2419f99127 + * cipher/cipher-cfb.c (_gcry_cipher_cfb8_encrypt) + (_gcry_cipher_cfg8_decrypt): Add 8-bit variants of decrypt/encrypt + functions. + * cipher/cipher-internal.h (_gcry_cipher_cfb8_encrypt) + (_gcry_cipher_cfg8_decrypt): Ditto. + * cipher/cipher.c: Adjust code flow to work with GCRY_CIPHER_MODE_CFB8. + * tests/basic.c: Add tests for cfb8 with AES and 3DES. + +2017-02-04 Jussi Kivilinna + + rndhw: add missing "memory" clobbers. + + commit c67c728478e8f47b6e8296b643fd35d66d4a1052 + * random/rndhw.c: (poll_padlock, rdrand_long): Add "memory" to asm + clobbers. + + Add UNLIKELY and LIKELY macros. + + commit 4b7451d3e8e7b87d8e407fbbd924ad5b13bd0f00 + * src/g10lib.h (LIKELY, UNLIKELY): New. + (gcry_assert): Use LIKELY for assert check. + (fast_wipememory2_unaligned_head): Use UNLIKELY for unaligned + branching. + * cipher/bufhelp.h (buf_cpy, buf_xor, buf_xor_1, buf_xor_2dst) + (buf_xor_n_copy_2): Ditto. + + rndhw: avoid type-punching. + + commit 37b537600f33fcf8e1c8dc2c658a142fbba44199 + * random/rndhw.c (rdrand_long, rdrand_nlong): Add 'volatile' for + pointer. + (poll_drng): Convert buffer to 'unsigned long[]' and make use of DIM + macro. + +2017-01-28 Jussi Kivilinna + + hwf-x86: avoid type-punching. + + commit 1407317a6112a23d4fec5827a9d74faef4196f66 + * src/hwf-x86.c (detect_x86_gnuc): Use union for vendor_id. + + cipher: add explicit blocksize checks to allow better optimization. + + commit efa9042f82ffed3d076b8e26ac62d29e00bb756a + * cipher/cipher-cbc.c (_gcry_cipher_cbc_encrypt) + (_gcry_cipher_cbc_decrypt): Add explicit check for cipher blocksize of + 64-bit or 128-bit. + * cipher/cipher-cfb.c (_gcry_cipher_cfb_encrypt) + (_gcry_cipher_cfb_decrypt): Ditto. + * cipher/cipher-cmac.c (cmac_write, cmac_generate_subkeys) + (cmac_final): Ditto. + * cipher/cipher-ctr.c (_gcry_cipher_ctr_encrypt): Ditto. + * cipher/cipher-ofb.c (_gcry_cipher_ofb_encrypt): Ditto. + + bufhelp: use unaligned dword and qword types for endianess helpers. + + commit e7b941c3de9c9b6319298c02f844cc0cadbf8562 + * cipher/bufhelp.h (BUFHELP_UNALIGNED_ACCESS): New, defined + if attributes 'packed', 'aligned' and 'may_alias' are supported. + (BUFHELP_FAST_UNALIGNED_ACCESS): Define if have + BUFHELP_UNALIGNED_ACCESS. + + rijndael-aesni: fix u128_t strict-aliasing rule breaking. + + commit 92b4a29d2453712192ced2d7226abc49679dcb1e + * cipher/rijndael-aesni.c (u128_t): Add attributes to tell GCC and clang + that casting from 'char *' to 'u128_t *' is ok. + + cipher-xts: fix pointer casting to wrong alignment and aliasing. + + commit 4f31d816dcc1e95dc647651e92acbdfed53f5c14 + * cipher/cipher-xts.c (xts_gfmul_byA, xts_inc128): Use buf_get_le64 + and buf_put_le64 for accessing data; Change parameter pointers to + 'unsigned char *' type. + (_gcry_cipher_xts_crypt): Do not cast buffer pointers to 'u64 *' + for helper functions. + + crc-intel-pclmul: fix undefined behavior with unaligned access. + + commit 55cf1b5588705cab5f45e2817c4aa1d204dc0042 + * cipher/crc-intel-pclmul.c (u16_unaligned_s): New. + (crc32_reflected_less_than_16, crc32_less_than_16): Use + 'u16_unaligned_s' for unaligned memory access. + + configure.ac: fix attribute checks. + + commit b29b1b9f576f501d4b993be0a751567045274a1a + * configure.ac: Add -Werror flag for attribute checks. + + configure.ac: fix may_alias attribute check. + + commit 136c8416ea540dd126be3997d94d7063b3aaf577 + * configure.ac: Test may_alias attribute on type, not on variable. + + bufhelp: add 'may_alias' attribute for properly aligned 'bufhelp_int_t' + + commit d1ae52a0e23308f33b78cffeba56005b687f23c0 + * cipher/bufhelp.h [!BUFHELP_FAST_UNALIGNED_ACCESS] + (bufhelp_int_t): Add 'may_alias' attribute. + +2017-01-27 Werner Koch + + w32: New envvar GCRYPT_RNDW32_DBG. + + commit a351fbde8548ce3f57298c618426f043844fbc78 + * random/rndw32.c (_gcry_rndw32_gather_random): Use getenv to set + DEBUG_ME. + +2017-01-23 Jussi Kivilinna + + rijndael-ssse3-amd64: fix building on x32. + + commit 39b9302da5d08bd52688d20befe626fee0b6c41d + * cipher/rijndael-ssse3-amd64.c: Use 64-bit call instructions + with 64-bit registers. + + bufhelp: use 'may_alias' attribute unaligned pointer types. + + commit bf9e0b79e620ca2324224893b07522462b125412 + * configure.ac (gcry_cv_gcc_attribute_may_alias) + (HAVE_GCC_ATTRIBUTE_MAY_ALIAS): New check for 'may_alias' attribute. + * cipher/bufhelp.h (BUFHELP_FAST_UNALIGNED_ACCESS): Enable only if + HAVE_GCC_ATTRIBUTE_MAY_ALIAS is defined. + [BUFHELP_FAST_UNALIGNED_ACCESS] (bufhelp_int_t, bufhelp_u32_t) + (bufhelp_u64_t): Add 'may_alias' attribute. + * src/g10lib.h (fast_wipememory_t): Add HAVE_GCC_ATTRIBUTE_MAY_ALIAS + defined check; Add 'may_alias' attribute. + +2017-01-18 Werner Koch + + random: Call getrandom before select and emitting a progress callback. + + commit 623aab8a940ea61afe3fef650ad485a755ed9fe7 + * random/rndlinux.c (_gcry_rndlinux_gather_random): Move the getrandom + call before the select. + +2017-01-06 Jussi Kivilinna + + mpi: amd64: fix too large jump alignment in mpih-rshift. + + commit ddcfe31e2425e88b280e7cdaf3f0eaaad8ccc023 + * mpi/amd64/mpih-rshift.S (_gcry_mpih_rshift): Use 16-byte alignment + with 'ALIGN(4)' instead of 256-byte. + + rijndael-ssse3: move assembly functions to separate source-file. + + commit 54c57bc49edb5c00e9ed8103cc4837bb72c5e863 + * cipher/Makefile.am: Add 'rinjdael-ssse3-amd64-asm.S'. + * cipher/rinjdael-ssse3-amd64-asm.S: Moved assembly functions + here ... + * cipher/rinjdael-ssse3-amd64.c: ... from this file. + (_gcry_aes_ssse3_enc_preload, _gcry_aes_ssse3_dec_preload) + (_gcry_aes_ssse3_shedule_core, _gcry_aes_ssse3_encrypt_core) + (_gcry_aes_ssse3_decrypt_core): New. + (vpaes_ssse3_prepare_enc, vpaes_ssse3_prepare_dec) + (_gcry_aes_ssse3_do_setkey, _gcry_aes_ssse3_prepare_decryption) + (do_vpaes_ssse3_enc, do_vpaes_ssse3_dec): Update to use external + assembly functions; remove 'aes_const_ptr' variable usage. + (_gcry_aes_ssse3_encrypt, _gcry_aes_ssse3_decrypt) + (_gcry_aes_ssse3_cfb_enc, _gcry_aes_ssse3_cbc_enc) + (_gcry_aes_ssse3_ctr_enc, _gcry_aes_ssse3_cfb_dec) + (_gcry_aes_ssse3_cbc_dec, ssse3_ocb_enc, ssse3_ocb_dec) + (_gcry_aes_ssse3_ocb_auth): Remove 'aes_const_ptr' variable usage. + * configure.ac: Add 'rinjdael-ssse3-amd64-asm.lo'. + + Add AVX2/vpgather bulk implementation of Twofish. + + commit c59a8ce51ceb9a80169c44ef86a67e95cf8528c3 + * cipher/Makefile.am: Add 'twofish-avx2-amd64.S'. + * cipher/twofish-avx2-amd64.S: New. + * cipher/twofish.c (USE_AVX2): New. + (TWOFISH_context) [USE_AVX2]: Add 'use_avx2' member. + (ASM_FUNC_ABI): New. + (twofish_setkey): Add check for AVX2 and fast VPGATHER HW features. + (_gcry_twofish_avx2_ctr_enc, _gcry_twofish_avx2_cbc_dec) + (_gcry_twofish_avx2_cfb_dec, _gcry_twofish_avx2_ocb_enc) + (_gcry_twofish_avx2_ocb_dec, _gcry_twofish_avx2_ocb_auth): New. + (_gcry_twofish_ctr_enc, _gcry_twofish_cbc_dec, _gcry_twofish_cfb_dec) + (_gcry_twofish_ocb_crypt, _gcry_twofish_ocb_auth): Add AVX2 bulk + handling. + (selftest_ctr, selftest_cbc, selftest_cfb): Increase nblocks from + 3+X to 16+X. + * configure.ac: Add 'twofish-avx2-amd64.lo'. + * src/g10lib.h (HWF_INTEL_FAST_VPGATHER): New. + * src/hwf-x86.c (detect_x86_gnuc): Add detection for + HWF_INTEL_FAST_VPGATHER. + * src/hwfeatures.c (HWF_INTEL_FAST_VPGATHER): Add + "intel-fast-vpgather" for HWF_INTEL_FAST_VPGATHER. + + Add XTS cipher mode. + + commit 232a129b1f915fc54881506e4b07c89cf84932e6 + * cipher/Makefile.am: Add 'cipher-xts.c'. + * cipher/cipher-internal.h (gcry_cipher_handle): Add 'bulk.xts_crypt' + and 'u_mode.xts' members. + (_gcry_cipher_xts_crypt): New prototype. + * cipher/cipher-xts.c: New. + * cipher/cipher.c (_gcry_cipher_open_internal, cipher_setkey) + (cipher_reset, cipher_encrypt, cipher_decrypt): Add XTS mode handling. + * doc/gcrypt.texi: Add XTS mode to documentation. + * src/gcrypt.h.in (GCRY_CIPHER_MODE_XTS, GCRY_XTS_BLOCK_LEN): New. + * tests/basic.c (do_check_xts_cipher, check_xts_cipher): New. + (check_bulk_cipher_modes): Add XTS test-vectors. + (check_one_cipher_core, check_one_cipher, check_ciphers): Add XTS + testing support. + (check_cipher_modes): Add XTS test. + * tests/bench-slope.c (bench_xts_encrypt_init) + (bench_xts_encrypt_do_bench, bench_xts_decrypt_do_bench) + (xts_encrypt_ops, xts_decrypt_ops): New. + (cipher_modes, cipher_bench_one): Add XTS. + * tests/benchmark.c (cipher_bench): Add XTS testing. + +2017-01-04 Jussi Kivilinna + + rijndael-ssse3: fix counter operand from read-only to read/write. + + commit aada604594fd42224d366d3cb98f67fd3b989cd6 + * cipher/rijndael-ssse3-amd64.c (_gcry_aes_ssse3_ctr_enc): Change + 'ctrlow' operand from read-only to read-write. + +2017-01-03 Werner Koch + + Extend GCRYCTL_PRINT_CONFIG to print compiler version. + + commit 98b49695b1ffe3c406ae39a45051b8594f903b9d + * src/global.c (print_config): Print version of libgpg-error and used + compiler. + + tests: Add option --disable-hwf to the version utility. + + commit 3582641469f1c74078f0d758c4d5458cc0ee5649 + * src/hwfeatures.c (_gcry_disable_hw_feature): Rewrite to allow + passing a colon delimited feature set. + (parse_hwf_deny_file): Remove unused var I. + * tests/version.c (main): Add options --verbose and --disable-hwf. + +2016-12-15 Werner Koch + Nicolas Porcel + + Fix regression in broken mlock detection. + + commit 0a90f87799903a3fb97189ef7cba19e7b3534e1c + * acinclude.m4 (GNUPG_CHECK_MLOCK): Fix typo EGAIN->EAGAIN. + +2016-12-10 Jussi Kivilinna + + hwfeatures: add 'all' for disabling all hardware features. + + commit c83d0d2a26059cf471d09f5cb8e7fc5d76c4907b + * .gitignore: Add 'tests/basic-disable-all-hwf'. + * configure.ac: Ditto. + * tests/Makefile.am: Ditto. + * src/hwfeatures.c (_gcry_disable_hw_feature): Match 'all' for + masking all HW features off. + (parse_hwf_deny_file): Use '_gcry_disable_hw_feature' for matching. + * tests/basic-disable-all-hwf.in: New. + + tests/hashtest-256g: add missing executable extension for Win32. + + commit 2b7b227b8a0bd5ff286258bc187782efac180a7e + * tests/hashtest-256g.in: Add @EXEEXT@. + + OCB ARM CE: Move ocb_get_l handling to assembly part. + + commit 5c418e597f0f20a546d953161695e6caf1f57689 + * cipher/rijndael-armv8-aarch32-ce.S: Add OCB 'L_{ntz(i)}' calculation. + * cipher/rijndael-armv8-aarch64-ce.S: Ditto. + * cipher/rijndael-armv8-ce.c (_gcry_aes_ocb_enc_armv8_ce) + (_gcry_aes_ocb_dec_armv8_ce, _gcry_aes_ocb_auth_armv8_ce) + (ocb_cryt_fn_t): Updated arguments. + (_gcry_aes_armv8_ce_ocb_crypt, _gcry_aes_armv8_ce_ocb_auth): Remove + 'ocb_get_l' handling and splitting input to 32 block chunks, instead + pass full buffers to assembly. + + OCB: Move large L handling from bottom to upper level. + + commit 2d2e5286d53e1f62fe040dff4c6e01961f00afe2 + * cipher/cipher-ocb.c (_gcry_cipher_ocb_get_l): Remove. + (ocb_get_L_big): New. + (_gcry_cipher_ocb_authenticate): L-big handling done in upper + processing loop, so that lower level never sees the case where + 'aad_nblocks % 65536 =3D=3D 0'; Add missing stack burn. + (ocb_aad_finalize): Add missing stack burn. + (ocb_crypt): L-big handling done in upper processing loop, so that + lower level never sees the case where 'data_nblocks % 65536 =3D=3D 0'. + * cipher/cipher-internal.h (_gcry_cipher_ocb_get_l): Remove. + (ocb_get_l): Remove 'l_tmp' usage and simplify since input + is more limited now, 'N is not multiple of 65536'. + * cipher/rijndael-aesni.c (get_l): Remove. + (aesni_ocb_enc, aesni_ocb_dec, _gcry_aes_aesni_ocb_auth): Remove + l_tmp; Use 'ocb_get_l'. + * cipher/rijndael-ssse3-amd64.c (get_l): Remove. + (ssse3_ocb_enc, ssse3_ocb_dec, _gcry_aes_ssse3_ocb_auth): Remove + l_tmp; Use 'ocb_get_l'. + * cipher/camellia-glue.c: Remove OCB l_tmp usage. + * cipher/rijndael-armv8-ce.c: Ditto. + * cipher/rijndael.c: Ditto. + * cipher/serpent.c: Ditto. + * cipher/twofish.c: Ditto. + + OCB: remove 'int64_t' usage. + + commit 161d339f48c03be7fd0f4249d730f7f1767ef8e4 + * cipher/cipher-ocb.c (double_block): Use alternative way to generate + sign-bit mask, without 'int64_t'. + + random-drbg: use bufhelp function for big-endian store. + + commit 0b03b658bebc69a84d87ef13f9b60a27b0c42305 + * random/random-drbg.c (drbg_cpu_to_be32): Remove. + (drbg_ctr_df, drbg_hash_df): Use 'buf_put_be32' instead of + 'drbg_cpu_to_be32'. + +2016-12-09 Werner Koch + + Improve handling of mlock error codes. + + commit 618b8978f46f4011c11512fd5f30c15e01652e2e + * acinclude.m4 (GNUPG_CHECK_MLOCK): Check also for EAGAIN which is a + legitimate return code and does not indicate a broken mlock(). + * src/secmem.c (lock_pool_pages): Test ERR instead of ERRNO which + could have been overwritten by cap_from+text et al. + +2016-12-08 Stephan Mueller + + random: Eliminate unneeded memcpy invocations in the DRBG. + + commit 656395ba4cf34f42dda3a120bda3ed1220755a3d + * random/random-drbg.c (drbg_hash): Remove arg 'outval' and return a + pointer instead. + (drbg_instantiate): Reduce size of scratchpad. + (drbg_hmac_update): Avoid use of scratch buffers for the hash. + (drbg_hmac_generate, drbg_hash_df): Ditto. + (drbg_hash_process_addtl): Ditto. + (drbg_hash_hashgen): Ditto. + (drbg_hash_generate): Ditto. + + random: Add performance improvements for the DRBG. + + commit 20886fdcb841b0bf89bb1d44303d42f1804e38cb + * random/random-drbg.c (struct drbg_state_ops_s): New function + pointers 'crypto_init' and 'crypto-fini'. + (struct drbg_state_s): New fields 'priv_data', 'ctr_handle', and + 'ctr_null'. + (drbg_hash_init, drbg_hash_fini): New. + (drbg_hmac_init, drbg_hmac_setkey): New. + (drbg_sym_fini, drbg_sym_init, drbg_sym_setkey): New. + (drbg_sym_ctr): New. + (drbg_ctr_bcc): Set the key. + (drbg_ctr_df): Ditto. + (drbg_hmac_update): Ditto. + (drbg_hmac_generate): Replace drgb_hmac by drbg_hash. + (drbg_hash_df): Ditto. + (drbg_hash_process_addtl): Ditto. + (drbg_hash_hashgen): Ditto. + (drbg_ctr_update): Rework. + (drbg_ctr_generate): Rework. + (drbg_ctr_ops): Init new functions pointers. + (drbg_uninstantiate): Call fini function. + (drbg_instantiate): Call init function. + + cipher: New function for reading the counter in CTR mode. + + commit 227099f179df9dcf083d0ef6be9883c775df0874 + * cipher/cipher.c (gcry_cipher_getctr): New. + +2016-12-07 Werner Koch + + Document the overflow pools and add a stupid test case. + + commit 95bac312644ad45e486c94c2efd25d0748b9a20b + * tests/t-secmem.c (test_secmem_overflow): New func. + (main): Disable warning and call new function. + + Implement overflow secmem pools for xmalloc style allocators. + + commit b6870cf25c0b1eb9c127a94af8326c446421a472 + * src/secmem.c (pooldesc_s): Add fields next, cur_alloced, and + cur_blocks. + (cur_alloced, cur_blocks): Remove vars. + (ptr_into_pool_p): Make it inline. + (stats_update): Add arg pool and update the new pool specific + counters. + (_gcry_secmem_malloc_internal): Add arg xhint and allocate overflow + pools as needed. + (_gcry_secmem_malloc): Pass XHINTS along. + (_gcry_secmem_realloc_internal): Ditto. + (_gcry_secmem_realloc): Ditto. + (_gcry_secmem_free_internal): Take multiple pools in account. Add + return value to indicate whether the arg was freed. + (_gcry_secmem_free): Add return value to indicate whether the arg was + freed. + (_gcry_private_is_secure): Take multiple pools in account. + (_gcry_secmem_term): Release all pools. + (_gcry_secmem_dump_stats): Print stats for all pools. + * src/stdmem.c (_gcry_private_free): Replace _gcry_private_is_secure + test with a direct call of _gcry_secmem_free to avoid double checking. + + Give the secmem allocators a hint when a xmalloc calls them. + + commit b7df907dca4d525f8930c533b763ffce44ceed87 + * src/secmem.c (_gcry_secmem_malloc): New not yet used arg XHINT. + (_gcry_secmem_realloc): Ditto. + * src/stdmem.c (_gcry_private_malloc_secure): New arg XHINT to be + passed to the secmem functions. + (_gcry_private_realloc): Ditto. + * src/g10lib.h (GCRY_ALLOC_FLAG_XHINT): New. + * src/global.c (do_malloc): Pass this flag as XHINT to the private + allocator. + (_gcry_malloc_secure): Factor code out to ... + (_gcry_malloc_secure_core): this. Add arg XHINT. + (_gcry_realloc): Factor code out to ... + (_gcry_realloc_core): here. Add arg XHINT. + (_gcry_strdup): Factor code out to ... + (_gcry_strdup_core): here. Add arg XHINT. + (_gcry_xrealloc): Use the core function and pass true for XHINT. + (_gcry_xmalloc_secure): Ditto. + (_gcry_xstrdup): Ditto. + + tests: New test t-secmem. + + commit e366c19b34922c770af82cd035fd815680b29dee + * src/secmem.c (_gcry_secmem_dump_stats): Add arg EXTENDED and adjust + caller. + * src/gcrypt-testapi.h (PRIV_CTL_DUMP_SECMEM_STATS): New. + * src/global.c (_gcry_vcontrol): Implement that. + * tests/t-secmem.c: New. + * tests/Makefile.am (tests_bin): Add that test. + +2016-12-06 Werner Koch + + Fix compiler warning about possible-NULL-dreference. + + commit 995ce697308320c6a52a307f83dc49eeb8d784b4 + * src/mpi.h (mpi_is_const, mpi_is_immutable): Do check arg before + deref-ing. The are only used at places where the arg shall not be NULL. + + Fix possible NULL-deref in gcry_log_debugsxp. + + commit 984a97f0750f812f0ad3c343ee6a67560953a504 + * src/misc.c (_gcry_log_printsxp): Prevent passing NULL to strlen. + + Reorganize code in secmem.c. + + commit 603f479a919311f720a05da738150c2192d5e562 + * src/secmem.c (pooldesc_t): New type to collect information about one + pool. + (pool_size): Remove. Now a member of pooldesc_t. + (pool_okay): Ditto. + (pool_is_mmapped): Ditto. + (pool): Rename variable ... + (mainpool): And change type to pooldesc_t. + (ptr_into_pool_p): Add arg 'pool'. + (mb_get_next): Ditto. + (mb_get_prev): Ditto. + (mb_merge): Ditto. + (mb_get_new): Ditto. + (init_pool): Ditto. + (lock_pool): Rename to ... + (look_pool_pages: this. + (secmem_init): Rename to ... + (_gcry_secmem_init_internal): this. Add local var POOL and init with + address of MAINPOOL. + (_gcry_secmem_malloc_internal): Add local var POOL and init with + address of MAINPOOL. + (_gcry_private_is_secure): Ditto. + (_gcry_secmem_term): Ditto. + (_gcry_secmem_dump_stats): Ditto. + (_gcry_secmem_free_internal): Ditto. Remove check for NULL arg. + (_gcry_secmem_free): Add check for NULL arg before taking the lock. + (_gcry_secmem_realloc): Factor most code out to ... + (_gcry_secmem_realloc_internal): this. + +2016-11-28 Dmitry Eremin-Solenikov + + tests: Add PBKDF2 tests for Stribog512. + + commit a0580d446fef648a177ca4ab060d0e449780db84 + * tests/t-kdf.c (check_pbkdf2): Add Stribog512 test cases from TC26's + additions to PKCS#5. + + tests: Add Stribog HMAC tests from TC26ALG. + + commit fe6077e6ee8565bfcc91bad14a73e68f45b3c32b + * tests/basic.c (check_mac): add HMAC test vectors from TC26ALG document + for Stribog. + + cipher: Add Stribog OIDs from TC26 space. + + commit ccffacaf6c3abe6120a0898db922981d28ab7af2 + * cipher/stribog.c (oid_spec_stribog256, oid_spec_stribog512): New. + +2016-11-25 Justus Winter + + tests: Fix memory leak. + + commit 5530a8234d703ce9b685f78fb6e951136eb0aeb2 + * tests/basic.c (check_gost28147_cipher): Free cipher handles. + +2016-11-25 Dmitry Eremin-Solenikov + + Cast oid argument of gcry_cipher_set_sbox to disable compiler warning. + + commit 1a67e3195896704f8b3ba09e3db1214bab834491 + * src/gcrypt.h.in (gcry_cipher_set_sbox): Cast oid to (void *). + + gost: Rename tc26 s-box from A to Z. + + commit dc8ceb8d2dfef949f3afa14fc75f9de8cd07c7ad + * cipher/gost-s-box.c (gost_sboxes): Rename TC26_A to TC26_Z as it is + the name that ended up in all standards. + + tests: Add test to verify GOST 28147-89 against known results. + + commit 4f5c26c73c66daf2e4aff966e43c22b2db7e0138 + * tests/basic.c (check_gost28147_cipher): new test function. + +2016-11-17 Dmitry Eremin-Solenikov + + cipher/gost28147: Fix CryptoPro-B S-BOX. + + commit 5ca63c92825453fdb369a97bbc19cb95b49b4296 + * cipher/gost-s-box.c: CryptoPro_B s-box missed one line, resulting in + incorrect encryption/decryption using that s-box. Add missing data. + +2016-11-12 Werner Koch + + Put blocking calls into Libgpg-error's system call clamp. + + commit b829dfe9f0eeff08c956ba3f3a6b559b9d2199dd + * src/gcrypt.h.in (GCRYCTL_REINIT_SYSCALL_CLAMP): New. + * configure.ac: Require Libgpg-error 1.25. Set version number to + 1.8.0. + * src/gcrypt-int.h: Remove error code emulation. + * src/global.c (pre_syscall_func, post_syscall_func): New. + (global_init): Call gpgrt_get_syscall_clamp. + (_gcry_vcontrol) : Ditto. + (_gcry_pre_syscall, _gcry_post_syscall): New. + * random/rndlinux.c (_gcry_rndlinux_gather_random): Use the new + functions. + +2016-11-01 NIIBE Yutaka + + cipher: Fix IDEA cipher for clearing memory. + + commit bf6d5b10cb4173826f47ac080506b68bb001acb2 + * cipher/idea.c (invert_key): Use wipememory, since this kind of memset + may be removed by compiler optimization. + +2016-10-09 Jussi Kivilinna + + GCM: Add bulk processing for ARMv8/AArch64 implementation. + + commit bfd732f53a9b5dfe14217a68a0fa289bf6913ec0 + * cipher/cipher-gcm-armv8-aarch64-ce.S: Add 6 blocks bulk processing. + + GCM: Add bulk processing for ARMv8/AArch32 implementation. + + commit 27747921cb1dfced83c5666cd1c474764724c52b + * cipher/cipher-gcm-armv8-aarch32-ce.S: Add 4 blocks bulk processing. + * tests/basic.c (check_digests): Print correct data length for "?" + tests. + (check_one_mac): Add large 1000000 bytes tests, when input is "!" or + "?". + (check_mac): Add "?" tests vectors for HMAC, CMAC, GMAC and POLY1305. + +2016-09-11 Jussi Kivilinna + + Add Aarch64 assembly implementation of Twofish. + + commit 5418d9ca4c0e087fd6872ad350a996fe74880d86 + * cipher/Makefile.am: Add 'twofish-aarch64.S'. + * cipher/twofish-aarch64.S: New. + * cipher/twofish.c: Enable USE_ARM_ASM if __AARCH64EL__ and + HAVE_COMPATIBLE_GCC_AARCH64_PLATFORM_AS defined. + * configure.ac [host=3Daarch64]: Add 'twofish-aarch64.lo'. + +2016-09-05 Jussi Kivilinna + + Add Aarch64 assembly implementation of Camellia. + + commit de73a2e7237ba7c34ce48bb5fb671aa3993de832 + * cipher/Makefile.am: Add 'camellia-aarch64.S'. + * cipher/camellia-aarch64.S: New. + * cipher/camellia-glue.c [USE_ARM_ASM][__aarch64__]: Set stack burn + size to zero. + * cipher/camellia.h: Enable USE_ARM_ASM if __AARCH64EL__ and + HAVE_COMPATIBLE_GCC_AARCH64_PLATFORM_AS defined. + * configure.ac [host=3Daarch64]: Add 'rijndael-aarch64.lo'. + + Add ARMv8/AArch64 Crypto Extension implementation of AES. + + commit 4cd8d40d698564d24ece2af24546e34c58bf2961 + * cipher/Makefile.am: Add 'rijndael-armv-aarch64-ce.S'. + * cipher/rijndael-armv8-aarch64-ce.S: New. + * cipher/rijndael-internal.h (USE_ARM_CE): Enable for ARMv8/AArch64. + * configure.ac: Add 'rijndael-armv-aarch64-ce.lo' and + 'rijndael-armv8-ce.lo' for ARMv8/AArch64. + + Add ARMv8/AArch64 Crypto Extension implementation of GCM. + + commit 0b332c1aef03a735c1fb0df184f74d523deb2f98 + * cipher/Makefile.am: Add 'cipher-gcm-armv8-aarch64-ce.S'. + * cipher/cipher-gcm-armv8-aarch64-ce.S: New. + * cipher/cipher-internal.h (GCM_USE_ARM_PMULL): Enable on + ARMv8/AArch64. + + Add ARMv8/AArch64 Crypto Extension implementation of SHA-256. + + commit 2d4bbc0ad62c54bbdef77799f9db82d344b7219e + * cipher/Makefile.am: Add 'sha256-armv8-aarch64-ce.S'. + * cipher/sha256-armv8-aarch64-ce.S: New. + * cipher/sha256-armv8-aarch32-ce.S: Move round macros to correct + section. + * cipher/sha256.c (USE_ARM_CE): Enable on ARMv8/AArch64. + * configure.ac: Add 'sha256-armv8-aarch64-ce.lo'; Swap places for + 'sha512-arm.lo' and 'sha256-armv8-aarch32-ce.lo'. + + Add ARMv8/AArch64 Crypto Extension implementation of SHA-1. + + commit e4eb03f56683317c908cb55be727832810dc8c72 + * cipher/Makefile.am: Add 'sha1-armv8-aarch64-ce.S'. + * cipher/sha1-armv8-aarch64-ce.S: New. + * cipher/sha1.c (USE_ARM_CE): Enable on ARMv8/AArch64. + * configure.ac: Add 'sha1-armv8-aarch64-ce.lo'. + +2016-09-04 Jussi Kivilinna + + Add AArch64 assembly implementation of AES. + + commit 595251ad37bf1968261d7e781752513f67525803 + * cipher/Makefile.am: Add 'rijndael-aarch64.S'. + * cipher/rijndael-aarch64.S: New. + * cipher/rijndael-internal.h: Enable USE_ARM_ASM if __AARCH64EL__ and + HAVE_COMPATIBLE_GCC_AARCH64_PLATFORM_AS defined. + * configure.ac (gcry_cv_gcc_aarch64_platform_as_ok): New check. + [host=3Daarch64]: Add 'rijndael-aarch64.lo'. + +2016-08-17 Werner Koch + + Release 1.7.3. + + commit f8241874971478bdcd2bc2082d901d05db7b256d + * configure.ac: Set LT version to C21/A1/R3. + + random: Hash continuous areas in the csprng pool. + + commit 8dd45ad957b54b939c288a68720137386c7f6501 + * random/random-csprng.c (mix_pool): Store the first hash at the end + of the pool. + + random: Improve the diagram showing the random mixing. + + commit 2f62103b4bb6d6f9ce806e01afb7fdc58aa33513 + * random/random-csprng.c (mix_pool): Use DIGESTLEN instead of 20. + +2016-07-19 Jussi Kivilinna + + crc-intel-pclmul: split assembly block to ease register pressure. + + commit f38199dbc290003898a1799adc367265267784c2 + * cipher/crc-intel-pclmul.c (crc32_less_than_16): Split inline + assembly block handling 4 byte input into multiple blocks. + + rijndael-aesni: split assembly block to ease register pressure. + + commit a4d1595a2638db63ac4c73e722c8ba95fdd85ff7 + * cipher/rijndael-aesni.c (do_aesni_ctr_4): Use single register + constraint for passing 'bige_addb' to assembly block; split + first inline assembly block into two parts. + +2016-07-14 Jussi Kivilinna + + Add ARMv8/AArch32 Crypto Extension implementation of AES. + + commit 05a4cecae0c02d2b4ee1cadd9c08115beae3a94a + * cipher/Makefile.am: Add 'rijndael-armv8-ce.c' and + 'rijndael-armv-aarch32-ce.S'. + * cipher/rijndael-armv8-aarch32-ce.S: New. + * cipher/rijndael-armv8-ce.c: New. + * cipher/rijndael-internal.h (USE_ARM_CE): New. + (RIJNDAEL_context_s): Add 'use_arm_ce'. + * cipher/rijndael.c [USE_ARM_CE] (_gcry_aes_armv8_ce_setkey) + (_gcry_aes_armv8_ce_prepare_decryption) + (_gcry_aes_armv8_ce_encrypt, _gcry_aes_armv8_ce_decrypt) + (_gcry_aes_armv8_ce_cfb_enc, _gcry_aes_armv8_ce_cbc_enc) + (_gcry_aes_armv8_ce_ctr_enc, _gcry_aes_armv8_ce_cfb_dec) + (_gcry_aes_armv8_ce_cbc_dec, _gcry_aes_armv8_ce_ocb_crypt) + (_gcry_aes_armv8_ce_ocb_auth): New. + (do_setkey) [USE_ARM_CE]: Add ARM CE/AES HW feature check and key + setup for ARM CE. + (prepare_decryption, _gcry_aes_cfb_enc, _gcry_aes_cbc_enc) + (_gcry_aes_ctr_enc, _gcry_aes_cfb_dec, _gcry_aes_cbc_dec) + (_gcry_aes_ocb_crypt, _gcry_aes_ocb_auth) [USE_ARM_CE]: Add + ARM CE support. + * configure.ac: Add 'rijndael-armv8-ce.lo' and + 'rijndael-armv8-aarch32-ce.lo'. + + Add ARMv8/AArch32 Crypto Extension implementation of GCM. + + commit 962b15470663db11e5c35b86768f1b5d8e600017 + * cipher/Makefile.am: Add 'cipher-gcm-armv8-aarch32-ce.S'. + * cipher/cipher-gcm-armv8-aarch32-ce.S: New. + * cipher/cipher-gcm.c [GCM_USE_ARM_PMULL] + (_gcry_ghash_setup_armv8_ce_pmull, _gcry_ghash_armv8_ce_pmull) + (ghash_setup_armv8_ce_pmull, ghash_armv8_ce_pmull): New. + (setupM) [GCM_USE_ARM_PMULL]: Enable ARM PMULL implementation if + HWF_ARM_PULL HW feature flag is enabled. + * cipher/cipher-gcm.h (GCM_USE_ARM_PMULL): New. + + Add ARMv8/AArch32 Crypto Extension implemenation of SHA-256. + + commit 34c64eb03178fbfd34190148fec5a189df2b8f83 + * cipher/Makefile.am: Add 'sha256-armv8-aarch32-ce.S'. + * cipher/sha256-armv8-aarch32-ce.S: New. + * cipher/sha256.c (USE_ARM_CE): New. + (sha256_init, sha224_init): Check features for HWF_ARM_SHA1. + [USE_ARM_CE] (_gcry_sha256_transform_armv8_ce): New. + (transform) [USE_ARM_CE]: Use ARMv8 CE implementation if HW supports. + (SHA256_CONTEXT): Add 'use_arm_ce'. + * configure.ac: Add 'sha256-armv8-aarch32-ce.lo'. + + Add ARMv8/AArch32 Crypto Extension implementation of SHA-1. + + commit 3d6334f8d94c2a4df10eed203ae928298a4332ef + * cipher/Makefile.am: Add 'sha1-armv8-aarch32-ce.S'. + * cipher/sha1-armv7-neon.S (_gcry_sha1_transform_armv7_neon): Add + missing size. + * cipher/sha1-armv8-aarch32-ce.S: New. + * cipher/sha1.c (USE_ARM_CE): New. + (sha1_init): Check features for HWF_ARM_SHA1. + [USE_ARM_CE] (_gcry_sha1_transform_armv8_ce): New. + (transform) [USE_ARM_CE]: Use ARMv8 CE implementation if HW supports + it. + * cipher/sha1.h (SHA1_CONTEXT): Add 'use_arm_ce'. + * configure.ac: Add 'sha1-armv8-aarch32-ce.lo'. + + Add HW feature check for ARMv8 AArch64 and crypto extensions. + + commit eee78f6e1fbce7d54c43fb7efc5aa8be9f52755f + * configure.ac: Add '--disable-arm-crypto-support'; enable hwf-arm + module on 64-bit ARM. + (armcryptosupport, gcry_cv_gcc_inline_aarch32_crypto) + (gcry_cv_inline_asm_aarch64_neon) + (gcry_cv_gcc_inline_asm_aarch64_crypto): New. + * src/g10lib.h (HWF_ARM_AES, HWF_ARM_SHA1, HWF_ARM_SHA2) + (HWF_ARM_PMULL): New. + * src/hwf-arm.c [__aarch64__]: Enable building in AArch64 mode. + (feature_map_s): New. + [__arm__] (AT_HWCAP, AT_HWCAP2, HWCAP2_AES, HWCAP2_PMULL) + (HWCAP2_SHA1, HWCAP2_SHA2, arm_features): New. + [__aarch64__] (AT_HWCAP, AT_HWCAP2, HWCAP_ASIMD, HWCAP_AES) + (HWCAP_PMULL, HWCAP_SHA1, HWCAP_SHA2, arm_features): New. + (get_hwcap): Add reading of 'AT_HWCAP2'; Change auxv use + 'unsigned long'. + (detect_arm_at_hwcap): Add mapping of HWCAP/HWCAP2 to HWF flags. + (detect_arm_proc_cpuinfo): Add mapping of CPU features to HWF flags. + (_gcry_hwf_detect_arm): Use __ARM_NEON instead of legacy __ARM_NEON__. + * src/hwfeatures.c (hwflist): Add 'arm-aes', 'arm-sha1', 'arm-sha2' + and 'arm-pmull'. + +2016-07-14 Werner Koch + + Release 1.7.2. + + commit be0bec7d9208b2f2d2ffce9cc2ca6154853e7e59 + * configure.ac: Set LT version to C21/A1/R2. + * Makefile.am (distcheck-hook): New. + +2016-07-13 Werner Koch + + build: Update config.{guess,sub} to {2016-05-15,2016-06-20}. + + commit e535ea1bdc42309553007d60599d3147b8defe93 + * build-aux/config.guess: Update. + * build-aux/config.sub: Update. + +2016-07-08 Jussi Kivilinna + + Fix unaligned accesses with ldm/stm in ChaCha20 and Poly1305 ARM/NEON. + + commit 1111d311fd6452abd4080d1072c75ddb1b5a3dd1 + * cipher/chacha20-armv7-neon.S (UNALIGNED_STMIA8) + (UNALIGNED_LDMIA4): New. + (_gcry_chacha20_armv7_neon_blocks): Use new helper macros instead of + ldm/stm instructions directly. + * cipher/poly1305-armv7-neon.S (UNALIGNED_LDMIA2) + (UNALIGNED_LDMIA4): New. + (_gcry_poly1305_armv7_neon_init_ext, _gcry_poly1305_armv7_neon_blocks) + (_gcry_poly1305_armv7_neon_finish_ext): Use new helper macros instead + of ldm instruction directly. + +2016-07-03 Jussi Kivilinna + + bench-slope: add unaligned buffer mode. + + commit 496790940753226f96b731a43d950bd268acd97a + * tests/bench-slope.c (unaligned_mode): New. + (do_slope_benchmark): Unalign buffer if in unaligned mode enabled. + (print_help, main): Add '--unaligned' parameter. + +2016-07-01 Jussi Kivilinna + + Fix static build. + + commit cb79630ec567a5f2e03e5f863cda168faa7b8cc8 + * tests/pubkey.c (_gcry_pk_util_get_nbits): Make function 'static'. + +2016-06-30 Jussi Kivilinna + + Disallow encryption/decryption if key is not set. + + commit 07de9858032826f5a7b08c372f6bcc73bbb503eb + * cipher/cipher.c (cipher_encrypt, cipher_decrypt): If mode is not + NONE, make sure that key is set. + * cipher/cipher-ccm.c (_gcry_cipher_ccm_set_nonce): Do not clear + 'marks.key' when reseting state. + + Avoid unaligned accesses with ARM ldm/stm instructions. + + commit a6158a01a4d81a5d862e1e0a60bfd6063443311d + * cipher/rijndael-arm.S: Remove __ARM_FEATURE_UNALIGNED ifdefs, always + compile with unaligned load/store code paths. + * cipher/sha512-arm.S: Ditto. + + Fix non-PIC reference in PIC for poly1305/ARMv7-NEON. + + commit a09126242a51c4ea4564b0f70b808e4f27fe5a91 + * cipher/poly1305-armv7-neon.S (GET_DATA_POINTER): New. + (_gcry_poly1305_armv7_neon_init_ext): Use GET_DATA_POINTER. + + Fix wrong CPU feature #ifdef for SHA1/AVX. + + commit 4a983e3bef58b9d056517e25e0ab10b72d12ceba + * cipher/sha1-avx-amd64.S: Check for HAVE_GCC_INLINE_ASM_AVX instead of + HAVE_GCC_INLINE_ASM_AVX2 & HAVE_GCC_INLINE_ASM_BMI2. + +2016-06-30 Werner Koch + + random: Remove debug message about not supported getrandom syscall. + + commit 6965515c73632a088fb126a4a55e95121671fa98 + * random/rndlinux.c (_gcry_rndlinux_gather_random): Remove log_debug + for getrandom error ENOSYS. + +2016-06-27 Werner Koch + + tests: Do not test SHAKE128 et al with gcry_md_hash_buffer. + + commit 4d634a098742ff425b324e9f2a67b9f62de09744 + * tests/benchmark.c (md_bench): Do not test variable lengths algos + with the gcry_md_hash_buffer. + + md: Improve diagnostic when using SHAKE128 with gcry_md_hash_buffer. + + commit ae26edf4b60359bfa5fe3a27b2c24b336e7ec35c + * cipher/md.c (md_read): Detect missing read function. + (_gcry_md_hash_buffers): Return an error. + +2016-06-25 Werner Koch + + ecc: Fix memory leak. + + commit 7a7f7c147f888367dfee6093d26bfeaf750efc3a + * cipher/ecc.c (ecc_check_secret_key): Do not init point if already + set. + + doc: Update yat2m. + + commit 1feb01940062a74c27230434fc3babdddca8caf4 + * doc/yat2m.c: Update from Libgpg-error + + tests: Add attributes to helper functions. + + commit c870cb5d385c1d6e1e28ca481cf9cf44b3bfeea9 + * tests/t-common.h (die, fail, info): Add attributes. + * tests/random.c (die, inf): Ditto. + * tests/pubkey.c (die, fail, info): Add attributes. + * tests/fipsdrv.c (die): Add attribute. + (main): Take care of missing --key,--iv,--dt options. + + Improve robustness and help lint. + + commit 5a5b055b81ee60a22a846bdf2031516b1c24df98 + * cipher/rsa.c (rsa_encrypt): Check for !DATA. + * cipher/md.c (search_oid): Check early for !OID. + (md_copy): Use gpg_err_code_from_syserror. Replace chains of if(!err) + tests. + * cipher/cipher.c (search_oid): Check early for !OID. + * src/misc.c (do_printhex): Allow for BUFFER=3D=3DNULL even with LENGTH>0. + * mpi/mpicoder.c (onecompl): Allow for A=3D=3DNULL to help static + analyzers. + + cipher: Improve fatal error message for bad use of gcry_md_read. + + commit 3f98b1e92d5afd720d7cea5b4e8295c5018bf9ac + * cipher/md.c (md_read): Use _gcry_fatal_error instead of BUG. + +2016-06-16 Niibe Yutaka + + ecc: Default cofactor 1 for PUBKEY_FLAG_PARAM. + + commit b0b70e7fe37b1bf13ec0bfc8effcb5c7f5db6b7d + * cipher/ecc.c (ecc_check_secret_key, ecc_sign, ecc_verify) + (ecc_encrypt_raw, ecc_decrypt_raw, compute_keygrip): Set default + cofactor as 1, when not specified. + + ecc: Default cofactor 1 for PUBKEY_FLAG_PARAM. + + commit 0f3a069211d8d24a61aa0dc2cc6c4ef04cc4fab7 + * cipher/ecc.c (ecc_check_secret_key, ecc_sign, ecc_verify) + (ecc_encrypt_raw, ecc_decrypt_raw, compute_keygrip): Set default + cofactor as 1, when not specified. + +2016-06-15 Werner Koch + + Release 1.7.1. + + commit 48aa6d6602564d6ba0cef10cf08f9fb0c59b3223 + + + doc: Describe envvars. + + commit c3173bbe3f1a9c73f81a538dd49ccfa0447bfcdc + * doc/gcrypt.texi: Add chapter Configuration. + + random: Change names of debug envvars. + + commit 131b4f0634cee0e5c47d2250c59f51127b10f7b3 + * random/rndunix.c (start_gatherer): Change GNUPG_RNDUNIX_DBG to + GCRYPT_RNDUNIX_DBG, change GNUPG_RNDUNIX_DBG to GCRYPT_RNDUNIX_DBG. + * random/rndw32.c (registry_poll): Change GNUPG_RNDW32_NOPERF to + GCRYPT_RNDW32_NOPERF. + +2016-06-14 Werner Koch + + cipher: Assign OIDs to the Serpent cipher. + + commit e13a6a1ba53127af602713d0c2aaa85c94b3cd7e + * cipher/serpent.c (serpent128_oids, serpent192_oids) + (serpent256_oids): New. Add them to the specs blow. + (serpent128_aliases): Add "SERPENT-128". + (serpent256_aliases, serpent192_aliases): New. + + cipher: Assign OIDs to the Serpent cipher. + + commit 6cc2100c00a65dff07b095dea7b32cb5c5cd96d4 + * cipher/serpent.c (serpent128_oids, serpent192_oids) + (serpent256_oids): New. Add them to the specs blow. + (serpent128_aliases): Add "SERPENT-128". + (serpent256_aliases, serpent192_aliases): New. + +2016-06-08 Werner Koch + + rsa: Implement blinding also for signing. + + commit 1f769e3e8442bae2f1f73c656920bb2df70153c0 + * cipher/rsa.c (rsa_decrypt): Factor blinding code out to ... + (secret_blinded): new. + (rsa_sign): Use blinding by default. + + random: Remove debug output for getrandom(2) output. + + commit 52cdfb1960808aaad48b5a501bbce0e3141c3961 + * random/rndlinux.c (_gcry_rndlinux_gather_random): Remove debug + output. + + Fix gcc portability on Solaris 9 SPARC boxes. + + commit b766ea14ad1c27d6160531b200cc70aaa479c6dc + * mpi/longlong.h: Use __sparcv8 as alias for __sparc_v8__. + +2016-06-08 J=C3=A9r=C3=A9mie Courr=C3=A8ges-Anglas + + Check for compiler SSE4.1 support in PCLMUL CRC code. + + commit dc76313308c184c92eb78452b503405b90fc7ebd + * cipher/crc-intel-pclmul.c: Build PCLMUL CRC implementation only if + compiler supports PCLMUL *and* SSE4.1 + * cipher/crc.c: Ditto + * configure.ac (sse41support, gcry_cv_gcc_inline_asm_sse41): New. + +2016-06-08 NIIBE Yutaka + + ecc: Fix ecc_verify for cofactor support. + + commit bd39eb9fba47dc8500c83769a679cc8b683d6c6e + * cipher/ecc.c (ecc_verify): Fix the argument for cofactor "h". + +2016-06-08 Werner Koch + + random: Try to use getrandom() instead of /dev/urandom (Linux only). + + commit c05837211e5221d3f56146865e823bc20b4ff1ab + * configure.ac: Check for syscall. + * random/rndlinux.c [HAVE_SYSCALL]: Include sys/syscall.h. + (_gcry_rndlinux_gather_random): Use getrandom is available. + +2016-06-03 Werner Koch + + rsa: Implement blinding also for signing. + + commit ef6e4d004b10f5740bcd2125fb70e199dd21e3e8 + * cipher/rsa.c (rsa_decrypt): Factor blinding code out to ... + (secret_blinded): new. + (rsa_sign): Use blinding by default. + + random: Remove debug output for getrandom(2) output. + + commit 82df6c63a72fdd969c3923523f10d0cef5713ac7 + * random/rndlinux.c (_gcry_rndlinux_gather_random): Remove debug + output. + +2016-06-02 Werner Koch + + Fix gcc portability on Solaris 9 SPARC boxes. + + commit 4121f15122501d8946f1589b303d1f7949c15e30 + * mpi/longlong.h: Use __sparcv8 as alias for __sparc_v8__. + +2016-05-28 J=C3=A9r=C3=A9mie Courr=C3=A8ges-Anglas + + Check for compiler SSE4.1 support in PCLMUL CRC code. + + commit 3e8074ecd3a534e8bd7f11cf17f0b22d252584c8 + * cipher/crc-intel-pclmul.c: Build PCLMUL CRC implementation only if + compiler supports PCLMUL *and* SSE4.1 + * cipher/crc.c: Ditto + * configure.ac (sse41support, gcry_cv_gcc_inline_asm_sse41): New. + +2016-05-06 NIIBE Yutaka + + ecc: Fix ecc_verify for cofactor support. + + commit c7430aa752232aa690c5d8f16575a345442ad8d7 + * cipher/ecc.c (ecc_verify): Fix the argument for cofactor "h". + +2016-04-26 Werner Koch + + random: Try to use getrandom() instead of /dev/urandom (Linux only). + + commit ee5a32226a7ca4ab067864e06623fc11a1768900 + * configure.ac: Check for syscall. + * random/rndlinux.c [HAVE_SYSCALL]: Include sys/syscall.h. + (_gcry_rndlinux_gather_random): Use getrandom is available. + +2016-04-19 Werner Koch + + asm fix for older gcc versions. + + commit caa9d14c914bf6116ec3f773a322a94e2be0c0fb + * cipher/crc-intel-pclmul.c: Remove extra trailing colon from + asm statements. + + asm fix for older gcc versions. + + commit 4545372c0f8dd35aef2a7abc12b588ed1a4a0363 + * cipher/crc-intel-pclmul.c: Remove extra trailing colon from + asm statements. + +2016-04-15 Werner Koch + + Release 1.7.0. + + commit 795f9cb090c776658a0e3117996e3fb7e2ebd94a + + +2016-04-14 Werner Koch + + tests: Add test vectors for 256 GiB test of SHA3-256. + + commit 1737c546dc7268fa9edcd4a23b7439c56d37ee4f + * tests/hashtest.c: Add new test vectros. + +2016-04-14 Justus Winter + + src: Improve S-expression parsing. + + commit 491586bc7f7b9edc6b78331a77e653543983c9e4 + * src/sexp.c (do_vsexp_sscan): Return an error if a closing + parenthesis is encountered with no matching opening parenthesis. + +2016-04-14 Werner Koch + + cipher: Add constant for 8 bit CFB mode. + + commit 47c6a1f88eb763e9baa394e34d873b761abcebbe + * src/gcrypt.h.in (GCRY_CIPHER_MODE_CFB8): New. + * tests/basic.c (check_cfb_cipher): Prepare for CFB-8 tests. + + tests: Add a new test for S-expressions. + + commit 88c6b98350193abbdcfb227754979b0c097ee09c + * tests/t-sexp.c (compare_to_canon): New. + (back_and_forth_one): Add another test. + +2016-04-13 NIIBE Yutaka + + ecc: Fix corner cases for X25519. + + commit 8472b71812e71c69d66e2fcc02a6e21b66755f8b + * cipher/ecc.c (ecc_encrypt_raw): For invalid input, returns + GPG_ERR_INV_DATA instead of aborting with log_fatal. For X25519, + it's not an error, thus, let it return 0. + (ecc_decrypt_raw): Use the flag PUBKEY_FLAG_DJB_TWEAK to distinguish + X25519, not by the name of the curve. + (ecc_decrypt_raw): For invalid input, returns GPG_ERR_INV_DATA instead + of aborting with log_fatal. For X25519, it's not an error by its + definition, but we deliberately let it return the error to detect + looks-like-encrypted-message. + * tests/t-cv25519.c: Add points to record the issue. + +2016-04-12 Werner Koch + + cipher: Buffer data from gcry_cipher_authenticate in OCB mode. + + commit b6d2a25a275a35ec4dbd53ecaa9ea0ed7aa99c7b + * cipher/cipher-internal.h (gcry_cipher_handle): Add fields + aad_leftover and aad_nleftover to u_mode.ocb. + * cipher/cipher-ocb.c (_gcry_cipher_ocb_set_nonce): Clear + aad_nleftover. + (_gcry_cipher_ocb_authenticate): Add buffering and facor some code out + to ... + (ocb_aad_finalize): new. + (compute_tag_if_needed): Call new function. + * tests/basic.c (check_ocb_cipher_splitaad): New. + (check_ocb_cipher): Call new function. + (main): Also call check_cipher_modes with --ciper-modes. + +2016-04-12 NIIBE Yutaka + + ecc: Fix X25519 computation on Curve25519. + + commit ee7e1a0e835f8ffcfbcba2a44abab8632db8fed5 + * cipher/ecc.c (ecc_encrypt_raw): Tweak of bits when + PUBKEY_FLAG_DJB_TWEAK is enabled. + (ecc_decrypt_raw): Return 0 when PUBKEY_FLAG_DJB_TWEAK is enabled. + * tests/t-cv25519.c (test_cv): Update by using gcry_pk_encrypt. + + ecc: Fix initialization of EC context. + + commit 7fbdb99b8c56360adfd1fb4e7f4c95e0f8aa34de + * cipher/ecc.c (test_ecdh_only_keys, ecc_generate) + (ecc_check_secret_key, ecc_encrypt_raw, ecc_decrypt_raw): Initialize + by _gcry_mpi_ec_p_internal_new should carry FLAGS. + +2016-04-06 Werner Koch + + Allow building with configure option --enable-hmac-binary-check. + + commit 65c63144b66392f40b991684789b8b793248e3ba + * src/Makefile.am (mpicalc_LDADD): Add DL_LIBS. + * src/fips.c (check_binary_integrity): Allow use of hmac256 output. + * src/hmac256.c (main): Add option --stdkey + +2016-04-06 NIIBE Yutaka + + ecc: Positive values in computation. + + commit 6f386ceae86a058e26294f744750f1ed2a95e604 + * cipher/ecc-curves.c (_gcry_ecc_fill_in_curve): Make sure + coefficients A and B are positive. + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_recover_x): For negation, do + "P - T" instead of "-T", so that the result will be positive. + (_gcry_ecc_eddsa_verify): Likewise. + * cipher/ecc.c (ecc_check_secret_key): Use _gcry_ecc_fill_in_curve + instead of _gcry_ecc_update_curve_param. + * mpi/ec.c (ec_subm): Make sure the result will be positive. + (dup_point_edwards, sub_points_edwards, _gcry_mpi_ec_curve_point): Use + mpi_sub instead of mpi_neg. + (add_points_edwards): Simply use ec_addm. + * tests/t-mpi-point.c (test_curve): Define curves with positive + coefficients. + +2016-04-01 Werner Koch + + mpi: Explicitly limit the allowed input length for gcry_mpi_scan. + + commit 862cf19a119427dd7ee7959a36c72d905f5ea5ca + * mpi/mpicoder.c (MAX_EXTERN_SCAN_BYTES): New. + (mpi_fromstr): Check against this limit. + (_gcry_mpi_scan): Ditto. + * tests/mpitests.c (test_maxsize): New. + (main): Cal that test. + +2016-03-31 Werner Koch + + cipher: Remove specialized rmd160 functions. + + commit fcce0cb6e8af70b134c6ecc3f56afa07a7d31f27 + * cipher/rmd160.c: Replace rmd.h by hash-common.h. + (RMD160_CONTEXT): Move from rmd.h to here. + (_gcry_rmd160_init): Remove. + (_gcry_rmd160_mixblock): Remove. + (_gcry_rmd160_hash_buffer): Use rmd160_init directly. + * cipher/md.c: Remove rmd.h which was not actually used. + * cipher/rmd.h: Remove. + * cipher/Makefile.am (libcipher_la_SOURCES): Remove rmd.h. + * configure.ac (USE_RMD160): Allow to build without RMD160. + + random: Replace RMD160 by SHA-1 for mixing the CSPRNG pool. + + commit a9cbe2d1f6a517a831517da8bc1d29e3e0b2c0c0 + * cipher/sha1.c (_gcry_sha1_mixblock_init): New. + (_gcry_sha1_mixblock): New. + * random/random-csprng.c: Include sha1.h instead of rmd.h. + (mix_pool): Use SHA-1 instead of RIPE-MD-160 for mixing. + + cipher: Move sha1 context definition to a separate file. + + commit 142a479a484cb4e84d0561be9b05b44dac9e6fe2 + * cipher/sha1.c: Replace hash-common.h by sha1.h. + (SHA1_CONTEXT): Move to ... + * cipher/sha1.h: new. Always include all flags. + * cipher/Makefile.am (libcipher_la_SOURCES): Add sha1.h. + +2016-03-29 Werner Koch + + tests: Fix buffer overflow in bench-slope. + + commit 48ee918400762281bec5b6fc218a9f0d119aac7c + * tests/bench-slope.c (bench_print_result_std): Remove wrong use of + strncat. + +2016-03-27 Jussi Kivilinna + + cipher: GCM: check that length of supplied tag is one of valid lengths. + + commit f2260e3a2e962ac80124ef938e54041bbea08561 + * cipher/cipher-gcm.c (is_tag_length_valid): New. + (_gcry_cipher_gcm_tag): Check that 'outbuflen' has valid tag length. + * tests/basic.c (_check_gcm_cipher): Add test-vectors with different + valid tag lengths and negative test vectors with invalid lengths. + +2016-03-24 Peter Wu + + cipher: Fix memleaks in (self)tests. + + commit 4a064e2a06fe737f344d1dfd8a45cc4c2abbe4c9 + * cipher/dsa.c: Release memory for MPI and sexp structures. + * cipher/ecc.c: Release memory for sexp structure. + * tests/keygen.c: Likewise. + + Mark constant MPIs as non-leaked. + + commit 470a30db241a2d567739ef2adb2a2ee64992d8b4 + * mpi/mpiutil.c: Mark "constant" MPIs as explicitly leaked. + +2016-03-23 Werner Koch + + Add new control GCRYCTL_GET_TAGLEN for use with gcry_cipher_info. + + commit fea5971488e049f902d7912df22a945bc755ad6d + * src/gcrypt.h.in (GCRYCTL_GET_TAGLEN): New. + * cipher/cipher.c (_gcry_cipher_info): Add GCRYCTL_GET_TAGLEN feature. + + * tests/basic.c (_check_gcm_cipher): Check that new feature. + (_check_poly1305_cipher): Ditto. + (check_ccm_cipher): Ditto. + (do_check_ocb_cipher): Ditto. + (check_ctr_cipher): Add negative test for new feature. + + cipher: Avoid NULL-segv in GCM mode if a key has not been set. + + commit e709d86fe596a4bcf235799468947c13ae657d78 + * cipher/cipher-gcm.c (_gcry_cipher_gcm_encrypt): Check that GHASH_FN + has been initialized. + (_gcry_cipher_gcm_decrypt): Ditto. + (_gcry_cipher_gcm_authenticate): Ditto. + (_gcry_cipher_gcm_initiv): Ditto. + (_gcry_cipher_gcm_tag): Ditto. + + cipher: Check length of supplied tag in _gcry_cipher_poly1305_check_tag. + + commit 7c9c82feecf94a455c66d9c38576f36c9c4b484c + * cipher/cipher-poly1305.c (_gcry_cipher_poly1305_tag): Check that the + provided tag length matches the actual tag length. + +2016-03-23 Peter Wu + + Fix buffer overrun in gettag for Poly1305. + + commit 6821e1bd94969106a70e3de17b86f6e6181f4e59 + * cipher/cipher-poly1305.c: copy a fixed length instead of the + user-supplied number. + +2016-03-23 Werner Koch + + cipher: Check length of supplied tag in _gcry_cipher_gcm_check_tag. + + commit 15785bc9fb1787554bf371945ecb191830c15bfd + * cipher/cipher-gcm.c (_gcry_cipher_gcm_tag): Check that the provided + tag length matches the actual tag length. Avoid gratuitous return + statements. + +2016-03-23 Peter Wu + + Fix buffer overrun in gettag for GCM. + + commit d3d7bdf8215275b3b20690dfde3f43dbe25b6f85 + * cipher/cipher-gcm.c: copy a fixed length instead of the user-supplied + number. + +2016-03-22 Werner Koch + + tests: Add options --fips to keygen for manual tests. + + commit d328095dd4de83b839d9d8c4bdbeec0956971016 + (main): Add option --fips. + * tests/keygen.c (check_rsa_keys): Create an 2048 bit key with e=3D65539 + because that is valid in FIPS mode. Check that key generation fails + for too short keys in FIPS mode. + (check_ecc_keys): Check that key generation fails for Ed25519 keys in + FIPS mode. + +2016-03-22 Tom=C3=A1=C5=A1 Mr=C3=A1z + + rsa: Add FIPS 186-4 compliant RSA probable prime key generator. + + commit 5f9b3c2e220ca6d0eaff32324a973ef67933a844 + * cipher/primegen.c (_gcry_fips186_4_prime_check): New. + * cipher/rsa.c (generate_fips): New. + (rsa_generate): Use new function in fips mode or with test-parms. + + * tests/keygen.c (check_rsa_keys): Add test using e=3D65539. + +2016-03-20 Jussi Kivilinna + + Fix ARM NEON support detection on ARMv6 target. + + commit 583919d70763671ed9feeaa14e1f66379aff88cc + * configure.ac (gcry_cv_gcc_inline_asm_neon): Use '.arm' directive + instead of '.thumb'. + +2016-03-18 Werner Koch + + Always require a 64 bit integer type. + + commit 897ccd21b7221982806b5c024518f4e989152f14 + * configure.ac (available_digests_64): Merge with available_digests. + (available_kdfs_64): Merge with available_kdfs. + <64 bit datatype test>: Bail out if no such type is available. + * src/types.h: Emit #error if no u64 can be defined. + (PROPERLY_ALIGNED_TYPE): Always add u64 type. + * cipher/bithelp.h: Remove all code paths which handle the + case of !HAVE_U64_TYPEDEF. + * cipher/bufhelp.h: Ditto. + * cipher/cipher-ccm.c: Ditto. + * cipher/cipher-gcm.c: Ditto. + * cipher/cipher-internal.h: Ditto. + * cipher/cipher.c: Ditto. + * cipher/hash-common.h: Ditto. + * cipher/md.c: Ditto. + * cipher/poly1305.c: Ditto. + * cipher/scrypt.c: Ditto. + * cipher/tiger.c: Ditto. + * src/g10lib.h: Ditto. + * tests/basic.c: Ditto. + * tests/bench-slope.c: Ditto. + * tests/benchmark.c: Ditto. + +2016-03-18 Vitezslav Cizek + + tests: Fix testsuite after the FIPS adjustments. + + commit 9ecc2690181ba0bb44f66451a7dce2fc19965793 + * tests/benchmark.c (ecc_bench): Avoid not approved curves in FIPS. + * tests/curves.c (check_get_params): Skip Brainpool curves in FIPS. + * tests/keygen.c (check_dsa_keys): Generate 2048 and 3072 bits keys. + (check_ecc_keys): Skip Ed25519 in FIPS mode. + * tests/random.c (main): Don't switch DRBG in FIPS mode. + * tests/t-ed25519.c (main): Ed25519 isn't supported in FIPS mode. + * tests/t-kdf.c (check_openpgp): Skip vectors using md5 in FIPS. + * tests/t-mpi-point.c (context_param): Skip P-192 and Ed25519 in FIPS. + (main): Skip math tests that use P-192 and Ed25519 in FIPS. + + tests: Add new --pss option to fipsdrv. + + commit 1a02d741cacc3b57fe3d6ffebd794d53a60c9e97 + * tests/fipsdrv.c (run_rsa_sign, run_rsa_verify): Set salt-length + to 0 for PSS. + + cipher: Add option to specify salt length for PSS verification. + + commit 0bd8137e68c201b6c2290710e348aaf57efa2b2e + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): Check for + salt-length token. + + tests: Add support for RSA keygen tests to fipsdrv. + + commit 2e139456369a834cf87d983da4f61241fda76efe + * tests/fipsdrv.c (run_rsa_keygen): New. + (main): Support RSA keygen and RSA keygen KAT tests. + + tests: Fixes for RSA testsuite in FIPS mode. + + commit c690230af5a66b809f8f6fbab1a6262a5ba078cb + * tests/basic.c (get_keys_new): Generate 2048 bit key. + * tests/benchmark.c (rsa_bench): Skip keys of lengths different + than 2048 and 3072 in FIPS mode. + * tests/keygen.c (check_rsa_keys): Failure if short keys can be + generated in FIPS mode. + (check_dsa_keys): Ditto for DSA keys. + * tests/pubkey.c (check_x931_derived_key): Skip keys < 2048 in FIPS. + + rsa: Use 2048 bit RSA keys for selftest. + + commit 78cec8b4754fdf774edb2d575000cb3e972e244c + * cipher/rsa.c (selftests_rsa): Use 2048 bit keys. + (selftest_encr_1024): Replaced by selftest_encr_2048. + (selftest_sign_1024): Replaced by selftest_sign_2048. + (selftest_encr_2048): Add check against known ciphertext. + (selftest_sign_2048): Add check against known signature. + (selftest_sign_2048): Free SIG_MPI. + * tests/pubkey.c (get_keys_new): Generate 2048 bit keys. + + Disable non-allowed algorithms in FIPS mode. + + commit ce1cbe16992a7340edcf8e6576973e3508267640 + * cipher/cipher.c (_gcry_cipher_init), + * cipher/mac.c (_gcry_mac_init), + * cipher/md.c (_gcry_md_init), + * cipher/pubkey.c (_gcry_pk_init): In the FIPS mode, disable all the + non-allowed ciphers. + * cipher/md5.c: Mark MD5 as not allowed in FIPS. + * src/g10lib.h (_gcry_mac_init): New. + * src/global.c (global_init): Call the new _gcry_mac_init. + * tests/basic.c (check_ciphers): Fix a typo. + +2016-03-18 Werner Koch + + kdf: Make PBKDF2 check work on all platforms. + + commit c478cf175887c84dc071c4f73a7667603b354789 + * cipher/kdf.c (_gcry_kdf_pkdf2): Chnage DKLEN to unsigned long. + +2016-03-18 Vitezslav Cizek + + kdf: Add upper bound for derived key length in PBKDF2. + + commit 0f741b0704bac5c0e2d2a0c2b34b44b35baa76d6 + * cipher/kdf.c (_gcry_kdf_pkdf2): limit dkLen. + + ecc: ECDSA adjustments for FIPS 186-4. + + commit a242e3d9185e6e2dc13902ea9331131755bbba01 + * cipher/ecc-curves.c: Unmark curve P-192 for FIPS. + * cipher/ecc.c: Add ECDSA self test. + * cipher/pubkey-util.c (_gcry_pk_util_init_encoding_ctx): Use SHA-2 + in FIPS mode. + * tests/fipsdrv.c: Add support for ECDSA signatures. + +2016-03-18 Werner Koch + + dsa: Make regression tests work. + + commit e40939b2141306238cc30a340b867b60fa4dc2a3 + * cipher/dsa.c (sample_secret_key_1024): Comment out unused constant. + (ogenerate_fips186): Make it work with use-fips183-2 flag. + * cipher/primegen.c (_gcry_generate_fips186_3_prime): Use Emacs + standard comment out format. + * tests/fips186-dsa.c (check_dsa_gen_186_3): New dummy fucntion. + (main): Call it. + (main): Compare against current version. + * tests/pubkey.c (get_dsa_key_fips186_new): Create 2048 bit key. + (get_dsa_key_fips186_with_seed_new): Ditto. + (get_dsa_key_fips186_with_domain_new): Comment out. + (check_run): Do not call that function. + +2016-03-18 Vitezslav Cizek + + dsa: Adjustments to conform with FIPS 186-4. + + commit 80e9f95e6f419daa765e4876c858e3e36e808897 + * cipher/dsa.c (generate_fips186): FIPS 186-4 adjustments. + * cipher/primegen.c (_gcry_generate_fips186_3_prime): Fix incorrect + buflen passed to _gcry_mpi_scan. + +2016-03-16 Justus Winter + + Update documentation for 'gcry_sexp_extract_param'. + + commit 4051fe7fec6ffdc7a2f5c3856665478866991ee7 + * doc/gcrypt.texi (gcry_sexp_extract_param): Mention that all MIPs + must be set to NULL first, and document how the function behaves in + case of errors. + * src/sexp.c (_gcry_sexp_extract_param): Likewise. + * src/gcrypt.h.in (gcry_sexp_extract_param): Copy the comment from + '_gcry_sexp_extract_param'. + + cipher: Update comment. + + commit fcf4358a7a7ba8d32bf385ea99ced5f47cbd3ae2 + * cipher/ecc.c (ecc_get_nbits): Update comment to reflect the fact + that a curve parameter can be given. + +2016-03-12 Jussi Kivilinna + + Add Intel PCLMUL implementations of CRC algorithms. + + commit 5d601dd57fcb41aa2015ab655fd6fc51537da667 + * cipher/Makefile.am: Add 'crc-intel-pclmul.c'. + * cipher/crc-intel-pclmul.c: New. + * cipher/crc.c (USE_INTEL_PCLMUL): New macro. + (CRC_CONTEXT) [USE_INTEL_PCLMUL]: Add 'use_pclmul'. + [USE_INTEL_PCLMUL] (_gcry_crc32_intel_pclmul) + (gcry_crc24rfc2440_intel_pclmul): New. + (crc32_init, crc32rfc1510_init, crc24rfc2440_init) + [USE_INTEL_PCLMUL]: Select PCLMUL implementation if SSE4.1 and PCLMUL + HW features detected. + (crc32_write, crc24rfc2440_write) [USE_INTEL_PCLMUL]: Use PCLMUL + implementation if enabled. + (crc24_init): Document storage format of 24-bit CRC. + (crc24_next4): Use only 'data' for last table look-up. + * configure.ac: Add 'crc-intel-pclmul.lo'. + * src/g10lib.h (HWF_*, HWF_INTEL_SSE4_1): Update HWF flags to include + Intel SSE4.1. + * src/hwf-x86.c (detect_x86_gnuc): Add SSE4.1 detection. + * src/hwfeatures.c (hwflist): Add 'intel-sse4.1'. + * tests/basic.c (fillbuf_count): New. + (check_one_md): Add "?" check (million byte data-set with byte pattern + 0x00,0x01,0x02,...); Test all buffer sizes 1 to 1000, for "!" and "?" + checks. + (check_one_md_multi): Skip "?". + (check_digests): Add "?" test-vectors for MD5, SHA1, SHA224, SHA256, + SHA384, SHA512, SHA3_224, SHA3_256, SHA3_384, SHA3_512, RIPEMD160, + CRC32, CRC32_RFC1510, CRC24_RFC2440, TIGER1 and WHIRLPOOL; Add "!" + test-vectors for CRC32_RFC1510 and CRC24_RFC2440. + +2016-02-25 NIIBE Yutaka + + mpi: Normalize EXPO for mpi_powm. + + commit fdfa5bfefdde316688a3c8021bd3528c5273b0f4 + * mpi/mpi-pow.c (gcry_mpi_powm): Normalize EP. + +2016-02-22 Andreas Metzler + + Do not ship generated header file in tarball. + + commit 2b40a16333fa75f1cee85ab901a5aa9cff845a92 + * src/Makefile.am: Move gcrypt.h from include_HEADERS to + nodist_include_HEADERS to prevent inclusion in release tarball. + This could break out-of-tree-builds because the potentially outdated + src/gcrypt.h was not updated but was in the compiler search path. + +2016-02-20 Jussi Kivilinna + + Fix building random-drbg for Win32/64. + + commit 531b25aa94c58f6d2168a9537c8cea6c53d7bbe0 + * random/random-drbg.c: Remove include for sys/types.h and asm/types.h. + (DRBG_PREDICTION_RESIST, DRBG_CTRAES, DRBG_CTRSERPENT, DRBG_CTRTWOFISH) + (DRBG_HASHSHA1, DRBG_HASHSHA224, DRBG_HASHSHA256, DRBG_HASHSHA384) + (DRBG_HASHSHA512, DRBG_HMAC, DRBG_SYM128, DRBG_SYM192) + (DRBG_SYM256): Change 'u_int32_t' to 'u32'. + (drbg_get_entropy) [USE_RNDUNIX, USE_RNDW32]: Fix parameters + 'drbg_read_cb' and 'len'. + +2016-02-20 Werner Koch + + tests: Do not test DRBG_REINIT from "make check" + + commit 839d12c221430b60db5e0d6fbb107f22e0a6837f + * tests/random.c (main): Run check_drbg_reinit only if the envvar + GCRYPT_IN_REGRESSION_TEST is set. + + doc: Fix possible dependency problem. + + commit 3b57e5a1ba68e26dcaea38b763287fddba9b6b7c + * doc/Makefile.am (gcrypt.texi): Use the right traget. + +2016-02-19 Stephan Mueller + + random: Remove ANSI X9.31 DRNG. + + commit e9b692d25d1c149b5417b70e18f2ce173bc25b6d + * random-fips.c: Remove. + +2016-02-19 Werner Koch + + random: Add a test case for DRBG_REINIT. + + commit 934ba2ae5a95a96fdbb3b935b51ba43df66f11df + * src/global.c (_gcry_vcontrol) : Test for FIPS RNG. + * tests/random.c (check_drbg_reinit): New. + (main): Call new test. + + random: Allow DRBG_REINIT before initialization. + + commit 7cdbd6e6a3cf1ee366b981e148d41b1187a6fdcf + * random/random-drbg.c (DRBG_DEFAULT_TYPE): New. + (_drbg_init_internal): Set the default type if no type has been set + before. + (_gcry_rngdrbg_inititialize): Pass 0 for flags to use the default. + + Add new private header gcrypt-testapi.h. + + commit 744b030cff61fd25114b0b25394c62782c153343 + * src/gcrypt-testapi.h: New. + * src/Makefile.am (libgcrypt_la_SOURCES): Add new file. + * random/random.h: Include gcrypt-testapi.h. + (struct gcry_drbg_test_vector) : Move to gcrypt-testapi.h. + * src/global.c: Include gcrypt-testapi.h. + (_gcry_vcontrol): Use PRIV_CTL_* constants instead of 58, 59, 60, 61. + * cipher/cipher.c: Include gcrypt-testapi.h. + (_gcry_cipher_ctl): Use PRIV_CIPHERCTL_ constants instead of 61, 62. + * tests/fipsdrv.c: Include gcrypt-testapi.h. Remove definition of + PRIV_CTL_ constants and replace their use by the new PRIV_CIPHERCTL_ + constants. + * tests/t-lock.c: Include gcrypt-testapi.h. Remove + PRIV_CTL_EXTERNAL_LOCK_TEST and EXTERNAL_LOCK_TEST_ constants. + + * random/random-drbg.c (gcry_rngdrbg_cavs_test): Rename to ... + (_gcry_rngdrbg_cavs_test): this. + (gcry_rngdrbg_healthcheck_one): Rename to ... + (_gcry_rngdrbg_healthcheck_one): this. + + random: Make the DRBG C-90 clean and use a flag string. + + commit 95f1db3affb9f5b8a2c814c211d4a02b30446c15 + * random/random.h (struct gcry_drbg_test_vector): Rename "flags" to + "flagstr" and turn it into a string. + * random/random-drbg.c (drbg_test_pr, drbg_test_nopr): Replace use of + designated initializers. Use a string for the flags. + (gcry_rngdrbg_cavs_test): Parse the flag string into a flag value. + (drbg_healthcheck_sanity): Ditto. + + random: Symbol name cleanup for random-drbg.c. + + commit 85ed07790552297586258e8fe09b546eee357a8b + * random/random-drbg.c: Rename all static objects and macros from + "gcry_drbg" to "drbg". + (drbg_string_t): New typedef. + (drbg_gen_t): New typedef. + (drbg_state_t): New typedef. Replace all "struct drbg_state_s *" by + this. + (_drbg_init_internal): Replace xcalloc_secure by xtrycalloc_secure so + that an error if actually returned. + (gcry_rngdrbg_cavs_test): Ditto. + (gcry_drbg_healthcheck_sanity): Ditto. + + random: Use our symbol name pattern also for drbg functions. + + commit 7cf3c929331133e4381dbceac53d3addd921c929 + * random/random-drbg.c: Rename global functions from _gcry_drbg_* + to _gcry_rngdrbg_*. + * random/random.c: Adjust for this change. + * src/global.c: Ditto. + + random: Rename drbg.c to random-drbg.c. + + commit e49b3f2c10e012509b5930c0df4d6df378d3b9f4 + * random/drbg.c: Rename to ... + * random/random-drbg.c: this. + * random/Makefile.am (librandom_la_SOURCES): Adjust accordingly. + + random: Remove the new API introduced by the new DRBG. + + commit dfac2b13d0068b2b1b420d77e9771a49964b81c1 + * src/gcrypt.h.in (struct gcry_drbg_gen): Move to random/drbg.c. + (struct gcry_drbg_string): Ditto. + (gcry_drbg_string_fill): Ditto. + (gcry_randomize_drbg): Remove. + * random/drbg.c (parse_flag_string): New. + (_gcry_drbg_reinit): Change the way the arguments are passed. + * src/global.c (_gcry_vcontrol) : Change calling + convention. + + Add helper function _gcry_strtokenize. + + commit 4e134b6e77f558730ec1eceb6b816b0bcfd845e9 + * src/misc.c (_gcry_strtokenize): New. + +2016-02-18 Werner Koch + + random: Remove DRBG constants from the public API. + + commit fd13372fa9069d3a72947ea59c57e33637c936bf + * src/gcrypt.h.in (GCRY_DRBG_): Remove all new flags to ... + * random/drbg.c: here. + +2016-02-18 Stephan Mueller + + random: Add SP800-90A DRBG. + + commit ed57fed6de1465e02ec5e3bc0affeabdd35e2eb7 + * random/drbg.c: New. + * random/random.c (_gcry_random_initialize): Replace rngfips init by + drbg init. + (__gcry_random_close_fds): Likewise. + (_gcry_random_dump_stats): Likewise. + (_gcry_random_is_faked): Likewise. + (do_randomize): Likewise. + (_gcry_random_selftest): Likewise. + (_gcry_create_nonce): Replace rngfips_create_noce by drbg_randomize. + (_gcry_random_init_external_test): Remove. + (_gcry_random_run_external_test): Remove. + (_gcry_random_deinit_external_test): Remove. + * random/random.h (struct gcry_drbg_test_vector): New. + * src/gcrypt.h.in (struct gcry_drbg_gen): New. + (struct gcry_drbg_string): New. + (gcry_drbg_string_fill): New. + (gcry_randomize_drbg): New. + (GCRY_DRBG_): Lots of new macros. + * src/global.c (_gcry_vcontrol) : Turn into + a nop. + (_gcry_vcontrol) : Ditto. + (_gcry_vcontrol) : Change. + (_gcry_vcontrol) : New. + +2016-02-13 Jussi Kivilinna + + bufhelp: disable unaligned memory accesses on powerpc. + + commit 1da793d089b65ac8c1ead65dacb6b8699f5b6e69 + * cipher/bufhelp.h (BUFHELP_FAST_UNALIGNED_ACCESS): Disable for + __powerpc__ and __powerpc64__. + +2016-02-12 NIIBE Yutaka + + ecc: Not validate input point for Curve25519. + + commit 7a019bc7ecdbdfdef51094e090ce95e062da9b64 + * cipher/ecc.c (ecc_decrypt_raw): Curve25519 is an exception. + +2016-02-10 NIIBE Yutaka + + ecc: Fix memory leaks on error. + + commit b12dd550fd6af687ef95c584d0d8366c34965cc8 + * cipher/ecc.c (ecc_decrypt_raw): Go to leave to release memory. + * mpi/ec.c (_gcry_mpi_ec_curve_point): Likewise. + +2016-02-09 NIIBE Yutaka + + ecc: input validation on ECDH. + + commit 23b72901f8a5ba9a78485b235c7a917fbc8faae0 + * cipher/ecc.c (ecc_decrypt_raw): Validate the point. + +2016-02-08 Jussi Kivilinna + + Add ARM assembly implementation of SHA-512. + + commit 8353884bc65c820d5bcacaf1ac23cdee72091a09 + * cipher/Makefile.am: Add 'sha512-arm.S'. + * cipher/sha512-arm.S: New. + * cipher/sha512.c (USE_ARM_ASM): New. + (_gcry_sha512_transform_arm): New. + (transform) [USE_ARM_ASM]: Use ARM assembly implementation instead of + generic. + * configure.ac: Add 'sha512-arm.lo'. + +2016-02-03 NIIBE Yutaka + + tests: Add a test for Curve25519. + + commit b8b3361504950689ef1e779fb3357cecf8a9f739 + * tests/Makefile.am (tests_bin): Add t-cv25519. + * tests/t-cv25519.c: New. + +2016-02-02 NIIBE Yutaka + + ecc: Fix Curve25519 for data by older implementation. + + commit 6cb6df9dddac6ad246002b83c2ce0aaa0ecf30e5 + * cipher/ecc-misc.c (gcry_ecc_mont_decodepoint): Fix code path for + short length data. + + ecc: more fix of Curve25519. + + commit 48ba5a50066611ecacea850ced13f5cb66097a81 + * cipher/ecc-misc.c (gcry_ecc_mont_decodepoint): Fix removing of + prefix. Clear the MSB, according to RFC7748. + + ecc: Fix ECDH of Curve25519. + + commit a2f9afcd7fcdafd5951498b07f34957f9766dce9 + * cipher/ecc-misc.c (_gcry_ecc_mont_decodepoint): Fix calc of NBITS + and prefix detection. + * cipher/ecc.c (ecc_generate): Use NBITS instead of CTX->NBITS. + (ecc_encrypt_raw): Use NBITS from curve instead of from P. + Fix rawmpilen calculation. + (ecc_decrypt_raw): Likewise. Add debug output. + +2016-01-29 Jussi Kivilinna + + Improve performance of generic SHA256 implementation. + + commit f3e51161036382429c3491c7c881f36c0a653c7b + * cipher/sha256.c (R): Let caller do variable shuffling. + (Chro, Maj, Sum0, Sum1): Convert from inline functions to macros. + (W, I): New. + (transform_blk): Unroll round loop; inline message expansion to rounds + to make message expansion buffer smaller. + +2016-01-28 Werner Koch + + ecc: New API function gcry_mpi_ec_decode_point. + + commit 2cf2ca7bb9741ac86e8aa92d8f03b1c5f5938897 + * mpi/ec.c (_gcry_mpi_ec_decode_point): New. + * cipher/ecc-common.h: Move two prototypes to ... + * src/ec-context.h: here. + * src/gcrypt.h.in (gcry_mpi_ec_decode_point): New. + * src/libgcrypt.def (gcry_mpi_ec_decode_point): New. + * src/libgcrypt.vers (gcry_mpi_ec_decode_point): New. + * src/visibility.c (gcry_mpi_ec_decode_point): New. + * src/visibility.h: Add new function. + +2016-01-15 Werner Koch + + Fix build problem for rndegd.c. + + commit 191c2e4fe2dc0e00f61aa44e011a9596887e6ce1 + * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Test all RND modules. + * random/rndegd.c (_gcry_rndegd_connect_socket) + (my_make_filename): Use functions with '_' prefix. + + random: Fix possible AIX problem with sysconf in rndunix. + + commit 6303b0e83856ee89374b447e710f0ab2af61caec + * random/rndunix.c [HAVE_STDINT_H]: Include stdint.h. + (start_gatherer): Detect misbehaving sysconf. + +2015-12-27 Werner Koch + + random: Take at max 25% from RDRAND. + + commit 5a78e7f15e0dd96a8bf64e2bb142880bf8ea6965 + * random/rndlinux.c (_gcry_rndlinux_gather_random): Change use of + RDRAND from 50% to 25%. + +2015-12-07 Justus Winter + + cipher: Improve error handling. + + commit b9c02fbeb7efb7d0593b33485fb30c298291cf80 + * cipher/ecc.c (ecc_decrypt_raw): Improve error handling. + + cipher: Initialize 'flags'. + + commit ca06cd7f77acb317c2649c58918908f043dfe6bd + * cipher/ecc.c (ecc_encrypt_raw): Initialize 'flags' to 0. + +2015-12-05 NIIBE Yutaka + + ecc: CHANGE point representation of Curve25519. + + commit dd3d06e7f113cf7608f060ceb043262efd0b0c9d + * cipher/ecc-misc.c (_gcry_ecc_mont_decodepoint): Decode point with + the prefix 0x40, additional 0x00 by MPI handling, and shorter octets + by MPI normalization. + * cipher/ecc.c (ecc_generate, ecc_encrypt_raw, ecc_decrypt_raw): + Always add the prefix 0x40. + +2015-12-03 Jussi Kivilinna + + chacha20: fix alignment of self-test context. + + commit 6fadbcd088e2af3e48407b95d8d0c2a8b7ad6c38 + * cipher/chacha20.c (selftest): Ensure 16-byte alignment for chacha20 + context structure. + + salsa20: fix alignment of self-test context. + + commit 2cba0dbda462237f55438d4199eccd10c5e3f6ca + * cipher/salsa20.c (selftest): Ensure 16-byte alignment for salsa20 + context structure. + +2015-12-02 Justus Winter + + random: Drop fake entropy gathering function. + + commit d421ac283ec46d0ecaf6278ba4c24843f65fb2fa + * random/random-csprng.c (faked_rng): Drop variable. + (gather_faked): Drop prototype and function. + (initialize): Drop fallback code. + (_gcry_rngcsprng_is_faked): Change accordingly. + + random: Fix selection of entropy gathering function. + + commit 468a5796ffb1a7776db4004d534376c1b981d740 + * random/random-csprng.c (getfnc_gather_random): Do return NULL if no + usable entropy gathering function is found. The callsite then + installs the fake gather function. + +2015-11-26 NIIBE Yutaka + + ecc: minor improvement of point multiplication. + + commit 3658afd09c3b03b4398aaa5748387220c93b1a94 + * mpi/ec.c (_gcry_mpi_ec_mul_point): Move ec_subm out of the loop. + +2015-11-25 NIIBE Yutaka + + ecc: Constant-time multiplication for Weierstrass curve. + + commit 88e1358962e902ff1cbec8d53ba3eee46407851a + * mpi/ec.c (_gcry_mpi_ec_mul_point): Use simple left-to-right binary + method for Weierstrass curve when SCALAR is secure. + + mpi: fix gcry_mpi_swap_cond. + + commit f88adee3e1f3e2de7d63f92f90bfb3078afd3b4f + * mpi/mpiutil.c (_gcry_mpi_swap_cond): Relax the condition. + + mpi: Fix mpi_set_cond and mpi_swap_cond . + + commit 8ad682c412047d3b9196950709dbd7bd14ac8732 + * mpi/mpiutil.c (_gcry_mpi_set_cond, _gcry_mpi_swap_cond): Don't use + the operator of !!, but assume SET/SWAP is 0 or 1. + + ecc: multiplication of Edwards curve to be constant-time. + + commit 295b1c3540752af4fc5e6f41480e6db215222fba + * mpi/ec.c (_gcry_mpi_ec_mul_point): Use point_swap_cond. + + ecc: Add point_resize and point_swap_cond. + + commit b6015176df6bfae107ac82f9baa29ef2c175c9f9 + * mpi/ec.c (point_resize, point_swap_cond): New. + (_gcry_mpi_ec_mul_point): Use point_resize and point_swap_cond. + +2015-11-18 Justus Winter + + cipher: Fix error handling. + + commit 940dc8adc034a6c6c38742f6bfd7d837a532d537 + * cipher/cipher.c (_gcry_cipher_ctl): Fix error handling. + +2015-11-18 Jussi Kivilinna + + Tweak Keccak for small speed-up. + + commit 6571a64331839d7d952292163afbf34c8bef62e0 + * cipher/keccak_permute_32.h (KECCAK_F1600_PERMUTE_FUNC_NAME): Track + rounds with round constant pointer instead of separate round counter. + * cipher/keccak_permute_64.h (KECCAK_F1600_PERMUTE_FUNC_NAME): Ditto. + (KECCAK_F1600_ABSORB_FUNC_NAME): Tweak lanes pointer increment for bulk + absorb loops. + + Update license information for CRC. + + commit 15ea0acf8bb0aa307eccc23024a0bd7878fb8080 + * LICENSES: Remove 'Simple permissive' and 'IETF permissive' licenses + for 'cipher/crc.c' as result of rewrite of CRC implementations. + +2015-11-17 Justus Winter + + Fix typos found using codespell. + + commit 0e395944b70c7a92a6437f6bcc14f287c19ce9de + * cipher/cipher-ocb.c: Fix typos. + * cipher/des.c: Likewise. + * cipher/dsa-common.c: Likewise. + * cipher/ecc.c: Likewise. + * cipher/pubkey.c: Likewise. + * cipher/rsa-common.c: Likewise. + * cipher/scrypt.c: Likewise. + * random/random-csprng.c: Likewise. + * random/random-fips.c: Likewise. + * random/rndw32.c: Likewise. + * src/cipher-proto.h: Likewise. + * src/context.c: Likewise. + * src/fips.c: Likewise. + * src/gcrypt.h.in: Likewise. + * src/global.c: Likewise. + * src/sexp.c: Likewise. + * tests/mpitests.c: Likewise. + * tests/t-lock.c: Likewise. + +2015-11-01 Jussi Kivilinna + + Improve performance of Tiger hash algorithms. + + commit 89fa74d6b3e58cd4fcd6e0939a35e46cbaca2ea0 + * cipher/tiger.c (tiger_round, pass, key_schedule): Convert functions + to macros. + (transform_blk): Pass variable names instead of pointers to 'pass'. + + Add ARMv7/NEON implementation of Keccak. + + commit a1cc7bb15473a2419b24ecac765ae0ce5989a13b + * cipher/Makefile.am: Add 'keccak-armv7-neon.S'. + * cipher/keccak-armv7-neon.S: New. + * cipher/keccak.c (USE_64BIT_ARM_NEON): New. + (NEED_COMMON64): Select if USE_64BIT_ARM_NEON. + [NEED_COMMON64] (round_consts_64bit): Rename to... + [NEED_COMMON64] (_gcry_keccak_round_consts_64bit): ...this; Add + terminator at end. + [USE_64BIT_ARM_NEON] (_gcry_keccak_permute_armv7_neon) + (_gcry_keccak_absorb_lanes64_armv7_neon, keccak_permute64_armv7_neon) + (keccak_absorb_lanes64_armv7_neon, keccak_armv7_neon_64_ops): New. + (keccak_init) [USE_64BIT_ARM_NEON]: Select ARM/NEON implementation + if supported by HW. + * cipher/keccak_permute_64.h (KECCAK_F1600_PERMUTE_FUNC_NAME): Update + to use new round constant table. + * configure.ac: Add 'keccak-armv7-neon.lo'. + + Optimize Keccak 64-bit absorb functions. + + commit 2857cb89c6dc1c02266600bc1fd2967a3cd5cf88 + * cipher/keccak.c [USE_64BIT] [__x86_64__] (absorb_lanes64_8) + (absorb_lanes64_4, absorb_lanes64_2, absorb_lanes64_1): New. + * cipher/keccak.c [USE_64BIT] [!__x86_64__] (absorb_lanes64_8) + (absorb_lanes64_4, absorb_lanes64_2, absorb_lanes64_1): New. + [USE_64BIT] (KECCAK_F1600_ABSORB_FUNC_NAME): New. + [USE_64BIT] (keccak_absorb_lanes64): Remove. + [USE_64BIT_SHLD] (KECCAK_F1600_ABSORB_FUNC_NAME): New. + [USE_64BIT_SHLD] (keccak_absorb_lanes64_shld): Remove. + [USE_64BIT_BMI2] (KECCAK_F1600_ABSORB_FUNC_NAME): New. + [USE_64BIT_BMI2] (keccak_absorb_lanes64_bmi2): Remove. + * cipher/keccak_permute_64.h (KECCAK_F1600_ABSORB_FUNC_NAME): New. + +2015-10-31 Jussi Kivilinna + + Enable CRC test vectors with zero bytes. + + commit 07e4839e75a7bca3a6c0a94aecfe75efe61d7ff2 + * tests/basic.c (check_digests): Enable CRC test-vectors with zero + bytes. + + Keccak: Add SHAKE Extendable-Output Functions. + + commit c0b9eee2d93a13930244f9ce0c14ed6b4aeb6c29 + * src/hash-common.c (_gcry_hash_selftest_check_one): Add handling for + XOFs. + * src/keccak.c (keccak_ops_t): Rename 'extract_inplace' to 'extract' + and add 'pos' argument. + (KECCAK_CONTEXT): Add 'suffix'. + (keccak_extract_inplace64): Rename to... + (keccak_extract64): ...this; Add handling for 'pos' argument. + (keccak_extract_inplace32bi): Rename to... + (keccak_extract32bi): ...this; Add handling for 'pos' argument. + (keccak_extract_inplace64): Rename to... + (keccak_extract64): ...this; Add handling for 'pos' argument. + (keccak_extract_inplace32bi_bmi2): Rename to... + (keccak_extract32bi_bmi2): ...this; Add handling for 'pos' argument. + (keccak_init): Setup 'suffix'; add SHAKE128 & SHAKE256. + (shake128_init, shake256_init): New. + (keccak_final): Do not initial permute for SHAKE output; use correct + suffix for SHAKE. + (keccak_extract): New. + (keccak_selftests_keccak): Add SHAKE128 & SHAKE256 test-vectors. + (run_selftests): Add SHAKE128 & SHAKE256. + (shake128_asn, oid_spec_shake128, shake256_asn, oid_spec_shake256) + (_gcry_digest_spec_shake128, _gcry_digest_spec_shake256): New. + * cipher/md.c (digest_list): Add SHAKE128 & SHAKE256. + * doc/gcrypt.texi: Ditto. + * src/cipher.h (_gcry_digest_spec_shake128) + (_gcry_digest_spec_shake256): New. + * src/gcrypt.h.in (GCRY_MD_SHAKE128, GCRY_MD_SHAKE256): New. + * tests/basic.c (check_one_md): Add XOF check; Add 'elen' argument. + (check_one_md_multi): Skip if algo is XOF. + (check_digests): Add SHAKE128 & SHAKE256 test vectors. + * tests/bench-slope.c (kdf_bench_one): Skip XOFs. + + Few updates to documentation. + + commit 28de6f9e16e386018e81a9cdaee596be7616ccab + * doc/gcrypt.text: Add mention of new 'intel-fast-shld' hw feature + flag; Add mention of x86 RDRAND support in rndhw. + + Add HMAC-SHA3 test vectors. + + commit 92ad19873562cfce7bcc4a0b5aed8195d8284cfc + * tests/basic.c (check_mac): Add HMAC_SHA3 test vectors. + +2015-10-28 Jussi Kivilinna + + md: add variable length output interface. + + commit 577dc2b63ceca6a8a716256d034ea4e7414f65fa + * cipher/crc.c (_gcry_digest_spec_crc32) + (_gcry_digest_spec_crc32_rfc1510, _gcry_digest_spec_crc24_rfc2440): Set + 'extract' NULL. + * cipher/gostr3411-94.c (_gcry_digest_spec_gost3411_94) + (_gcry_digest_spec_gost3411_cp): Ditto. + * cipher/keccak.c (_gcry_digest_spec_sha3_224) + (_gcry_digest_spec_sha3_256, _gcry_digest_spec_sha3_384) + (_gcry_digest_spec_sha3_512): Ditto. + * cipher/md2.c (_gcry_digest_spec_md2): Ditto. + * cipher/md4.c (_gcry_digest_spec_md4): Ditto. + * cipher/md5.c (_gcry_digest_spec_md5): Ditto. + * cipher/rmd160.c (_gcry_digest_spec_rmd160): Ditto. + * cipher/sha1.c (_gcry_digest_spec_sha1): Ditto. + * cipher/sha256.c (_gcry_digest_spec_sha224) + (_gcry_digest_spec_sha256): Ditto. + * cipher/sha512.c (_gcry_digest_spec_sha384) + (_gcry_digest_spec_sha512): Ditto. + * cipher/stribog.c (_gcry_digest_spec_stribog_256) + (_gcry_digest_spec_stribog_512): Ditto. + * cipher/tiger.c (_gcry_digest_spec_tiger) + (_gcry_digest_spec_tiger1, _gcry_digest_spec_tiger2): Ditto. + * cipher/whirlpool.c (_gcry_digest_spec_whirlpool): Ditto. + * cipher/md.c (md_enable): Do not allow combination of HMAC and + 'expandable-output function'. + (md_final): Check if spec->read is NULL before calling. + (md_read): Ditto. + (md_extract, _gcry_md_extract): New. + * doc/gcrypt.texi: Add SHA3 algorithms and gcry_md_extract. + * src/cipher-proto.h (gcry_md_extract_t): New. + (gcry_md_spec_t): Add 'extract'. + * src/gcrypt-int.g (_gcry_md_extract): New. + * src/gcrypt.h.in (gcry_md_extract): New. + * src/libgcrypt.def: Add gcry_md_extract. + * src/libgcrypt.vers: Add gcry_md_extract. + * src/visibility.c (gcry_md_extract): New. + * src/visibility.h (gcry_md_extract): New. + + md: check hmac flag in prepare_macpads. + + commit cee2e122ec6c1886957a8d47498eb63a6a921725 + * cipher/md.c (prepare_macpads): Check hmac flag. + + keccak: rewrite for improved performance. + + commit 74184c28fbe7ff58cf57f0094ef957d94045da7d + * cipher/Makefile.am: Add 'keccak_permute_32.h' and + 'keccak_permute_64.h'. + * cipher/hash-common.h [USE_SHA3] (MD_BLOCK_MAX_BLOCKSIZE): Remove. + * cipher/keccak.c (USE_64BIT, USE_32BIT, USE_64BIT_BMI2) + (USE_64BIT_SHLD, USE_32BIT_BMI2, NEED_COMMON64, NEED_COMMON32BI) + (keccak_ops_t): New. + (KECCAK_STATE): Add 'state64' and 'state32bi' members. + (KECCAK_CONTEXT): Remove 'bctx'; add 'blocksize', 'count' and 'ops'. + (rol64, keccak_f1600_state_permute): Remove. + [NEED_COMMON64] (round_consts_64bit, keccak_extract_inplace64): New. + [NEED_COMMON32BI] (round_consts_32bit, keccak_extract_inplace32bi) + (keccak_absorb_lane32bi): New. + [USE_64BIT] (ANDN64, ROL64, keccak_f1600_state_permute64) + (keccak_absorb_lanes64, keccak_generic64_ops): New. + [USE_64BIT_SHLD] (ANDN64, ROL64, keccak_f1600_state_permute64_shld) + (keccak_absorb_lanes64_shld, keccak_shld_64_ops): New. + [USE_64BIT_BMI2] (ANDN64, ROL64, keccak_f1600_state_permute64_bmi2) + (keccak_absorb_lanes64_bmi2, keccak_bmi2_64_ops): New. + [USE_32BIT] (ANDN64, ROL64, keccak_f1600_state_permute32bi) + (keccak_absorb_lanes32bi, keccak_generic32bi_ops): New. + [USE_32BIT_BMI2] (ANDN64, ROL64, keccak_f1600_state_permute32bi_bmi2) + (pext, pdep, keccak_absorb_lane32bi_bmi2, keccak_absorb_lanes32bi_bmi2) + (keccak_extract_inplace32bi_bmi2, keccak_bmi2_32bi_ops): New. + (keccak_write): New. + (keccak_init): Adjust to KECCAK_CONTEXT changes; add implementation + selection based on HWF features. + (keccak_final): Adjust to KECCAK_CONTEXT changes; use selected 'ops' + for state manipulation. + (keccak_read): Adjust to KECCAK_CONTEXT changes. + (_gcry_digest_spec_sha3_224, _gcry_digest_spec_sha3_256) + (_gcry_digest_spec_sha3_348, _gcry_digest_spec_sha3_512): Use + 'keccak_write' instead of '_gcry_md_block_write'. + * cipher/keccak_permute_32.h: New. + * cipher/keccak_permute_64.h: New. + + hwf-x86: add detection for Intel CPUs with fast SHLD instruction. + + commit 909644ef5883927262366c356eed530e55aba478 + * cipher/sha1.c (sha1_init): Use HWF_INTEL_FAST_SHLD instead of + HWF_INTEL_CPU. + * cipher/sha256.c (sha256_init, sha224_init): Ditto. + * cipher/sha512.c (sha512_init, sha384_init): Ditto. + * src/g10lib.h (HWF_INTEL_FAST_SHLD): New. + (HWF_INTEL_BMI2, HWF_INTEL_SSSE3, HWF_INTEL_PCLMUL, HWF_INTEL_AESNI) + (HWF_INTEL_RDRAND, HWF_INTEL_AVX, HWF_INTEL_AVX2) + (HWF_ARM_NEON): Update. + * src/hwf-x86.c (detect_x86_gnuc): Add detection of Intel Core + CPUs with fast SHLD/SHRD instruction. + * src/hwfeatures.c (hwflist): Add "intel-fast-shld". + + Fix OCB amd64 assembly implementations for x32. + + commit 16fd540f4d01eb6dc23d9509ae549353617c7a67 + * cipher/camellia-glue.c (_gcry_camellia_aesni_avx_ocb_enc) + (_gcry_camellia_aesni_avx_ocb_dec, _gcry_camellia_aesni_avx_ocb_auth) + (_gcry_camellia_aesni_avx2_ocb_enc, _gcry_camellia_aesni_avx2_ocb_dec) + (_gcry_camellia_aesni_avx2_ocb_auth, _gcry_camellia_ocb_crypt) + (_gcry_camellia_ocb_auth): Change 'Ls' from pointer array to u64 array. + * cipher/serpent.c (_gcry_serpent_sse2_ocb_enc) + (_gcry_serpent_sse2_ocb_dec, _gcry_serpent_sse2_ocb_auth) + (_gcry_serpent_avx2_ocb_enc, _gcry_serpent_avx2_ocb_dec) + (_gcry_serpent_ocb_crypt, _gcry_serpent_ocb_auth): Ditto. + * cipher/twofish.c (_gcry_twofish_amd64_ocb_enc) + (_gcry_twofish_amd64_ocb_dec, _gcry_twofish_amd64_ocb_auth) + (twofish_amd64_ocb_enc, twofish_amd64_ocb_dec, twofish_amd64_ocb_auth) + (_gcry_twofish_ocb_crypt, _gcry_twofish_ocb_auth): Ditto. + + bench-slope: add KDF/PBKDF2 benchmark. + + commit ae40af427fd2a856b24ec2a41323ec8b80ffc9c0 + * tests/bench-slope.c (bench_kdf_mode, bench_kdf_init, bench_kdf_free) + (bench_kdf_do_bench, kdf_ops, kdf_bench_one, kdf_bench): New. + (print_help): Add 'kdf'. + (main): Add KDF benchmarks. + +2015-10-22 NIIBE Yutaka + + md: keep contexts for HMAC in GcryDigestEntry. + + commit f7505b550dd591e33d3a3fab9277c43c460f1bad + * cipher/md.c (struct gcry_md_context): Add flags.hmac. + Remove macpads and mcpads_Bsize. + (md_open): Initialize flags.hmac. Remove macpads initialization. + (md_enable): Allocate contexts when flags.hmac is enabled. + (md_copy): Remove macpads copying. Add copying contexts. + (_gcry_md_reset): When flags.hmac is enabled, restore precomputed + context with input pad + (md_close): Remove macpads wiping. + (md_final): When flags.hmac is enabled, compute hmac by precomputed + context with output pad. + (prepare_macpads): Prepare precomputed contexts with input pad and + output pad for each registered digest entry. + (_gcry_md_setkey): Just call prepare_macpads. + +2015-10-15 NIIBE Yutaka + + Fix double free on error. + + commit 1c6d2698a84e4bf82735287c1d64954bfc1a1982 + * src/hmac256.c (_gcry_hmac256_finalize): Don't free HD. + +2015-10-14 NIIBE Yutaka + + Fix gpg_error_t and gpg_err_code_t confusion. + + commit 813565a07ca575c87e1252c6ed26018653ecd338 + * src/gcrypt-int.h (_gcry_sexp_extract_param): Revert the change. + * cipher/dsa.c (dsa_check_secret_key): Ditto. + * src/sexp.c (_gcry_sexp_extract_param): Return gpg_err_code_t. + + * src/gcrypt-int.h (_gcry_err_make_from_errno) + (_gcry_error_from_errno): Return gpg_error_t. + * cipher/cipher.c (_gcry_cipher_open_internal) + (_gcry_cipher_ctl, _gcry_cipher_ctl): Don't use gcry_error. + * src/global.c (_gcry_vcontrol): Likewise. + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_genkey): Use + gpg_err_code_from_syserror. + * cipher/mac.c (mac_reset, mac_setkey, mac_setiv, mac_write) + (mac_read, mac_verify): Return gcry_err_code_t. + * cipher/rsa-common.c (mgf1): Use gcry_err_code_t for ERR. + * src/visibility.c (gcry_error_from_errno): Return gpg_error_t. + +2015-10-13 Jussi Kivilinna + + Fix compiling AES/AES-NI implementation on linux-i386. + + commit fa94b6111948a614ebdcb67f7942eced8b84c579 + * cipher/rijndael-aesni.c (do_aesni_ctr_4): Split assembly block in + two parts to reduce number of register constraints needed. + +2015-10-13 NIIBE Yutaka + + Fix declaration of return type. + + commit 73374fdd27c7ba28b19f9672c68a6f5b72252fe5 + * src/gcrypt-int.h (_gcry_sexp_extract_param): Return gpg_error_t. + * cipher/dsa.c (dsa_generate): Fix call to _gcry_sexp_extract_param. + * src/g10lib.h (_gcry_vcontrol): Return gcry_err_code_t. + * src/visibility.c (gcry_mpi_snatch): Fix call to _gcry_mpi_snatch. + +2015-09-07 Werner Koch + + Improve GCRYCTL_DISABLE_PRIV_DROP by also disabling cap_ calls. + + commit 3a3d5410cc83f7069c7cb1ab384905f382292d32 + * src/secmem.c (lock_pool, secmem_init): Do not call any cap_ + functions if NO_PRIV_DROP is set. + +2015-09-04 Werner Koch + + w32: Avoid a few compiler warnings. + + commit e97c62a4a687b56d00a2d0a63e072a977f8eb81c + * cipher/cipher-selftest.c (_gcry_selftest_helper_cbc) + (_gcry_selftest_helper_cfb, _gcry_selftest_helper_ctr): Mark variable + as unused. + * random/rndw32.c (slow_gatherer): Avoid signed pointer mismatch + warning. + * src/secmem.c (init_pool): Avoid unused variable warning. + * tests/random.c (writen, readn): Include on if needed. + + w32: Fix alignment problem with AESNI on Windows >=3D 8. + + commit e2785a2268702312529521df3bd2f4e6b43cea3a + * cipher/cipher-selftest.c (_gcry_cipher_selftest_alloc_ctx): New. + * cipher/rijndael.c (selftest_basic_128, selftest_basic_192) + (selftest_basic_256): Allocate context on the heap. + +2015-08-31 Werner Koch + + rsa: Add verify after sign to avoid Lenstra's CRT attack. + + commit c17f84bd02d7ee93845e92e20f6ddba814961588 + * cipher/rsa.c (rsa_sign): Check the CRT. + + Add pubkey algo id for EdDSA. + + commit dd87639abd38afc91a6f27af33f0ba17402ad02d + * src/gcrypt.h.in (GCRY_PK_EDDSA): New. + +2015-08-25 Werner Koch + + Add configure option --enable-build-timestamp. + + commit a785cc3db0c4e8eb8ebbf784b833a40d2c42ec3e + * configure.ac (BUILD_TIMESTAMP): Set to "" by default. + +2015-08-23 Werner Koch + + tests: Add missing files for the make distcheck target. + + commit fb3cb47b0a29d3e73150297aa4495c20915e4a75 + * tests/Makefile.am (EXTRA_DIST): Add sha3-x test vector files. + +2015-08-19 Werner Koch + + Change SHA-3 algorithm ids. + + commit 65639ecaaeba642e40487446c40d045482001285 + * src/gcrypt.h.in (GCRY_MD_SHA3_224, GCRY_MD_SHA3_256) + (GCRY_MD_SHA3_384, GCRY_MD_SHA3_512): Change values. + +2015-08-12 Jussi Kivilinna + + Keccak: Fix array indexes in =CE=B8 step. + + commit 48822ae0b436bcea0fe92dbf0d88475ba3179320 + * cipher/keccak.c (keccak_f1600_state_permute): Fix indexes for D[5]. + + Simplify OCB offset calculation for parallel implementations. + + commit 24ebf53f1e8a8afa27dcd768339bda70a740bb03 + * cipher/camellia-glue.c (_gcry_camellia_ocb_crypt) + (_gcry_camellia_ocb_auth): Precalculate Ls array always, instead of + just if 'blkn % =3D=3D 0'. + * cipher/serpent.c (_gcry_serpent_ocb_crypt) + (_gcry_serpent_ocb_auth): Ditto. + * cipher/rijndael-aesni.c (get_l): Remove low-bit checks. + (aes_ocb_enc, aes_ocb_dec, _gcry_aes_aesni_ocb_auth): Handle leading + blocks until block counter is multiple of 4, so that parallel block + processing loop can use 'c->u_mode.ocb.L' array directly. + * tests/basic.c (check_ocb_cipher_largebuf): Rename to... + (check_ocb_cipher_largebuf_split): ...this and add option to process + large buffer as two split buffers. + (check_ocb_cipher_largebuf): New. + + Add carryless 8-bit addition fast-path for AES-NI CTR mode. + + commit e11895da1f4af9782d89e92ba2e6b1a63235b54b + * cipher/rijndael-aesni.c (do_aesni_ctr_4): Do addition using + CTR in big-endian form, if least-significant byte does not overflow. + +2015-08-10 Jussi Kivilinna + + Add additional SHA3 test-vectors. + + commit 80321eb3a63a20f86734d6eebb3f419c0ec895aa + * tests/basic.c (check_digests): Allow datalen to be specified so that + input data can have byte with value 0x00; Include sha3-*.h header files + to test-vector structure. + * tests/sha3-224.h: New. + * tests/sha3-256.h: New. + * tests/sha3-384.h: New. + * tests/sha3-512.h: New. + + Add generic SHA3 implementation. + + commit 434ba17d1d5ad59c70d721ad3ecb376c2403a7e5 + * cipher/hash-common.h (MD_BLOCK_MAX_BLOCKSIZE): Increase blocksize + USE_SHA3 enabled. + * cipher/keccak.c (SHA3_DELIMITED_SUFFIX, SHAKE_DELIMITED_SUFFIX): New. + (KECCAK_STATE): Add proper state. + (KECCAK_CONTEXT): Add 'outlen'. + (rol64, keccak_f1600_state_permute, transform_blk, transform): New. + (keccak_init): Add proper initialization. + (keccak_final): Add proper finalization. + (selftests_keccak): Add selftests. + (oid_spec_sha3_224, oid_spec_sha3_256, oid_spec_sha3_384) + (oid_spec_sha3_512): Add OID. + (_gcry_digest_spec_sha3_224, _gcry_digest_spec_sha3_256) + (_gcry_digest_spec_sha3_384, _gcry_digest_spec_sha3_512): Fix output + length. + * cipher/mac-hmac.c (map_mac_algo_to_md): Fix mapping for SHA3-512. + (hmac_get_keylen): Return proper blocksizes for SHA3 algorithms. + [USE_SHA3] (_gcry_mac_type_spec_hmac_sha3_224) + (_gcry_mac_type_spec_hmac_sha3_256, _gcry_mac_type_spec_hmac_sha3_384) + (_gcry_mac_type_spec_hmac_sha3_512): New. + * cipher/mac-internal [USE_SHA3] (_gcry_mac_type_spec_hmac_sha3_224) + (_gcry_mac_type_spec_hmac_sha3_256, _gcry_mac_type_spec_hmac_sha3_384) + (_gcry_mac_type_spec_hmac_sha3_512): New. + * cipher/mac.c (mac_list) [USE_SHA3]: Add SHA3 algorithms. + * cipher/md.c (md_open): Use proper SHA-3 blocksizes for HMAC macpads. + * tests/basic.c (check_digests): Add SHA3 test vectors. + + Optimize OCB offset calculation. + + commit 49f52c67fb42c0656c8f9af655087f444562ca82 + * cipher/cipher-internal.h (ocb_get_l): New. + * cipher/cipher-ocb.c (_gcry_cipher_ocb_authenticate) + (ocb_crypt): Use 'ocb_get_l' instead of '_gcry_cipher_ocb_get_l'. + * cipher/camellia-glue.c (get_l): Remove. + (_gcry_camellia_ocb_crypt, _gcry_camellia_ocb_auth): Precalculate + offset array when block count matches parallel operation size; Use + 'ocb_get_l' instead of 'get_l'. + * cipher/rijndael-aesni.c (get_l): Add fast path for 75% most common + offsets. + (aesni_ocb_enc, aesni_ocb_dec, _gcry_aes_aesni_ocb_auth): Precalculate + offset array when block count matches parallel operation size. + * cipher/rijndael-ssse3-amd64.c (get_l): Add fast path for 75% most + common offsets. + * cipher/rijndael.c (_gcry_aes_ocb_crypt, _gcry_aes_ocb_auth): Use + 'ocb_get_l' instead of '_gcry_cipher_ocb_get_l'. + * cipher/serpent.c (get_l): Remove. + (_gcry_serpent_ocb_crypt, _gcry_serpent_ocb_auth): Precalculate + offset array when block count matches parallel operation size; Use + 'ocb_get_l' instead of 'get_l'. + * cipher/twofish.c (get_l): Remove. + (_gcry_twofish_ocb_crypt, _gcry_twofish_ocb_auth): Use 'ocb_get_l' + instead of 'get_l'. + +2015-08-10 NIIBE Yutaka + + ecc: fix Montgomery curve bugs. + + commit ce746936b6c210e602d106cfbf45cf60b408d871 + * cipher/ecc.c (check_secret_key): Y1 should not be NULL when check. + (ecc_check_secret_key): Support Montgomery curve. + * mpi/ec.c (_gcry_mpi_ec_curve_point): Fix condition. + +2015-08-08 Werner Koch + + Add framework to eventually support SHA3. + + commit 0e17f7a05bba309a87811992aa47a77af9935b99 + * src/gcrypt.h.in (GCRY_MD_SHA3_224, GCRY_MD_SHA3_256) + (GCRY_MD_SHA3_384, GCRY_MD_SHA3_512): New. + (GCRY_MAC_HMAC_SHA3_224, GCRY_MAC_HMAC_SHA3_256) + (GCRY_MAC_HMAC_SHA3_384, GCRY_MAC_HMAC_SHA3_512): New. + * cipher/keccak.c: New with stub functions. + * cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add keccak.c. + * configure.ac (available_digests): Add sha3. + (USE_SHA3): New. + * src/fips.c (run_hmac_selftests): Add SHA3 to the required selftests. + * cipher/md.c (digest_list) [USE_SHA3]: Add standard SHA3 algos. + (md_open): Ditto for hmac processing. + * cipher/mac-hmac.c (map_mac_algo_to_md): Add mapping. + * cipher/hmac-tests.c (run_selftests): Prepare for tests. + * cipher/pubkey-util.c (get_hash_algo): Add "sha3-xxx". + +2015-08-06 Werner Koch + + tools: Fix memory leak for functions "I" and "G". + + commit 10789e3cdda7b944acb4b59624c34a2ccfaea6e5 + * src/mpicalc.c (do_inv, do_gcd): Init A after stack check. + +2015-08-06 Ismo Puustinen + + ecc: Free memory also when in error branch. + + commit 1d896371fbc94c605fce35eabcde01e24dd22892 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_sign): Init DISGEST and goto + leave on error. + +2015-08-06 NIIBE Yutaka + + Add Curve25519 support. + + commit e93f4c21c59756604440ad8cbf27e67d29c99ffd + * cipher/ecc-curves.c (curve_aliases, domain_parms): Add Curve25519. + * tests/curves.c (N_CURVES): It's 22 now. + * src/cipher.h (PUBKEY_FLAG_DJB_TWEAK): New. + * cipher/ecc-common.h (_gcry_ecc_mont_decodepoint): New. + * cipher/ecc-misc.c (_gcry_ecc_mont_decodepoint): New. + * cipher/ecc.c (nist_generate_key): Handle the case of + PUBKEY_FLAG_DJB_TWEAK and Montgomery curve. + (test_ecdh_only_keys, check_secret_key): Likewise. + (ecc_generate): Support Curve25519 which is Montgomery curve with flag + PUBKEY_FLAG_DJB_TWEAK and PUBKEY_FLAG_COMP. + (ecc_encrypt_raw): Get flags from KEYPARMS and handle + PUBKEY_FLAG_DJB_TWEAK and Montgomery curve. + (ecc_decrypt_raw): Likewise. + (compute_keygrip): Handle the case of PUBKEY_FLAG_DJB_TWEAK. + * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist): + PUBKEY_FLAG_EDDSA implies PUBKEY_FLAG_DJB_TWEAK. + Parse "djb-tweak" for PUBKEY_FLAG_DJB_TWEAK. + +2015-07-27 Jussi Kivilinna + + Reduce code size for Twofish key-setup and remove key dependend branch. + + commit b4b1d872ba651bc44761b35d245b1a519a33f515 + * cipher/twofish.c (poly_to_exp): Increase size by one, change type + from byte to u16 and insert '492' to index 0. + (exp_to_poly): Increase size by 256, let new cells have zero value. + (CALC_S): Execute unconditionally with help of modified tables. + (do_twofish_setkey): Change type for 'tmp' to 'unsigned int'; Un-unroll + CALC_K256 and CALC_K phases to reduce generated object size. + + Reduce amount of duplicated code in OCB bulk implementations. + + commit e950052bc6f5ff11a7c23091ff3f6b5cc431e875 + * cipher/cipher-ocb.c (_gcry_cipher_ocb_authenticate) + (ocb_crypt): Change bulk function to return number of unprocessed + blocks. + * src/cipher.h (_gcry_aes_ocb_crypt, _gcry_aes_ocb_auth) + (_gcry_camellia_ocb_crypt, _gcry_camellia_ocb_auth) + (_gcry_serpent_ocb_crypt, _gcry_serpent_ocb_auth) + (_gcry_twofish_ocb_crypt, _gcry_twofish_ocb_auth): Change return type + to 'size_t'. + * cipher/camellia-glue.c (get_l): Only if USE_AESNI_AVX or + USE_AESNI_AVX2 defined. + (_gcry_camellia_ocb_crypt, _gcry_camellia_ocb_auth): Change return type + to 'size_t' and return remaining blocks; Remove unaccelerated common + code path. Enable remaining common code only if USE_AESNI_AVX or + USE_AESNI_AVX2 defined; Remove unaccelerated common code. + * cipher/rijndael.c (_gcry_aes_ocb_crypt, _gcry_aes_ocb_auth): Change + return type to 'size_t' and return zero. + * cipher/serpent.c (get_l): Only if USE_SSE2, USE_AVX2 or USE_NEON + defined. + (_gcry_serpent_ocb_crypt, _gcry_serpent_ocb_auth): Change return type + to 'size_t' and return remaining blocks; Remove unaccelerated common + code path. Enable remaining common code only if USE_SSE2, USE_AVX2 or + USE_NEON defined; Remove unaccelerated common code. + * cipher/twofish.c (get_l): Only if USE_AMD64_ASM defined. + (_gcry_twofish_ocb_crypt, _gcry_twofish_ocb_auth): Change return type + to 'size_t' and return remaining blocks; Remove unaccelerated common + code path. Enable remaining common code only if USE_AMD64_ASM defined; + Remove unaccelerated common code. + + Add bulk OCB for Serpent SSE2, AVX2 and NEON implementations. + + commit adbdca0d58f9c06dc3850b95e3455e179c1e6960 + * cipher/cipher.c (_gcry_cipher_open_internal): Setup OCB bulk + functions for Serpent. + * cipher/serpent-armv7-neon.S: Add OCB assembly functions. + * cipher/serpent-avx2-amd64.S: Add OCB assembly functions. + * cipher/serpent-sse2-amd64.S: Add OCB assembly functions. + * cipher/serpent.c (_gcry_serpent_sse2_ocb_enc) + (_gcry_serpent_sse2_ocb_dec, _gcry_serpent_sse2_ocb_auth) + (_gcry_serpent_neon_ocb_enc, _gcry_serpent_neon_ocb_dec) + (_gcry_serpent_neon_ocb_auth, _gcry_serpent_avx2_ocb_enc) + (_gcry_serpent_avx2_ocb_dec, _gcry_serpent_avx2_ocb_auth): New + prototypes. + (get_l, _gcry_serpent_ocb_crypt, _gcry_serpent_ocb_auth): New. + * src/cipher.h (_gcry_serpent_ocb_crypt) + (_gcry_serpent_ocb_auth): New. + * tests/basic.c (check_ocb_cipher): Add test-vector for serpent. + + Add bulk OCB for Twofish AMD64 implementation. + + commit 7f6804c37c4b41d85fb26aa723b1c41e4a3cf278 + * cipher/cipher.c (_gcry_cipher_open_internal): Setup OCB bulk + functions for Twofish. + * cipher/twofish-amd64.S: Add OCB assembly functions. + * cipher/twofish.c (_gcry_twofish_amd64_ocb_enc) + (_gcry_twofish_amd64_ocb_dec, _gcry_twofish_amd64_ocb_auth): New + prototypes. + (call_sysv_fn5, call_sysv_fn6, twofish_amd64_ocb_enc) + (twofish_amd64_ocb_dec, twofish_amd64_ocb_auth, get_l) + (_gcry_twofish_ocb_crypt, _gcry_twofish_ocb_auth): New. + * src/cipher.h (_gcry_twofish_ocb_crypt) + (_gcry_twofish_ocb_auth): New. + * tests/basic.c (check_ocb_cipher): Add test-vector for Twofish. + + Add bulk OCB for Camellia AES-NI/AVX and AES-NI/AVX2 implementations. + + commit bb088c6b1620504fdc79e89af27c2bf3fb02b4b4 + * cipher/camellia-aesni-avx-amd64.S: Add OCB assembly functions. + * cipher/camellia-aesni-avx2-amd64.S: Add OCB assembly functions. + * cipher/camellia-glue.c (_gcry_camellia_aesni_avx_ocb_enc) + (_gcry_camellia_aesni_avx_ocb_dec, _gcry_camellia_aesni_avx_ocb_auth) + (_gcry_camellia_aesni_avx2_ocb_enc, _gcry_camellia_aesni_avx2_ocb_dec) + (_gcry_camellia_aesni_avx2_ocb_auth): New prototypes. + (get_l, _gcry_camellia_ocb_crypt, _gcry_camellia_ocb_auth): New. + * cipher/cipher.c (_gcry_cipher_open_internal): Setup OCB bulk + functions for Camellia. + * src/cipher.h (_gcry_camellia_ocb_crypt) + (_gcry_camellia_ocb_auth): New. + * tests/basic.c (check_ocb_cipher): Add test-vector for Camellia. + +2015-07-26 Jussi Kivilinna + + Add OCB bulk mode for AES SSSE3 implementation. + + commit 620e1e0300c79943a1846a49563b04386dc60546 + * cipher/rijndael-ssse3-amd64.c (SSSE3_STATE_SIZE): New. + [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] (vpaes_ssse3_prepare): Use + 'ssse3_state' for storing current SSSE3 state. + [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] + (vpaes_ssse3_cleanup): Restore SSSE3 state from 'ssse3_state'. + (_gcry_aes_ssse3_do_setkey, _gcry_aes_ssse3_prepare_decryption) + (_gcry_aes_ssse3_encrypt, _gcry_aes_ssse3_cfb_enc) + (_gcry_aes_ssse3_cbc_enc, _gcry_aes_ssse3_ctr_enc) + (_gcry_aes_ssse3_decrypt, _gcry_aes_ssse3_cfb_dec) + (_gcry_aes_ssse3_cbc_dec, _gcry_aes_ssse3_cbc_dec): Add 'ssse3_state' + array. + (get_l, ssse3_ocb_enc, ssse3_ocb_dec, _gcry_aes_ssse3_ocb_crypt) + (_gcry_aes_ssse3_ocb_auth): New. + * cipher/rijndael.c (_gcry_aes_ssse3_ocb_crypt) + (_gcry_aes_ssse3_ocb_auth): New. + (_gcry_aes_ocb_crypt, _gcry_aes_ocb_auth) [USE_SSSE3]: Use SSSE3 + implementation for OCB. + +2015-07-26 Peter Wu + + Fix undefined behavior wrt memcpy. + + commit 46c072669eb81ed610cc5b3c0dc0c75a143afbb4 + * cipher/cipher-gcm.c: Do not copy zero bytes from an empty buffer. Let + the function continue to add padding as needed though. + * cipher/mac-poly1305.c: If the caller requested to finish the hash + function without a copy of the result, return immediately. + +2015-07-23 Peter Wu + + build: ignore scissor line for the commit-msg hook. + + commit ada0a7d302cca97b327faaacac7a5d0b8043df88 + * build-aux/git-hooks/commit-msg: Stop processing more lines when the + scissor line is encountered. + +2015-07-16 Peter Wu + + rsa: Fix error in comments. + + commit 9cd55e8e948f0049cb23495f536decf797d072f7 + * cipher/rsa.c: Fix. + +2015-07-14 Peter Wu + + sexp: Fix invalid deallocation in error path. + + commit 0f9532b186c1e0b54d7e7a6d76bce82b6226122b + * src/sexp.c: Fix wrong condition. + +2015-07-10 Peter Wu + + ecc: fix memory leak. + + commit 2a7aa3ea4d03a9c808d5888f5509c08cd27aa27c + * cipher/ecc.c (ecc_verify): Release memory which was allocated before + by _gcry_pk_util_preparse_sigval. + (ecc_decrypt_raw): Likewise. + +2015-07-06 NIIBE Yutaka + + ecc: fix memory leaks. + + commit 0a7547e487a8bc4e7ac9599c55579eb2e4a13f06 + cipher/ecc.c (ecc_generate): Fix memory leak on error of + _gcry_pk_util_parse_flaglist and _gcry_ecc_eddsa_encodepoint. + (ecc_check_secret_key): Fix memory leak on error of + _gcry_ecc_update_curve_param. + (ecc_sign, ecc_verify, ecc_encrypt_raw, ecc_decrypt_raw): Remove + unnecessary sexp_release and fix memory leak on error of + _gcry_ecc_fill_in_curve. + (ecc_decrypt_raw): Fix double free of the point kG and memory leak + on error of _gcry_ecc_os2ec. + +2015-06-11 NIIBE Yutaka + + mpi: Support FreeBSD 10 or later. + + commit a36ee7501f68ad7ebcfe31f9659430b9d2c3ddd1 + * mpi/config.links: Include FreeBSD 10 to 29. + +2015-05-21 Werner Koch + + ecc: Add key generation flag "no-keytest". + + commit 2bddd947fd1c11b4ec461576db65a5e34fea1b07 + * src/cipher.h (PUBKEY_FLAG_NO_KEYTEST): New. + * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist): Add flag + "no-keytest". Return an error for invalid flags of length 10. + + * cipher/ecc.c (nist_generate_key): Replace arg random_level by flags + set random level depending on flags. + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_genkey): Ditto. + * cipher/ecc.c (ecc_generate): Pass flags to generate fucntion and + remove var random_level. + (nist_generate_key): Implement "no-keytest" flag. + + * tests/keygen.c (check_ecc_keys): Add tests for transient-key and + no-keytest. + + ecc: Avoid double conversion to affine coordinates in keygen. + + commit 102d68b3bd77813a3ff989526855bb1e283bf9d7 + * cipher/ecc.c (nist_generate_key): Add args r_x and r_y. + (ecc_generate): Rename vars. Convert to affine coordinates only if + not returned by the lower level generation function. + + random: Change initial extra seeding from 2400 bits to 128 bits. + + commit 8124e357b732a719696bfd5271def4e528f2a1e1 + * random/random-csprng.c (read_pool): Reduce initial seeding. + +2015-05-14 Jussi Kivilinna + + Enable AMD64 Twofish implementation on WIN64. + + commit 9b0c6c8141ae9bd056392a3f6b5704b505fc8501 + * cipher/twofish-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/twofish.c (USE_AMD64_ASM): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] (call_sysv_fn): New. + (twofish_amd64_encrypt_block, twofish_amd64_decrypt_block) + (twofish_amd64_ctr_enc, twofish_amd64_cbc_dec) + (twofish_amd64_cfb_dec): New wrapper functions for AMD64 + assembly functions. + + Enable AMD64 Serpent implementations on WIN64. + + commit eb0ed576893b6c7990dbcb568510f831d246cea6 + * cipher/serpent-avx2-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/serpent-sse2-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/chacha20.c (USE_SSE2, USE_AVX2): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + [USE_SSE2 || USE_AVX2] (ASM_FUNC_ABI): New. + (_gcry_serpent_sse2_ctr_enc, _gcry_serpent_sse2_cbc_dec) + (_gcry_serpent_sse2_cfb_dec, _gcry_serpent_avx2_ctr_enc) + (_gcry_serpent_avx2_cbc_dec, _gcry_serpent_avx2_cfb_dec): Add + ASM_FUNC_ABI. + + Enable AMD64 Salsa20 implementation on WIN64. + + commit 12bc93ca8187b8061c2e705427ef22f5a71d29b0 + * cipher/salsa20-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/salsa20.c (USE_AMD64): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + [USE_AMD64] (ASM_FUNC_ABI, ASM_EXTRA_STACK): New. + (_gcry_salsa20_amd64_keysetup, _gcry_salsa20_amd64_ivsetup) + (_gcry_salsa20_amd64_encrypt_blocks): Add ASM_FUNC_ABI. + [USE_AMD64] (salsa20_core): Add ASM_EXTRA_STACK. + (salsa20_do_encrypt_stream) [USE_AMD64]: Add ASM_EXTRA_STACK. + + Enable AMD64 Poly1305 implementations on WIN64. + + commit 8d7de4dbf7732c6eb9e9853ad7c19c89075ace6f + * cipher/poly1305-avx2-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/poly1305-sse2-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/poly1305-internal.h (POLY1305_SYSV_FUNC_ABI): New. + (POLY1305_USE_SSE2, POLY1305_USE_AVX2): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (OPS_FUNC_ABI): New. + (poly1305_ops_t): Use OPS_FUNC_ABI. + * cipher/poly1305.c (_gcry_poly1305_amd64_sse2_init_ext) + (_gcry_poly1305_amd64_sse2_finish_ext) + (_gcry_poly1305_amd64_sse2_blocks, _gcry_poly1305_amd64_avx2_init_ext) + (_gcry_poly1305_amd64_avx2_finish_ext) + (_gcry_poly1305_amd64_avx2_blocks, _gcry_poly1305_armv7_neon_init_ext) + (_gcry_poly1305_armv7_neon_finish_ext) + (_gcry_poly1305_armv7_neon_blocks, poly1305_init_ext_ref32) + (poly1305_blocks_ref32, poly1305_finish_ext_ref32) + (poly1305_init_ext_ref8, poly1305_blocks_ref8) + (poly1305_finish_ext_ref8): Use OPS_FUNC_ABI. + + Enable AMD64 3DES implementation on WIN64. + + commit b65e9e71d5ee992db5c96793c6af999545daad28 + * cipher/des-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/des.c (USE_AMD64_ASM): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] (call_sysv_fn): New. + (tripledes_ecb_crypt) [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS]: Call + assembly function through 'call_sysv_fn'. + (tripledes_amd64_ctr_enc, tripledes_amd64_cbc_dec) + (tripledes_amd64_cfb_dec): New wrapper functions for bulk + assembly functions. + + Enable AMD64 ChaCha20 implementations on WIN64. + + commit 9597cfddf03c467825da152be5ca0d12a8c30d88 + * cipher/chacha20-avx2-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/chacha20-sse2-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/chacha20-ssse3-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/chacha20.c (USE_SSE2, USE_SSSE3, USE_AVX2): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ASM_FUNC_ABI, ASM_EXTRA_STACK): New. + (chacha20_blocks_t, _gcry_chacha20_amd64_sse2_blocks) + (_gcry_chacha20_amd64_ssse3_blocks, _gcry_chacha20_amd64_avx2_blocks) + (_gcry_chacha20_armv7_neon_blocks, chacha20_blocks): Add ASM_FUNC_ABI. + (chacha20_core): Add ASM_EXTRA_STACK. + + Enable AMD64 CAST5 implementation on WIN64. + + commit 6a6646df80386204675d8b149ab60e74d7ca124c + * cipher/cast5-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (RIP): Remove. + (GET_EXTERN_POINTER): Use 'leaq' version on WIN64. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/cast5.c (USE_AMD64_ASM): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] (call_sysv_fn): New. + (do_encrypt_block, do_decrypt_block) + [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS]: Call assembly + function through 'call_sysv_fn'. + (cast5_amd64_ctr_enc, cast5_amd64_cbc_dec) + (cast5_amd64_cfb_dec): New wrapper functions for bulk + assembly functions. + + Enable AMD64 Camellia implementations on WIN64. + + commit 9a4fb3709864bf3e3918800d44ff576590cd4e92 + * cipher/camellia-aesni-avx-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/camellia-aesni-avx2-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/camellia-glue.c (USE_AESNI_AVX, USE_AESNI_AVX2): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + [USE_AESNI_AVX ||=C2=A0USE_AESNI_AVX2] (ASM_FUNC_ABI, ASM_EXTRA_STACK): N= ew. + (_gcry_camellia_aesni_avx_ctr_enc, _gcry_camellia_aesni_avx_cbc_dec) + (_gcry_camellia_aesni_avx_cfb_dec, _gcry_camellia_aesni_avx_keygen) + (_gcry_camellia_aesni_avx2_ctr_enc, _gcry_camellia_aesni_avx2_cbc_dec) + (_gcry_camellia_aesni_avx2_cfb_dec): Add ASM_FUNC_ABI. + + Enable AMD64 Blowfish implementation on WIN64. + + commit e05682093ffb003b589a697428d918d755ac631d + * cipher/blowfish-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/blowfish.c (USE_AMD64_ASM): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] (call_sysv_fn): New. + (do_encrypt, do_encrypt_block, do_decrypt_block) + [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS]: Call assembly + function through 'call_sysv_fn'. + (blowfish_amd64_ctr_enc, blowfish_amd64_cbc_dec) + (blowfish_amd64_cfb_dec): New wrapper functions for bulk + assembly functions. + .. + + Enable AMD64 arcfour implementation on WIN64. + + commit c46b015bedba7ce0db68929bd33a86a54ab3d919 + * cipher/arcfour-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/arcfour.c (USE_AMD64_ASM): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (do_encrypt, do_decrypt) [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS]: Use + assembly block to call AMD64 assembly function. + + Update documentation for Poly1305-ChaCha20 AEAD, RFC-7539. + + commit ee8fc4edcb3466b03246c8720b90731bf274ff1d + * cipher/cipher-poly1305.c: Add RFC-7539 to header. + * doc/gcrypt.texi: Update Poly1305 AEAD documentation with mention of + RFC-7539; Drop Salsa from supported stream ciphers for Poly1305 AEAD. + + hwf-x86: use edi for passing value to ebx for i386 cpuid. + + commit bac42c68b069f17abcca810a21439c7233815747 + * src/hwf-x86.c [__i386__] (get_cpuid): Use '=3DD' for regs[1] instead + of '=3Dr'. + + hwf-x86: add EDX as output register for xgetbv asm block. + + commit e15beb584a5ebdfc363e1ff15f87102508652d71 + * src/hwf-x86.c (get_xgetbv): Add EDX as output. + +2015-05-04 Werner Koch + + build: Update build-aux files. + + commit 5a7d55eed3316f40ca61acbee032bfc285e28803 + + + Fix possible regression on old 32 bit mingw compilers. + + commit 090ca7435156b5f52064357dd59059570d466f46 + * acinclude.m4: Add new pattern for mingw32. + + build: Add new file. + + commit 4af52b2e72ce004b7d8f99e09c4324e3c2a84379 + * mpi/amd64/distfiles: Add func_abi.h. + +2015-05-03 Jussi Kivilinna + + Fix WIN64 assembly glue for AES. + + commit 24a769a7c7601dbb85332e550f6fbd121b56df5f + * cipher/rinjdael.c (do_encrypt, do_decrypt) + [!HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS]: Change input operands to + input+output to mark volatile nature of the used registers. + + Add '1 million a characters' test vectors. + + commit 2f4fefdbc62857b6e2da26ce111ee140a068c471 + * tests/basic.c (check_digests): Add "!" test vectors for MD5, SHA-384, + SHA-512, RIPEMD160 and CRC32. + +2015-05-02 Jussi Kivilinna + + More optimized CRC implementations. + + commit 06e122baa3321483a47bbf82fd2a4540becfa0c9 + * cipher/crc.c (crc32_table, crc24_table): Replace with new table + contents. + (update_crc32, CRC24_INIT, CRC24_POLY): Remove. + (crc32_next, crc32_next4, crc24_init, crc24_next, crc24_next4) + (crc24_final): New. + (crc24rfc2440_init): Use crc24_init. + (crc32_write): Rewrite to use crc32_next & crc32_next4. + (crc24_write): Rewrite to use crc24_next & crc24_next4. + (crc32_final, crc32rfc1510_final): Use buf_put_be32. + (crc24rfc2440_final): Use crc24_final & buf_put_le32. + * tests/basic.c (check_digests): Add CRC "123456789" tests. + + Enable AMD64 AES implementation for WIN64. + + commit 66129b3334a5aa54ff8a97981507e4704f759571 + * cipher/rijndael-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/rijndael-internal.h (USE_AMD64_ASM): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (do_encrypt, do_decrypt) + [USE_AMD64_ASM && !HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS]: Use + assembly block to call AMD64 assembly encrypt/decrypt function. + + Enable AMD64 Whirlpool implementation for WIN64. + + commit 8422d5d699265b960bd1ca837044ee052fc5b614 + * cipher/whirlpool-sse2-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/whirlpool.c (USE_AMD64_ASM): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + [USE_AMD64_ASM] (ASM_FUNC_ABI, ASM_EXTRA_STACK): New. + [USE_AMD64_ASM] (_gcry_whirlpool_transform_amd64): Add ASM_FUNC_ABI to + prototype. + [USE_AMD64_ASM] (whirlpool_transform): Add ASM_EXTRA_STACK to stack + burn value. + + Enable AMD64 SHA512 implementations for WIN64. + + commit 1089a13073c26a9a456e43ec38d937e6ee7f4077 + * cipher/sha512-avx-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/sha512-avx-bmi2-amd64.S: Ditto. + * cipher/sha512-ssse3-amd64.S: Ditto. + * cipher/sha512.c (USE_SSSE3, USE_AVX, USE_AVX2): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + [USE_SSSE3 ||=C2=A0USE_AVX ||=C2=A0USE_AVX2] (ASM_FUNC_ABI) + (ASM_EXTRA_STACK): New. + (_gcry_sha512_transform_amd64_ssse3, _gcry_sha512_transform_amd64_avx) + (_gcry_sha512_transform_amd64_avx_bmi2): Add ASM_FUNC_ABI to + prototypes. + (transform): Add ASM_EXTRA_STACK to stack burn value. + + Enable AMD64 SHA256 implementations for WIN64. + + commit 022959099644f64df5f2a83ade21159864f64837 + * cipher/sha256-avx-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/sha256-avx2-bmi2-amd64.S: Ditto. + * cipher/sha256-ssse3-amd64.S: Ditto. + * cipher/sha256.c (USE_SSSE3, USE_AVX, USE_AVX2): Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + [USE_SSSE3 ||=C2=A0USE_AVX ||=C2=A0USE_AVX2] (ASM_FUNC_ABI) + (ASM_EXTRA_STACK): New. + (_gcry_sha256_transform_amd64_ssse3, _gcry_sha256_transform_amd64_avx) + (_gcry_sha256_transform_amd64_avx2): Add ASM_FUNC_ABI to prototypes. + (transform): Add ASM_EXTRA_STACK to stack burn value. + + Enable AMD64 SHA1 implementations for WIN64. + + commit e433676a899fa0d274d40547166b03c7c8bd8e78 + * cipher/sha1-avx-amd64.S: Enable when + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + (ELF): New macro to mask lines with ELF specific commands. + * cipher/sha1-avx-bmi2-amd64.S: Ditto. + * cipher/sha1-ssse3-amd64.S: Ditto. + * cipher/sha1.c (USE_SSSE3, USE_AVX, USE_BMI2): Enable + when HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined. + [USE_SSSE3 ||=C2=A0USE_AVX ||=C2=A0USE_BMI2] (ASM_FUNC_ABI) + (ASM_EXTRA_STACK): New. + (_gcry_sha1_transform_amd64_ssse3, _gcry_sha1_transform_amd64_avx) + (_gcry_sha1_transform_amd64_avx_bmi2): Add ASM_FUNC_ABI to + prototypes. + (transform): Add ASM_EXTRA_STACK to stack burn value. + +2015-05-01 Jussi Kivilinna + + Enable AES/AES-NI, AES/SSSE3 and GCM/PCLMUL implementations on WIN64. + + commit 4e09aaa36d151c3312019724a77fc09aa345b82f + * cipher/cipher-gcm-intel-pclmul.c (_gcry_ghash_intel_pclmul) + ( _gcry_ghash_intel_pclmul) [__WIN64__]: Store non-volatile vector + registers before use and restore after. + * cipher/cipher-internal.h (GCM_USE_INTEL_PCLMUL): Remove dependency + on !defined(__WIN64__). + * cipher/rijndael-aesni.c [__WIN64__] (aesni_prepare_2_6_variable, + aesni_prepare, aesni_prepare_2_6, aesni_cleanup) + ( aesni_cleanup_2_6): New. + [!__WIN64__] (aesni_prepare_2_6_variable, aesni_prepare_2_6): New. + (_gcry_aes_aesni_do_setkey, _gcry_aes_aesni_cbc_enc) + (_gcry_aesni_ctr_enc, _gcry_aesni_cfb_dec, _gcry_aesni_cbc_dec) + (_gcry_aesni_ocb_crypt, _gcry_aesni_ocb_auth): Use + 'aesni_prepare_2_6'. + * cipher/rijndael-internal.h (USE_SSSE3): Enable if + HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS or + HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS. + (USE_AESNI): Remove dependency on !defined(__WIN64__) + * cipher/rijndael-ssse3-amd64.c [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] + (vpaes_ssse3_prepare, vpaes_ssse3_cleanup): New. + [!HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] (vpaes_ssse3_prepare): New. + (vpaes_ssse3_prepare_enc, vpaes_ssse3_prepare_dec): Use + 'vpaes_ssse3_prepare'. + (_gcry_aes_ssse3_do_setkey, _gcry_aes_ssse3_prepare_decryption): Use + 'vpaes_ssse3_prepare' and 'vpaes_ssse3_cleanup'. + [HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS] (X): Add masking macro to + exclude '.type' and '.size' markers from assembly code, as they are + not support on WIN64/COFF objects. + * configure.ac (gcry_cv_gcc_attribute_ms_abi) + (gcry_cv_gcc_attribute_sysv_abi, gcry_cv_gcc_default_abi_is_ms_abi) + (gcry_cv_gcc_default_abi_is_sysv_abi) + (gcry_cv_gcc_win64_platform_as_ok): New checks. + + Add W64 support for mpi amd64 assembly. + + commit 460355f23e770637d29e3af7b998a957a2b5bc88 + acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): Set + 'ac_cv_sys_symbol_underscore=3Dno' on MingW-W64. + mpi/amd64/func_abi.h: New. + mpi/amd64/mpih-add1.S (_gcry_mpih_add_n): Add FUNC_ENTRY and FUNC_EXIT. + mpi/amd64/mpih-lshift.S (_gcry_mpih_lshift): Ditto. + mpi/amd64/mpih-mul1.S (_gcry_mpih_mul_1): Ditto. + mpi/amd64/mpih-mul2.S (_gcry_mpih_addmul_1): Ditto. + mpi/amd64/mpih-mul3.S (_gcry_mpih_submul_1): Ditto. + mpi/amd64/mpih-rshift.S (_gcry_mpih_rshift): Ditto. + mpi/amd64/mpih-sub1.S (_gcry_mpih_sub_n): Ditto. + mpi/config.links [host=3Dx86_64-*mingw*]: Enable assembly modules. + [host=3Dx86_64-*-*]: Append mpi/amd64/func_abi.h to mpi/asm-syntax.h. + + DES: Silence compiler warnings on Windows. + + commit 6c21cf5fed1ad430fa41445eac2350802bc8aaed + * cipher/des.c (working_memcmp): Make pointer arguments 'const void *'. + + Cast pointers to integers using uintptr_t instead of long. + + commit 9cf224322007d90193d4910f0da6e0e29ce01d70 + + + Fix rndhw for 64-bit Windows build. + + commit d5a7e00b6b222566a5650639ef29684b047c1909 + * configure.ac: Add sizeof check for 'void *'. + * random/rndhw.c (poll_padlock): Check for SIZEOF_VOID_P =3D=3D 8 + instead of defined(__LP64__). + (RDRAND_LONG): Check for SIZEOF_UNSIGNED_LONG =3D=3D 8 instead of + defined(__LP64__). + + Prepare random/win32.c fast poll for 64-bit Windows. + + commit 0cdd24456b33defc7f8176fa82ab694fbc284385 + * random/win32.c (_gcry_rndw32_gather_random_fast) [ADD]: Rename to + ADDINT. + (_gcry_rndw32_gather_random_fast): Add ADDPTR. + (_gcry_rndw32_gather_random_fast): Disable entropy gathering from + GetQueueStatus(QS_ALLEVENTS). + (_gcry_rndw32_gather_random_fast): Change minimumWorkingSetSize and + maximumWorkingSetSize to SIZE_T from DWORD. + (_gcry_rndw32_gather_random_fast): Only add lower 32-bits of + minimumWorkingSetSize and maximumWorkingSetSize to random poll. + (_gcry_rndw32_gather_random_fast) [__WIN64__]: Read TSC directly + using intrinsic. + + Disable GCM and AES-NI assembly implementations for WIN64. + + commit f701954555340a503f6e52cc18d58b0c515427b7 + * cipher/cipher-internal.h (GCM_USE_INTEL_PCLMUL): Do not enable when + __WIN64__ defined. + * cipher/rijndael-internal.h (USE_AESNI): Ditto. + + Disable building mpi assembly routines on WIN64. + + commit e78560a4b717f7154f910a8ce4128de152f586da + * mpi/config.links: Disable assembly for host 'x86_64-*mingw32*'. + + Fix packed attribute check for Windows targets. + + commit e886e4f5e73fe6a9f9191f5155852ce5d8bb88fe + * configure.ac (gcry_cv_gcc_attribute_packed): Move 'long b' to its + own packed structure. + + Fix tail handling in buf_xor_1. + + commit c2dba93e639639bdac139b3a3a456d10ddc61f79 + * cipher/bufhelp.h (buf_xor_1): Increment source pointer at tail + handling. + + Add --disable-hwf for basic tests. + + commit 839a3bbe2bb045139223b32753d656cc6c3d4669 + * tests/basic.c (main): Add handling for '--disable-hwf'. + + Use more odd chuck sizes for check_one_md. + + commit 9f086ffa43f2507b9d17522a0a2e394cb273baf8 + * tests/basic.c (check_one_md): Make chuck size vary oddly, instead + of using fixed length of 1000 bytes. + + Enable more modes in basic ciphers test. + + commit e40eff94f9f8654c3d29e03bbb7e5ee6a43c1435 + * src/gcrypt.h.in (GCRY_OCB_BLOCK_LEN): New. + * tests/basic.c (check_one_cipher_core_reset): New. + (check_one_cipher_core): Use check_one_cipher_core_reset inplace of + gcry_cipher_reset. + (check_ciphers): Add CCM and OCB modes for block cipher tests. + + Fix reseting cipher in OCB mode. + + commit 88842cbc68beb4f73c87fdbcb74182cba818f789 + * cipher/cipher.c (cipher_reset): Setup default taglen for OCB after + clearing state. + +2015-04-30 Jussi Kivilinna + + Fix buggy RC4 AMD64 assembly and add test to notice similar issues. + + commit 124dfce7c5a2d9405fa2b2832e91ac1267943830 + * cipher/arcfour-amd64.S (_gcry_arcfour_amd64): Fix swapped store of + 'x' and 'y'. + * tests/basic.c (get_algo_mode_blklen): New. + (check_one_cipher_core): Add new tests for split buffer input on + encryption and decryption. + +2015-04-26 Jussi Kivilinna + + Disallow compiler from generating SSE instructions in mixed C+asm source + + commit f88266c0f868d7bf51a215d5531bb9f2b4dad19e + * cipher/cipher-gcm-intel-pclmul.c [gcc-version >=3D 4.4]: Add GCC target + pragma to disable compiler use of SSE. + * cipher/rijndael-aesni.c [gcc-version >=3D 4.4]: Ditto. + * cipher/rijndael-ssse3-amd64.c [gcc-version >=3D 4.4]: Ditto. + +2015-04-18 Jussi Kivilinna + + Add OCB bulk crypt/auth functions for AES/AES-NI. + + commit 305cc878d395475c46b4ef52f4764bd0c85bf8ac + * cipher/cipher-internal.h (gcry_cipher_handle): Add bulk.ocb_crypt + and bulk.ocb_auth. + (_gcry_cipher_ocb_get_l): New prototype. + * cipher/cipher-ocb.c (get_l): Rename to ... + (_gcry_cipher_ocb_get_l): ... this. + (_gcry_cipher_ocb_authenticate, ocb_crypt): Use bulk function when + available. + * cipher/cipher.c (_gcry_cipher_open_internal): Setup OCB bulk + functions for AES. + * cipher/rijndael-aesni.c (get_l, aesni_ocb_enc, aes_ocb_dec) + (_gcry_aes_aesni_ocb_crypt, _gcry_aes_aesni_ocb_auth): New. + * cipher/rijndael.c [USE_AESNI] (_gcry_aes_aesni_ocb_crypt) + (_gcry_aes_aesni_ocb_auth): New prototypes. + (_gcry_aes_ocb_crypt, _gcry_aes_ocb_auth): New. + * src/cipher.h (_gcry_aes_ocb_crypt, _gcry_aes_ocb_auth): New + prototypes. + * tests/basic.c (check_ocb_cipher_largebuf): New. + (check_ocb_cipher): Add large buffer encryption/decryption test. + +2015-04-15 Werner Koch + + tests: Add option to time the S2K function. + + commit fe38d3815b4cd203cd529949e244aca80d32897f + * tests/t-kdf.c: Include stopwatch.h. + (dummy_consumer): new. + (bench_s2k): New. + (main): Add option parser and option --s2k. + + tests: Improve stopwatch.h. + + commit 3b03a3b493233a472da531d8d9582d1be6d376b0 + * tests/stopwatch.h (elapsed_time): Add arg divisor. + +2015-04-13 Werner Koch + + mpi: Fix gcry_mpi_copy for NULL opaque data. + + commit 9fca46864e1b5a9c788072113589454adb89fa97 + * mpi/mpiutil.c (_gcry_mpi_copy): Copy opaque only if needed. + +2015-03-21 Jussi Kivilinna + + wipememory: use one-byte aligned type for unaligned memory accesses. + + commit a06fbc0d1e98eb1218eff55ad2f37d471e4f33b2 + * src/g10lib.h (fast_wipememory2_unaligned_head): Enable unaligned + access only when HAVE_GCC_ATTRIBUTE_PACKED and + HAVE_GCC_ATTRIBUTE_ALIGNED defined. + (fast_wipememory_t): New. + (fast_wipememory2): Use 'fast_wipememory_t'. + + bufhelp: use one-byte aligned type for unaligned memory accesses. + + commit 92fa5f16d69707e302c0f85b2e5e80af8dc037f1 + * cipher/bufhelp.h (BUFHELP_FAST_UNALIGNED_ACCESS): Enable only when + HAVE_GCC_ATTRIBUTE_PACKED and HAVE_GCC_ATTRIBUTE_ALIGNED are defined. + (bufhelp_int_t): New type. + (buf_cpy, buf_xor, buf_xor_1, buf_xor_2dst, buf_xor_n_copy_2): Use + 'bufhelp_int_t'. + [BUFHELP_FAST_UNALIGNED_ACCESS] (bufhelp_u32_t, bufhelp_u64_t): New. + [BUFHELP_FAST_UNALIGNED_ACCESS] (buf_get_be32, buf_get_le32) + (buf_put_be32, buf_put_le32, buf_get_be64, buf_get_le64) + (buf_put_be64, buf_put_le64): Use 'bufhelp_uXX_t'. + * configure.ac (gcry_cv_gcc_attribute_packed): New. + + tests/bench-slope: fix memory-leak and use-after-free bugs. + + commit aa234561d00c3fb15fe501df4bf58f3db7c7c06b + * tests/bench-slope.c (do_slope_benchmark): Free 'measurements' at end. + (bench_mac_init): Move 'key' free at end of function. + +2015-03-19 Werner Koch + + Fix two pedantic warnings. + + commit f5832285b0e420d77be1b8da10a1e1d86583b414 + * src/gcrypt.h.in (gcry_mpi_flag, gcry_mac_algos): Remove trailing + comma. + +2015-03-16 Werner Koch + + Use well defined type instead of size_t in secmem.c. + + commit db8ae3616987fa288173446398a107e31e2e28aa + * src/secmem.c (ptr_into_pool_p): Replace size_t by uintptr_t. + + Make uintptr_t global available. + + commit f0f60c1a04d664936bcf52e8f46705bdc63e7ad9 + * cipher/bufhelp.h: Move include for uintptr_t to ... + * src/types.h: here. Check that config.h has been included. + + mpi: Remove useless condition. + + commit 0a9cdb8ae092d050ca12a7a4f2f50e25b82154ec + * mpi/mpi-pow.c: Remove condition rp=3D=3Dmp. + + cipher: Remove useless NULL check. + + commit fbb97dcf763e28e81e01092ad4c934b3eaf88cc8 + * cipher/hash-common.c (_gcry_md_block_write): Remove NUL check for + hd->buf. + +2015-02-28 Jussi Kivilinna + + Fix in-place encryption for OCB mode. + + commit 5e66a4f8d5a63f58caeee367433dd8dd32346083 + * cipher/cipher-ocb.c (ocb_checksum): New. + (ocb_crypt): Move checksum calculation outside main crypt loop, do + checksum calculation for encryption before inbuf is overwritten. + * tests/basic.c (check_ocb_cipher): Rename to ... + (do_check_ocb_cipher): ... to this and add argument for testing + in-place encryption/decryption. + (check_ocb_cipher): New. + +2015-02-27 NIIBE Yutaka + + tests: fix t-sexp.c. + + commit 505decf5369970219ddc9e78a20f97c623957b78 + * tests/t-sexp.c (bug_1594): Free N and PUBKEY. + + mpi: Avoid data-dependent timing variations in mpi_powm. + + commit 6636c4fd0c6ceab9f79827bf96967d1e112c0b82 + * mpi/mpi-pow.c (mpi_powm): Access all data in the table by + mpi_set_cond. + + mpi: Revise mpi_powm. + + commit 1fa8cdb933505960d4e4b4842b122d4e06953e88 + * mpi/mpi-pow.c (_gcry_mpi_powm): Rename the table to PRECOMP. + +2015-02-23 Werner Koch + + cipher: Use ciphertext blinding for Elgamal decryption. + + commit 410d70bad9a650e3837055e36f157894ae49a57d + * cipher/elgamal.c (USE_BLINDING): New. + (decrypt): Rewrite to use ciphertext blinding. + +2015-02-12 NIIBE Yutaka + + mpi: Add mpi_set_cond. + + commit 653a9fa1a3a4c35a4dc1841cb57d7e2a318f3288 + * mpi/mpiutil.c (_gcry_mpi_set_cond): New. + (_gcry_mpi_swap_cond): Fix types. + * src/mpi.h (mpi_set_cond): New. + +2015-01-30 Werner Koch + + w32: Use -static-libgcc to avoid linking to libgcc_s_sjlj-1.dll. + + commit 40a7bdf50e19faaf106470897fed72af623adc50 + * src/Makefile.am (extra_ltoptions): New. + (libgcrypt_la_LDFLAGS): Use it. + +2015-01-28 Werner Koch + + Fix building of GOST s-boxes when cross-compiling. + + commit 2564d204e408b296425ac0660c6bdc6270575fb6 + * cipher/Makefile.am (gost-s-box): USe CC_FOR_BUILD. + (noinst_PROGRAMS): Remove. + (EXTRA_DIST): New. + (CLEANFILES): New. + +2015-01-20 Jussi Kivilinna + + rijndael: fix wrong ifdef for SSSE3 setkey. + + commit ceaa97f0d849c07f3a15b642fc3a2b0a477b4a47 + * cipher/rijndael.c (do_setkey): Use USE_SSSE3 instead of USE_AESNI + around SSSE3 setkey selection. + +2015-01-16 Werner Koch + + Add OCB cipher mode. + + commit 067d7d8752d4d8a98f8e0e5e9b1a5b13e1b7ff9c + * cipher/cipher-ocb.c: New. + * cipher/Makefile.am (libcipher_la_SOURCES): Add cipher-ocb.c + * cipher/cipher-internal.h (OCB_BLOCK_LEN, OCB_L_TABLE_SIZE): New. + (gcry_cipher_handle): Add fields marks.finalize and u_mode.ocb. + * cipher/cipher.c (_gcry_cipher_open_internal): Add OCB mode. + (_gcry_cipher_open_internal): Setup default taglen of OCB. + (cipher_reset): Clear OCB specific data. + (cipher_encrypt, cipher_decrypt, _gcry_cipher_authenticate) + (_gcry_cipher_gettag, _gcry_cipher_checktag): Call OCB functions. + (_gcry_cipher_setiv): Add OCB specific nonce setting. + (_gcry_cipher_ctl): Add GCRYCTL_FINALIZE and GCRYCTL_SET_TAGLEN + + * src/gcrypt.h.in (GCRYCTL_SET_TAGLEN): New. + (gcry_cipher_final): New. + + * cipher/bufhelp.h (buf_xor_1): New. + + * tests/basic.c (hex2buffer): New. + (check_ocb_cipher): New. + (main): Call it here. Add option --cipher-modes. + * tests/bench-slope.c (bench_aead_encrypt_do_bench): Call + gcry_cipher_final. + (bench_aead_decrypt_do_bench): Ditto. + (bench_aead_authenticate_do_bench): Ditto. Check error code. + (bench_ocb_encrypt_do_bench): New. + (bench_ocb_decrypt_do_bench): New. + (bench_ocb_authenticate_do_bench): New. + (ocb_encrypt_ops): New. + (ocb_decrypt_ops): New. + (ocb_authenticate_ops): New. + (cipher_modes): Add them. + (cipher_bench_one): Skip wrong block length for OCB. + * tests/benchmark.c (cipher_bench): Add field noncelen to MODES. Add + OCB support. + +2015-01-15 Werner Koch + + Add functions to count trailing zero bits in a word. + + commit 9d2a22c94ae99f9301321082c4fb8d73f4085fda + * cipher/bithelp.h (_gcry_ctz, _gcry_ctz64): New. + * configure.ac (HAVE_BUILTIN_CTZ): Add new test. + +2015-01-08 Werner Koch + + cipher: Prepare for OCB mode. + + commit 9d328962660da72f094dc5424d5ef67abbaffdf6 + * src/gcrypt.h.in (GCRY_CIPHER_MODE_OCB): New. + +2015-01-06 Werner Koch + + Make make distcheck work again. + + commit 4f7dcdc25af269b12275126edeef30b262fb891d + * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Remove --enable-ciphers. + * cipher/Makefile.am (DISTCLEANFILES): Add gost-sb.h. + +2015-01-06 Dmitry Eremin-Solenikov + + stribog: Reduce table size to the needed one. + + commit e4de52378a85cf383994ded8edf0d5cf98dcb10c + * cipher/stribog.c (C16): Avoid allocating superfluous space. + + gostr3411-94: Fix the iteration count for length filling loop. + + commit 05dc5bcd234909ae9c9366b653346076b9a834ed + * cipher/gostr3411-94.c (gost3411_final): Fix loop + +2015-01-05 Werner Koch + + random: Silent warning under NetBSD using rndunix. + + commit 817472358a093438e802380caecf7139406400cf + * random/rndunix.c (STDERR_FILENO): Define if needed. + (start_gatherer): Re-open standard descriptors. Fix an + unsigned/signed pointer warning. + + primegen: Fix memory leak for invalid call sequences. + + commit 8c5eee51d9a25b143e41ffb7ff4a6b2a29b82d83 + * cipher/primegen.c (prime_generate_internal): Refactor generator code + to not leak memory for non-implemented feature. + (_gcry_prime_group_generator): Refactor to not leak memory for invalid + args. Also make sure that R_G is set as soon as possible. + + doc: Update yat2m to current upstream version (GnuPG). + + commit dd5df198727ea5d8f6b04288e14fd732051453c8 + + + build: Require automake 1.14. + + commit f65276970a6dcd6d9bca94cecc49b68acdcc9492 + * configure.ac (AM_INIT_AUTOMAKE): Add serial-tests. + + Replace camel case of internal scrypt functions. + + commit 1a6d65ac0aab335541726d02f2046d883a768ec3 + * cipher/scrypt.c (_salsa20_core): Rename to salsa20_core. Change + callers. + (_scryptBlockMix): Rename to scrypt_block_mix. Change callers. + (_scryptROMix): Rename to scrypt_ro_mix. Change callers. + +2015-01-02 Jussi Kivilinna + + rmd160: restore native-endian store in _gcry_rmd160_mixblock. + + commit d7c7453cf5e6b8f3c6b522a30e680f844a28c9de + * cipher/rmd160.c (_gcry_rmd160_mixblock): Store result to buffer in + native-endianess. + +2014-12-27 Jussi Kivilinna + + Add Intel SSSE3 based vector permutation AES implementation. + + commit 8eabecc883332156adffc1df42d27f614c157e06 + * cipher/Makefile.am: Add 'rijndael-ssse3-amd64.c'. + * cipher/rijndael-internal.h (USE_SSSE3): New. + (RIJNDAEL_context_s) [USE_SSSE3]: Add 'use_ssse3'. + * cipher/rijndael-ssse3-amd64.c: New. + * cipher/rijndael.c [USE_SSSE3] (_gcry_aes_ssse3_do_setkey) + (_gcry_aes_ssse3_prepare_decryption, _gcry_aes_ssse3_encrypt) + (_gcry_aes_ssse3_decrypt, _gcry_aes_ssse3_cfb_enc) + (_gcry_aes_ssse3_cbc_enc, _gcry_aes_ssse3_ctr_enc) + (_gcry_aes_ssse3_cfb_dec, _gcry_aes_ssse3_cbc_dec): New. + (do_setkey): Add HWF check for SSSE3 and setup for SSSE3 + implementation. + (prepare_decryption, _gcry_aes_cfb_enc, _gcry_aes_cbc_enc) + (_gcry_aes_ctr_enc, _gcry_aes_cfb_dec, _gcry_aes_cbc_dec): Add + selection for SSSE3 implementation. + * configure.ac [host=3Dx86_64]: Add 'rijndael-ssse3-amd64.lo'. + +2014-12-25 Jussi Kivilinna + + random-csprng: fix compiler warnings on ARM. + + commit c2e1f8fea271f3ef8027809547c4a52e0b1e24a2 + * random/random-csprng.c (_gcry_rngcsprng_update_seed_file) + (read_pool): Cast keypool and rndpool to 'unsigned long *' through + 'void *'. + + scrypt: fix compiler warnings on ARM. + + commit 1dab4c9422bf0f3cdc7a4d3ccf9db090abd90e94 + * cipher/scrypt.c (_scryptBlockMix): Cast X to 'u32 *' through 'void *'. + + secmem: fix compiler warnings on ARM. + + commit 99faf9cb34f872144313403f29f3379798debfc9 + * src/secmem.c (ADDR_TO_BLOCK, mb_get_next, mb_get_new): Cast pointer + from 'char *' to 'memblock_t *' through 'void *'. + (MB_WIPE_OUT): Remove unneeded cast to 'memblock_t *'. + + hash: fix compiler warning on ARM. + + commit 4515315f61fbf79413e150fbd1d5f5a2435f2bc5 + * cipher/md.c (md_open, md_copy): Cast 'char *' to ctx through + 'void *'. + * cipher/md4.c (md4_final): Use buf_put_* helper instead of + converting 'char *' to 'u32 *'. + * cipher/md5.c (md5_final): Ditto. + * cipher/rmd160.c (_gcry_rmd160_mixblock, rmd160_final): Ditto. + * cipher/sha1.c (sha1_final): Ditto. + * cipher/sha256.c (sha256_final): Ditto. + * cipher/sha512.c (sha512_final): Ditto. + * cipher/tiger.c (tiger_final): Ditto. + + rijndael: fix compiler warnings on ARM. + + commit cc26106dbebeb84d481661813edc3e5aea9a7d99 + * cipher/rijndael-internal.h (RIJNDAEL_context_s): Add u32 variants of + keyschedule arrays to unions u1 and u2. + (keyschedenc32, keyscheddec32): New. + * cipher/rijndael.c (u32_a_t): Remove. + (do_setkey): Add and use tkk[].data32, k_u32, tk_u32 and W_u32; Remove + casting byte arrays to u32_a_t. + (prepare_decryption, do_encrypt_fn, do_decrypt_fn): Use keyschedenc32 + and keyscheddec32; Remove casting byte arrays to u32_a_t. + +2014-12-23 Jussi Kivilinna + + Poly1305-AEAD: updated implementation to match draft-irtf-cfrg-chacha20-p= oly1305-03 + + commit 520070e02e2e6ee7228945015573a6e1f4895ec3 + * cipher/cipher-internal.h (gcry_cipher_handle): Use separate byte + counters for AAD and data in Poly1305. + * cipher/cipher-poly1305.c (poly1305_fill_bytecount): Remove. + (poly1305_fill_bytecounts, poly1305_do_padding): New. + (poly1305_aad_finish): Fill padding to Poly1305 and do not fill AAD + length. + (_gcry_cipher_poly1305_authenticate, _gcry_cipher_poly1305_encrypt) + (_gcry_cipher_poly1305_decrypt): Update AAD and data length separately. + (_gcry_cipher_poly1305_tag): Fill padding and bytecounts to Poly1305. + (_gcry_cipher_poly1305_setkey, _gcry_cipher_poly1305_setiv): Reset + AAD and data byte counts; only allow 96-bit IV. + * cipher/cipher.c (_gcry_cipher_open_internal): Limit Poly1305-AEAD to + ChaCha20 cipher. + * tests/basic.c (_check_poly1305_cipher): Update test-vectors. + (check_ciphers): Limit Poly1305-AEAD checks to ChaCha20. + * tests/bench-slope.c (cipher_bench_one): Ditto. + + chacha20: allow setting counter for stream random access. + + commit 11b8d2d449a7bc664b4371ae14c57caa6704d272 + * cipher/chacha20.c (CHACHA20_CTR_SIZE): New. + (chacha20_ivsetup): Add setup for full counter. + (chacha20_setiv): Allow ivlen =3D=3D CHACHA20_CTR_SIZE. + + gcm: do not pass extra key pointer for setupM/fillM. + + commit c964321c8a1328e89d636d899a45d68802f5ac9f + * cipher/cipher-gcm-intel-pclmul.c + (_gcry_ghash_setup_intel_pclmul): Remove 'h' parameter. + * cipher/cipher-gcm.c (_gcry_ghash_setup_intel_pclmul): Ditto. + (fillM): Get 'h' pointer from 'c'. + (setupM): Remome 'h' parameter. + (_gcry_cipher_gcm_setkey): Only pass 'c' to setupM. + + rijndael: use more compact look-up tables and add table prefetching. + + commit 2374753938df64f6fd8015b44613806a326eff1a + * cipher/rijndael-internal.h (rijndael_prefetchfn_t): New. + (RIJNDAEL_context): Add 'prefetch_enc_fn' and 'prefetch_dec_fn'. + * cipher/rijndael-tables.h (S, T1, T2, T3, T4, T5, T6, T7, T8, S5, U1) + (U2, U3, U4): Remove. + (encT, dec_tables, decT, inv_sbox): Add. + * cipher/rijndael.c (_gcry_aes_amd64_encrypt_block) + (_gcry_aes_amd64_decrypt_block, _gcry_aes_arm_encrypt_block) + (_gcry_aes_arm_encrypt_block): Add parameter for passing table pointer + to assembly implementation. + (prefetch_table, prefetch_enc, prefetch_dec): New. + (do_setkey): Setup context prefetch functions depending on selected + rijndael implementation; Use new tables for key setup. + (prepare_decryption): Use new tables for decryption key setup. + (do_encrypt_aligned): Rename to... + (do_encrypt_fn): ... to this, change to use new compact tables, + make handle unaligned input and unroll rounds loop by two. + (do_encrypt): Remove handling of unaligned input/output; pass table + pointer to assembly implementations. + (rijndael_encrypt, _gcry_aes_cfb_enc, _gcry_aes_cbc_enc) + (_gcry_aes_ctr_enc, _gcry_aes_cfb_dec): Prefetch encryption tables + before encryption. + (do_decrypt_aligned): Rename to... + (do_decrypt_fn): ... to this, change to use new compact tables, + make handle unaligned input and unroll rounds loop by two. + (do_decrypt): Remove handling of unaligned input/output; pass table + pointer to assembly implementations. + (rijndael_decrypt, _gcry_aes_cbc_dec): Prefetch decryption tables + before decryption. + * cipher/rijndael-amd64.S: Use 1+1.25 KiB tables for + encryption+decryption; remove tables from assembly file. + * cipher/rijndael-arm.S: Ditto. + +2014-12-15 Werner Koch + + build: Add configure option --disable-doc. + + commit ad50e360ef4851e66e51a03fc420175636336b58 + * Makefile.am (AUTOMAKE_OPTIONS): Remove. + (doc) [!BUILD_DOC]: Do not recurse into the dir. + * configure.ac (AM_INIT_AUTOMAKE): Add option formerly in Makefile.am. + (BUILD_DOC): Add new am_conditional. + +2014-12-12 Jussi Kivilinna + + rijndael: further optimizations for AES-NI accelerated CBC and CFB bulk m= odes + + commit 4f46374502eb988d701b904f83819e2cf7b1755c + * cipher/rijndael-aesni.c (do_aesni_enc, do_aesni_dec): Pass + input/output through SSE register XMM0. + (do_aesni_cfb): Remove. + (_gcry_aes_aesni_encrypt, _gcry_aes_aesni_decrypt): Add loading/storing + input/output to/from XMM0. + (_gcry_aes_aesni_cfb_enc, _gcry_aes_aesni_cbc_enc) + (_gcry_aes_aesni_cfb_dec): Update to use renewed 'do_aesni_enc' and + move IV loading/storing outside loop. + (_gcry_aes_aesni_cbc_dec): Update to use renewed 'do_aesni_dec'. + + GCM: move Intel PCLMUL accelerated implementation to separate file. + + commit 4a0795af021305f9240f23626a3796157db46bd7 + * cipher/Makefile.am: Add 'cipher-gcm-intel-pclmul.c'. + * cipher/cipher-gcm-intel-pclmul.c: New. + * cipher/cipher-gcm.c [GCM_USE_INTEL_PCLMUL] + (_gcry_ghash_setup_intel_pclmul, _gcry_ghash_intel_pclmul): New + prototypes. + [GCM_USE_INTEL_PCLMUL] (gfmul_pclmul, gfmul_pclmul_aggr4): Move + to 'cipher-gcm-intel-pclmul.c'. + (ghash): Rename to... + (ghash_internal): ...this and move GCM_USE_INTEL_PCLMUL part to new + function in 'cipher-gcm-intel-pclmul.c'. + (setupM): Move GCM_USE_INTEL_PCLMUL part to new function in + 'cipher-gcm-intel-pclmul.c'; Add selection of ghash function based + on available HW acceleration. + (do_ghash_buf): Change use of 'ghash' to 'c->u_mode.gcm.ghash_fn'. + * cipher/internal.h (ghash_fn_t): New. + (gcry_cipher_handle): Remove 'use_intel_pclmul'; Add 'ghash_fn'. + +2014-12-06 Jussi Kivilinna + + rijndael: split Padlock part to separate file. + + commit cbf4c8cb6bbda15eea61885279f2a6f1d4bcedfd + * cipher/Makefile.am: Add 'rijndael-padlock.c'. + * cipher/rijndael-padlock.c: New. + * cipher/rijndael.c (do_padlock, do_padlock_encrypt) + (do_padlock_decrypt): Move to 'rijndael-padlock.c'. + * configure.ac [mpi_cpu_arch=3Dx86]: Add 'rijndael-padlock.lo'. + +2014-12-01 Jussi Kivilinna + + rijndael: refactor to reduce number of #ifdefs and branches. + + commit 3d5b51786e2050c461e9791b59142a731462b66d + * cipher/rijndael-aesni.c (_gcry_aes_aesni_encrypt) + (_gcry_aes_aesni_decrypt): Make return stack burn depth. + * cipher/rijndael-amd64.S (_gcry_aes_amd64_encrypt_block) + (_gcry_aes_amd64_decrypt_block): Ditto. + * cipher/rijndael-arm.S (_gcry_aes_arm_encrypt_block) + (_gcry_aes_arm_decrypt_block): Ditto. + * cipher/rijndael-internal.h (RIJNDAEL_context_s) + (rijndael_cryptfn_t): New. + (RIJNDAEL_context): New members 'encrypt_fn' and 'decrypt_fn'. + * cipher/rijndael.c (_gcry_aes_amd64_encrypt_block) + (_gcry_aes_amd64_decrypt_block, _gcry_aes_aesni_encrypt) + (_gcry_aes_aesni_decrypt, _gcry_aes_arm_encrypt_block) + (_gcry_aes_arm_decrypt_block): Change prototypes. + (do_padlock_encrypt, do_padlock_decrypt): New. + (do_setkey): Separate key-length to rounds conversion from + HW features check; Add selection for ctx->encrypt_fn and + ctx->decrypt_fn. + (do_encrypt_aligned, do_decrypt_aligned): Move inside + '[!USE_AMD64_ASM && !USE_ARM_ASM]'; Move USE_AMD64_ASM and + USE_ARM_ASM to... + (do_encrypt, do_decrypt): ...here; Return stack depth; Remove second + temporary buffer from non-aligned input/output case. + (do_padlock): Move decrypt_flag to last argument; Return stack depth. + (rijndael_encrypt): Remove #ifdefs, just call ctx->encrypt_fn. + (_gcry_aes_cfb_enc, _gcry_aes_cbc_enc): Remove USE_PADLOCK; Call + ctx->encrypt_fn in place of do_encrypt/do_encrypt_aligned. + (_gcry_aes_ctr_enc): Call ctx->encrypt_fn in place of + do_encrypt_aligned; Make tmp buffer 16-byte aligned and wipe buffer + after use. + (rijndael_encrypt): Remove #ifdefs, just call ctx->decrypt_fn. + (_gcry_aes_cfb_dec): Remove USE_PADLOCK; Call ctx->decrypt_fn in place + of do_decrypt/do_decrypt_aligned. + (_gcry_aes_cbc_dec): Ditto; Make savebuf buffer 16-byte aligned. + + rijndael: move AES-NI blocks before Padlock. + + commit dbf9e95dd3891f6e6ad370e8ab78fec03595687b + * cipher/rijndael.c (do_setkey, rijndael_encrypt, _gcry_aes_cfb_enc) + (rijndael_decrypt, _gcry_aes_cfb_dec): Move USE_AESNI before + USE_PADLOCK. + (check_decryption_praparation) [USE_PADLOCK]: Move to... + (prepare_decryption) [USE_PADLOCK]: ...here. + + rijndael: split AES-NI functions to separate file. + + commit 67d529630e838daeb8cb9c6d7ef660c01ef34fee + * cipher/Makefile.in: Add 'rijndael-aesni.c'. + * cipher/rijndael-aesni.c: New. + * cipher/rijndael-internal.h: New. + * cipher/rijndael.c (MAXKC, MAXROUNDS, BLOCKSIZE, ATTR_ALIGNED_16) + (USE_AMD64_ASM, USE_ARM_ASM, USE_PADLOCK, USE_AESNI, RIJNDAEL_context) + (keyschenc, keyschdec, padlockkey): Move to 'rijndael-internal.h'. + (u128_s, aesni_prepare, aesni_cleanup, aesni_cleanup_2_6) + (aesni_do_setkey, do_aesni_enc, do_aesni_dec, do_aesni_enc_vec4) + (do_aesni_dec_vec4, do_aesni_cfb, do_aesni_ctr, do_aesni_ctr_4): Move + to 'rijndael-aesni.c'. + (prepare_decryption, rijndael_encrypt, _gcry_aes_cfb_enc) + (_gcry_aes_cbc_enc, _gcry_aes_ctr_enc, rijndael_decrypt) + (_gcry_aes_cfb_dec, _gcry_aes_cbc_dec) [USE_AESNI]: Move to functions + in 'rijdael-aesni.c'. + * configure.ac [mpi_cpu_arch=3Dx86]: Add 'rijndael-aesni.lo'. + +2014-11-24 Werner Koch + + Remove duplicated prototypes. + + commit d53ea84bed37b973f7ce59262c50b33700cd8311 + * src/gcrypt-int.h (_gcry_mpi_ec_new, _gcry_mpi_ec_set_mpi) + (gcry_mpi_ec_set_point): Remove. + + tests: Add a prime mode to benchmark. + + commit 1b4210c204a5ef5e631187509e011b8468a134ef + * tests/benchmark.c (progress_cb): Add a single char mode. + (prime_bench): New. + (main): Add a "prime" mode. Factor with_progress out to file scope. + +2014-11-19 NIIBE Yutaka + + ecc: Improve Montgomery curve implementation. + + commit e6130034506013d6153465a2bedb6fb08a43f74d + * cipher/ecc-curves.c (_gcry_ecc_fill_in_curve): Support + MPI_EC_MONTGOMERY. + * cipher/ecc.c (test_ecdh_only_keys): New. + (nist_generate_key): Call test_ecdh_only_keys for MPI_EC_MONTGOMERY. + (check_secret_key): Handle Montgomery curve of x-coordinate only. + * mpi/ec.c (_gcry_mpi_ec_mul_point): Resize points before the loop. + Simplify, using pointers of Q1, Q2, PRD, and SUM. + +2014-11-02 Jussi Kivilinna + + Disable NEON for CPUs that are known to have broken NEON implementation. + + commit 95eef21583d8e998efc48f22898c1ae31b77cb48 + * src/hwf-arm.c (detect_arm_proc_cpuinfo): Add parsing for CPU version + information and check if CPU is known to have broken NEON + implementation. + (_gcry_hwf_detect_arm): Filter out broken HW features. + + Add ARM/NEON implementation of Poly1305. + + commit 0b520128551054d83fb0bb2db8873394f38de498 + * cipher/Makefile.am: Add 'poly1305-armv7-neon.S'. + * cipher/poly1305-armv7-neon.S: New. + * cipher/poly1305-internal.h (POLY1305_USE_NEON) + (POLY1305_NEON_BLOCKSIZE, POLY1305_NEON_STATESIZE) + (POLY1305_NEON_ALIGNMENT): New. + * cipher/poly1305.c [POLY1305_USE_NEON] + (_gcry_poly1305_armv7_neon_init_ext) + (_gcry_poly1305_armv7_neon_finish_ext) + (_gcry_poly1305_armv7_neon_blocks, poly1305_armv7_neon_ops): New. + (_gcry_poly1305_init) [POLY1305_USE_NEON]: Select NEON implementation + if HWF_ARM_NEON set. + * configure.ac [neonsupport=3Dyes]: Add 'poly1305-armv7-neon.lo'. + + chacha20: add ARMv7/NEON implementation. + + commit c584f44543883346d5a565581ff99a0afce9c5e1 + * cipher/Makefile.am: Add 'chacha20-armv7-neon.S'. + * cipher/chacha20-armv7-neon.S: New. + * cipher/chacha20.c (USE_NEON): New. + [USE_NEON] (_gcry_chacha20_armv7_neon_blocks): New. + (chacha20_do_setkey) [USE_NEON]: Use Neon implementation if + HWF_ARM_NEON flag set. + (selftest): Self-test encrypting buffer byte by byte. + * configure.ac [neonsupport=3Dyes]: Add 'chacha20-armv7-neon.lo'. + +2014-10-08 Markus Teich + + mpi: Add gcry_mpi_ec_sub. + + commit 23ecadf309f8056c35cc092e58df801ac0eab862 + * NEWS (gcry_mpi_ec_sub): New. + * doc/gcrypt.texi (gcry_mpi_ec_sub): New. + * mpi/ec.c (_gcry_mpi_ec_sub, sub_points_edwards): New. + (sub_points_montgomery, sub_points_weierstrass): New stubs. + * src/gcrypt-int.h (_gcry_mpi_ec_sub): New. + * src/gcrypt.h.in (gcry_mpi_ec_sub): New. + * src/libgcrypt.def (gcry_mpi_ec_sub): New. + * src/libgcrypt.vers (gcry_mpi_ec_sub): New. + * src/mpi.h (_gcry_mpi_ec_sub_points): New. + * src/visibility.c (gcry_mpi_ec_sub): New. + * src/visibility.h (gcry_mpi_ec_sub): New. + +2014-10-08 Werner Koch + + Fix prime test for 2 and lower and add check command to mpicalc. + + commit 5c906e2cdb14e93fb4915fdc69c7353a5fa35709 + * cipher/primegen.c (check_prime): Return true for the small primes. + (_gcry_prime_check): Return correct values for 2 and lower numbers. + + * src/mpicalc.c (do_primecheck): New. + (main): Add command 'P'. + (main): Allow for larger input data. + +2014-10-04 Jussi Kivilinna + + Add Whirlpool AMD64/SSE2 assembly implementation. + + commit de0ccd4dce7ec185a678d78878d4538dd609ca0f + * cipher/Makefile.am: Add 'whirlpool-sse2-amd64.S'. + * cipher/whirlpool-sse2-amd64.S: New. + * cipher/whirlpool.c (USE_AMD64_ASM): New. + (whirlpool_tables_s): New. + (rc, C0, C1, C2, C3, C4, C5, C6, C7): Combine these tables into single + structure and replace old tables with macros of same name. + (tab): New structure containing above tables. + [USE_AMD64_ASM] (_gcry_whirlpool_transform_amd64) + (whirlpool_transform): New. + * configure.ac [host=3Dx86_64]: Add 'whirlpool-sse2-amd64.lo'. + +2014-10-04 Andrei Scherer + + Improved ripemd160 performance. + + commit 30bd759f398f45b04d0a783b875f59ce9bd1e51d + * cipher/rmd160.c (transform): Interleave the left and right lane + rounds to introduce more instruction level parallelism. + +2014-10-02 Werner Koch + + build: Document SYSROOT. + + commit 0ecd136a6ca02252f63ad229fa5240897bfe6544 + * configure.ac: Mark SYSROOT as arg var. + + build: Support SYSROOT based config script finding. + + commit 1e8b86494cf8fa045696bd447b16267ffd1797f0 + * src/libgcrypt.m4: Add support for SYSROOT and set + gpg_config_script_warn. Use AC_PATH_PROG instead of AC_PATH_TOOL + because the config script is not expected to be installed with a + prefix for its name + * configure.ac: Print a library mismatch warning. + * m4/gpg-error.m4: Update from git master. + +2014-09-30 Werner Koch + + mac: Fix gcry_mac_close to allow for a NULL handle. + + commit 51dae8c8c4b63bb5e1685cbd8722e35342524737 + * cipher/mac.c (_gcry_mac_close): Check for NULL. + +2014-09-03 Werner Koch + + Add a constant for a forthcoming new RNG. + + commit 8b960a807d168000d2690897a7634bd384ac1346 + * src/gcrypt.h.in (GCRYCTL_DRBG_REINIT): New constant. + +2014-09-02 Jussi Kivilinna + + Add new Poly1305 MAC test vectors. + + commit 8a2a328742012a7c528dd007437185e4584c1e48 + * tests/basic.c (check_mac): Add new test vectors for Poly1305 MAC. + +2014-09-02 Werner Koch + + asm: Allow building x86 and amd64 using old compilers. + + commit 5eec04a43e6c562e956353449be931dd43dfe1cc + * src/hwf-x86.c (get_xgetbv): Build only if AVX support is enabled. + +2014-08-21 Werner Koch + + sexp: Check args of gcry_sexp_build. + + commit e606d5f1bada1f2d21faeedd3fa2cf2dca7b274c + * src/sexp.c (do_vsexp_sscan): Return error for invalid args. + + cipher: Fix a segv in case of calling with wrong parameters. + + commit f850add813d783f31ca6a60459dea25ef71bce7e + * cipher/md.c (_gcry_md_info): Fix arg testing. + + cipher: Fix possible NULL deref in call to prime generator. + + commit 18056ace7f466cb8c1eaf08e5dc0400516d83b4c + * cipher/primegen.c (_gcry_generate_elg_prime): Change to return an + error code. + * cipher/dsa.c (generate): Take care of new return code. + * cipher/elgamal.c (generate): Change to return an error code. Take + care of _gcry_generate_elg_prime return code. + (generate_using_x): Take care of _gcry_generate_elg_prime return code. + (elg_generate): Propagate return code from generate. + +2014-08-12 NIIBE Yutaka + + ecc: Support Montgomery curve for gcry_mpi_ec_mul_point. + + commit 34bb55ee36df3aca3ebca88f8b61c786cd0c0701 + * mpi/ec.c (_gcry_mpi_ec_get_affine): Support Montgomery curve. + (montgomery_ladder): New. + (_gcry_mpi_ec_mul_point): Implemention using montgomery_ladder. + (_gcry_mpi_ec_curve_point): Check x-coordinate is valid. + +2014-08-09 Werner Koch + + tests: Add a benchmark for Elgamal. + + commit e6d354865bf8f3d4c1bb5e8157a76fdd442cff41 + * tests/benchmark.c (sample_public_elg_key_1024): New. + (sample_private_elg_key_1024): New. + (sample_public_elg_key_2048, sample_private_elg_key_2048): New. + (sample_public_elg_key_3072, sample_private_elg_key_3072): New. + (elg_bench): New. + (main): Add elg_bench. Add commands "elg" and "public". + +2014-08-08 NIIBE Yutaka + + ecc: Add cofactor to domain parameters. + + commit 9933b9e5e1a3f5b1019c75f93bd265d4a1ecc270 + * src/ec-context.h (mpi_ec_ctx_s): Add cofactor 'h'. + * cipher/ecc-common.h (elliptic_curve_t): Add cofactor 'h'. + (_gcry_ecc_update_curve_param): New API adding cofactor. + + * cipher/ecc-curves.c (ecc_domain_parms_t): Add cofactor 'h'. + (ecc_domain_parms_t domain_parms): Add cofactors. + (_gcry_ecc_fill_in_curve, _gcry_ecc_update_curve_param) + (_gcry_ecc_get_curve, _gcry_mpi_ec_new, _gcry_ecc_get_param_sexp) + (_gcry_ecc_get_mpi): Handle cofactor. + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_genkey): Likewise. + * cipher/ecc-misc.c (_gcry_ecc_curve_free) + (_gcry_ecc_curve_copy): Likewise. + * cipher/ecc.c (nist_generate_key, ecc_generate) + (ecc_check_secret_key, ecc_sign, ecc_verify, ecc_encrypt_raw) + (ecc_decrypt_raw, _gcry_pk_ecc_get_sexp, _gcry_pubkey_spec_ecc): + Likewise. + (compute_keygrip): Handle cofactor, but skip it for its computation. + * mpi/ec.c (ec_deinit): Likewise. + * tests/t-mpi-point.c (context_param): Likewise. + (test_curve): Add cofactors. + * tests/curves.c (sample_key_1, sample_key_2): Add cofactors. + * tests/keygrip.c (key_grips): Add cofactors. + +2014-08-05 Werner Koch + + mpi: Fix regression for powerpc-apple-darwin detection. + + commit 4ce77b0a810d3c889c07dfb385127d90fa1ae36a + * mpi/config.links: Add separate entry for powerpc-apple-darwin. + + Fix bug inhibiting the use of the sentinel attribute. + + commit d2d28298ccc0d0f3c0b03fd323deb1e8808ef74f + * src/gcrypt.h.in: Fix typo in macro. + + mpi: Use BSD syntax for x86_64-apple-darwin. + + commit 71939faa7c54e7b4b28d115e748a85f134876a02 + * mpi/config.links: Add case for x86_64-apple-darwin. + +2014-08-05 Kristian Fiskerstrand + + Fix building for the x32 target without asm modules. + + commit a17c29844b63e9e869f7855d901bc9d859234ead + * mpi/generic/mpi-asm-defs.h: Use a fixed value for the x32 ABI. + +2014-07-25 Werner Koch + + ecc: Support the non-standard 0x40 compression flag for EdDSA. + + commit 4556f9b19c024f16bdf542da7173395c0741b91d + * cipher/ecc.c (ecc_generate): Check the "comp" flag for EdDSA. + * cipher/ecc-eddsa.c (eddsa_encode_x_y): Add arg WITH_PREFIX. + (_gcry_ecc_eddsa_encodepoint): Ditto. + (_gcry_ecc_eddsa_ensure_compact): Handle the 0x40 compression prefix. + (_gcry_ecc_eddsa_decodepoint): Ditto. + * tests/keygrip.c: Check an compresssed with prefix Ed25519 key. + * tests/t-ed25519.inp: Ditto. + + mpi: Extend the internal mpi_get_buffer. + + commit 0e10902ad7584277ac966367efc712b183784532 + * mpi/mpicoder.c (do_get_buffer): Add arg EXTRAALLOC. + (_gcry_mpi_get_buffer_extra): New. + + cipher: Fix compiler warning for chacha20. + + commit 4e0bf1b9190ce08fb23eb3ae0c3be58954ff36ab + * cipher/chacha20.c (chacha20_blocks) [!USE_SSE2]: Do not build. + +2014-07-16 NIIBE Yutaka + + mpi: Add mpi_swap_cond. + + commit 4846e52728970e3117f3a046ef9010be089a3ae4 + * mpi/mpiutil.c (_gcry_mpi_swap_cond): New. + * src/mpi.h (mpi_swap_cond): New. + +2014-06-29 Jussi Kivilinna + + Speed-up SHA-1 NEON assembly implementation. + + commit 1b9b00bbe41bbed32563f1102049521e703e72bd + * cipher/sha1-armv7-neon.S: Tweak implementation for speed-up. + +2014-06-28 Dmitry Eremin-Solenikov + + gostr3411_94: rewrite to use u32 mathematic. + + commit 066f068bd0bc4d8e01f1f18b6153cdc8d2c245d7 + * cipher/gost28147.c (_gcry_gost_enc_data): New. + * cipher/gostr3411-94.c: Rewrite implementation to use u32 mathematic + internally. + * cipher/gost28147.c (_gcry_gost_enc_one): Remove. + + gost28147: use bufhelp helpers. + + commit 7aeba6c449169926076df83b01ddbfa6b41fe411 + * cipher/gost28147.c (gost_setkey, gost_encrypt_block, gost_decrypt_block= ): + use buf_get_le32/buf_put_le32 helpers. + + Fixup curve name in the GOST2012 test case. + + commit b78d504fa8745b8b04589acbbcf7dd5fe9279d13 + * tests/basic.c (check_pubkey): fixup curve name in public key. + + Update PBKDF2 tests with GOST R 34.11-94 test cases. + + commit 7533b2ad46f42e98d9dba52e88e79c0311d2d3b7 + * tests/t-kdf.c (check_pbkdf2): Add MD_GOSTR3411_CP test cases. + + Add GOST R 34.11-94 variant using id-GostR3411-94-CryptoProParamSet. + + commit 25d6af77e2336b5979ddbe8b90978fe5b61dfaf9 + * src/gcrypt.h.in (GCRY_MD_GOSTR3411_CP): New. + * src/cipher.h (_gcry_digest_spec_gost3411_cp): New. + * cipher/gost28147.c (_gcry_gost_enc_one): Differentiate between + CryptoPro and Test S-Boxes. + * cipher/gostr3411-94.c (_gcry_digest_spec_gost3411_cp, + gost3411_cp_init): New. + * cipher/md.c (md_open): GCRY_MD_GOSTR3411_CP also uses B=3D32. + + gost28147: support GCRYCTL_SET_SBOX. + + commit 5ee35a04362c94e680ef3633fa83b72e0aee8626 + cipher/gost28147.c (gost_set_extra_info, gost_set_sbox): New. + + Support setting s-box for the ciphers that require it. + + commit fb074d113fcbf66a5c20592625cb19051f3430f5 + * src/gcrypt.h.in (GCRYCTL_SET_SBOX, gcry_cipher_set_sbox): New. + * cipher/cipher.c (_gcry_cipher_ctl): pass GCRYCTL_SET_SBOX to + set_extra_info callback. + + cipher/gost28147: generate optimized s-boxes from compact ones. + + commit 164738a0292b3f32c7747099ad9cadace58e5eda + * cipher/gost-s-box.c: New. Outputs optimized expanded representation of + s-boxes (4x256) from compact 16x8 representation. + * cipher/Makefile.am: Add gost-sb.h dependency to gost28147.lo + * cipher/gost.h: Add sbox to the GOST28147_context structure. + * cipher/gost28147.c (gost_setkey): Set default s-box to test s-box from + GOST R 34.11 (this was the only one S-box before). + * cipher/gost28147.c (gost_val): Use sbox from the context. + + gost28147: add OIDs used to define cipher mode. + + commit 34a58010000288515636706811c3837f32957b2e + * cipher/gost28147 (oids_gost28147): Add OID from RFC4357. + + GOST R 34.11-94 add OIDs. + + commit 8b221cf5ce233c8c49a4e4ecebb70d523fc37837 + * cipher/gostr3411-94.c: Add OIDs for GOST R 34.11-94 from RFC 4357. + +2014-05-21 Jussi Kivilinna + + tests: add larger test-vectors for hash algorithms. + + commit f14fb5b427b5159fcd9603d2b3cde936889cf430 + * tests/basic.c (check_digests): Add large test-vectors for MD5, SHA1, + SHA224, SHA256, SHA384, RMD160, CRC32, TIGER1, WHIRLPOOL and + GOSTR3411_94. + + sha512: fix ARM/NEON implementation. + + commit beb901575f0d6cd6a0a27506ebea9a725754d0cc + * cipher/sha512-armv7-neon.S + (_gcry_sha512_transform_armv7_neon): Byte-swap RW67q and RW1011q + correctly in multi-block loop. + * tests/basic.c (check_digests): Add large test vector for SHA512. + +2014-05-20 Jussi Kivilinna + + Fix ARM assembly when building __PIC__ + + commit 994c758d8f5471c7e9c38c2834742cca2502d35f + * cipher/camellia-arm.S (GET_DATA_POINTER): New. + (_gcry_camellia_arm_encrypt_block): Use GET_DATA_POINTER. + (_gcry_camellia_arm_decrypt_block): Ditto. + * cipher/cast5-arm.S (GET_DATA_POINTER): New. + (_gcry_cast5_arm_encrypt_block, _gcry_cast5_arm_decrypt_block) + (_gcry_cast5_arm_enc_blk2, _gcry_cast5_arm_dec_blk2): Use + GET_DATA_POINTER. + * cipher/rijndael-arm.S (GET_DATA_POINTER): New. + (_gcry_aes_arm_encrypt_block, _gcry_aes_arm_decrypt_block): Use + GET_DATA_POINTER. + * cipher/sha1-armv7-neon.S (GET_DATA_POINTER): New. + (.LK_VEC): Move from .text to .data section. + (_gcry_sha1_transform_armv7_neon): Use GET_DATA_POINTER. + +2014-05-17 Jussi Kivilinna + + Add Poly1305 to documentation. + + commit bf4943932dae95a0573b63bf32a9b9acd5a6ddf3 + * doc/gcrypt.texi: Add documentation for Poly1305 MACs and AEAD mode. + +2014-05-16 Jussi Kivilinna + + chacha20: add SSE2/AMD64 optimized implementation. + + commit 323b1eb80ff3396d83fedbe5bba9a4e6c412d192 + * cipher/Makefile.am: Add 'chacha20-sse2-amd64.S'. + * cipher/chacha20-sse2-amd64.S: New. + * cipher/chacha20.c (USE_SSE2): New. + [USE_SSE2] (_gcry_chacha20_amd64_sse2_blocks): New. + (chacha20_do_setkey) [USE_SSE2]: Use SSE2 implementation for blocks + function. + * configure.ac [host=3Dx86-64]: Add 'chacha20-sse2-amd64.lo'. + + poly1305: add AMD64/AVX2 optimized implementation. + + commit 98f021961ee65669037bc8bb552a69fd78f610fc + * cipher/Makefile.am: Add 'poly1305-avx2-amd64.S'. + * cipher/poly1305-avx2-amd64.S: New. + * cipher/poly1305-internal.h (POLY1305_USE_AVX2) + (POLY1305_AVX2_BLOCKSIZE, POLY1305_AVX2_STATESIZE) + (POLY1305_AVX2_ALIGNMENT): New. + (POLY1305_LARGEST_BLOCKSIZE, POLY1305_LARGEST_STATESIZE) + (POLY1305_STATE_ALIGNMENT): Use AVX2 versions when needed. + * cipher/poly1305.c [POLY1305_USE_AVX2] + (_gcry_poly1305_amd64_avx2_init_ext) + (_gcry_poly1305_amd64_avx2_finish_ext) + (_gcry_poly1305_amd64_avx2_blocks, poly1305_amd64_avx2_ops): New. + (_gcry_poly1305_init) [POLY1305_USE_AVX2]: Use AVX2 implementation if + AVX2 supported by CPU. + * configure.ac [host=3Dx86_64]: Add 'poly1305-avx2-amd64.lo'. + +2014-05-12 Jussi Kivilinna + + poly1305: add AMD64/SSE2 optimized implementation. + + commit 297532602ed2d881d8fdc393d1961068a143a891 + * cipher/Makefile.am: Add 'poly1305-sse2-amd64.S'. + * cipher/poly1305-internal.h (POLY1305_USE_SSE2) + (POLY1305_SSE2_BLOCKSIZE, POLY1305_SSE2_STATESIZE) + (POLY1305_SSE2_ALIGNMENT): New. + (POLY1305_LARGEST_BLOCKSIZE, POLY1305_LARGEST_STATESIZE) + (POLY1305_STATE_ALIGNMENT): Use SSE2 versions when needed. + * cipher/poly1305-sse2-amd64.S: New. + * cipher/poly1305.c [POLY1305_USE_SSE2] + (_gcry_poly1305_amd64_sse2_init_ext) + (_gcry_poly1305_amd64_sse2_finish_ext) + (_gcry_poly1305_amd64_sse2_blocks, poly1305_amd64_sse2_ops): New. + (_gcry_polu1305_init) [POLY1305_USE_SSE2]: Use SSE2 version. + * configure.ac [host=3Dx86_64]: Add 'poly1305-sse2-amd64.lo'. + + Add Poly1305 based cipher AEAD mode. + + commit e813958419b0ec4439e6caf07d3b2234cffa2bfa + * cipher/Makefile.am: Add 'cipher-poly1305.c'. + * cipher/cipher-internal.h (gcry_cipher_handle): Add 'u_mode.poly1305'. + (_gcry_cipher_poly1305_encrypt, _gcry_cipher_poly1305_decrypt) + (_gcry_cipher_poly1305_setiv, _gcry_cipher_poly1305_authenticate) + (_gcry_cipher_poly1305_get_tag, _gcry_cipher_poly1305_check_tag): New. + * cipher/cipher-poly1305.c: New. + * cipher/cipher.c (_gcry_cipher_open_internal, cipher_setkey) + (cipher_reset, cipher_encrypt, cipher_decrypt, _gcry_cipher_setiv) + (_gcry_cipher_authenticate, _gcry_cipher_gettag) + (_gcry_cipher_checktag): Handle 'GCRY_CIPHER_MODE_POLY1305'. + (cipher_setiv): Move handling of 'GCRY_CIPHER_MODE_GCM' to ... + (_gcry_cipher_setiv): ... here, as with other modes. + * src/gcrypt.h.in: Add 'GCRY_CIPHER_MODE_POLY1305'. + * tests/basic.c (_check_poly1305_cipher, check_poly1305_cipher): New. + (check_ciphers): Add Poly1305 check. + (check_cipher_modes): Call 'check_poly1305_cipher'. + * tests/bench-slope.c (bench_gcm_encrypt_do_bench): Rename to + bench_aead_... and take nonce as argument. + (bench_gcm_decrypt_do_bench, bench_gcm_authenticate_do_bench): Ditto. + (bench_gcm_encrypt_do_bench, bench_gcm_decrypt_do_bench) + (bench_gcm_authenticate_do_bench, bench_poly1305_encrypt_do_bench) + (bench_poly1305_decrypt_do_bench) + (bench_poly1305_authenticate_do_bench, poly1305_encrypt_ops) + (poly1305_decrypt_ops, poly1305_authenticate_ops): New. + (cipher_modes): Add Poly1305. + (cipher_bench_one): Add special handling for Poly1305. + + Add Poly1305-AES (-Camellia, etc) MACs. + + commit 73b3b75c2221a6e3bed4117e0a206a1193acd2ed + * cipher/mac-internal.h (_gcry_mac_type_spec_poly1305_aes) + (_gcry_mac_type_spec_poly1305_camellia) + (_gcry_mac_type_spec_poly1305_twofish) + (_gcry_mac_type_spec_poly1305_serpent) + (_gcry_mac_type_spec_poly1305_seed): New. + * cipher/mac-poly1305.c (poly1305mac_context_s): Add 'hd' and + 'nonce_set'. + (poly1305mac_open, poly1305mac_close, poly1305mac_setkey): Add handling + for Poly1305-*** MACs. + (poly1305mac_prepare_key, poly1305mac_setiv): New. + (poly1305mac_reset, poly1305mac_write, poly1305mac_read): Add handling + for 'nonce_set'. + (poly1305mac_ops): Add 'poly1305mac_setiv'. + (_gcry_mac_type_spec_poly1305_aes) + (_gcry_mac_type_spec_poly1305_camellia) + (_gcry_mac_type_spec_poly1305_twofish) + (_gcry_mac_type_spec_poly1305_serpent) + (_gcry_mac_type_spec_poly1305_seed): New. + * cipher/mac.c (mac_list): Add Poly1305-AES, Poly1305-Twofish, + Poly1305-Serpent, Poly1305-SEED and Poly1305-Camellia. + * src/gcrypt.h.in: Add 'GCRY_MAC_POLY1305_AES', + 'GCRY_MAC_POLY1305_CAMELLIA', 'GCRY_MAC_POLY1305_TWOFISH', + 'GCRY_MAC_POLY1305_SERPENT' and 'GCRY_MAC_POLY1305_SEED'. + * tests/basic.c (check_mac): Add Poly1305-AES test vectors. + * tests/bench-slope.c (bench_mac_init): Set IV for Poly1305-*** MACs. + * tests/bench-slope.c (mac_bench): Set IV for Poly1305-*** MACs. + + Add Poly1305 MAC. + + commit b8794fed68ebe7567f4617141f0996ad290d9120 + * cipher/Makefile.am: Add 'mac-poly1305.c', 'poly1305.c' and + 'poly1305-internal.h'. + * cipher/mac-internal.h (poly1305mac_context_s): New. + (gcry_mac_handle): Add 'u.poly1305mac'. + (_gcry_mac_type_spec_poly1305mac): New. + * cipher/mac-poly1305.c: New. + * cipher/mac.c (mac_list): Add Poly1305. + * cipher/poly1305-internal.h: New. + * cipher/poly1305.c: New. + * src/gcrypt.h.in: Add 'GCRY_MAC_POLY1305'. + * tests/basic.c (check_mac): Add Poly1035 test vectors; Allow + overriding lengths of data and key buffers. + * tests/bench-slope.c (mac_bench): Increase max algo number from 500 to + 600. + * tests/benchmark.c (mac_bench): Ditto. + + chacha20/AVX2: clear upper-halfs of YMM registers on entry. + + commit c20daeeb05329bfc6cc2c562cbd4b965291fe0e1 + * cipher/chacha20-avx2-amd64.S (_gcry_chacha20_amd64_avx2_blocks): Add + 'vzeroupper' at beginning. + + chacha20/AVX2: check for ENABLE_AVX2_SUPPORT instead of HAVE_GCC_INLINE_A= SM_AVX2 + + commit a3062db748f272e0f7346e1ed9e0bf7ed61a4eae + * cipher/chacha20.c (USE_AVX2): Enable depending on + ENABLE_AVX2_SUPPORT, not HAVE_GCC_INLINE_ASM_AVX2. + * cipher/chacha20-avx2-amd64.S: Ditto. + + chacha20/SSSE3: clear XMM registers after use. + + commit a7d9eeeba632b7eb4a5b15ff17f6565181642f3c + * cipher/chacha20-ssse3-amd64.S (_gcry_chacha20_amd64_ssse3_blocks): On + return, clear XMM registers. + +2014-05-11 Jussi Kivilinna + + chacha20: add AVX2/AMD64 assembly implementation. + + commit a39ee7555691d18cae97560f130aaf952bfbd278 + * cipher/Makefile.am: Add 'chacha20-avx2-amd64.S'. + * cipher/chacha20-avx2-amd64.S: New. + * cipher/chacha20.c (USE_AVX2): New macro. + [USE_AVX2] (_gcry_chacha20_amd64_avx2_blocks): New. + (chacha20_do_setkey): Select AVX2 implementation if there is HW + support. + (selftest): Increase size of buf by 256. + * configure.ac [host=3Dx86-64]: Add 'chacha20-avx2-amd64.lo'. + + chacha20: add SSSE3 assembly implementation. + + commit def7d4cad386271c6d4e2f10aabe0cb4abd871e4 + * cipher/Makefile.am: Add 'chacha20-ssse3-amd64.S'. + * cipher/chacha20-ssse3-amd64.S: New. + * cipher/chacha20.c (USE_SSSE3): New macro. + [USE_SSSE3] (_gcry_chacha20_amd64_ssse3_blocks): New. + (chacha20_do_setkey): Select SSSE3 implementation if there is HW + support. + * configure.ac [host=3Dx86-64]: Add 'chacha20-ssse3-amd64.lo'. + + Add ChaCha20 stream cipher. + + commit 23f33d57c9b6f2295a8ddfc9a8eee5a2c30cf406 + * cipher/Makefile.am: Add 'chacha20.c'. + * cipher/chacha20.c: New. + * cipher/cipher.c (cipher_list): Add ChaCha20. + * configure.ac: Add ChaCha20. + * doc/gcrypt.texi: Add ChaCha20. + * src/cipher.h (_gcry_cipher_spec_chacha20): New. + * src/gcrypt.h.in (GCRY_CIPHER_CHACHA20): Add new algo. + * tests/basic.c (MAX_DATA_LEN): Increase to 128 from 100. + (check_stream_cipher): Add ChaCha20 test-vectors. + (check_ciphers): Add ChaCha20. + +2014-05-09 Werner Koch + + mpi: Fix a subtle bug setting spurious bits with in mpi_set_bit. + + commit 246b7aaae1ee459f440260bbc4ec2c01c5dc3362 + * mpi/mpi-bit.c (_gcry_mpi_set_bit, _gcry_mpi_set_highbit): Clear + allocated but not used bits before resizing. + * tests/t-mpi-bits.c (set_bit_with_resize): New. + +2014-05-07 Werner Koch + + Bump LT version. + + commit fc6ff6f73a51bcbbbb3757dc1386da40aa3ae75d + * configure.ac: Bumb LT version to C21/A1/R0. + +2014-04-22 Werner Koch + + random: Small patch for consistency and really burn the stack. + + commit a79c4ad7c56ee4410f17beb73eeb58b0dd36bfc6 + * random/rndlinux.c (_gcry_rndlinux_gather_random): s/int/size_t/. + (_gcry_rndlinux_gather_random): Replace memset by wipememory. + +2014-04-16 Werner Koch + + pubkey: Re-map all depreccated RSA algo numbers. + + commit 773e23698218755e9172d2507031a8263c47cc0b + * cipher/pubkey.c (map_algo): Mape RSA_E and RSA_S. + +2014-04-15 Werner Koch + + cipher: Fix possible NULL dereference. + + commit ae1fbce6dacf14747af0126e640bd4e54cb8c680 + * cipher/md.c (_gcry_md_selftest): Check for spec being NULL. + +2014-03-30 Jussi Kivilinna + + 3des: add amd64 assembly implementation for 3DES. + + commit b76b632a453b8d100d024e2439b4358454dc286e + * cipher/Makefile.am: Add 'des-amd64.S'. + * cipher/cipher-selftests.c (_gcry_selftest_helper_cbc) + (_gcry_selftest_helper_cfb, _gcry_selftest_helper_ctr): Handle failures + from 'setkey' function. + * cipher/cipher.c (_gcry_cipher_open_internal) [USE_DES]: Setup bulk + functions for 3DES. + * cipher/des-amd64.S: New file. + * cipher/des.c (USE_AMD64_ASM, ATTR_ALIGNED_16): New macros. + [USE_AMD64_ASM] (_gcry_3des_amd64_crypt_block) + (_gcry_3des_amd64_ctr_enc), _gcry_3des_amd64_cbc_dec) + (_gcry_3des_amd64_cfb_dec): New prototypes. + [USE_AMD64_ASM] (tripledes_ecb_crypt): New function. + (TRIPLEDES_ECB_BURN_STACK): New macro. + (_gcry_3des_ctr_enc, _gcry_3des_cbc_dec, _gcry_3des_cfb_dec) + (bulk_selftest_setkey, selftest_ctr, selftest_cbc, selftest_cfb): New + functions. + (selftest): Add call to CTR, CBC and CFB selftest functions. + (do_tripledes_encrypt, do_tripledes_decrypt): Use + TRIPLEDES_ECB_BURN_STACK. + * configure.ac [host=3Dx86-64]: Add 'des-amd64.lo'. + * src/cipher.h (_gcry_3des_ctr_enc, _gcry_3des_cbc_dec) + (_gcry_3des_cfb_dec): New prototypes. + +2014-03-13 Werner Koch + + tests: Print diagnostics for skipped tests. + + commit 50aeee51a0b1a09dd9fff2bb71749a816fe7a791 + * tests/basic.c (show_note): New. + (show_md_not_available): + (show_old_hmac_not_available): + (show_mac_not_available): + (check_digests): Remove USE_foo cpp tests from the test table. Call + show_md_not_available if algo is not available. + (check_hmac): Likewise. + (check_mac): Likewise. + +2014-03-11 Dmitry Eremin-Solenikov + + Add MD2 message digest implementation. + + commit 5a8e1504bf8a2ffbc018be576dea77b685200444 + * cipher/md2.c: New. + * cipher/md.c (digest_list): add _gcry_digest_spec_md2. + * tests/basic.c (check_digests): add MD2 test vectors. + * configure.ac (default_digests): disable md2 by default. + +2014-03-04 Dmitry Eremin-Solenikov + + Add an utility to calculate hashes over a set of files. + + commit 2b5403c408dfbd71be24c7635f5fa0b61ab4c9bb + * tests/gchash.c: New. + + Add a simple (raw) PKCS#1 padding mode. + + commit ea8d597726305274214224757b32730644e12bd8 + * src/cipher.h (PUBKEY_ENC_PKCS1_RAW): New. + * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist): Handle pkcs1-raw + flag. + * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): + Handle s-exp like (data (flags pkcs1-raw) (value xxxxx)) + * cipher/rsa-common.c (_gcry_rsa_pkcs1_encode_raw_for_sig): + PKCS#1-encode data with embedded hash OID for signature verification. + * tests/basic.c (check_pubkey_sign): Add tests for s-exps with pkcs1-raw + flag. + +2014-02-04 Jussi Kivilinna + + Fix ARMv6 detection when CFLAGS modify target CPU architecture. + + commit 6be3032048ee2466511d2384fcf2d28b856219b2 + * configure.ac (gcry_cv_cc_arm_arch_is_v6): Use compiler test instead + of preprocessor test. + +2014-01-29 Werner Koch + + Reserve control code for FIPS extensions. + + commit aea96a64fbc58a0b6f9f435e97e93294c6eb1052 + * src/gcrypt.h.in (GCRYCTL_INACTIVATE_FIPS_FLAG): New. + (GCRYCTL_REACTIVATE_FIPS_FLAG): New. + * src/global.c (_gcry_vcontrol): Add them but return not_implemented. + +2014-01-29 NIIBE Yutaka + + Fix RSA Blinding. + + commit 121a90d8931944974054f7d94f63b7f89df87fa5 + * cipher/rsa.c (rsa_decrypt): Loop to get multiplicative inverse. + +2014-01-28 Werner Koch + + cipher: Take care of ENABLE_NEON_SUPPORT. + + commit 52f7c48c901a3de51bd690a218f3de2f71e8d790 + * cipher/salsa20.c (USE_ARM_NEON_ASM): Define only if + ENABLE_NEON_SUPPORT is defined. + * cipher/serpent.c (USE_NEON): Ditto. + * cipher/sha1.c (USE_NEON): Ditto. + * cipher/sha512.c (USE_ARM_NEON_ASM): Ditto. + + sexp: Fix broken gcry_sexp_nth. + + commit cbdc355415f83ed62da4f3618767eba54d7e6d37 + * src/sexp.c (_gcry_sexp_nth): Return a valid S-expression for a data + element. + (NODE): Remove unused typedef. + (ST_HINT): Comment unused macro. + + * tests/t-sexp.c (bug_1594): New. + (main): Run new test. + +2014-01-27 Werner Koch + + tests: Improve t-common.h. + + commit 7460e9243b3cc050631c37ed4f2713ae7bcb6762 + * tests/t-common.h: Add couple of macros. Check that config.h has + been included. + (show): Rename to info. + * tests/t-lock.c, tests/t-sexp.c: Adjust for changes. + + mpi: Minor fix for Atari-mint. + + commit 3caa0f1319dc4779e0d6eee4460c1af2a12b2c3c + * mpi/config.links [m68k-atari-mint]: Do not assume 68020. Suggested + by Alan Hourihane. + + (cherry picked from commit 420f42a5752e90a8b27d58ffa1ddfe6e4ab341e8) + +2014-01-27 Dmitry Eremin-Solenikov + + Fix most of memory leaks in tests code. + + commit 5c150ece094bf0a504a111ce6c7b72e8d0b0457a + * tests/basic.c (check_ccm_cipher): Close cipher after use. + * tests/basic.c (check_one_cipher): Correct length of used buffer. + * tests/benchmark.c (cipher_bench): Use xcalloc to make buffer + initialized. + * tests/keygen.c (check_ecc_keys): Release generated key. + * tests/t-mpi-point.c (context_param): Release mpi Q. + * tests/t-sexp.c (check_extract_param): Release extracted number. + + Fix memory leaks in ecc code. + + commit 6d87e6abdfb7552323a95401f14e6367398a3e5a + * cipher/ecc-curves.c (_gcry_ecc_update_curve_param): Release passed mpi + values. + * cipher/ecc.c (compute_keygrip): Fix potential memory leak in error + path. + * cipher/ecc.c (_gcry_ecc_get_curve): Release temporary mpi. + + Fix number of blocks passed used in _gcry_rmd160_mixblock. + + commit 5d23e7b9a77421f3ebfda4a84c459a8729f3bb41 + * cipher/rmd160.c (_gcry_rmd160_mixblock): pass 1 to transform + +2014-01-27 Werner Koch + + Small Windows build tweaks. + + commit f7df906171854b6b6506b82d4fee2c2ebb0327ea + * configure.ac (HAVE_PTHREAD): Do test when building for Windows. + + * tests/basic.c: Replace "%zi" by "%z" and a cast to make it work + under Windows. + + Update gpg-error autoconf macros to fix threading problems. + + commit 79da0358fd555361e1ce4202f55494a8918eb8ae + * m4/gpg-error.m4: Update to version 2014-01-24. + * tests/Makefile.am (t_lock_LDADD): Use MT Libs. + +2014-01-24 Dmitry Eremin-Solenikov + + tests: Pass -no-install to libtool. + + commit bf34bfa5c458ee5ece91f25e3b4194d768498ab6 + * tests/Makefile.am: add AM_LDFLAGS =3D -no-install + +2014-01-24 Werner Koch + + tests: Add a test for the internal locking. + + commit ff91ec934ed52294cddcd7dcfacc04721a0487bf + * src/global.c (external_lock_test): New. + (_gcry_vcontrol): Call new function with formerly reserved code 61. + + * tests/t-common.h: New. Taken from current libgpg-error. + * tests/t-lock.c: New. Based on t-lock.c from libgpg-error. + * configure.ac (HAVE_PTHREAD): Set macro to 1 if defined. + (AC_CHECK_FUNCS): Check for flockfile. + * tests/Makefile.am (tests_bin): Add t-lock. + (noinst_HEADERS): Add t-common.h + (LDADD): Move value to ... + (default_ldadd): new. + (t_lock_LDADD): New. + + Check compiler features only for the relevant platform. + + commit 24e65d715812cea28732397870cb1585b8435521 + * mpi/config.links (mpi_cpu_arch): Always set for ARM. Set for HPPA. + Set to "undefined" for unknown platforms. + (try_asm_modules): Act upon only after having detected the CPU. + * configure.ac: Move the call to config.links before the platform + specific compiler checks. Check platform specific features only if + the platform is targeted. + +2014-01-23 Werner Koch + + Support building using the latest mingw-w64 toolchain. + + commit 4ad3417acab5021db1f722c314314ce4b781833a + * acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): Change mingw detection. + +2014-01-20 Werner Koch + + cipher: Fix commit 94030e44. + + commit dad06e4d1b835bac778b87090b1d3894b7535b14 + * cipher/tiger.c (tiger_init): Add arg FLAGS. + (tiger1_init, tiger2_init): Ditto. + + tests: Rename tsexp.c. + + commit 192e77d123fdb04c459c998b9eb1731618a833fa + * tests/tsexp.c: Rename to t-sexp.c + +2014-01-19 Werner Koch + + md: Add Whirlpool bug emulation feature. + + commit 94030e44aaff805d754e368507f16dd51a531b72 + * src/gcrypt.h.in (GCRY_MD_FLAG_BUGEMU1): New. + * src/cipher-proto.h (gcry_md_init_t): Add arg FLAGS. Change all code + to implement that flag. + * cipher/md.c (gcry_md_context): Replace SECURE and FINALIZED by bit + field FLAGS. Add flag BUGEMU1. Change all users. + (md_open): Replace args SECURE and HMAC by FLAGS. Init flags.bugemu1. + (_gcry_md_open): Add for GCRY_MD_FLAG_BUGEMU1. + (md_enable): Pass bugemu1 flag to the hash init function. + (_gcry_md_reset): Ditto. + +2014-01-17 Werner Koch + + Actually check for uint64_t. + + commit c3b30bae7d1e157f8b65e32ba1b3a516f2bbf58b + * configure.ac: Check size of uint64_t and the UINT64_C macro. + +2014-01-16 Werner Koch + + Replace ath based mutexes by gpgrt based locks. + + commit cfc151ba637200e4fc05d9481a8df2071b2f9a47 + * configure.ac (NEED_GPG_ERROR_VERSION): Require 1.13. + (gl_LOCK): Remove. + * src/ath.c, src/ath.h: Remove. Remove from all files. Replace all + mutexes by gpgrt based statically initialized locks. + * src/global.c (global_init): Remove ath_init. + (_gcry_vcontrol): Make ath install a dummy function. + (print_config): Remove threads info line. + + * doc/gcrypt.texi: Simplify the multi-thread related documentation. + +2014-01-15 NIIBE Yutaka + + ecc: Fix _gcry_mpi_ec_p_new to allow secp256k1. + + commit 49edeebb43174865cf4fa2c170a42a8e4274c4f0 + * mpi/ec.c (_gcry_mpi_ec_p_new): Remove checking a!=3D0. + * tests/t-mpi-point.c (context_alloc): Remove two spurious tests. + +2014-01-14 Milan Broz + + PBKDF2: Use gcry_md_reset to speed up calculation. + + commit 04cda6b7cc16f3f52c12d9d3e46c56701003496e + * cipher/kdf.c (_gcry_kdf_pkdf2): Use gcry_md_reset + to speed up calculation. + +2014-01-13 Werner Koch + + Fix macro conflict in NetBSD. + + commit 5f2af6c26bc04975c0b518881532871d7387d7ce + * cipher/bithelp.h (bswap32): Rename to _gcry_bswap32. + (bswap64): Rename to _gcry_bswap64. + + Use internal malloc function in fips.c. + + commit 518ae274a1845ce626b2b4223a9b3805cbbab1a7 + * src/fips.c (check_binary_integrity): s/gcry_malloc/xtrymalloc/. + +2014-01-13 Dmitry Eremin-Solenikov + + Truncate hash values for ECDSA signature scheme. + + commit 9edcf1090e0485f9f383b6c54b18ea8ca3d4a225 + * cipher/dsa-common (_gcry_dsa_normalize_hash): New. Truncate opaque + mpis as required for DSA and ECDSA signature schemas. + * cipher/dsa.c (verify): Return gpg_err_code_t value from verify() to + behave like the rest of internal sign/verify functions. + * cipher/dsa.c (sign, verify, dsa_verify): Factor out hash truncation. + * cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_sign): Factor out hash truncation. + * cipher/ecc-ecdsa.c (_gcry_ecc_ecdsa_verify): + as required by ECDSA scheme, truncate hash values to bitlength of + used curve. + * tests/pubkey.c (check_ecc_sample_key): add a testcase for hash + truncation. + + Add GOST R 34.10-2012 curves proposed by TC26. + + commit 2c5ec803100ed8261e51442fb93b75367b7725ea + * cipher/ecc-curves.c (domain_parmss): Add two GOST R 34.10-2012 curves + proposed/pending to standardization by TC26 (Russian cryptography + technical comitee). + * cipher/ecc-curves.c (curve_alias): Add OID aliases. + * tests/curves.c: Increase N_CURVES. + + Add GOST R 34.10-2001 curves per RFC4357. + + commit 9bedc5c3b646dfe481678ca58f5466ac46decaf7 + * cipher/ecc-curves.c (domain_parms): Add 3 curves defined in rfc4357. + * cipher/ecc-curves.c (curve_aliases): Add OID and Xch aliases for GOST + curves. + * tests/curves.c (N_CURVES): Update value. + + Fix typo in search_oid. + + commit 7edcb574d8d6dffb6e234c2ba1996a9a04923859 + * cipher/md.c (search_oid): Invert condition on oid comparison. + + Add MD2-HMAC calculation support. + + commit 653b58cb5e85511b6c04c3f85ef3e372c2e9f74f + * src/gcrypt.h.in (GCRY_MAC_HMAC_MD2): New. + * cipher/mac-hmac.c: Support GCRY_MAC_HMAC_MD2. + + Add a function to retrieve algorithm used by MAC handler. + + commit 8439a379c86ef1088465ea70ac10840759a1638e + * cipher/mac.c (_gcry_mac_get_algo): New function, returns used algo. + * src/visibility.c (gcry_mac_get_algo): New wrapper. + * src/visibility.h: Hanlde gcry_mac_get_algo. + * src/gcrypt-int.h (_gcry_mac_get_algo): New. + * src/gcrypt.h.in (gcry_mac_get_algo): New. + * src/libgcrypt.def (gcry_mac_get_algo): New. + * src/libgcrypt.vers (gcry_mac_get_algo): New. + * doc/gcrypt.texi: Document gcry_mac_get_algo. + * tests/basic.c (check_one_mac): Verify gcry_mac_get_algo. + + Correct formatting of gcry_mac_get_algo_keylen documentation. + + commit 36c9e0e4eb4f935da90df1c8df484d1940bda5eb + * doc/gcrypt.texi: add braces near gcry_mac_get_algo_keylen + documentation. + + Use braces around unsigned int in gcry_mac_get_algo_keylen + documentation, otherwise texinfo breaks that and uses 'int' as a + function definition. + +2014-01-13 Werner Koch + + ecc: Make a macro shorter. + + commit 2ef48ba59c32bfa1a9265d5eea8ab225a658903a + * src/mpi.h (MPI_EC_TWISTEDEDWARDS): Rename to MPI_EC_EDWARDS. CHnage + all users. + * cipher/ecc-curves.c (domain_parms): Add parameters for Curve3617 as + comment. + * mpi/ec.c (dup_point_twistededwards): Rename to dup_point_edwards. + (add_points_twistededwards): Rename to add_points_edwards. + +2014-01-12 Jussi Kivilinna + + Fix assembly division check. + + commit ef3e66e168c4b9b86bfc4903001631e53a7125d8 + * configure.ac (gcry_cv_gcc_as_const_division_ok): Correct variable + name mismatch at '--Wa,--divide' workaround check. + +2014-01-12 NIIBE Yutaka + + Add secp256k1 curve. + + commit 019e0e9e8c77a2edf283745e05e9301673ea6a0a + * cipher/ecc-curves.c (curve_aliases): Add secp256k1 and its OID. + (domain_parms): Add secp256k1's domain paramerter. + + * tests/basic.c (check_pubkey): Add a key of secp256k1. + + * tests/curves.c (N_CURVES): Updated. + +2014-01-12 Jussi Kivilinna + + Fix constant division for AMD64 assembly on Solaris/x86. + + commit 43376891c01f4aff1fbfb23beafebb5adfd0868c + * configure.ac (gcry_cv_gcc_as_const_division_ok): Add new check for + constant division in assembly and test for "-Wa,--divide" workaround. + (gcry_cv_gcc_amd64_platform_as_ok): Check for also constant division. + +2014-01-10 Werner Koch + + Use the generic autogen.sh script. + + commit b0ac1f9b143aa15855914ba93fef900288d45c9c + * autogen.rc: New. + * Makefile.am (EXTRA_DIST): Add it. + * autogen.sh: Update from current GnuPG. + + Move all helper scripts to build-aux/ + + commit df9b4eabf52faee6f289a4bc62219684442ae383 + * scripts/: Rename to build-aux/. + * compile, config.guess, config.rpath, config.sub + * depcomp, doc/mdate-sh, doc/texinfo.tex + * install-sh, ltmain.sh, missing: Move to build-aux/. + * Makefile.am (EXTRA_DIST): Adjust. + * configure.ac (AC_CONFIG_AUX_DIR): New. + (AM_SILENT_RULES): New. + +2013-12-30 Jussi Kivilinna + + Add blowfish/serpent ARM assembly files to Makefile.am. + + commit 7fef7f481c0a1542be34d1dc831f58d41846ac29 + * cipher/Makefile.am: Add 'blowfish-arm.S' and 'serpent-armv7-neon.S'. + + Add AMD64 assembly implementation for arcfour. + + commit 7547898109c72a97e3102b2a045ee4fdb2aa40bf + * cipher/Makefile.am: Add 'arcfour-amd64.S'. + * cipher/arcfour-amd64.S: New. + * cipher/arcfour.c (USE_AMD64_ASM): New. + [USE_AMD64_ASM] (ARCFOUR_context, _gcry_arcfour_amd64) + (encrypt_stream): New. + * configure.ac [host=3Dx86_64]: Add 'arcfour-amd64.lo'. + + Parse /proc/cpuinfo for ARM HW features. + + commit a05be441d8cd89b90d8d58e3a343a436dae377d0 + * src/hwf-arm.c [__linux__] (HAS_PROC_CPUINFO) + (detect_arm_proc_cpuinfo): New. + (_gcry_hwf_detect_arm) [HAS_PROC_CPUINFO]: Check '/proc/cpuinfo' for + HW features. + + Fix buggy/incomplete detection of AVX/AVX2 support. + + commit bbcb12187afb1756cb27296166b57fa19ee45d4d + * configure.ac: Also check for 'xgetbv' instruction in AVX and AVX2 + inline assembly checks. + * src/hwf-x86.c [__i386__] (get_xgetbv): New function. + [__x86_64__] (get_xgetbv): New function. + [HAS_X86_CPUID] (detect_x86_gnuc): Check for OSXSAVE and OS support for + XMM&YMM registers and enable AVX/AVX2 only if XMM&YMM registers are + supported by OS. + +2013-12-18 Jussi Kivilinna + + Change utf-8 copyright characters to '(C)' + + commit b7e814f93ee40fcfe17a187a8989c07fde2ba0cd + cipher/blowfish-amd64.S: Change utf-8 encoded copyright character to + '(C)'. + cipher/blowfish-arm.S: Ditto. + cipher/bufhelp.h: Ditto. + cipher/camellia-aesni-avx-amd64.S: Ditto. + cipher/camellia-aesni-avx2-amd64.S: Ditto. + cipher/camellia-arm.S: Ditto. + cipher/cast5-amd64.S: Ditto. + cipher/cast5-arm.S: Ditto. + cipher/cipher-ccm.c: Ditto. + cipher/cipher-cmac.c: Ditto. + cipher/cipher-gcm.c: Ditto. + cipher/cipher-selftest.c: Ditto. + cipher/cipher-selftest.h: Ditto. + cipher/mac-cmac.c: Ditto. + cipher/mac-gmac.c: Ditto. + cipher/mac-hmac.c: Ditto. + cipher/mac-internal.h: Ditto. + cipher/mac.c: Ditto. + cipher/rijndael-amd64.S: Ditto. + cipher/rijndael-arm.S: Ditto. + cipher/salsa20-amd64.S: Ditto. + cipher/salsa20-armv7-neon.S: Ditto. + cipher/serpent-armv7-neon.S: Ditto. + cipher/serpent-avx2-amd64.S: Ditto. + cipher/serpent-sse2-amd64.S: Ditto. + + Add ARM/NEON implementation for SHA-1. + + commit fc7dcf616937afaf73cfda1bf7bd79566a96b130 + * cipher/Makefile.am: Add 'sha1-armv7-neon.S'. + * cipher/sha1-armv7-neon.S: New. + * cipher/sha1.c (USE_NEON): New. + (SHA1_CONTEXT, sha1_init) [USE_NEON]: Add and initialize 'use_neon'. + [USE_NEON] (_gcry_sha1_transform_armv7_neon): New. + (transform) [USE_NEON]: Use ARM/NEON assembly if enabled. + * configure.ac: Add 'sha1-armv7-neon.lo'. + + Improve performance of SHA-512/ARM/NEON implementation. + + commit df629ba53a662427ebd3ddca90c3fe9ddd6511d3 + * cipher/sha512-armv7-neon.S (RT01q, RT23q, RT45q, RT67q): New. + (round_0_63, round_64_79): Remove. + (rounds2_0_63, rounds2_64_79): New. + (_gcry_sha512_transform_armv7_neon): Add 'nblks' input; Handle multiple + input blocks; Use new round macros. + * cipher/sha512.c [USE_ARM_NEON_ASM] + (_gcry_sha512_transform_armv7_neon): Add 'num_blks'. + (transform) [USE_ARM_NEON_ASM]: Pass nblks to assembly. + + Add AVX and AVX2/BMI implementations for SHA-256. + + commit a5c2bbfe0db515d739ab683297903c77b1eec124 + * LICENSES: Add 'cipher/sha256-avx-amd64.S' and + 'cipher/sha256-avx2-bmi2-amd64.S'. + * cipher/Makefile.am: Add 'sha256-avx-amd64.S' and + 'sha256-avx2-bmi2-amd64.S'. + * cipher/sha256-avx-amd64.S: New. + * cipher/sha256-avx2-bmi2-amd64.S: New. + * cipher/sha256-ssse3-amd64.S: Use 'lea' instead of 'add' in few + places for tiny speed improvement. + * cipher/sha256.c (USE_AVX, USE_AVX2): New. + (SHA256_CONTEXT) [USE_AVX, USE_AVX2]: Add 'use_avx' and 'use_avx2'. + (sha256_init, sha224_init) [USE_AVX, USE_AVX2]: Initialize above + new context members. + [USE_AVX] (_gcry_sha256_transform_amd64_avx): New. + [USE_AVX2] (_gcry_sha256_transform_amd64_avx2): New. + (transform) [USE_AVX2]: Use AVX2 assembly if enabled. + (transform) [USE_AVX]: Use AVX assembly if enabled. + * configure.ac: Add 'sha256-avx-amd64.lo' and + 'sha256-avx2-bmi2-amd64.lo'. + +2013-12-17 Jussi Kivilinna + + Add AVX and AVX/BMI2 implementations for SHA-1. + + commit e4e458465b124e25b6aec7a60174bf1ca32dc5fd + * cipher/Makefile.am: Add 'sha1-avx-amd64.S' and + 'sha1-avx-bmi2-amd64.S'. + * cipher/sha1-avx-amd64.S: New. + * cipher/sha1-avx-bmi2-amd64.S: New. + * cipher/sha1.c (USE_AVX, USE_BMI2): New. + (SHA1_CONTEXT) [USE_AVX]: Add 'use_avx'. + (SHA1_CONTEXT) [USE_BMI2]: Add 'use_bmi2'. + (sha1_init): Initialize 'use_avx' and 'use_bmi2'. + [USE_AVX] (_gcry_sha1_transform_amd64_avx): New. + [USE_BMI2] (_gcry_sha1_transform_amd64_bmi2): New. + (transform) [USE_BMI2]: Use BMI2 assembly if enabled. + (transform) [USE_AVX]: Use AVX assembly if enabled. + * configure.ac: Add 'sha1-avx-amd64.lo' and 'sha1-avx-bmi2-amd64.lo'. + + SHA-1/SSSE3: Improve performance on large buffers. + + commit 6fd0dd2a5f1362f91e2861cd9d300341a43842a5 + * cipher/sha1-ssse3-amd64.S (RNBLKS): New. + (_gcry_sha1_transform_amd64_ssse3): Handle multiple input blocks, with + software pipelining of next data block processing. + * cipher/sha1.c [USE_SSSE3] (_gcry_sha1_transform_amd64_ssse3): Add + 'nblks'. + (transform) [USE_SSSE3]: Pass nblks to assembly function. + + Add bulk processing for hash transform functions. + + commit 50b8c8342d023038a4b528af83153293dd2756ea + * cipher/hash-common.c (_gcry_md_block_write): Preload 'hd->blocksize' + to stack, pass number of blocks to 'hd->bwrite'. + * cipher/hash-common.c (_gcry_md_block_write_t): Add 'nblks'. + * cipher/gostr3411-94.c: Rename 'transform' function to + 'transform_blk', add new 'transform' function with 'nblks' as + additional input. + * cipher/md4.c: Ditto. + * cipher/md5.c: Ditto. + * cipher/md4.c: Ditto. + * cipher/rmd160.c: Ditto. + * cipher/sha1.c: Ditto. + * cipher/sha256.c: Ditto. + * cipher/sha512.c: Ditto. + * cipher/stribog.c: Ditto. + * cipher/tiger.c: Ditto. + * cipher/whirlpool.c: Ditto. + +2013-12-16 Werner Koch + + Release 1.6.0. + + commit 0ea9731e1c93a962f6266004ab0e7418c19d6277 + + + doc: Change yat2m to allow arbitrary condition names. + + commit 9a912f8c4f366c53f1cdb94513b67b937e87178b + * doc/yat2m.c (MAX_CONDITION_NESTING): New. + (gpgone_defined): Remove. + (condition_s, condition_stack, condition_stack_idx): New. + (cond_is_active, cond_in_verbatim): New. + (add_predefined_macro, set_macro, macro_set_p): New. + (evaluate_conditions, push_condition, pop_condition): New. + (parse_file): Rewrite to use the condition stack. + (top_parse_file): Set prefined macros. + (main): Change -D to define arbitrary macros. + + tests: Add SHA-512 to the long hash test. + + commit 0d3bd23d7f730b9bbc81fc8da8d99f4853c36020 + * tests/hashtest.c (testvectors): Add vectors for 256GiB SHA-512. + * tests/hashtest-256g.in (algos): Add test for SHA-512. + + Add configure option --enable-large-data-tests. + + commit a6b9304a889397ac98e1c2c4ac3e178669d94492 + * configure.ac: Add option --enable-large-data-tests. + * tests/hashtest-256g.in: New. + * tests/Makefile.am (EXTRA_DIST): Add hashtest-256g.in. + (TESTS): Split up into tests_bin, tests_bin_last, tests_sh, and + tests_sh_last. + (tests_sh_last): Add hashtest-256g + (noinst_PROGRAMS): Add only tests_bin and tests_bin_last. + (bench-slope.log, hashtest-256g.log): New rules to enforce serial run. + + random: Call random progress handler more often. + + commit 5a7ce59396fe56f0d681df314bfbdb5f7732d4b1 + * random/rndlinux.c (_gcry_rndlinux_gather_random): Update progress + indicator earlier. + + cipher: Normalize the MPIs used as input to secret key functions. + + commit dec048b2ec79271a2f4405be5b87b1e768b3f1a9 + * cipher/dsa.c (sign): Normalize INPUT. + * cipher/elgamal.c (decrypt): Normalize A and B. + * cipher/rsa.c (secret): Normalize the INPUT. + (rsa_decrypt): Reduce DATA before passing to secret. + +2013-12-16 Jussi Kivilinna + + Change dummy variable in mpih-div.c to mpi_limb_t type. + + commit 953535a7de68cf62b5b1ad6f96ea3a9edd83762c + * mpi/mpih-div.c (_gcry_mpih_mod_1, _gcry_mpih_divmod_1): Change dummy + variable to 'mpi_limb_t' type from 'int'. + + Remove duplicate gcry_mac_hd_t typedef. + + commit 5c31990214b58c4e17edb01fbbe6d9f573975a22 + * cipher/mac-internal.h (gcry_mac_hd_t): Remove. + +2013-12-15 Jussi Kivilinna + + Use u64 for CCM data lengths. + + commit 110fed2d6b0bbc97cb5cc0a3a564e05fc42afa2d + * cipher/cipher-ccm.c: Move code inside [HAVE_U64_TYPEDEF]. + [HAVE_U64_TYPEDEF] (_gcry_cipher_ccm_set_lengths): Use 'u64' for + data lengths. + [!HAVE_U64_TYPEDEF] (_gcry_cipher_ccm_encrypt) + (_gcry_cipher_ccm_decrypt, _gcry_cipher_ccm_set_nonce) + (_gcry_cipher_ccm_authenticate, _gcry_cipher_ccm_get_tag) + (_gcry_cipher_ccm_check_tag): Dummy functions returning + GPG_ERROR_NOT_SUPPORTED. + * cipher/cipher-internal.h (gcry_cipher_handle.u_mode.ccm) + (_gcry_cipher_ccm_set_lengths): Move inside [HAVE_U64_TYPEDEF] and use + u64 instead of size_t for CCM data lengths. + * cipher/cipher.c (_gcry_cipher_open_internal, cipher_reset) + (_gcry_cipher_ctl) [!HAVE_U64_TYPEDEF]: Return GPG_ERR_NOT_SUPPORTED + for CCM. + (_gcry_cipher_ctl) [HAVE_U64_TYPEDEF]: Use u64 for + GCRYCTL_SET_CCM_LENGTHS length parameters. + * tests/basic.c: Do not use CCM if !HAVE_U64_TYPEDEF. + * tests/bench-slope.c: Ditto. + * tests/benchmark.c: Ditto. + +2013-12-14 Werner Koch + + tests: Prevent rare failure of gcry_pk_decrypt test. + + commit bfb43a17d8db571fca4ed433ee8be5c366745844 + * tests/basic.c (check_pubkey_crypt): Add special mode 1. + (main): Add option --loop. + +2013-12-14 Jussi Kivilinna + + Minor fixes to SHA assembly implementations. + + commit ffd9b2aa5abda7f4d7790ed48116ed5d71ab9995 + * cipher/Makefile.am: Correct 'sha256-avx*.S' to 'sha512-avx*.S'. + * cipher/sha1-ssse3-amd64.S: First line, correct filename. + * cipher/sha256-ssse3-amd64.S: Return correct stack burn depth. + * cipher/sha512-avx-amd64.S: Use 'vzeroall' to clear registers. + * cipher/sha512-avx2-bmi2-amd64.S: Ditto and return correct stack burn + depth. + + SHA-1/SSSE3: Do not check for Intel syntax assembly support. + + commit c86c35534a153b13e880d0bb0ea3e48e1c0ecaf9 + * cipher/sha1-ssse3-amd64.S: Remove check for + HAVE_INTEL_SYNTAX_PLATFORM_AS. + * cipher/sha1.c [USE_SSSE3]: Ditto. + +2013-12-13 Jussi Kivilinna + + Convert SHA-1 SSSE3 implementation from mixed asm&C to pure asm. + + commit d2b853246c2ed056a92096d89c3ca057e45c9c92 + * cipher/Makefile.am: Change 'sha1-ssse3-amd64.c' to + 'sha1-ssse3-amd64.S'. + * cipher/sha1-ssse3-amd64.c: Remove. + * cipher/sha1-ssse3-amd64.S: New. + + SHA-1: Add SSSE3 implementation. + + commit be2238f68abcc6f2b4e8c38ad9141376ce622a22 + * cipher/Makefile.am: Add 'sha1-ssse3-amd64.c'. + * cipher/sha1-ssse3-amd64.c: New. + * cipher/sha1.c (USE_SSSE3): New. + (SHA1_CONTEXT) [USE_SSSE3]: Add 'use_ssse3'. + (sha1_init) [USE_SSSE3]: Initialize 'use_ssse3'. + (transform): Rename to... + (_transform): this. + (transform): New. + * configure.ac [host=3Dx86_64]: Add 'sha1-ssse3-amd64.lo'. + + Add missing register clearing in to SHA-256 and SHA-512 assembly. + + commit 04615cc6803cdede25fa92e3ff697e252a23cd7a + * cipher/sha256-ssse3-amd64.S: Clear used XMM/YMM registers at return. + * cipher/sha512-avx-amd64.S: Ditto. + * cipher/sha512-avx2-bmi2-amd64.S: Ditto. + * cipher/sha512-ssse3-amd64.S: Ditto. + +2013-12-13 Werner Koch + + Update license information. + + commit 764643a3d5634bcbc47790bd8505f6a1a5280d9c + * LICENSES: New. + * Makefile.am (EXTRA_DIST): Add LICENSES. + * AUTHORS: Add list of copyright holders. + * README: Reference AUTHORS. + +2013-12-13 Jussi Kivilinna + + Fix empty clobber in AVX2 assembly check. + + commit e41d605ee41469e8a33cdc4d38f742cfb931f835 + * configure.ac (gcry_cv_gcc_inline_asm_avx2): Add "cc" as assembly + globber. + + Fix W32 build. + + commit a71b810ddd67ca3a1773d8f929d162551abb58eb + * random/rndw32.c (register_poll, slow_gatherer): Change gcry_xmalloc to + xmalloc, and gcry_xrealloc to xrealloc. + +2013-12-12 Jussi Kivilinna + + SHA-512: Add AVX and AVX2 implementations for x86-64. + + commit 2e4253dc8eb512cd0e807360926dc6ba912c95b4 + * cipher/Makefile.am: Add 'sha512-avx-amd64.S' and + 'sha512-avx2-bmi2-amd64.S'. + * cipher/sha512-avx-amd64.S: New. + * cipher/sha512-avx2-bmi2-amd64.S: New. + * cipher/sha512.c (USE_AVX, USE_AVX2): New. + (SHA512_CONTEXT) [USE_AVX]: Add 'use_avx'. + (SHA512_CONTEXT) [USE_AVX2]: Add 'use_avx2'. + (sha512_init, sha384_init) [USE_AVX]: Initialize 'use_avx'. + (sha512_init, sha384_init) [USE_AVX2]: Initialize 'use_avx2'. + [USE_AVX] (_gcry_sha512_transform_amd64_avx): New. + [USE_AVX2] (_gcry_sha512_transform_amd64_avx2): New. + (transform) [USE_AVX2]: Add call for AVX2 implementation. + (transform) [USE_AVX]: Add call for AVX implementation. + * configure.ac (HAVE_GCC_INLINE_ASM_BMI2): New check. + (sha512): Add 'sha512-avx-amd64.lo' and 'sha512-avx2-bmi2-amd64.lo'. + * doc/gcrypt.texi: Document 'intel-cpu' and 'intel-bmi2'. + * src/g10lib.h (HWF_INTEL_CPU, HWF_INTEL_BMI2): New. + * src/hwfeatures.c (hwflist): Add "intel-cpu" and "intel-bmi2". + * src/hwf-x86.c (detect_x86_gnuc): Check for HWF_INTEL_CPU and + HWF_INTEL_BMI2. + + SHA-512: Add SSSE3 implementation for x86-64. + + commit 69a6d0f9562fcd26112a589318c13de66ce1700e + * cipher/Makefile.am: Add 'sha512-ssse3-amd64.S'. + * cipher/sha512-ssse3-amd64.S: New. + * cipher/sha512.c (USE_SSSE3): New. + (SHA512_CONTEXT) [USE_SSSE3]: Add 'use_ssse3'. + (sha512_init, sha384_init) [USE_SSSE3]: Initialize 'use_ssse3'. + [USE_SSSE3] (_gcry_sha512_transform_amd64_ssse3): New. + (transform) [USE_SSSE3]: Call SSSE3 implementation. + * configure.ac (sha512): Add 'sha512-ssse3-amd64.lo'. + + SHA-256: Add SSSE3 implementation for x86-64. + + commit e1a3931263e67aacec3c0bfcaa86c7d1441d5c6a + * cipher/Makefile.am: Add 'sha256-ssse3-amd64.S'. + * cipher/sha256-ssse3-amd64.S: New. + * cipher/sha256.c (USE_SSSE3): New. + (SHA256_CONTEXT) [USE_SSSE3]: Add 'use_ssse3'. + (sha256_init, sha224_init) [USE_SSSE3]: Initialize 'use_ssse3'. + (transform): Rename to... + (_transform): This. + [USE_SSSE3] (_gcry_sha256_transform_amd64_ssse3): New. + (transform): New. + * configure.ac (HAVE_INTEL_SYNTAX_PLATFORM_AS): New check. + (sha256): Add 'sha256-ssse3-amd64.lo'. + * doc/gcrypt.texi: Document 'intel-ssse3'. + * src/g10lib.h (HWF_INTEL_SSSE3): New. + * src/hwfeatures.c (hwflist): Add "intel-ssse3". + * src/hwf-x86.c (detect_x86_gnuc): Test for SSSE3. + +2013-12-12 Werner Koch + + Add a configuration file to disable hardware features. + + commit 5e1239b1e2948211ff2675f45cce2b28c3379cfb + * src/hwfeatures.c: Inclyde syslog.h and ctype.h. + (HWF_DENY_FILE): New. + (my_isascii): New. + (parse_hwf_deny_file): New. + (_gcry_detect_hw_features): Call it. + + * src/mpicalc.c (main): Correctly initialize Libgcrypt. Add options + "--print-config" and "--disable-hwf". + + Move list of hardware features to hwfeatures.c. + + commit 4ae77322b681a13da62d01274bcab25be2af12d0 + * src/global.c (hwflist, disabled_hw_features): Move to .. + * src/hwfeatures.c: here. + (_gcry_disable_hw_feature): New. + (_gcry_enum_hw_features): New. + (_gcry_detect_hw_features): Remove arg DISABLED_FEATURES. + * src/global.c (print_config, _gcry_vcontrol, global_init): Adjust + accordingly. + + Remove macro hacks for internal vs. external functions. Part 2 and last. + + commit 3b30e9840d4b351c4de73b126e561154cb7df4cc + * src/visibility.h: Remove remaining define/undef hacks for symbol + visibility. Add macros to detect the use of the public functions. + Change all affected functions by replacing them by the x-macros. + * src/g10lib.h: Add internal prototypes. + (xtrymalloc, xtrycalloc, xtrymalloc_secure, xtrycalloc_secure) + (xtryrealloc, xtrystrdup, xmalloc, xcalloc, xmalloc_secure) + (xcalloc_secure, xrealloc, xstrdup, xfree): New macros. + +2013-12-11 Werner Koch + + random: Add a feature to close device file descriptors. + + commit cd548ba2dc777b8b27d8d33182ba733c20222120 + * src/gcrypt.h.in (GCRYCTL_CLOSE_RANDOM_DEVICE): New. + * src/global.c (_gcry_vcontrol): Call _gcry_random_close_fds. + * random/random.c (_gcry_random_close_fds): New. + * random/random-csprng.c (_gcry_rngcsprng_close_fds): New. + * random/random-fips.c (_gcry_rngfips_close_fds): New. + * random/random-system.c (_gcry_rngsystem_close_fds): New. + * random/rndlinux.c (open_device): Add arg retry. + (_gcry_rndlinux_gather_random): Add mode to close open fds. + + * tests/random.c (check_close_random_device): New. + (main): Call new test. + +2013-12-10 Werner Koch + + Fix last commit (9a37470c) + + commit eae1e7712e1b687bd77eb37d0eb505fc9d46d93c + * src/secmem.c (lock_pool): Remove remaining line. Reported by Ian + Goldberg. + +2013-12-09 Werner Koch + + Fix one-off memory leak when build with Linux capability support. + + commit 9a37470c50ee9966cb2652617a404ddd54a9c096 + * src/secmem.c (lock_pool, secmem_init): Use cap_free. Reported by + Mike Crowe . + +2013-12-09 David 'Digit' Turner + + Update libtool to support Android. + + commit 2516f0b660b1a7181ad38c44310c627f4f498595 + * m4/libtool.m4: Add "linux*android*" case. Taken from the libtool + repository. + +2013-12-09 Werner Koch + + tests: Speed up benchmarks in regression test mode. + + commit 2e5354fe8db5288939733d0fb63ad4c87bc20105 + * tests/tsexp.c (check_extract_param): Fix compiler warning. + * tests/Makefile.am (TESTS_ENVIRONMENT): Set GCRYPT_IN_REGRESSION_TEST. + * tests/bench-slope.c (main): Speed up if in regression test mode. + * tests/benchmark.c (main): Ditto. + + tests: Add --csv option to bench-slope. + + commit 8072e9fa4b42ae8e65e266aa158fd903f1bb0927 + * tests/bench-slope.c (STR, STR2): New. + (cvs_mode): New. + (num_measurement_repetitions): New. Replace use of + NUM_MEASUREMENT_REPETITIONS by this. + (current_section_name, current_algo_name, current_mode_name): New. + (bench_print_result_csv): New. + (bench_print_result_std): Rename from bench_print_result. + (bench_print_result): New. Divert depending on CSV_MODE. + (bench_print_header, bench_print_footer): take care of CSV_MODE. + (bench_print_algo, bench_print_mode): New. Use them instead of + explicit printfs. + (main): Add options --csv and --repetitions. + +2013-12-07 Werner Koch + + sexp: Allow long names and white space in gcry_sexp_extract_param. + + commit d4555433b6e422fa69a85cae99961f513e55d82b + * src/sexp.c (_gcry_sexp_vextract_param): Skip white space. Support + long parameter names. + * tests/tsexp.c (check_extract_param): Add test cases for long parameter + names and white space. + +2013-12-06 Werner Koch + + ecc: Merge partly duplicated code. + + commit 405021cb6d4e470337302c65dec5bc91491a89c1 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_sign): Factor A hashing out to ... + (_gcry_ecc_eddsa_compute_h_d): new function. + * cipher/ecc-misc.c (_gcry_ecc_compute_public): Use new function. + (reverse_buffer): Remove. + + ecc: Remove unused internal function. + + commit 4cf2c65fe15173c8d68a141a01b34fc1fb9080b7 + * src/cipher-proto.h (gcry_pk_spec): Remove get_param. + * cipher/ecc-curves.c (_gcry_ecc_get_param_sexp): Merge in code from + _gcry_ecc_get_param. + (_gcry_ecc_get_param): Remove. + * cipher/ecc.c (_gcry_pubkey_spec_ecc): Remove _gcry_ecc_get_param. + +2013-12-06 Jussi Kivilinna + + Fix building on mingw32. + + commit 5917ce34e3b3eac4c15f62577e4723974024f818 + * src/gcrypt-int.h: Include . + +2013-12-05 Werner Koch + + ecc: Change OID for Ed25519. + + commit 7ef43d1eebb4f8226e860982dfe5fa2e2c82ad0f + * cipher/ecc-curves.c (curve_aliased): Add more suitable OID for + Ed25519. + + Remove macro hacks for internal vs. external functions. Part 1. + + commit 7bacf1812b55fa78db63abaa1f5a9220e9c6cccc + * src/visibility.h: Remove almost all define/undef hacks for symbol + visibility. Add macros to detect the use of the public functions. + Change all affected functions by prefixing them explicitly with an + underscore and change all internal callers to call the underscore + prefixed versions. Provide convenience macros from sexp and mpi + functions. + * src/visibility.c: Change all functions to use only gpg_err_code_t + and translate to gpg_error_t only in visibility.c. + +2013-12-04 Jussi Kivilinna + + mpi: add inline assembly for x86-64. + + commit 85bb0a98ea5add0296cbcc415d557eaa1f6bd294 + * mpi/longlong.h [__x86_64] (add_ssaaaa, sub_ddmmss, umul_ppmm) + (udiv_qrnnd, count_leading_zeros, count_trailing_zeros): New. + +2013-12-04 NIIBE Yutaka + + mpi: fix gcry_mpi_powm for negative base. + + commit c56080c26186d25dec05f01831494c77d8d07e13 + * mpi/mpi-pow.c (gcry_mpi_powm) [USE_ALGORITHM_SIMPLE_EXPONENTIATION]: + Fix for the case where BASE is negative. + * tests/mpitests.c (test_powm): Add a test case of (-17)^6 mod 19. + +2013-12-03 Werner Koch + + Add build support for ppc64le. + + commit 2ff86db2e1b0f6cc22a1ca86037b526c5fa3be51 + * config.guess, config.sub: Update to latest version (2013-11-29). + * m4/libtool.m4: Add patches for ppc64le. + +2013-12-03 Jussi Kivilinna + + rijndael: fix compiler warning on aarch64. + + commit 59b1a1b7ee2923e1bf091071ae716d180c6c6006 + * cipher/rijndael.c (do_setkey): Use braces for empty if statement + instead of semicolon. + + Add aarch64 (arm64) mpi assembly. + + commit 80896bc8f5e6ed9a627374e34f040ad5f3617584 + * mpi/aarch64/mpi-asm-defs.h: New. + * mpi/aarch64/mpih-add1.S: New. + * mpi/aarch64/mpih-mul1.S: New. + * mpi/aarch64/mpih-mul2.S: New. + * mpi/aarch64/mpih-mul3.S: New. + * mpi/aarch64/mpih-sub1.S: New. + * mpi/config.links [host=3Daarch64-*-*]: Add configguration for aarch64 + assembly. + * mpi/longlong.h [__aarch64__] (add_ssaaaa, sub_ddmmss, umul_ppmm) + (count_leading_zeros): New. + +2013-12-02 Werner Koch + + ecc: Use constant time point operation for Twisted Edwards. + + commit d4ce0cfe0d35d7ec69c115456848b5b735c928ea + * mpi/ec.c (_gcry_mpi_ec_mul_point): Try to do a constant time + operation if needed. + * tests/benchmark.c (main): Add option --use-secmem. + + ecc: Make gcry_pk_testkey work for Ed25519. + + commit 14ae6224b1b17abbfc80c26ad0f4c60f1e8635e2 + * cipher/ecc-misc.c (_gcry_ecc_compute_public): Add optional args G + and d. Change all callers. + * cipher/ecc.c (gen_y_2): Remove. + (check_secret_key): Use generic public key compute function. Adjust + for use with Ed25519 and EdDSA. + (nist_generate_key): Do not use the compliant key thingy for Ed25519. + (ecc_check_secret_key): Make parameter parsing similar to the other + functions. + * cipher/ecc-curves.c (domain_parms): Zero prefix some parameters so + that _gcry_ecc_update_curve_param works correctly. + * tests/keygen.c (check_ecc_keys): Add "param" flag. Check all + Ed25519 keys. + + ecc: Fix eddsa point decompression. + + commit 485f35124b1a74af0bad321ed70be3a79d8d11d7 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_recover_x): Fix the negative + case. + + ecc: Fix gcry_mpi_ec_curve_point for Weierstrass. + + commit ecb90f8e7c6f2516080d27ed7da6a25f2314da3c + * mpi/ec.c (_gcry_mpi_ec_curve_point): Use correct equation. + (ec_pow3): New. + (ec_p_init): Always copy B. + + mpi: Introduce 4 user flags for gcry_mpi_t. + + commit 29eddc2558d4cf39995f66d5fccd62f584d5b203 + * src/gcrypt.h.in (GCRYMPI_FLAG_USER1, GCRYMPI_FLAG_USER2) + (GCRYMPI_FLAG_USER3, GCRYMPI_FLAG_USER4): New. + * mpi/mpiutil.c (gcry_mpi_set_flag, gcry_mpi_clear_flag) + (gcry_mpi_get_flag, _gcry_mpi_free): Implement them. + (gcry_mpi_set_opaque): Keep user flags. + +2013-11-29 Vladimir '=CF=86-coder/phcoder' Serbinenko + + Fix armv3 compile error. + + commit 3b1cc9e6c357574f54160298d731c18f3d717b6c + * mpi/longlong.h [__arm__ && __ARM_ARCH < 4] (umul_ppmm): Use + __AND_CLOBBER_CC instead of __CLOBBER_CC. + + longlong.h on mips with clang. + + commit 1ecbd0bca31d462719a2a6590c1d03244e76ef89 + * mpi/longlong.h [__mips__]: Use C-language version with clang. + +2013-11-24 Jussi Kivilinna + + Camellia: Tweaks for AES-NI implementations. + + commit 3ef21e7e1b8003db9792155044db95f9d9ced184 + * cipher/camellia-aesni-avx-amd64.S: Align stack to 16 bytes; tweak + key-setup for small speed up. + * cipher/camellia-aesni-avx2-amd64.S: Use vmovdqu even with aligned + stack; reorder vinsert128 instructions; use rbp for stack frame. + +2013-11-21 Jussi Kivilinna + + Add GMAC to MAC API. + + commit a34448c929b13bfb7b66d69169c89e7319a18b31 + * cipher/Makefile.am: Add 'mac-gmac.c'. + * cipher/mac-gmac.c: New. + * cipher/mac-internal.h (gcry_mac_handle): Add 'u.gcm'. + (_gcry_mac_type_spec_gmac_aes, _gcry_mac_type_spec_gmac_twofish) + (_gcry_mac_type_spec_gmac_serpent, _gcry_mac_type_spec_gmac_seed) + (_gcry_mac_type_spec_gmac_camellia): New externs. + * cipher/mac.c (mac_list): Add GMAC specifications. + * doc/gcrypt.texi: Add mention of GMAC. + * src/gcrypt.h.in (gcry_mac_algos): Add GCM algorithms. + * tests/basic.c (check_one_mac): Add support for MAC IVs. + (check_mac): Add support for MAC IVs and add GMAC test vectors. + * tests/bench-slope.c (mac_bench): Iterate algorithm numbers to 499. + * tests/benchmark.c (mac_bench): Iterate algorithm numbers to 499. + + GCM: Move gcm_table initialization to setkey. + + commit dbfa651618693da7ea73b4d2d00d4efd411bfb46 + * cipher/cipher-gcm.c: Change all 'c->u_iv.iv' to + 'c->u_mode.gcm.u_ghash_key.key'. + (_gcry_cipher_gcm_setkey): New. + (_gcry_cipher_gcm_initiv): Move ghash initialization to function above. + * cipher/cipher-internal.h (gcry_cipher_handle): Add + 'u_mode.gcm.u_ghash_key'; Reorder 'u_mode.gcm' members for partial + clearing in gcry_cipher_reset. + (_gcry_cipher_gcm_setkey): New prototype. + * cipher/cipher.c (cipher_setkey): Add GCM setkey. + (cipher_reset): Clear 'u_mode' only partially for GCM. + +2013-11-20 Jussi Kivilinna + + GCM: Add support for split data buffers and online operation. + + commit fb1e52e3fe231671de546eacd6becd31c26c4f7b + * cipher/cipher-gcm.c (do_ghash_buf): Add buffering for less than + blocksize length input and padding handling. + (_gcry_cipher_gcm_encrypt, _gcry_cipher_gcm_decrypt): Add handling + for AAD padding and check if data has already being padded. + (_gcry_cipher_gcm_authenticate): Check that AAD or data has not being + padded yet. + (_gcry_cipher_gcm_initiv): Clear padding marks. + (_gcry_cipher_gcm_tag): Add finalization and padding; Clear sensitive + data from cipher handle, since they are not used after generating tag. + * cipher/cipher-internal.h (gcry_cipher_handle): Add 'u_mode.gcm.macbuf', + 'u_mode.gcm.mac_unused', 'u_mode.gcm.ghash_data_finalized' and + 'u_mode.gcm.ghash_aad_finalized'. + * tests/basic.c (check_gcm_cipher): Rename to... + (_check_gcm_cipher): ...this and add handling for different buffer step + lengths; Enable per byte buffer testing. + (check_gcm_cipher): Call _check_gcm_cipher with different buffer step + sizes. + + GCM: Use size_t for buffer sizes. + + commit 2d870a9142e8c8b3f008e1ad8e83e4bdf7a8e4e7 + * cipher/cipher-gcm.c (ghash, gcm_bytecounter_add, do_ghash_buf) + (_gcry_cipher_gcm_encrypt, _gcry_cipher_gcm_decrypt) + (_gcry_cipher_gcm_authenticate, _gcry_cipher_gcm_geniv) + (_gcry_cipher_gcm_tag): Use size_t for buffer lengths. + * cipher/cipher-internal.h (_gcry_cipher_gcm_encrypt) + (_gcry_cipher_gcm_decrypt, _gcry_cipher_gcm_authenticate): Use size_t + for buffer lengths. + + GCM: add FIPS mode restrictions. + + commit 56d352d6bdcf7abaa33c3399741f5063e2ddc32a + * cipher/cipher-gcm.c (_gcry_cipher_gcm_encrypt) + (_gcry_cipher_gcm_get_tag): Do not allow using in FIPS mode is setiv + was invocated directly. + (_gcry_cipher_gcm_setiv): Rename to... + (_gcry_cipher_gcm_initiv): ...this. + (_gcry_cipher_gcm_setiv): New setiv function with check for FIPS mode. + [TODO] (_gcry_cipher_gcm_getiv): New. + * cipher/cipher-internal.h (gcry_cipher_handle): Add + 'u_mode.gcm.disallow_encryption_because_of_setiv_in_fips_mode'. + + GCM: Add clearing and checking of marks.tag. + + commit 32a2da9abc91394b23cf565c1c833fa964394083 + * cipher/cipher-gcm.c (_gcry_cipher_gcm_encrypt) + (_gcry_cipher_gcm_decrypt, _gcry_cipher_gcm_authenticate): Make sure + that tag has not been finalized yet. + (_gcry_cipher_gcm_setiv): Clear 'marks.tag'. + + GCM: Add stack burning. + + commit 018f08354b1b116672e82f9ce942884b288aaf9e + * cipher/cipher-gcm.c (do_ghash, ghash): Return stack burn depth. + (setupM): Wipe 'tmp' buffer. + (do_ghash_buf): Wipe 'tmp' buffer and add stack burning. + + Add aggregated bulk processing for GCM on x86-64. + + commit c9537fbf8ff0af919cff2bebadc4c6e7caea8076 + * cipher/cipher-gcm.c [__x86_64__] (gfmul_pclmul_aggr4): New. + (ghash) [GCM_USE_INTEL_PCLMUL]: Add aggregated bulk processing + for __x86_64__. + (setupM) [__x86_64__]: Add initialization for aggregated bulk + processing. + + GCM: Tweak Intel PCLMUL ghash loop for small speed-up. + + commit 9b6764944284fed733c2f88619b3d9eb5d5c259a + * cipher/cipher-gcm.c (do_ghash): Mark 'inline'. + [GCM_USE_INTEL_PCLMUL] (do_ghash_pclmul): Rename to... + [GCM_USE_INTEL_PCLMUL] (gfmul_pclmul): ..this and make inline function. + (ghash) [GCM_USE_INTEL_PCLMUL]: Preload data before ghash-pclmul loop. + + GCM: Use counter mode code for speed-up. + + commit bd4bd23a2511a4bce63c3217cca0d4ecf0c79532 + * cipher/cipher-gcm.c (ghash): Add process for multiple blocks. + (gcm_bytecounter_add, gcm_add32_be128, gcm_check_datalen) + (gcm_check_aadlen_or_ivlen, do_ghash_buf): New functions. + (_gcry_cipher_gcm_encrypt, _gcry_cipher_gcm_decrypt) + (_gcry_cipher_gcm_authenticate, _gcry_cipher_gcm_set_iv) + (_gcry_cipher_gcm_tag): Adjust to use above new functions and + counter mode functions for encryption/decryption. + * cipher/cipher-internal.h (gcry_cipher_handle): Remove 'length'; Add + 'u_mode.gcm.(addlen|datalen|tagiv|datalen_over_limits)'. + (_gcry_cipher_gcm_setiv): Return gcry_err_code_t. + * cipher/cipher.c (cipher_setiv): Return error code. + (_gcry_cipher_setiv): Handle error code from 'cipher_setiv'. + + Add Intel PCLMUL acceleration for GCM. + + commit 5a65ffabadd50f174ab7375faad7a726cce49e61 + * cipher/cipher-gcm.c (fillM): Rename... + (do_fillM): ...to this. + (ghash): Remove. + (fillM): New macro. + (GHASH): Use 'do_ghash' instead of 'ghash'. + [GCM_USE_INTEL_PCLMUL] (do_ghash_pclmul): New. + (ghash): New. + (setupM): New. + (_gcry_cipher_gcm_encrypt, _gcry_cipher_gcm_decrypt) + (_gcry_cipher_gcm_authenticate, _gcry_cipher_gcm_setiv) + (_gcry_cipher_gcm_tag): Use 'ghash' instead of 'GHASH' and + 'c->u_mode.gcm.u_tag.tag' instead of 'c->u_tag.tag'. + * cipher/cipher-internal.h (GCM_USE_INTEL_PCLMUL): New. + (gcry_cipher_handle): Move 'u_tag' and 'gcm_table' under + 'u_mode.gcm'. + * configure.ac (pclmulsupport, gcry_cv_gcc_inline_asm_pclmul): New. + * src/g10lib.h (HWF_INTEL_PCLMUL): New. + * src/global.c: Add "intel-pclmul". + * src/hwf-x86.c (detect_x86_gnuc): Add check for Intel PCLMUL. + + GCM: GHASH optimizations. + + commit 0e9e7d72f3c9eb7ac832746c3034855faaf8d02c + * cipher/cipher-gcm.c [GCM_USE_TABLES] (gcmR, ghash): Replace with new. + [GCM_USE_TABLES] [GCM_TABLES_USE_U64] (bshift, fillM, do_ghash): New. + [GCM_USE_TABLES] [!GCM_TABLES_USE_U64] (bshift, fillM): Replace with + new. + [GCM_USE_TABLES] [!GCM_TABLES_USE_U64] (do_ghash): New. + (_gcry_cipher_gcm_tag): Remove extra memcpy to outbuf and use + buf_eq_const for comparing authentication tag. + * cipher/cipher-internal.h (gcry_cipher_handle): Different 'gcm_table' + for 32-bit and 64-bit platforms. + + Add some documentation for GCM mode. + + commit 332da0ed7c8fab6c2bee841c94d8364c2ab4e30d + * doc/gcrypt.texi: Add mention of GCM mode. + +2013-11-19 Dmitry Eremin-Solenikov + + Initial implementation of GCM. + + commit 90cce18b9eced4f412ceeec5bcae18c4493322df + * cipher/Makefile.am: Add 'cipher-gcm.c'. + * cipher/cipher-ccm.c (_gcry_ciphert_ccm_set_lengths) + (_gcry_cipher_ccm_authenticate, _gcry_cipher_ccm_tag) + (_gcry_cipher_ccm_encrypt, _gcry_cipher_ccm_decrypt): Change + 'c->u_mode.ccm.tag' to 'c->marks.tag'. + * cipher/cipher-gcm.c: New. + * cipher/cipher-internal.h (GCM_USE_TABLES): New. + (gcry_cipher_handle): Add 'marks.tag', 'u_tag', 'length' and + 'gcm_table'; Remove 'u_mode.ccm.tag'. + (_gcry_cipher_gcm_encrypt, _gcry_cipher_gcm_decrypt) + (_gcry_cipher_gcm_setiv, _gcry_cipher_gcm_authenticate) + (_gcry_cipher_gcm_get_tag, _gcry_cipher_gcm_check_tag): New. + * cipher/cipher.c (_gcry_cipher_open_internal, cipher_setkey) + (cipher_encrypt, cipher_decrypt, _gcry_cipher_authenticate) + (_gcry_cipher_gettag, _gcry_cipher_checktag): Add GCM mode handling. + * src/gcrypt.h.in (gcry_cipher_modes): Add GCRY_CIPHER_MODE_GCM. + (GCRY_GCM_BLOCK_LEN): New. + * tests/basic.c (check_gcm_cipher): New. + (check_ciphers): Add GCM check. + (check_cipher_modes): Call 'check_gcm_cipher'. + * tests/bench-slope.c (bench_gcm_encrypt_do_bench) + (bench_gcm_decrypt_do_bench, bench_gcm_authenticate_do_bench) + (gcm_encrypt_ops, gcm_decrypt_ops, gcm_authenticate_ops): New. + (cipher_modes): Add GCM enc/dec/auth. + (cipher_bench_one): Limit GCM to block ciphers with 16 byte block-size. + * tests/benchmark.c (cipher_bench): Add GCM. + +2013-11-19 Jussi Kivilinna + + Camellia: fix compiler warning. + + commit 9816ae9d9931b75e4fdc9a5be10e6af447132313 + * cipher/camellia-glue.c (camellia_setkey): Use braces around empty if + statement. + + Tweak Camellia-AVX key-setup for small speed-up. + + commit 77922a82c3f2e30eca04511fa5a355208349c657 + * cipher/camellia-aesni-avx-amd64.S (camellia_f): Merge S-function output + rotation with P-function. + + Add CMAC (Cipher-based MAC) to MAC API. + + commit b49cd64aaaff2e5488a84665362ef7150683226c + * cipher/Makefile.am: Add 'cipher-cmac.c' and 'mac-cmac.c'. + * cipher/cipher-cmac.c: New. + * cipher/cipher-internal.h (gcry_cipher_handle.u_mode): Add 'cmac'. + * cipher/cipher.c (gcry_cipher_open): Rename to... + (_gcry_cipher_open_internal): ...this and add CMAC. + (gcry_cipher_open): New wrapper that disallows use of internal + modes (CMAC) from outside. + (cipher_setkey, cipher_encrypt, cipher_decrypt) + (_gcry_cipher_authenticate, _gcry_cipher_gettag) + (_gcry_cipher_checktag): Add handling for CMAC mode. + (cipher_reset): Do not reset 'marks.key' and do not clear subkeys in + 'u_mode' in CMAC mode. + * cipher/mac-cmac.c: New. + * cipher/mac-internal.h: Add CMAC support and algorithms. + * cipher/mac.c: Add CMAC algorithms. + * doc/gcrypt.texi: Add documentation for CMAC. + * src/cipher.h (gcry_cipher_internal_modes): New. + (_gcry_cipher_open_internal, _gcry_cipher_cmac_authenticate) + (_gcry_cipher_cmac_get_tag, _gcry_cipher_cmac_check_tag) + (_gcry_cipher_cmac_set_subkeys): New prototypes. + * src/gcrypt.h.in (gcry_mac_algos): Add CMAC algorithms. + * tests/basic.c (check_mac): Add CMAC test vectors. + +2013-11-16 Jussi Kivilinna + + Add new MAC API, initially with HMAC. + + commit fcd6da37d55f248d3558ee0ff385b41b866e7ded + * cipher/Makefile.am: Add 'mac.c', 'mac-internal.h' and 'mac-hmac.c'. + * cipher/bufhelp.h (buf_eq_const): New. + * cipher/cipher-ccm.c (_gcry_cipher_ccm_tag): Use 'buf_eq_const' for + constant-time compare. + * cipher/mac-hmac.c: New. + * cipher/mac-internal.h: New. + * cipher/mac.c: New. + * doc/gcrypt.texi: Add documentation for MAC API. + * src/gcrypt-int.h [GPG_ERROR_VERSION_NUMBER < 1.13] + (GPG_ERR_MAC_ALGO): New. + * src/gcrypt.h.in (gcry_mac_handle, gcry_mac_hd_t, gcry_mac_algos) + (gcry_mac_flags, gcry_mac_open, gcry_mac_close, gcry_mac_ctl) + (gcry_mac_algo_info, gcry_mac_setkey, gcry_mac_setiv, gcry_mac_write) + (gcry_mac_read, gcry_mac_verify, gcry_mac_get_algo_maclen) + (gcry_mac_get_algo_keylen, gcry_mac_algo_name, gcry_mac_map_name) + (gcry_mac_reset, gcry_mac_test_algo): New. + * src/libgcrypt.def (gcry_mac_open, gcry_mac_close, gcry_mac_ctl) + (gcry_mac_algo_info, gcry_mac_setkey, gcry_mac_setiv, gcry_mac_write) + (gcry_mac_read, gcry_mac_verify, gcry_mac_get_algo_maclen) + (gcry_mac_get_algo_keylen, gcry_mac_algo_name, gcry_mac_map_name): New. + * src/libgcrypt.vers (gcry_mac_open, gcry_mac_close, gcry_mac_ctl) + (gcry_mac_algo_info, gcry_mac_setkey, gcry_mac_setiv, gcry_mac_write) + (gcry_mac_read, gcry_mac_verify, gcry_mac_get_algo_maclen) + (gcry_mac_get_algo_keylen, gcry_mac_algo_name, gcry_mac_map_name): New. + * src/visibility.c (gcry_mac_open, gcry_mac_close, gcry_mac_ctl) + (gcry_mac_algo_info, gcry_mac_setkey, gcry_mac_setiv, gcry_mac_write) + (gcry_mac_read, gcry_mac_verify, gcry_mac_get_algo_maclen) + (gcry_mac_get_algo_keylen, gcry_mac_algo_name, gcry_mac_map_name): New. + * src/visibility.h (gcry_mac_open, gcry_mac_close, gcry_mac_ctl) + (gcry_mac_algo_info, gcry_mac_setkey, gcry_mac_setiv, gcry_mac_write) + (gcry_mac_read, gcry_mac_verify, gcry_mac_get_algo_maclen) + (gcry_mac_get_algo_keylen, gcry_mac_algo_name, gcry_mac_map_name): New. + * tests/basic.c (check_one_mac, check_mac): New. + (main): Call 'check_mac'. + * tests/bench-slope.c (bench_print_header, bench_print_footer): Allow + variable algorithm name width. + (_cipher_bench, hash_bench): Update to above change. + (bench_hash_do_bench): Add 'gcry_md_reset'. + (bench_mac_mode, bench_mac_init, bench_mac_free, bench_mac_do_bench) + (mac_ops, mac_modes, mac_bench_one, _mac_bench, mac_bench): New. + (main): Add 'mac' benchmark options. + * tests/benchmark.c (mac_repetitions, mac_bench): New. + (main): Add 'mac' benchmark options. + + Use correct blocksize of 32 bytes for GOSTR3411-94 HMAC. + + commit b95a557a43aeed68ea5e5ce02aca42ee97bfdb3b + * cipher/md.c (md_open): Set macpads_Bsize to 32 for + GCRY_MD_GOST24311_94. + +2013-11-15 Jussi Kivilinna + + cipher: use size_t for internal buffer lengths. + + commit b787657a9d2c1d8e19f9fcb0b21e31cb062630cf + * cipher/arcfour.c (do_encrypt_stream, encrypt_stream): Use 'size_t' + for buffer lengths. + * cipher/blowfish.c (_gcry_blowfish_ctr_enc, _gcry_blowfish_cbc_dec) + (_gcry_blowfish_cfb_dec): Ditto. + * cipher/camellia-glue.c (_gcry_camellia_ctr_enc) + (_gcry_camellia_cbc_dec, _gcry_blowfish_cfb_dec): Ditto. + * cipher/cast5.c (_gcry_cast5_ctr_enc, _gcry_cast5_cbc_dec) + (_gcry_cast5_cfb_dec): Ditto. + * cipher/cipher-aeswrap.c (_gcry_cipher_aeswrap_encrypt) + (_gcry_cipher_aeswrap_decrypt): Ditto. + * cipher/cipher-cbc.c (_gcry_cipher_cbc_encrypt) + (_gcry_cipher_cbc_decrypt): Ditto. + * cipher/cipher-ccm.c (_gcry_cipher_ccm_encrypt) + (_gcry_cipher_ccm_decrypt): Ditto. + * cipher/cipher-cfb.c (_gcry_cipher_cfb_encrypt) + (_gcry_cipher_cfb_decrypt): Ditto. + * cipher/cipher-ctr.c (_gcry_cipher_ctr_encrypt): Ditto. + * cipher/cipher-internal.h (gcry_cipher_handle->bulk) + (_gcry_cipher_cbc_encrypt, _gcry_cipher_cbc_decrypt) + (_gcry_cipher_cfb_encrypt, _gcry_cipher_cfb_decrypt) + (_gcry_cipher_ofb_encrypt, _gcry_cipher_ctr_encrypt) + (_gcry_cipher_aeswrap_encrypt, _gcry_cipher_aeswrap_decrypt) + (_gcry_cipher_ccm_encrypt, _gcry_cipher_ccm_decrypt): Ditto. + * cipher/cipher-ofb.c (_gcry_cipher_cbc_encrypt): Ditto. + * cipher/cipher-selftest.h (gcry_cipher_bulk_cbc_dec_t) + (gcry_cipher_bulk_cfb_dec_t, gcry_cipher_bulk_ctr_enc_t): Ditto. + * cipher/cipher.c (cipher_setkey, cipher_setiv, do_ecb_crypt) + (do_ecb_encrypt, do_ecb_decrypt, cipher_encrypt) + (cipher_decrypt): Ditto. + * cipher/rijndael.c (_gcry_aes_ctr_enc, _gcry_aes_cbc_dec) + (_gcry_aes_cfb_dec, _gcry_aes_cbc_enc, _gcry_aes_cfb_enc): Ditto. + * cipher/salsa20.c (salsa20_setiv, salsa20_do_encrypt_stream) + (salsa20_encrypt_stream, salsa20r12_encrypt_stream): Ditto. + * cipher/serpent.c (_gcry_serpent_ctr_enc, _gcry_serpent_cbc_dec) + (_gcry_serpent_cfb_dec): Ditto. + * cipher/twofish.c (_gcry_twofish_ctr_enc, _gcry_twofish_cbc_dec) + (_gcry_twofish_cfb_dec): Ditto. + * src/cipher-proto.h (gcry_cipher_stencrypt_t) + (gcry_cipher_stdecrypt_t, cipher_setiv_fuct_t): Ditto. + * src/cipher.h (_gcry_aes_cfb_enc, _gcry_aes_cfb_dec) + (_gcry_aes_cbc_enc, _gcry_aes_cbc_dec, _gcry_aes_ctr_enc) + (_gcry_blowfish_cfb_dec, _gcry_blowfish_cbc_dec) + (_gcry_blowfish_ctr_enc, _gcry_cast5_cfb_dec, _gcry_cast5_cbc_dec) + (_gcry_cast5_ctr_enc, _gcry_camellia_cfb_dec, _gcry_camellia_cbc_dec) + (_gcry_camellia_ctr_enc, _gcry_serpent_cfb_dec, _gcry_serpent_cbc_dec) + (_gcry_serpent_ctr_enc, _gcry_twofish_cfb_dec, _gcry_twofish_cbc_dec) + (_gcry_twofish_ctr_enc): Ditto. + + Camellia: Add AVX/AES-NI key setup. + + commit ef9f52cbb39e46918c96200b09c21e931eff174f + * cipher/camellia-aesni-avx-amd64.S (key_bitlength, key_table): New + order of fields in ctx. + (camellia_f, vec_rol128, vec_ror128): New macros. + (__camellia_avx_setup128, __camellia_avx_setup256) + (_gcry_camellia_aesni_avx_keygen): New functions. + * cipher/camellia-aesni-avx2-amd64.S (key_bitlength, key_table): New + order of fields in ctx. + * cipher/camellia-arm.S (CAMELLIA_TABLE_BYTE_LEN, key_length): Remove + unused macros. + * cipher/camellia-glue.c (CAMELLIA_context): Move keytable to head for + better alignment; Make 'use_aesni_avx' and 'use_aesni_avx2' bitfield + members. + [USE_AESNI_AVX] (_gcry_camellia_aesni_avx_keygen): New prototype. + (camellia_setkey) [USE_AESNI_AVX || USE_AESNI_AVX2]: Read hw features + to variable 'hwf' and match features from it. + (camellia_setkey) [USE_AESNI_AVX]: Use AES-NI/AVX key setup if + available. + + Avoid unneeded stack burning with AES-NI and reduce number of 'decryption= _prepared' checks + + commit c8ad83fb605fdbf6dc0b0dbcc8aedfbd477640da + * cipher/rijndael.c (RIJNDAEL_context): Make 'decryption_prepared', + 'use_padlock' and 'use_aesni' 1-bit members in bitfield. + (do_setkey): Move 'hwfeatures' inside [USE_AESNI ||=C2=A0USE_PADLOCK]. + (do_aesni_enc_aligned): Rename to... + (do_aesni_enc): ...this, as function does not require aligned input. + (do_aesni_dec_aligned): Rename to... + (do_aesni_dec): ...this, as function does not require aligned input. + (do_aesni): Remove. + (rijndael_encrypt): Call 'do_aesni_enc' instead of 'do_aesni'. + (rijndael_decrypt): Call 'do_aesni_dec' instead of 'do_aesni'. + (check_decryption_preparation): New. + (do_decrypt): Remove 'decryption_prepared' check. + (rijndael_decrypt): Ditto and call 'check_decryption_preparation'. + (_gcry_aes_cbc_dec): Ditto. + (_gcry_aes_cfb_enc): Add 'burn_depth' and burn stack only when needed. + (_gcry_aes_cbc_enc): Ditto. + (_gcry_aes_ctr_enc): Ditto. + (_gcry_aes_cfb_dec): Ditto. + (_gcry_aes_cbc_dec): Ditto and correct clearing of 'savebuf'. + +2013-11-14 Werner Koch + + md: Fix hashing for data >=3D 256 GB. + + commit c43a8c0d81a711161f7a81b24ef7c33a1353eee0 + * cipher/hash-common.h (gcry_md_block_ctx): Add "nblocks_high". + * cipher/hash-common.c (_gcry_md_block_write): Bump NBLOCKS_HIGH. + * cipher/md4.c (md4_init, md4_final): Take care of NBLOCKS_HIGH. + * cipher/md5.c (md5_init, md5_final): Ditto. + * cipher/rmd160.c (_gcry_rmd160_init, rmd160_final): Ditto. + * cipher/sha1.c (sha1_init, sha1_final): Ditto. + * cipher/sha256.c (sha256_init, sha224_init, sha256_final): Ditto. + * cipher/sha512.c (sha512_init, sha384_init, sha512_final): Ditto. + * cipher/tiger.c (do_init, tiger_final): Ditto. + * cipher/whirlpool.c (whirlpool_final): Ditto. + + * cipher/md.c (gcry_md_algo_info): Add GCRYCTL_SELFTEST. + (_gcry_md_selftest): Return "not implemented" as required. + * tests/hashtest.c: New. + * tests/genhashdata.c: New. + * tests/Makefile.am (TESTS): Add hashtest. + (noinst_PROGRAMS): Add genhashdata + +2013-11-13 Christian Grothoff + + ecc: Fix key generation for a plain Ed25519 key. + + commit 7d91e99bcd30a463dd4faed014b8521a663d8316 + * cipher/ecc.c (nist_generate_key): Use custom code for ED25519. + + ecc: Fix some memory leaks. + + commit c4f9af49f228df59c218381a25fa3c0f93ccbeae + * cipher/ecc-curves.c (_gcry_mpi_ec_new): Free ec->b before assigning. + * cipher/ecc.c (nist_generate_key): Release Q. + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_genkey): Ditto. + +2013-11-11 Werner Koch + + ecc: Change keygrip computation for Ed25519+EdDSA. + + commit 4fb3c8e5a7fc6a1568f54bcc0be17fecf75e0742 + * cipher/ecc.c (compute_keygrip): Rework. + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_ensure_compact): New. + * cipher/ecc-curves.c (_gcry_ecc_update_curve_param): New. + * tests/keygrip.c (key_grips): Add flag param and test cases for + Ed25519. + + mpi: Add special format GCRYMPI_FMT_OPAQUE. + + commit 8b3eecee2d89179297e43de7d650f74759c61a58 + * src/gcrypt.h.in (GCRYMPI_FMT_OPAQUE): New. + (_gcry_sexp_nth_opaque_mpi): Remove. + * src/sexp.c (gcry_sexp_nth_mpi): Add support for GCRYMPI_FMT_OPAQUE. + (_gcry_sexp_vextract_param): Replace removed function by + GCRYMPI_FMT_OPAQUE. + +2013-11-10 Jussi Kivilinna + + Fix error output in CTR selftest. + + commit 7b26586e35a6d407ca31b41528b0810b1408fd4b + * cipher/cipher-selftest.c (_gcry_selftest_helper_ctr): Change + fprintf(stderr,...) to syslog(); Correct error output for bulk + IV check, plaintext mismatch =3D> ciphertext mismatch. + +2013-11-09 Jussi Kivilinna + + Fix Serpent-AVX2 and Camellia-AVX2 counter modes. + + commit df29831d008e32faf74091d080a415731418d158 + * cipher/camellia-aesni-avx2-amd64.S + (_gcry_camellia_aesni_avx2_ctr_enc): Byte-swap before checking for + overflow handling. + * cipher/camellia-glue.c (selftest_ctr_128, selftest_cfb_128) + (selftest_cbc_128): Add 16 to nblocks. + * cipher/cipher-selftest.c (_gcry_selftest_helper_ctr): Add test with + non-overflowing IV and modify overflow IV to detect broken endianness + handling. + * cipher/serpent-avx2-amd64.S (_gcry_serpent_avx2_ctr_enc): Byte-swap + before checking for overflow handling; Fix crazy-mixed-endian IV + construction to big-endian. + * cipher/serpent.c (selftest_ctr_128, selftest_cfb_128) + (selftest_cbc_128): Add 8 to nblocks. + +2013-11-09 Sergey V + + cipher/gost28147: optimization: use precomputed S-box tables. + + commit 51501b638546665163bbb85a14308fdb99211a28 + * cipher/gost.h (GOST28147_context): Remove unneeded subst and + subst_set members. + * cipher/gost28147.c (max): Remove unneeded macro. + (test_sbox): Replace with new precomputed tables. + (gost_set_subst): Remove function. + (gost_val): Use new S-box tables. + (gost_encrypt_block, gost_decrypt_block): Tweak to use new ctx and + S-box tables. + +2013-11-09 Jussi Kivilinna + + Fix tail handling for AES-NI counter mode. + + commit 60ed0abbbc7cb15812f1e713143c72555acea69e + * cipher/rijndael.c (do_aesni_ctr): Fix outputting of updated + counter-IV. + +2013-11-08 Werner Koch + + ecc: Improve gcry_pk_get_curve. + + commit 03aed1acec611362285db5156a6b92c91604fba4 + * cipher/ecc-curves.c (_gcry_ecc_fill_in_curve): Factor some code out + to .. + (find_domain_parms_idx): new. + (_gcry_ecc_get_curve): Find by curve name on error. + + cipher: Avoid signed divisions in idea.c. + + commit e241dde1420475459e32608137829e52748d0212 + * cipher/idea.c (mul_inv): Use unsigned division. + + ecc: Implement the "nocomp" flag for key generation. + + commit 9f63c0f7a3b2c15c7e258cd17395cabd0a8f00cc + * cipher/ecc.c (ecc_generate): Support the "nocomp" flag. + * tests/keygen.c (check_ecc_keys): Add a test for it. + + ecc: Make "noparam" the default and replace by "param". + + commit ed45fd2e60c88e2f005282e6eadd018b59dcf65b + * src/cipher.h (PUBKEY_FLAG_NOCOMP): New. + (PUBKEY_FLAG_NOPARAM): Remove. + (PUBKEY_FLAG_PARAM): New. + * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist): Support the new + flags and ignore the obsolete "noparam" flag. + * cipher/ecc-curves.c (_gcry_ecc_fill_in_curve): Return the curve name + also for curves selected by NBITS. + (_gcry_mpi_ec_new): Support the "param" flag. + * cipher/ecc.c (ecc_generate, ecc_sign, ecc_verify): Ditto. + * tests/keygen.c (check_ecc_keys): Remove the "noparam" flag. + +2013-11-07 Jussi Kivilinna + + Fix decryption function size in AES AMD64 assembly. + + commit bfe4f6523b80bae0040328ef324b9000ee5b38a4 + * cipher/rijndael-amd64.S (_gcry_aes_amd64_decrypt_block): Set '.size' + for '_gcry_aes_amd64_decrypt_block', not '..._encrypt_block'. + + Change 64-bit shift to 32-bit in AES AMD64 assembly. + + commit 57b296ea3a5204cd3711b7bf57c8fb14d8542402 + * cipher/rijndael-amd64.S (do16bit_shr): Change 'shrq' to 'shrl'. + +2013-11-06 Jussi Kivilinna + + Speed-up AES-NI key setup. + + commit f702d62d888b30e24c19f203566a1473098b2b31 + * cipher/rijndael.c [USE_AESNI] (m128i_t): Remove. + [USE_AESNI] (u128_t): New. + [USE_AESNI] (aesni_do_setkey): New. + (do_setkey) [USE_AESNI]: Move AES-NI accelerated key setup to + 'aesni_do_setkey'. + (do_setkey): Call _gcry_get_hw_features only once. Clear stack after + use in generic key setup part. + (rijndael_setkey): Remove stack burning. + (prepare_decryption) [USE_AESNI]: Use 'u128_t' instead of 'm128i_t' to + avoid compiler generated SSE2 instructions and XMM register usage, + unroll 'aesimc' setup loop + (prepare_decryption): Clear stack after use. + [USE_AESNI] (do_aesni_enc_aligned): Update comment about alignment. + (do_decrypt): Do not burning stack after prepare_decryption. + + Avoid burn stack in Arcfour setkey. + + commit a50a6ba3540f49fc7dcdb32e691327d5942e3509 + * cipher/arcfour.c (arcfour_setkey): Remove stack burning. + + Avoid burn_stack in CAST5 setkey. + + commit 5797ebc268b4e953cedd0c729c5cdb1f8fd764e4 + * cipher/cast5.c (do_cast_setkey): Use wipememory instead of memset. + (cast_setkey): Remove stack burning. + + Improve Serpent key setup speed. + + commit 9897ccb381503455edc490679b2e9251a09ac5cb + * cipher/serpent.c (SBOX, SBOX_INVERSE): Remove index argument. + (serpent_subkeys_generate): Use smaller temporary arrays for subkey + generation and perform stack clearing locally. + (serpent_setkey_internal): Use wipememory to clear stack and remove + _gcry_burn_stack. + (serpent_setkey): Remove unneeded _gcry_burn_stack. + + Modify encrypt/decrypt arguments for in-place. + + commit b8515aa70b00baba3fba8121ed305edcd029c8c7 + * cipher/cipher.c (gcry_cipher_encrypt, gcry_cipher_decrypt): Modify + local arguments if in-place operation. + + Speed up Stribog. + + commit a48d07ccadee4cb8b666a9a4ba2f00129bad5b2f + * cipher/stribog.c (STRIBOG_TABLES): Remove. + (Pi): Remove. + [!STRIBOG_TABLES] (A, strido): Remove. + (stribog_table): New table pre-reordered with Pi values. + (strido): Rewrite for new table. + (LPSX): Rewrite for new table. + (xor): Remove. + (g): Small tweaks. + + Tweak AES-NI bulk CTR mode slightly. + + commit 3b5058b58a183fa23ecf3ef819e2ae6ac64c0216 + * cipher/rijndael.c [USE_AESNI] (aesni_cleanup_2_5): Rename to... + (aesni_cleanup_2_6): ...this and clear also 'xmm6'. + [USE_AESNI && __i386__] (do_aesni_ctr, do_aesni_ctr_4): Prevent + inlining only on i386, allow on AMD64. + [USE_AESNI] (do_aesni_ctr, do_aesni_ctr_4): Use counter block from + 'xmm5' and byte-swap mask from 'xmm6'. + (_gcry_aes_ctr_enc) [USE_AESNI]: Preload counter block to 'xmm5' and + byte-swap mask to 'xmm6'. + (_gcry_aes_ctr_enc, _gcry_aes_cfb_dec, _gcry_aes_cbc_dec): Use + 'aesni_cleanup_2_6'. + + Tweak bench-slope parameters. + + commit 7e98eecc1a955bc253765f92a166b6560f085b8c + * tests/bench-slope.c (BUF_STEP_SIZE): Half step size to 64. + (NUM_MEASUREMENT_REPETITIONS): Double repetitions to 64. + + Optimize Blowfish weak key check. + + commit 8e1c0f9b894c39b6554c544208dc000682f520c7 + * cipher/blowfish.c (hashset_elem, val_to_hidx, add_val): New. + (do_bf_setkey): Use faster algorithm for detecting weak keys. + (bf_setkey): Move stack burning to do_bf_setkey. + + Fix __builtin_bswap32/64 checks. + + commit 2590a5df6f5fc884614c8c379324027d2d61b9b5 + * configure.ac (gcry_cv_have_builtin_bswap32) + (gcry_cv_have_builtin_bswap64): Change compile checks to link checks. + + Fix 'u32' build error with Camellia. + + commit 84bcb400e7db7268abfc29b5ab1513b0c063b293 + * cipher/camellia.c: Add include for and "types.h". + (u32): Remove. + (u8): Typedef as 'byte'. + +2013-11-06 Werner Koch + + pubkey: Add forward compatibility feature. + + commit 6d169b654c7ff04c10f73afe80b2c70cefa410c1 + * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist): Add + "igninvflag". + +2013-11-05 Werner Koch + + ecc: Require "eddsa" flag for curve Ed25519. + + commit b9fd3988b54b50109f4e7179e7fe0739bb1d97c5 + * src/cipher.h (PUBKEY_FLAG_ECDSA): Remove. + * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist): Remove "ecdsa". + * cipher/ecc.c (ecc_generate, ecc_sign, ecc_verify): Require "eddsa" flag. + * cipher/ecc-misc.c (_gcry_ecc_compute_public): Depend "eddsa" flag. + * tests/benchmark.c, tests/keygen.c, tests/pubkey.c + * tests/t-ed25519.c, tests/t-mpi-point.c: Adjust for changed flags. + + ecc: Fully implement Ed25519 compression in ECDSA mode. + + commit f09ffe8a4802af65a116e79eceeb1cb4ed4fa2f4 + * src/ec-context.h (mpi_ec_ctx_s): Add field FLAGS. + * mpi/ec.c (ec_p_init): Add arg FLAGS. Change all callers to pass it. + * cipher/ecc-curves.c (point_from_keyparam): Add arg EC, parse as + opaque mpi and use eddsa decoding depending on the flag. + (_gcry_mpi_ec_new): Rearrange to parse Q and D after knowing the + curve. + + mpi: Add function gcry_mpi_set_opaque_copy. + + commit 630aca794ddf057fb7265b7dc346374743036af4 + * src/gcrypt.h.in (gcry_mpi_set_opaque_copy): New. + * src/visibility.c (gcry_mpi_set_opaque_copy): New. + * src/visibility.h (gcry_mpi_set_opaque_copy): Mark visible. + * src/libgcrypt.def, src/libgcrypt.vers: Add new API. + * tests/mpitests.c (test_opaque): Add test. + +2013-11-04 Jussi Kivilinna + + Make test vectors 'static const' + + commit d50a88d1e29124d038196fec6082fd093e922604 + * cipher/arcfour.c (selftest): Change test vectors to 'static const'. + * cipher/blowfish.c (selftest): Ditto. + * cipher/camellia-glue.c (selftest): Ditto. + * cipher/cast5.c (selftest): Ditto. + * cipher/des.c (selftest): Ditto. + * cipher/rijndael.c (selftest): Ditto. + * tests/basic.c (cipher_cbc_mac_cipher, check_aes128_cbc_cts_cipher) + (check_ctr_cipher, check_cfb_cipher, check_ofb_cipher) + (check_ccm_cipher, check_stream_cipher) + (check_stream_cipher_large_block, check_bulk_cipher_modes) + (check_ciphers, check_digests, check_hmac, check_pubkey_sign) + (check_pubkey_sign_ecdsa, check_pubkey_crypt, check_pubkey): Ditto. + +2013-11-03 Jussi Kivilinna + + Make jump labels local in Salsa20 assembly. + + commit d4697862266f3c96b6946dc92139dd8f3e81e5f6 + * cipher/salsa20-amd64.S: Rename '._labels' to '.L_labels'. + * cipher/salsa20-armv7-neon.S: Ditto. + +2013-10-30 Jussi Kivilinna + + bithelp: fix undefined behaviour with rol and ror. + + commit d1cadd145199040299538891ab2ccd1208f7776e + * cipher/bithelp.h (rol, ror): Mask shift with 31. + +2013-10-29 Werner Koch + + tests: Add feature to skip benchmarks. + + commit ba6bffafd17bea11985afc500022d66da261d59a + * tests/benchmark.c (main): Add feature to skip the test. + * tests/bench-slope.c (main): Ditto. + (get_slope): Repace C++ style comment. + (double_cmp, cipher_bench, _hash_bench): Repalce system reserved + symbols. + + ecc: Finish Ed25519/ECDSA hack. + + commit c284f15db99e9cb135612de710199abb23baafd3 + * cipher/ecc.c (ecc_generate): Fix Ed25519/ECDSA case. + (ecc_verify): Implement ED25519/ECDSA uncompression. + + ecc: Add flags "noparam" and "comp". + + commit ba892a0a874c8b2a83dbf0940608cd7e2911ce01 + * src/cipher.h (PUBKEY_FLAG_NOPARAM, PUBKEY_FLAG_COMP): New. + * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist): Parse new flags + and change code for possible faster parsing. + * cipher/ecc.c (ecc_generate): Implement the "noparam" flag. + (ecc_sign): Ditto. + (ecc_verify): Ditto. + * tests/keygen.c (check_ecc_keys): Use the "noparam" flag. + + * cipher/ecc.c (ecc_generate): Fix parsing of the deprecated + transient-flag parameter. + (ecc_verify): Do not make Q optional in the extract-param call. + +2013-10-28 Jussi Kivilinna + + Fix typos in documentation. + + commit 1faa61845f180bd47e037e400dde2d864ee83c89 + * doc/gcrypt.texi: Fix some typos. + + Add ARM NEON assembly implementation of Serpent. + + commit 2cb6e1f323d24359b1c5b113be5c2f79a2a4cded + * cipher/Makefile.am: Add 'serpent-armv7-neon.S'. + * cipher/serpent-armv7-neon.S: New. + * cipher/serpent.c (USE_NEON): New macro. + (serpent_context_t) [USE_NEON]: Add 'use_neon'. + [USE_NEON] (_gcry_serpent_neon_ctr_enc, _gcry_serpent_neon_cfb_dec) + (_gcry_serpent_neon_cbc_dec): New prototypes. + (serpent_setkey_internal) [USE_NEON]: Detect NEON support. + (_gcry_serpent_neon_ctr_enc, _gcry_serpent_neon_cfb_dec) + (_gcry_serpent_neon_cbc_dec) [USE_NEON]: Use NEON implementations + to process eight blocks in parallel. + * configure.ac [neonsupport]: Add 'serpent-armv7-neon.lo'. + + Add ARM NEON assembly implementation of Salsa20. + + commit 3ff9d2571c18cd7a34359f9c60a10d3b0f932b23 + * cipher/Makefile.am: Add 'salsa20-armv7-neon.S'. + * cipher/salsa20-armv7-neon.S: New. + * cipher/salsa20.c [USE_ARM_NEON_ASM]: New macro. + (struct SALSA20_context_s, salsa20_core_t, salsa20_keysetup_t) + (salsa20_ivsetup_t): New. + (SALSA20_context_t) [USE_ARM_NEON_ASM]: Add 'use_neon'. + (SALSA20_context_t): Add 'keysetup', 'ivsetup' and 'core'. + (salsa20_core): Change 'src' argument to 'ctx'. + [USE_ARM_NEON_ASM] (_gcry_arm_neon_salsa20_encrypt): New prototype. + [USE_ARM_NEON_ASM] (salsa20_core_neon, salsa20_keysetup_neon) + (salsa20_ivsetup_neon): New. + (salsa20_do_setkey): Setup keysetup, ivsetup and core with default + functions. + (salsa20_do_setkey) [USE_ARM_NEON_ASM]: When NEON support detect, + set keysetup, ivsetup and core with ARM NEON functions. + (salsa20_do_setkey): Call 'ctx->keysetup'. + (salsa20_setiv): Call 'ctx->ivsetup'. + (salsa20_do_encrypt_stream) [USE_ARM_NEON_ASM]: Process large buffers + in ARM NEON implementation. + (salsa20_do_encrypt_stream): Call 'ctx->core' instead of directly + calling 'salsa20_core'. + (selftest): Add test to check large buffer processing and block counter + updating. + * configure.ac [neonsupport]: 'Add salsa20-armv7-neon.lo'. + + Add AMD64 assembly implementation of Salsa20. + + commit 5a3d43485efdc09912be0967ee0a3ce345b3b15a + * cipher/Makefile.am: Add 'salsa20-amd64.S'. + * cipher/salsa20-amd64.S: New. + * cipher/salsa20.c (USE_AMD64): New macro. + [USE_AMD64] (_gcry_salsa20_amd64_keysetup, _gcry_salsa20_amd64_ivsetup) + (_gcry_salsa20_amd64_encrypt_blocks): New prototypes. + [USE_AMD64] (salsa20_keysetup, salsa20_ivsetup, salsa20_core): New. + [!USE_AMD64] (salsa20_core): Change 'src' to non-constant, update block + counter in 'salsa20_core' and return burn stack depth. + [!USE_AMD64] (salsa20_keysetup, salsa20_ivsetup): New. + (salsa20_do_setkey): Move generic key setup to 'salsa20_keysetup'. + (salsa20_setkey): Fix burn stack depth. + (salsa20_setiv): Move generic IV setup to 'salsa20_ivsetup'. + (salsa20_do_encrypt_stream) [USE_AMD64]: Process large buffers in AMD64 + implementation. + (salsa20_do_encrypt_stream): Move stack burning to this function... + (salsa20_encrypt_stream, salsa20r12_encrypt_stream): ...from these + functions. + * configure.ac [x86-64]: Add 'salsa20-amd64.lo'. + + Add new benchmarking utility, bench-slope. + + commit e214e8392671dd30e9c33260717b5e756debf3bf + * tests/Makefile.am (TESTS): Add 'bench-slope'. + * tests/bench-slope.c: New. + + Change .global to .globl in assembly files. + + commit ebc8abfcb09d6106fcfce40f240a513e276f46e9 + * cipher/blowfish-arm.S: Change '.global' to '.globl'. + * cipher/camellia-aesni-avx-amd64.S: Ditto. + * cipher/camellia-aesni-avx2-amd64.S: Ditto. + * cipher/camellia-arm.S: Ditto. + * cipher/cast5-amd64.S: Ditto. + * cipher/rijndael-amd64.S: Ditto. + * cipher/rijndael-arm.S: Ditto. + * cipher/serpent-avx2-amd64.S: Ditto. + * cipher/serpent-sse2-amd64.S: Ditto. + * cipher/twofish-amd64.S: Ditto. + * cipher/twofish-arm.S: Ditto. + +2013-10-26 Jussi Kivilinna + + Deduplicate code for ECB encryption and decryption. + + commit 51f1beab3d1e879942a95f58b08de7dbcce75dce + * cipher/cipher.c (do_ecb_crypt): New, based on old 'do_ecb_encrypt'. + (do_ecb_encrypt): Use 'do_ecb_crypt', pass encryption function. + (do_ecb_decrypt): Use 'do_ecb_crypt', pass decryption function. + +2013-10-26 Dmitry Eremin-Solenikov + + Drop _gcry_cipher_ofb_decrypt as it duplicates _gcry_cipher_ofb_encrypt. + + commit d9431725952e40f201c7eda000d3c8511ebd5b33 + * cipher/cipher.c (cipher_decrypt): Use _gcry_cipher_ofb_encrypt for OFB + decryption. + * cipher/cipher-internal.h: Remove _gcry_cipher_ofb_decrypt declaration. + * cipher/cipher-ofb.c (_gcry_cipher_ofb_decrypt): Remove. + (_gcry_cipher_ofb_encrypt): remove copying of IV to lastiv, it's + unused there. + +2013-10-25 Werner Koch + + tests: Add tests for mpi_cmp. + + commit 6c6d4810927de7310ae7bac61b4ff5467d7cb485 + * tests/mpitests.c (die): Modernize. + (fail): New. + (test_opaque, test_add, test_sub, test_mul): Use gcry_log_xx + (main): Return error count. + (test_cmp): New. + +2013-10-24 Werner Koch + + ecc: Change algorithm for Ed25519 x recovery. + + commit c630fd71b336eb9209e914d24dc1e26a34521882 + * cipher/ecc-eddsa.c (scanval): Add as temporary hack. + (_gcry_ecc_eddsa_recover_x): Use the algorithm from page 15 of the + paper. Return an error code. + (_gcry_ecc_eddsa_decodepoint): Take care of the error code. + * mpi/mpi-mul.c (gcry_mpi_mulm): Use truncated division. + + ecc: Refactor _gcry_ecc_eddsa_decodepoint. + + commit 1cf5699b6febab1ef9d300531acc2ee33a7df739 + * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_decodepoint): Factor some code + out to .. + (_gcry_ecc_eddsa_recover_x): new. + +2013-10-24 Jussi Kivilinna + + ecc-gost: Add missing include. + + commit 9ce54e5b512418ddf45ce18f2cbd48cdced779f5 + * ecc-gost.c: Include "pubkey-internal.h". + +2013-10-23 Jussi Kivilinna + + Replace architecture specific fast_wipememory2 with generic. + + commit 54df6fcd806f8c150cffe6cc09925bb8b638bb5b + * src/g10lib.h (fast_wipememory2): Remove architecture specific + implementations and add generic implementation. + + Improve the speed of the cipher mode code. + + commit 293e93672fdabc829e35cc624c397276342bafe4 + * cipher/bufhelp.h (buf_cpy): New. + (buf_xor, buf_xor_2dst): If buffers unaligned, always jump to per-byte + processing. + (buf_xor_n_copy_2): New. + (buf_xor_n_copy): Use 'buf_xor_n_copy_2'. + * cipher/blowfish.c (_gcry_blowfish_cbc_dec): Avoid extra memory copy + and use new 'buf_xor_n_copy_2'. + * cipher/camellia-glue.c (_gcry_camellia_cbc_dec): Ditto. + * cipher/cast5.c (_gcry_cast_cbc_dec): Ditto. + * cipher/serpent.c (_gcry_serpent_cbc_dec): Ditto. + * cipher/twofish.c (_gcry_twofish_cbc_dec): Ditto. + * cipher/rijndael.c (_gcry_aes_cbc_dec): Ditto. + (do_encrypt, do_decrypt): Use 'buf_cpy' instead of 'memcpy'. + (_gcry_aes_cbc_enc): Avoid copying IV, use 'last_iv' pointer instead. + * cipher/cipher-cbc.c (_gcry_cipher_cbc_encrypt): Avoid copying IV, + update pointer to IV instead. + (_gcry_cipher_cbc_decrypt): Avoid extra memory copy and use new + 'buf_xor_n_copy_2'. + (_gcry_cipher_cbc_encrypt, _gcry_cipher_cbc_decrypt): Avoid extra + accesses to c->spec, use 'buf_cpy' instead of memcpy. + * cipher/cipher-ccm.c (do_cbc_mac): Ditto. + * cipher/cipher-cfb.c (_gcry_cipher_cfb_encrypt) + (_gcry_cipher_cfb_decrypt): Ditto. + * cipher/cipher-ctr.c (_gcry_cipher_ctr_encrypt): Ditto. + * cipher/cipher-ofb.c (_gcry_cipher_ofb_encrypt) + (_gcry_cipher_ofb_decrypt): Ditto. + * cipher/cipher.c (do_ecb_encrypt, do_ecb_decrypt): Ditto. + + bufhelp: enable unaligned memory accesses for AArch64 (64-bit ARM) + + commit 2901a10dbf1264707debc8402546c07eeac60932 + * cipher/bufhelp.h [__aarch64__] (BUFHELP_FAST_UNALIGNED_ACCESS): Set + macro on AArch64. + +2013-10-23 Dmitry Eremin-Solenikov + + Enable assembler optimizations on earlier ARM cores. + + commit 2fd83faa876d0be91ab7884b1a9eaa7793559eb9 + * cipher/blowfish-armv6.S =3D> cipher/blowfish-arm.S: adapt to pre-armv6 = CPUs. + * cipher/blowfish.c: enable assembly on armv4/armv5 little-endian CPUs. + * cipher/camellia-armv6.S =3D> cipher/camellia-arm.S: adapt to pre-armv6 = CPUs. + * cipher/camellia.c, cipher-camellia-glue.c: enable assembly on armv4/arm= v5 + little-endian CPUs. + * cipher/cast5-armv6.S =3D> cipher/cast5-arm.S: adapt to pre-armv6 CPUs. + * cipher/cast5.c: enable assembly on armv4/armv5 little-endian CPUs. + * cipher/rijndael-armv6.S =3D> cipher/rijndael-arm.S: adapt to pre-armv6 = CPUs. + * cipher/rijndael.c: enable assembly on armv4/armv5 little-endian CPUs. + * cipher/twofish-armv6.S =3D> cipher/twofish-arm.S: adapt to pre-armv6 CP= Us. + * cipher/twofish.c: enable assembly on armv4/armv5 little-endian CPUs. + + mpi: enable assembler on all arm architectures. + + commit 0b39fce7e3ce6761d6bd5195d093ec6857edb7c2 + * mpi/config.links: remove check for arm >=3D v6 + * mpi/armv6 =3D> mpi/arm: rename directory to reflect that is is generic + enough + + Correct ASM assembly test in configure.ac. + + commit 10bf6a7e16ed193f90d2749970a420f00d1d3320 + * configure.ac: correct HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS test to + require neither ARMv6, nor thumb mode. Our assembly code works + perfectly even on ARMv4 now. + +2013-10-23 Werner Koch + + ecc: Refactor ecc.c. + + commit 164eb8c85d773ef4f0939115ec45f5e4b47c1700 + * cipher/ecc-ecdsa.c, cipher/ecc-eddsa.c, cipher/ecc-gost.c: New. + * cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add new files. + * configure.ac (GCRYPT_PUBKEY_CIPHERS): Add new files. + * cipher/ecc.c (point_init, point_free): Move to ecc-common.h. + (sign_ecdsa): Move to ecc-ecdsa.c as _gcry_ecc_ecdsa_sign. + (verify_ecdsa): Move to ecc-ecdsa.c as _gcry_ecc_ecdsa_verify. + (sign_gost): Move to ecc-gots.c as _gcry_ecc_gost_sign. + (verify_gost): Move to ecc-gost.c as _gcry_ecc_gost_verify. + (sign_eddsa): Move to ecc-eddsa.c as _gcry_ecc_eddsa_sign. + (verify_eddsa): Move to ecc-eddsa.c as _gcry_ecc_eddsa_verify. + (eddsa_generate_key): Move to ecc-eddsa.c as _gcry_ecc_eddsa_genkey. + (reverse_buffer): Move to ecc-eddsa.c. + (eddsa_encodempi, eddsa_encode_x_y): Ditto. + (_gcry_ecc_eddsa_encodepoint, _gcry_ecc_eddsa_decodepoint): Ditto. + + mpi: Fix scanning of negative SSH formats and add more tests. + + commit 45f6e6268bfdc4b608beaba6b7086b2286e33c71 + * mpi/mpicoder.c (gcry_mpi_scan): Fix sign setting for SSH format. + * tests/t-convert.c (negative_zero): Test all formats. + (check_formats): Add tests for PGP and scan tests for SSH and USG. + + * src/gcrypt.h.in (mpi_is_neg): Fix macro. + + * mpi/mpi-scan.c (_gcry_mpi_getbyte, _gcry_mpi_putbyte): Comment out + these unused functions. + +2013-10-22 Jussi Kivilinna + + twofish: add ARMv6 assembly implementation. + + commit 98674fdaa30ab22a3ac86ca05d688b5b6112895d + * cipher/Makefile.am: Add 'twofish-armv6.S'. + * cipher/twofish-armv6.S: New. + * cipher/twofish.c (USE_ARMV6_ASM): New macro. + [USE_ARMV6_ASM] (_gcry_twofish_armv6_encrypt_block) + (_gcry_twofish_armv6_decrypt_block): New prototypes. + [USE_AMDV6_ASM] (twofish_encrypt, twofish_decrypt): Add. + [USE_AMD64_ASM] (do_twofish_encrypt, do_twofish_decrypt): Remove. + (_gcry_twofish_ctr_enc, _gcry_twofish_cfb_dec): Use 'twofish_encrypt' + instead of 'do_twofish_encrypt'. + (_gcry_twofish_cbc_dec): Use 'twofish_decrypt' instead of + 'do_twofish_decrypt'. + * configure.ac [arm]: Add 'twofish-armv6.lo'. + + mpi: allow building with clang on ARM. + + commit e67c67321ce240c93dd0fa2b21c649c0a8e233f7 + * mpi/longlong.h [__arm__] (add_ssaaaa, sub_ddmmss, umul_ppmm) + (count_leading_zeros): Do not cast assembly output arguments. + [__arm__] (umul_ppmm): Remove the extra '%' ahead of assembly comment. + [_ARM_ARCH >=3D 4] (umul_ppmm): Use correct inputs and outputs instead of + registers. + + serpent-amd64: do not use GAS macros. + + commit c7efaa5fe0ee92e321a7b49d56752cc12eb75fe0 + * cipher/serpent-avx2-amd64.S: Remove use of GAS macros. + * cipher/serpent-sse2-amd64.S: Ditto. + * configure.ac [HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS]: Do not check + for GAS macros. + + Add Counter with CBC-MAC mode (CCM) + + commit 335d9bf7b035815750b63a3a8334d6ce44dc4449 + * cipher/Makefile.am: Add 'cipher-ccm.c'. + * cipher/cipher-ccm.c: New. + * cipher/cipher-internal.h (gcry_cipher_handle): Add 'u_mode'. + (_gcry_cipher_ccm_encrypt, _gcry_cipher_ccm_decrypt) + (_gcry_cipher_ccm_set_nonce, _gcry_cipher_ccm_authenticate) + (_gcry_cipher_ccm_get_tag, _gcry_cipher_ccm_check_tag) + (_gcry_cipher_ccm_set_lengths): New prototypes. + * cipher/cipher.c (gcry_cipher_open, cipher_encrypt, cipher_decrypt) + (_gcry_cipher_setiv, _gcry_cipher_authenticate, _gcry_cipher_gettag) + (_gcry_cipher_checktag, gry_cipher_ctl): Add handling for CCM mode. + * doc/gcrypt.texi: Add documentation for GCRY_CIPHER_MODE_CCM. + * src/gcrypt.h.in (gcry_cipher_modes): Add 'GCRY_CIPHER_MODE_CCM'. + (gcry_ctl_cmds): Add 'GCRYCTL_SET_CCM_LENGTHS'. + (GCRY_CCM_BLOCK_LEN): New. + * tests/basic.c (check_ccm_cipher): New. + (check_cipher_modes): Call 'check_ccm_cipher'. + * tests/benchmark.c (ccm_aead_init): New. + (cipher_bench): Add handling for AEAD modes and add CCM benchmarking. + + Add API to support AEAD cipher modes. + + commit 95654041f2aa62f71aac4d8614dafe8433d10f95 + * cipher/cipher.c (_gcry_cipher_authenticate, _gcry_cipher_checktag) + (_gcry_cipher_gettag): New. + * doc/gcrypt.texi: Add documentation for new API functions. + * src/visibility.c (gcry_cipher_authenticate, gcry_cipher_checktag) + (gcry_cipher_gettag): New. + * src/gcrypt.h.in, src/visibility.h: add declarations of these + functions. + * src/libgcrypt.defs, src/libgcrypt.vers: export functions. + +2013-10-22 NIIBE Yutaka + + ecc: Correct compliant key generation for Edwards curves. + + commit a5a277a9016ccb34f1858a65e0ed1791b2fc3db3 + * cipher/ecc.c: Add case for Edwards curves. + +2013-10-17 Werner Koch + + tests: Add test options to keygen. + + commit f7711e6eb5f02d03c74911f6f037ab28075e7c0d + * tests/keygen.c (usage): New. + (main): Print usage info. Allow running just one algo. + + mpi: Do not clear the sign of the mpi_mod result. + + commit 91e007606f1f6f8e1416c403fe809d47fddf9b1f + * mpi/mpi-mod.c (_gcry_mpi_mod): Remove sign setting. + + ecc: Put the curve name again into the output of gcry_pk_genkey. + + commit 4776dcd394ce59fa50d959921857b3427c5a63c8 + * cipher/ecc.c (ecc_generate): Use the correct var. Release + CURVE_FLAGS. + + ecc: Support Weierstrass curves in gcry_mpi_ec_curve_point. + + commit b22417158c50ec3a0b2ff55b4ade063b42a87e8f + * mpi/ec.c (_gcry_mpi_ec_curve_point): Support MPI_EC_WEIERSTRASS. + +2013-10-16 Jussi Kivilinna + + arcfour: more optimized version for non-i386 architectures. + + commit f9371c026aad09ff48746d22c8333746c886e773 + * cipher/arcfour.c (ARCFOUR_context): Reorder members. + (do_encrypt_stream) [!__i386__]: Faster implementation for non-i386. + (do_arcfour_setkey): Avoid modulo operations. + + Avoid void* pointer arithmetic. + + commit c89ab921ccfaefe6c4f6a724d01e0df41a1a381f + * tests/tsexp.c (check_extract_param): Cast void* pointers to char* + before doing arithmetics. + +2013-10-16 Dmitry Eremin-Solenikov + + ecc: Add support for GOST R 34.10-2001/-2012 signatures. + + commit 83902f1f1dbc8263a0c3f61be59cd2eb95293c97 + * src/cipher.h: define PUBKEY_FLAG_GOST + * cipher/ecc-curves.c: Add GOST2001-test and GOST2012-test curves + defined in standards. Typical applications would use either those + curves, or curves defined in RFC 4357 (will be added later). + * cipher/ecc.c (sign_gost, verify_gost): New. + (ecc_sign, ecc_verify): use sign_gost/verify_gost if PUBKEY_FLAG_GOST + is set. + (ecc_names): add "gost" for gost signatures. + * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist, + _gcry_pk_util_preparse_sigval): set PUBKEY_FLAG_GOST if gost flag + is present in s-exp. + * tests/benchmark.c (ecc_bench): also benchmark GOST signatures. + * tests/basic.c (check_pubkey): add two public keys from + GOST R 34.10-2012 standard. + (check_pubkey_sign_ecdsa): add two data sets to check gost signatures. + * tests/curves.c: correct N_CURVES as we now have 2 more curves. + + + Removed some comments from the new curve definitions in ecc-curves.c + to avoid line wrapping. Eventually we will develop a precompiler to + avoid parsing those hex strings. -wk + + Fix 256-bit ecdsa test key definition. + + commit 187b2bb541b985255aee262d181434a7cb4ae2e7 + * tests/basic.c (check_pubkey): fix nistp256 testing key declaration - + add missing comma. + +2013-10-16 Werner Koch + + sexp: Add function gcry_sexp_extract_param. + + commit a329b6abf00c990faf1986f9fbad7b4d71c13bcb + * src/gcrypt.h.in (_GCRY_GCC_ATTR_SENTINEL): New. + (gcry_sexp_extract_param): New. + * src/visibility.c (gcry_sexp_extract_param): New. + * src/visibility.h (gcry_sexp_extract_param): Add hack to detect + internal use. + * cipher/pubkey-util.c (_gcry_pk_util_extract_mpis): Move and split + into ... + * src/sexp.c (_gcry_sexp_vextract_param) + (_gcry_sexp_extract_param): this. Change all callers. Add support for b= uffer + descriptors and a path option/ + + * tests/tsexp.c (die, hex2buffer, hex2mpi, hex2mpiopa): New. + (cmp_mpihex, cmp_bufhex): New. + (check_extract_param): New. + +2013-10-16 NIIBE Yutaka + + mpi: mpi-pow improvement. + + commit 45aa6131e93fac89d46733b3436d960f35fb99b2 + * mpi/mpi-pow.c (gcry_mpi_powm): New implementation of left-to-right + k-ary exponentiation. + +2013-10-15 Werner Koch + + ecc: Support use of Ed25519 with ECDSA. + + commit 537969fbbb1104b8305a7edb331b7666d54eff2c + * src/cipher.h (PUBKEY_FLAG_ECDSA): New. + * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist): Add flag "ecdsa". + * cipher/ecc.c (verify_ecdsa, verify_eddsa): Remove some debug output. + (ecc_generate, ecc_sign, ecc_verify): Support Ed25519 with ECDSA. + * tests/keygen.c (check_ecc_keys): Create such a test key. + * tests/pubkey.c (fail, info, data_from_hex, extract_cmp_data): New. + Take from dsa-6979.c + (check_ed25519ecdsa_sample_key): new. + (main): Call new test. + +2013-10-14 Werner Koch + + pubkey: Support flags list in gcry_pk_genkey. + + commit d3a605d7827b8a73ef844e9e5183590bd6b1389a + * src/cipher.h (PUBKEY_FLAG_TRANSIENT_KEY): New. + (PUBKEY_FLAG_USE_X931): New. + (PUBKEY_FLAG_USE_FIPS186): New. + (PUBKEY_FLAG_USE_FIPS186_2): New. + * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist): Rename from + parse_flags_list. Parse new flags. + * cipher/dsa.c (dsa_generate): Support flag list. + * cipher/ecc.c (ecc_generate): Ditto. + * cipher/rsa.c (rsa_generate): Ditto. + + pubkey: Remove duplicated flag parsing code. + + commit 5be2345ddec4147e535d5b039ee74f84bcacf9e4 + * cipher/pubkey-util.c (_gcry_pk_util_preparse_encval) + (_gcry_pk_util_data_to_mpi): Factor flag parsing code out to .. + (parse_flag_list): New. + * src/cipher.h (PUBKEY_FLAG_RAW_FLAG): New. + + mpicalc: Accept lowercase hex digits. + + commit 0cd551faa775ad5309a40629ae30bf86b75fca09 + * src/mpicalc.c (main): Test for lowercase hex digits. + +2013-10-11 Werner Koch + + pubkey: Move sexp parsing of remaining fucntions to the modules. + + commit a951c061523e1c13f1358c9760fc3a9d787ab2d4 + * cipher/pubkey.c (release_mpi_array): Remove. + (pubkey_check_secret_key): Remove. + (sexp_elements_extract): Remove. + (sexp_elements_extract_ecc): Remove. + (sexp_to_key): Remove. + (get_hash_algo): Remove. + (gcry_pk_testkey): Revamp. + (gcry_pk_get_curve): Revamp. + * cipher/rsa.c (rsa_check_secret_key): Revamp. + * cipher/elgamal.c (elg_check_secret_key): Revamp. + * cipher/dsa.c (dsa_check_secret_key): Revamp. + * cipher/ecc.c (ecc_check_secret_key): Revamp. + * cipher/ecc-curves.c: Include cipher.h and pubkey-internal.h + (_gcry_ecc_get_curve): Revamp. + + * cipher/pubkey-util.c (_gcry_pk_util_extract_mpis): Set passed and + used parameters on error to NULL. + + pubkey: Move sexp parsing for gcry_pk_decrypt to the modules. + + commit 07950c865a901afc48acb46f0695040cadfd5068 + * cipher/rsa.c (rsa_decrypt): Revamp. + * cipher/elgamal.c (elg_decrypt): Revamp. + * cipher/ecc.c (ecc_decrypt_raw): Revamp. + * cipher/pubkey.c (gcry_pk_decrypt): Simplify. + (sexp_to_enc): Remove. + * cipher/pubkey-util.c (_gcry_pk_util_preparse_encval): New. + + pubkey: Move sexp parsing for gcry_pk_encrypt to the modules. + + commit 6bd5d18c45a4a3ce8f0f66f56c83b80594877f53 + * cipher/rsa.c (rsa_encrypt): Revamp. + * cipher/elgamal.c (elg_encrypt): Revamp. + * cipher/ecc.c (ecc_encrypt_raw): Revamp. + * cipher/pubkey.c (gcry_pk_encrypt): Simplify. + + * tests/basic.c (check_pubkey_crypt): Init plain, ciph, and data so + that they are initialized even after an encrypt failure. + + pubkey: Move sexp parsing for gcry_pk_sign to the modules. + + commit d0ae6635e4e6ae273c3a137c513d518f28f6eab3 + * cipher/rsa.c (rsa_sign): Revamp. + * cipher/dsa.c (dsa_sign): Revamp. + * cipher/elgamal.c (elg_sign): Revamp. + * cipher/ecc.c (ecc_sign): Revamp. + * cipher/pubkey.c (gcry_pk_sign): Simplify. + +2013-10-10 Jussi Kivilinna + + Prevent tail call optimization with _gcry_burn_stack. + + commit 150c0313f971bcea62d2802f0389c883e11ebb31 + * configure.ac: New check, HAVE_GCC_ASM_VOLATILE_MEMORY. + * src/g10lib.h (_gcry_burn_stack): Rename to __gcry_burn_stack. + (__gcry_burn_stack_dummy): New. + (_gcry_burn_stack): New macro. + * src/misc.c (_gcry_burn_stack): Rename to __gcry_burn_stack. + (__gcry_burn_stack_dummy): New. + +2013-10-09 Werner Koch + + pubkey: Move sexp parsing for gcry_pk_verify to the modules. + + commit 94b652ecb006c29fa2ffb1badc9f02b758581737 + * cipher/rsa.c (rsa_verify): Revamp. + * cipher/dsa.c (dsa_verify): Revamp. + * cipher/elgamal.c (elg_verify): Revamp. + * cipher/ecc.c (ecc_verify): Revamp. + * cipher/pubkey.c (sexp_to_sig): Remove. + (pss_verify_cmp): Move to pubkey-util.c + (sexp_data_to_mpi): Ditto. + (init_encoding_ctx): Ditto. + (gcry_pk_verify): Simplify. + * cipher/pubkey-util.c (_gcry_pk_util_init_encoding_ctx): Add. Take + from pubkey.c + (get_hash_algo): Ditto. + (_gcry_pk_util_data_to_mpi): Ditto. + (pss_verify_cmp): Ditto. + (_gcry_pk_util_extract_mpis): New. + (_gcry_pk_util_preparse_sigval): New. + (_gcry_pk_util_free_encoding_ctx): New. + * cipher/ecc-curves.c (_gcry_ecc_fill_in_curve): Make curve init + optional. + + * src/g10lib.h (GCC_ATTR_SENTINEL): New. + + * tests/basic.c (check_pubkey_sign): Print the algo name. + (main): Add option --pubkey. + +2013-10-08 Werner Koch + + pubkey: Move sexp parsing for gcry_pk_get_nbits to the modules. + + commit 4645f3728bb0900591b0aef85831fdee52c59e3c + * cipher/pubkey.c (spec_from_sexp): New. + (gcry_pk_get_nbits): Simplify. + * cipher/rsa.c (rsa_get_nbits): Take only PARMS as args and do sexp + parsing here. + * cipher/dsa.c (dsa_get_nbits): Ditto. + * cipher/elgamal.c (elg_get_nbits): Ditto. + * cipher/ecc.c (ecc_get_nbits): Ditto. + * cipher/ecc-curves.c (_gcry_ecc_fill_in_curve): Allow NULL for arg + CURVE. + + pubkey: Move sexp parsing for gcry_pk_getkey to the modules. + + commit 3816e46ce211e63adf46dbc775510aa137572248 + * cipher/pubkey-util.c: New. + (_gcry_pk_util_get_nbits): New. Based on code from gcry_pk_genkey. + (_gcry_pk_util_get_rsa_use_e): Ditto. + * cipher/pubkey.c (gcry_pk_genkey): Strip most code and pass. + * cipher/rsa.c (rsa_generate): Remove args ALGO, NBITS and EVALUE. + Call new fucntions to get these values. + * cipher/dsa.c (dsa_generate): Remove args ALGO, NBITS and EVALUE. + Call _gcry_pk_util_get_nbits to get nbits. Always parse genparms. + * cipher/elgamal.c (elg_generate): Ditto. + * cipher/ecc.c (ecc_generate): Ditto. + + cipher: Deprecate GCRY_PK_ELG_E. + + commit f79d3e13d3229115c47cbe5007647cb44105fe3f + * cipher/elgamal.c (_gcry_pubkey_spec_elg_e): Remove. + * cipher/pubkey.c (pubkey_list): Remove double included + _gcry_pubkey_spec_elg. + (map_algo): MAke ELG_E to ELG. + +2013-10-02 Werner Koch + + Provide Pth compatiblity for use with GnuPG 2.0. + + commit 2f767f6a17f7e99da4075882f7fe3ca597b31bdb + * src/ath.c (ath_install): Call ath_init and declare Pth as + compatible. + +2013-10-02 Jussi Kivilinna + + sha512: fix building on ARM. + + commit 6410152338a2b2ac1216e70c153cd16f9199c94e + * cipher/sha512.c (transform) [USE_ARM_NEON_ASM]: Fix 'hd' to 'ctx'. + +2013-10-02 Werner Koch + + Remove deprecated control codes. + + commit f04a1db22d982627ba87da4e5df52df9b994c779 + * src/gcrypt.h.in (GCRYCTL_SET_KEY): Remove. + (GCRYCTL_SET_IV): Remove. + (GCRYCTL_SET_CTR): Remove. + * cipher/md.c (gcry_md_ctl): Remove deprecated GCRYCTL_SET_KEY. + * cipher/cipher.c (gcry_cipher_ctl): Remove deprecated + GCRYCTL_SET_KEY, GCRYCTL_SET_IV, GCRYCTL_SET_CTR. + +2013-10-02 Dmitry Eremin-Solenikov + + Fix errors when building with Clang on PPC. + + commit 33757c1e03f1d885920633edf543cd1c77999455 + * mpi/longlong.h (add_ssaaaa, sub_ddmmss, count_leading_zeros, + umul_ppmm): Do not cast asm output to USItype. + +2013-10-02 Werner Koch + + Remove last remains of the former module system. + + commit 628ed5ba0ef4b1f04b5a77e29e4bc49a1fe13c07 + * src/gcrypt-module.h, src/module.c: Remove. + * src/visibility.h: Do not include gcrypt-module.h. + * src/g10lib.h: Remove all prototypes from module.c + (gcry_module): Remove. + * cipher/cipher-internal.h (gcry_cipher_handle): Remove unused field. + + Fix missing prototype warning in visibility.c. + + commit 52783d483293d48cd468143ae6ae2cccbfe17200 + * src/ec-context.h (_gcry_mpi_ec_new): Move prototype to mpi.h. + + md: Simplify the message digest dispatcher md.c. + + commit 0d39997932617ba20656f8bcc230ba744b76c87e + * src/gcrypt-module.h (gcry_md_spec_t): Move to ... + * src/cipher-proto.h: here. Merge with md_extra_spec_t. Add fields + ALGO and FLAGS. Set these fields in all digest modules. + * cipher/md.c: Change most code to replace the former module + system by a simpler system to gain information about the algorithms. + +2013-10-01 Werner Koch + + cipher: Simplify the cipher dispatcher cipher.c. + + commit 3ca180b25e8df252fc16f802cfdc27496e307830 + * src/gcrypt-module.h (gcry_cipher_spec_t): Move to ... + * src/cipher-proto.h (gcry_cipher_spec_t): here. Merge with + cipher_extra_spec_t. Add fields ALGO and FLAGS. Set these fields in + all cipher modules. + * cipher/cipher.c: Change most code to replace the former module + system by a simpler system to gain information about the algorithms. + (disable_pubkey_algo): Simplified. Not anymore thread-safe, though. + + * cipher/md.c (_gcry_md_selftest): Use correct structure. Not a real + problem because both define the same function as their first field. + + * cipher/pubkey.c (_gcry_pk_selftest): Take care of the disabled flag. + + mpi: Fix gcry_mpi_neg. + + commit 4153fa859816e799e506055321a22e6450aacdcc + * mpi/mpiutil.c (_gcry_mpi_neg): Copy U to W. + +2013-10-01 Peter Wu + + cipher: Add support for 128-bit keys in RC2. + + commit 738177ec0eae05069ec61bc4f724a69d4e052e42 + * cipher/rfc2268.c (oids_rfc2268_128): New + (_gcry_cipher_spec_rfc2268_128): New. + * cipher/cipher.c (cipher_table_entry): Add GCRY_CIPHER_RFC2268_128. + +2013-09-30 Werner Koch + + ecc: Use faster b parameter for Ed25519. + + commit 1d85452412b65e7976bc94969fc513ff6b880ed8 + * cipher/ecc-curves.c (domain_parms): Replace b. + * tests/t-mpi-point.c (test_curve): Ditto. + + ecc: Prepare for future Ed25519 optimization. + + commit a2618c822e666d4121cba29bee3fd50bf70c9743 + * mpi/ec-ed25519.c: New but empty file. + * mpi/ec-internal.h: New. + * mpi/ec.c: Include ec-internal.h. + (ec_mod): New. + (ec_addm): Use ec_mod. + (ec_mulm): Remove commented code. Use ec_mod. + (ec_subm): Call simple sub. + (ec_pow2): Use ec_mulm. + (ec_mul2): New. + (dup_point_weierstrass): Use ec_mul2. + (dup_point_twistededwards): Add special case for a =3D=3D -1. Use + ec_mul2. + (add_points_weierstrass): Use ec_mul2. + (add_points_twistededwards): Add special case for a =3D=3D -1. + (_gcry_mpi_ec_curve_point): Ditto. + (ec_p_init): Add hack to test Barrett functions. + * src/ec-context.h (mpi_ec_ctx_s): Add P_BARRETT. + + * mpi/mpi-mod.c (_gcry_mpi_mod_barrett): Fix sign problem. + + ecc: Fix recomputing of Q for Ed25519. + + commit c325adb8f5092b80a626bd3bb5e49cf7f3a29fc8 + * cipher/ecc-misc.c (reverse_buffer): New. + (_gcry_ecc_compute_public): Add ED255519 specific code. + * cipher/ecc.c (sign_eddsa): Allocate DIGEST in secure memory. Get + rid of HASH_D. + * tests/t-mpi-point.c (context_param): Test recomputing of Q for + Ed25519. + + log: Try to print s-expressions in a more compact format. + + commit d69a13d3d1c14ad6a6aa7cd349d6d2dfb152d422 + * src/misc.c (count_closing_parens): New. + (_gcry_log_printsxp): Use new function. + * mpi/ec.c (_gcry_mpi_point_log): Take care of a NULL point. + +2013-09-30 Jussi Kivilinna + + Make Whirlpool use the _gcry_md_block_write helper. + + commit 68cefd0f1d60ac33b58031df9b1d165cb1bf0f14 + * cipher/whirlpool.c (whirlpool_context_t): Add 'bctx', remove + 'buffer', 'count' and 'nblocks'. + (whirlpool_init): Initialize 'bctx'. + (whirlpool_transform): Adjust context argument type and burn stack + depth. + (whirlpool_add): Remove. + (whirlpool_write): Use _gcry_md_block_write. + (whirlpool_final, whirlpool_read): Adjust for 'bctx' usage. + + whirlpool: add stack burning after transform. + + commit a96d622e1a36d40d1504b7ada567e90ec9957443 + * cipher/whirlpool.c (whirlpool_transform): Return burn stack depth. + (whirlpool_add): Do burn_stack. + + whirlpool: do bitcount calculation in finalization part. + + commit 10d7351411f19bb2c03d2e24ca5a38dabe45023b + * cipher/whirlpool.c (whirlpool_context_t): Remove 'length', add + 'nblocks'. + (whirlpool_add): Update 'nblocks' instead of 'length', and add early + return at one spot. + (whirlpool_write): Check for 'nblocks' overflow. + (whirlpool_final): Convert 'nblocks' to bit-counter, and use + whirlpool_write instead of whirlpool_add. + +2013-09-30 Werner Koch + + Add logging functions to the API. + + commit d2076f27bb7c5d505abf25fc622d21794c4a5df3 + * src/gcrypt.h.in (_GCRY_GCC_ATTR_PRINTF): New. + (gcry_log_debug, gcry_log_debughex, gcry_log_debugmpi): New. + (gcry_log_debugpnt, gcry_log_debugsxp): New. + * src/visibility.c (gcry_log_debug): New. + (gcry_log_debughex, gcry_log_debugmpi, gcry_log_debugpnt): New. + (gcry_log_debugsxp): New. + * src/libgcrypt.def, src/libgcrypt.vers: Add new functions. + * src/misc.c (_gcry_logv): Make public. + (_gcry_log_printsxp): New. + * src/g10lib.h (log_printsxp): New macro. + +2013-09-26 Jussi Kivilinna + + Make libgcrypt build with Clang on i386. + + commit db60d828137c4f3682ca4ca2a54fe3d96d3db5f9 + * cipher/longlong.h [__i386__] (add_ssaaaa, sub_ddmmss) + (umul_ppmm, udiv_qrnnd): Do not cast asm output to USItype. + +2013-09-25 Werner Koch + + mpi: Change not yet used _gcry_mpi_set_opaque_copy. + + commit 1c6660debdbf1e4c3e80074c846a3e3097f214bb + * mpi/mpiutil.c (_gcry_mpi_set_opaque_copy): Change prototype. + (_gcry_mpi_get_opaque_copy): Take care of gcry_malloc failure. + + sexp: Improve printing of data with a leading zero. + + commit 9b7c49971588edf6acfc74bfb797eb79d19cb350 + * src/sexp.c (suitable_encoding): Detect leading zero byte. + + ecc: Allow the name "q@eddsa" to get/set the public key. + + commit d6683d2a6065986a9198d2d2eaa02c005b68cea4 + * cipher/ecc-curves.c (_gcry_ecc_get_mpi): Support "q@eddsa". + (_gcry_ecc_set_mpi): Support "q". + * cipher/ecc.c (eddsa_encodepoint): Rename to ... + (_gcry_ecc_eddsa_encodepoint): this and make global. Remove arg + MINLEN and take from context. + (eddsa_decodepoint): Rename to + (_gcry_ecc_eddsa_decodepoint): this and make global. Remove arg LEN + and take from context. + (sign_eddsa, verify_eddsa): Take B from context. + (ecc_sign, ecc_verify): Add hack to set DIALECT. + (_gcry_pk_ecc_get_sexp): Use _gcry_ecc_compute_public. Handle EdDSA. + * src/ec-context.h (mpi_ec_ctx_s): Add field NBITS. + * mpi/ec.c (ec_p_init): Init NBITS. + * tests/t-mpi-point.c (test_curve): Add Ed25519. + (sample_ed25519_q): New. + (context_param): Check new sample key. + (hex2buffer, hex2mpiopa): New. + (cmp_mpihex): Take care of opaque MPIs. + + mpicalc: Add statement to compute the number of bits. + + commit 9a4447ccd1b90bcd701941e80a7f484a1825fcea + * src/mpicalc.c (do_nbits): New. + (main): Add statement 'b'. + + ecc: Refactor low-level access functions. + + commit 64a7d347847d606eb5f4c156e24ba060271b8f6b + * mpi/ec.c (point_copy): Move to cipher/ecc-curves.c. + (ec_get_reset): Rename to _gcry_mpi_ec_get_reset and make global. + (_gcry_mpi_ec_get_mpi): Factor most code out to _gcry_ecc_get_mpi. + (_gcry_mpi_ec_get_point): Factor most code out to _gcry_ecc_get_point. + (_gcry_mpi_ec_set_mpi): Factor most code out to _gcry_ecc_set_mpi. + (_gcry_mpi_ec_set_point): Factor most code out to _gcry_ecc_set_point. + * cipher/ecc-curves.c (_gcry_ecc_get_mpi): New. + (_gcry_ecc_get_point, _gcry_ecc_set_mpi, _gcry_ecc_set_point): New. + * cipher/ecc-misc.c (_gcry_ecc_compute_public): New. + + ecc: Fix highly unlikely endless loop in sign_ecdsa. + + commit 1f5f4452e5bca105ec2197a4facbf9778e7dc31e + * cipher/ecc.c (sign_ecdsa): Turn while-do into do-while loops. + +2013-09-24 Werner Koch + + ecc: Allow the use of an uncompressed public key. + + commit df013c9820709421ef9550158ac5df0060d73379 + * cipher/ecc.c (eddsa_encodepoint): Factor most code out to ... + (eddsa_encode_x_y): new fucntion. + (eddsa_decodepoint): Allow use of an uncompressed public key. + * tests/t-ed25519.c (N_TESTS): Adjust. + * tests/t-ed25519.inp: Add test 1025. + +2013-09-23 Werner Koch + + pk: Add algo id GCRY_PK_ECC and deprecate ECDSA and ECDH. + + commit d5f91466695c5736f441c9bf1998436184a4bf61 + * src/gcrypt.h.in (GCRY_PK_ECC): New. + * cipher/pubkey.c (map_algo): New. + (spec_from_algo, gcry_pk_get_param, _gcry_pk_selftest): Use it. + * cipher/ecc.c (selftests_ecdsa): Report using GCRY_PK_ECC. + (run_selftests): Simplify. + (ecdh_names, ecdsa_names): Merge into a new ecc_names. + (_gcry_pubkey_spec_ecdh, _gcry_pubkey_spec_ecdsa): Merge into new + _gcry_pubkey_spec_ecc. + + ec: Use mpi_mulm instead of mpi_powm. + + commit 4552437bb3c5ff96a889fd31e4bc504b2a12fac7 + * mpi/ec.c (ec_pow2): New. + (ec_powm): Remove call to mpi_abs. + (dup_point_weierstrass, dup_point_twistededwards) + (add_points_weierstrass, add_points_twistededwards) + (_gcry_mpi_ec_curve_point): Use ec_pow2. + +2013-09-21 Jussi Kivilinna + + bufhelp: enable fast unaligned memory accesses on powerpc. + + commit 925d4fb3e8f2df3c5566ec6b5df7620a3d3504e5 + * cipher/bufhelp.h [__powerpc__] (BUFHELP_FAST_UNALIGNED_ACCESS): Set + macro enabled. + [__powerpc64__] (BUFHELP_FAST_UNALIGNED_ACCESS): Ditto. + + Remove i386 inline assembly version of rotation functions. + + commit cfea5c28a3822e1e7e401e5107ebe07ba7fdcf37 + * cipher/bithelp.h (rol, ror): Remove i386 version, change + macros to inline functions. + * src/hmac256.c (ror): Ditto. + + Optimize and cleanup 32-bit and 64-bit endianess transforms. + + commit 9337e03824a5bdd3bbbcb8382cabefe6d6c32e1e + * cipher/bithelp.h (bswap32, bswap64, le_bswap32, be_bswap32) + (le_bswap64, be_bswap64): New. + * cipher/bufhelp.h (buf_get_be32, buf_get_le32, buf_put_le32) + (buf_put_be32, buf_get_be64, buf_get_le64, buf_put_be64) + (buf_put_le64): New. + * cipher/blowfish.c (do_encrypt_block, do_decrypt_block): Use new + endian conversion helpers. + (do_bf_setkey): Turn endian specific code to generic. + * cipher/camellia.c (GETU32, PUTU32): Use new endian conversion + helpers. + * cipher/cast5.c (rol): Remove, use rol from bithelp. + (F1, F2, F3): Fix to use rol from bithelp. + (do_encrypt_block, do_decrypt_block, do_cast_setkey): Use new endian + conversion helpers. + * cipher/des.c (READ_64BIT_DATA, WRITE_64BIT_DATA): Ditto. + * cipher/md4.c (transform, md4_final): Ditto. + * cipher/md5.c (transform, md5_final): Ditto. + * cipher/rmd160.c (transform, rmd160_final): Ditto. + * cipher/salsa20.c (LE_SWAP32, LE_READ_UINT32): Ditto. + * cipher/scrypt.c (READ_UINT64, LE_READ_UINT64, LE_SWAP32): Ditto. + * cipher/seed.c (GETU32, PUTU32): Ditto. + * cipher/serpent.c (byte_swap_32): Remove. + (serpent_key_prepare, serpent_encrypt_internal) + (serpent_decrypt_internal): Use new endian conversion helpers. + * cipher/sha1.c (transform, sha1_final): Ditto. + * cipher/sha256.c (transform, sha256_final): Ditto. + * cipher/sha512.c (__transform, sha512_final): Ditto. + * cipher/stribog.c (transform, stribog_final): Ditto. + * cipher/tiger.c (transform, tiger_final): Ditto. + * cipher/twofish.c (INPACK, OUTUNPACK): Ditto. + * cipher/whirlpool.c (buffer_to_block, block_to_buffer): Ditto. + * configure.ac (gcry_cv_have_builtin_bswap32): Check for compiler + provided __builtin_bswap32. + (gcry_cv_have_builtin_bswap64): Check for compiler provided + __builtin_bswap64. + + gostr3411_94: set better burn stack depth estimate. + + commit 7409de7bc28ff8847c9d71d8c3e35e1968d59d60 + * cipher/gost28147.c (_gcry_gost_enc_one): Account function stack to + burn stack depth. + * cipher/gostr3411-94.c (max): New macro. + (do_hash_step, transform): Return stack burn depth. + + Use hash transform function return type for passing burn stack depth. + + commit 592c2ab3deeeccbb6d3b078ed7bf0e6627c8e1fb + * cipher/gostr4311-94.c (transform): Return stack burn depth. + * cipher/hash-common.c (_gcry_md_block_write): Use stack burn depth + returned by 'hd->bwrite'. + * cipher/hash-common.h (_gcry_md_block_write_t): Change return type to + 'unsigned int'. + (gry_md_block_ctx_t): Remove 'stack_burn'. + * cipher/md4.c (transform): Return stack burn depth. + (md4_final): Use stack burn depth from transform. + * cipher/md5.c (transform): Return stack burn depth. + (md5_final): Use stack burn depth from transform. + * cipher/rmd160.c (transform): Return stack burn depth. + (rmd160_final): Use stack burn depth from transform. + * cipher/sha1.c (transform): Return stack burn depth. + (sha1_final): Use stack burn depth from transform. + * cipher/sha256.c (transform): Return stack burn depth. + (sha256_final): Use stack burn depth from transform. + * cipher/sha512.c (__transform, transform): Return stack burn depth. + (sha512_final): Use stack burn depth from transform. + * cipher/stribog.c (transform64): Return stack burn depth. + * cipher/tiger.c (transform): Return stack burn depth. + (tiger_final): Use stack burn depth from transform. + + Make STRIBOG use the new _gcry_md_block_write helper. + + commit 902ea6052c11108bd19333c31b03e084bed1fb86 + * cipher/stribog.c (STRIBOG_STRUCT): Add 'bctx' and remove 'buf' and + 'count'. + (stribog_init_512): Initialize 'bctx'. + (transform64): New function. + (stribog_write): Remove. + (stribog_final): Use _gcry_md_block_write and bctx. + (_gcry_digest_spec_stribog_256, _gcry_digest_spec_stribog_512): Use + _gcry_md_block_write. + + Make SHA-512 use the new _gcry_md_block_write helper. + + commit cce7449efe471b076c5a97929ac8907162011394 + * cipher/hash-common.c (_gcry_md_block_write): Check that hd->buf is + large enough. + * cipher/hash-common.h (MD_BLOCK_MAX_BLOCKSIZE, MD_NBLOCKS_TYPE): New + macros. + (gcry_md_block_ctx_t): Use above macros for 'nblocks' and 'buf'. + * cipher/sha512.c (SHA512_STATE): New struct. + (SHA512_CONTEXT): Add 'bctx' and 'state'. + (sha512_init, sha384_init): Initialize 'bctx'. + (__transform, _gcry_sha512_transform_armv7_neon): Use SHA512_STATE for + 'hd'. + (transform): For now, do not return burn stack. + (sha512_write): Remove. + (sha512_final): Use _gcry_md_block_write and bctx. + (_gcry_digest_spec_sha512, _gcry_digest_spec_sha384): Use + _gcry_md_block_write. + +2013-09-20 Werner Koch + + sexp: Change internal versions to always use gpg_err_code_t. + + commit 3e5cfa20acfeccb9df2c3fae2730344b40b36104 + * src/sexp.c (gcry_sexp_new, gcry_sexp_create, gcry_sexp_build) + (gcry_sexp_build_array, gcry_sexp_canon_len): Change error return type + from gpg_error_t to gpg_err_code_t. Remove all calls to gpg_error. + * src/visibility.c (gcry_sexp_new, gcry_sexp_create, gcry_sexp_sscan) + (gcry_sexp_build, gcry_sexp_build_array, gcry_sexp_canon_len): Map + error codes via gpg_error. + * cipher/dsa.c, cipher/ecc.c, cipher/elgamal.c, cipher/rsa.c: Remove + use gpg_err_code wrappers. + + pk: Move s-exp creation for gcry_pk_decrypt to the modules. + + commit 722bfc1e5f2268453db62f38cc46b5ec6ef3adee + * cipher/pubkey.c (sexp_to_enc): Remove RET_MODERN arg and merge it + into FLAGS. + (gcry_pk_decrypt): Move result s-exp building into the modules. + * src/cipher-proto.h (gcry_pk_decrypt_t): Add some args. + * cipher/ecc.c (ecc_decrypt_raw): Change to return an s-exp. + * cipher/elgamal.c (elg_decrypt): Ditto. + * cipher/rsa.c (rsa_decrypt): Ditto. + (rsa_blind, rsa_unblind): Merge into rsa_decrypt. This saves several + extra MPI allocations. + + pk: Remove unused function. + + commit 64cd7ab93da7c95cc8aa320c61c6e29f9e2399c4 + * cipher/pubkey.c (_gcry_pk_aliased_algo_name): Remove + +2013-09-19 Werner Koch + + Beautify debug output of the prime generator. + + commit 6576f0a7684292cb5691bfcabad0acca4c06c014 + * cipher/primegen.c: Adjust output of log_mpidump to recently changed + log_mpidump code changes. + + pk: Move s-expr creation for genkey to the modules. + + commit 1bf08850bf9343146c938bc03917417e16393e9a + * cipher/pubkey.c (pubkey_generate): Fold into gcry_pk_genkey + (gcry_pk_genkey): Move result s-exp creation into the modules. + * cipher/dsa.c (dsa_generate): Create result as s-exp. + * cipher/elgamal.c (elg_generate): Ditto. + * cipher/rsa.c (rsa_generate): Ditto. + * cipher/ecc.c (ecc_generate): Ditto. + * src/cipher-proto.h (pk_ext_generate_t): Remove type + (gcry_pk_spec): and remove from struct. + + tests: Beautify some diagnostics. + + commit 2fe084873333c4d67bcfba0b527d63cd3cff6c47 + * tests/benchmark.c (ecc_bench): Print the key sexp in very verbose + mode. + (main): Add option --pk-count. + * tests/keygen.c: Add Elgamal generation and improved diagnostics. + * tests/t-ed25519.c (check_ed25519): Print running number of tests + done. + + sexp: Improve printing data representing a negative number. + + commit b3f3d47d347c14ed41d755cee580f000309b9c03 + * src/sexp.c (suitable_encoding): Detect a negative number. + + pk: Move RSA encoding functions to a new file. + + commit 071f70b9a766187fc70f6abc6a69d50752449285 + * cipher/rsa-common: New. + * cipher/pubkey.c (pkcs1_encode_for_encryption): Move to rsa-common.c + and rename to _gcry_rsa_pkcs1_encode_for_enc. + (pkcs1_decode_for_encryption): Move to rsa-common.c and rename to + _gcry_rsa_pkcs1_decode_for_enc. + (pkcs1_encode_for_signature): Move to rsa-common.c and rename to + _gcry_rsa_pkcs1_encode_for_sig. + (oaep_encode): Move to rsa-common.c and rename to + _gcry_rsa_oaep_encode. + (oaep_decode): Move to rsa-common.c and rename to + _gcry_rsa_oaep_decode. + (pss_encode): Move to rsa-common.c and rename to _gcry_rsa_pss_encode. + (pss_verify): Move to rsa-common.c and rename to _gcry_rsa_pss_decode. + (octet_string_from_mpi, mgf1): Move to rsa-common.c. + + pk: Move s-expr creation for sign and encrypt to the modules. + + commit eca9e2e50ddd4c9020fe1d4a9a3c77d20ebb90f6 + * cipher/pubkey.c (pubkey_encrypt): Fold into gcry_pk_encrypt. + (pubkey_decrypt): Fold into gcry_pk_decrypt. + (pubkey_sign): Fold into gcry_pk_sign. + (pubkey_verify): Fold into gcry_pk_verify. + (octet_string_from_mpi): Make it a wrapper and factor code out to ... + * mpi/mpicoder.c (_gcry_mpi_to_octet_string): New function. + + * src/cipher.h (PUBKEY_FLAG_FIXEDLEN): New. + * cipher/pubkey.c (sexp_data_to_mpi): Set flag for some encodings. + (gcry_pk_encrypt): Simply by moving the s-expr generation to the modules. + (gcry_pk_sign): Ditto. + * cipher/dsa.c (dsa_sign): Create s-expr. + * cipher/elgamal.c (elg_encrypt, elg_sign): Ditto. + * cipher/rsa.c (rsa_encrypt, rsa_sign): Ditto. + * cipher/ecc.c (ecc_sign, ecc_encrypt_raw): Ditto. + (ecdsa_names): Add "eddsa". + * tests/t-ed25519.c (one_test): Expect "eddsa" token. + +2013-09-19 Dmitry Eremin-Solenikov + + Fix Stribog digest on bigendian platforms. + + commit d399faf5db71d429bfd6fa4a9cfc82e2a55055f0 + * cipher/stribog.c (stribog_final): swap bytes in the result of digest + calculations. + +2013-09-18 Werner Koch + + pk: Simplify the public key dispatcher pubkey.c. + + commit 85722afb379f7a392a8117b895de273fd88c4ebc + * src/cipher-proto.h (gcry_pk_spec_t): Add fields ALGO and FLAGS. + * cipher/dsa.c (_gcry_pubkey_spec_dsa): Set these fields. + * cipher/ecc.c (_gcry_pubkey_spec_ecdsa): Ditto. + (_gcry_pubkey_spec_ecdh): Ditto. + * cipher/rsa.c (_gcry_pubkey_spec_rsa): Ditto. + * cipher/elgamal.c (_gcry_pubkey_spec_elg): Ditto + (_gcry_pubkey_spec_elg_e): New. + * cipher/pubkey.c: Change most code to replace the former module + system by a simpler system to gain information about the algorithms. + (disable_pubkey_algo): SImplified. Not anymore thread-safe, though. + + pk: Merge extraspecs struct with standard specs struct. + + commit 89103ce00e862cc709e80fa41f2ee13d54093ec5 + * src/gcrypt-module.h (gcry_pk_spec_t): Move this typedef and the + corresponding function typedefs to ... + * src/cipher-proto.h: here. + (pk_extra_spec_t): Remove typedef and merge fields into + gcry_pk_spec_t. + * cipher/rsa.c, cipher/dsa.c, cipher/elg.c, cipher/ecc.c: Ditto. + * cipher/pubkey.c: Change accordingly. + * src/cipher.h (_gcry_pubkey_extraspec_rsa): Remove. + (_gcry_pubkey_extraspec_dsa): Remove. + (_gcry_pubkey_extraspec_elg): Remove. + (_gcry_pubkey_extraspec_ecdsa): Remove. + +2013-09-18 Jussi Kivilinna + + Fix encryption/decryption return type for GOST28147. + + commit 2ad7ea9cb388fd31e4b0852b68d77f599ef4adce + * cipher/gost.h (_gcry_gost_enc_one): Change return type to + 'unsigned int'. + * cipher/gost28147.c (max): New macro. + (gost_encrypt_block, gost_decrypt_block): Return burn stack depth. + (_gcry_gost_enc_one): Return burn stack depth from gost_encrypt_block. + +2013-09-18 Dmitry Eremin-Solenikov + + doc: fix building of ps and pdf documentation. + + commit bd33fa21c9afc6c81e0da24016fc13001e9c7390 + * doc/gcrypt.texi, doc/gpl.texi, doc/lgpl.texi: fix texinfo errors. + + Add GOST R 34.11-2012 implementation (Stribog) + + commit c22064bdd773a807801e300aa9214b2fdcafcf20 + * src/gcrypt.h.in (GCRY_MD_GOSTR3411_12_256) + (GCRY_MD_GOSTR3411_12_512): New. + * cipher/stribog.c: New. + * configure.ac (available_digests_64): Add stribog. + * src/cipher.h: Declare Stribog declarations. + * cipher/md.c: Register Stribog digest. + * tests/basic.c (check_digests) Add 4 testcases for Stribog from + standard. + * doc/gcrypt.texi: Document new constants. + + Add basic implementation of GOST R 34.11-94 message digest. + + commit b0579baaa04fb91eabbbdc295bcabea04cf84056 + * src/gcrypt.h.in (GCRY_MD_GOSTR3411_94): New. + * cipher/gostr3411-94.c: New. + * configure.ac (available_digests): Add gostr3411-94. + * src/cipher.h: Add gostr3411-94 definitions. + * cipher/md.c: Register GOST R 34.11-94. + * tests/basic.c (check_digests): Add 4 tests for GOST R 34.11-94 + hash algo. Two are defined in the standard itself, two other are + more or less common tests - an empty string an exclamation mark. + * doc/gcrypt.texi: Add an entry describing GOST R 34.11-94 to the MD + algorithms table. + + Separate common md block code. + + commit ecde77ad98690540abb21db08e5531297ed72bd0 + * cipher/hash-common.c (_gcry_md_block_write): New function to handle + block md operations. The current implementation is limited to 64 byte + buffer and u32 block counter. + + * cipher/md4.c, cipher/md5.c, cipher/rmd.h, cipher/rmd160.c + *cipher/sha1.c, cipher/sha256.c, cipher/tiger.c: Convert to use + _gcry_md_block_write. + + Add limited implementation of GOST 28147-89 cipher. + + commit 56b5949f71f501744998f5ebc12488ebf6f1c0b5 + * src/gcrypt.h.in (GCRY_CIPHER_GOST28147): New. + * cipher/gost.h, cipher/gost28147.c: New. + * configure.ac (available_ciphers): Add gost28147. + * src/cipher.h: Add gost28147 definitions. + * cipher/cipher.c: Register gost28147. + * tests/basic.c (check_ciphers): Enable simple test for gost28147. + * doc/gcrypt.texi: document GCRY_CIPHER_GOST28147. + +2013-09-18 Werner Koch + + ecc: Add Ed25519 key generation and prepare for optimizations. + + commit 63cd3474425cb5a7ec4d1a56be15b248ecda4680 + * src/mpi.h (enum ecc_dialects): New. + * src/ec-context.h (mpi_ec_ctx_s): Add field DIALECT. + * cipher/ecc-common.h (elliptic_curve_t): Ditto. + * cipher/ecc-curves.c (ecc_domain_parms_t): Ditto. + (domain_parms): Add dialect values. + (_gcry_ecc_fill_in_curve): Set dialect. + (_gcry_ecc_get_curve): Ditto. + (_gcry_mpi_ec_new): Ditto. + (_gcry_ecc_get_param): Use ECC_DIALECT_STANDARD for now. + * cipher/ecc-misc.c (_gcry_ecc_curve_copy): Copy dialect. + (_gcry_ecc_dialect2str): New. + * mpi/ec.c (ec_p_init): Add arg DIALECT. + (_gcry_mpi_ec_p_internal_new): Ditto. + (_gcry_mpi_ec_p_new): Ditto. + + * mpi/mpiutil.c (gcry_mpi_set_opaque): Set the secure flag. + (_gcry_mpi_set_opaque_copy): New. + + * cipher/ecc-misc.c (_gcry_ecc_os2ec): Take care of an opaque MPI. + * cipher/ecc.c (eddsa_generate_key): New. + (generate_key): Rename to nist_generate_key and factor some code out + to ... + (ecc_generate_ext): here. Divert to eddsa_generate_key if desired. + (eddsa_decodepoint): Take care of an opaque MPI. + (ecc_check_secret_key): Ditto. + (ecc_sign): Ditto. + * cipher/pubkey.c (sexp_elements_extract_ecc): Store public and secret + key as opaque MPIs. + (gcry_pk_genkey): Add the curve_name also to the private key part of + the result. + + * tests/benchmark.c (ecc_bench): Support Ed25519. + (main): Add option --debug. + * tests/curves.c (sample_key_2): Make sure that P and N are positive. + * tests/keygen.c (show): New. + (check_ecc_keys): Support Ed25519. + +2013-09-17 Werner Koch + + mpi: Support printing of negative numbers. + + commit 89fe2173649a72019d75e059e6c6938efd10421f + * mpi/mpicoder.c (twocompl, onecompl): New. + (gcry_mpi_print): Use it for STD and SSH. + (gcry_mpi_scan): Use it for STD and SSH. Always set NSCANNED. + (gcry_mpi_aprint): Clear the extra allocated byte. + * tests/t-convert.c (showhex, showmpi): New. + (mpi2bitstr_nlz): New. + (check_formats): New. + (main): Call new test. + +2013-09-16 Werner Koch + + Fix bug in _gcry_mpi_tdiv_q_2exp. + + commit a7a9cdcaaf3979baa18dad51e722882581349f45 + * mpi/mpi-internal.h (MPN_COPY_INCR): Make it work. + + ecc: Implement Curve Ed25519 signing and verification. + + commit bc5199a02abe428ad377443280b3eda60141a1d6 + * cipher/ecc-curves.c (domain_parms): Add curve "Ed25519". + * cipher/ecc.c (reverse_buffer): New. + (eddsa_encodempi): New. + (eddsa_encodepoint): New. + (eddsa_decodepoint): New. + (sign_eddsa): Implement. + (verify_eddsa): Implement. + (ecc_sign): Init unused Q. Pass public key to sign_eddsa. + (ecc_verify): Init pk.Q if not used. Pass public key verbatim to + verify_eddsa. + * cipher/pubkey.c (sexp_elements_extract): Add arg OPAQUE. Change all + callers to pass 0. + (sexp_to_sig): Add arg OPAQUE and pass it to sexp_elements_extract. + (sexp_data_to_mpi): Allow for a zero length "value". + (gcry_pk_verify): Reorder parameter processing. Pass OPAQUE flag as + required. + * mpi/ec.c (ec_invm): Print a warning if the inverse does not exist. + (_gcry_mpi_ec_get_affine): Implement for our Twisted Edwards curve + model. + (dup_point_twistededwards): Implement. + (add_points_twistededwards): Implement. + (_gcry_mpi_ec_mul_point): Support Twisted Edwards. + + * mpi/mpicoder.c (do_get_buffer): Add arg FILL_LE. + (_gcry_mpi_get_buffer): Ditto. Change all callers. + (_gcry_mpi_get_secure_buffer): Ditto. + + * src/sexp.c (_gcry_sexp_nth_opaque_mpi): New. + + * tests/t-ed25519.c: New. + * tests/t-ed25519.inp: New. + * tests/t-mpi-point.c (basic_ec_math_simplified): Print some output + only in debug mode. + (twistededwards_math): New test. + (main): Call new test. + + mpi: Add internal convenience function. + + commit 44a2c34e90ed7de149952398787906d8823b636b + * mpi/mpiutil.c (_gcry_mpi_get_opaque_copy): New. + + mpi: Add debug function to print a point. + + commit 8ebc94d11a1eb93f2365c93f555e958700fdfbd4 + * mpi/ec.c (_gcry_mpi_point_log): New. + * src/mpi.h (log_printpnt): new macro. + + tests: Factor time measurement code out. + + commit 58eaf0c4332ac2f645ede28c4d18337389dfa753 + * tests/benchmark.c (started_at, stopped_at, start_timer, stop_timer) + (elapsed time): Factor out to .. + * tests/stopwatch.h: new file. + +2013-09-12 Werner Koch + + Fix _gcry_log_printmpi to print 00 instead of a sole sign. + + commit 1c76349c69c70a62b516a4f837c6287def640807 + * src/misc.c: Special case an mpi length of 0. + +2013-09-11 Werner Koch + + Streamline the use of the internal mpi and hex debug functions. + + commit e35ed615acc624a8b6c07576ea0650aac2bdb0db + * mpi/mpicoder.c (gcry_mpi_dump): Remove. + (_gcry_log_mpidump): Remove. + * src/misc.c (_gcry_log_printhex): Factor all code out to ... + (do_printhex): new. Add line wrapping a and compact printing. + (_gcry_log_printmpi): New. + * src/mpi.h (log_mpidump): Remove macro. + * src/g10lib.h (log_mpidump): Add compatibility macro. + (log_printmpi): New macro + * src/visibility.c (gcry_mpi_dump): Call _gcry_log_printmpi. + * cipher/primegen.c (prime_generate_internal): Replace gcry_mpi_dump + by log_printmpi. + (gcry_prime_group_generator): Ditto. + * cipher/pubkey.c: Remove extra colons from log_mpidump call. + * cipher/rsa.c (stronger_key_check): Use log_printmpi. + +2013-09-10 Werner Koch + + md: Add function gcry_md_hash_buffers. + + commit f3bca0c77c4979504f95fdbc618f7458e61e3e45 + * src/gcrypt.h.in (gcry_buffer_t): new. + (gcry_md_hash_buffers): New. + * src/visibility.c, src/visibility.h: Add wrapper for new function. + * src/libgcrypt.def, src/libgcrypt.vers: Export new function. + * cipher/md.c (gcry_md_hash_buffers): New. + * cipher/sha1.c (_gcry_sha1_hash_buffers): New. + * tests/basic.c (check_one_md_multi): New. + (check_digests): Run that test. + * tests/hmac.c (check_hmac_multi): New. + (main): Run that test. + + md: Fix Whirlpool flaw. + + commit 0a28b2d2c9181a536fc894e24626714832619923 + * cipher/whirlpool.c (whirlpool_add): Remove shortcut return so that + byte counter is always properly updated. + +2013-09-07 Jussi Kivilinna + + Fix static build on AMD64. + + commit 90fdf25f0dcc5feac7195ede55bd15948a11363e + * cipher/rijndael-amd64.S: Correct 'RIP' macro for non-PIC build. + + scrypt: fix for big-endian systems. + + commit 38a038a135d82231eff9d84f1ae3c4a25c6a5e75 + * cipher/scrypt.c (_salsa20_core): Fix endianess issues. + +2013-09-07 Werner Koch + + Use gcc "unused" attribute only with gcc >=3D 3.5. + + commit f7135e299e659d78906aac3dfdf30f380b5cf9c6 + * src/g10lib.h (GCC_ATTR_UNUSED): Fix gcc version detection. + +2013-09-07 Dmitry Eremin-Solenikov + + Add support for Salsa20/12 - 12 round version of Salsa20. + + commit ae6f6c47d2e0c536f3eab0823b5f23d26956cda2 + * src/gcrypt.h.in (GCRY_CIPHER_SALSA20R12): New. + * src/salsa20.c (salsa20_core, salsa20_do_encrypt_stream): Add support + for reduced round versions. + (salsa20r12_encrypt_stream, _gcry_cipher_spec_salsa20r12): Implement + Salsa20/12 - a 12 round version of Salsa20 selected by eStream. + * src/cipher.h: Declsare Salsa20/12 definition. + * cipher/cipher.c: Register Salsa20/12 + * tests/basic.c: (check_stream_cipher, check_stream_cipher_large_block): + Populate Salsa20/12 tests with test vectors from ecrypt + (check_ciphers): Add simple test for Salsa20/12 + +2013-09-07 Werner Koch + + Add configure option --disable-amd64-as-feature-detection. + + commit 49d5b9dcd622cdc87fb02a211bd51e3d46345bf2 + * configure.ac: Implement new disable flag. + + mpi: Improve support for non-Weierstrass support. + + commit 4d8c8c7aa88cddb1624301957e6245405f46d027 + * mpi/ec.c (ec_p_init): Add args MODEL and P. Change all callers. + (_gcry_mpi_ec_p_internal_new): Ditto. + (_gcry_mpi_ec_p_new): Ditto. + * cipher/ecc-curves.c (_gcry_ecc_fill_in_curve): Return + GPG_ERR_UNKNOWN_CURVE instead of invalid value. Init curve model. + * cipher/ecc.c (ecc_verify, ecc_encrypt_raw): Ditto. + * cipher/pubkey.c (sexp_data_to_mpi): Fix EDDSA flag error checking. + + mpi: Add gcry_mpi_ec_curve_point. + + commit ddfefe429660cc5d798f3517208936449247ae5c + * mpi/ec.c (_gcry_mpi_ec_curve_point): New. + (ec_powm): Return the absolute value. + * src/visibility.c, src/visibility.c: Add wrappers. + * src/libgcrypt.def, src/libgcrypt.vers: Export them. + + mpi: Add functions to manipulate the sign. + + commit 1bd2c67aa55b40589654d3fa5dea05cf1ed7dc5f + * src/gcrypt.h.in (gcry_mpi_is_neg): New. + (gcry_mpi_neg, gcry_mpi_abs): New. + * mpi/mpiutil.c (_gcry_mpi_is_neg): New. + (_gcry_mpi_neg, _gcry_mpi_abs): New. + * src/visibility.c, src/visibility.h: Add wrappers. + * src/libgcrypt.def, src/libgcrypt.vers: Export them. + * src/mpi.h (mpi_is_neg): New. Rename old macro to mpi_has_sign. + * mpi/mpi-mod.c (_gcry_mpi_mod_barrett): Use mpi_has_sign. + * mpi/mpi-mpow.c (calc_barrett): Ditto. + * cipher/primegen.c (_gcry_derive_x931_prime): Ditto + * cipher/rsa.c (secret): Ditto. + +2013-09-06 Jussi Kivilinna + + Tune armv6 mpi assembly. + + commit 4e4440153258e2f0dfdcaa8443820af06984ecb1 + * mpi/armv6/mpih-mul1.S: Tune assembly for Cortex-A8. + * mpi/armv6/mpih-mul2.S: Ditto. + * mpi/armv6/mpih-mul3.S: Ditto. + +2013-09-05 Jussi Kivilinna + + Change _gcry_burn_stack take burn depth as unsigned integer. + + commit e0ae31fcce3bd57b24751ff3c82cba820e493c3a + * src/misc.c (_gcry_burn_stack): Change to handle 'unsigned int' bytes. + + mpicalc: fix building on linux and win32. + + commit 50ec983666f0ca9d50c84aa1afad0d7bd5810779 + * src/Makefile.am (mpicalc): Adjust CFLAGS and LDADD. + +2013-09-04 Werner Koch + + Change mpicalc to use Libgcrypt and install it. + + commit 1d23040b659661b4086c079cb9fd5f37189a7020 + * src/mpicalc.c: Make use of gcry_ functions. + (MPICALC_VERSION): New. Set to 2.0. + (strusage): Remove. + (scan_mpi): New. Replaces mpi_fromstr. + (print_mpi): New. Replaces mpi_print. + (my_getc): New. + (print_help): New. + (main): Use simple option parser and print version info. + * src/Makefile.am (bin_PROGRAMS): Add mpicalc. + (mpicalc_SOURCES, mpicalc_CFLAGS, mpicalc_LDADD): New. + + Add mpicalc.c to help with testing. + + commit a70c46e29c480fa0f56ab4814666a5b115f84fd7 + * src/mpicalc.c: Take from GnuPG 1.4 + + Prepare support for EdDSA. + + commit c47d4001033f68212d2847b3074a0bdda990342e + * src/cipher.h (PUBKEY_FLAG_EDDSA): New. + * cipher/pubkey.c (pubkey_verify): Repalce args CMP and OPAQUEV by + CTX. Pass flags and hash algo to the verify function. Change all + verify functions to accept these args. + (sexp_data_to_mpi): Implement new flag "eddsa". + (gcry_pk_verify): Pass CTX instead of the compare function to + pubkey_verify. + * cipher/ecc.c (sign): Rename to sign_ecdsa. Change all callers. + (verify): Rename to verify_ecdsa. Change all callers. + (sign_eddsa, verify_eddsa): New stub functions. + (ecc_sign): Divert to sign_ecdsa or sign_eddsa. + (ecc_verify): Divert to verify_ecdsa or verify_eddsa. + + Prepare support for non-Weierstrass EC equations. + + commit c26be7a337d0bf98193bc58e043209e46d0769bb + * src/mpi.h (gcry_mpi_ec_models): New. + * src/ec-context.h (mpi_ec_ctx_s): Add MODEL. + * cipher/ecc-common.h (elliptic_curve_t): Ditto. + * cipher/ecc-curves.c (ecc_domain_parms_t): Ditto. + (domain_parms): Mark als as Weierstrass. + (_gcry_ecc_fill_in_curve): Check model. + (_gcry_ecc_get_curve): Set model to Weierstrass. + * cipher/ecc-misc.c (_gcry_ecc_model2str): New. + * cipher/ecc.c (generate_key, ecc_generate_ext): Print model in the + debug output. + + * mpi/ec.c (_gcry_mpi_ec_dup_point): Switch depending on model. + Factor code out to ... + (dup_point_weierstrass): new. + (dup_point_montgomery, dup_point_twistededwards): New stub functions. + (_gcry_mpi_ec_add_points): Switch depending on model. Factor code out + to ... + (add_points_weierstrass): new. + (add_points_montgomery, add_points_twistededwards): New stub + functions. + + * tests/Makefile.am (TESTS): Reorder tests. + + mpi: Suppress newer gcc warnings. + + commit 8698530b2f9ef95542f1dd550961de7af86cc256 + * src/g10lib.h (GCC_ATTR_UNUSED): Define for gcc >=3D 3.5. + * mpi/mpih-div.c (_gcry_mpih_mod_1, _gcry_mpih_divmod_1): Mark dummy + as unused. + * mpi/mpi-internal.h (UDIV_QRNND_PREINV): Mark _ql as unused. + + Do not check with cpp for typedefed constants. + + commit b28b1f732e1b4f9c62a9de87c22c6bb0d3f8fdb8 + * src/gcrypt-int.h: Include error code replacements depeding on the + version of libgpg-error. + +2013-09-04 Jussi Kivilinna + + Make _gcry_burn_stack use variable length array. + + commit 4b0edf53440239d3bcc95941980c062a0801a149 + * configure.ac (HAVE_VLA): Add check. + * src/misc.c (_gcry_burn_stack) [HAVE_VLA]: Add VLA code. + + Move stack burning from block ciphers to cipher modes. + + commit a3aaa6ad03388ea3eaa24304b604cb864633332f + * src/gcrypt-module.h (gcry_cipher_encrypt_t) + (gcry_cipher_decrypt_t): Return 'unsigned int'. + * cipher/cipher.c (dummy_encrypt_block, dummy_decrypt_block): Return + zero. + (do_ecb_encrypt, do_ecb_decrypt): Get largest stack burn depth from + block cipher crypt function and burn stack at end. + * cipher/cipher-aeswrap.c (_gcry_cipher_aeswrap_encrypt) + (_gcry_cipher_aeswrap_decrypt): Ditto. + * cipher/cipher-cbc.c (_gcry_cipher_cbc_encrypt) + (_gcry_cipher_cbc_decrypt): Ditto. + * cipher/cipher-cfb.c (_gcry_cipher_cfb_encrypt) + (_gcry_cipher_cfb_decrypt): Ditto. + * cipher/cipher-ctr.c (_gcry_cipher_cbc_encrypt): Ditto. + * cipher/cipher-ofb.c (_gcry_cipher_ofb_encrypt) + (_gcry_cipher_ofb_decrypt): Ditto. + * cipher/blowfish.c (encrypt_block, decrypt_block): Return burn stack + depth. + * cipher/camellia-glue.c (camellia_encrypt, camellia_decrypt): Ditto. + * cipher/cast5.c (encrypt_block, decrypt_block): Ditto. + * cipher/des.c (do_tripledes_encrypt, do_tripledes_decrypt) + (do_des_encrypt, do_des_decrypt): Ditto. + * cipher/idea.c (idea_encrypt, idea_decrypt): Ditto. + * cipher/rijndael.c (rijndael_encrypt, rijndael_decrypt): Ditto. + * cipher/seed.c (seed_encrypt, seed_decrypt): Ditto. + * cipher/serpent.c (serpent_encrypt, serpent_decrypt): Ditto. + * cipher/twofish.c (twofish_encrypt, twofish_decrypt): Ditto. + * cipher/rfc2268.c (encrypt_block, decrypt_block): New. + (_gcry_cipher_spec_rfc2268_40): Use encrypt_block and decrypt_block. + +2013-09-01 Jussi Kivilinna + + camellia-aesni-avx2-amd64: Move register clearing to assembly functions. + + commit f3515240de9513ead975985c9f8ab714022cac8e + * cipher/camellia-aesni-avx2-amd64.S + (_gcry_camellia_aesni_avx2_ctr_enc): Add 'vzeroall'. + (_gcry_camellia_aesni_avx2_cbc_dec) + (_gcry_camellia_aesni_avx2_cfb_dec): Add 'vzeroupper' at head and + 'vzeroall' at tail. + * cipher/camellia-glue.c (_gcry_serpent_ctr_enc, _gcry_serpent_cbc_dec) + (_gcry_serpent_avx2_cfb_dec) [USE_AESNI_AVX2]: Remove register + clearing. + + camellia-aesni-avx-amd64: Move register clearing to assembly functions. + + commit 8b735cb563dff7aafbf8a970972522b5621e665c + * cipher/camellia-aesni-avx-amd64.S (_gcry_camellia_aesni_avx_ctr_enc) + (_gcry_camellia_aesni_avx_cbc_dec) + (_gcry_camellia_aesni_avx_cfb_dec): Add 'vzeroupper' at head and + 'vzeroall' at tail. + * cipher/camellia-glue.c (_gcry_serpent_ctr_enc, _gcry_serpent_cbc_dec) + (_gcry_serpent_avx2_cfb_dec) [USE_AESNI_AVX]: Remove register clearing. + + serpent-avx2-amd64: Move register clearing to assembly. + + commit d12828cd821a4b4428eae19de5aee02cf536e536 + * cipher/serpent-avx2-amd64.S (_gcry_serpent_avx2_ctr_enc) + (_gcry_serpent_avx2_cbc_dec, _gcry_serpent_avx2_cfb_dec): Change last + 'vzeroupper' to 'vzeroall'. + * cipher/serpent.c (_gcry_serpent_ctr_enc, _gcry_serpent_cbc_dec) + (_gcry_serpent_avx2_cfb_dec) [USE_AVX2]: Remove register clearing with + 'vzeroall'. + + Fix building for x32 target. + + commit fd6721c235a5bdcb332c8eb708fbd4f96e52e824 + * mpi/amd64/mpi-asm-defs.h: New file. + * random/rndhw.c (poll_padlock) [__x86_64__]: Also check if __LP64__ is + defined. + [USE_DRNG, __x86_64__]: Also check if __LP64__ is defined. + +2013-08-31 Jussi Kivilinna + + sha512: add ARM/NEON assembly version of transform function. + + commit 99d15543b8d94a8f1ef66c6ccb862b0ce82c514d + * cipher/Makefile.am: Add 'sha512-armv7-neon.S'. + * cipher/sha512-armv7-neon.S: New file. + * cipher/sha512.c (USE_ARM_NEON_ASM): New macro. + (SHA512_CONTEXT)=C2=A0[USE_ARM_NEON_ASM]: Add 'use_neon'. + (sha512_init, sha384_init) [USE_ARM_NEON_ASM]: Enable 'use_neon' if + CPU support NEON instructions. + (k): Round constant array moved outside of 'transform' function. + (__transform): Renamed from 'tranform' function. + [USE_ARM_NEON_ASM] (_gcry_sha512_transform_armv7_neon): New prototype. + (transform): New wrapper function for different transform versions. + (sha512_write, sha512_final): Burn stack by the amount returned by + transform function. + * configure.ac (sha512) [neonsupport]: Add 'sha512-armv7-neon.lo'. + + sha512: reduce stack use in transform function by 512 bytes. + + commit 03da7f8ba3ec24d4639a2bcebbc0d9d831734c08 + * cipher/sha512.c (transform): Change 'u64 w[80]' to 'u64 w[16]' and + inline input expansion to first 64 rounds. + (sha512_write, sha512_final): Reduce burn_stack depth by 512 bytes. + + Add ARM HW feature detection module and add NEON detection. + + commit 9c95be105f518d18407115c2c06893857c24b116 + * configure.ac: Add option --disable-neon-support. + (HAVE_GCC_INLINE_ASM_NEON): New. + (ENABLE_NEON_SUPPORT): New. + [arm]: Add 'hwf-arm.lo' as HW feature module. + * src/Makefile.am: Add 'hwf-arm.c'. + * src/g10lib.h (HWF_ARM_NEON): New macro. + * src/global.c (hwflist): Add HWF_ARM_NEON entry. + * src/hwf-arm.c: New file. + * src/hwf-common.h (_gcry_hwf_detect_arm): New prototype. + * src/hwfeatures.c (_gcry_detect_hw_features) [HAVE_CPU_ARCH_ARM]: Add + call to _gcry_hwf_detect_arm. + + Correct mpi_cpu_arch for ARMv6. + + commit 7b0ebe69fe35f2ee13e1e1beb2766a1eaadb7f0c + * mpi/config.links [armv6]: Set mpi_cpu_arch to "arm", instead of + "armv6". + +2013-08-30 Werner Koch + + mpi: Make gcry_mpi_print work with negative zeroes. + + commit e9b711e6ddb480a71d2996465074e436c752c005 + * mpi/mpicoder.c (gcry_mpi_print): Take care of negative zero. + (gcry_mpi_aprint): Allocate at least 1 byte. + * tests/t-convert.c: New. + * tests/Makefile.am (TESTS): Add t-convert. + + Refactor the ECC code into 3 files. + + commit 800d4e01376d52a94a157b53978c7c3f957fc476 + * cipher/ecc-common.h, cipher/ecc-curves.c, cipher/ecc-misc.c: New. + * cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add new files. + * configure.ac (GCRYPT_PUBKEY_CIPHERS): Add new .c files. + * cipher/ecc.c (curve_aliases, ecc_domain_parms_t, domain_parms) + (scanval): Move to ecc-curves.c. + (fill_in_curve): Move to ecc-curve.c as _gcry_ecc_fill_in_curve. + (ecc_get_curve): Move to ecc-curve.c as _gcry_ecc_get_curve. + (_gcry_mpi_ec_ec2os): Move to ecc-misc.c. + (ec2os): Move to ecc-misc.c as _gcry_ecc_ec2os. + (os2ec): Move to ecc-misc.c as _gcry_ecc_os2ec. + (point_set): Move as inline function to ecc-common.h. + (_gcry_ecc_curve_free): Move to ecc-misc.c as _gcry_ecc_curve_free. + (_gcry_ecc_curve_copy): Move to ecc-misc.c as _gcry_ecc_curve_copy. + (mpi_from_keyparam, point_from_keyparam): Move to ecc-curves.c. + (_gcry_mpi_ec_new): Move to ecc-curves.c. + (ecc_get_param): Move to ecc-curves.c as _gcry_ecc_get_param. + (ecc_get_param_sexp): Move to ecc-curves.c as _gcry_ecc_get_param_sexp. + +2013-08-22 Jussi Kivilinna + + serpent-sse2-amd64: Move register clearing to assembly functions. + + commit 040aa7688296e93659cb32ca31e9a001a6ab1edd + cipher/serpent-sse2-amd64.S (_gcry_serpent_sse2_ctr_enc) + (_gcry_serpent_sse2_cbc_dec, _gcry_serpent_sse2_cfb_dec): Clear used + XMM registers. + cipher/serpent.c (_gcry_serpent_ctr_enc, _gcry_serpent_cbc_dec) + ( _gcry_serpent_cfb_dec) [USE_SSE2]: Remove XMM register clearing from + bulk functions. + + twofish-amd64: do not make __twofish_dec_blk3 global. + + commit 82db04a6a0058cf870485459abe7c1659b138ec5 + * cipher/twofish-amd64.S (__twofish_dec_blk3): Do not export symbol as + global. + (__twofish_dec_blk3): Mark symbol as function. + +2013-08-20 Jussi Kivilinna + + mpi: add ARMv6 assembly. + + commit da327aef3fe24fdf98fffbc8aea69de42ed12456 + * mpi/armv6/mpi-asm-defs.h: New. + * mpi/armv6/mpih-add1.S: New. + * mpi/armv6/mpih-mul1.S: New. + * mpi/armv6/mpih-mul2.S: New. + * mpi/armv6/mpih-mul3.S: New. + * mpi/armv6/mpih-sub1.S: New. + * mpi/config.links [arm]: Enable ARMv6 assembly. + + Move ARMv6 detection to configure.ac. + + commit 151f1e518be2d16bed748ba832384b0472ddcf9b + * cipher/blowfish-armv6.S: Replace __ARM_ARCH >=3D 6 checks with + HAVE_ARM_ARCH_V6. + * cipher/blowfish.c: Ditto. + * cipher/camellia-armv6.S: Ditto. + * cipher/camellia.h: Ditto. + * cipher/cast5-armv6.S: Ditto. + * cipher/cast5.c: Ditto. + * cipher/rijndael-armv6.S: Ditto. + * cipher/rijndael.c: Ditto. + * configure.ac: Add HAVE_ARM_ARCH_V6 check. + +2013-08-19 Jussi Kivilinna + + Add optimized wipememory for ARM. + + commit c030e33533fb819afe195eff5f89ec39863b1fbc + src/g10lib.h [__arm__] (fast_wipememory2_unaligned_head) + (fast_wipememory2): New macros. + + cipher: bufhelp: allow unaligned memory accesses on ARM. + + commit 796dda37b957b20dba391343937c6325a8c8b288 + * cipher/bufhelp.h [__arm__ && __ARM_FEATURE_UNALIGNED]: Enable + BUFHELP_FAST_UNALIGNED_ACCESS. + +2013-08-17 Jussi Kivilinna + + Remove burn_stack optimization. + + commit 79895b9459b9bf8c60cb7abf09d5bf16ed0cf6e3 + * src/misc.c (_gcry_burn_stack): Remove SIZEOF_UNSIGNED_LONG =3D=3D 4 or 8 + optimization. + +2013-08-16 Jussi Kivilinna + + camellia: add ARMv6 assembly implementation. + + commit cafadc1e4fb97581262b0081ba251e05613d4394 + * cipher/Makefile.am: Add 'camellia-armv6.S'. + * cipher/camellia-armv6.S: New file. + * cipher/camellia-glue.c [USE_ARMV6_ASM] + (_gcry_camellia_armv6_encrypt_block) + (_gcry_camellia_armv6_decrypt_block): New prototypes. + [USE_ARMV6_ASM] (Camellia_EncryptBlock, Camellia_DecryptBlock) + (camellia_encrypt, camellia_decrypt): New functions. + * cipher/camellia.c [!USE_ARMV6_ASM]: Compile encryption and decryption + routines if USE_ARMV6_ASM macro is _not_ defined. + * cipher/camellia.h (USE_ARMV6_ASM): New macro. + [!USE_ARMV6_ASM] (Camellia_EncryptBlock, Camellia_DecryptBlock): If + USE_ARMV6_ASM is defined, disable these function prototypes. + (camellia) [arm]: Add 'camellia-armv6.lo'. + + blowfish: add ARMv6 assembly implementation. + + commit 31e4b1a96a07e9a3698fcb7be0643a136ebb8e5c + * cipher/Makefile.am: Add 'blowfish-armv6.S'. + * cipher/blowfish-armv6.S: New file. + * cipher/blowfish.c (USE_ARMV6_ASM): New macro. + [USE_ARMV6_ASM] (_gcry_blowfish_armv6_do_encrypt) + (_gcry_blowfish_armv6_encrypt_block) + (_gcry_blowfish_armv6_decrypt_block, _gcry_blowfish_armv6_ctr_enc) + (_gcry_blowfish_armv6_cbc_dec, _gcry_blowfish_armv6_cfb_dec): New + prototypes. + [USE_ARMV6_ASM] (do_encrypt, do_encrypt_block, do_decrypt_block) + (encrypt_block, decrypt_block): New functions. + (_gcry_blowfish_ctr_enc) [USE_ARMV6_ASM]: Use ARMv6 assembly function. + (_gcry_blowfish_cbc_dec) [USE_ARMV6_ASM]: Use ARMv6 assembly function. + (_gcry_blowfish_cfb_dec) [USE_ARMV6_ASM]: Use ARMv6 assembly function. + * configure.ac (blowfish) [arm]: Add 'blowfish-armv6.lo'. + + cast5: add ARMv6 assembly implementation. + + commit 8d1faf56714598301580ce370e0bfa6d65e73644 + * cipher/Makefile.am: Add 'cast5-armv6.S'. + * cipher/cast5-armv6.S: New file. + * cipher/cast5.c (USE_ARMV6_ASM): New macro. + (CAST5_context) [USE_ARMV6_ASM]: New members 'Kr_arm_enc' and + 'Kr_arm_dec'. + [USE_ARMV6_ASM] (_gcry_cast5_armv6_encrypt_block) + (_gcry_cast5_armv6_decrypt_block, _gcry_cast5_armv6_ctr_enc) + (_gcry_cast5_armv6_cbc_dec, _gcry_cast5_armv6_cfb_dec): New prototypes. + [USE_ARMV6_ASM] (do_encrypt_block, do_decrypt_block, encrypt_block) + (decrypt_block): New functions. + (_gcry_cast5_ctr_enc) [USE_ARMV6_ASM]: Use ARMv6 assembly function. + (_gcry_cast5_cbc_dec) [USE_ARMV6_ASM]: Use ARMv6 assembly function. + (_gcry_cast5_cfb_dec) [USE_ARMV6_ASM]: Use ARMv6 assembly function. + (do_cast_setkey) [USE_ARMV6_ASM]: Initialize 'Kr_arm_enc' and + 'Kr_arm_dec'. + * configure.ac (cast5) [arm]: Add 'cast5-armv6.lo'. + +2013-08-14 Jussi Kivilinna + + rijndael: add ARMv6 assembly implementation. + + commit f365961422f1c8b3d89b8bcd9c99828f38c1f158 + * cipher/Makefile.am: Add 'rijndael-armv6.S'. + * cipher/rijndael-armv6.S: New file. + * cipher/rijndael.c (USE_ARMV6_ASM): New macro. + [USE_ARMV6_ASM] (_gcry_aes_armv6_encrypt_block) + (_gcry_aes_armv6_decrypt_block): New prototypes. + (do_encrypt_aligned) [USE_ARMV6_ASM]: Use ARMv6 assembly function. + (do_encrypt): Disable input/output alignment when USE_ARMV6_ASM. + (do_decrypt_aligned) [USE_ARMV6_ASM]: Use ARMv6 assembly function. + (do_decrypt): Disable input/output alignment when USE_ARMV6_ASM. + * configure.ac (HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS): New check for + gcc/as compatibility with ARM assembly implementations. + (aes) [arm]: Add 'rijndael-armv6.lo'. + +2013-08-09 NIIBE Yutaka + + cipher: fix memory leak. + + commit 2b5bbe264fcd61e5e458e5f71a6507ba0271c729 + * cipher/pubkey.c (gcry_pk_sign): Handle the specific case of ECC, + where there is NULL whichi is not the sentinel. + +2013-08-08 Werner Koch + + mpi: Clear immutable flag on the result of gcry_mpi_set. + + commit 426cbc9feca0c8f46208fb3670adab95f9e46087 + * mpi/mpiutil.c (gcry_mpi_set): Reset immutable and const flags. + * tests/mpitests.c (test_const_and_immutable): Add a test for this. + +2013-08-07 NIIBE Yutaka + + tests: fix memory leaks. + + commit cc082642c1b0f2a3e9ca78e1ffd3f64417c204bd + * tests/benchmark.c (dsa_bench): Release SIG. + + * tests/mpitests.c (test_powm): Release BASE, EXP, MOD, and RES. + + * tests/prime.c (check_primes): Release PRIME. + + * tests/tsexp.c (basic): Use intermediate variable M for constant. + Release S1, S2 and A. + +2013-08-07 Jussi Kivilinna + + Fix building on W32 (cannot export symbol 'gcry_sexp_get_buffer') + + commit 065d446478bf68553339fc77a89b8369bd110a18 + * src/libgcrypt.def: Change 'gcry_sexp_get_buffer' to + 'gcry_sexp_nth_buffer'. + +2013-08-06 NIIBE Yutaka + + cipher: fix another memory leak. + + commit 9a421813123a2f5db0a91eaee4a45138efc9ad34 + * cipher/ecc.c (ecc_get_curve): Free TMP. + + tests: fix memory leaks. + + commit 87eddc31ccba6decbddd1761dd42a208666cd311 + * tests/pubkey.c (check_keys_crypt): Release L, X0, and X1. + (check_keys): Release X. + + cipher: fix memory leaks. + + commit ae6ffd9af38cbcac57c220960f683aab91db85cb + * cipher/elgamal.c (elg_generate_ext): Free XVALUE. + + * cipher/pubkey.c (sexp_elements_extract): Don't use IDX for loop. + Call mpi_free. + (sexp_elements_extract_ecc): Call mpi_free. + +2013-08-05 Werner Koch + + mpi: Improve gcry_mpi_invm to detect bad input. + + commit d8e99a04dba6a606e879464cd11deee760d1e000 + * mpi/mpi-inv.c (gcry_mpi_invm): Return 0 for bad input. + +2013-07-31 Dmitry Eremin-Solenikov + + Correct checks for ecc secret key. + + commit 10dfa41b43a906031bc674ea41cd3073701011f3 + * cipher/ecc.c (check_secret_key): replace wrong comparison of Q and + sk->Q points with correct one. + +2013-07-29 Werner Koch + + sexp: Allow white space anywhere in a hex format. + + commit 43320961a8751ee28dc95cdb0ae01ea8a7ff7f91 + * src/sexp.c (hextobyte): Remove. + (hextonibble): New. + (vsexp_sscan): Skip whtespace between hex nibbles. + + Implement deterministic ECDSA as specified by rfc-6979. + + commit 6e0a9786637d649b48aae0e611a12e12beef9b3b + * cipher/ecc.c (sign): Add args FLAGS and HASHALGO. Convert an opaque + MPI as INPUT. Implement rfc-6979. + (ecc_sign): Remove the opaque MPI code and pass FLAGS to sign. + (verify): Do not allocate and compute Y; it is not used. + (ecc_verify): Truncate the hash value if needed. + * tests/dsa-rfc6979.c (check_dsa_rfc6979): Add ECDSA test cases. + +2013-07-26 Werner Koch + + Implement deterministic DSA as specified by rfc-6979. + + commit 1cfa79aabc5d0fd8d124901054475e90ab7d9cde + * cipher/dsa.c (dsa_sign): Move opaque mpi extraction to sign. + (sign): Add args FLAGS and HASHALGO. Implement deterministic DSA. + Add code path for R=3D=3D0 to comply with the standard. + (dsa_verify): Left fill opaque mpi based hash values. + * cipher/dsa-common.c (int2octets, bits2octets): New. + (_gcry_dsa_gen_rfc6979_k): New. + * tests/dsa-rfc6979.c: New. + * tests/Makefile.am (TESTS): Add dsa-rfc6979. + + Allow the use of a private-key s-expression with gcry_pk_verify. + + commit b72d312ad11887fc416aa821786f6bdb663c0f4a + * cipher/pubkey.c (sexp_to_key): Fallback to private key. + +2013-07-25 Werner Koch + + Mitigate a flush+reload cache attack on RSA secret exponents. + + commit 287bf0e543f244d784cf8b58340bf0ab3c6aba97 + * mpi/mpi-pow.c (gcry_mpi_powm): Always perfrom the mpi_mul for + exponents in secure memory. + +2013-07-19 Werner Koch + + pk: Allow the use of a hash element for DSA sign and verify. + + commit 37d0a1ebdc2dc74df4fb6bf0621045018122a68f + * cipher/pubkey.c (pubkey_sign): Add arg ctx and pass it to the sign + module. + (gcry_pk_sign): Pass CTX to pubkey_sign. + (sexp_data_to_mpi): Add flag rfc6979 and code to alls hash with *DSA + * cipher/rsa.c (rsa_sign, rsa_verify): Return an error if an opaque + MPI is given for DATA/HASH. + * cipher/elgamal.c (elg_sign, elg_verify): Ditto. + * cipher/dsa.c (dsa_sign, dsa_verify): Convert a given opaque MPI. + * cipher/ecc.c (ecc_sign, ecc_verify): Ditto. + * tests/basic.c (check_pubkey_sign_ecdsa): Add a test for using a hash + element with DSA. + + sexp: Add function gcry_sexp_nth_buffer. + + commit 2d3e8d4d9562d666420aadd9ffa8ac0456a1cd91 + * src/sexp.c (gcry_sexp_nth_buffer): New. + * src/visibility.c, src/visibility.h: Add function wrapper. + * src/libgcrypt.vers, src/libgcrypt.def: Add to API. + * src/gcrypt.h.in: Add prototype. + +2013-07-18 Werner Koch + + Add support for Salsa20. + + commit c4885092088431e7928e4459fda20cc0e8ceb201 + * src/gcrypt.h.in (GCRY_CIPHER_SALSA20): New. + * cipher/salsa20.c: New. + * configure.ac (available_ciphers): Add Salsa20. + * cipher/cipher.c: Register Salsa20. + (cipher_setiv): Allow to divert an IV to a cipher module. + * src/cipher-proto.h (cipher_setiv_func_t): New. + (cipher_extra_spec): Add field setiv. + * src/cipher.h: Declare Salsa20 definitions. + * tests/basic.c (check_stream_cipher): New. + (check_stream_cipher_large_block): New. + (check_cipher_modes): Run new test functions. + (check_ciphers): Add simple test for Salsa20. + +2013-07-17 Werner Koch + + Allow gcry_mpi_dump to print opaque MPIs. + + commit 364d019e3ffedfcb434576702f73e767cb9389ef + * mpi/mpicoder.c (gcry_mpi_dump): Detect abd print opaque MPIs. + * tests/mpitests.c (test_opaque): New. + (main): Call new test. + + cipher: Prepare to pass extra info to the sign functions. + + commit 5940e66cbefea3de5924f494f18aed69bb694bff + * src/gcrypt-module.h (gcry_pk_sign_t): Add parms flags and hashalgo. + * cipher/rsa.c (rsa_sign): Add parms and mark them as unused. + * cipher/dsa.c (dsa_sign): Ditto. + * cipher/elgamal.c (elg_sign): Ditto. + * cipher/pubkey.c (dummy_sign): Ditto. + (pubkey_sign): Pass 0 for the new args. + + Fix a special case bug in mpi_powm for e=3D=3D0. + + commit 6e1adb05d290aeeb1c230c763970695f4a538526 + * mpi/mpi-pow.c (gcry_mpi_powm): For a zero exponent, make sure that + the result has been allocated. + +2013-07-15 Dmitry Eremin-Solenikov + + Fix memory leak in t-mpi-point test. + + commit a7b80e9fba6b1b095f7c53469747967b40ebfbfd + * tests/t-mpi-point.c (basic_ec_math, basic_ec_math_simplified): add + calls to gcry_ctx_release() to free contexts after they become unused. + +2013-07-10 Jussi Kivilinna + + Fix 'Please include winsock2.h before windows.h' warnings with mingw32. + + commit d6c9c86cb7f571ae0bd9aee4efa01a0f9c4c3104 + * random/rndw32.c: include winsock2.h before windows.h. + * src/ath.h [_WIN32]: Ditto. + * tests/benchmark.c [_WIN32]: Ditto. + + Remove duplicate header from mpi/amd64/mpih-mul2.S. + + commit c64a0dcbefc5b0055954e37a3c86b32ff7a1b1da + * mpi/amd64/mpih-mul2.S: remove duplicated header. + + Fix i386/amd64 inline assembly "cc" clobbers. + + commit ed0a598172208ec67234a4edd73189bf6808fd04 + * cipher/bithelp.h [__GNUC__, __i386__] (rol, ror): add "cc" globber + for inline assembly. + * cipher/cast5.c [__GNUC__, __i386__] (rol): Ditto. + * random/rndhw.c [USE_DRNG] (rdrand_long): Ditto. + * src/hmac256.c [__GNUC__, __i386__] (ror): Ditto. + * mpi/longlong.c [__i386__] (add_ssaaaa, sub_ddmmss, umul_ppmm) + (udiv_qrnnd, count_leading_zeros, count_trailing_zeros): Ditto. + + bufhelp: Suppress 'cast increases required alignment' warning. + + commit c3902a6b5cea9acef2e15fbee24eb601eeb25168 + * cipher/bufhelp.h (buf_xor, buf_xor_2dst, buf_xor_n_copy): Cast + to larger element pointer through (void *) to suppress -Wcast-error. + + mpi: Add __ARM_ARCH for older GCC. + + commit 97f392f43cf2e4da1297cbecacbfbff33a869478 + * mpi/longlong.h [__arm__]: Construct __ARM_ARCH if not provided by + compiler. + + mpi: add missing "cc" clobber for ARM assembly. + + commit 8aa4f2161cf643ce36d87d2e2786b546736f8232 + * mpi/longlong.h [__arm__] (add_ssaaaa, sub_ddmmss): Add __CLOBBER_CC. + [__arm__][__ARM_ARCH <=3D 3] (umul_ppmm): Ditto. + + Tweak ARM inline assembly for mpi. + + commit 71dda4507053379433dc8b0fc6462c15de7299df + mpi/longlong.h [__arm__]: Enable inline assembly if __thumb2__ is + defined. + [__arm__]: Use __ARCH_ARM when defined. + [__arm__] [__ARM_ARCH >=3D 5] (count_leading_zeros): New. + +2013-06-26 Werner Koch + + Make gpg-error replacement defines more robust. + + commit 6540b84a6e9113813e7e49e3ad2024d4a0073300 + * configure.ac (AH_BOTTOM): Move GPG_ERR_ replacement defines to ... + * src/gcrypt-int.h: new file. + * src/visibility.h, src/cipher.h: Replace gcrypt.h by gcrypt-int.h. + * tests/: Ditto for all test files. + +2013-06-20 Jussi Kivilinna + + Check if assembler is compatible with AMD64 assembly implementations. + + commit 3544fa8aa63bef9a35abf236e9376191b5ec206b + * cipher/blowfish-amd64.S: Enable only if + HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS is defined. + * cipher/camellia-aesni-avx-amd64.S: Ditto. + * cipher/camellia-aesni-avx2-amd64.S: Ditto. + * cipher/cast5-amd64.S: Ditto. + * cipher/rinjdael-amd64.S: Ditto. + * cipher/serpent-avx2-amd64.S: Ditto. + * cipher/serpent-sse2-amd64.S: Ditto. + * cipher/twofish-amd64.S: Ditto. + * cipher/blowfish.c: Use AMD64 assembly implementation only if + HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS is defined + * cipher/camellia-glue.c: Ditto. + * cipher/cast5.c: Ditto. + * cipher/rijndael.c: Ditto. + * cipher/serpent.c: Ditto. + * cipher/twofish.c: Ditto. + * configure.ac: Check gcc/as compatibility with AMD64 assembly + implementations. + +2013-06-09 Jussi Kivilinna + + Optimize _gcry_burn_stack for 32-bit and 64-bit architectures. + + commit ec2f8de409a93c80efa658134df22074a9bca5a4 + * src/misc.c (_gcry_burn_stack): Add optimization for 32-bit and 64-bit + architectures. + + Add Camellia AES-NI/AVX2 implementation. + + commit d94ec5f5f8a5d40a7d344025aa466f276f9718df + * cipher/Makefile.am: Add 'camellia-aesni-avx2-amd64.S'. + * cipher/camellia-aesni-avx2-amd64.S: New file. + * cipher/camellia-glue.c (USE_AESNI_AVX2): New macro. + (CAMELLIA_context) [USE_AESNI_AVX2]: Add 'use_aesni_avx2'. + [USE_AESNI_AVX2] (_gcry_camellia_aesni_avx2_ctr_enc) + (_gcry_camellia_aesni_avx2_cbc_dec) + (_gcry_camellia_aesni_avx2_cfb_dec): New prototypes. + (camellia_setkey) [USE_AESNI_AVX2]: Check AVX2+AES-NI capable hardware + and set 'ctx->use_aesni_avx2'. + (_gcry_camellia_ctr_enc) [USE_AESNI_AVX2]: Add AVX2 accelerated code. + (_gcry_camellia_cbc_dec) [USE_AESNI_AVX2]: Add AVX2 accelerated code. + (_gcry_camellia_cfb_dec) [USE_AESNI_AVX2]: Add AVX2 accelerated code. + (selftest_ctr_128, selftest_cbc_128, selftest_cfb_128): Grow 'nblocks' + so that AVX2 codepaths get tested. + * configure.ac (camellia) [avx2support, aesnisupport]: Add + 'camellia-aesni-avx2-amd64.lo'. + + Add Serpent AVX2 implementation. + + commit e7ab4e1a7396f4609b9033207015b239ab4a5140 + * cipher/Makefile.am: Add 'serpent-avx2-amd64.S'. + * cipher/serpent-avx2-amd64.S: New file. + * cipher/serpent.c (USE_AVX2): New macro. + (serpent_context_t) [USE_AVX2]: Add 'use_avx2'. + [USE_AVX2] (_gcry_serpent_avx2_ctr_enc, _gcry_serpent_avx2_cbc_dec) + (_gcry_serpent_avx2_cfb_dec): New prototypes. + (serpent_setkey_internal) [USE_AVX2]: Check for AVX2 capable hardware + and set 'use_avx2'. + (_gcry_serpent_ctr_enc) [USE_AVX2]: Use AVX2 accelerated functions. + (_gcry_serpent_cbc_dec) [USE_AVX2]: Use AVX2 accelerated functions. + (_gcry_serpent_cfb_dec) [USE_AVX2]: Use AVX2 accelerated functions. + (selftest_ctr_128, selftest_cbc_128, selftest_cfb_128): Grow 'nblocks' + so that AVX2 codepaths are tested. + * configure.ac (serpent) [avx2support]: Add 'serpent-avx2-amd64.lo'. + + Add detection for Intel AVX2 instruction set. + + commit 3289bca708bdd02c69a331095ac6ca9a1efd74cc + * configure.ac: Add option --disable-avx2-support. + (HAVE_GCC_INLINE_ASM_AVX2): New. + (ENABLE_AVX2_SUPPORT): New. + * src/g10lib.h (HWF_INTEL_AVX2): New. + * src/global.c (hwflist): Add HWF_INTEL_AVX2. + * src/hwf-x86.c [__i386__] (get_cpuid): Initialize registers to zero + before cpuid. + [__x86_64__] (get_cpuid): Initialize registers to zero before cpuid. + (detect_x86_gnuc): Store maximum cpuid level. + (detect_x86_gnuc) [ENABLE_AVX2_SUPPORT]: Add detection for AVX2. + + twofish: add amd64 assembly implementation. + + commit d325ab5d86e6107a46007a4d0131122bbd719f8c + * cipher/Makefile.am: Add 'twofish-amd64.S'. + * cipher/twofish-amd64.S: New file. + * cipher/twofish.c (USE_AMD64_ASM): New macro. + [USE_AMD64_ASM] (_gcry_twofish_amd64_encrypt_block) + (_gcry_twofish_amd64_decrypt_block, _gcry_twofish_amd64_ctr_enc) + (_gcry_twofish_amd64_cbc_dec, _gcry_twofish_amd64_cfb_dec): New + prototypes. + [USE_AMD64_ASM] (do_twofish_encrypt, do_twofish_decrypt) + (twofish_encrypt, twofish_decrypt): New functions. + (_gcry_twofish_ctr_enc, _gcry_twofish_cbc_dec, _gcry_twofish_cfb_dec) + (selftest_ctr, selftest_cbc, selftest_cfb): New functions. + (selftest): Call new bulk selftests. + * cipher/cipher.c (gcry_cipher_open) [USE_TWOFISH]: Register Twofish + bulk functions for ctr-enc, cbc-dec and cfb-dec. + * configure.ac (twofish) [x86_64]: Add 'twofish-amd64.lo'. + * src/cipher.h (_gcry_twofish_ctr_enc, _gcry_twofish_cbc_dec) + (gcry_twofish_cfb_dec): New prototypes. + +2013-05-29 Jussi Kivilinna + + rinjdael: add amd64 assembly implementation. + + commit 7317fcfadf00789df140e51c0d16b60f6b144b59 + * cipher/Makefile.am: Add 'rijndael-amd64.S'. + * cipher/rijndael-amd64.S: New file. + * cipher/rijndael.c (USE_AMD64_ASM): New macro. + [USE_AMD64_ASM] (_gcry_aes_amd64_encrypt_block) + (_gcry_aes_amd64_decrypt_block): New prototypes. + (do_encrypt_aligned) [USE_AMD64_ASM]: Use amd64 assembly function. + (do_encrypt): Disable input/output alignment when USE_AMD64_ASM is set. + (do_decrypt_aligned) [USE_AMD64_ASM]: Use amd64 assembly function. + (do_decrypt): Disable input/output alignment when USE_AMD64_AES is set. + * configure.ac (aes) [x86-64]: Add 'rijndael-amd64.lo'. + + blowfish: add amd64 assembly implementation. + + commit 9a61edd1f00cefe8ffa3ad54a53eed163883053c + * cipher/Makefile.am: Add 'blowfish-amd64.S'. + * cipher/blowfish-amd64.S: New file. + * cipher/blowfish.c (USE_AMD64_ASM): New macro. + [USE_AMD64_ASM] (_gcry_blowfish_amd64_do_encrypt) + (_gcry_blowfish_amd64_encrypt_block) + (_gcry_blowfish_amd64_decrypt_block, _gcry_blowfish_amd64_ctr_enc) + (_gcry_blowfish_amd64_cbc_dec, _gcry_blowfish_amd64_cfb_dec): New + prototypes. + [USE_AMD64_ASM] (do_encrypt, do_encrypt_block, do_decrypt_block) + (encrypt_block, decrypt_block): New functions. + (_gcry_blowfish_ctr_enc, _gcry_blowfish_cbc_dec) + (_gcry_blowfish_cfb_dec, selftest_ctr, selftest_cbc, selftest_cfb): New + functions. + (selftest): Call new bulk selftests. + * cipher/cipher.c (gcry_cipher_open) [USE_BLOWFISH]: Register Blowfish + bulk functions for ctr-enc, cbc-dec and cfb-dec. + * configure.ac (blowfish) [x86_64]: Add 'blowfish-amd64.lo'. + * src/cipher.h (_gcry_blowfish_ctr_enc, _gcry_blowfish_cbc_dec) + (gcry_blowfish_cfb_dec): New prototypes. + +2013-05-24 Werner Koch + + ecc: Simplify the compliant point generation. + + commit 99b18aa536703ef90c9a1f5c8f40bc68b2064593 + * cipher/ecc.c (generate_key): Use point_snatch_set, replaces unneeded + variable copies, etc. + + ecc: Fix a minor flaw in the generation of K. + + commit 9711384f75564a71979e3fb971b5f4cadcf1afef + * cipher/dsa.c (gen_k): Factor code out to .. + * cipher/dsa-common.c (_gcry_dsa_gen_k): new file and function. Add + arg security_level and re-indent a bit. + * cipher/ecc.c (gen_k): Remove and change callers to _gcry_dsa_gen_k. + * cipher/dsa.c: Include pubkey-internal. + * cipher/Makefile.am (libcipher_la_SOURCES): Add dsa-common.c + +2013-05-24 Jussi Kivilinna + + cast5: add amd64 assembly implementation. + + commit 0bdf26eea8cdbffefe7e37578f8f896c4f5f5275 + * cipher/Makefile.am: Add 'cast5-amd64.S'. + * cipher/cast5-amd64.S: New file. + * cipher/cast5.c (USE_AMD64_ASM): New macro. + (_gcry_cast5_s1tos4): Merge arrays s1, s2, s3, s4 to single array to + simplify access from assembly implementation. + (s1, s2, s3, s4): New macros pointing to subarrays in + _gcry_cast5_s1tos4. + [USE_AMD64_ASM] (_gcry_cast5_amd64_encrypt_block) + (_gcry_cast5_amd64_decrypt_block, _gcry_cast5_amd64_ctr_enc) + (_gcry_cast5_amd64_cbc_dec, _gcry_cast5_amd64_cfb_dec): New prototypes. + [USE_AMD64_ASM] (do_encrypt_block, do_decrypt_block, encrypt_block) + (decrypt_block): New functions. + (_gcry_cast5_ctr_enc, _gcry_cast5_cbc_dec, _gcry_cast5_cfb_dec) + (selftest_ctr, selftest_cbc, selftest_cfb): New functions. + (selftest): Call new bulk selftests. + * cipher/cipher.c (gcry_cipher_open) [USE_CAST5]: Register CAST5 bulk + functions for ctr-enc, cbc-dec and cfb-dec. + * configure.ac (cast5) [x86_64]: Add 'cast5-amd64.lo'. + * src/cipher.h (_gcry_cast5_ctr_enc, _gcry_cast5_cbc_dec) + (gcry_cast5_cfb_dec): New prototypes. + + cipher-selftest: make selftest work with any block-size. + + commit ab8fc70b5f0c396a5bc941267f59166e860b8c5d + * cipher/cipher-selftest.c (_gcry_selftest_helper_cbc_128) + (_gcry_selftest_helper_cfb_128, _gcry_selftest_helper_ctr_128): Renamed + functions from '_128' to ''. + (_gcry_selftest_helper_cbc, _gcry_selftest_helper_cfb) + (_gcry_selftest_helper_ctr): Make work with different block sizes. + * cipher/cipher-selftest.h (_gcry_selftest_helper_cbc_128) + (_gcry_selftest_helper_cfb_128, _gcry_selftest_helper_ctr_128): Renamed + prototypes from '_128' to ''. + * cipher/camellia-glue.c (selftest_ctr_128, selftest_cfb_128) + (selftest_ctr_128): Change to use new function names. + * cipher/rijndael.c (selftest_ctr_128, selftest_cfb_128) + (selftest_ctr_128): Change to use new function names. + * cipher/serpent.c (selftest_ctr_128, selftest_cfb_128) + (selftest_ctr_128): Change to use new function names. + +2013-05-23 Jussi Kivilinna + + serpent: add parallel processing for CFB decryption. + + commit 6deb0ccdf718a0670f80e6762a3842caf76437d6 + * cipher/cipher.c (gcry_cipher_open): Add bulf CFB decryption function + for Serpent. + * cipher/serpent-sse2-amd64.S (_gcry_serpent_sse2_cfb_dec): New + function. + * cipher/serpent.c (_gcry_serpent_sse2_cfb_dec): New prototype. + (_gcry_serpent_cfb_dec) New function. + (selftest_cfb_128) New function. + (selftest) Call selftest_cfb_128. + * src/cipher.h (_gcry_serpent_cfb_dec): New prototype. + + camellia: add parallel processing for CFB decryption. + + commit b60f06f70227c1e69e1010da8b47ea51ade48145 + * cipher/camellia-aesni-avx-amd64.S + (_gcry_camellia_aesni_avx_cfb_dec): New function. + * cipher/camellia-glue.c (_gcry_camellia_aesni_avx_cfb_dec): New + prototype. + (_gcry_camellia_cfb_dec): New function. + (selftest_cfb_128): New function. + (selftest): Call selftest_cfb_128. + * cipher/cipher.c (gry_cipher_open): Add bulk CFB decryption function + for Camellia. + * src/cipher.h (_gcry_camellia_cfb_dec): New prototype. + + rinjdael: add parallel processing for CFB decryption with AES-NI. + + commit 319ee14f2aab8db56a830fd7ac8926f91b4f738a + * cipher/cipher-selftest.c (_gcry_selftest_helper_cfb_128): New + function for CFB selftests. + * cipher/cipher-selftest.h (_gcry_selftest_helper_cfb_128): New + prototype. + * cipher/rijndael.c [USE_AESNI] (do_aesni_enc_vec4): New function. + (_gcry_aes_cfb_dec) [USE_AESNI]: Add parallelized CFB decryption. + (selftest_cfb_128): New function. + (selftest): Call selftest_cfb_128. + +2013-05-23 Werner Koch + + Avoid compiler warning due to the global symbol setkey. + + commit b402de8b9c4a9f269faf03ca952b1eb68a1f33c8 + * cipher/cipher-selftest.c (_gcry_selftest_helper_cbc_128) + (_gcry_selftest_helper_ctr_128): Rename setkey to setkey_func. + +2013-05-23 Jussi Kivilinna + + serpent: add SSE2 accelerated amd64 implementation. + + commit 2fd06e207dcea1d8a7f0e7e92f3359615a99421b + * configure.ac (serpent): Add 'serpent-sse2-amd64.lo'. + * cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add + 'serpent-sse2-amd64.S'. + * cipher/cipher.c (gcry_cipher_open) [USE_SERPENT]: Register bulk + functions for CBC-decryption and CTR-mode. + * cipher/serpent.c (USE_SSE2): New macro. + [USE_SSE2] (_gcry_serpent_sse2_ctr_enc, _gcry_serpent_sse2_cbc_dec): + New prototypes to assembler functions. + (serpent_setkey): Set 'serpent_init_done' before calling serpent_test. + (_gcry_serpent_ctr_enc): New function. + (_gcry_serpent_cbc_dec): New function. + (selftest_ctr_128): New function. + (selftest_cbc_128): New function. + (selftest): Call selftest_ctr_128 and selftest_cbc_128. + * cipher/serpent-sse2-amd64.S: New file. + * src/cipher.h (_gcry_serpent_ctr_enc): New prototype. + (_gcry_serpent_cbc_dec): New prototype. + + Serpent: faster S-box implementation. + + commit c85501af8222913f0a1e20e77fceb88e93417925 + * cipher/serpent.c (SBOX0, SBOX1, SBOX2, SBOX3, SBOX4, SBOX5, SBOX6) + (SBOX7, SBOX0_INVERSE, SBOX1_INVERSE, SBOX2_INVERSE, SBOX3_INVERSE) + (SBOX4_INVERSE, SBOX5_INVERSE, SBOX6_INVERSE, SBOX7_INVERSE): Replace + with new definitions. + +2013-05-22 Werner Koch + + w32: Fix installing of .def file. + + commit 4e46d8bc78008ba06f106b368cefb0dddf15fe38 + * src/Makefile.am (install-def-file): Create libdir first. + + Add control commands to disable mlock and setuid dropping. + + commit 2b8014af202c9e0f7619f7a4377f5eb752235220 + * src/gcrypt.h.in (GCRYCTL_DISABLE_LOCKED_SECMEM): New. + (GCRYCTL_DISABLE_PRIV_DROP): New. + * src/global.c (_gcry_vcontrol): Implement them. + * src/secmem.h (GCRY_SECMEM_FLAG_NO_MLOCK): New. + (GCRY_SECMEM_FLAG_NO_PRIV_DROP): New. + * src/secmem.c (no_mlock, no_priv_drop): New. + (_gcry_secmem_set_flags, _gcry_secmem_get_flags): Set and get them. + (lock_pool): Handle no_mlock and no_priv_drop. + + Fix libtool 2.4.2 to correctly detect .def files. + + commit 05b3e2dda61d3d532a7f1ffd2487a85ed1c4f3ab + * ltmain.sh (sed_uncomment_deffile): New. + (orig_export_symbols): Uncomment def file before testing for EXPORTS. + * m4/libtool.m4: Do the same for the generated code. + +2013-05-22 Jussi Kivilinna + + Add AES bulk CBC decryption selftest. + + commit b65281a1b76d7898eb7607932246b78277d8570b + * cipher/rinjdael.c (selftest_cbc_128): New. + (selftest): Call selftest_cbc_128. + + Change AES bulk CTR encryption selftest use new selftest helper function + + commit 3637bdbb5f30a5e06745d448a6a8ad00e5cdd740 + * cipher/rinjdael.c: (selftest_ctr_128): Change to use new selftest + helper function. + + Convert bulk CTR and CBC selftest functions in Camellia to generic selfte= st helper functions + + commit eed4042fa028b3f73bad6a768f5b0a82f642e545 + * cipher/Makefile.am (libcipher_la_SOURCES): Add cipher-selftest files. + * cipher/camellia-glue.c (selftest_ctr_128, selftest_cbc_128): Change + to use the new selftest helper functions. + * cipher/cipher-selftest.c: New. + * cipher/cipher-selftest.h: New. + + camellia: add bulk CBC decryption selftest. + + commit f2986f03d1ae59f973bae56ce4333e5457003de5 + * cipher/camellia-glue.c: (selftest_cbc_128): New selftest function for + bulk CBC decryption. + (selftest): Add call to selftest_cbc_128. + + camellia: Rename camellia_aesni_avx_x86-64.S to camellia-aesni-avx-amd64.S + + commit 194ae35da7830a76b96e9b21121a2e1248762d3f + * cipher/camellia_aesni_avx_x86-64.S: Remove. + * cipher/camellia-aesni-avx-amd64.S: New. + * cipher/Makefile.am: Use the new filename. + * configure.ac: Use the new filename. + +2013-05-21 Werner Koch + + Fix indentation and save on string space. + + commit 2ac3a7c2b7154379738d17cfde8cd9017dc142f0 + * cipher/ecc.c (generate_key): Use the same string for both fatal + messages. + +2013-05-20 Andrey + + cipher: Fix segv in last ECC change. + + commit eb4937914db3fb7317502e97e4f0e40c1857f59d + * cipher/ecc.c (generate_key): Make sure R is initialized. + +2013-05-09 Andrey + + cipher: Generate compliant ECC keys. + + commit 296f38a2bd2e25788643a42e4881faed00884a40 + * cipher/ecc.c (generate_key): Make sure a key is compliant for + using the compact representation. + +2013-04-18 Werner Koch + + cipher: Fix regression in Padlock support. + + commit 6c942ec4d63032539f1fc56c3b970cfec2369e2b + * cipher/rijndael.c (do_setkey): Remove dummy padlock key generation case + and use the standard one. + + mpi: Yet another fix to get option flag munging right. + + commit 03557687a09b9c8878c77cbfdd0f5049940c72da + * cipher/Makefile.am (o_flag_munging): Yet another fix. + + mpi: Make using gcc's -Ofast easier. + + commit 1ab26bc304c559b0a8d29823d656f7ad8d10a59d + * cipher/Makefile.am (o_flag_munging): Take -Ofast in account. + + Fix alignment problem in idea.c. + + commit 3271b0dfda67e26c381d7ed667737f08f865ee40 + * cipher/idea.c (cipher): Rework parameter use to fix alignment + problems. + + * cipher/idea.c (FNCCAST_SETKEY, FNCCAST_CRYPT): Remove unused macros. + + Fix alignment problem in idea.c. + + * cipher/idea.c (cipher): Rework parameter use to fix alignment + problems. + + * cipher/idea.c (FNCCAST_SETKEY, FNCCAST_CRYPT): Remove unused macros. + + + (cherry picked from 4cd279556777e02eda79973f68efaa4b741f9175) + +2013-04-18 Vladimir Serbinenko + + Add some const attributes. + + commit ff0b94c22b36600fff1db9f1d48f9de61f9038f7 + * cipher/md4.c (transform): Add const attribute. + * cipher/md5.c (transform): Ditto. + * cipher/rmd160.c (transform): Ditto. + + Fix alignment problem in serpent.c. + + commit 86e72b490a5790a9c23341067c7e4d3e38be1634 + * cipher/serpent.c (serpent_key_prepare): Fix misaligned access. + (serpent_setkey): Likewise. + (serpent_encrypt_internal): Likewise. + (serpent_decrypt_internal): Likewise. + (serpent_encrypt): Don't put an alignment-increasing cast. + (serpent_decrypt): Likewise. + (serpent_test): Likewise. + +2013-04-16 Werner Koch + + Fix multiply by zero in gcry_mpi_ec_mul. + + commit 78cd0ba8a8eceee9d0b3397a2ab3bda6ba37c8a4 + * mpi/ec.c (_gcry_mpi_ec_mul_point): Handle case of SCALAR =3D=3D 0. + * tests/t-mpi-point.c (basic_ec_math): Add a test case for this. + +2013-04-15 Werner Koch + + Add macros to return pre-defined MPIs. + + commit bd3afc27459a44df8cf501a7e1ae37bb849a8b0e + * src/gcrypt.h.in (GCRYMPI_CONST_ONE, GCRYMPI_CONST_TWO) + (GCRYMPI_CONST_THREE, GCRYMPI_CONST_FOUR, GCRYMPI_CONST_EIGHT): New. + (_gcry_mpi_get_const): New private function. + * src/visibility.c (_gcry_mpi_get_const): New. + * src/visibility.h: Mark it visible. + + Fix addition of EC points. + + commit 71b25a5562f68aad81eae52cc1bab9ca7731a7e9 + * mpi/ec.c (_gcry_mpi_ec_add_points): Fix case of P1 given in affine + coordinates. + +2013-04-12 Werner Koch + + Add hack to allow using an "ecc" key for "ecdsa" or "ecdh". + + commit af8a79aea80217a0c85a592db1fa001792a6bf0f + * cipher/pubkey.c (sexp_to_key): Add optional arg USE. + (gcry_pk_encrypt, gcry_pk_decrypt): Call sexp_to_key with usage sign. + (gcry_pk_sign, gcry_pk_verify): Call sexp_to_key with usage encrypt. + * tests/basic.c (show_sexp): New. + (check_pubkey_sign): Print test number and add cases for ecc. + (check_pubkey_sign_ecdsa): New. + (do_check_one_pubkey): Divert to new function. + +2013-04-11 Werner Koch + + Add gcry_pubkey_get_sexp. + + commit 1f3cfad66456dd6f2e48f20b8eb0c51343449a1c + * src/gcrypt.h.in (GCRY_PK_GET_PUBKEY): New. + (GCRY_PK_GET_SECKEY): New. + (gcry_pubkey_get_sexp): New. + * src/visibility.c (gcry_pubkey_get_sexp): New. + * src/visibility.h (gcry_pubkey_get_sexp): Mark visible. + * src/libgcrypt.def, src/libgcrypt.vers: Add new function. + * cipher/pubkey-internal.h: New. + * cipher/Makefile.am (libcipher_la_SOURCES): Add new file. + * cipher/ecc.c: Include pubkey-internal.h + (_gcry_pk_ecc_get_sexp): New. + * cipher/pubkey.c: Include pubkey-internal.h and context.h. + (_gcry_pubkey_get_sexp): New. + * src/context.c (_gcry_ctx_find_pointer): New. + * src/cipher-proto.h: Add _gcry_pubkey_get_sexp. + * tests/t-mpi-point.c (print_sexp): New. + (context_param, basic_ec_math_simplified): Add tests for the new + function. + + * configure.ac (NEED_GPG_ERROR_VERSION): Set to 1.11. + (AH_BOTTOM) Add error codes from gpg-error 1.12 + * src/g10lib.h (fips_not_operational): Use GPG_ERR_NOT_OPERATIONAL. + + * mpi/ec.c (_gcry_mpi_ec_get_mpi): Fix computation of Q. + (_gcry_mpi_ec_get_point): Ditto. + + Remove unused code. + + commit 7524da2ba83d83a766c22d704006380c893e1c49 + * cipher/pubkey.c (_gcry_pk_module_lookup, _gcry_pk_module_release) + (_gcry_pk_get_elements): Remove. + +2013-04-05 Werner Koch + + Make the Q parameter optional for ECC signing. + + commit fe91a642c7c257aca095b96406fbcace88fa3df4 + * cipher/ecc.c (ecc_sign): Remove the need for Q. + * cipher/pubkey.c (sexp_elements_extract_ecc): Make Q optional for a + private key. + (sexp_to_key): Add optional arg R_IS_ECC. + (gcry_pk_sign): Do not call gcry_pk_get_nbits for ECC keys. + * tests/pubkey.c (die): Make sure to print a LF. + (check_ecc_sample_key): New. + (main): Call new test. + + Add test case for SCRYPT and rework the code. + + commit f23a068bcb6ec9788710698578d8be0a2a006dbc + * tests/t-kdf.c (check_scrypt): New. + (main): Call new test. + + * configure.ac: Support disabling of the scrypt algorithm. Make KDF + enabling similar to the other algorithm classes. Disable scrypt if we + don't have a 64 bit type. + * cipher/memxor.c, cipher/memxor.h: Remove. + * cipher/scrypt.h: Remove. + * cipher/kdf-internal.h: New. + * cipher/Makefile.am: Remove files. Add new file. Move scrypt.c to + EXTRA_libcipher_la_SOURCES. + (GCRYPT_MODULES): Add GCRYPT_KDFS. + * src/gcrypt.h.in (GCRY_KDF_SCRYPT): Change value. + * cipher/kdf.c (pkdf2): Rename to _gcry_kdf_pkdf2. + (_gcry_kdf_pkdf2): Don't bail out for SALTLEN=3D=3D0. + (gcry_kdf_derive): Allow for a passwordlen of zero for scrypt. Check + for SALTLEN > 0 for GCRY_KDF_PBKDF2. Pass algo to _gcry_kdf_scrypt. + (gcry_kdf_derive) [!USE_SCRYPT]: Return an error. + * cipher/scrypt.c: Replace memxor.h by bufhelp.h. Replace scrypt.h by + kdf-internal.h. Enable code only if HAVE_U64_TYPEDEF is defined. + Replace C99 types uint64_t, uint32_t, and uint8_t by libgcrypt types. + (_SALSA20_INPUT_LENGTH): Remove underscore from identifier. + (_scryptBlockMix): Replace memxor by buf_xor. + (_gcry_kdf_scrypt): Use gcry_malloc and gcry_free. Check for integer + overflow. Add hack to support blocksize of 1 for tests. Return + errors from calls to _gcry_kdf_pkdf2. + + * cipher/kdf.c (openpgp_s2k): Make static. + +2013-04-04 Christian Grothoff + + Add the SCRYPT KDF function. + + commit 855b1a8f81b5a3b5b31d0c3c303675425f58a5af + * scrypt.c, scrypt.h: New files. + * memxor.c, memxor.h: New files. + * cipher/Makefile.am: Add new files. + * cipher/kdf.c (gcry_kdf_derive): Support GCRY_KDF_SCRYPT. + * src/gcrypt.h.in (GCRY_KDF_SCRYPT): New. + +2013-03-22 Werner Koch + + Replace deprecated AM_CONFIG_HEADER macro. + + commit d0c8fda5af45354ac32928c9a01e688d6893599d + * configure.ac: s/AM_CONFIG_HEADER/AC_CONFIG_HEADER/ + + Disable AES-NI support if as does not support SSSE3. + + commit 9f4df1612ae21a5ce70d98930cb194e5193f5e2d + * configure.ac (HAVE_GCC_INLINE_ASM_SSSE3): New test. + (ENABLE_AESNI_SUPPORT): Do not define without SSSE3 support. + (HAVE_GCC_INLINE_ASM_SSSE3, ENABLE_AVX_SUPPORT): Split up detection + and definition. + +2013-03-21 Werner Koch + + Fix make dependency regression. + + commit 2a1e03c5a481689c43d197dd8034a1d73de0a1a4 + * src/Makefile.am (libgcrypt_la_DEPENDENCIES): Add missing backslash. + Reported by LRN. + +2013-03-20 Werner Koch + + Use finer grained on-the-fly helper computations for EC. + + commit 5fb3501aa0cf5f2b2a9012706bb9ad2b1c4bfd7d + * src/ec-context.h (mpi_ec_ctx_s): Replace NEED_SYNC by a bitfield. + * mpi/ec.c (ec_p_sync): Remove. + (ec_get_reset, ec_get_a_is_pminus3, ec_get_two_inv_p): New. + (ec_p_init): Use ec_get_reset. + (_gcry_mpi_ec_set_mpi, _gcry_mpi_ec_dup_point) + (_gcry_mpi_ec_add_points): Replace ec_p_sync by the ec_get_ accessors. + + Allow building with w64-mingw32. + + commit b402e550041782b770a6ae267c7c28ca8324a12e + * autogen.sh <--build-w32>: Support the w64-mingw32 toolchain. Also + prepare for 64 bit building. + + Provide GCRYPT_VERSION_NUMBER macro, add build info to the binary. + + commit 1eaad0a8c4cab227685a6a8768e539df2f1f4dac + * src/gcrypt.h.in (GCRYPT_VERSION_NUMBER): New. + * configure.ac (VERSION_NUMBER): New ac_subst. + * src/global.c (_gcry_vcontrol): Move call to above function ... + (gcry_check_version): .. here. + + * configure.ac (BUILD_REVISION, BUILD_FILEVERSION) + (BUILD_TIMESTAMP): Define on all platforms. + * compat/compat.c (_gcry_compat_identification): Include revision and + timestamp. + + Fix a memory leak in the new EC code. + + commit de07974d807b703a2554d6ba885ea249e648bd44 + * cipher/ecc.c (point_from_keyparam): Always call mpi_free on A. + +2013-03-19 Werner Koch + + Extend the new EC interface and fix two bugs. + + commit 931e409e877d1e444edd53dead327ec8e64daf9a + * src/ec-context.h (mpi_ec_ctx_s): Add field NEED_SYNC. + * mpi/ec.c (ec_p_sync): New. + (ec_p_init): Only set NEED_SYNC. + (_gcry_mpi_ec_set_mpi): Set NEED_SYNC for 'p' and 'a'. + (_gcry_mpi_ec_dup_point, _gcry_mpi_ec_add_points) + (_gcry_mpi_ec_mul_point): Call ec_p_sync. + (_gcry_mpi_ec_get_point): Recompute 'q' is needed. + (_gcry_mpi_ec_get_mpi): Ditto. Also allow for names 'q', 'q.x', + 'q.y', and 'g'. + * cipher/ecc.c (_gcry_mpi_ec_ec2os): New. + + * cipher/ecc.c (_gcry_mpi_ec_new): Fix init from parameters 'Q'->'q', + 'G'->'q'. + +2013-03-15 Werner Koch + + mpi: Add functions to manipulate an EC context. + + commit 229f3219f80c9369ed9624242c0436ae6d293201 + * src/gcrypt.h.in (gcry_mpi_ec_p_new): Remove. + (gcry_mpi_ec_new): New. + (gcry_mpi_ec_get_mpi): New. + (gcry_mpi_ec_get_point): New. + (gcry_mpi_ec_set_mpi): New. + (gcry_mpi_ec_set_point): New. + * src/visibility.c (gcry_mpi_ec_p_new): Remove. + * mpi/ec.c (_gcry_mpi_ec_p_new): Make it an internal function and + change to return an error code. + (_gcry_mpi_ec_get_mpi): New. + (_gcry_mpi_ec_get_point): New. + (_gcry_mpi_ec_set_mpi): New. + (_gcry_mpi_ec_set_point): New. + * src/mpi.h: Add new prototypes. + * src/ec-context.h: New. + * mpi/ec.c: Include that header. + (mpi_ec_ctx_s): Move to ec-context.h, add new fields, and put some + fields into an inner struct. + (point_copy): New. + * cipher/ecc.c (fill_in_curve): Allow passing NULL for R_NBITS. + (mpi_from_keyparam, point_from_keyparam): New. + (_gcry_mpi_ec_new): New. + + * tests/t-mpi-point.c (test-curve): New. + (ec_p_new): New. Use it instead of the removed gcry_mpi_ec_p_new. + (get_and_cmp_mpi, get_and_cmp_point): New. + (context_param): New test. + (basic_ec_math_simplified): New test. + (main): Call new tests. + + * src/context.c (_gcry_ctx_get_pointer): Check for a NULL CTX. + +2013-03-13 Werner Koch + + Add GCRYMPI_FLAG_CONST and make use constants. + + commit e005629bd7bebb3e13945645c6e1230b44ab16a2 + * src/gcrypt.h.in (GCRYMPI_FLAG_CONST): New. + * src/mpi.h (mpi_is_const, mpi_const): New. + (enum gcry_mpi_constants, MPI_NUMBER_OF_CONSTANTS): New. + * mpi/mpiutil.c (_gcry_mpi_init): New. + (constants): New. + (_gcry_mpi_free): Do not release a constant flagged MPI. + (gcry_mpi_copy): Clear the const and immutable flags. + (gcry_mpi_set_flag, gcry_mpi_clear_flag, gcry_mpi_get_flag): Support + GCRYMPI_FLAG_CONST. + (_gcry_mpi_const): New. + * src/global.c (global_init): Call _gcry_mpi_init. + * mpi/ec.c (mpi_ec_ctx_s): Remove fields one, two, three, four, and + eight. Change all users to call mpi_const() instead. + + * src/mpiutils.c (gcry_mpi_set_opaque): Check the immutable flag. + + Add GCRYMPI_FLAG_IMMUTABLE to help debugging. + + commit 1fecae98ee7e0fa49b29f98efa6817ca121ed98a + * src/gcrypt.h.in (GCRYMPI_FLAG_IMMUTABLE): New. + * src/mpi.h (mpi_is_immutable): New macro. + * mpi/mpiutil.c (gcry_mpi_set_flag, gcry_mpi_clear_flag) + (gcry_mpi_get_flag): Implement new flag + (_gcry_mpi_immutable_failed): New. + + * mpi/mpiutil.c (_gcry_mpi_clear, _gcry_mpi_free, gcry_mpi_snatch) + (gcry_mpi_set, gcry_mpi_randomize): Act upon the immutable flag. + * mpi/mpi-bit.c (gcry_mpi_set_bit, gcry_mpi_set_highbit) + (gcry_mpi_clear_highbit, gcry_mpi_clear_bit) + (_gcry_mpi_rshift_limbs, gcry_mpi_lshift): Ditto. + * mpi/mpicoder.c (_gcry_mpi_set_buffer): Ditto. + +2013-03-08 Werner Koch + + mpi: Add an API for EC math. + + commit 8ac9e756d3ca545a9b97e61ad3d42fc2e877d788 + * src/context.c, src/context.h: New. + * src/Makefile.am (libgcrypt_la_SOURCES): Add new files. + * src/gcrypt.h.in (struct gcry_context, gcry_ctx_t): New types. + (gcry_ctx_release): New prototype. + (gcry_mpi_ec_p_new, gcry_mpi_ec_get_affine, gcry_mpi_ec_dup) + (gcry_mpi_ec_add, gcry_mpi_ec_mul): New prototypes. + * mpi/ec.c: Include errno.h and context.h. + (_gcry_mpi_ec_init): Rename to .. + (ec_p_init): this, make static, remove allocation and add arg CTX. + (_gcry_mpi_ec_p_internal_new): New; to replace _gcry_mpi_ec_init. + Change all callers to use this func. + (_gcry_mpi_ec_free): Factor code out to .. + (ec_deinit): New func. + (gcry_mpi_ec_p_new): New. + * src/visibility.c: Include context.h and mpi.h. + (gcry_mpi_ec_p_new, gcry_mpi_ec_get_affine, gcry_mpi_ec_dup) + (gcry_mpi_ec_add, gcry_mpi_ec_mul) + (gcry_ctx_release): New wrapper functions. + * src/visibility.h: Mark new wrapper functions visible. + * src/libgcrypt.def, src/libgcrypt.vers: Add new symbols. + * tests/t-mpi-point.c (print_mpi, hex2mpi, cmp_mpihex): New. + (context_alloc): New. + (make_point, basic_ec_math): New. + + mpi: Add an API for EC point operations. + + commit 7cce620acddac2df024ca421ed3abc32a88f3738 + * mpi/ec.c (gcry_mpi_point_new, gcry_mpi_point_release): New. + (gcry_mpi_point_get, gcry_mpi_point_snatch_get): New. + (gcry_mpi_point_set, gcry_mpi_point_snatch_set): New. + * src/visibility.h, src/visibility.c: Add corresponding macros and + wrappers. + * src/gcrypt.h.in (struct gcry_mpi_point, gcry_mpi_point_t): New. + (gcry_mpi_point_new, gcry_mpi_point_release, gcry_mpi_point_get) + (gcry_mpi_point_snatch_get, gcry_mpi_point_set) + (gcry_mpi_point_snatch_set): New prototypes. + (mpi_point_new, mpi_point_release, mpi_point_get, mpi_point_snatch_get) + (mpi_point_set, mpi_point_snatch_set): New macros. + * src/libgcrypt.vers (gcry_mpi_point_new, gcry_mpi_point_release) + (gcry_mpi_point_get, gcry_mpi_point_snatch_get, gcry_mpi_point_set) + (gcry_mpi_point_snatch_set): New symbols. + * src/libgcrypt.def: Ditto. + * tests/t-mpi-point.c: New. + * tests/Makefile.am (TESTS): Add t-mpi-point + +2013-03-07 Werner Koch + + mpi: Add mpi_snatch and change an internal typedef. + + commit 6c4767637c512127a4362732b3ec51068554d328 + * src/mpi.h (struct mpi_point_s): Rename to struct gcry_mpi_point. + (mpi_point_struct): New typedef. + (mpi_point_t): Change typedef to a pointer. Replace all occurrences + to use mpi_point_struct. + * mpi/ec.c (_gcry_mpi_ec_point_init): Rename to .. + (_gcry_mpi_point_init): this. Change all callers. + (_gcry_mpi_ec_point_free): Rename to .. + (_gcry_mpi_point_free_parts): this. Change all callers. + + * mpi/mpiutil.c (gcry_mpi_snatch): New function. + * src/gcrypt.h.in (gcry_mpi_snatch, mpi_snatch): Add protoype and + macro. + * src/visibility.c (gcry_mpi_snatch): Add wrapper. + * src/visibility.h (gcry_mpi_snatch): Add macro magic. + * src/libgcrypt.def, src/libgcrypt.vers: Add new function. + + Pretty print the configure feedback. + + commit c620099e4ab2f35e0196b395a805bb655c984ac2 + * acinclude.m4 (GNUPG_MSG_PRINT): Remove. + (GCRY_MSG_SHOW, GCRY_MSG_WRAP): New. + * configure.ac: Use new macros for the feedback. + +2013-02-20 Werner Koch + + Fix building of hwf-x86.c. + + commit 70dcac663de06b012417015c175973d64e6980df + * src/Makefile.am (AM_CFLAGS): Set to GPG_ERROR_CFLAGS + (AM_CCASFLAGS): Set NOEXECSTACK_FLAGS. + + Remove build hacks for FreeBSD. + + commit fb48ebf7081400a24ee48f8a9894a361e8834b6e + * configure.ac [freebsd]: Do not add /usr/local to CPPFLAGS and + LDFLAGS. + +2013-02-19 Jussi Kivilinna + + Rinjdael: Fix use of SSE2 outside USE_AESNI/ctx->use_aesni. + + commit 0da77955a097bfd2469ad084b3e9fcac4fb1e3fa + * cipher/rijndael.c (_gcry_aes_cbc_enc): Check if AES-NI is enabled before + calling aesni_prepare() and aesni_cleanup(). + + Add AES-NI/AVX accelerated Camellia implementation. + + commit 63ac3ba07dba82fde040d31b90b4eff627bd92b9 + * configure.ac: Add option --disable-avx-support. + (HAVE_GCC_INLINE_ASM_AVX): New. + (ENABLE_AVX_SUPPORT): New. + (camellia) [ENABLE_AVX_SUPPORT, ENABLE_AESNI_SUPPORT]: Add + camellia_aesni_avx_x86-64.lo. + * cipher/Makefile.am (AM_CCASFLAGS): Add. + (EXTRA_libcipher_la_SOURCES): Add camellia_aesni_avx_x86-64.S + * cipher/camellia-glue.c [ENABLE_AESNI_SUPPORT, ENABLE_AVX_SUPPORT] + [__x86_64__] (USE_AESNI_AVX): Add macro. + (struct Camellia_context) [USE_AESNI_AVX]: Add use_aesni_avx. + [USE_AESNI_AVX] (_gcry_camellia_aesni_avx_ctr_enc) + (_gcry_camellia_aesni_avx_cbc_dec): New prototypes to assembly + functions. + (camellia_setkey) [USE_AESNI_AVX]: Enable AES-NI/AVX if hardware + support both. + (_gcry_camellia_ctr_enc) [USE_AESNI_AVX]: Add AES-NI/AVX code. + (_gcry_camellia_cbc_dec) [USE_AESNI_AVX]: Add AES-NI/AVX code. + * cipher/camellia_aesni_avx_x86-64.S: New. + * src/g10lib.h (HWF_INTEL_AVX): New. + * src/global.c (hwflist): Add HWF_INTEL_AVX. + * src/hwf-x86.c (detect_x86_gnuc) [ENABLE_AVX_SUPPORT]: Add detection + for AVX. + + camellia.c: Prepare for AES-NI/AVX implementation. + + commit 4de62d80644228fc5db2a9f9c94a7eb633d8de2e + * cipher/camellia-glue.c (CAMELLIA_encrypt_stack_burn_size) + (CAMELLIA_decrypt_stack_burn_size): Increase stack burn size. + * cipher/camellia.c (CAMELLIA_ROUNDSM): Move key-material mixing in + the front. + (camellia_setup128, camellia_setup256): Remove now unneeded + key-material mangling. + (camellia_encrypt128, camellia_decrypt128, amellia_encrypt256) + (camellia_decrypt256): Copy block to stack, so that compiler can + optimize it for register usage. + + Camellia, prepare glue code for AES-NI/AVX implementation. + + commit 537f12ce072d568f9fa344c447d32b2e0efffbe8 + * cipher/camellia-glue.c (ATTR_ALIGNED_16): Add macro. + (CAMELLIA_encrypt_stack_burn_size): Add macro. + (camellia_encrypt): Use macro above for stack burn size. + (CAMELLIA_decrypt_stack_burn_size): Add macro. + (camellia_decrypt): Use macro above for stack burn size. + (_gcry_camellia_ctr_enc): New function. + (_gcry_camellia_cbc_dec): New function. + (selftest_ctr_128): New function. + (selftest): Call function above. + * cipher/cipher.c (gcry_cipher_open) [USE_CAMELLIA]: Register bulk + functions for CBC-decryption and CTR-mode. + * src/cipher.h (_gcry_camellia_ctr_enc): New prototype. + (_gcry_camellia_cbc_dec): New prototype. + +2012-12-21 Werner Koch + + Prepare for hardware feature detection on other platforms. + + commit 09ac5d87d11aa0b1fa0e0a4184ab03b3671a73e2 + * configure.ac (GCRYPT_HWF_MODULES): New. + (HAVE_CPU_ARCH_X86, HAVE_CPU_ARCH_ALPHA, HAVE_CPU_ARCH_SPARC) + (HAVE_CPU_ARCH_MIPS, HAVE_CPU_ARCH_M68K, HAVE_CPU_ARCH_PPC) + (HAVE_CPU_ARCH_ARM): New AC_DEFINEs. + * mpi/config.links (mpi_cpu_arch): New. + * src/global.c (print_config): Print new tag "cpu-arch". + * src/Makefile.am (libgcrypt_la_SOURCES): Add hwf-common.h + (EXTRA_libgcrypt_la_SOURCES): New. + (gcrypt_hwf_modules): New. + (libgcrypt_la_DEPENDENCIES, libgcrypt_la_LIBADD): Add that one. + * src/hwfeatures.c: Factor most code out to ... + * src/hwf-x86.c: New file. + (detect_x86_gnuc): Return the feature vector. + (_gcry_hwf_detect_x86): New. + * src/hwf-common.h: New. + * src/hwfeatures.c (_gcry_detect_hw_features): Dispatch using + HAVE_CPU_ARCH_ macros. + +2012-12-21 Jussi Kivilinna + + Clean up i386/x86-64 cpuid usage in hwfeatures.c. + + commit d842eea55e22c05da3959a7a4422b5fcd7884f60 + * src/hwfeatures.c [__i386__ && __GNUC__] (detect_ia32_gnuc): Remove. + [__x86_64__ && __GNUC__] (detect_x86_64_gnuc): Remove. + [__i386__ && __GNUC__] (is_cpuid_available, get_cpuid) + (HAS_X86_CPUID): New. + [__x86_64__ && __GNUC__] (is_cpuid_available, get_cpuid) + (HAS_X86_CPUID): New. + [HAS_X86_CPUID] (detect_x86_gnuc): New. + (_gcry_detect_hw_features) [__i386__ && GNUC]: Remove detect_ia32_gnuc + call. + (_gcry_detect_hw_features) [__x86_64__ && GNUC]: Remove + detect_x86_64_gnuc call. + (_gcry_detect_hw_features) [HAS_X86_CPUID]: Add detect_x86_gnuc call. + +2012-12-18 Dmitry Kasatkin + + Add support for using DRNG random number generator. + + commit efd7002188e6d50013e4d9a920a8b9afa9d210e5 + * configure.ac: Add option --disable-drng-support. + (ENABLE_DRNG_SUPPORT): New. + * random/rndhw.c (USE_DRNG): New. + (rdrand_long, rdrand_nlong, poll_drng): New. + (_gcry_rndhw_poll_fast, _gcry_rndhw_poll_slow): Call poll function. + * src/g10lib.h (HWF_INTEL_RDRAND): New. + * src/global.c (hwflist): Add "intel-rdrand". + * src/hwfeatures.c (detect_x86_64_gnuc) [ENABLE_DRNG_SUPPORT]: Detect + RDRAND. + (detect_ia32_gnuc) [ENABLE_DRNG_SUPPORT]: Detect RDRAND. + +2012-12-03 Werner Koch + + random: Add a RNG selection interface and system RNG wrapper. + + commit 7607ab81504ce44060ed0b331d309606f5da1e75 + * random/random-system.c: New. + * random/Makefile.am (librandom_la_SOURCES): Add new module. + * random/random.c (struct rng_types): New. + (_gcry_set_preferred_rng_type, _gcry_get_rng_type): New. + (_gcry_random_initialize, gcry_random_add_bytes, do_randomize) + (_gcry_set_random_seed_file, _gcry_update_random_seed_file) + (_gcry_fast_random_poll): Dispatch to the actual RNG. + * src/gcrypt.h.in (GCRYCTL_SET_PREFERRED_RNG_TYPE): New. + GCRYCTL_GET_CURRENT_RNG_TYPE): New. + (gcry_rng_types): New. + * src/global.c (print_config): Print the TNG type. + (global_init, _gcry_vcontrol): Implement the new control codes. + * doc/gcrypt.texi (Controlling the library): Document the new control + codes. + + * tests/benchmark.c (main): Add options to test the RNG types. + * tests/random.c (main): Add new options. + (print_hex): Print to stderr. + (progress_cb, rng_type): New. + (check_rng_type_switching, check_early_rng_type_switching): New. + (run_all_rng_tests): New. + + tests: Allow use of random.c under Windows. + + commit 76c622e24a07f7c826812be173aa173b4334776b + * tests/Makefile.am (TESTS): Always include random.c + * tests/random.c [!W32]: Include sys/wait.h. + (inf): New. + (check_forking, check_nonce_forking): Print a notice what will be done. + (main) [W32]: Do not call signal. + + Make random-fips.c work multi-threaded. + + commit 75760021b511ba438606af746431223357e7a155 + * random/random-fips.c (basic_initialization): Fix reversed logic. + + Move nonce creation from csprng backend to random main module. + + commit c324644aa14e54fc7051983b38222db32b8ab227 + * random/random-csprng.c (_gcry_rngcsprng_create_nonce): Remove. + (nonce_buffer_lock): Remove. + (initialize_basics): Remove init of nonce_buffer_lock. + * random/random.c: Add a few header files. + (nonce_buffer_lock): New. + (_gcry_random_initialize): Init nonce_buffer_lock. + (gcry_create_nonce): Add code from _gcry_rngcsprng_create_nonce. + + * random/random-daemon.c (_gcry_daemon_create_nonce): Remove. + +2012-12-03 Jussi Kivilinna + + Fix building with CC=3D"gcc -std=3Dc90". + + commit f851b9a932ee64fa5a06000d1ac763ba4349f07d + * configure.ac: Add check for missing 'asm' keyword in C90 mode and + replacement with '__asm__'. + +2012-12-03 Werner Koch + + Try to use inttypes.h if stdint.h is not available. + + commit d9ec7aec1301b13a89e5c9c54d7ad52e1a29b846 + * cipher/bufhelp.h [HAVE_INTTYPES_H]: Include inttypes.h + +2012-12-03 Jussi Kivilinna + + Optimize buffer xoring. + + commit 162791bc08f4fc9b3882671e68ecdfd9e130ae59 + * cipher/Makefile.am (libcipher_la_SOURCES): Add 'bufhelp.h'. + * cipher/bufhelp.h: New. + * cipher/cipher-aeswrap.c (_gcry_cipher_aeswrap_encrypt) + (_gcry_cipher_aeswrap_decrypt): Use 'buf_xor' for buffer xoring. + * cipher/cipher-cbc.c (_gcry_cipher_cbc_encrypt) + (_gcry_cipher_cbc_decrypt): Use 'buf_xor' for buffer xoring and remove + resulting unused variables. + * cipher/cipher-cfb.c (_gcry_cipher_cfb_encrypt) Use 'buf_xor_2dst' + for buffer xoring and remove resulting unused variables. + (_gcry_cipher_cfb_decrypt): Use 'buf_xor_n_copy' for buffer xoring and + remove resulting unused variables. + * cipher/cipher-ctr.c (_gcry_cipher_ctr_encrypt): Use 'buf_xor' for + buffer xoring and remove resulting unused variables. + * cipher/cipher-ofb.c (_gcry_cipher_ofb_encrypt) + (_gcry_cipher_ofb_decrypt): Use 'buf_xor' for buffer xoring and remove + resulting used variables. + * cipher/rijndael.c (_gry_aes_cfb_enc): Use 'buf_xor_2dst' for buffer + xoring and remove resulting unused variables. + (_gry_aes_cfb_dev): Use 'buf_xor_n_copy' for buffer xoring and remove + resulting unused variables. + (_gry_aes_cbc_enc, _gry_aes_ctr_enc, _gry_aes_cbc_dec): Use 'buf_xor' + for buffer xoring and remove resulting unused variables. + +2012-11-29 Jussi Kivilinna + + Optimize AES-NI CTR mode. + + commit 9ee9e25f519696d509b1a5c1cc04ab0121e98a51 + * cipher/rijndael.c [USE_AESNI] (do_aesni_ctr, do_aesni_ctr_4): Make + handling of 64-bit overflow and carry conditional. Avoid generic to + vector register passing of value '1'. Generate and use '-1' instead. + +2012-11-28 Werner Koch + + Make a cpp conditional in rijndael.c better readable. + + commit 6765e0a8618000d3dc7bda035163e0708c43791b + * cipher/rijndael.c (USE_AESNI): Modify cpp conditionals for better + readability. + +2012-11-28 Jussi Kivilinna + + Fix building with Clang on x86-64 and i386. + + commit 99e272d938fe23efec25af409bdb91dae0e659e5 + * cipher/rijndael.c [USE_AESNI] (do_aesni_enc_aligned) + (do_aesni_dec_vec4, do_aesni_cfb, do_aesni_ctr, do_aesni_ctr_4): Add + explicit suffix to 'cmp' instructions. + +2012-11-26 Jussi Kivilinna + + Optimize wipememory2 for i386 and x86-64. + + commit faec12e23f03c7cd1614594bfdd51f1302cadb42 + * src/g10lib.h (wipememory2): Add call to fast_wipememory2. + (fast_wipememory2): New macros for i386 and x86-64 architectures. + Empty macro provided for other architectures. + + Fix missing 64bit carry handling in AES-NI CTR mode. + + commit fc37e805c6394c2e635d1a033670be961f36a6d2 + * cipher/rijndael.c [USE_AESNI] (do_aesni_ctr, do_aesni_ctr_4): Add + carry handling to 64-bit addition. + (selftest_ctr_128): New function for testing IV handling in bulk CTR + function. + (selftest): Add call to selftest_ctr_128. + + Add parallelized AES-NI CBC decryption. + + commit 35aff0cd43885b5f5c076432ec614698abeb63d8 + * cipher/rijndael.c [USE_AESNI] (aesni_cleanup_5): New macro. + [USE_AESNI] (do_aesni_dec_vec4): New function. + (_gcry_aes_cbc_dec) [USE_AESNI]: Add parallelized CBC loop. + (_gcry_aes_cbc_dec) [USE_AESNI]: Change IV storage register from xmm3 + to xmm5. + + Clear xmm5 after use in AES-NI CTR mode. + + commit 5acd0e5ae2a58dda51c2b56c879b80a1a6d2c42f + * cipher/rijndael.c [USE_AESNI]: Rename aesni_cleanup_2_4 to + aesni_cleanup_2_5. + [USE_AESNI] (aesni_cleanup_2_5): Clear xmm5 register. + (_gcry_aes_ctr_enc, _gcry_aes_cbc_dec) [USE_AESNI]: Use + aesni_cleanup_2_5 instead of aesni_cleanup_2_4. + + Optimize AES-NI CBC encryption. + + commit be3768994ad362dfc849a8cd0146b4c9bb287d20 + * cipher/rijndeal.c (_gcry_aes_cbc_enc) [USE_AESNI]: Add AES-NI + spesific loop and use SSE2 assembler for xoring and copying of + blocks. + + Improve parallelizability of CBC decryption for AES-NI. + + commit 3369d960158ab4231b83926a0f982e2a8819f173 + * cipher/rijndael.c (_gcry_aes_cbc_dec) [USE_AESNI]: Add AES-NI + specific CBC mode loop with temporary block and IV stored in free SSE + registers. + + Extend test of chained modes for 128bit ciphers. + + commit 55b96be08531664ed3f4230acebe0f45954bbc33 + * tests/basic.c (check_one_cipher_core, check_one_cipher): Increase + input and output buffer sizes from 16 bytes to 1024+16=3D1040 bytes. + (check_one_cipher_core): Add asserts to verify sizes of temporary + buffers. + +2012-11-21 Werner Koch + + Fix for strict aliasing rules. + + commit dfb4673da8ee52d95e0a62c9f49ca8599943f22e + * cipher/rijndael.c (do_setkey, prepare_decryption): Use u32_a_t for + casting. + + Do not detect AES-NI support if disabled by configure. + + commit 3047795794eb238aa684bd0729acf64c82a19e09 + * src/hwfeatures.c (detect_ia32_gnuc): Detect AESNI support only if + that support has been enabled. + +2012-11-21 Jussi Kivilinna + + Fix too large burn_stack in camellia-glue.c. + + commit 8afabc2813948778a3db52d9dee9a041a3dd50d4 + * cipher/camellia-glue.c (camellia_encrypt, camellia_decrypt): Do not + take full array size of KEY_TABLE_TYPE, but argument size instead. + + Add x86_64 support for AES-NI. + + commit d8bdfa42ed582655c180e7db9b16d4e756a12a6e + * cipher/rijndael.c [ENABLE_AESNI_SUPPORT]: Enable USE_AESNI on x86-64. + (do_setkey) [USE_AESNI_is_disabled_here]: Use %[key] and %[ksch] + directly as registers instead of using temporary register %%esi. + [USE_AESNI] (do_aesni_enc_aligned, do_aesni_dec_aligned, do_aesni_cfb, + do_aesni_ctr, do_aesni_ctr_4): Use %[key] directly as register instead + of using temporary register %%esi. + [USE_AESNI] (do_aesni_cfb, do_aesni_ctr, do_aesni_ctr_4): Change %[key] + from generic "g" type to register "r". + * src/hwfeatures.c (_gcry_detect_hw_features) [__x86_64__]: Do not + clear AES-NI feature flag. + + Fix cpuid vendor-id check for i386 and x86-64. + + commit 9e1552517f68459a165ddebbba85e7cf37ff4f0c + * src/hwfeatures.c (detect_x86_64_gnuc, detect_ia32_gnuc): Allow + Intel features be detect from CPU by other vendors too. + + Fix hwdetect assembler clobbers. + + commit 19b9efd1f47a5de9c450ce8212dfa3174a029c7a + * src/hwfeatures.c (detect_x86_64_gnuc): Add missing %ebx assembler + clobbers. + (detect_x86_64_gnuc, detect_ia32_gnuc) [ENABLE_PADLOCK_SUPPORT]: Add + missing %ecx assembler clobbers. + +2012-11-21 Werner Koch + + Use configure test for aligned attribute. + + commit 6368ed542150956ff4ba8170a15bbc534143675c + * configure.ac (HAVE_GCC_ATTRIBUTE_ALIGNED): New test and ac_define. + * cipher/cipher-internal.h, cipher/rijndael.c, random/rndhw.c: Use new + macro instead of a fixed test for __GNUC__. + + Fix segv with AES-NI on some platforms. + + commit a96974de734beb51a733a89b3283bcf7b433b54c + * cipher/rijndael.c (RIJNDAEL_context): Align on 16 bytes. + +2012-11-16 Werner Koch + + Improve parsing of the GIT revision number. + + commit 4b18e530f417d4af401a3fd721ad2a07e5310e3e + * configure.ac (mmm4_revision): Use git rev-parse. + +2012-11-08 Werner Koch + + Fix extern inline use for gcc > 4.3 in c99 mode. + + commit 5abc06114e91beca0177331e1c79815f5fb6d7be + * mpi/mpi-inline.h [!G10_MPI_INLINE_DECL]: Take care of changed extern + inline semantics in gcc. + +2012-11-07 Werner Koch + + Fix memory leak in gcry_pk_testkey for ECC. + + commit 8cbbad5f94f6e0429fffe66d689aea20f7e35957 + * cipher/ecc.c (check_secret_key): Restructure for easier allocation + tracking. Fix memory leak. + +2012-11-05 Werner Koch + + Prepare for a backported interface in 1.5.1. + + commit 7af98ef78d45e813f47ae4e180a02757a379953f + * configure.ac: Bump LT version at C20/A0/R0 to adjust for a planned + API update in 1.5.1. + + Adjust for stricter autoconf requirements. + + commit 1241fbbc896e9bbad68f1007a17b20493f6cd1af + * configure.ac: Fix usage of AC_LANG_PROGRAM. + + Update build helper scripts. + + commit a5c4d45e8d12737cd21b095c81da5c18e2afc39e + * config.guess, config.sub: Update to version 2012-07-31. + * ltmain.sh: Update to version 2.4.2. + * install-sh, m4/libtool.m4, m4/ltoptions.m4, m4/ltversion.m4 + * m4/lt~obsolete.m4: Update to autoconf 2.69 versions. + + Do not distribute a copy of gitlog-to-changelog. + + commit 40976d7da5420453bf93a9c99f0cc4c7044d0774 + * Makefile.am (GITLOG_TO_CHANGELOG): New. + (gen-ChangeLog): Require an installed gitlog-to-changelog. + * scripts/gitlog-to-changelog: Remove. + + * README.SVN: Remove. + * REMOVE.GIT: New. + + Allow building with w64-mingw32. + + commit 4f6fb150558d0ed250bfbd50352c258a4456ba50 + * autogen.sh <--build-w32>: Support the w64-mingw32 toolchain. Also + prepare for 64 bit building. + : Remove option -c from chmod. + + Switch to the new automagic beta numbering scheme. + + commit 7d5195be76d9dd4adc28976ad153e8f7761c5855 + * configure.ac: Add all the required m4 magic. + + Avoid dereferencing pointer right after the end. + + commit 79502e2c1982047dcf2b776f52826f38bbd9b1fe + * mpi/mpicoder.c (do_get_buffer): Check the length before derefing P. + +2012-10-30 Werner Koch + + Make ancient test program useful again. + + commit 66adf76e634423bb72ce1f0b5ed78f4e4798f190 + * tests/testapi.c (test_sexp): Adjust to current API. Print the + return code. Mark unused args. + (test_genkey): Mark unused args. + (main): Do not pass NULL to printf. + + tests: Add ECC key generation tests. + + commit c13164884ade6b1e945cddacce2d244fd881de6b + * tests/keygen.c (check_generated_ecc_key): New. + (check_ecc_keys): New. + (main): Call simple ECC checks. + +2012-10-30 Milan Broz + + PBKDF2: Allow empty passphrase. + + commit 8528f1ba40e587dc17e02822e529fbd7ac69a189 + * cipher/kdf.c (gcry_kdf_derive): Allow empty passphrase for PBKDF2. + * tests/t-kdf.c (check_pbkdf2): Add test case for above. + +2012-08-16 Xi Wang + + Replace deliberate division by zero with _gcry_divide_by_zero. + + commit 2c54c4da19d3a79e9f749740828026dd41f0521a + * mpi/mpi-pow.c: Replace 1 / msize. + * mpi/mpih-div.c: Replace 1 / dsize. + * src/misc.c: Add _gcry_divide_by_zero. + +2012-06-21 Werner Koch + + Clear AESNI feature flag for x86_64. + + commit 2196728e2252917849c1be94417258076767021b + * src/hwfeatures.c (_gcry_detect_hw_features) [__x86_64__]: Clear + AESNI feature flag. + + Beautify last change. + + commit 20e423212c9710ee663e12dd0f62580ceb245a6f + * cipher/rijndael.c: Replace C99 feature from last patch. Keep cpp + lines short. + * random/rndhw.c: Keep cpp lines short. + * src/hwfeatures.c (_gcry_detect_hw_features): Make cpp def chain + better readable. + +2012-06-21 Rafa=C3=ABl Carr=C3=A9 + + Enable VIA Padlock on x86_64 platforms. + + commit baf0dc7e9c26167ab43ba2adebcf2f1abc9d9b3b + * cipher/rijndael.c: Duplicate x86 assembly and convert to x86_64. + * random/rndhw.c: Likewise. + * src/hwfeatures.c: Likewise. + +2012-05-14 Werner Koch + + Add curve aliases from RFC-5656. + + commit 39c123b729a472ace039f8536d07f8b9a5f4675a + * cipher/ecc.c (curve_aliases): Add "nistp???" entries. + +2012-04-16 Werner Koch + + State new contribution rules. + + commit 3bb858551cd5d84e43b800edfa2b07d1529718a9 + * doc/DCO: New. + * doc/HACKING: Document new rules. + +2012-04-04 Tomas Mraz + + Add GCRYCTL_SET_ENFORCED_FIPS_FLAG command. + + commit 90e49a11733bfba9c3c505ac487282d35757f682 + * doc/gcrypt.texi: Add documentation of the new command. + * src/fips.c (_gcry_enforced_fips_mode): Report the enforced fips mode + only when fips mode is enabled. + (_gcry_set_enforced_fips_mode): New function. + * src/g10lib.h: Add the _gcry_set_enforced_fips_mode prototype. + * src/gcrypt.h.in: Add the GCRYCTL_SET_ENFORCED_FIPS_FLAG. + * src/global.c (_gcry_vcontrol): Handle the new command. + +2012-02-17 Ulrich M=C3=BCller + + Rework selftest in idea.c. + + commit 70cca617ed75ea292e1fed769114dda5cc1d76f1 + * cipher/idea.c (do_setkey): Execute selftest when first called. + (decrypt_block): Remove commented-out code. + (selftest): Execute all selftests. Return NULL on success, or + string in case of error. + +2012-02-16 Werner Koch + + Fix missing prototype. + + commit 46035d28c9b413851d43a4008fdc8e4cdf5d686b + * src/g10lib.h (_gcry_secmem_module_init): Make it a real prototype. + +2012-02-16 Ulrich M=C3=BCller + + Add support for the IDEA cipher. + + commit 318fd85f377c060908d371f792d41e599b3b7483 + Adapt idea.c to the Libgcrypt framework. + Add IDEA to cipher_table and to the build system. + + Patents on IDEA have expired: + Europe: EP0482154 on 2011-05-16, + Japan: JP3225440 on 2011-05-16, + U.S.: 5,214,703 on 2012-01-07. + + * configure.ac: Add idea to the list of available ciphers. + Define USE_IDEA if idea is enabled. + * cipher/cipher.c (cipher_table): Add entry for IDEA. + * cipher/idea.c: Update comment about patents. + Include proper header files and remove redundant declarations. + (expand_key, cipher, do_setkey, encrypt_block, decrypt_block): + Define function arguments as const where appropriate. + (cipher): Test for !WORDS_BIGENDIAN instead of LITTLE_ENDIAN_HOST. + (do_setkey, decrypt_block): Don't call selftest. + (idea_setkey): New function, wrapper for do_setkey. + (idea_encrypt): New function, wrapper for encrypt_block. + (_gcry_cipher_spec_idea): Define. + * cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add idea.c. + * src/cipher.h (_gcry_cipher_spec_idea): Declare. + * tests/basic.c (check_ciphers): Add GCRY_CIPHER_IDEA. + +2012-01-09 Werner Koch + + Include an IDEA implementation. + + commit 6078b05f5340d886e0b9e6cee1d9b5043e0cb210 + The code is the old IDEA test code, written by me back in 1997 and + distributed on a Danish FTP server. This commit is only for + reference. To use the code it has to be adjusted to the Libgcrypt + framework. + +2012-01-03 Marcus Brinkmann + + Fix pthread locking and remove defunctional support for static lock init. + + commit 38fcd59ce774eaa3d65f2f7534c989afd860eb56 + * src/ath.c: Include assert.h. + (ath_mutex_destroy, ath_mutex_lock, ath_mutex_unlock): Dereference LOCK. + * src/g10lib.h (_gcry_secmem_module_init): New declaration. + * src/global.c (global_init): Call _gcry_secmem_module_init. + * src/secmem.c (_gcry_secmem_module_init): New function. + +2011-12-16 Werner Koch + + Add alignment tests for the cipher tests. + + commit 14cf1f7e338fedb8edaff5631441746605152bd6 + * tests/basic.c (check_one_cipher): Factor most code out to + check_one_cipher_core. Call that core function several times using + different alignment settings. + (check_one_cipher_core): New. Add extra args to allow alignment + testing. + +2011-12-07 Werner Koch + + tests/prime: Add option to create a well known private key. + + commit 16f5654643d584e3bc739b636752d779176b2191 + * tests/prime.c (print_mpi, create_42prime): New. + (main): Add option --42. + +2011-12-01 Werner Koch + + Do not build the random-daemon by make distcheck. + + commit ea1fb538d99f1ec093f2fef86f4f29176ec27826 + * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Disable building of the + random daemon + + Generate the ChangeLog from commit logs. + + commit 137d73191c904926ba529376144ee8239af4ca02 + * scripts/gitlog-to-changelog: New script. Taken from gnulib. + * scripts/git-log-fix: New file. + * scripts/git-log-footer: New file. + * doc/HACKING: Describe the ChangeLog policy + * ChangeLog: New file. + * Makefile.am (EXTRA_DIST): Add new files. + (gen-ChangeLog): New. + (dist-hook): Run gen-ChangeLog. + + Rename all ChangeLog files to ChangeLog-2011. + +2011-12-01 Werner Koch + + NB: Changes done before December 1st, 2011 are described in + per directory files named ChangeLog-2011. See doc/HACKING for + details. + + ----- + Copyright (C) 2011 Free Software Foundation, Inc. + + Copying and distribution of this file and/or the original GIT + commit log messages, with or without modification, are + permitted provided the copyright notice and this notice are + preserved. diff --git a/grub-core/lib/libgcrypt/ChangeLog-2011 b/grub-core/lib/libgcry= pt/ChangeLog-2011 new file mode 100644 index 000000000..3c70a1f8e --- /dev/null +++ b/grub-core/lib/libgcrypt/ChangeLog-2011 @@ -0,0 +1,1499 @@ +2011-12-01 Werner Koch + + NB: ChangeLog files are no longer manually maintained. Starting + on December 1st, 2011 we put change information only in the GIT + commit log, and generate a top-level ChangeLog file from logs at + "make dist". See doc/HACKING for details. + +2011-11-28 Jim Meyering + + accept --with-libgpg-error-prefix as well as --with-gpg-error-prefix + * m4/gpg-error.m4: Update from git master. + +2011-09-16 Werner Koch + + * configure.ac (HAVE_PTHREAD): New. + +2011-09-15 Werner Koch + + * configure.ac: Bump LT version at C19/A0/R0 due to the ABI change. + + * configure.ac (CC_FOR_BUILD): New. + +2011-06-29 Werner Koch + + Release 1.5.0. + + * configure.ac: Keep LT version at C18/A7/R0 because it has + already been bumped up at 2010-07-09. + + * config.guess, config.sub: Update to 2011-06-03. + +2011-04-06 Werner Koch + + * configure.ac (emacs_local_vars_begin): Move more to the top to + avoid Emacs warnings. + +2011-03-30 Werner Koch + + * compat/compat.c (_gcry_compat_identification): Add version string. + +2011-03-08 Werner Koch + + * configure.ac (BUILD_REVISION): Use new git_brevis macro. + +2011-02-23 Werner Koch + + * configure.ac (LIBGCRYPT_CONFIG_HOST): New. + + * acinclude.m4 (AM_PATH_GPG_ERROR): Remove. + +2011-02-21 Werner Koch + + Release 1.5.0-beta1. + +2011-02-18 Werner Koch + + * configure.ac [GCC]: Remove the use of -fno-strict-aliasing. + +2011-02-11 Werner Koch + + * configure.ac: Add option --disbale-aesni-support. + (ENABLE_AESNI_SUPPORT): New macro. + +2011-02-04 Werner Koch + + * autogen.sh: Install the git pre-commit if not yet done. + +2010-12-23 Werner Koch + + * configure.ac (BUILD_REVISION): Use git_revision. + +2010-08-19 Werner Koch + + * configure.ac: Define GPG_ERR_ENABLE_ERRNO_MACROS. Remove + definition of _GNU_SOURCE. + (AC_GNU_SOURCE): New. + +2010-08-16 Werner Koch + + * configure.ac (INSERT_SYS_SELECT_H): New. + +2010-07-09 Werner Koch + + * configure.ac: Bump LT version to C18/A7/R0 to prepare a backport + of a new API to the 1.4 series. + +2010-04-19 Marcus Brinkmann + + * configure.ac: Check for -fno-strict-aliasing. + +2010-04-12 Brad Hards (wk) + + * configure.ac: Print more verbose info at the end. + +2010-03-24 Werner Koch + + * configure.ac (USE_RNDW32CE): New. + +2010-03-15 Werner Koch + + * configure.ac (emacs_local_vars_begin) + (emacs_local_vars_read_only, emacs_local_vars_end): New. + +2010-01-21 Werner Koch + + * compat/Makefile.am: New. + * compat/compat.c: New. + * compat/libcompat.h: New. + * compat/getpid.c, compat/clock.c: New. + + * configure.ac: Require libgpg-error 1.8. + (HAVE_W32CE_SYSTEM): New am_defines and am_conditionals. + (getpid): Check for replacement function. + (AC_CONFIG_LIBOBJ_DIR): New. + (AC_TYPE_PID_T): New. + (AM_INIT_AUTOMAKE): Use modern variant. + (AC_CONFIG_FILES): Add compat/Makfile. + * autogen.sh: Support W32CE. + * ltmain.sh: Update to 2.2.6b + (wrappers_required): Don't set for mingw32ce. + * Makefile.am (DIST_SUBDIRS, SUBDIRS): Add compat. + +2009-12-10 Werner Koch + + * configure.ac: Add option --disable-O-flag-munging. + +2009-12-08 Marcus Brinkmann + + Update to libtool 2.2.6a. + * configure.ac: Invoke AC_CONFIG_MACRO_DIR. + (AC_LIBTOOL_WIN32_DLL, AC_LIBTOOL_RC): Replace by ... + (LT_PREREQ, LT_INIT, LT_LANG): ... these. + * config.guess, config.sub, install-sh, ltmain.sh, m4/libtool.m4: + Updated to libtool 2.2.6a. + * m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4, + m4/lt~obsolete.m4: New files from libtool 2.2.6a. + +2009-08-05 Werner Koch + + * configure.ac: Test for sys/msg.h. + +2009-04-23 Werner Koch + + * README: Add a section on build problems. + +2009-01-22 Werner Koch + + * configure.ac: Bump LT version to C17/A6/R0 to mark the start of + a new development series. + +2009-01-22 Werner Koch + + Release 1.4.4. + + * configure.ac: Bump LT version to C16/A5/R2. + +2008-10-30 Werner Koch + + * configure.ac: Remove option --enable-gcc-warnings. Autodetect + useful gcc warnings in maintainer mode. + +2008-09-18 Werner Koch + + Release 1.4.3. + + * configure.ac: Bump LT version to C16/A5/R1. + +2008-09-15 Werner Koch + + * configure.ac: Cehck for syslog. + +2008-09-08 Werner Koch + + Release 1.4.2. + +2008-09-01 Werner Koch + + Release 1.4.2rc2. + + * configure.ac: Update svn_revision macro. + +2008-08-22 Werner Koch + + * configure.ac: Add option --enable-hmac-binary-check. + (DL_LIBS): Check whether -ldl is required. + +2008-08-19 Werner Koch + + Release 1.4.2rc1. + + * configure.ac: Bump LT version to C16/A5/R0. + +2008-08-18 Werner Koch + + * Makefile.am (EXTRA_DIST): Remove the unused BUGS file. + +2008-08-15 Werner Koch + + * configure.ac (AH_BOTTOM): Define GCRY_GPG_ERR_NOT_OPERATIONAL. + +2008-07-05 Werner Koch + + * random/: New. + * Makefile.am (DIST_SUBDIRS): Add random. + * configure.ac (AC_CONFIG_FILES): Add random/Makefile. + +2008-04-25 Werner Koch + + Release 1.4.1. + + * configure.ac: Bump LT version to C15/A4/R4. + +2008-04-22 Werner Koch + + * configure.ac: Set version to 1.4.1rc1. + +2008-04-18 Werner Koch + + * configure.ac (AH_BOTTOM): Add CAMELLIA_EXT_SYM_PREFIX. + (NAME_OF_DEV_RANDOM): Remove special cases for Solaris etc. This + matches the gnupg 1.4.9 version. + +2008-04-01 Werner Koch + + * configure.ac (AC_INIT): Fix quoting. + +2008-03-19 Werner Koch + + * configure.ac: Fix the tests for USE_ to either define or + undef the macros. Suggested by Dirk Stoecker. + +2008-03-18 Werner Koch + + * configure.ac: Test for uintptr_t. + +2008-02-18 Werner Koch + + * configure.ac (IS_DEVELOPMENT_VERSION): Set depending on the my_svn. + +2007-12-11 Werner Koch + + * configure.ac: We actually require libgpg-error 1.4. Reported by + Tim Mooney. + +2007-12-10 Werner Koch + + Released 1.4.0. + + * configure.ac: Set LT to C15/A4/R3. + +2007-12-05 Werner Koch + + * configure.ac: Add option --disable-padlock-support. + +2007-12-03 Werner Koch + + Released 1.3.2. + + * configure.ac: Set LT to C15/A4/R2. + + * config.sub, config.guess: Update to version 2007-11-19. + +2007-10-30 Werner Koch + + * configure.ac: Protect config.h against double inclusion. + +2007-10-26 Werner Koch + + Released 1.3.1. + + * configure.ac: Set LT to C15/A4/R1. + +2007-08-22 Werner Koch + + * README: Rewrite the license description. + * configure.ac (USE_RNDW32, USE_RNDUNIX): Unmark as GPL modules. + +2007-08-08 Werner Koch + + * configure.ac: Use $host and not $target. + +2007-07-26 Werner Koch + + * acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): Fix a syntax error + in the test program which lurked there for 4 years. Adjusted name + of libtools global_system_pipe variable and add extra cut stage. + Reported by Gregor Riepl. + +2007-06-15 Werner Koch + + * autogen.sh (FORCE): Use =3D and not =3D=3D in test to be POSIXly correc= t. + +2007-05-30 Werner Koch + + * configure.ac: Camellia is no longer GPL. + +2007-05-24 Werner Koch + + * configure.ac: Try to use -Wpointer-arith. + +2007-05-19 Marcus Brinkmann + + * configure.ac: Fix test for optional UDIV and UDIV_QRNND MPI + modules. + +2007-05-09 Marcus Brinkmann + + * configure.ac (ac_cv_mpi_config_done): Unused variable removed. + (ac_cv_mpi_mod_list, MPI_MOD_LIST_LO, MPI_MOD_LIST_O): Removed. + (MPI_MOD_ASM_MPIH_ADD1, MPI_MOD_ASM_MPIH_SUB1, + MPI_MOD_ASM_MPIH_MUL1, MPI_MOD_ASM_MPIH_MUL2, + MPI_MOD_ASM_MPIH_MUL3, MPI_MOD_ASM_MPIH_LSHIFT, + MPI_MOD_ASM_MPIH_RSHIFT, MPI_MOD_ASM_MPIH_UDIV, + MPI_MOD_ASM_MPIH_UDIV_QRNND, MPI_MOD_C_MPIH_ADD1, + MPI_MOD_C_MPIH_SUB1, MPI_MOD_C_MPIH_MUL1, MPI_MOD_C_MPIH_MUL2, + MPI_MOD_C_MPIH_MUL3, MPI_MOD_C_MPIH_LSHIFT, MPI_MOD_C_MPIH_RSHIFT, + MPI_MOD_C_MPIH_UDIV, MPI_MOD_C_MPIH_UDIV_QRNND): New automake + variables. + +2007-05-04 Werner Koch + + Released 1.3.0. + + * configure.ac: Set LT to C15/A4/R0. + + * configure.ac: Require automake 1.10 + (AM_PROG_CC_C_O): New. + +2007-05-03 Werner Koch + + * configure.ac: Fix detection of GPLed random modules. + +2007-05-02 Werner Koch + + * configure.ac (LIBGCRYPT_DIGESTS, LIBGCRYPT_CIPHERS) + (LIBGCRYPT_PUBKEY_CIPHERS): Ac_define lists of algorithms. + (default_ciphers): Don't make camellia a default. + +2007-05-02 David Shaw + + * NEWS, configure.ac: Add Camellia. + +2007-04-30 Werner Koch + + * README.apichanges: Move to doc/. + * Makefile.am (EXTRA_DIST): Removed that file. + +2007-04-28 Marcus Brinkmann + + * configure.ac: Allow to specify additional search directories + with --enable-mpi-path. + +2007-04-16 Werner Koch + + * configure.ac: Check for sysconf. + * acinclude.m4 (GNUPG_CHECK_MLOCK): Try to use sysconf to get the + page size and use getpagesize only then if available. + +2007-03-22 Werner Koch + + * configure.ac: Add support for ECC. + +2007-02-22 Werner Koch + + * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Use + --enable-random-daemon. + + * configure.ac: New option --enable-random-daemon. + Create versioninfo.rc and provide the build information. + +2007-02-21 Werner Koch + + * Makefile.am, configure.ac: Ignore w32-dll/. + +2007-02-20 Werner Koch + + * configure.ac: Bump LT version to C14/A3/R0 in preparation for a + release. + + * autogen.sh: Add option --force. + * configure.ac: New option --disable-endian-check. Use a real + noexecstack test instead of requiring an option. Add SVN version + magic. + +2007-02-02 Werner Koch + + * configure.ac (FALLBACK_SOCKLEN_T): Special case for mingw32. + +2006-11-15 Werner Koch + + * autogen.sh: Add convenience option --build-amd64. + +2006-10-20 Werner Koch + + * Makefile.am (stowinstall): New convenience target. + +2006-10-12 Marcus Brinkmann + + * configure.ac (FALLBACK_SOCKLEN_T): Third time is a charm. + Define gcry_socklen_t, to avoid conflicts with socklen_t + definitions by autoconf. + +2006-10-11 Marcus Brinkmann + + * configure.ac (FALLBACK_SOCKLEN_T): Rewrite in terms of + socklen.m4. + +2006-10-11 Marcus Brinkmann + + * acinclude.m4 (GNUPG_FIX_HDR_VERSION): Removed. + * configure.ac: Do not call GNUPG_FIX_HDR_VERSION. + +2006-10-10 Marcus Brinkmann + + * configure.ac: Invoke AC_CHECK_SOCKLEN_TYPE. + (AC_CONFIG_FILES): Add src/gcrypt.h. + (AC_CONFIG_SRCDIR): Change to src/libgcrypt.vers. + +2006-10-02 Werner Koch + + * acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): Test on HOST and not + TARGET. Hardwire for mingw32. Allow setting via command line when + cross compiling. + +2006-08-29 Werner Koch + + * configure.ac (USE_SEED): New. + +2006-07-26 Werner Koch + + * configure.ac: New options --enable-noexecstack and + --disable-optimization. + +2006-07-04 Marcus Brinkmann + + * configure.ac: Call AC_LIBTOO_WIN32_DLL and AC_LIBTOOL_RC. + + * configure.ac: Call gl_TYPE_SOCKLEN_T instead of the other + socklen_t checks. + +2006-06-08 Marcus Brinkmann + + * configure.ac (PTH_LIBS): Add --all to pth-config invocation. + +2006-03-14 Werner Koch + + * configure.ac: Check for fctnl and ftruncate. + (HAVE_PTH): Check for GNU Pth. + (HAVE_W32_SYSTEM): Define it. + * acinclude.m4 (GNUPG_PTH_VERSION_CHECK): New. Taken from GnuPG 1.4. + +2005-12-08 Werner Koch + + * configure.ac: Changed the random device names for netbsd. From + Christian Biere. + +2005-11-02 Moritz Schulte + + * NEWS: Documented minor API changes. + +2005-09-15 Moritz Schulte + + * Makefile.am (EXTRA_DIST): Depend on README.SVN, not on README.CVS. + +2005-06-25 Moritz Schulte + + * configure.ac: Removed src/libgcrypt.pc from AC_CONFIG_FILES. + +2005-06-10 Werner Koch + + * configure.ac: Move detection of basic stuff to the top. For + example we need to know whether gcc is used before testing for it. + Reported by Ralf Fassel. + +2005-04-23 Moritz Schulte + + * acinclude.m4 (TYPE_SOCKLEN_T): New type definition test; + provided by Albert Chin. + * configure.ac: Don't use $(CMD) as it's not portable; use CMD in + backticks instead. Simpler -lnsl/-lsocket test. Use + TYPE_SOCKLEN_T test. Don't forget to set `random_modules' + correctly. + +2005-04-22 Moritz Schulte + + * configure.ac: Added support for pkgconfig; provided by Albert + Chin. + +2005-04-11 Moritz Schulte + + * configure.ac: Integrate Whirlpool. + +2005-01-04 Werner Koch + + Updated to automake 1.9. + + * acinclude.m4: Updated for use with automake 1.9. + + * configure.ac: Require libgpg-error 1.0; not really needed but + that is the first stable version. + + * Makefile.am (ACLOCAL_AMFLAGS): New for -I m4. + (AUTOMAKE_OPTIONS): New to create a bzip archive. + +2005-02-03 Moritz Schulte + + * THANKS: Updated. + +2004-08-09 Moritz Schulte + + * THANKS: Updated. + +2004-07-04 Moritz Schulte + + * THANKS: Updated. + +2004-04-21 Werner Koch + + * configure.ac: Don't print a warning if GNU make was not found. + +2004-05-07 Moritz Schulte + + * THANKS: Updated. + +2004-04-02 Thomas Schwinge + + * autogen.sh: Added ACLOCAL_FLAGS. + +2004-04-15 Werner Koch + + Released 1.2.0. + + * configure.ac: Set LT to C12/A1/R1. + +2004-04-06 Werner Koch + + * config.guess, config.sub, ltmain.sh: Updated to those from + libtools 1.5.4. + +2004-03-29 Werner Koch + + Released 1.1.94. + + * configure.ac: Set LT to C12/A1/R0. + +2004-03-10 Marcus Brinkmann + + * configure.ac (LIBGCRYPT_CONFIG_LIBS_PTHREAD, + LIBGCRYPT_CONFIG_CFLAGS_PTHREAD, LIBGCRYPT_CONFIG_LIBS_PTH, + LIBGCRYPT_CONFIG_CFLAGS_PTH, have_pth, have_pthread, AC_CHECK_PTH, + AC_CHECK_LIB(pthread), HAVE_PTH, HAVE_PTHREAD): Removed. + +2004-03-06 Werner Koch + + Released 1.1.93. + + * configure.ac (LIBGCRYPT_CONFIG_SONAME_NUMBER): Replaced by + LIBGCRYPT_CONPIG_API_VERSION. Set it to 1. Set LT to C11/A0/R1. + +2004-03-05 Werner Koch + + * configure.ac (LIBGCRYPT_CONFIG_SONAME_NUMBER): New. + +2004-02-20 Werner Koch + + Released 1.1.92. + + * configure.ac: Set LT to C11/A0/R0. + +2004-02-11 Werner Koch + + * autogen.sh (check_version): Removed bashism and simplified. + +2004-02-06 Werner Koch + + * configure.ac: Add rfc2268 cipher algorithm. + +2004-01-25 Moritz Schulte + + * THANKS: Updated. + +2003-12-19 Werner Koch + + Released 1.1.91. + + * configure.ac: Bumbed LT version to C10/A3/R1. + +2003-12-08 Werner Koch + + * Makefile.am (dist-hook): Don't distribute stuff from the now + obsolete scripts dir. + (EXTRA_DIST): Remove README_alpha + * README-alpha: Removed. + * configure.ac (AM_CONFIG_AUX_DIR): Removed. + + * COPYING.DOC: Removed. + * Makefile.am (EXTRA_DIST): Added README.CVS and + autogen.sh. Removed COPYING.DOC. + +2003-11-14 Werner Koch + + Released 1.1.90. + + * configure.ac: Bumbed LT version to C10/A3/R0. + + * configure.ac (have_ld_version_script): Set the default in + a separate test. + (PRINTABLE_OS_NAME): Don't handle the Hurd extra, this leads to + conflicts with BSD based GNU systems. The Hurd has now a working + uname. + +2003-11-04 Werner Koch + + * configure.ac (USE_SHA1): Make sure it is always included. + (USE_RMD160): Removed this AM conditional. + +2003-10-31 Werner Koch + + * configure.ac: Bumbed version number to 1.1.90-cvs for futher + development + + Released 1.1.44. + + * acinclude.m4 (AC_CHECK_PTH): Added. + * configure.ac: Use it here instead of the generic lib test. + Bumbed LT vesion to C9/A2/R0. + +2003-10-27 Werner Koch + + * configure.ac: Give a hint on where libgpg-error is available. + Reformatted long lines. Don't include gcrypt-defs.h. + (--enable-gcc-warnings): New option. + +2003-10-24 Moritz Schulte + + * configure.ac: Check for socklen_t. + +2003-10-11 Moritz Schulte + + * acinclude.m4: Update AM_PATH_GPG_ERROR macro. + +2003-09-04 Werner Koch + + Released 1.1.43. + + * configure.ac: Require libgpg-error 0.4 due to the prime interface. + +2003-08-29 Werner Koch + + * acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): Re-implemented. + * configure.ac: Use it here. + +2003-08-27 Moritz Schulte + + * configure.ac: Substitute: LIBGCRYPT_CONFIG_LIBS_PTHREAD, + LIBGCRYPT_CONFIG_CFLAGS_PTHREAD, LIBGCRYPT_CONFIG_LIBS_PTH, + LIBGCRYPT_CONFIG_CFLAGS_PTH, LIBGCRYPT_THREAD_MODULES. + +2003-08-07 Moritz Schulte + + * configure.ac: Fail, if libgpg-error could not be found. + +2003-07-31 Werner Koch + + Released 1.1.42. + + * configure.ac: Set LT version to 7/0/0. + +2003-07-30 Werner Koch + + * AUTHORS (Maintainer): Assigned Moritz as Maintainer. + +2003-07-30 Moritz Schulte + + * NEWS: Include much more complete list of `Interface changes + relative to the 1.1.12 release'. + +2003-07-14 Moritz Schulte + + * configure.ac: Bumbed version number up to 1.1.42-cvs. + +2003-07-09 Moritz Schulte + + * configure.ac: Reintroduce --disable-asm, since it is needed by + mpi/config.links. + +2003-07-05 Moritz Schulte + + * README: Few changes, mention libgpg-error. + +2003-06-18 Moritz Schulte + + * configure.ac (available_ciphers): Removed Serpent, hrrm. + +2003-06-17 Moritz Schulte + + * acinclude.m4: Removed macro definitions: GNUPG_CHECK_FAQPROG, + GNUPG_CHECK_ENDIAN, GNUPG_CHECK_CACHE, GNUPG_CHECK_PIC, + GNUPG_CHECK_EXPORTDYNAMIC, GNUPG_CHECK_IPC, GNUPG_PROG_NM, + GNUPG_SYS_SYMBOL_UNDERSCORE, GNUPG_FUNC_MKDIR_TAKES_ONE_ARG, + GPH_PROG_DB2ANY. + Added macro definitions: AM_PATH_GPG_ERROR. + + * configure.ac: Use alternative approach for building based on + conditional sources, which does not make automake eat all your + memory, etc. + Removed unused tests. + Renamed --enable-static-rnd to --enable-random. + Use Autoconf's AC_C_BIGENDIAN macro instead of our own. + Re-organized the whole file. + +2003-06-16 Moritz Schulte + + * configure.ac (AC_CONFIG_FILES): Removed doc/version.sgml. + +2003-06-11 Moritz Schulte + + * configure.ac: Remove --enable-libgpg-error flag. + Ue AC_PATH_GPG_ERROR. + +2003-06-09 Moritz Schulte + + * NEWS: Mention API changes and libgpg-error. + +2003-05-25 Moritz Schulte + + * configure.ac (USE_LIBGPG_ERROR): Implementation of the + --enable-libgpg-error switch. + Define USE_LIBGPG_ERROR in LIBGCRYPT_CONFIG_FLAGS, in case + libgpg-error is used. + +2003-05-22 Moritz Schulte + + * configure.ac (AC_CHECK_HEADERS): Removed unused headers: + termio.h, langinfo.h. + (AC_CHECK_FUNCS): Removed unused functions: strsep, strlwr, + tcgetattr, setrlimit, strftime, nl_langinfo, sigaction, + sigprocmask, fopen64, fstat64. + +2003-04-27 Moritz Schulte + + * README: Documented new configure switches. + Mention the --enable-maintainer-switch. + + * configure.ac: Merged some code from GnuPG's configure.ac for + disabling sha512/tiger in case no 64 data types are available. + +2003-04-17 Moritz Schulte + + * configure.ac: Include support for sha512. + +2003-04-17 Moritz Schulte + + * AUTHORS: Updated. + +2003-04-16 Moritz Schulte + + * configure.ac: Implement command line switches: --enable-ciphers, + --enable-pubkey-ciphers and --enable-digests. + Set Automake conditionals and config.h symbols depending on the + selected ciphers, pubkey-ciphers, digests and random-modules. + + * acinclude.m4 (LIST_MEMBER): New macro. + + * configure.ac: Simplified, removed code for parsing + EXTRA_PROGRAMS from Makefile.am. + +2003-04-08 Moritz Schulte + + * configure.ac: Merged random-module selection code from GnuPG's + configure.ac. + +2003-04-07 Moritz Schulte + + * configure.ac: Removed code for generating contruct.c. + Remove digest modules from the static_modules list, only handle + random module selection. + + +2003-03-24 Moritz Schulte + + * NEWS: Mention new CBC_MAC flag. + + * AUTHORS (Maintainer): Update entry for Simon Josefsson. + +2003-03-04 Moritz Schulte + + * TODO: Remove item about resetting handles, since + gcry_cipher_reset is implemented by now. + + * NEWS: Mentioned gcry_cipher_reset. + +2003-01-21 Werner Koch + + * README (Configure options): New. + * configure.ac (have_ld_version_script): New option + --enable-ld-version-script. + +2003-01-20 Simon Josefsson + + * configure.ac (MODULES_IN_CIPHER): Add crc. + +2003-01-20 Werner Koch + + Released 1.1.12. + + * configure.ac (LIBGCRYPT_LT_REVISION): Bumbed up. + +2002-12-21 Werner Koch + + Released 1.1.11. + + * configure.ac (LIBGCRYPT_LT_CURRENT: Bumbed to 6/5/0 due to a new + interface + +2002-12-19 Werner Koch + + * configure.ac (have_pthread): Check for pthreads in libc. + (have_ld_version_script): New. + +2002-11-10 Werner Koch + + * configure.ac (MODULES_IN_CIPHER): Add md4.c. By Simon Josefsson. + +2002-09-20 Werner Koch + + Released 1.1.10. + + * configure.ac (HAVE_DEV_RANDOM_IOCTL): Don't check for it; it is + not used. + (AS_CHECK_HEADERS): Check for sys/select.h. + * Makefile.am (DIST_SUBDIRS): New to include the w32-dll directory + +2002-09-18 Timo Schulz + + * configure.ac: Added makefile for the W32 DLL. + +2002-09-17 Werner Koch + + * configure.ac: Check for Pth and Pthreads. + +2002-08-23 Werner Koch + + Released 1.1.9. + + * configure.ac (LIBGCRYPT_CONFIG_CFLAGS): Renamed from + LIBGCRYPT_CFLAGS and removed the libpath because it is set by the + config script. + (LIBGCRYPT_LT_REVISION): Set LT version to 5/4/1. + +2002-06-25 Werner Koch + + Released 1.1.8. + + * configure.ac: Set LT version to 5/4/0. + +2002-05-21 Werner Koch + + Released 1.1.7. + + * configure.ac: Set LT version to 4/3/0. + +2002-05-17 Werner Koch + + * configure.ac: Removed all the dynamic loading stuff. + +2002-05-16 Werner Koch + + * configure.ac: Reordered the C_CHECK_FUNCS. + +2002-05-15 Werner Koch + + * configure.ac: Adjusted for new MPI module stuff. + +2002-05-14 Werner Koch + + Changed license to the LGPL. + +2002-05-02 Werner Koch + + * jnlib/: Removed. + * Makefile.am (SUBDIRS): Removed jnlib. + * configure.ac (jnlib/Makefile): Removed. + + * configure.ac: Define _REENTRANT. + +2002-02-18 Werner Koch + + * configure.ac (MPI_EXTRA_ASM_OBJS): Use .lo suffix. + (AC_CANONICAL_TARGET): Added. + +2002-02-07 Werner Koch + + Released 1.1.6. + +2002-01-24 Werner Koch + + * jnlib/: Replaced by a fresh copy from GnuPG (actually the NewPG + development branch). Adjusted Makefile.am and jnlib-config.h + accordingly. + +2001-12-18 Werner Koch + + Released 1.1.5. + + * Makefile.am (dist-hook): Only look in mpi and scripts for + distfiles; this way we don't include those of a stale "make dist" + directory. + + * acinclude.m4 (GNUPG_FIX_HDR_VERSION): Make it work with the new + automake. + * configure.ac: Don't chmod db2any. + +2001-08-06 Werner Koch + + * configure.ac: Removed cross compiling hacks. + +2001-08-03 Werner Koch + + Released 1.1.4. + + * acinclude.m4 (GNUPG_CHECK_TYPEDEF): Define GNU Source. + + Migrated to autoconf 2.52. + * acinclude.m4: Removed GNUPG_LINK_FILES and converted. + * acconfig.h: Removed + * configure.in: Replaced by... + * configure.ac: and modified for use with autoconf 2.52. Replaced + GNUPG_LINK_FILES with AC_CONFIG_LINKS and moved some informational + messages to the end. Removed --enable-m-debug + + * tests/: New. + * Makefile.am: Included tests directory + + * configure.in (DYNLINK_MOD_CFLAGS): Use -shared with dec-osf. + Reported by Chris Adams. Merged some cases. + +2001-05-31 Werner Koch + + Released 1.1.3. + + * configure.in: Use _gcry_ prefix when creating the cipher constructor. + + * acconfig.h (_GCRYPT_IN_LIBGCRYPT): Define it here. + +2001-05-28 Werner Koch + + * acinclude.m4 (GPH_PROG_DOCBOOK): Removed. + (GPH_PROG_DB2ANY): New. Taken from GPH. + * configure.in: Use it here. + +2000-12-19 Werner Koch + + Major change: + Removed all GnuPG stuff and renamed this piece of software + to gcrypt. The directory gcrypt has been renamed to src. + +2000-11-14 Werner Koch + + Version 1.1.2 released. + +2000-11-13 Werner Koch + + * acinclude.m4 (GNUPG_FIX_HDR_VERSION): VPATH build fix. + +2000-10-10 Werner Koch + + * Makefile.am (dist-hook): Create the version file. + * configure.in: Set the libtool version here, removed the need + for the version file. + +Mon Sep 18 16:35:45 CEST 2000 Werner Koch + + * acinclude.m4 (GNUPG_CHECK_MLOCK): Removed that silly mkdir(). + + * configure.in: Changes to allow for Solaris random device. + By Nils Ellmenreich. + (--with-egd-socket): New. + + * configure.in (GNUPG_HOMEDIR): New. + + * configure.in: Check for fstat64 and fopen64 + + * acinclude.m4 (GNUPG_CHECK_FAQPROG): New. + * configure.in: Test for this. + + * configure.in (DYNLINK_MOD_CFLAGS): Fix by David Champion. + +Tue Aug 22 14:31:15 CEST 2000 Werner Koch + + Version 1.1.1 + +Fri Aug 18 14:27:14 CEST 2000 Werner Koch + + * agent/: New. + * Makefile.am, configure.in: Support for the new directory. + +Mon Jul 17 16:35:47 CEST 2000 Werner Koch + + * configure.in (mingw32): Changes to allow for mingw32msvc + +Fri Jul 14 19:38:23 CEST 2000 Werner Koch + + The big merge between this one and the stable branch 1.0. Still need + to merge TNANKS, AUTHORS and such. It probaly does not compile yet. + + * acinclude.m4 (GNUPG_CHECK_MLOCK): Fixed syntax error in C code. + + * configure.in: Add check for termio.h, wait unctiosn and sigaction. + + * acinclude.m4, configure.in (GNUPG_CHECK_GNUMAKE): New. + + * acinclude.m4 (MKDIR_TAKES_ONE_ARG): Check some headers. By Ga=EBl Qu= =E9ri. + + * configure.in (AM_INIT_AUTOMAKE): Use this now. By Ga=EBl. + + * acinclude.m4 (GNUPG_CHECK_EXPORTDYNAMIC): Replacement for + GNUPG_CHECK_RDYNAMIC which should handle gcc with non GNU ld nicer. + Contributed by Dave Dykstra. + * configure.in (GNYPG_CHECK_RDYNAMIC): Replaced by the new check. + + * configure.in: Add a test for unisgned long long. + + * configure.in (DYNLINK_MOD_CFLAGS): Set different for NetBSD. + + * configure.in: Add check for clock_gettime + + * configure.in (ALL_LINGUAS): Add nl. + * configure.in (ALL_LINGUAS): Add Esperanto. + * configure.in (ALL_LINGUAS): Add sv and ja. + + * configure.in: Use /usr/local for CFLAGS and LDFLAGS when + target is freebsd. By R=E9mi. + + * configure.in: Do not set development version when the version has + a dash in it. Suggested by Dave Dykstra. + + * configure.in: Removed substitution for doc/gph/Makefile. + Do all the gcc warning only in maintainer mode. + + * configure.in (dlopen): Use CHECK_FUNC for a test of dlopen in libc. + Suggested by Alexandre Oliva. + (-Wall): Moved the settting of gcc warning options near to the end + so that tests don't get confused. Suggested by Paul D. Smith. + + * acinclude.m4 (GNUPG_SYS_NM_PARSE): Added BSDI support. + (GNUPG_CHECK_RDYNAMIC): Ditto. + + * acinclude.m4 (GNUPG_CHECK_MLOCK): Changed the way to test for + librt. Test suggested by Jeff Long. + + * acinclude.m4 (GNUPG_CHECK_MLOCK): Do librt check only when + we can't link a test program. This way GNU systems don't need + to link against linrt. + (GNUPG_CHECK_IPC): Fixed use of TRY_COMPILE macro. From Tim Mooney. + + * acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): Add support for + DJGPP. + (GNUPG_CHECK_MLOCK): Check whether mlock sits in librt. + + * acinclude.m4 (GNUPG_CHECK_RDYNAMIC): Add NetBSD. By Thomas Klausner. + + * acconfig.h (HAVE_MLOCK): Added + +Mon Mar 13 19:22:46 CET 2000 Werner Koch + + * configure.in: Now uses the Docbook M4s from GPH. + +Mon Jan 31 17:46:35 CET 2000 Werner Koch + + * Makefile.am: Re-added tools. By R=E9mi. + +Mon Jan 31 16:37:34 CET 2000 Werner Koch + + * configure.in: Create a symlink for types.h in gcrypt/. + +Thu Jan 27 18:00:44 CET 2000 Werner Koch + + * configure.in (g10defs.h): Replaced by gnupg-defs.h + +Mon Jan 24 13:04:28 CET 2000 Werner Koch + + * jnlib/ : New. + + * configure.in: Do set development version when the version has + a dash in it. Suggested by Dave Dykstra. + +Thu Dec 9 17:22:27 CET 1999 Werner Koch + + * acinclude.m4 (GNUPG_FIX_HDR_VERSION): New. + * configure.in: Check and fix the version number of gcrypt/gcrypt.h + so that it is always the save as VERSION. + +Thu Oct 28 16:17:46 CEST 1999 Werner Koch + + * Started with development series 1.1 on 1999-10-26 + +Tue Oct 26 14:10:21 CEST 1999 Werner Koch + + * README-alpha: New + + * configure.in: Fixed quoting in test for development version. + + * THANKS: Add entries for Michael, Brenno and J Horacio who did + very nice Howto documents - I apoligize for forgetting to mention them + earlier. + +Fri Sep 17 12:56:42 CEST 1999 Werner Koch + + + * configure.in: Add "-lcap" when capabilities are requested. + Add the conditional CROSS_COMPILING. + * Makefile.am: Don't use checks when CROSS_COMPILING. + + +Wed Sep 15 16:22:17 CEST 1999 Werner Koch + + + * configure.in (ALL_LINGUAS): Add pt_PT. + + * configure.in: Some tweaks for cross compiling under MingW32 + * acconfig.h (USE_STATIC_RNDW32): New. + +Tue Sep 7 17:08:10 CEST 1999 Werner Koch + + + * VERSION: Set to 1.0.0. + +Mon Sep 6 19:59:08 CEST 1999 Werner Koch + + + * configure.in: Create makefile in doc/gph + + * acinclude.m4 (GNUPG_FUNC_MKDIR_TAKES_ONE_ARG): New + * configure.in: use the above. + +Thu Sep 2 16:40:55 CEST 1999 Werner Koch + + + * VERSION: Set to 0.9.11. + +Tue Aug 31 17:20:44 CEST 1999 Werner Koch + + * configure.in: Minor changes to the OS/2 and Mingw32 system labels. + Add a printable name for Hurd. + +Mon Aug 30 20:38:33 CEST 1999 Werner Koch + + * configure.in: Some support for DJGPP (Mark Elbrecht) + +Wed Aug 4 10:34:46 CEST 1999 Werner Koch + + * VERSION: Set to 0.9.10. + +Mon Jul 26 09:34:46 CEST 1999 Werner Koch + + * acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): remove init of ac_cv_... + + * Makefile.am (DISCLEANFILES): New + +Fri Jul 23 13:53:03 CEST 1999 Werner Koch + + * VERSION: Set to 0.9.9. + + * configure.in: Print a notice when rndunix is used. + +Thu Jul 15 10:15:35 CEST 1999 Werner Koch + + * acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): Fixed last modification. + +Wed Jul 7 13:08:40 CEST 1999 Werner Koch + + * Makefile.am: Support for libtool. + * configure.in: Ditto. + +Tue Jun 29 21:44:25 CEST 1999 Werner Koch + + * configure.in (use_local_zlib): The lost dollar is back. + + * acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): Add EMX case. + * configure.in: Another variant of the MX vendor string + + * configure.in (--with-capabilities): Some test code (Remi). + +Sat Jun 26 12:15:59 CEST 1999 Werner Koch + + * acinclude.m4 (GNUPG_CHECK_RDYNAMIC): Support for HPUX and IRIX. + * configure.in (HAVE_DL_SHL_LOAD): New for HPUX (Dave Dykstra). + + * VERSION: Now 0.9.8 + +Wed Jun 16 20:16:21 CEST 1999 Werner Koch + + * configure.in: Add test for docbook-to-man + +Tue Jun 15 12:21:08 CEST 1999 Werner Koch + + * acinclude.m4 (GNUPG_SYS_NM_PARSE): Support for {net,free}bsd, + +Thu Jun 10 14:18:23 CEST 1999 Werner Koch + + * configure.in (ZLIB,GDBM): Check both, header and lib. + +Sat Jun 5 15:30:33 CEST 1999 Werner Koch + + * pkclist.c (key_present_in_pk_list): New (Michael). + +Tue May 25 19:50:32 CEST 1999 Werner Koch + + * configure.in (IS_DEVELOPMENT_VERSION): Fixed detection. + +Sun May 23 14:20:22 CEST 1999 Werner Koch + + * acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): assume yes when + cross-compiling. + +Mon May 17 21:54:43 CEST 1999 Werner Koch + + * configure.in (socket): Fix for Unisys by Katsuhiro Kondou. + +Sat May 8 19:28:08 CEST 1999 Werner Koch + + * NEWS: Add a marker line which I forgot to do for 0.9.6. + +Thu May 6 14:18:17 CEST 1999 Werner Koch + + * README: Minor updates + + * VERSION: Now 0.9.6 + +Thu Apr 8 09:35:53 CEST 1999 Werner Koch + + * acinclude.m4 (GNUPG_CHECK_RDYNAMIC): Fix for + amiga-openbsd (Peter Reich) + (GNUPG_PROG_NM): Ditto + +Wed Apr 7 20:51:39 CEST 1999 Werner Koch + + * Makefile.am (g10defs.h): Removed. + * configure.in (AC_OUTPUT_COMMANDS): Create g10defs.h + +Sat Mar 20 12:55:33 CET 1999 Werner Koch + + * VERSION: Now 0.9.5 + +Sun Mar 14 19:34:36 CET 1999 Werner Koch + + * acinclude.m4 (AM_SYS_SYMBOL_UNDERSCORE): Removed because it is + now in the latest libtool. + +Thu Mar 11 16:39:46 CET 1999 Werner Koch + + * configure.in: Removed the need for libtool + +Mon Mar 8 20:47:17 CET 1999 Werner Koch + + * configure.in (DLSYM_NEEDS_UNDERSCORE): Replaced. + * acinclude.in (AM_SYS_SYMBOL_UNDERSCORE): New. + + * VERSION: Now 0.9.4 + +Sun Feb 28 19:11:00 CET 1999 Werner Koch + + * configure.in (dld): Test disabled. + +Fri Feb 26 17:55:41 CET 1999 Werner Koch + + * encode.c (encode_simple): temporary fix. + +Wed Feb 24 11:07:27 CET 1999 Werner Koch + + * configure.in: New option --enable-static-rnd. + +Mon Feb 22 20:04:00 CET 1999 Werner Koch + + * BUGS: Now we assign bug numbers. + * OBUGS: New to keep rack o fixed bugs (CVS only) + +Fri Feb 19 18:01:54 CET 1999 Werner Koch + + * VERSION: Released 0.9.3 + +Fri Feb 19 15:49:15 CET 1999 Werner Koch + + * acinclude.m4: Removed gettext macros. + +Tue Feb 16 14:10:02 CET 1999 Werner Koch + + * configure.in (socket): Check for -lsocket and -lnsl. + (osf4): Disable all warnings for DEC's cc. + (-Wall): Add more warning options for gcc + +Sat Feb 13 12:04:43 CET 1999 Werner Koch + + * configure.in: Changed detection of compiler flags. + * intl/ : Removed directory + +Wed Feb 10 17:15:39 CET 1999 Werner Koch + + * acinclude.m4 (GNUPG_CHECK_RDYNAMIC): Fix for freebsd 2.2 + + * configure.in: a lot of changes to allow selection of modules. + Add support for OS/2. + + * acinclude.m4: add some more caching + + * README: Spelling and grammar corrections (John A. Martin) + * INSTALL: Ditto. + +Wed Jan 20 21:40:21 CET 1999 Werner Koch + + * configure.in: --enable-m-guard is now default + +Wed Jan 13 12:49:36 CET 1999 Werner Koch + + * INSTALL: Applied new information how to build rpms by Fabio Coatti + * Makefile.in (gnupg.spec): Changed the names. + +Tue Jan 12 11:17:18 CET 1999 Werner Koch + + * config.links (m68k-atari-mint): New + +Tue Jan 12 09:17:19 CET 1999 Ga=EBl Qu=E9ri + + * all: Fixed typos all over the place + +Sat Jan 9 16:02:23 CET 1999 Werner Koch + + * configure.in: Add a way to statically link rndunix + +Sun Jan 3 15:28:44 CET 1999 Werner Koch + + * acinclude.m4 (GNUPG_CHECK_RDYNAMIC): New. + * configure.in (DYNLOAD_CFLAGS): Use result from CHECK_RDYNAMIC + +Wed Dec 23 13:18:14 CET 1998 Werner Koch + + * README: Replaced the command overview with a short intro. + +Sat Dec 12 18:40:32 CET 1998 Werner Koch + + * configure.in: Add check for dlopen in libc (Greg Troxel) + and a new define + * acconfig.h (DLSYM_NEEDS_UNDERSCORE): New. + +Thu Dec 10 20:15:36 CET 1998 Werner Koch + + * acinclude.m (GNUPG_CHECK_PIC): New + * configure.in, acinclude.m4: Renamed all WK_ to GNUPG_ + +Tue Dec 8 15:09:29 CET 1998 Werner Koch + + * VERSION: Set to 0.4.5 + +Wed Nov 25 12:38:29 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in (USE_RNDLINUX): New. + +Fri Nov 20 19:34:57 1998 Werner Koch (wk@isil.d.shuttle.de) + + * VERSION: Released 0.4.4 + + * configure.in (try_asm_modules): For option --disable-asm + +Tue Nov 10 19:32:40 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in (MPI_SFLAGS): New. + +Tue Nov 10 13:44:53 1998 Werner Koch (wk@isil.d.shuttle.de) + + * ABOUT-NLS: New + * configure.in (AC_REVISION): New. + +Sun Nov 8 18:20:35 1998 Werner Koch (wk@isil.d.shuttle.de) + + * VERSION: Set to 0.4.3 + +Sun Oct 25 19:49:37 1998 Werner Koch (wk@isil.d.shuttle.de) + + * Makefile.am (g10defs.h): New macro GNUPG_DATADIR. + +Wed Oct 21 17:24:24 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in: Removed gettext kludge + * acinclude.m4: Add patched AM_WITH_NKS macro + +Tue Oct 20 19:03:36 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in: Kludge to make AM_GNU_GETTEXT work, + changed some macors to more modern versions. Also + changeg the all makefiles to remove duplicate ../intl. + * acinclude.m4: Removed the gettext stuff, as this + already comes with automake now. + +Wed Oct 14 12:11:34 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in (NAME_OF_DEV_RANDOM): New. + (DYNLINK_MOD_CFLAGS): New. + +Thu Oct 8 10:55:15 1998 Werner Koch (wk@isil.d.shuttle.de) + + * Makefile.am (g10defs.h): creates include file + * acconfig.h: now includes g10defs.h + * configure.in: Removed G10_LOCALEDIR and GNUPG_LIB + +Thu Sep 17 18:49:40 1998 Werner Koch (wk@(none)) + + * Makefile.am (dist-hook): Now creates RPM file. + * scripts/gnupg.spec: New template file for RPMs + +Thu Jul 30 19:17:07 1998 Werner Koch (wk@(none)) + + * acinclude.h (WK_CHECK_IPC): New + * configure.in : Add checks for SysV IPC + +Thu Jun 25 11:18:49 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in (--disable-dynload): New. + +Wed Jun 10 07:48:59 1998 Werner Koch,mobil,,, (wk@tobold) + + * configure.in (GNUPG_LIBDIR): New. + +Mon May 25 19:10:59 1998 Werner Koch (wk@isil.d.shuttle.de) + + * rand-unix.c (fast_random_poll): fixed syntax bug. + +Mon May 11 10:21:31 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in (PRINTABLE_OS_NAME): Linux is now GNU/Linux + +Tue Apr 14 19:08:05 1998 Werner Koch (wk@isil.d.shuttle.de) + + * [all files]: Applied Matthew Skala's typo and grammar fixes. + +Wed Mar 4 10:32:40 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in (getrusage,gettimeofday): New tests. + +Fri Feb 27 13:14:17 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in (--disable-m-guard): New. + +Thu Feb 26 17:09:27 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in, acinclude.m4, intl/, po/: New macros taken + from GNOME, switched to automake 1.2f + +Thu Feb 26 09:05:46 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in (doc/Makefile): New + +Thu Feb 26 07:40:47 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in: Changed gettext stuff + +Wed Feb 25 11:44:10 1998 Werner Koch (wk@isil.d.shuttle.de) + + * checks/*test : restructured the directory. + +Tue Feb 24 15:59:12 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in: Changed the name of the package to GNUPG and + chnaged several other names too. + +Wed Feb 18 17:36:45 1998 Werner Koch (wk@isil.d.shuttle.de) + + * Makefile.am (checks): New. + +Sat Feb 14 15:37:55 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in (mpi_config_done): Removed asm links caching. + +Sat Feb 14 14:02:20 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in (PRINTABLE_OS_NAME): New. + * acconfig.h: Likewise. + +Fri Feb 13 19:43:41 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in : Fixed zlib stuff + * Makefile.am: Likewise + + + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, + 2007, 2008, 2009, 2011 Free Software Foundation, Inc. + + This file is free software; as a special exception the author gives + unlimited permission to copy and/or distribute it, with or without + modifications, as long as this notice is preserved. + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY, to the extent permitted by law; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + +Local Variables: +buffer-read-only: t +End: diff --git a/grub-core/lib/libgcrypt/INSTALL b/grub-core/lib/libgcrypt/INST= ALL new file mode 100644 index 000000000..5458714e1 --- /dev/null +++ b/grub-core/lib/libgcrypt/INSTALL @@ -0,0 +1,234 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006 Free Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=3Dconfig.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=3Dc99 CFLAGS=3D-g LIBS=3D-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + +Installation Names +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=3DPREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=3DPREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=3DDIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=3DPREFIX' or `--program-suffix=3DSUFFIX'. + +Optional Features +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=3DDIR' and +`--x-libraries=3DDIR' to specify their locations. + +Specifying the System Type +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=3DTYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=3DTYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=3DTYPE'. + +Sharing Defaults +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=3Dvalue'. For example: + + ./configure CC=3D/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=3D/bin/bash /bin/bash ./configure CONFIG_SHELL=3D/bin/ba= sh + +`configure' Invocation +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=3DFILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=3Dconfig.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=3DDIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/grub-core/lib/libgcrypt/LICENSES b/grub-core/lib/libgcrypt/LIC= ENSES new file mode 100644 index 000000000..8be7fb244 --- /dev/null +++ b/grub-core/lib/libgcrypt/LICENSES @@ -0,0 +1,287 @@ +Additional license notices for Libgcrypt. -*- org -*- + +This file contains the copying permission notices for various files in +the Libgcrypt distribution which are not covered by the GNU Lesser +General Public License (LGPL) or the GNU General Public License (GPL). + +These notices all require that a copy of the notice be included +in the accompanying documentation and be distributed with binary +distributions of the code, so be sure to include this file along +with any binary distributions derived from the GNU C Library. + +* BSD_3Clause + + For files: + - cipher/sha256-avx-amd64.S + - cipher/sha256-avx2-bmi2-amd64.S + - cipher/sha256-ssse3-amd64.S + - cipher/sha512-avx-amd64.S + - cipher/sha512-avx2-bmi2-amd64.S + - cipher/sha512-ssse3-amd64.S + - cipher/sha512-ssse3-i386.c + +#+begin_quote + Copyright (c) 2012, Intel Corporation + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. + + * Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + + THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#+end_quote + + For files: + - random/jitterentropy-base.c + - random/jitterentropy-gcd.c + - random/jitterentropy-gcd.h + - random/jitterentropy-health.c + - random/jitterentropy-health.h + - random/jitterentropy-noise.c + - random/jitterentropy-noise.h + - random/jitterentropy-sha3.c + - random/jitterentropy-sha3.h + - random/jitterentropy-timer.c + - random/jitterentropy-timer.h + - random/jitterentropy.h + - random/rndjent.c (plus common Libgcrypt copyright holders) + +#+begin_quote + Copyright (C) 2017 - 2021, Stephan Mueller + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, and the entire permission notice in its entirety, + including the disclaimer of warranties. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + ALTERNATIVELY, this product may be distributed under the terms of + the GNU General Public License, in which case the provisions of the GPL2 + are required INSTEAD OF the above restrictions. (This clause is + necessary due to a potential bad interaction between the GPL and + the restrictions contained in a BSD-style copyright.) + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH + DAMAGE. +#+end_quote + + For files: + - cipher/cipher-gcm-ppc.c + +#+begin_quote + Copyright (c) 2006, CRYPTOGAMS by + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain copyright notices, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + * Neither the name of the CRYPTOGAMS nor the names of its + copyright holder and contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + + ALTERNATIVELY, provided that this notice is retained in full, this + product may be distributed under the terms of the GNU General Public + License (GPL), in which case the provisions of the GPL apply INSTEAD OF + those given above. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#+end_quote + +* X License + + For files: + - install.sh + +#+begin_quote + Copyright (C) 1994 X Consortium + + Permission is hereby granted, free of charge, to any person obtaining a = copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation t= he + rights to use, copy, modify, merge, publish, distribute, sublicense, and= /or + sell copies of the Software, and to permit persons to whom the Software = is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included = in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS = OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL= THE + X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHE= R IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON= NEC- + TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name of the X Consortium shall n= ot + be used in advertising or otherwise to promote the sale, use or other de= al- + ings in this Software without prior written authorization from the X Con= sor- + tium. +#+end_quote + +* Public domain + + For files: + - cipher/arcfour-amd64.S + +#+begin_quote + Author: Marc Bevand + Licence: I hereby disclaim the copyright on this code and place it + in the public domain. +#+end_quote + +* OCB license 1 + + For files: + - cipher/cipher-ocb.c + +#+begin_quote + OCB is covered by several patents but may be used freely by most + software. See http://web.cs.ucdavis.edu/~rogaway/ocb/license.htm . + In particular license 1 is suitable for Libgcrypt: See + http://web.cs.ucdavis.edu/~rogaway/ocb/license1.pdf for the full + license document; it basically says: + + License 1 =E2=80=94 License for Open-Source Software Implementations o= f OCB + (Jan 9, 2013) + + Under this license, you are authorized to make, use, and + distribute open-source software implementations of OCB. This + license terminates for you if you sue someone over their + open-source software implementation of OCB claiming that you have + a patent covering their implementation. + + + + License for Open Source Software Implementations of OCB + January 9, 2013 + + 1 Definitions + + 1.1 =E2=80=9CLicensor=E2=80=9D means Phillip Rogaway. + + 1.2 =E2=80=9CLicensed Patents=E2=80=9D means any patent that claims prior= ity to United + States Patent Application No. 09/918,615 entitled =E2=80=9CMethod and App= aratus + for Facilitating Efficient Authenticated Encryption,=E2=80=9D and any uti= lity, + divisional, provisional, continuation, continuations-in-part, reexaminati= on, + reissue, or foreign counterpart patents that may issue with respect to the + aforesaid patent application. This includes, but is not limited to, United + States Patent No. 7,046,802; United States Patent No. 7,200,227; United + States Patent No. 7,949,129; United States Patent No. 8,321,675 ; and any + patent that issues out of United States Patent Application No. 13/669,114. + + 1.3 =E2=80=9CUse=E2=80=9D means any practice of any invention claimed in = the Licensed Patents. + + 1.4 =E2=80=9CSoftware Implementation=E2=80=9D means any practice of any i= nvention + claimed in the Licensed Patents that takes the form of software executing= on + a user-programmable, general-purpose computer or that takes the form of a + computer-readable medium storing such software. Software Implementation d= oes + not include, for example, application-specific integrated circuits (ASICs= ), + field-programmable gate arrays (FPGAs), embedded systems, or IP cores. + + 1.5 =E2=80=9COpen Source Software=E2=80=9D means software whose source co= de is published + and made available for inspection and use by anyone because either (a) the + source code is subject to a license that permits recipients to copy, modi= fy, + and distribute the source code without payment of fees or royalties, or + (b) the source code is in the public domain, including code released for + public use through a CC0 waiver. All licenses certified by the Open Source + Initiative at opensource.org as of January 9, 2013 and all Creative Commo= ns + licenses identified on the creativecommons.org website as of January 9, + 2013, including the Public License Fallback of the CC0 waiver, satisfy th= ese + requirements for the purposes of this license. + + 1.6 =E2=80=9COpen Source Software Implementation=E2=80=9D means a Software + Implementation in which the software implicating the Licensed Patents is + Open Source Software. Open Source Software Implementation does not include + any Software Implementation in which the software implicating the Licensed + Patents is combined, so as to form a larger program, with software that is + not Open Source Software. + + 2 License Grant + + 2.1 License. Subject to your compliance with the term s of this license, + including the restriction set forth in Section 2.2, Licensor hereby + grants to you a perpetual, worldwide, non-exclusive, non-transferable, + non-sublicenseable, no-charge, royalty-free, irrevocable license to pract= ice + any invention claimed in the Licensed Patents in any Open Source Software + Implementation. + + 2.2 Restriction. If you or your affiliates institute patent litigation + (including, but not limited to, a cross-claim or counterclaim in a lawsui= t) + against any entity alleging that any Use authorized by this license + infringes another patent, then any rights granted to you under this licen= se + automatically terminate as of the date such litigation is filed. + + 3 Disclaimer + YOUR USE OF THE LICENSED PATENTS IS AT YOUR OWN RISK AND UNLESS REQUIRED + BY APPLICABLE LAW, LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY + KIND CONCERNING THE LICENSED PATENTS OR ANY PRODUCT EMBODYING ANY LICENSED + PATENT, EXPRESS OR IMPLIED, STATUT ORY OR OTHERWISE, INCLUDING, WITHOUT + LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR + PURPOSE, OR NONINFRINGEMENT. IN NO EVENT WILL LICENSOR BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, + ARISING FROM OR RELATED TO ANY USE OF THE LICENSED PATENTS, INCLUDING, + WITHOUT LIMITATION, DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, PUNITIVE + OR SPECIAL DAMAGES, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY = OF + SUCH DAMAGES PRIOR TO SUCH AN OCCURRENCE. +#+end_quote diff --git a/grub-core/lib/libgcrypt/Makefile.am b/grub-core/lib/libgcrypt/= Makefile.am new file mode 100644 index 000000000..87e8de6c3 --- /dev/null +++ b/grub-core/lib/libgcrypt/Makefile.am @@ -0,0 +1,160 @@ +## Process this file with automake to produce Makefile.in +# Copyright (C) 1992, 1999, 2000, 2002 Free Software Foundation, Inc. +# +# This file is part of Libgcrypt. +# +# Libgcrypt is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of +# the License, or (at your option) any later version. +# +# Libgcrypt is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, see . +# SPDX-License-Identifier: LGPL-2.1-or-later + +# Location of the released tarball archives. This is prefixed by +# the variable RELEASE_ARCHIVE in ~/.gnupg-autogen.rc. For example: +# RELEASE_ARCHIVE=3Dwk@somehost:archive/tarballs +RELEASE_ARCHIVE_SUFFIX =3D libgcrypt/v1.10 +# The variable RELEASE_SIGNING_KEY in ~/.gnupg-autogen.rc is used +# to specify the key for signing. For example: +# RELEASE_SIGNKEY=3DD8692123C4065DEA5E0F3AB5249B39D24F25E3B6 + + +ACLOCAL_AMFLAGS =3D -I m4 +AM_DISTCHECK_DVI_TARGET =3D pdf +DISTCHECK_CONFIGURE_FLAGS =3D --disable-random-daemon --enable-doc \ + --enable-random=3Dauto + +# (A suitable gitlog-to-changelog script can be found in GnuPG master.) +GITLOG_TO_CHANGELOG=3Dgitlog-to-changelog + +if BUILD_DOC +doc =3D doc +else +doc =3D +endif + + +DIST_SUBDIRS =3D m4 compat mpi cipher random src doc tests +SUBDIRS =3D compat mpi cipher random src $(doc) tests + +EXTRA_DIST =3D autogen.sh autogen.rc README.GIT LICENSES \ + ChangeLog-2011 build-aux/ChangeLog-2011 doc/ChangeLog-2011 \ + m4/ChangeLog-2011 cipher/ChangeLog-2011 src/ChangeLog-2011 \ + random/ChangeLog-2011 tests/ChangeLog-2011 mpi/ChangeLog-2011 \ + build-aux/libtool-patch.sed \ + build-aux/git-log-footer build-aux/git-log-fix VERSION + +DISTCLEANFILES =3D + + +# Add all the files listed in "distfiles" files to the distribution +dist-hook: gen-ChangeLog + @set -e; \ + for file in `cd $(top_srcdir); \ + find mpi -type f -name distfiles`; do \ + dir=3D`dirname $$file` ; $(mkinstalldirs) $(distdir)/$$dir ; \ + for i in distfiles `cat $(top_srcdir)/$$file` ; do \ + ln $(top_srcdir)/$$dir/$$i $(distdir)/$$dir/$$i 2> /dev/null \ + || cp -p $(top_srcdir)/$$dir/$$i $(distdir)/$$dir/$$i; \ + done ; \ + done + +distcheck-hook: + set -e; ( \ + pref=3D"#+macro: $$(echo $(PACKAGE_NAME)|tr '-' '_')_" ;\ + reldate=3D"$$(date -u +%Y-%m-%d)" ;\ + echo "$${pref}ver $(PACKAGE_VERSION)" ;\ + echo "$${pref}date $${reldate}" ;\ + list=3D'$(DIST_ARCHIVES)'; for i in $$list; do \ + case "$$i" in *.tar.bz2) \ + echo "$${pref}size $$(wc -c <$$i|awk '{print int($$1/1024)}')k= " ;\ + echo "$${pref}sha1 $$(sha1sum <$$i|cut -d' ' -f1)" ;\ + echo "$${pref}sha2 $$(sha256sum <$$i|cut -d' ' -f1)" ;;\ + esac;\ + done ) | tee $(distdir).swdb + + + +gen_start_date =3D 2011-12-01T14:00:00 +.PHONY: gen-ChangeLog +gen-ChangeLog: + if test -e $(top_srcdir)/.git; then \ + (cd $(top_srcdir) && \ + $(GITLOG_TO_CHANGELOG) --append-dot --tear-off \ + --amend=3Dbuild-aux/git-log-fix \ + --since=3D$(gen_start_date) ) > $(distdir)/cl-t; \ + cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;\ + rm -f $(distdir)/ChangeLog; \ + mv $(distdir)/cl-t $(distdir)/ChangeLog; \ + fi + + + +stowinstall: + $(MAKE) $(AM_MAKEFLAGS) install prefix=3D/usr/local/stow/libgcrypt + +# Macro to help the release target. +RELEASE_NAME =3D $(PACKAGE_TARNAME)-$(PACKAGE_VERSION) + +release: + +(set -e;\ + if [ "$(abs_top_builddir)" =3D "$(abs_top_srcdir)" ]; then \ + echo "error: build directory must not be the source directory" = >&2;\ + exit 2;\ + fi ;\ + echo "/* Build started at $$(date -uIseconds) */" ;\ + cd $(top_srcdir); \ + ./autogen.sh --force; \ + cd $(abs_top_builddir); \ + rm -rf dist; mkdir dist ; cd dist ; \ + $(abs_top_srcdir)/configure --enable-maintainer-mode; \ + $(MAKE) distcheck; \ + echo "/* Build finished at $$(date -uIseconds) */" ;\ + echo "/*" ;\ + echo " * Please run the final step interactivly:" ;\ + echo " * make sign-release" ;\ + echo " */" ;\ + ) 2>&1 | tee "$(RELEASE_NAME).buildlog" + +sign-release: + +(set -e; \ + test $$(pwd | sed 's,.*/,,') =3D dist || cd dist; \ + x=3D$$(grep '^RELEASE_ARCHIVE=3D' $$HOME/.gnupg-autogen.rc|cut -d=3D -f= 2);\ + if [ -z "$$x" ]; then \ + echo "error: RELEASE_ARCHIVE missing in ~/.gnupg-autogen.rc">= &2; \ + exit 2;\ + fi;\ + myarchive=3D"$$x/$(RELEASE_ARCHIVE_SUFFIX)";\ + x=3D$$(grep '^RELEASE_SIGNKEY=3D' $$HOME/.gnupg-autogen.rc|cut -d=3D -f= 2);\ + if [ -z "$$x" ]; then \ + echo "error: RELEASE_SIGNKEY missing in ~/.gnupg-autogen.rc">= &2; \ + exit 2;\ + fi;\ + mysignkey=3D"$$x";\ + files1=3D"$(RELEASE_NAME).tar.bz2 \ + $(RELEASE_NAME).tar.gz" ; \ + files2=3D"$(RELEASE_NAME).tar.bz2.sig \ + $(RELEASE_NAME).tar.gz.sig \ + $(RELEASE_NAME).swdb \ + $(RELEASE_NAME).buildlog" ;\ + echo "/* Signing the source tarball ..." ;\ + gpg -sbu $$mysignkey $(RELEASE_NAME).tar.bz2 ;\ + gpg -sbu $$mysignkey $(RELEASE_NAME).tar.gz ;\ + cat $(RELEASE_NAME).swdb >swdb.snippet;\ + echo >>swdb.snippet ;\ + sha1sum $${files1} >>swdb.snippet ;\ + cat "../$(RELEASE_NAME).buildlog" swdb.snippet \ + | gzip >$(RELEASE_NAME).buildlog ;\ + echo "Copying to archive $$myarchive ..." ;\ + scp -p $${files1} $${files2} $${myarchive}/ || true;\ + echo '/*' ;\ + echo ' * All done; for checksums see dist/swdb.snippet' ;\ + echo ' */' ;\ + ) diff --git a/grub-core/lib/libgcrypt/NEWS b/grub-core/lib/libgcrypt/NEWS new file mode 100644 index 000000000..b767dc117 --- /dev/null +++ b/grub-core/lib/libgcrypt/NEWS @@ -0,0 +1,1688 @@ +Noteworthy changes in version 1.10.3 (2023-11-14) [C24/A4/R3] +------------------------------------------------- + + * Bug fixes: + + - Fix public key computation for other EdDSA curves. + [rC469919751d6e] + + - Remove out of core handler diagnostic in FIPS mode. [T6515] + + - Check that the digest size is not zero in gcry_pk_sign_md and + gcry_pk_verify_md. [T6539] + + - Make store an s-exp with \0 is considered to be binary. [T6747] + + - Various constant-time improvements. + + * Portability: + + - Use getrandom call only when supported by the platform. [T6442] + + - Change the default for --with-libtool-modification to never. + [T6619] + + + Release-info: https://dev.gnupg.org/T6817 + + +Noteworthy changes in version 1.10.2 (2023-04-06) [C24/A4/R2] +------------------------------------------------- + + * Bug fixes: + + - Fix Argon2 for the case output > 64. [rC13b5454d26] + + - Fix missing HWF_PPC_ARCH_3_10 in HW feature. [rCe073f0ed44] + + - Fix RSA key generation failure in forced FIPS mode. [T5919] + + - Fix gcry_pk_hash_verify for explicit hash. [T6066] + + - Fix a wrong result of gcry_mpi_invm. [T5970] + + - Allow building with --disable-asm for HPPA. [T5976] + + - Fix Jitter RNG for building native on Windows. [T5891] + + - Allow building with -Oz. [T6432] + + - Enable the fast path to ChaCha20 only when supported. [T6384] + + - Use size_t to avoid counter overflow in Keccak when directly + feeding more than 4GiB. [T6217] + + * Other: + + - Do not use secure memory for a DRBG instance. [T5933] + + - Do not allow PKCS#1.5 padding for encryption in FIPS mode. + [T5918] + + - Fix the behaviour for child process re-seeding in the DRBG. + [rC019a40c990] + + - Allow verification of small RSA signatures in FIPS mode. [T5975] + + - Allow the use of a shorter salt for KDFs in FIPS mode. [T6039] + + - Run digest+sign self tests for RSA and ECC in FIPS mode. + [rC06c9350165] + + - Add function-name based FIPS indicator function. + GCRYCTL_FIPS_SERVICE_INDICATOR_FUNCTION. This is not considered + an ABI changes because the new FIPS features were not yet + approved. [rC822ee57f07] + + - Improve PCT in FIPS mode. [rC285bf54b1a, rC4963c127ae, T6397] + + - Use getrandom (GRND_RANDOM) in FIPS mode. [rCcf10c74bd9] + + - Disable RSA-OAEP padding in FIPS mode. [rCe5bfda492a] + + - Check minimum allowed key size in PBKDF in FIPS mode. + [T6039,T6219] + + - Get maximum 32B of entropy at once in FIPS mode. [rCce0df08bba] + + - Prefer gpgrt-config when available. [T5034] + + - Mark AESWRAP as approved FIPS algorithm. [T5512] + + - Prevent usage of long salt for PSS in FIPS mode. [rCfdd2a8b332] + + - Prevent usage of X9.31 keygen in FIPS mode. [rC392e0ccd25] + + - Remove GCM mode from the allowed FIPS indicators. [rC1540698389] + + - Add explicit FIPS indicators for hash and MAC algorithms. [T6376] + + + Release-info: https://dev.gnupg.org/T5905 + + +Noteworthy changes in version 1.10.1 (2022-03-28) [C24/A4/R1] +------------------------------------------------- + + * Bug fixes: + + - Fix minor memory leaks in FIPS mode. + + - Build fixes for MUSL libc. [rCffaef0be61] + + * Other: + + - More portable integrity check in FIPS mode. [rC9fa4c8946a,T5835] + + - Add X9.62 OIDs to sha256 and sha512 modules. [rC52fd2305ba] + + Release-info: https://dev.gnupg.org/T5810 + + +Noteworthy changes in version 1.10.0 (2022-02-01) [C24/A4/R0] +------------------------------------------------- + + * New and extended interfaces: + + - New control codes to check for FIPS 140-3 approved algorithms. + + - New control code to switch into non-FIPS mode. + + - New cipher modes SIV and GCM-SIV as specified by RFC-5297. + + - Extended cipher mode AESWRAP with padding as specified by + RFC-5649. [T5752] + + - New set of KDF functions. + + - New KDF modes Argon2 and Balloon. + + - New functions for combining hashing and signing/verification. [T4894] + + * Performance: + + - Improved support for PowerPC architectures. + + - Improved ECC performance on zSeries/s390x by using accelerated + scalar multiplication. + + - Many more assembler performance improvements for several + architectures. + + * Bug fixes: + + - Fix Elgamal encryption for other implementations. + [R5328,CVE-2021-40528] + + - Fix alignment problem on macOS. [T5440] + + - Check the input length of the point in ECDH. [T5423] + + - Fix an abort in gcry_pk_get_param for "Curve25519". [T5490] + + * Other features: + + - The control code GCRYCTL_SET_ENFORCED_FIPS_FLAG is ignored + because it is useless with the FIPS 140-3 related changes. + + - Update of the jitter entropy RNG code. [T5523] + + - Simplification of the entropy gatherer when using the getentropy + system call. + + * Interface changes relative to the 1.10.0 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + GCRYCTL_SET_DECRYPTION_TAG NEW control code. + GCRYCTL_FIPS_SERVICE_INDICATOR_CIPHER NEW control code. + GCRYCTL_FIPS_SERVICE_INDICATOR_KDF NEW control code. + GCRYCTL_NO_FIPS_MODE =3D 83 NEW control code. + GCRY_CIPHER_MODE_SIV NEW mode. + GCRY_CIPHER_MODE_GCM_SIV NEW mode. + GCRY_CIPHER_EXTENDED NEW flag. + GCRY_SIV_BLOCK_LEN NEW macro. + gcry_cipher_set_decryption_tag NEW macro. + GCRY_KDF_ARGON2 NEW constant. + GCRY_KDF_BALLOON NEW constant. + GCRY_KDF_ARGON2D NEW constant. + GCRY_KDF_ARGON2I NEW constant. + GCRY_KDF_ARGON2ID NEW constant. + gcry_kdf_hd_t NEW type. + gcry_kdf_job_fn_t NEW type. + gcry_kdf_dispatch_job_fn_t NEW type. + gcry_kdf_wait_all_jobs_fn_t NEW type. + struct gcry_kdf_thread_ops NEW struct. + gcry_kdf_open NEW function. + gcry_kdf_compute NEW function. + gcry_kdf_final NEW function. + gcry_kdf_close NEW function. + gcry_pk_hash_sign NEW function. + gcry_pk_hash_verify NEW function. + gcry_pk_random_override_new NEW function. + + Release-info: https://dev.gnupg.org/T5691 + + Release dates of 1.9.x versions: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Version 1.9.4 (2021-08-22) + + +Noteworthy changes in version 1.9.3 (2021-04-19) [C23/A3/R3] +------------------------------------------------ + + * Bug fixes: + + - Fix build problems on i386 using gcc-4.7. + + - Fix checksum calculation in OCB decryption for AES on s390. + [#5356] + + - Fix a regression in gcry_mpi_ec_add related to certain usages of + curve 25519. [#5372] + + - Fix a symbol not found problem on Apple M1. [#5370] + + - Fix for Apple iOS getentropy peculiarity. [#5375] + + - Make keygrip computation work for compressed points. [#4961] + + * Performance: + + - Add x86_64 VAES/AVX2 accelerated implementation of Camellia. + [0e7e60241a] + + - Add x86_64 VAES/AVX2 accelerated implementation of AES. + [e72498a54f] + + - Add VPMSUMD acceleration for GCM mode on PPC. [#5040] + + * Internal changes. + + - Harden MPI conditional code against EM leakage. [#5330] + + - Harden Elgamal by introducing exponent blinding. [#5328] + + - Fix memory leaks in the error code paths of EdDSA. [#5385] + + Release-info: https://dev.gnupg.org/T5305 + + +Noteworthy changes in version 1.9.2 (2021-02-17) [C23/A3/R2] +------------------------------------------------ + + * Bug fixes: + + - Fix build problem for macOS in the random code. [#5268] + + - Fix building with --disable-asm on x86. [#5277] + + - Check public key for ECDSA verify operation. [#5282] + + - Make sure gcry_get_config (NULL) returns a nul-terminated string. + [8716e4b2ad] + + - Fix a memory leak in the ECDH code. [289543544e] + + - Fix a reading beyond end of input buffer in SHA2-avx2. + [24af2a55d8] + + * Other features: + + - New test driver to allow for standalone regression + tests. [b142da4c88] + + Release-info: https://dev.gnupg.org/T5276 + + +Noteworthy changes in version 1.9.1 (2021-01-29) [C23/A3/R1] +------------------------------------------------ + + * Bug fixes: + + - Fix exploitable bug in hash functions introduced with 1.9.0. + [#5275] + + - Return an error if a negative MPI is used with sexp scan + functions. [#4964] + + - Check for operational FIPS in the random and KDF functions. + [#5243] + + - Fix compile error on ARMv7 with NEON disabled. [#5251] + + - Fix self-test in KDF module. [#5254] + + - Improve assembler checks for better LTO support. [#5255] + + - Fix assember problem on macOS running on M1. [#5157] + + - Support older macOS without posix_spawn. [#5159] + + - Fix 32-bit cross build on x86. [#5257] + + - Fix non-NEON ARM assembly implementation for SHA512. [#5263] + + - Fix build problems with the cipher_bulk_ops_t typedef. [#5264] + + - Fix Ed25519 private key handling for preceding ZEROs. [#5267] + + - Fix overflow in modular inverse implementation. [#5269] + + - Fix register access for AVX/AVX2 implementations of Blake2. + [#5271]. + + * Performance: + + - Add optimized cipher and hash functions for s390x/zSeries. + + - Use hardware bit counting functions when available. + + * Internal changes: + + - The macOS getentropy syscall is used when available. [#5268] + + - Update DSA functions to match FIPS 186-3. [30ed9593f6] + + - New self-tests for CMACs and KDFs. [385a89e35b,7a0da24925] + + - Add bulk cipher functions for OFB and GCM modes. + [f12b6788f2,f4e63e92dc] + + Release-info: https://dev.gnupg.org/T5259 + + +Noteworthy changes in version 1.9.0 (2021-01-19) [C23/A3/R0] +------------------------------------------------ + + * New and extended interfaces: + + - New curves Ed448, X448, and SM2. + + - New cipher mode EAX. + + - New cipher algo SM4. + + - New hash algo SM3. + + - New hash algo variants SHA512/224 and SHA512/256. + + - New MAC algos for Blake-2 algorithms, the new SHA512 variants, + SM3, SM4 and for a GOST variant. + + - New convenience function gcry_mpi_get_ui. + + - gcry_sexp_extract_param understands new format specifiers to + directly store to integers and strings. + + - New function gcry_ecc_mul_point and curve constants for Curve448 + and Curve25519. [#4293] + + - New function gcry_ecc_get_algo_keylen. + + - New control code GCRYCTL_AUTO_EXPAND_SECMEM to allow growing the + secure memory area. Also in 1.8.2 as an undocumented feature. + + * Performance: + + - Optimized implementations for Aarch64. + + - Faster implementations for Poly1305 and ChaCha. Also for + PowerPC. [b9a471ccf5,172ad09cbe,#4460] + + - Optimized implementations of AES and SHA-256 on PowerPC. + [#4529,#4530] + + - Improved use of AES-NI to speed up AES-XTS (6 times faster). + [a00c5b2988] + + - Improved use of AES-NI for OCB. [eacbd59b13,e924ce456d] + + - Speedup AES-XTS on ARMv8/CE (2.5 times faster). [93503c127a] + + - New AVX and AVX2 implementations for Blake-2 (1.3/1.4 times + faster). [af7fc732f9, da58a62ac1] + + - Use Intel SHA extension for SHA-1 and SHA-256 (4.0/3.7 times + faster). [d02958bd30, 0b3ec359e2] + + - Use ARMv7/NEON accelerated GCM implementation (3 times faster). + [2445cf7431] + + - Use of i386/SSSE3 for SHA-512 (4.5 times faster on Ryzen 7). + [b52dde8609] + + - Use 64 bit ARMv8/CE PMULL for CRC (7 times faster). [14c8a593ed] + + - Improve CAST5 (40% to 70% faster). [4ec566b368] + + - Improve Blowfish (60% to 80% faster). [ced7508c85] + + * Bug fixes: + + - Fix infinite loop due to applications using fork the wrong + way. [#3491][also in 1.8.4] + + - Fix possible leak of a few bits of secret primes to pageable + memory. [#3848][also in 1.8.4] + + - Fix possible hang in the RNG (1.8.3 only). [#4034][also in 1.8.4] + + - Several minor fixes. [#4102,#4208,#4209,#4210,#4211,#4212] + [also in 1.8.4] + + - On Linux always make use of getrandom if possible and then use + its /dev/urandom behaviour. [#3894][also in 1.8.4] + + - Use blinding for ECDSA signing to mitigate a novel side-channel + attack. [#4011,CVE-2018-0495] [also in 1.8.3, 1.7.10] + + - Fix incorrect counter overflow handling for GCM when using an IV + size other than 96 bit. [#3764] [also in 1.8.3, 1.7.10] + + - Fix incorrect output of AES-keywrap mode for in-place encryption + on some platforms. [also in 1.8.3, 1.7.10] + + - Fix the gcry_mpi_ec_curve_point point validation function. + [also in 1.8.3, 1.7.10] + + - Fix rare assertion failure in gcry_prime_check. [also in 1.8.3] + + - Do not use /dev/srandom on OpenBSD. [also in 1.8.2] + + - Fix test suite failure on systems with large pages. [#3351] + [also in 1.8.2] + + - Fix test suite to not use mmap on Windows. [also in 1.8.2] + + - Fix fatal out of secure memory status in the s-expression parser + on heavy loaded systems. [also in 1.8.2] + + - Fix build problems on OpenIndiana et al. [#4818, also in 1.8.6] + + - Fix GCM bug on arm64 which troubles for example OMEMO. [#4986, + also in 1.8.6] + + - Detect a div-by-zero in a debug helper tool. [#4868, also in 1.8.6] + + - Use a constant time mpi_inv and related changes. [#4869, partly + also in 1.8.6] + + - Fix mpi_copy to correctly handle flags of opaque MPIs. + [also in 1.8.6] + + - Fix mpi_cmp to consider +0 and -0 the same. [also in 1.8.6] + + - Fix extra entropy collection via clock_gettime. Note that this + fallback code path is not used on any decent hardware. [#4966, + also in 1.8.7] + + - Support opaque MPI with gcry_mpi_print. [#4872, also in 1.8.7] + + - Allow for a Unicode random seed file on Windows. [#5098, also in + 1.8.7] + + * Other features: + + - Add OIDs from RFC-8410 as aliases for Ed25519 and Curve25519. + [also in 1.8.6] + + - Add mitigation against ECC timing attack CVE-2019-13627. [#4626] + + - Internal cleanup of the ECC implementation. + + - Support reading EC point in compressed format for some curves. + [#4951] + + * Interface changes relative to the 1.8.0 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + gcry_mpi_get_ui NEW function. + GCRYCTL_AUTO_EXPAND_SECMEM NEW control code. + gcry_sexp_extract_param EXTENDED. + GCRY_CIPHER_GOST28147_MESH NEW cipher algo. + GCRY_CIPHER_SM4 NEW cipher algo. + GCRY_CIPHER_MODE_EAX NEW mode. + GCRY_ECC_CURVE25519 NEW curve id. + GCRY_ECC_CURVE448 NEW curve id. + gcry_ecc_get_algo_keylen NEW function. + gcry_ecc_mul_point NEW function. + GCRY_MD_SM3 NEW hash algo. + GCRY_MD_SHA512_256 NEW hash algo. + GCRY_MD_SHA512_224 NEW hash algo. + GCRY_MAC_GOST28147_IMIT NEW mac algo. + GCRY_MAC_HMAC_GOSTR3411_CP NEW mac algo. + GCRY_MAC_HMAC_BLAKE2B_512 NEW mac algo. + GCRY_MAC_HMAC_BLAKE2B_384 NEW mac algo. + GCRY_MAC_HMAC_BLAKE2B_256 NEW mac algo. + GCRY_MAC_HMAC_BLAKE2B_160 NEW mac algo. + GCRY_MAC_HMAC_BLAKE2S_256 NEW mac algo. + GCRY_MAC_HMAC_BLAKE2S_224 NEW mac algo. + GCRY_MAC_HMAC_BLAKE2S_160 NEW mac algo. + GCRY_MAC_HMAC_BLAKE2S_128 NEW mac algo. + GCRY_MAC_HMAC_SM3 NEW mac algo. + GCRY_MAC_HMAC_SHA512_256 NEW mac algo. + GCRY_MAC_HMAC_SHA512_224 NEW mac algo. + GCRY_MAC_CMAC_SM4 NEW mac algo. + + Release-info: https://dev.gnupg.org/T4294 + + Release dates of 1.8.x versions: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Version 1.8.2 (2017-12-13) + Version 1.8.3 (2018-06-13) + Version 1.8.4 (2018-10-26) + Version 1.8.5 (2019-08-29) + Version 1.8.6 (2020-07-06) + Version 1.8.7 (2020-10-23) + + +Noteworthy changes in version 1.8.1 (2017-08-27) [C22/A2/R1] +------------------------------------------------ + + * Bug fixes: + + - Mitigate a local side-channel attack on Curve25519 dubbed "May + the Fourth be With You". [CVE-2017-0379] [also in 1.7.9] + + - Add more extra bytes to the pool after reading a seed file. + + - Add the OID SHA384WithECDSA from RFC-7427 to SHA-384. + + - Fix build problems with the Jitter RNG + + - Fix assembler code build problems on Rasbian (ARMv8/AArch32-CE). + + +Noteworthy changes in version 1.8.0 (2017-07-18) [C22/A2/R0] +------------------------------------------------ + + * New interfaces: + + - New cipher mode XTS + + - New hash function Blake-2 + + - New function gcry_mpi_point_copy. + + - New function gcry_get_config. + + - GCRYCTL_REINIT_SYSCALL_CLAMP allows to init nPth after Libgcrypt. + + - New global configuration file /etc/gcrypt/random.conf. + + * Extended interfaces: + + - GCRYCTL_PRINT_CONFIG does now also print build information for + libgpg-error and the used compiler version. + + - GCRY_CIPHER_MODE_CFB8 is now supported. + + - Add Stribog OIDs. [also in 1.7.4] + + * Performance: + + - A jitter based entropy collector is now used in addition to the + other entropy collectors. + + - Optimized gcry_md_hash_buffers for SHA-256 and SHA-512. + + - More ARMv8/AArch32 improvements for AES, GCM, SHA-256, and SHA-1. + [also in 1.7.4] + + - Add ARMv8/AArch32 assembly implementation for Twofish and + Camellia. [also in 1.7.4] + + - Add bulk processing implementation for ARMv8/AArch32. + [also in 1.7.4] + + - Improve the DRBG performance and sync the code with the Linux + version. [also in 1.7.4] + + * Internal changes: + + - Libgpg-error 1.25 is now required. This avoids stalling of nPth + threads due to contention on internal Libgcrypt locks (e.g. the + random pool lock). + + - The system call clamp of libgpg-error is now used to wrap the + blocking read of /dev/random. This allows other nPth threads to + run while Libgcrypt is gathering entropy. + + - When secure memory is requested by the MPI functions or by + gcry_xmalloc_secure, they do not anymore lead to a fatal error if + the secure memory pool is used up. Instead new pools are + allocated as needed. These new pools are not protected against + being swapped out (mlock can't be used). However, these days + this is considered a minor issue and can easily be mitigated by + using encrypted swap space. [also in 1.7.4] + + * Bug fixes: + + - Fix AES CTR self-check detected failure in the SSSE3 based + implementation. [also in 1.7.6] + + - Remove gratuitous select before the getrandom syscall. + [also in 1.7.6] + + - Fix regression in mlock detection. [bug#2870] [also in 1.7.5] + + - Fix GOST 28147 CryptoPro-B S-box. [also in 1.7.4] + + - Fix error code handling of mlock calls. [also in 1.7.4] + + - Fix possible timing attack on EdDSA session key. [also in 1.7.7] + + - Fix long standing bug in secure memory implementation which could + lead to a segv on free. [bug#3027] [also in 1.7.7] + + - Mitigate a flush+reload side-channel attack on RSA secret keys + dubbed "Sliding right into disaster". For details see + . [CVE-2017-7526] [also in 1.7.8] + + * Interface changes relative to the 1.7.0 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + gcry_get_config NEW function. + gcry_mpi_point_copy NEW function. + GCRYCTL_REINIT_SYSCALL_CLAMP NEW macro. + GCRY_MD_BLAKE2B_512 NEW constant. + GCRY_MD_BLAKE2B_384 NEW constant. + GCRY_MD_BLAKE2B_256 NEW constant. + GCRY_MD_BLAKE2B_160 NEW constant. + GCRY_MD_BLAKE2S_256 NEW constant. + GCRY_MD_BLAKE2S_224 NEW constant. + GCRY_MD_BLAKE2S_160 NEW constant. + GCRY_MD_BLAKE2S_128 NEW constant. + GCRY_CIPHER_MODE_XTS NEW constant. + gcry_md_info DEPRECATED. + + * Release dates of 1.7.x versions: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Version 1.7.10 (2018-06-13) [C21/A1/R10] + Version 1.7.9 (2017-08-27) [C21/A1/R9] + Version 1.7.8 (2017-06-29) [C21/A1/R8] + Version 1.7.7 (2017-06-02) [C21/A1/R7] + Version 1.7.6 (2017-01-18) [C21/A1/R6] + Version 1.7.5 (2016-12-15) [C21/A1/R5] + Version 1.7.4 (2016-12-09) [C21/A1/R4] + + +Noteworthy changes in version 1.7.3 (2016-08-17) [C21/A1/R3] +------------------------------------------------ + + * Bug fixes: + + - Fix critical security bug in the RNG [CVE-2016-6313]. An + attacker who obtains 580 bytes from the standard RNG can + trivially predict the next 20 bytes of output. Problem + detected by Felix D=C3=B6rre and Vladimir Klebanov, KIT. + + - Fix building of some asm modules with older compilers and CPUs. + + * Performance: + + - ARMv8/AArch32 improvements for AES, GCM, SHA-256, and SHA-1. + + +Noteworthy changes in version 1.7.2 (2016-07-14) [C21/A1/R2] +------------------------------------------------ + + * Bug fixes: + + - Fix setting of the ECC cofactor if parameters are specified. + + - Fix memory leak in the ECC code. + + - Remove debug message about unsupported getrandom syscall. + + - Fix build problems related to AVX use. + + - Fix bus errors on ARM for Poly1305, ChaCha20, AES, and SHA-512. + + * Internal changes: + + - Improved fatal error message for wrong use of gcry_md_read. + + - Disallow symmetric encryption/decryption if key is not set. + + +Noteworthy changes in version 1.7.1 (2016-06-15) [C21/A1/R1] +------------------------------------------------ + + * Bug fixes: + + - Fix ecc_verify for cofactor support. + + - Fix portability bug when using gcc with Solaris 9 SPARC. + + - Build fix for OpenBSD/amd64 + + - Add OIDs to the Serpent ciphers. + + * Internal changes: + + - Use getrandom system call on Linux if available. + + - Blinding is now also used for RSA signature creation. + + - Changed names of debug envvars + + +Noteworthy changes in version 1.7.0 (2016-04-15) [C21/A1/R0] +------------------------------------------------ + + * New algorithms and modes: + + - SHA3-224, SHA3-256, SHA3-384, SHA3-512, and MD2 hash algorithms. + + - SHAKE128 and SHAKE256 extendable-output hash algorithms. + + - ChaCha20 stream cipher. + + - Poly1305 message authentication algorithm + + - ChaCha20-Poly1305 Authenticated Encryption with Associated Data + mode. + + - OCB mode. + + - HMAC-MD2 for use by legacy applications. + + * New curves for ECC: + + - Curve25519. + + - sec256k1. + + - GOST R 34.10-2001 and GOST R 34.10-2012. + + * Performance: + + - Improved performance of KDF functions. + + - Assembler optimized implementations of Blowfish and Serpent on + ARM. + + - Assembler optimized implementation of 3DES on x86. + + - Improved AES using the SSSE3 based vector permutation method by + Mike Hamburg. + + - AVX/BMI is used for SHA-1 and SHA-256 on x86. This is for SHA-1 + about 20% faster than SSSE3 and more than 100% faster than the + generic C implementation. + + - 40% speedup for SHA-512 and 72% for SHA-1 on ARM Cortex-A8. + + - 60-90% speedup for Whirlpool on x86. + + - 300% speedup for RIPE MD-160. + + - Up to 11 times speedup for CRC functions on x86. + + * Other features: + + - Improved ECDSA and FIPS 186-4 compliance. + + - Support for Montgomery curves. + + - gcry_cipher_set_sbox to tweak S-boxes of the gost28147 cipher + algorithm. + + - gcry_mpi_ec_sub to subtract two points on a curve. + + - gcry_mpi_ec_decode_point to decode an MPI into a point object. + + - Emulation for broken Whirlpool code prior to 1.6.0. [from 1.6.1] + + - Flag "pkcs1-raw" to enable PCKS#1 padding with a user supplied + hash part. + + - Parameter "saltlen" to set a non-default salt length for RSA PSS. + + - A SP800-90A conforming DRNG replaces the former X9.31 alternative + random number generator. + + - Map deprecated RSA algo number to the RSA algo number for better + backward compatibility. [from 1.6.2] + + - Use ciphertext blinding for Elgamal decryption [CVE-2014-3591]. + See http://www.cs.tau.ac.il/~tromer/radioexp/ for details. + [from 1.6.3] + + - Fixed data-dependent timing variations in modular exponentiation + [related to CVE-2015-0837, Last-Level Cache Side-Channel Attacks + are Practical]. [from 1.6.3] + + - Flag "no-keytest" for ECC key generation. Due to a bug in + the parser that flag will also be accepted but ignored by older + version of Libgcrypt. [from 1.6.4] + + - Speed up the random number generator by requiring less extra + seeding. [from 1.6.4] + + - Always verify a created RSA signature to avoid private key leaks + due to hardware failures. [from 1.6.4] + + - Mitigate side-channel attack on ECDH with Weierstrass curves + [CVE-2015-7511]. See http://www.cs.tau.ac.IL/~tromer/ecdh/ for + details. [from 1.6.5] + + * Internal changes: + + - Moved locking out to libgpg-error. + + - Support of the SYSROOT envvar in the build system. + + - Refactor some code. + + - The availability of a 64 bit integer type is now mandatory. + + * Bug fixes: + + - Fixed message digest lookup by OID (regression in 1.6.0). + + - Fixed a build problem on NetBSD + + - Fixed memory leaks in ECC code. + + - Fixed some asm build problems and feature detection bugs. + + * Interface changes relative to the 1.6.0 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + gcry_cipher_final NEW macro. + GCRY_CIPHER_MODE_CFB8 NEW constant. + GCRY_CIPHER_MODE_OCB NEW. + GCRY_CIPHER_MODE_POLY1305 NEW. + gcry_cipher_set_sbox NEW macro. + gcry_mac_get_algo NEW. + GCRY_MAC_HMAC_MD2 NEW. + GCRY_MAC_HMAC_SHA3_224 NEW. + GCRY_MAC_HMAC_SHA3_256 NEW. + GCRY_MAC_HMAC_SHA3_384 NEW. + GCRY_MAC_HMAC_SHA3_512 NEW. + GCRY_MAC_POLY1305 NEW. + GCRY_MAC_POLY1305_AES NEW. + GCRY_MAC_POLY1305_CAMELLIA NEW. + GCRY_MAC_POLY1305_SEED NEW. + GCRY_MAC_POLY1305_SERPENT NEW. + GCRY_MAC_POLY1305_TWOFISH NEW. + gcry_md_extract NEW. + GCRY_MD_FLAG_BUGEMU1 NEW [from 1.6.1]. + GCRY_MD_GOSTR3411_CP NEW. + GCRY_MD_SHA3_224 NEW. + GCRY_MD_SHA3_256 NEW. + GCRY_MD_SHA3_384 NEW. + GCRY_MD_SHA3_512 NEW. + GCRY_MD_SHAKE128 NEW. + GCRY_MD_SHAKE256 NEW. + gcry_mpi_ec_decode_point NEW. + gcry_mpi_ec_sub NEW. + GCRY_PK_EDDSA NEW constant. + GCRYCTL_GET_TAGLEN NEW. + GCRYCTL_SET_SBOX NEW. + GCRYCTL_SET_TAGLEN NEW. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Version 1.6.5 (2016-02-09) [C20/A0/R5] +Version 1.6.4 (2015-09-08) [C20/A0/R4] +Version 1.6.3 (2015-02-27) [C20/A0/R3] +Version 1.6.2 (2014-08-21) [C20/A0/R2] +Version 1.6.1 (2014-01-29) [C20/A0/R1] + + +Noteworthy changes in version 1.6.0 (2013-12-16) [C20/A0/R0] +------------------------------------------------ + + * Removed the long deprecated gcry_ac interface. Thus Libgcrypt is + not anymore ABI compatible to previous versions if they used the ac + interface. + + * Removed the module register subsystem. + + * The deprecated message digest debug macros have been removed. Use + gcry_md_debug instead. + + * Removed deprecated control codes. + + * Improved performance of most cipher algorithms as well as for the + SHA family of hash functions. + + * Added support for the IDEA cipher algorithm. + + * Added support for the Salsa20 and reduced Salsa20/12 stream ciphers. + + * Added limited support for the GOST 28147-89 cipher algorithm. + + * Added support for the GOST R 34.11-94 and R 34.11-2012 (Stribog) + hash algorithms. + + * Added a random number generator to directly use the system's RNG. + Also added an interface to prefer the use of a specified RNG. + + * Added support for the SCRYPT algorithm. + + * Mitigated the Yarom/Falkner flush+reload side-channel attack on RSA + secret keys. See [CVE-2013-4242]. + + * Added support for Deterministic DSA as per RFC-6979. + + * Added support for curve Ed25519. + + * Added a scatter gather hash convenience function. + + * Added several MPI amd SEXP helper functions. + + * Added support for negative numbers to gcry_mpi_print, + gcry_mpi_aprint and gcry_mpi_scan. + + * The algorithm ids GCRY_PK_ECDSA and GCRY_PK_ECDH are now + deprecated. Use GCRY_PK_ECC if you need an algorithm id. + + * Changed gcry_pk_genkey for "ecc" to only include the curve name and + not the parameters. The flag "param" may be used to revert this. + + * Added a feature to globally disable selected hardware features. + + * Added debug helper functions. + + * Interface changes relative to the 1.5.0 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + gcry_ac_* REMOVED. + GCRY_AC_* REMOVED. + gcry_module_t REMOVED. + gcry_cipher_register REMOVED. + gcry_cipher_unregister REMOVED. + gcry_cipher_list REMOVED. + gcry_pk_register REMOVED. + gcry_pk_unregister REMOVED. + gcry_pk_list REMOVED. + gcry_md_register REMOVED. + gcry_md_unregister REMOVED. + gcry_md_list REMOVED. + gcry_md_start_debug REMOVED (macro). + gcry_md_stop_debug REMOVED (macro). + GCRYCTL_SET_KEY REMOVED. + GCRYCTL_SET_IV REMOVED. + GCRYCTL_SET_CTR REMOVED. + GCRYCTL_DISABLE_ALGO CHANGED: Not anymore thread-safe. + gcry_pk_genkey CHANGED: ECC curve params not returned. + gcry_md_hash_buffers NEW. + gcry_buffer_t NEW. + GCRYCTL_SET_ENFORCED_FIPS_FLAG NEW. + GCRYCTL_SET_PREFERRED_RNG_TYPE NEW. + GCRYCTL_GET_CURRENT_RNG_TYPE NEW. + GCRYCTL_CLOSE_RANDOM_DEVICE NEW. + GCRY_RNG_TYPE_STANDARD NEW. + GCRY_RNG_TYPE_FIPS NEW. + GCRY_RNG_TYPE_SYSTEM NEW. + gcry_mpi_is_neg NEW. + gcry_mpi_neg NEW. + gcry_mpi_abs NEW. + gcry_mpi_snatch NEW. + gcry_mpi_set_opaque_copy NEW. + gcry_mpi_point_t NEW. + gcry_mpi_point_new NEW. + gcry_mpi_point_release NEW. + gcry_mpi_point_get NEW. + gcry_mpi_point_snatch_get NEW. + gcry_mpi_point_set NEW. + gcry_mpi_point_snatch_set NEW. + gcry_ctx_t NEW. + gcry_ctx_release NEW. + gcry_mpi_ec_new NEW. + gcry_mpi_ec_get_mpi NEW. + gcry_mpi_ec_get_point NEW. + gcry_mpi_ec_set_mpi NEW. + gcry_mpi_ec_set_point NEW. + gcry_mpi_ec_get_affine NEW. + gcry_mpi_ec_dup NEW. + gcry_mpi_ec_add NEW. + gcry_mpi_ec_mul NEW. + gcry_mpi_ec_curve_point NEW. + GCRYMPI_FLAG_IMMUTABLE NEW. + GCRYMPI_FLAG_CONST NEW. + GCRYMPI_FLAG_USER1 NEW. + GCRYMPI_FLAG_USER2 NEW. + GCRYMPI_FLAG_USER3 NEW. + GCRYMPI_FLAG_USER4 NEW. + GCRYMPI_CONST_ONE NEW. + GCRYMPI_CONST_TWO NEW. + GCRYMPI_CONST_THREE NEW. + GCRYMPI_CONST_FOUR NEW. + GCRYMPI_CONST_EIGHT NEW. + GCRYMPI_FMT_OPAQUE NEW. + GCRYPT_VERSION_NUMBER NEW. + GCRY_KDF_SCRYPT NEW. + gcry_pubkey_get_sexp NEW. + GCRYCTL_DISABLE_LOCKED_SECMEM NEW. + GCRYCTL_DISABLE_PRIV_DROP NEW. + GCRY_CIPHER_SALSA20 NEW. + gcry_sexp_nth_buffer NEW. + gcry_sexp_extract_param NEW. + GCRY_CIPHER_SALSA20R12 NEW. + GCRY_CIPHER_GOST28147 NEW. + GCRY_MD_GOSTR3411_94 NEW. + GCRY_MD_STRIBOG256 NEW. + GCRY_MD_STRIBOG512 NEW. + GCRY_PK_ECC NEW. + gcry_log_debug NEW. + gcry_log_debughex NEW. + gcry_log_debugmpi NEW. + gcry_log_debugpnt NEW. + + +Noteworthy changes in version 1.5.0 (2011-06-29) +------------------------------------------------ + + * New function gcry_kdf_derive implementing OpenPGP S2K algorithms + and PBKDF2. + + * Support for WindowsCE. + + * Support for ECDH. + + * Support for OAEP and PSS methods as described by RFC-3447. + + * Fixed PKCS v1.5 code to always return the leading zero. + + * New format specifiers "%M" and "%u" for gcry_sexp_build. + + * Support opaque MPIs with "%m" and "%M" in gcry_sexp_build. + + * New functions gcry_pk_get_curve and gcry_pk_get_param to map ECC + parameters to a curve name and to retrieve parameter values. + + * gcry_mpi_cmp applied to opaque values has a defined semantic now. + + * Uses the Intel AES-NI instructions if available. + + * The use of the deprecated Alternative Public Key Interface + (gcry_ac_*) will now print compile time warnings. + + * The module register subsystem has been deprecated. This subsystem + is not flexible enough and would always require ABI changes to + extend the internal interfaces. It will eventually be removed. + Please contact us on the gcrypt-devel mailing list to discuss + whether you really need this feature or how it can be replaced by + an internal plugin mechanism. + + * CTR mode may now be used with data chunks of arbitrary length. + + * Changes also done in 1.4.6 (2010-07-13): + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + * New variants of the TIGER algorithm. + + * New cipher algorithm mode for AES-WRAP. + + * Changes also done in 1.4.5 (2009-12-11): + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + * Fixed minor memory leak in DSA key generation. + + * No more switching to FIPS mode if /proc/version is not readable. + + * Fixed sigill during Padlock detection on old CPUs. + + * Fixed a hang on some W2000 machines. + + * Boosted SHA-512 performance by 30% on ia32 boxes and gcc 4.3; + SHA-256 went up by 25%. + + * Interface changes relative to the 1.4.6 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + GCRY_PK_ECDH NEW. + gcry_pk_get_curve NEW. + gcry_pk_get_param NEW. + GCRYCTL_DISABLE_HWF NEW. + gcry_kdf_derive NEW. + gcry_pk_encrypt EXTENDED: Support OAEP. + gcry_pk_decrypt EXTENDED: Support OAEP. + gcry_pk_sign EXTENDED: Support PSS. + gcry_pk_verify EXTENDED: Support PSS. + gcry_sexp_build EXTENDED: Add format specifiers M and u. + + * Interface changes relative to the 1.4.2 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + GCRY_CIPHER_MODE_AESWRAP NEW. + GCRY_MD_TIGER1 NEW. + GCRY_MD_TIGER2 NEW. + + +Noteworthy changes in version 1.4.4 (2009-01-22) +------------------------------------------------ + + * Publish GCRY_MODULE_ID_USER and GCRY_MODULE_ID_USER_LAST constants. + This functionality has been in Libgcrypt since 1.3.0. + + * MD5 may now be used in non-enforced fips mode. + + * Fixed HMAC for SHA-384 and SHA-512 with keys longer than 64 bytes. + + * In fips mode, RSA keys are now generated using the X9.31 algorithm + and DSA keys using the FIPS 186-2 algorithm. + + * The transient-key flag is now also supported for DSA key + generation. DSA domain parameters may be given as well. + + +Noteworthy changes in version 1.4.3 (2008-09-18) +------------------------------------------------ + + * Try to auto-initialize Libgcrypt to minimize the effect of + applications not doing that correctly. This is not a perfect + solution but given that many applicationion would totally fail + without such a hack, we try to help at least with the most common + cases. Folks, please read the manual to learn how to properly + initialize Libgcrypt! + + * Auto-initialize the secure memory to 32k instead of aborting the + process. + + * Log fatal errors via syslog. + + * Changed the name and the semantics of the fips mode config file. + + * Add convenience macro gcry_fips_mode_active. + + * More self-tests. + + * Documentation cleanups. + + +Noteworthy changes in version 1.4.2 (2008-09-08) +------------------------------------------------ + + * The long missing gcry_mpi_lshift function has been added. + + * RSA key generation now supports a "transient-key" flag. + + * The keygrip computation for ECDSA has been implemented thus ECDSA + is now fully supported. + + * A few macros have been replaced by functions for better type + checking. + + * The thread initialization structure now carries version + information. + + * The manual describes more clearly how to initialize Libgcrypt. + + * The library may now be switched into a FIPS mode. + + * Interface changes relative to the 1.3.0 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + GCRYCTL_OPERATIONAL_P NEW. + GCRYCTL_FIPS_MODE_P NEW. + GCRYCTL_FORCE_FIPS_MODE NEW. + gcry_cipher_setkey NEW: Replaces macro. + gcry_cipher_setiv NEW: Replaces macro. + gcry_cipher_setctr NEW: Replaces macro. + gcry_mpi_lshift NEW. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Noteworthy changes in version 1.4.1 (2008-04-25) +------------------------------------------------ + + * Fixed a bug introduced by 1.3.1 which led to the comsumption of far + too much entropy for the intial seeding. + + * Improved AES performance for CFB and CBC modes. + + * Removed build problems for the Padlock support. + + +Noteworthy changes in version 1.4.0 (2007-12-10) +------------------------------------------------ + + * New configure option --disable-padlock-support which is mostly + useful in case of build problems. + + +Noteworthy changes in version 1.3.2 (2007-12-03) +------------------------------------------------ + + * The visibility attribute is now used if supported by the toolchain. + + * The ACE engine of VIA processors is now used for AES-128. + + * The ASN.1 DER template for SHA-224 has been fixed. + + +Noteworthy changes in version 1.3.1 (2007-10-26) +------------------------------------------------ + + * The entire library is now under the LGPL. The helper programs and + the manual are under the GPL. Kudos to Peter Gutmann for giving + permissions to relicense the rndw32 and rndunix modules. + + * The Camellia cipher is now under the LGPL and included by default. + + * Fixed a bug in the detection of symbol prefixes which inhibited the + build of optimzied assembler code on certain systems. + + * Updated the entropy gatherer for W32. + + +Noteworthy changes in version 1.3.0 (2007-05-04) +------------------------------------------------ + + * Changed the way the RNG gets initialized. This allows to keep it + uninitialized as long as no random numbers are used. To override + this, the new macro gcry_fast_random_poll may be used. It is in + general a good idea to spread this macro into the application code + to make sure that these polls happen often enough. + + * Made the RNG immune against fork without exec. + + * Reading and writing the random seed file is now protected by a + fcntl style file lock on systems that provide this function. + + * Support for SHA-224 and HMAC using SHA-384 and SHA-512. + + * Support for the SEED cipher. + + * Support for the Camellia cipher. Note that Camellia is disabled by + default, and that enabling it changes the license of libgcrypt from + LGPL to GPL. + + * Support for OFB encryption mode. + + * gcry_mpi_rshift does not anymore truncate the shift count. + + * Reserved algorithm ranges for use by applications. + + * Support for DSA2. + + * The new function gcry_md_debug should be used instead of the + gcry_md_start_debug and gcry_md_stop_debug macros. + + * New configure option --enable-random-daemon to support a system + wide random daemon. The daemon code is experimental and not yet + very well working. It will eventually allow to keep a global + random pool for the sake of short living processes. + + * Non executable stack support is now used by default on systems + supporting it. + + * Support for Microsoft Windows. + + * Assembler support for the AMD64 architecture. + + * New configure option --enable-mpi-path for optimized builds. + + * Experimental support for ECDSA; should only be used for testing. + + * New control code GCRYCTL_PRINT_CONFIG to print the build + configuration. + + * Minor changes to some function declarations. Buffer arguments are + now typed as void pointer. This should not affect any compilation. + Fixed two bugs in return values and clarified documentation. + + * Interface changes relative to the 1.2.0 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + gcry_fast_random_poll NEW + gcry_md_debug NEW + gcry_sexp_nth_string NEW + GCRY_MD_SHA224 NEW + GCRY_PK_USAGE_CERT NEW + GCRY_PK_USAGE_AUTH NEW + GCRY_PK_USAGE_UNKN NEW + GCRY_PK_ECDSA NEW + GCRY_CIPHER_SEED NEW + GCRY_CIPHER_CAMELLIA128 NEW + GCRY_CIPHER_CAMELLIA192 NEW + GCRY_CIPHER_CAMELLIA256 NEW + GCRYCTL_FAKED_RANDOM_P NEW + GCRYCTL_PRINT_CONFIG NEW + GCRYCTL_SET_RNDEGD_SOCKET NEW. + gcry_mpi_scan CHANGED: Argument BUFFER is now void*. + gcry_pk_algo_name CHANGED: Returns "?" instead of NULL. + gcry_cipher_algo_name CHANGED: Returns "?" instead of "". + gcry_pk_spec_t CHANGED: Element ALIASES is now const ptr. + gcry_md_write_t CHANGED: Argument BUF is now a const void*. + gcry_md_ctl CHANGED: Argument BUFFER is now void*. + gcry_cipher_encrypt CHANGED: Arguments IN and OUT are now void*. + gcry_cipher_decrypt CHANGED: Arguments IN and OUT are now void*. + gcry_sexp_sprint CHANGED: Argument BUFFER is now void*. + gcry_create_nonce CHANGED: Argument BUFFER is now void*. + gcry_randomize CHANGED: Argument BUFFER is now void*. + gcry_cipher_register CHANGED: Argument ALGORITHM_ID is now int*. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Noteworthy changes in version 1.2.0 (2004-04-15) +------------------------------------------------ + + * First stable release. + + +Noteworthy changes in version 1.1.94 (2004-03-29) +------------------------------------------------- + + * The support for multi-threaded users goes into its third + incarnation. We removed compile time support for thread libraries. + To support the thread library of your choice, you have to set up + callback handlers at initialization time. New data structures, a + new control command, and default initializers are provided for this + purpose. + + * Interface changes relative to the 1.1.93 release: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +libgcrypt-config --thread OBSOLETE +libgcrypt-pth.la REMOVED +libgcrypt-pthread.la REMOVED +GCRYCTL_SET_THREAD_CBS NEW +struct gcrypt_thread_cbs NEW +enum gcry_thread_option NEW +GCRY_THREAD_OPTION_PTH_IMPL NEW +GCRY_THREAD_OPTION_PTHREAD_IMPL NEW +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Noteworthy changes in version 1.1.93 (2004-03-06) +------------------------------------------------- + + * The automatic thread library detection has finally been removed. + From now on, only linking explicitely to libgcrypt, libgcrypt-pth + or libgcrypt-pthread is supported. + +Noteworthy changes in version 1.1.92 (2004-02-20) +------------------------------------------------- + + * Minor bug fixes. + + * Included a limited implementation of RFC2268. + + * Changed API of the gcry_ac_ functions. Only a very few programs + should be affected by this. + + * Interface changes relative to the 1.1.91 release: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +GCRY_CIPHER_RFC2268_40 NEW. +gcry_ac_data_set CHANGED: New argument FLAGS. +gcry_ac_data_get_name CHANGED: New argument FLAGS. +gcry_ac_data_get_index CHANGED: New argument FLAGS. +gcry_ac_key_pair_generate CHANGED: New and reordered arguments. +gcry_ac_key_test CHANGED: New argument HANDLE. +gcry_ac_key_get_nbits CHANGED: New argument HANDLE. +gcry_ac_key_get_grip CHANGED: New argument HANDLE. +gcry_ac_data_search REMOVED. +gcry_ac_data_add REMOVED. +GCRY_AC_DATA_FLAG_NO_BLINDING REMOVED. +GCRY_AC_FLAG_NO_BLINDING NEW: Replaces above. + + +Noteworthy changes in version 1.1.91 (2003-12-19) +------------------------------------------------- + + * Code cleanups and minor bug fixes. + + +Noteworthy changes in version 1.1.90 (2003-11-14) +------------------------------------------------- + + * The use of the GCRY_WEAK_RANDOM level is now deprecated in favor of + the new gcry_create_nonce function. + + * gcry_sexp_build now supports a "%b" format to include a memory buffer. + + * Minor configuration fixes. + + * Interface changes relative to the 1.1.44 release: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +gcry_create_nonce NEW +gcry_sexp_build ENHANCED + + +Noteworthy changes in version 1.1.44 (2003-10-31) +------------------------------------------------- + + * Bug fixes and more code cleanups. + + * Enhanced the prime API. + + * Interface changes relative to the 1.1.43 release: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +gcry_prime_group_generator NEW +gcry_prime_release_factors NEW + + +Noteworthy changes in version 1.1.43 (2003-09-04) +------------------------------------------------- + + * Bug fixes and internal code cleanups. + + * Support for the Serpent cipher algorithm. + + * Interface changes relative to the 1.1.42 release: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +gcry_prime_generate NEW +gcry_prime_check NEW + + +Noteworthy changes in version 1.1.42 (2003-07-31) +------------------------------------------------- + + * Major API cleanup. Applications need to be converted to the new + API. See README.apichanges for hints on how to do that. Backward + compatibility is provided where it was possible without too much + effort and did not collide with the overall sanitization effort. + However, this is only for ease of transition. NO DEPRECATED + FUNCTION OR DATA TYPE IS CONSIDERED A PART OF THE API OR ABI AND + WILL BE DROPPED IN THE FUTURE WITHOUT CHANGING THE SONAME OF THE + LIBRARY. + + * If gcrypt.h is included in sources compiled by GCC 3.1 or later, + deprecated attributes will warn about use of obsolete functions and + type definitions. You can suppress these warnings by passing + -Wno-deprecated-declarations to the gcc command. + + * gcry_check_version must be called from now on to initialize the + library, it is not longer optional. + + * Removed `libgcrypt errno' concept. + + * Libgcrypt depends on libgpg-error, a library that provides error + codes and according functions for all GnuPG components. Functions + that used to return error codes asa `int' have been changed to + return a code of type `gcry_error_t'. All GCRYERR_* error symbols + have been removed, since they are now contained in libgpg-error + (GPG_ERR_*). All functions and types in libgpg-error have also been + wrapped in Libgcrypt. The new types are gcry_err_code_t and + gcry_err_source_t. The new functions are gcry_err_code, + gcry_err_source, gcry_error, gcry_err_make, gcry_error_from_errno, + gcry_err_make_from_errno, gcry_err_code_from_errno, + gcry_err_code_to_errno, gcry_strsource. + + * New function gcry_mpi_dump to help in debugging. + + * Added alternative interface for asymmetric cryptography. + + * CRC-32, CRC-32 a'la RFC 1510, CRC-24 a'la RFC 2440 are now + supported. + + * SHA-256, SHA-384 and SHA-512 are now supported. + + * 128 bit Twofish is now supported. + + * The random module won't print the "not enough random bytes + available" anymore. A new progress status is issued instead. + + * CBC-MAC for block ciphers is now supported, by using a + GCRY_CIPHER_CBC_MAC cipher flag. + + * CTR mode for block ciphers is now supported. + + * The public RSA exponent can now be specified in key generation. + + * RSA blinding is now supported and is used automatically for RSA + decryption. It can be explicitely disabled by using the + `no-blinding' symbol in the `flags' S-Expression or by using the + GCRY_AC_FLAG_DATA_NO_BLINDING flag when using the ac interface. + + * gcry_sexp_canon_len does not use a `historically encoded' error + code anymore. + + + * Interface changes relative to the 1.1.12 release: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +GCRY_MPI DEPRECATED; Use: gcry_mpi_t +GcryMPI DEPRECATED; Use: gcry_mpi_t +GCRY_SEXP DEPRECATED; Use: gcry_sexp_t +GcrySexp DEPRECATED; Use: gcry_sexp_t +GCRY_CIPHER_HD DEPRECATED; Use: gcry_cipher_hd_t +GcryCipherHd DEPRECATED; Use: gcry_cipher_hd_t +GCRY_MD_HD DEPRECATED; Use: gcry_md_hd_t +GcryMDHd DEPRECATED; Use: gcry_md_hd_t +gcry_error_t NEW +gcry_err_code_t NEW +gcry_err_source_t NEW +gcry_err_make NEW +gcry_error NEW +gcry_err_code NEW +gcry_err_source NEW +gcry_err_code_from_errno NEW +gcry_err_code_to_errno NEW +gcry_err_make_from_errno NEW +gcry_error_from_errno NEW +gcry_strsource NEW +GCRYERR_{some error code} REMOVED; Use GPG_ERR_* + from libgpg-error instead. +gcry_errno REMOVED +gcry_sexp_canon_len CHANGED +gcry_sexp_build_array NEW +gcry_mpi_scan CHANGED: New argument to separate in/out args. +gcry_mpi_print CHANGED: Ditto. +gcry_mpi_dump NEW +gcry_cipher_open CHANGED +gcry_cipher_reset NEW +gcry_cipher_register NEW +gcry_cipher_unregister NEW +gcry_cipher_list NEW +gcry_cipher_algo_keylen REPLACED macro with function. +gcry_cipher_algo_blklen REPLACED macro with function. +gcry_pk_register NEW +gcry_pk_unregister NEW +gcry_pk_list NEW +gcry_pk_decrypt ENHANCED: Allows flag to return + complete S-expression. +gcry_md_open CHANGED +gcry_md_copy CHANGED +gcry_md_is_enabled NEW +gcry_md_is_secure NEW +gcry_md_register NEW +gcry_md_unregister NEW +gcry_md_list NEW +gcry_ac_data_t NEW +gcry_ac_key_t NEW +gcry_ac_key_pair_t NEW +gcry_ac_handle_t NEW +gcry_ac_key_spec_rsa_t NEW +gcry_ac_data_new NEW +gcry_ac_data_destroy NEW +gcry_ac_data_set NEW +gcry_ac_data_copy NEW +gcry_ac_data_length NEW +gcry_ac_data_get_name NEW +gcry_ac_data_get_index NEW +gcry_ac_data_clear NEW +gcry_ac_open NEW +gcry_ac_close NEW +gcry_ac_key_init NEW +gcry_ac_key_pair_generate NEW +gcry_ac_key_pair_extract NEW +gcry_ac_key_data_get NEW +gcry_ac_key_test NEW +gcry_ac_key_get_nbits NEW +gcry_ac_key_get_grip NEW +gcry_ac_key_destroy NEW +gcry_ac_key_pair_destroy NEW +gcry_ac_data_encrypt NEW +gcry_ac_data_decrypt NEW +gcry_ac_data_sign NEW +gcry_ac_data_verify NEW +gcry_ac_id_to_name NEW +gcry_ac_name_to_id NEW +gcry_handler_progress_t NEW +gcry_handler_alloc_t NEW +gcry_handler_secure_check_t NEW +gcry_handle_realloc_t NEW +gcry_handler_free_t NEW +gcry_handler_no_mem_t NEW +gcry_handler_error_t NEW +gcry_handler_log_t NEW +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Noteworthy changes in version 1.1.12 (2003-01-20) +------------------------------------------------- + + * gcry_pk_sign, gcry_pk_verify and gcry_pk_encrypt can now handle an + optional pkcs1 flags parameter in the S-expression. A similar flag + may be passed to gcry_pk_decrypt but it is only syntactically + implemented. + + * New convenience macro gcry_md_get_asnoid. + + * There is now some real stuff in the manual. + + +Noteworthy changes in version 1.1.11 (2002-12-21) +------------------------------------------------- + + * Don't export internal symbols anymore (currently only for GNU systems) + + * New algorithm: MD4 + + * Implemented ciphertext stealing. + + * Smaller bugs fixes and a few new OIDs. + + * Interface changes relative to the 1.1.8 release: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +gcry_cipher_cts NEW +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Noteworthy changes in version 1.1.10 (2002-09-20) +------------------------------------------------- + + * Fixed shared library builds for i386, PPC and Sparc. + + * Added simple benchmark tool. + + * Replaced the internal mutexes by code which automatically adapts to + the used threading library. Currently Pth and Pthread are + supported. For non-ELF systems the GNU toolchain is now required.. + + * Added untested support to build Windows DLLs. + +Noteworthy changes in version 1.1.9 (2002-08-23) +------------------------------------------------ + + * Support for plain old DES. + + +Noteworthy changes in version 1.1.8 (2002-06-25) +------------------------------------------------ + + * Minor cleanups and exported a few new functions. + + * Interface changes relative to the 1.1.7 release: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~ +gcry_mpi_div NEW +gcry_mpi_mod NEW +gcry_mpi_invm NEW +gcry_mpi_swap NEW +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~ + +Noteworthy changes in version 1.1.7 (2002-05-21) +------------------------------------------------ + +* Libgcrypt is now distributed under the terms of the GNU Lesser + General Public License; see the README file for details. + +* It is possible to use libgcrypt w/o intialized secure memory. + +* Libgcrypt should now be thread safe after the initialization. + gcry_control (GCRYCRL_INITIALIZATION_FINISHED,NULL,0) should have + been called before creating additional threads. + + * Interface changes relative to the 1.1.6 release: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~ +GCRYCTL_DISABLE_INTERNAL_LOCKING NEW +GCRYCTL_DISABLE_SECMEM NEW +GCRYCTL_INITIALIZATION_FINISHED NEW +GCRYCTL_INITIALIZATION_FINISHED_P NEW +GCRYCTL_ANY_INITIALIZATION_P NEW +gcry_strdup NEW +gcry_sexp_create NEW +gcry_sexp_new NEW +gcry_set_progress_handler NEW +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~ + +Noteworthy changes in version 1.1.6 (2002-02-07) +------------------------------------------------ + + * Enhanced the S-expression conversion functions. + +Noteworthy changes in version 1.1.5 (2001-12-18) +------------------------------------------------ + + * gcry_{cipher,md}_map_name are now able to map stringified object IDs. + + * New functions gcry_sexp_canon_len and gcry_cipher_mode_from_oid. + + * Closed some memory leaks. + + +Noteworthy changes in version 1.1.4 (2001-08-03) +------------------------------------------------ + + * Arcfour does now work. + + * Some minor fixes. + + * Added a first test program + + * Migrated to autoconf 2.52. + + +Noteworthy changes in version 1.1.3 (2001-05-31) +------------------------------------------------ + + * First release of Libgcrypt which is a result of splitting GnuPG + into into libgcrypt and GnuPG. + + +Copyright 2001, 2002, 2003, 2004, 2007, 2008, + 2009, 2011 Free Software Foundation, Inc. +Copyright 2013 g10 Code GmbH + +This file is free software; as a special exception the author gives +unlimited permission to copy and/or distribute it, with or without +modifications, as long as this notice is preserved. + +This file is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/grub-core/lib/libgcrypt/README b/grub-core/lib/libgcrypt/README new file mode 100644 index 000000000..3c174a36f --- /dev/null +++ b/grub-core/lib/libgcrypt/README @@ -0,0 +1,280 @@ + Libgcrypt - The GNU Crypto Library + ------------------------------------ + Version 1.10 + + Copyright (C) 1989,1991-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2023 g10 Code GmbH + Copyright (C) 2013-2023 Jussi Kivilinna + + Libgcrypt is free software. See the file AUTHORS for full copying + notices, and LICENSES for notices about contributions that require + these additional notices to be distributed. + + + Overview + -------- + + Libgcrypt is a general purpose crypto library based on the code + used in GnuPG. Libgcrypt depends on the library `libgpg-error', + which must be installed correctly before Libgcrypt is to be built. + Libgcrypt is distributed under the LGPL, see the section "License" + below for details. + + + Build Instructions + ------------------ + + The download canonical location for libgcrypt is: + + https://gnupg.org/ftp/gcrypt/libgcrypt/ + + To build libgcrypt you need libgpg-error: + + https://gnupg.org/ftp/gcrypt/libgpg-error/ + + You should get the latest versions of course. + + After building and installing the libgpg-error package, you may + continue with Libgcrypt installation as with allmost all GNU + packages, you just have to do + + ./configure + make + make check + make install + + The "make check" is not required but a good idea to see whether + the library works as expected. The check takes some while and + prints some benchmarking results. Before doing "make install" you + probably need to become root. + + To build libgcrypt for Microsoft Windows, you need to have the + mingw32 cross-building toolchain installed. Instead of running a + plain configure you use + + ./autogen.sh --build-w32 + make + make install + + By default this command sequences expectsd a libgpg-error + installed below $HOME/w32root and installs libgcrypt to that + directory too. See the autogen.sh code for details. + + The documentation is available as an Info file (gcrypt.info). To + build documentation in PDF, run this: + + cd doc + make pdf + + + + Mailing List + ------------ + + You may want to join the developer's mailing list + gcrypt-devel@gnupg.org by sending mail with a subject of + "subscribe" to gcrypt-devel-request@gnupg.org. An archive of this + list is available at https://lists.gnupg.org . + + + Configure options + ----------------- + Here is a list of configure options which are sometimes useful + for installation. + + --enable-large-data-tests + With this option a "make check" will take really + long due to extra checks for the hash algorithms. + + --enable-m-guard + Enable the integrated malloc checking code. Please + note that this feature does not work on all CPUs + (e.g. SunOS 5.7 on UltraSparc-2) and might give + you a bus error. + + --disable-asm + Do not use assembler modules. It is not possible + to use this on some CPU types. + + --enable-ld-version-script + Libgcrypt tries to build a library where internal + symbols are not exported. This requires support + from ld and is currently enabled for a few OSes. + If you know that your ld supports the so called + ELF version scripts, you can use this option to + force its use. OTOH, if you get error message + from the linker, you probably want to use this + option to disable the use of version scripts. + Note, that you should never ever use an + undocumented symbol or one which is prefixed with + an underscore. + + --enable-ciphers=3Dlist + --enable-pubkey-ciphers=3Dlist + --enable-digests=3Dlist + If not otherwise specified, all algorithms + included in the libgcrypt source tree are built. + An exception are algorithms, which depend on + features not provided by the system, like 64bit + data types. With these switches it is possible + to select exactly those algorithm modules, which + should be built. The algorithms are to be + separated by spaces, commas or colons. To view + the list used with the current build the program + tests/version may be used. + + --disable-endian-check + Don't let configure test for the endianness but + try to use the OS provided macros at compile + time. This is helpful to create OS X fat binaries. + + --enable-random-daemon + Include support for a global random daemon and + build the daemon. This is an experimental feature. + + --enable-mpi-path=3DEXTRA_PATH + Prepend EXTRA_PATH to list of CPU specific + optimizations. For example, if you want to add + optimizations forn a Intel Pentium 4 compatible + CPU, you may use + --enable-mpi-path=3Dpentium4/sse2:pentium4/mmx + Take care: The generated library may crash on + non-compatible CPUs. + + --enable-random=3DNAME + Force the use of the random gathering module + NAME. Default is either to use /dev/random or + the auto mode. Possible values for NAME are: + egd - Use the module which accesses the + Entropy Gathering Daemon. See the webpages + for more information about it. + unix - Use the standard Unix module which does not + have a very good performance. + linux - Use the module which accesses /dev/random. + This is the first choice and the default one + for GNU/Linux or *BSD. + auto - Compile linux, egd and unix in and + automagically select at runtime. + + --enable-hmac-binary-check + Include support to check the binary at runtime + against a HMAC checksum. This works only in FIPS + mode on systems providing the dladdr function and usi= ng + the ELF binary format. + + --with-fips-module-version=3Dversion + Specify a string used as a module version for FIPS + certification purposes. + + --disable-padlock-support + Disable support for the PadLock engine of VIA + processors. The default is to use PadLock if + available. Try this if you get problems with + assembler code. + + --disable-aesni-support + Disable support for the AES-NI instructions of + newer Intel CPUs. The default is to use AES-NI + if available. Try this if you get problems with + assembler code. + + --disable-O-flag-munging + Some code is too complex for some compilers while + in higher optimization modes, thus the compiler + invocation is modified to use a lower + optimization level. Usually this works very well + but on some platforms these rules break the + invocation. This option may be used to disable + the feature under the assumption that either good + CFLAGS are given or the compiler can grok the code. + + + + + Build Problems + -------------- + + If you have a problem with a a certain release, please first check + the Release-info URL given in the NEWS file. + + We can't check all assembler files, so if you have problems + assembling them (or the program crashes) use --disable-asm with + ./configure. If you opt to delete individual replacement files in + hopes of using the remaining ones, be aware that the configure + scripts may consider several subdirectories to get all available + assembler files; be sure to delete the correct ones. Never delete + udiv-qrnnd.S in any CPU directory, because there may be no C + substitute (in mpi/genereic). Don't forget to delete + "config.cache" and run "./config.status --recheck". We got a few + reports about problems using versions of gcc earlier than 2.96 + along with a non-GNU assembler (as). If this applies to your + platform, you can either upgrade gcc to a more recent version, or + use the GNU assembler. + + Some make tools are broken - the best solution is to use GNU's + make. Try gmake or grab the sources from a GNU archive and + install them. + + Specific problems on some machines: + + * AArch64 (GCC 11.1 and 11.2) + + Because of the bug in GCC (fixed in 11.3), with the option + -O3, vectorization results wrong code for the function + buf_eq_const. Please use -O2 or -fno-tree-loop-vectorize. + + * IBM RS/6000 running AIX + + Due to a change in gcc (since version 2.8) the MPI stuff may + not build. In this case try to run configure using: + CFLAGS=3D"-g -O2 -mcpu=3Dpowerpc" ./configure + + * SVR4.2 (ESIX V4.2 cc) + + Due to problems with the ESIX as(1), you probably want to do: + CFLAGS=3D"-O -K pentium" ./configure --disable-asm + + * SunOS 4.1.4 + + ./configure ac_cv_sys_symbol_underscore=3Dyes + + * Sparc64 CPUs + + We have reports about failures in the AES module when + compiling using gcc (e.g. version 4.1.2) and the option -O3; + using -O2 solves the problem. + + + License + ------- + + The library is distributed under the terms of the GNU Lesser + General Public License (LGPL); see the file COPYING.LIB for the + actual terms. + + The helper programs as well as the documentation are distributed + under the terms of the GNU General Public License (GPL); see the + file COPYING for the actual terms. + + The file LICENSES has notices about contributions that require + that these additional notices are distributed. + + + Contact + ------- + + See the file AUTHORS. + + Commercial grade support for Libgcrypt is available; for a listing + of offers see https://www.gnupg.org/service.html . + + Since 2001 maintenance and development of Libgcrypt is done by + g10 Code GmbH and until 2021 mostly financed by donations. + + This file is Free Software; as a special exception the authors gives + unlimited permission to copy and/or distribute it, with or without + modifications, as long as this notice is preserved. For conditions + of the whole package, please see the file COPYING. This file is + distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY, to the extent permitted by law; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/grub-core/lib/libgcrypt/README.GIT b/grub-core/lib/libgcrypt/R= EADME.GIT new file mode 100644 index 000000000..ee2c6383f --- /dev/null +++ b/grub-core/lib/libgcrypt/README.GIT @@ -0,0 +1,49 @@ +If you are building from GIT, run the script + +./autogen.sh + +first, to make sure that you have all the necessary maintainer tools +are installed and to build the actual configuration files. If you +have just checked out from GIT, you should add the option "--force" to +autogen.sh so that meta data is noticed by autom4te.cache. Then run + +./configure --enable-maintainer-mode + +followed by the usual make. + +If autogen.sh complains about insufficient versions of the required +tools, or the tools are not installed, you may use environment +variables to override the default tool names: + + AUTOMAKE_SUFFIX is used as a suffix for all tools from the automake + package. For example + AUTOMAKE_SUFFIX=3D"-1.7" ./autogen.sh + uses "automake-1.7" and "aclocal-1.7. + AUTOMAKE_PREFIX is used as a prefix for all tools from the automake + page and may be combined with AUTOMAKE_SUFFIX. e.g.: + AUTOMAKE_PREFIX=3D/usr/foo/bin ./autogen.sh + uses "automake" and "aclocal" in the /usr/foo/bin + directory. + AUTOCONF_SUFFIX is used as a suffix for all tools from the automake + package + AUTOCONF_PREFIX is used as a prefix for all tools from the automake + package + GETTEXT_SUFFIX is used as a suffix for all tools from the gettext + package + GETTEXT_PREFIX is used as a prefix for all tools from the gettext + package + +It is also possible to use the variable name AUTOMAKE, AUTOCONF, +ACLOCAL, AUTOHEADER, GETTEXT and MSGMERGE to directly specify the name +of the programs to run. It is however better to use the suffix and +prefix forms as described above because that does not require +knowledge about the actual tools used by autogen.sh. + + +Please don't use autopoint, libtoolize or autoreconf unless you are +the current maintainer and want to update the standard configuration +files. All those files should be in GIT and only updated manually +if the maintainer decides that newer versions are required. The +maintainer should also make sure that the required version of automake +et al. are properly indicated at the top of configure.ac and take care +to copy the files and not merely use symlinks. diff --git a/grub-core/lib/libgcrypt/THANKS b/grub-core/lib/libgcrypt/THANKS new file mode 100644 index 000000000..6a44eade0 --- /dev/null +++ b/grub-core/lib/libgcrypt/THANKS @@ -0,0 +1,168 @@ +Libgcrypt is based on the GnuPG code. Here is a list of people, who +helped in GnuPG and Libgcrypt development. Please help us to keep it +complete and free of errors. + +Albert Chin china at thewrittenword com +Allan Clark allanc@sco.com +Anand Kumria wildfire@progsoc.uts.edu.au +Andreas Metzler ametzler at downhill.at.eu.org +Ariel T Glenn ariel@columbia.edu +Aurelien Jarno aurel32 at debian.org +Ben Hutchings ben decadent org uk +Bodo Moeller Bodo_Moeller@public.uni-hamburg.de +Brenno de Winter brenno@dewinter.com +Brian Moore bem@cmc.net +Brian Warner warner@lothar.com +Brieuc Jeunhomme bbp@via.ecp.fr +Bryan Fullerton bryanf@samurai.com +Caskey L. Dickson caskey@technocage.com +Cees van de Griend cees-list@griend.xs4all.nl +Charles Levert charles@comm.polymtl.ca +Christian Biere christianbiere@gmx.de +Christian Grothoff christian at grothoff org +Christian von Roques roques@pond.sub.org +Christopher Oliver oliver@fritz.traverse.net +Christian Recktenwald chris@citecs.de +Daiki Ueno ueno at unixuser org +Dan Fandrich dan at coneharvesters com +Daniel Eisenbud eisenbud@cs.swarthmore.edu +Daniel Koening dan@mail.isis.de +David Ellement ellement@sdd.hp.com +Detlef Lannert lannert@lannert.rz.uni-duesseldorf.de +Dirk Lattermann dlatt@t-online.de +Dirk Stoecker gcrypt@dstoecker.de +Ed Boraas ecxjo@esperanto.org +Elie De Brauwer elie@de-brauwer.be +Enzo Michelangeli em@MailAndNews.com +Ernst Molitor ernst.molitor@uni-bonn.de +Fabian Keil fk at fabiankeil de +Fabio Coatti cova@felix.unife.it +Felix von Leitner leitner@amdiv.de +Frank Heckenbach heckenb@mi.uni-erlangen.de +Frank Stajano frank.stajano@cl.cam.ac.uk +Gabriele Monti psicus78 gmail com +Ga=C3=ABl Qu=C3=A9ri gqueri@mail.dotcom.fr +Gregor Riepl seto-kun@freesurf.ch +Gerlinde Klaes gk@u64.de +Greg Louis glouis@dynamicro.on.ca +Greg Troxel gdt@ir.bbn.com +Gregory Steuck steuck@iname.com +Geoff Keating geoffk@ozemail.com.au +Harald Denker harry@hal.westfalen.de +Hendrik Buschkamp buschkamp@rheumanet.org +Holger Schurig holger@d.om.org +Hugh Daniel hugh@toad.com +Ian McKellar imckellar@harvestroad.com.au +Ian Peters itp@ximian.com +Janusz A. Urbanowicz alex@bofh.torun.pl +James Troup james@nocrew.org +Jean-loup Gailly gzip@prep.ai.mit.edu +Jeff Johnson jbj@redhat.com +Jens Bachem bachem@rrz.uni-koeln.de +J Horacio MG homega@ciberia.es +Joachim Backes backes@rhrk.uni-kl.de +Jordi Mallach jordi@sindominio.net +John A. Martin jam@jamux.com +Johnny Teve=C3=9Fen j.tevessen@gmx.de +J=C3=B6rg Schilling schilling@fokus.gmd.de +Jun Kuriyama kuriyama@sky.rim.or.jp +Karl Fogel kfogel@guanabana.onshore.com +Karsten Thygesen karthy@kom.auc.dk +Katsuhiro Kondou kondou@nec.co.jp +Kazu Yamamoto kazu@iijlab.net +Lars Kellogg-Stedman lars@bu.edu +Lee Fisher blibbet at gmail dot com +Marco d'Itri md@linux.it +Mark Adler madler@alumni.caltech.edu +Mark Elbrecht snowball3@bigfoot.com +Markus Friedl Markus.Friedl@informatik.uni-erlangen.de +Matthias Urlichs smurf@smurf.noris.de +Martin Kahlert martin.kahlert@provi.de +Martin Hamilton +Martin Schulte schulte@thp.uni-koeln.de +Matthew Skala mskala@ansuz.sooke.bc.ca +Max Kellermann max@duempel.org +Max Valianskiy maxcom@maxcom.ml.org +Michael Fischer v. Mollard mfvm@gmx.de +Michael Roth mroth@nessie.de +Michael Sobolev mss@despair.transas.com +Michele Baldessari michele@pupazzo.org +Modestas Vainius geromanas@mailas.com +Neil Dunbar neil.dunbar at pobox.com +Neil Spring nspring@cs.washington.edu +Newton Hammet newton@hammet.net +Nicolas Graner Nicolas.Graner@cri.u-psud.fr +NIIBE Yutaka gniibe@chroot.org +Niklas Hernaeus +Nikolay Sturm sturm@sec.informatik.tu-darmstadt.de +Nikos Mavroyanopoulos nmav@hellug.gr +Nimrod Zimerman zimerman@forfree.at +N J Doye nic@niss.ac.uk +Oliver Haakert haakert@hsp.de +Oskari J=C3=A4=C3=A4skel=C3=A4inen f33003a@cc.hut.fi +Paul D. Smith psmith@baynetworks.com +Philippe Laliberte arsphl@oeil.qc.ca +Peter Gutmann pgut001@cs.auckland.ac.nz +QingLong qinglong@bolizm.ihep.su +Rafael =C3=81vila de Esp=C3=ADndola rafael.espindola@gmail.com +Rafa=C3=ABl Carr=C3=A9 funman@videolan.org +Ralf Fassel ralf@akutech.de +Ralf Hildebrandt Ralf.Hildebrandt@innominate.com +Ralf Schneider ralf@tapfere-schneiderleins.de +Ralph Gillen gillen@theochem.uni-duesseldorf.de +Rami Lehti Rami.Lehti@finland.sun.com +Randolph Chung tausq@debian.org +Randy mcclellr@oit.edu +Rat ratinox@peorth.gweep.net +Reinhard Wobst R.Wobst@ifw-dresden.de +R=C3=A9mi Guyomarch rguyom@mail.dotcom.fr +Reuben Sumner rasumner@wisdom.weizmann.ac.il +Richard Outerbridge outer@interlog.com +Roddy Strachan roddy@satlink.com.au +Roland Rosenfeld roland@spinnaker.rhein.de +Ross Golder rossigee@bigfoot.com +Serge Munhoven munhoven@mema.ucl.ac.be +Sergi Blanch i Torn=C3=A9 sergi at calcurco cat +Simon Josefsson jas@extundo.com +SL Baur steve@xemacs.org +Stephan Austermuehle au@hcsd.de +Stephan M=C3=BCller smueller at atsec com +Stephane Corthesy stephane@sente.ch +Stefan Karrmann S.Karrmann@gmx.net +Stefan Keller dres@cs.tu-berlin.de +Stefan Kr=C3=BCger stadtkind2 at gmx de +Steffen Ullrich ccrlphr@xensei.com +Steffen Zahn zahn@berlin.snafu.de +Steven Bakker steven@icoe.att.com +Susanne Schultz schultz@hsp.de +Sven Bjorn +Szakats Istvan szaki.ms@gmail.com +Thiago Jung Bauermann jungmann@cwb.matrix.com.br +Thomas Roessler roessler@guug.de +Tom Holroyd tomh@po.crl.go.jp +Tom Spindler dogcow@home.merit.edu +Tom Zerucha tzeruch@ceddec.com +Tomas Fasth tomas.fasth@twinspot.net +Tommi Komulainen Tommi.Komulainen@iki.fi +Thomas Mikkelsen tbm@image.dk +Ulf M=C3=B6ller 3umoelle@informatik.uni-hamburg.de +Umberto Salsi salsi@icosaedro.it +Uoti Urpala +Urko Lusa ulusa@euskalnet.net +Victor Stinner haypo@inl.fr +Walter Koch koch@u32.de +Werner Koch wk@gnupg.org +Wim Vandeputte wim@kd85.com + nbecker@hns.com + + + Copyright 1998, 1999, 2000, 2001, 2002, 2003, + 2009, 2011 Free Software Foundation, Inc. + + This file is free software; as a special exception the author gives + unlimited permission to copy and/or distribute it, with or without + modifications, as long as this notice is preserved. + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY, to the extent permitted by law; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/grub-core/lib/libgcrypt/TODO b/grub-core/lib/libgcrypt/TODO new file mode 100644 index 000000000..7aa4de1af --- /dev/null +++ b/grub-core/lib/libgcrypt/TODO @@ -0,0 +1,59 @@ +# What's left to do -*- org -*- + +* Next API break: +** gcry_ac_io_t + Remove use of anonymous union. +** gcry_ac + Consider to remove it. + +* udiv-qrnbd.o should get build as *.lo [HPUX] + +* Allow operation using RSA keys consisting of the OpenSSL keys. + This requires the introduction of a parameter names (say) U which + is calculated according to OpenSSL/PKCS#1 rules. + +* linker script test + Write an autoconf test to check whether the linker supports a + version script.=20 + +* Add attributes to the MPI functions. + +* cipher/pubkey.c and pubkey implementations. + Don't rely on the secure memory based wiping function but add an + extra wiping. +=20=20 +* Use builtin bit functions of gcc 3.4 + +* Consider using a daemon to maintain the random pool + [Partly done] The down side of this is that we can't assume that the + random has has always been stored in "secure memory". And we rely + on that sniffing of Unix domain sockets is not possible. We can + implement this simply by detecting a special prefixed random seed + name and divert in this case to the daemon. There are several + benefits with such an approach: We keep the state of the RNG over + invocations of libgcrypt based applications, don't need time + consuming initialization of the pool and in case the entropy + collectros need to run that bunch of Unix utilities we don't waste + their precious results. + +* gcryptrnd.c + Requires a test for pth [done] as well as some other tests. + +* secmem.c + Check whether the memory block is valid before releasing it and + print a diagnosic, like glibc does. + +* threads +** We need to document fork problems + In particular that reinitialization is required in random.c + However, there is no code yet to do it. + +* Tests + We need a lot more tests. Lets keep an ever growing list here. +** Write tests for the progress function +** mpitests does no real checks yet. +** pthreads + To catch simple errors like the one fixed on 2007-03-16. +** C++ tests + We have some code to allow using libgcrypt from C++, so we also + should have a test case. diff --git a/grub-core/lib/libgcrypt/VERSION b/grub-core/lib/libgcrypt/VERS= ION new file mode 100644 index 000000000..587c5f0c7 --- /dev/null +++ b/grub-core/lib/libgcrypt/VERSION @@ -0,0 +1 @@ +1.10.3 diff --git a/grub-core/lib/libgcrypt/acinclude.m4 b/grub-core/lib/libgcrypt= /acinclude.m4 new file mode 100644 index 000000000..05bf88a79 --- /dev/null +++ b/grub-core/lib/libgcrypt/acinclude.m4 @@ -0,0 +1,392 @@ +dnl macros to configure Libgcrypt +dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, +dnl 2003 Free Software Foundation, Inc. +dnl Copyright (C) 2013 g10 Code GmbH +dnl +dnl This file is part of Libgcrypt. +dnl +dnl Libgcrypt is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU Lesser General Public License as +dnl published by the Free Software Foundation; either version 2.1 of +dnl the License, or (at your option) any later version. +dnl +dnl Libgcrypt is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, = USA + +dnl GCRY_MSG_SHOW(PREFIX,STRING) +dnl Print a message with a prefix. +dnl +define([GCRY_MSG_SHOW], + [ + echo " $1 $2" 1>&AS_MESSAGE_FD([]) + ]) + +dnl GCRY_MSG_WRAP(PREFIX, ALGOLIST) +dnl Print a nicely formatted list of algorithms +dnl with an appropriate line wrap. +dnl +define([GCRY_MSG_WRAP], + [ + tmp=3D" $1" + tmpi=3D"abc" + if test "${#tmpi}" -ne 3 >/dev/null 2>&1 ; then + dnl Without a POSIX shell, we don't botter to wrap it + echo "$tmp $2" 1>&AS_MESSAGE_FD([]) + else + tmpi=3D`echo "$tmp"| sed 's/./ /g'` + echo $2 EOF | tr ' ' '\n' | \ + while read word; do + if test "${#tmp}" -gt 70 ; then + echo "$tmp" 1>&AS_MESSAGE_FD([]) + tmp=3D"$tmpi" + fi + if test "$word" =3D "EOF" ; then + echo "$tmp" 1>&AS_MESSAGE_FD([]) + else + tmp=3D"$tmp $word" + fi + done + fi + ]) + + +dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME) +dnl Check whether a typedef exists and create a #define $2 if it exists +dnl +AC_DEFUN([GNUPG_CHECK_TYPEDEF], + [ AC_MSG_CHECKING(for $1 typedef) + AC_CACHE_VAL(gnupg_cv_typedef_$1, + [AC_TRY_COMPILE([#define _GNU_SOURCE 1 + #include + #include ], [ + #undef $1 + int a =3D sizeof($1); + ], gnupg_cv_typedef_$1=3Dyes, gnupg_cv_typedef_$1=3Dno )]) + AC_MSG_RESULT($gnupg_cv_typedef_$1) + if test "$gnupg_cv_typedef_$1" =3D yes; then + AC_DEFINE($2,1,[Defined if a `]$1[' is typedef'd]) + fi + ]) + + +dnl GNUPG_CHECK_GNUMAKE +dnl +AC_DEFUN([GNUPG_CHECK_GNUMAKE], + [ + if ${MAKE-make} --version 2>/dev/null | grep '^GNU ' >/dev/null 2>&1; = then + : + else + AC_MSG_WARN([[ +*** +*** It seems that you are not using GNU make. Some make tools have serious +*** flaws and you may not be able to build this software at all. Before you +*** complain, please try GNU make: GNU make is easy to build and available +*** at all GNU archives. It is always available from ftp.gnu.org:/gnu/mak= e. +***]]) + fi + ]) + + +# +# GNUPG_SYS_SYMBOL_UNDERSCORE +# Does the compiler prefix global symbols with an underscore? +# +# Taken from GnuPG 1.2 and modified to use the libtool macros. +AC_DEFUN([GNUPG_SYS_SYMBOL_UNDERSCORE], +[tmp_do_check=3D"no" +case "${host}" in + i?86-mingw32* | i?86-*-mingw32*) + ac_cv_sys_symbol_underscore=3Dyes + ;; + x86_64-*-mingw32*) + ac_cv_sys_symbol_underscore=3Dno + ;; + i386-emx-os2 | i[3456]86-pc-os2*emx | i386-pc-msdosdjgpp) + ac_cv_sys_symbol_underscore=3Dyes + ;; + *) + if test "$cross_compiling" !=3D yes; then + tmp_do_check=3D"yes" + fi + ;; +esac +if test "$tmp_do_check" =3D "yes"; then + AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) + AC_MSG_CHECKING([for _ prefix in compiled symbols]) + AC_CACHE_VAL(ac_cv_sys_symbol_underscore, + [ac_cv_sys_symbol_underscore=3Dno + cat > conftest.$ac_ext < $ac_nlist) && test -s "$ac_nlist"; then + # See whether the symbols have a leading underscore. + if egrep '^_nm_test_func' "$ac_nlist" >/dev/null; then + ac_cv_sys_symbol_underscore=3Dyes + else + if egrep '^nm_test_func ' "$ac_nlist" >/dev/null; then + : + else + echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MES= SAGE_LOG_FD + fi + fi + else + echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESS= AGE_LOG_FD + fi + else + echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.c >&AS_MESSAGE_LOG_FD + fi + rm -rf conftest* + ]) + else + AC_MSG_CHECKING([for _ prefix in compiled symbols]) + fi +AC_MSG_RESULT($ac_cv_sys_symbol_underscore) +if test x$ac_cv_sys_symbol_underscore =3D xyes; then + AC_DEFINE(WITH_SYMBOL_UNDERSCORE,1, + [Defined if compiled symbols have a leading underscore]) +fi +]) + + +###################################################################### +# Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock +# is not called from uid 0 (not tested whether uid 0 works) +# For DECs Tru64 we have also to check whether mlock is in librt +# mlock is there a macro using memlk() +###################################################################### +dnl GNUPG_CHECK_MLOCK +dnl +define(GNUPG_CHECK_MLOCK, + [ AC_CHECK_FUNCS(mlock) + if test "$ac_cv_func_mlock" =3D "no"; then + AC_CHECK_HEADERS(sys/mman.h) + if test "$ac_cv_header_sys_mman_h" =3D "yes"; then + # Add librt to LIBS: + AC_CHECK_LIB(rt, memlk) + AC_CACHE_CHECK([whether mlock is in sys/mman.h], + gnupg_cv_mlock_is_in_sys_mman, + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[ + #include + #ifdef HAVE_SYS_MMAN_H + #include + #endif + ]], [[ +int i; + +/* glibc defines this for functions which it implements + * to always fail with ENOSYS. Some functions are actually + * named something starting with __ and the normal name + * is an alias. */ +#if defined (__stub_mlock) || defined (__stub___mlock) +choke me +#else +mlock(&i, 4); +#endif +; return 0; + ]])], + gnupg_cv_mlock_is_in_sys_mman=3Dyes, + gnupg_cv_mlock_is_in_sys_mman=3Dno)]) + if test "$gnupg_cv_mlock_is_in_sys_mman" =3D "yes"; then + AC_DEFINE(HAVE_MLOCK,1, + [Defined if the system supports an mlock() call]) + fi + fi + fi + if test "$ac_cv_func_mlock" =3D "yes"; then + AC_CHECK_FUNCS(sysconf getpagesize) + AC_MSG_CHECKING(whether mlock is broken) + AC_CACHE_VAL(gnupg_cv_have_broken_mlock, + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include +#include +#include +#include +#include + +int main() +{ + char *pool; + int err; + long int pgsize; + +#if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) + pgsize =3D sysconf (_SC_PAGESIZE); +#elif defined (HAVE_GETPAGESIZE) + pgsize =3D getpagesize(); +#else + pgsize =3D -1; +#endif + + if (pgsize =3D=3D -1) + pgsize =3D 4096; + + pool =3D malloc( 4096 + pgsize ); + if( !pool ) + return 2; + pool +=3D (pgsize - ((size_t)pool % pgsize)); + + err =3D mlock( pool, 4096 ); + if( !err || errno =3D=3D EPERM || errno =3D=3D EAGAIN) + return 0; /* okay */ + + return 1; /* hmmm */ +} + ]])], + gnupg_cv_have_broken_mlock=3D"no", + gnupg_cv_have_broken_mlock=3D"yes", + gnupg_cv_have_broken_mlock=3D"assume-no" + ) + ) + if test "$gnupg_cv_have_broken_mlock" =3D "yes"; then + AC_DEFINE(HAVE_BROKEN_MLOCK,1, + [Defined if the mlock() call does not work]) + AC_MSG_RESULT(yes) + else + if test "$gnupg_cv_have_broken_mlock" =3D "no"; then + AC_MSG_RESULT(no) + else + AC_MSG_RESULT(assuming no) + fi + fi + fi + ]) + +# GNUPG_SYS_LIBTOOL_CYGWIN32 - find tools needed on cygwin32 +AC_DEFUN([GNUPG_SYS_LIBTOOL_CYGWIN32], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +AC_CHECK_TOOL(AS, as, false) +]) + +dnl LIST_MEMBER() +dnl Check whether an element ist contained in a list. Set `found' to +dnl `1' if the element is found in the list, to `0' otherwise. +AC_DEFUN([LIST_MEMBER], +[ +name=3D$1 +list=3D$2 +found=3D0 + +for n in $list; do + if test "x$name" =3D "x$n"; then + found=3D1 + fi +done +]) + + +dnl Check for socklen_t: historically on BSD it is an int, and in +dnl POSIX 1g it is a type of its own, but some platforms use different +dnl types for the argument to getsockopt, getpeername, etc. So we +dnl have to test to find something that will work. +AC_DEFUN([TYPE_SOCKLEN_T], +[ + AC_CHECK_TYPE([socklen_t], ,[ + AC_MSG_CHECKING([for socklen_t equivalent]) + AC_CACHE_VAL([socklen_t_equiv], + [ + # Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + socklen_t_equiv=3D + for arg2 in "struct sockaddr" void; do + for t in int size_t unsigned long "unsigned long"; do + AC_TRY_COMPILE([ +#include +#include + +int getpeername (int, $arg2 *, $t *); + ],[ + $t len; + getpeername(0,0,&len); + ],[ + socklen_t_equiv=3D"$t" + break + ]) + done + done + + if test "x$socklen_t_equiv" =3D x; then + AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) + fi + ]) + AC_MSG_RESULT($socklen_t_equiv) + AC_DEFINE_UNQUOTED(socklen_t, $socklen_t_equiv, + [type to use in place of socklen_t if not defined])], + [#include +#include ]) +]) + + +# GNUPG_PTH_VERSION_CHECK(REQUIRED) +# +# If the version is sufficient, HAVE_PTH will be set to yes. +# +# Taken form the m4 macros which come with Pth +AC_DEFUN([GNUPG_PTH_VERSION_CHECK], + [ + _pth_version=3D`$PTH_CONFIG --version | awk 'NR=3D=3D1 {print [$]3}'` + _req_version=3D"ifelse([$1],,1.2.0,$1)" + + AC_MSG_CHECKING(for PTH - version >=3D $_req_version) + for _var in _pth_version _req_version; do + eval "_val=3D\"\$${_var}\"" + _major=3D`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\= )\([[0-9]]*\)/\1/'` + _minor=3D`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\= )\([[0-9]]*\)/\2/'` + _rtype=3D`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\= )\([[0-9]]*\)/\3/'` + _micro=3D`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\= )\([[0-9]]*\)/\4/'` + case $_rtype in + "a" ) _rtype=3D0 ;; + "b" ) _rtype=3D1 ;; + "." ) _rtype=3D2 ;; + esac + _hex=3D`echo dummy | awk '{ printf("%d%02d%1d%02d", major, minor, = rtype, micro); }' \ + "major=3D$_major" "minor=3D$_minor" "rtype=3D$_rtype" "micro= =3D$_micro"` + eval "${_var}_hex=3D\"\$_hex\"" + done + have_pth=3Dno + if test ".$_pth_version_hex" !=3D .; then + if test ".$_req_version_hex" !=3D .; then + if test $_pth_version_hex -ge $_req_version_hex; then + have_pth=3Dyes + fi + fi + fi + if test $have_pth =3D yes; then + AC_MSG_RESULT(yes) + AC_MSG_CHECKING([whether PTH installation is sane]) + AC_CACHE_VAL(gnupg_cv_pth_is_sane,[ + _gnupg_pth_save_cflags=3D$CFLAGS + _gnupg_pth_save_ldflags=3D$LDFLAGS + _gnupg_pth_save_libs=3D$LIBS + CFLAGS=3D"$CFLAGS `$PTH_CONFIG --cflags`" + LDFLAGS=3D"$LDFLAGS `$PTH_CONFIG --ldflags`" + LIBS=3D"$LIBS `$PTH_CONFIG --libs`" + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include + ], + [[ pth_init ();]])], + gnupg_cv_pth_is_sane=3Dyes, + gnupg_cv_pth_is_sane=3Dno) + CFLAGS=3D$_gnupg_pth_save_cflags + LDFLAGS=3D$_gnupg_pth_save_ldflags + LIBS=3D$_gnupg_pth_save_libs + ]) + if test $gnupg_cv_pth_is_sane !=3D yes; then + have_pth=3Dno + fi + AC_MSG_RESULT($gnupg_cv_pth_is_sane) + else + AC_MSG_RESULT(no) + fi + ]) diff --git a/grub-core/lib/libgcrypt/aclocal.m4 b/grub-core/lib/libgcrypt/a= clocal.m4 new file mode 100644 index 000000000..67d20cec8 --- /dev/null +++ b/grub-core/lib/libgcrypt/aclocal.m4 @@ -0,0 +1,1216 @@ +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4= _defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. +You have another version of autoconf. It may work, but is not guaranteed = to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreco= nf'.])]) + +# Copyright (C) 2002-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version=3D'1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.16.5], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.16.5])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# Figure out how to run the assembler. -*- Autoconf -= *- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_AS +# ---------- +AC_DEFUN([AM_PROG_AS], +[# By default we simply use the C compiler to build assembly code. +AC_REQUIRE([AC_PROG_CC]) +test "${CCAS+set}" =3D set || CCAS=3D$CC +test "${CCASFLAGS+set}" =3D set || CCASFLAGS=3D$CFLAGS +AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) +AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl +]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -= *- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir=3D'\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING=3D"\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=3D`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -= *- + +# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE=3D + $1_FALSE=3D'#' +else + $1_TRUE=3D'#' + $1_FALSE=3D +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc=3D"$CC" am_compiler_list=3D], + [$1], [CXX], [depcc=3D"$CXX" am_compiler_list=3D], + [$1], [OBJC], [depcc=3D"$OBJC" am_compiler_list=3D'gcc3 gcc'], + [$1], [OBJCXX], [depcc=3D"$OBJCXX" am_compiler_list=3D'gcc3 gcc'], + [$1], [UPC], [depcc=3D"$UPC" am_compiler_list=3D], + [$1], [GCJ], [depcc=3D"$GCJ" am_compiler_list=3D'gcc3 gcc'], + [depcc=3D"$$1" am_compiler_list=3D]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=3Dnone + if test "$am_compiler_list" =3D ""; then + am_compiler_list=3D`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depco= mp` + fi + am__universal=3Dfalse + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=3Dtrue ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=3Dtrue ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=3Dsub/conftest.${OBJEXT-o} + am__minus_obj=3D"-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" =3D false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" =3D xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=3Dconftest.${OBJEXT-o} + am__minus_obj=3D + ;; + none) break ;; + esac + if depmode=3D$depmode \ + source=3Dsub/conftest.c object=3D$am__obj \ + depfile=3Dsub/conftest.Po tmpdepfile=3Dsub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument req= uired + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=3D$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=3Dnone +fi +]) +AC_SUBST([$1DEPMODE], [depmode=3D$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" !=3D xno \ + && test "$am_cv_$1_dependencies_compiler_type" =3D gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" !=3D xno; then + am_depcomp=3D"$ac_aux_dir/depcomp" + AMDEPBACKSLASH=3D'\' + am__nodep=3D'_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" !=3D xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -= *- + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=3D0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=3D`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=3D`AS_DIRNAME(["$am_mf"])` + am_filepart=3D`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=3D$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=3D"gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking)= .]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" !=3D x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE=3D"$AMDEP_TRUE" MAKE=3D"${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -= *- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" !=3D "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) !=3D ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean= " there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W=3D'cygpath -w' + else + CYGPATH_W=3Decho + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])= ])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])]= )dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=3Dctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=3Detags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=3Dcscope +fi +AC_SUBST([CSCOPE]) + +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contra= ry +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" =3D x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=3D$1 +_am_stamp_count=3D1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=3D`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_st= amp_count]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" !=3D xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh=3D"\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh=3D"\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=3D. +else + am__leading_dot=3D_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -= *- +# From Jim Meyering + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: = $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefil= es]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=3D$enableval], + [USE_MAINTAINER_MODE=3D]m4_if(am_maintainer_other, [enable], [no], [ye= s])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE =3D yes]) + MAINT=3D$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include=3D"#" +am__quote=3D +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=3Dno +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include=3D'.include' am__quote=3D'"'], + [am__include=3D'include' am__quote=3D''])]) + if test "$am__include" !=3D "#"; then + _am_result=3D"yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -= *- + +# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=3D${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" !=3D xset; then + MISSING=3D"\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run=3D"$MISSING " +else + am_missing_run=3D + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -= *- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this opt= ion. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=3Dyes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=3Dno + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" !=3D yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC=3D"\$(top_srcdir)/compile \$(CC)" + CC=3D"$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=3D$? + echo "$as_me:$LINENO: \$? =3D $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -= *- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=3D' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=3Dno + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" =3D "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" !=3D "X $srcdir/configure conftest.file" \ + && test "$[*]" !=3D "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" =3D conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=3Dyes + done + test "$[2]" =3D conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status= and +# generated files are strictly newer. +am_sleep_pid=3D +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=3D$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=3D1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=3D0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=3D0;; + no) AM_DEFAULT_VERBOSITY=3D1;; + *) AM_DEFAULT_VERBOSITY=3Dm4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=3D${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=3D$(BAR$(V)) +BAR0=3Dfalse +BAR1=3Dtrue +V=3D1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=3Dyes +else + am_cv_make_support_nested_variables=3Dno +fi]) +if test $am_cv_make_support_nested_variables =3D yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V=3D'$(V)' + AM_DEFAULT_V=3D'$(AM_DEFAULT_VERBOSITY)' +else + AM_V=3D$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=3D$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH=3D'\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling =3D yes, because it might be 'maybe'. +if test "$cross_compiling" !=3D no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM=3D"\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE =3D @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -= *- + +# Copyright (C) 2004-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=3Ddirectory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one work= s. +_am_tools=3D'gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar=3D'$${TAR-tar} chof - "$$tardir"' am__untar=3D'$${TAR-tar} xf -= '], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=3D2097151 # 2^21 - 1 + am_max_gid=3D$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=3D`id -u || echo unknown` + am_gid=3D`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=3Dnone + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=3Dnone + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=3D${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar=3D"$_am_tar --format=3Dm4_if([$1], [pax], [posix], [$1]) -ch= f - "'"$$tardir"' + am__tar_=3D"$_am_tar --format=3Dm4_if([$1], [pax], [posix], [$1]) -c= hf - "'"$tardir"' + am__untar=3D"$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format=3D it doesn't c= reate + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar=3D'tar chf - "$$tardir"' + am__tar_=3D'tar chf - "$tardir"' + am__untar=3D'tar xf -' + ;; + pax) + am__tar=3D'pax -L -x $1 -w "$$tardir"' + am__tar_=3D'pax -L -x $1 -w "$tardir"' + am__untar=3D'pax -r' + ;; + cpio) + am__tar=3D'find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_=3D'find "$tardir" -print | cpio -o -H $1 -L' + am__untar=3D'cpio -i -H $1 -d' + ;; + none) + am__tar=3Dfalse + am__tar_=3Dfalse + am__untar=3Dfalse + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=3Dconftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=3D$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/ax_cc_for_build.m4]) +m4_include([m4/gpg-error.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) +m4_include([m4/noexecstack.m4]) +m4_include([m4/socklen.m4]) +m4_include([acinclude.m4]) diff --git a/grub-core/lib/libgcrypt/autogen.rc b/grub-core/lib/libgcrypt/a= utogen.rc new file mode 100644 index 000000000..646f659cc --- /dev/null +++ b/grub-core/lib/libgcrypt/autogen.rc @@ -0,0 +1,13 @@ +# autogen.sh configuration for Libgcrypt -*- sh -*- + +case "$myhost" in + w32) + configure_opts=3D"" + ;; + + amd64) + configure_opts=3D"" + ;; +esac + +final_info=3D"./configure --enable-maintainer-mode && make" diff --git a/grub-core/lib/libgcrypt/autogen.sh b/grub-core/lib/libgcrypt/a= utogen.sh new file mode 100755 index 000000000..9b3615812 --- /dev/null +++ b/grub-core/lib/libgcrypt/autogen.sh @@ -0,0 +1,513 @@ +#! /bin/sh +# autogen.sh +# Copyright (C) 2003, 2014, 2017, 2018 g10 Code GmbH +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# This is a generic script to create the configure script and handle cross +# build environments. It requires the presence of a autogen.rc file to +# configure it for the respective package. It is maintained as part of +# GnuPG and source copied by other packages. +# +# Version: 2018-07-10 + +configure_ac=3D"configure.ac" + +cvtver () { + awk 'NR=3D=3D1 {split($NF,A,".");X=3D1000000*A[1]+1000*A[2]+A[3];print X= ;exit 0}' +} + +check_version () { + if [ $(( `("$1" --version || echo "0") | cvtver` >=3D $2 )) =3D 1 ]; t= hen + return 0 + fi + echo "**Error**: "\`$1\'" not installed or too old." >&2 + echo ' Version '$3' or newer is required.' >&2 + [ -n "$4" ] && echo ' Note that this is part of '\`$4\''.' >= &2 + DIE=3D"yes" + return 1 +} + +fatal () { + echo "autogen.sh:" "$*" >&2 + DIE=3Dyes +} + +info () { + if [ -z "${SILENT}" ]; then + echo "autogen.sh:" "$*" >&2 + fi +} + +die_p () { + if [ "$DIE" =3D "yes" ]; then + echo "autogen.sh: Stop." >&2 + exit 1 + fi +} + +replace_sysroot () { + configure_opts=3D$(echo $configure_opts | sed "s#@SYSROOT@#${w32root}#= g") + extraoptions=3D$(echo $extraoptions | sed "s#@SYSROOT@#${w32root}#g") +} + +# Allow to override the default tool names +AUTOCONF=3D${AUTOCONF_PREFIX}${AUTOCONF:-autoconf}${AUTOCONF_SUFFIX} +AUTOHEADER=3D${AUTOCONF_PREFIX}${AUTOHEADER:-autoheader}${AUTOCONF_SUFFIX} + +AUTOMAKE=3D${AUTOMAKE_PREFIX}${AUTOMAKE:-automake}${AUTOMAKE_SUFFIX} +ACLOCAL=3D${AUTOMAKE_PREFIX}${ACLOCAL:-aclocal}${AUTOMAKE_SUFFIX} + +GETTEXT=3D${GETTEXT_PREFIX}${GETTEXT:-gettext}${GETTEXT_SUFFIX} +MSGMERGE=3D${GETTEXT_PREFIX}${MSGMERGE:-msgmerge}${GETTEXT_SUFFIX} + +DIE=3Dno +FORCE=3D +SILENT=3D +PRINT_HOST=3Dno +PRINT_BUILD=3Dno +tmp=3D$(dirname "$0") +tsdir=3D$(cd "${tmp}"; pwd) + +if [ -n "${AUTOGEN_SH_SILENT}" ]; then + SILENT=3D" --silent" +fi +if test x"$1" =3D x"--help"; then + echo "usage: ./autogen.sh [OPTIONS] [ARGS]" + echo " Options:" + echo " --silent Silent operation" + echo " --force Pass --force to autoconf" + echo " --find-version Helper for configure.ac" + echo " --git-build Run all commands to build from a Git" + echo " --print-host Print only the host triplet" + echo " --print-build Print only the build platform triplet" + echo " --build-TYPE Configure to cross build for TYPE" + echo "" + echo " ARGS are passed to configure in --build-TYPE mode." + echo " Configuration for this script is expected in autogen.rc" + exit 0 +fi +if test x"$1" =3D x"--silent"; then + SILENT=3D" --silent" + shift +fi +if test x"$1" =3D x"--force"; then + FORCE=3D" --force" + shift +fi +if test x"$1" =3D x"--print-host"; then + PRINT_HOST=3Dyes + shift +fi +if test x"$1" =3D x"--print-build"; then + PRINT_BUILD=3Dyes + shift +fi + + +# Reject unsafe characters in $HOME, $tsdir and cwd. We consider spaces +# as unsafe because it is too easy to get scripts wrong in this regard. +am_lf=3D' +' +case `pwd` in + *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*) + fatal "unsafe working directory name" ;; +esac +case $tsdir in + *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*) + fatal "unsafe source directory: \`$tsdir'" ;; +esac +case $HOME in + *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*) + fatal "unsafe home directory: \`$HOME'" ;; +esac +die_p + + +# List of variables sourced from autogen.rc. The strings '@SYSROOT@' in +# these variables are replaced by the actual system root. +configure_opts=3D +extraoptions=3D +# List of optional variables sourced from autogen.rc and ~/.gnupg-autogen.= rc +w32_toolprefixes=3D +w32_extraoptions=3D +w32ce_toolprefixes=3D +w32ce_extraoptions=3D +w64_toolprefixes=3D +w64_extraoptions=3D +amd64_toolprefixes=3D +# End list of optional variables sourced from ~/.gnupg-autogen.rc +# What follows are variables which are sourced but default to +# environment variables or lacking them hardcoded values. +#w32root=3D +#w32ce_root=3D +#w64root=3D +#amd64root=3D + +# Convenience option to use certain configure options for some hosts. +myhost=3D"" +myhostsub=3D"" +case "$1" in + --find-version) + myhost=3D"find-version" + SILENT=3D" --silent" + shift + ;; + --git-build) + myhost=3D"git-build" + shift + ;; + --build-w32) + myhost=3D"w32" + shift + ;; + --build-w32ce) + myhost=3D"w32" + myhostsub=3D"ce" + shift + ;; + --build-w64) + myhost=3D"w32" + myhostsub=3D"64" + shift + ;; + --build-amd64) + myhost=3D"amd64" + shift + ;; + --build*) + fatal "**Error**: invalid build option $1" + shift + ;; + *) + ;; +esac +die_p + + +# **** GIT BUILD **** +# This is a helper to build from git. +if [ "$myhost" =3D "git-build" ]; then + tmp=3D"$(pwd)" + cd "$tsdir" || fatal "error cd-ing to $tsdir" + ./autogen.sh || fatal "error running ./autogen.sh" + cd "$tmp" || fatal "error cd-ing back to $tmp" + die_p + "$tsdir"/configure || fatal "error running $tsdir/configure" + die_p + make || fatal "error running make" + die_p + make check || fatal "error running male check" + die_p + exit 0 +fi +# **** end GIT BUILD **** + + +# Source our configuration +if [ -f "${tsdir}/autogen.rc" ]; then + . "${tsdir}/autogen.rc" +fi + +# Source optional site specific configuration +if [ -f "$HOME/.gnupg-autogen.rc" ]; then + info "sourcing extra definitions from $HOME/.gnupg-autogen.rc" + . "$HOME/.gnupg-autogen.rc" +fi + + +# **** FIND VERSION **** +# This is a helper for the configure.ac M4 magic +# Called +# ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO] +# returns a complete version string with automatic beta numbering. +if [ "$myhost" =3D "find-version" ]; then + package=3D"$1" + major=3D"$2" + minor=3D"$3" + micro=3D"$4" + + if [ -z "$package" -o -z "$major" -o -z "$minor" ]; then + echo "usage: ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO]= " >&2 + exit 1 + fi + + if [ -z "$micro" ]; then + matchstr1=3D"$package-$major.[0-9]*" + matchstr2=3D"$package-$major-base" + vers=3D"$major.$minor" + else + matchstr1=3D"$package-$major.$minor.[0-9]*" + matchstr2=3D"$package-$major.$minor-base" + vers=3D"$major.$minor.$micro" + fi + + beta=3Dno + if [ -e .git ]; then + ingit=3Dyes + tmp=3D$(git describe --match "${matchstr1}" --long 2>/dev/null) + tmp=3D$(echo "$tmp" | sed s/^"$package"//) + if [ -n "$tmp" ]; then + tmp=3D$(echo "$tmp" | sed s/^"$package"// \ + | awk -F- '$3!=3D0 && $3 !~ /^beta/ {print"-beta"$3}') + else + tmp=3D$(git describe --match "${matchstr2}" --long 2>/dev/null \ + | awk -F- '$4!=3D0{print"-beta"$4}') + fi + [ -n "$tmp" ] && beta=3Dyes + rev=3D$(git rev-parse --short HEAD | tr -d '\n\r') + rvd=3D$((0x$(echo ${rev} | dd bs=3D1 count=3D4 2>/dev/null))) + else + ingit=3Dno + beta=3Dyes + tmp=3D"-unknown" + rev=3D"0000000" + rvd=3D"0" + fi + + echo "$package-$vers$tmp:$beta:$ingit:$vers$tmp:$vers:$tmp:$rev:$rvd:" + exit 0 +fi +# **** end FIND VERSION **** + + +if [ ! -f "$tsdir/build-aux/config.guess" ]; then + fatal "$tsdir/build-aux/config.guess not found" + exit 1 +fi +build=3D`$tsdir/build-aux/config.guess` +if [ $PRINT_BUILD =3D yes ]; then + echo "$build" + exit 0 +fi + + + +# ****************** +# W32 build script +# ****************** +if [ "$myhost" =3D "w32" ]; then + case $myhostsub in + ce) + w32root=3D"$w32ce_root" + [ -z "$w32root" ] && w32root=3D"$HOME/w32ce_root" + toolprefixes=3D"$w32ce_toolprefixes arm-mingw32ce" + extraoptions=3D"$extraoptions $w32ce_extraoptions" + ;; + 64) + w32root=3D"$w64root" + [ -z "$w32root" ] && w32root=3D"$HOME/w64root" + toolprefixes=3D"$w64_toolprefixes x86_64-w64-mingw32" + extraoptions=3D"$extraoptions $w64_extraoptions" + ;; + *) + [ -z "$w32root" ] && w32root=3D"$HOME/w32root" + toolprefixes=3D"$w32_toolprefixes i686-w64-mingw32 i586-mingw32m= svc" + toolprefixes=3D"$toolprefixes i386-mingw32msvc mingw32" + extraoptions=3D"$extraoptions $w32_extraoptions" + ;; + esac + info "Using $w32root as standard install directory" + replace_sysroot + + # Locate the cross compiler + crossbindir=3D + for host in $toolprefixes; do + if ${host}-gcc --version >/dev/null 2>&1 ; then + crossbindir=3D/usr/${host}/bin + conf_CC=3D"CC=3D${host}-gcc" + break; + fi + done + if [ -z "$crossbindir" ]; then + fatal "cross compiler kit not installed" + if [ -z "$myhostsub" ]; then + info "Under Debian GNU/Linux, you may install it using" + info " apt-get install mingw32 mingw32-runtime mingw32-binutils" + fi + die_p + fi + if [ $PRINT_HOST =3D yes ]; then + echo "$host" + exit 0 + fi + + if [ -f "$tsdir/config.log" ]; then + if ! head $tsdir/config.log | grep "$host" >/dev/null; then + fatal "Please run a 'make distclean' first" + die_p + fi + fi + + $tsdir/configure --enable-maintainer-mode ${SILENT} \ + --prefix=3D${w32root} \ + --host=3D${host} --build=3D${build} SYSROOT=3D${w32root} \ + PKG_CONFIG_LIBDIR=3D${w32root}/lib/pkgconfig \ + ${configure_opts} ${extraoptions} "$@" + rc=3D$? + exit $rc +fi +# ***** end W32 build script ******* + +# ***** AMD64 cross build script ******* +# Used to cross-compile for AMD64 (for testing) +if [ "$myhost" =3D "amd64" ]; then + [ -z "$amd64root" ] && amd64root=3D"$HOME/amd64root" + info "Using $amd64root as standard install directory" + replace_sysroot + + toolprefixes=3D"$amd64_toolprefixes x86_64-linux-gnu amd64-linux-gnu" + + # Locate the cross compiler + crossbindir=3D + for host in $toolprefixes ; do + if ${host}-gcc --version >/dev/null 2>&1 ; then + crossbindir=3D/usr/${host}/bin + conf_CC=3D"CC=3D${host}-gcc" + break; + fi + done + if [ -z "$crossbindir" ]; then + echo "Cross compiler kit not installed" >&2 + echo "Stop." >&2 + exit 1 + fi + if [ $PRINT_HOST =3D yes ]; then + echo "$host" + exit 0 + fi + + if [ -f "$tsdir/config.log" ]; then + if ! head $tsdir/config.log | grep "$host" >/dev/null; then + echo "Please run a 'make distclean' first" >&2 + exit 1 + fi + fi + + $tsdir/configure --enable-maintainer-mode ${SILENT} \ + --prefix=3D${amd64root} \ + --host=3D${host} --build=3D${build} \ + ${configure_opts} ${extraoptions} "$@" + rc=3D$? + exit $rc +fi +# ***** end AMD64 cross build script ******* + + +# Grep the required versions from configure.ac +autoconf_vers=3D`sed -n '/^AC_PREREQ(/ { +s/^.*(\(.*\))/\1/p +q +}' ${configure_ac}` +autoconf_vers_num=3D`echo "$autoconf_vers" | cvtver` + +automake_vers=3D`sed -n '/^min_automake_version=3D/ { +s/^.*=3D"\(.*\)"/\1/p +q +}' ${configure_ac}` +automake_vers_num=3D`echo "$automake_vers" | cvtver` + +if [ -d "${tsdir}/po" ]; then + gettext_vers=3D`sed -n '/^AM_GNU_GETTEXT_VERSION(/ { +s/^.*\[\(.*\)])/\1/p +q +}' ${configure_ac}` + gettext_vers_num=3D`echo "$gettext_vers" | cvtver` +else + gettext_vers=3D"n/a" +fi + +if [ -z "$autoconf_vers" -o -z "$automake_vers" -o -z "$gettext_vers" ] +then + echo "**Error**: version information not found in "\`${configure_ac}\'".= " >&2 + exit 1 +fi + + +if check_version $AUTOCONF $autoconf_vers_num $autoconf_vers ; then + check_version $AUTOHEADER $autoconf_vers_num $autoconf_vers autoconf +fi +if check_version $AUTOMAKE $automake_vers_num $automake_vers; then + check_version $ACLOCAL $automake_vers_num $autoconf_vers automake +fi +if [ "$gettext_vers" !=3D "n/a" ]; then + if check_version $GETTEXT $gettext_vers_num $gettext_vers; then + check_version $MSGMERGE $gettext_vers_num $gettext_vers gettext + fi +fi + +if [ "$DIE" =3D "yes" ]; then + cat </dev/null 2>/dev/null; then + [ -z "${SILENT}" ] && CP=3D"$CP -v" + fi + if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; t= hen + [ -z "${SILENT}" ] && cat < + + NB: ChangeLog files are no longer manually maintained. Starting + on December 1st, 2011 we put change information only in the GIT + commit log, and generate a top-level ChangeLog file from logs at + "make dist". See doc/HACKING for details. + +2003-12-08 Werner Koch + + * autogen.sh, config.sub, install-sh, mkinstalldirs, config.guess, + * missing: Removed + +2003-10-31 Werner Koch + + * autogen.sh: Allow to override the tool name. Do not run + libtoolize. Update required version numbers. + +2003-07-30 Werner Koch + + * config.guess, config.sub: Updated from ftp.gnu.org/gnu/config/ + +2003-07-07 Moritz Schulte + + * autogen.sh: Undo last change. + * autogen.sh: Remove -a argument for automake. + +2003-03-06 Moritz Schulte + + * autogen.sh (run): New function. + Let automake run with -a for adding missing files automatically + +2002-11-12 Werner Koch + + * config.sub, config.guess: Updated from ftp.gnu.org/gnu/config + to version 2002-11-08. + +2002-05-14 Werner Koch + + * autogen.sh: Require version 2.53 of autoconf + +2001-12-18 Werner Koch + + * distfiles: Remove files which are automatically added by automake. + +2001-08-06 Werner Koch + + * autogen.sh: Added --build-w32 option. + +2001-05-28 Werner Koch + + * db2html.in: Removed. + * db2any: New. Taken from GPH + +Mon Jul 17 16:35:47 CEST 2000 Werner Koch + + * config.gues, config.sub: Support for s390-ibm-linux-gnu; thanks + to Holger Smolinski. Add support for QNX; by Sam Roberts. + +Tue Oct 26 14:10:21 CEST 1999 Werner Koch + + * commit: Remove leading and trailing empty lines when copying + Changes to Changelog + +Wed Sep 15 16:22:17 CEST 1999 Werner Koch + + * gnupg.spec: Add Portuguese description + +Thu Sep 2 16:40:55 CEST 1999 Werner Koch + + * mkdiff: changed format of diff file name and made script more + general. + +Wed Aug 4 10:34:18 CEST 1999 Werner Koch + + * config.guess: Updated from gnu/common and applied my emx patch again. + * config.sub: Updated from gnu/common. + +Wed Jul 14 19:42:08 CEST 1999 Werner Koch + + * ltmain.sh, ltconfig.sh : Updated to libtool 1.3.3 + +Mon Jul 12 14:55:34 CEST 1999 Werner Koch + + * autogen.sh: Run libtoolize + +Sat May 22 22:47:26 CEST 1999 Werner Koch + + * autogen.sh: Fixed the error message for a missing libtool. + +Sat May 8 19:28:08 CEST 1999 Werner Koch + + * mkinstalldirs, install-sh: New from GNU repository + * config.sub, config.guess: Merged with rep version. + +Sun Mar 14 19:34:36 CET 1999 Werner Koch + + * autogen.sh: Add a check for libtool because some autoconf macros + are needed. + +Mon Feb 22 20:04:00 CET 1999 Werner Koch + + * autogen.sh: Enhanced the version testing code (Philippe Laliberte) + + * mkwebpage: Edits the buglist. + +Sat Feb 13 12:04:43 CET 1999 Werner Koch + + * autogen.sh: Now uses gettextize + +Wed Feb 10 17:15:39 CET 1999 Werner Koch + + * config.sub, config.guess: Support i386-emx-os2 + +Sun Jan 17 11:04:33 CET 1999 Werner Koch + + * autogen.sh: Now checks for installed gettext + +Sat Jan 16 09:27:30 CET 1999 Werner Koch + + * config.guess (m68k-atari-mint): New. + * config.sub: Add support for atarist-MiNT + +Wed Jan 13 12:49:36 CET 1999 Werner Koch + + * gnupg.spec.in: New + * gnupg.spec: Removed + +Wed Dec 23 13:18:14 CET 1998 Werner Koch + + * gnupg.spec: Updated version by Fabio Coatti + +Thu Dec 17 18:31:15 CET 1998 Werner Koch + + * gnupg.spec: New version by Reuben Sumner and did some more + changes. + +Fri Nov 27 12:39:29 CET 1998 Werner Koch + + + * commit: New + + +Fri Nov 20 12:01:57 1998 Werner Koch (wk@isil.d.shuttle.de) + + * mkdiff: signs the patch file + +Sat Oct 17 16:10:16 1998 Werner Koch (wk@isil.d.shuttle.de) + + * autogen.sh: New. + +Wed Oct 14 09:55:25 1998 Werner Koch (wk@isil.d.shuttle.de) + + * config.guess (FreeBSD): Changes from Jun Kuriyama to support ELF + * config.sub: (freebsd): Add to maybe_os + + + Copyright 1998,1999,2000,2001,2002 Free Software Foundation, Inc. + + This file is free software; as a special exception the author gives + unlimited permission to copy and/or distribute it, with or without + modifications, as long as this notice is preserved. + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY, to the extent permitted by law; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Local Variables: +buffer-read-only: t +End: diff --git a/grub-core/lib/libgcrypt/build-aux/compile b/grub-core/lib/libg= crypt/build-aux/compile new file mode 100755 index 000000000..531136b06 --- /dev/null +++ b/grub-core/lib/libgcrypt/build-aux/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=3D2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=3D' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=3D" "" $nl" + +file_conv=3D + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=3D$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=3Dmingw + ;; + CYGWIN*) + file_conv=3Dcygwin + ;; + *) + file_conv=3Dwine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=3D`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=3D`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=3D`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=3D$file + else + lib_path=3D"$lib_path;$file" + fi + linker_opts=3D"$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=3D$1 + found=3Dno + save_IFS=3D$IFS + IFS=3D';' + for dir in $lib_path $LIB + do + IFS=3D$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=3Dyes + lib=3D$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=3Dyes + lib=3D$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=3Dyes + lib=3D$dir/lib$lib.a + break + fi + done + IFS=3D$save_IFS + + if test "$found" !=3D yes; then + lib=3D$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path=3D + shared=3D: + linker_opts=3D + for arg + do + if test -n "$eat"; then + eat=3D + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=3D1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=3D1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=3D1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=3D1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=3Dfalse + ;; + -Wl,*) + arg=3D${1#-Wl,} + save_ifs=3D"$IFS"; IFS=3D',' + for flag in $arg; do + IFS=3D"$save_ifs" + linker_opts=3D"$linker_opts $flag" + done + IFS=3D"$save_ifs" + ;; + -Xlinker) + eat=3D1 + linker_opts=3D"$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts=3D"-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat=3D + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile=3D +cfile=3D + +for arg +do + if test -n "$eat"; then + eat=3D + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=3D1 + case $2 in + *.o | *.obj) + ofile=3D$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=3D$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=3D`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=3D`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=3D$? + +if test -f "$cofile"; then + test "$cofile" =3D "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" =3D "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=3D" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/grub-core/lib/libgcrypt/build-aux/config.guess b/grub-core/lib= /libgcrypt/build-aux/config.guess new file mode 100755 index 000000000..c4bd827a7 --- /dev/null +++ b/grub-core/lib/libgcrypt/build-aux/config.guess @@ -0,0 +1,1456 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2016 Free Software Foundation, Inc. + +timestamp=3D'2016-05-15' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=3Dconfig.git;a=3Dblob_plain;f=3Dco= nfig.guess +# +# Please send patches to . + + +me=3D`echo "$0" | sed -e 's,.*/,,'` + +usage=3D"\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version=3D"\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2016 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE= ." + +help=3D" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# !=3D 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=3D' +trap "exitcode=3D\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/nu= ll) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 1= 3 15 ; +: ${TMPDIR=3D/tmp} ; + { tmp=3D`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test= -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=3D$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir = $tmp) ; } || + { tmp=3D$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: crea= ting insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1= ; } ; +dummy=3D$tmp/dummy ; +tmpfiles=3D"$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD=3D"$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" =3D x ; then + CC_FOR_BUILD=3Dno_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=3D$CC ;; + ,*,*) CC_FOR_BUILD=3D$HOST_CC ;; +esac ; set_cc_for_build=3D ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD univer= se. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=3D$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=3D`(uname -m) 2>/dev/null` || UNAME_MACHINE=3Dunknown +UNAME_RELEASE=3D`(uname -r) 2>/dev/null` || UNAME_RELEASE=3Dunknown +UNAME_SYSTEM=3D`(uname -s) 2>/dev/null` || UNAME_SYSTEM=3Dunknown +UNAME_VERSION=3D`(uname -v) 2>/dev/null` || UNAME_VERSION=3Dunknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=3Dgnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=3Duclibc + #elif defined(__dietlibc__) + LIBC=3Ddietlibc + #else + LIBC=3Dgnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" = in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl=3D"sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=3D`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=3Darmeb-unknown ;; + arm*) machine=3Darm-unknown ;; + sh3el) machine=3Dshl-unknown ;; + sh3eb) machine=3Dsh-unknown ;; + sh5el) machine=3Dsh5le-unknown ;; + earmv*) + arch=3D`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=3D`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=3D${arch}${endian}-unknown + ;; + *) machine=3D${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "${UNAME_MACHINE_ARCH}" in + earm*) + os=3Dnetbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout= ). + # Return netbsd for either. FIX? + os=3Dnetbsd + else + os=3Dnetbsdelf + fi + ;; + *) + os=3Dnetbsd + ;; + esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr=3D's/^earmv[0-9]/-eabi/;s/eb$//' + abi=3D`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release=3D'-gnu' + ;; + *) + release=3D`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}${abi}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=3D`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=3D`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=3D`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=3D`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=3D`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=3D`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\)= processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=3Dalpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=3Dalpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=3Dalpha ;; + "EV5 (21164)") + UNAME_MACHINE=3Dalphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=3Dalphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=3Dalphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=3Dalphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=3Dalphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=3Dalphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=3Dalphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=3Dalphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=3Dalphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=3Dalphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=3Dalphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=3Dalphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//= ' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=3D$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" =3D att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*/= /'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH=3Di386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" !=3D no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS=3D"" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=3Dx86_64 + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=3D`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=3D`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev= /null` + test "x${UNAME_RELEASE}" =3D x && UNAME_RELEASE=3D3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=3D`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=3D`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=3D`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR =3D mc88100 ] || [ $UNAME_PROCESSOR =3D mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x =3D m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x =3D x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=3D`/usr/bin/oslevel` + else + IBM_REV=3D${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=3D`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=3D`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk= '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; th= en + IBM_ARCH=3Drs6000 + else + IBM_ARCH=3Dpowerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=3D`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=3D${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=3D`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=3Dm68000 ;; + 9000/[34]?? ) HP_ARCH=3Dm68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=3D`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=3D`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH=3Dhppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=3Dhppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH=3Dhppa2.0n ;; + 64) HP_ARCH=3Dhppa2.0w ;; + '') HP_ARCH=3Dhppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" =3D "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits =3D sysconf(_SC_KERNEL_BITS); + #endif + long cpu =3D sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS=3D"" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARC= H=3D`$dummy` + test -z "$HP_ARCH" && HP_ARCH=3Dhppa + fi ;; + esac + if [ ${HP_ARCH} =3D hppa2.0w ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=3Dcc ./config.guess + # =3D> hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD=3D"cc +DA2.0w" ./config.guess + # =3D> hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS=3D"" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=3Dhppa2.0w + else + HP_ARCH=3Dhppa64 + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=3D`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu =3D sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=3D`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=3D`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnop= qrstuvwxyz` + FUJITSU_SYS=3D`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopq= rstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=3D`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=3D`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopq= rstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=3D`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcd= efghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=3D`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/= [-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${= UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' |= tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${L= IBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=3Daarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=3Dalphaev5 ;; + EV56) UNAME_MACHINE=3Dalphaev56 ;; + PCA56) UNAME_MACHINE=3Dalphapca56 ;; + PCA57) UNAME_MACHINE=3Dalphapca56 ;; + EV6) UNAME_MACHINE=3Dalphaev6 ;; + EV67) UNAME_MACHINE=3Dalphaev67 ;; + EV68*) UNAME_MACHINE=3Dalphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" =3D 0 ; then LIBC=3Dgnulibc1 ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defin= ed(MIPSEL) + CPU=3D${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defin= ed(MIPSEB) + CPU=3D${UNAME_MACHINE} + #else + CPU=3D + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" !=3D x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=3D`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=3Di486 ;; + *Pentium) UNAME_MACHINE=3Di586 ;; + *Pent*|*Celeron) UNAME_MACHINE=3Di686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_= VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=3D`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=3D`(/bin/uname -X|grep Release|sed -e 's/.*=3D //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=3Di486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=3Di586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=3Di686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=3Di686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]?= ?/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:= 4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL=3D'' + test -r /etc/.relid \ + && OS_REL=3D.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL=3D'.3' + test -r /etc/.relid \ + && OS_REL=3D.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.re= lid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02= ]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=3D`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=3D`uname -p` || UNAME_PROCESSOR=3Dunknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" =3D unknown ; then + UNAME_PROCESSOR=3Dpowerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" !=3D no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS=3D"" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=3Dx86_64 ;; + powerpc) UNAME_PROCESSOR=3Dpowerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" =3D i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=3Dx86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=3D`uname -p` + if test "$UNAME_PROCESSOR" =3D x86; then + UNAME_PROCESSOR=3Di386 + UNAME_MACHINE=3Dpc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" =3D 386; then + UNAME_MACHINE=3Di386 + else + UNAME_MACHINE=3D"$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[= -(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=3D`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +cat >&2 </dev/null || echo unknown` +uname -r =3D `(uname -r) 2>/dev/null || echo unknown` +uname -s =3D `(uname -s) 2>/dev/null || echo unknown` +uname -v =3D `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p =3D `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X =3D `(/bin/uname -X) 2>/dev/null` + +hostinfo =3D `(hostinfo) 2>/dev/null` +/bin/universe =3D `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k =3D `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch =3D `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel =3D `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo =3D `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE =3D ${UNAME_MACHINE} +UNAME_RELEASE =3D ${UNAME_RELEASE} +UNAME_SYSTEM =3D ${UNAME_SYSTEM} +UNAME_VERSION =3D ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp=3D'" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/grub-core/lib/libgcrypt/build-aux/config.rpath b/grub-core/lib= /libgcrypt/build-aux/config.rpath new file mode 100755 index 000000000..c38b914d6 --- /dev/null +++ b/grub-core/lib/libgcrypt/build-aux/config.rpath @@ -0,0 +1,690 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2013 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# The first argument passed to this file is the canonical host specificati= on, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC=3D"cc", the run time search patch must not be long= er +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=3Da +shrext=3D.so + +host=3D"$1" +host_cpu=3D`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=3D`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=3D`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=3D`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's _LT_COMPILER_PIC. + +wl=3D +if test "$GCC" =3D yes; then + wl=3D'-Wl,' +else + case "$host_os" in + aix*) + wl=3D'-Wl,' + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + ;; + hpux9* | hpux10* | hpux11*) + wl=3D'-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl=3D'-Wl,' + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + ecc*) + wl=3D'-Wl,' + ;; + icc* | ifort*) + wl=3D'-Wl,' + ;; + lf95*) + wl=3D'-Wl,' + ;; + nagfor*) + wl=3D'-Wl,-Wl,,' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + wl=3D'-Wl,' + ;; + ccc*) + wl=3D'-Wl,' + ;; + xl* | bgxl* | bgf* | mpixl*) + wl=3D'-Wl,' + ;; + como) + wl=3D'-lopt=3D' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + wl=3D + ;; + *Sun\ C*) + wl=3D'-Wl,' + ;; + esac + ;; + esac + ;; + newsos6) + ;; + *nto* | *qnx*) + ;; + osf3* | osf4* | osf5*) + wl=3D'-Wl,' + ;; + rdos*) + ;; + solaris*) + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + wl=3D'-Qoption ld ' + ;; + *) + wl=3D'-Wl,' + ;; + esac + ;; + sunos4*) + wl=3D'-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + wl=3D'-Wl,' + ;; + sysv4*MP*) + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl=3D'-Wl,' + ;; + unicos*) + wl=3D'-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's _LT_LINKER_SHLIBS. + +hardcode_libdir_flag_spec=3D +hardcode_libdir_separator=3D +hardcode_direct=3Dno +hardcode_minus_L=3Dno + +case "$host_os" in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" !=3D yes; then + with_gnu_ld=3Dno + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (=3D MSVC++) + with_gnu_ld=3Dyes + ;; + openbsd*) + with_gnu_ld=3Dno + ;; +esac + +ld_shlibs=3Dyes +if test "$with_gnu_ld" =3D yes; then + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec=3D'${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" !=3D ia64; then + ld_shlibs=3Dno + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec=3D'-L$libdir' + hardcode_minus_L=3Dyes + ;; + esac + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; = then + : + else + ld_shlibs=3Dno + fi + ;; + cygwin* | mingw* | pw32* | cegcc*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=3D'-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=3Dno + fi + ;; + haiku*) + ;; + interix[3-9]*) + hardcode_direct=3Dno + hardcode_libdir_flag_spec=3D'${wl}-rpath,$libdir' + ;; + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; = then + : + else + ld_shlibs=3Dno + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=3Dno + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null= ; then + : + else + ld_shlibs=3Dno + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=3Dno + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/nu= ll; then + hardcode_libdir_flag_spec=3D'`test -z "$SCOABSPATH" && echo ${= wl}-rpath,$libdir`' + else + ld_shlibs=3Dno + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=3Dyes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; = then + : + else + ld_shlibs=3Dno + fi + ;; + esac + if test "$ld_shlibs" =3D no; then + hardcode_libdir_flag_spec=3D + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=3Dyes + if test "$GCC" =3D yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=3Dunsupported + fi + ;; + aix[4-9]*) + if test "$host_cpu" =3D ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=3Dno + else + aix_use_runtimelinking=3Dno + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag =3D "-brtl" || test $ld_flag =3D "-Wl,-brtl"= ); then + aix_use_runtimelinking=3Dyes + break + fi + done + ;; + esac + fi + hardcode_direct=3Dyes + hardcode_libdir_separator=3D':' + if test "$GCC" =3D yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=3D`${CC} -print-prog-name=3Dcollect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=3Dunsupported + hardcode_minus_L=3Dyes + hardcode_libdir_flag_spec=3D'-L$libdir' + hardcode_libdir_separator=3D + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=3D`dump -H conftest 2>/dev/null | sed -n -e '/Import Fil= e Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=3D`dump -HX64 conftest 2>/dev/null | sed -n -e '/Impor= t File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath=3D"/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" =3D yes; then + hardcode_libdir_flag_spec=3D'${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" =3D ia64; then + hardcode_libdir_flag_spec=3D'${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec=3D'${wl}-blibpath:$libdir:'"$aix_libpa= th" + fi + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec=3D'-L$libdir' + hardcode_minus_L=3Dyes + ;; + esac + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=3D' ' + libext=3Dlib + ;; + darwin* | rhapsody*) + hardcode_direct=3Dno + if { case $cc_basename in ifort*) true;; *) test "$GCC" =3D yes;; es= ac; }; then + : + else + ld_shlibs=3Dno + fi + ;; + dgux*) + hardcode_libdir_flag_spec=3D'-L$libdir' + ;; + freebsd2.2*) + hardcode_libdir_flag_spec=3D'-R$libdir' + hardcode_direct=3Dyes + ;; + freebsd2*) + hardcode_direct=3Dyes + hardcode_minus_L=3Dyes + ;; + freebsd* | dragonfly*) + hardcode_libdir_flag_spec=3D'-R$libdir' + hardcode_direct=3Dyes + ;; + hpux9*) + hardcode_libdir_flag_spec=3D'${wl}+b ${wl}$libdir' + hardcode_libdir_separator=3D: + hardcode_direct=3Dyes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=3Dyes + ;; + hpux10*) + if test "$with_gnu_ld" =3D no; then + hardcode_libdir_flag_spec=3D'${wl}+b ${wl}$libdir' + hardcode_libdir_separator=3D: + hardcode_direct=3Dyes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=3Dyes + fi + ;; + hpux11*) + if test "$with_gnu_ld" =3D no; then + hardcode_libdir_flag_spec=3D'${wl}+b ${wl}$libdir' + hardcode_libdir_separator=3D: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=3Dno + ;; + *) + hardcode_direct=3Dyes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=3Dyes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec=3D'${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=3D: + ;; + netbsd*) + hardcode_libdir_flag_spec=3D'-R$libdir' + hardcode_direct=3Dyes + ;; + newsos6) + hardcode_direct=3Dyes + hardcode_libdir_flag_spec=3D'${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=3D: + ;; + *nto* | *qnx*) + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=3Dyes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$ho= st_os-$host_cpu" =3D "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec=3D'${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec=3D'-R$libdir' + ;; + *) + hardcode_libdir_flag_spec=3D'${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=3Dno + fi + ;; + os2*) + hardcode_libdir_flag_spec=3D'-L$libdir' + hardcode_minus_L=3Dyes + ;; + osf3*) + hardcode_libdir_flag_spec=3D'${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=3D: + ;; + osf4* | osf5*) + if test "$GCC" =3D yes; then + hardcode_libdir_flag_spec=3D'${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec=3D'-rpath $libdir' + fi + hardcode_libdir_separator=3D: + ;; + solaris*) + hardcode_libdir_flag_spec=3D'-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec=3D'-L$libdir' + hardcode_direct=3Dyes + hardcode_minus_L=3Dyes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=3Dyes # is this really true??? + ;; + siemens) + hardcode_direct=3Dno + ;; + motorola) + hardcode_direct=3Dno #Motorola manual says yes, but my tests say= they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=3Dyes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* |= sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec=3D'`test -z "$SCOABSPATH" && echo ${wl}-R,= $libdir`' + hardcode_libdir_separator=3D':' + ;; + uts4*) + hardcode_libdir_flag_spec=3D'-L$libdir' + ;; + *) + ld_shlibs=3Dno + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, = but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if = the +# linker has special search rules. +library_names_spec=3D # the last element of library_names_spec in lib= tool.m4 +libname_spec=3D'lib$name' +case "$host_os" in + aix3*) + library_names_spec=3D'$libname.a' + ;; + aix[4-9]*) + library_names_spec=3D'$libname$shrext' + ;; + amigaos*) + case "$host_cpu" in + powerpc*) + library_names_spec=3D'$libname$shrext' ;; + m68k) + library_names_spec=3D'$libname.a' ;; + esac + ;; + beos*) + library_names_spec=3D'$libname$shrext' + ;; + bsdi[45]*) + library_names_spec=3D'$libname$shrext' + ;; + cygwin* | mingw* | pw32* | cegcc*) + shrext=3D.dll + library_names_spec=3D'$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=3D.dylib + library_names_spec=3D'$libname$shrext' + ;; + dgux*) + library_names_spec=3D'$libname$shrext' + ;; + freebsd* | dragonfly*) + case "$host_os" in + freebsd[123]*) + library_names_spec=3D'$libname$shrext$versuffix' ;; + *) + library_names_spec=3D'$libname$shrext' ;; + esac + ;; + gnu*) + library_names_spec=3D'$libname$shrext' + ;; + haiku*) + library_names_spec=3D'$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=3D.so + ;; + hppa*64*) + shrext=3D.sl + ;; + *) + shrext=3D.sl + ;; + esac + library_names_spec=3D'$libname$shrext' + ;; + interix[3-9]*) + library_names_spec=3D'$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec=3D'$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff=3D shlibsuff=3D + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff=3D shlibsuf= f=3D ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=3D32 = shlibsuff=3DN32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=3D64 shlibsuf= f=3D64 ;; + *) libsuff=3D shlibsuff=3D ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + library_names_spec=3D'$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec=3D'$libname$shrext' + ;; + netbsd*) + library_names_spec=3D'$libname$shrext' + ;; + newsos6) + library_names_spec=3D'$libname$shrext' + ;; + *nto* | *qnx*) + library_names_spec=3D'$libname$shrext' + ;; + openbsd*) + library_names_spec=3D'$libname$shrext$versuffix' + ;; + os2*) + libname_spec=3D'$name' + shrext=3D.dll + library_names_spec=3D'$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec=3D'$libname$shrext' + ;; + rdos*) + ;; + solaris*) + library_names_spec=3D'$libname$shrext' + ;; + sunos4*) + library_names_spec=3D'$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec=3D'$libname$shrext' + ;; + sysv4*MP*) + library_names_spec=3D'$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec=3D'$libname$shrext' + ;; + tpf*) + library_names_spec=3D'$libname$shrext' + ;; + uts4*) + library_names_spec=3D'$libname$shrext' + ;; +esac + +sed_quote_subst=3D's/\(["`$\\]\)/\\\1/g' +escaped_wl=3D`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=3D`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=3D`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_q= uote_subst"` +escaped_library_names_spec=3D`echo "X$library_names_spec" | sed -e 's/^X//= ' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=3D`echo "X$hardcode_libdir_flag_spec" | = sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=3DC sed -e 's/^\([a-zA-Z0-9_]*\)=3D/acl_cv_\1=3D/' <. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration ty= pe. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code= 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=3Dconfig.git;a=3Dblob_plain;f=3Dco= nfig.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=3D`echo "$0" | sed -e 's,.*/,,'` + +usage=3D"\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version=3D"\ +GNU config.sub ($timestamp) + +Copyright 1992-2016 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE= ." + +help=3D" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any= ). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=3D`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* = | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*= -gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=3D-$maybe_os + basic_machine=3D`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=3D-linux-android + basic_machine=3D`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unkno= wn + ;; + *) + basic_machine=3D`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine !=3D $1 ] + then os=3D`echo $1 | sed 's/.*-/-/'` + else os=3D; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os=3D + basic_machine=3D$1 + ;; + -bluegene*) + os=3D-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os=3D + basic_machine=3D$1 + ;; + -scout) + ;; + -wrs) + os=3D-vxworks + basic_machine=3D$1 + ;; + -chorusos*) + os=3D-chorusos + basic_machine=3D$1 + ;; + -chorusrdb) + os=3D-chorusrdb + basic_machine=3D$1 + ;; + -hiux*) + os=3D-hiuxwe2 + ;; + -sco6) + os=3D-sco5v6 + basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=3D-sco3.2v5 + basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=3D-sco3.2v4 + basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=3D`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=3D-sco3.2v2 + basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=3D-isc2.2 + basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=3Dclipper-intergraph + ;; + -isc*) + basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=3D-lynxos178 + ;; + -lynx*5) + os=3D-lynxos5 + ;; + -lynx*) + os=3D-lynxos + ;; + -ptx*) + basic_machine=3D`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=3D`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=3D-psos + ;; + -mint | -mint[0-9]*) + basic_machine=3Dm68k-atari + os=3D-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[6= 7] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe= | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite= \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=3D$basic_machine-unknown + ;; + c54x) + basic_machine=3Dtic54x-unknown + ;; + c55x) + basic_machine=3Dtic55x-unknown + ;; + c6x) + basic_machine=3Dtic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=3Dsparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=3D$basic_machine-unknown + os=3D-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=3Dmt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=3Darm-unknown + ;; + xgate) + basic_machine=3D$basic_machine-unknown + os=3D-none + ;; + xscaleeb) + basic_machine=3Darmeb-unknown + ;; + + xscaleel) + basic_machine=3Darmel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=3D$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recogn= ized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | = sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-*= \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=3D$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=3Di386-unknown + os=3D-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=3Dm68000-att + ;; + 3b*) + basic_machine=3Dwe32k-att + ;; + a29khif) + basic_machine=3Da29k-amd + os=3D-udi + ;; + abacus) + basic_machine=3Dabacus-unknown + ;; + adobe68k) + basic_machine=3Dm68010-adobe + os=3D-scout + ;; + alliant | fx80) + basic_machine=3Dfx80-alliant + ;; + altos | altos3068) + basic_machine=3Dm68k-altos + ;; + am29k) + basic_machine=3Da29k-none + os=3D-bsd + ;; + amd64) + basic_machine=3Dx86_64-pc + ;; + amd64-*) + basic_machine=3Dx86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=3D580-amdahl + os=3D-sysv + ;; + amiga | amiga-*) + basic_machine=3Dm68k-unknown + ;; + amigaos | amigados) + basic_machine=3Dm68k-unknown + os=3D-amigaos + ;; + amigaunix | amix) + basic_machine=3Dm68k-unknown + os=3D-sysv4 + ;; + apollo68) + basic_machine=3Dm68k-apollo + os=3D-sysv + ;; + apollo68bsd) + basic_machine=3Dm68k-apollo + os=3D-bsd + ;; + aros) + basic_machine=3Di386-pc + os=3D-aros + ;; + asmjs) + basic_machine=3Dasmjs-unknown + ;; + aux) + basic_machine=3Dm68k-apple + os=3D-aux + ;; + balance) + basic_machine=3Dns32k-sequent + os=3D-dynix + ;; + blackfin) + basic_machine=3Dbfin-unknown + os=3D-linux + ;; + blackfin-*) + basic_machine=3Dbfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=3D-linux + ;; + bluegene*) + basic_machine=3Dpowerpc-ibm + os=3D-cnk + ;; + c54x-*) + basic_machine=3Dtic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=3Dtic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=3Dtic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=3Dc90-cray + os=3D-unicos + ;; + cegcc) + basic_machine=3Darm-unknown + os=3D-cegcc + ;; + convex-c1) + basic_machine=3Dc1-convex + os=3D-bsd + ;; + convex-c2) + basic_machine=3Dc2-convex + os=3D-bsd + ;; + convex-c32) + basic_machine=3Dc32-convex + os=3D-bsd + ;; + convex-c34) + basic_machine=3Dc34-convex + os=3D-bsd + ;; + convex-c38) + basic_machine=3Dc38-convex + os=3D-bsd + ;; + cray | j90) + basic_machine=3Dj90-cray + os=3D-unicos + ;; + craynv) + basic_machine=3Dcraynv-cray + os=3D-unicosmp + ;; + cr16 | cr16-*) + basic_machine=3Dcr16-unknown + os=3D-elf + ;; + crds | unos) + basic_machine=3Dm68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=3Dcrisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=3Dcris-axis + ;; + crx) + basic_machine=3Dcrx-unknown + os=3D-elf + ;; + da30 | da30-*) + basic_machine=3Dm68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=3Dmips-dec + ;; + decsystem10* | dec10*) + basic_machine=3Dpdp10-dec + os=3D-tops10 + ;; + decsystem20* | dec20*) + basic_machine=3Dpdp10-dec + os=3D-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=3Dm68k-motorola + ;; + delta88) + basic_machine=3Dm88k-motorola + os=3D-sysv3 + ;; + dicos) + basic_machine=3Di686-pc + os=3D-dicos + ;; + djgpp) + basic_machine=3Di586-pc + os=3D-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=3Drs6000-bull + os=3D-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=3Dm68k-bull + os=3D-sysv3 + ;; + e500v[12]) + basic_machine=3Dpowerpc-unknown + os=3D$os"spe" + ;; + e500v[12]-*) + basic_machine=3Dpowerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=3D$os"spe" + ;; + ebmon29k) + basic_machine=3Da29k-amd + os=3D-ebmon + ;; + elxsi) + basic_machine=3Delxsi-elxsi + os=3D-bsd + ;; + encore | umax | mmax) + basic_machine=3Dns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=3Dm68k-ericsson + os=3D-ose + ;; + fx2800) + basic_machine=3Di860-alliant + ;; + genix) + basic_machine=3Dns32k-ns + ;; + gmicro) + basic_machine=3Dtron-gmicro + os=3D-sysv + ;; + go32) + basic_machine=3Di386-pc + os=3D-go32 + ;; + h3050r* | hiux*) + basic_machine=3Dhppa1.1-hitachi + os=3D-hiuxwe2 + ;; + h8300hms) + basic_machine=3Dh8300-hitachi + os=3D-hms + ;; + h8300xray) + basic_machine=3Dh8300-hitachi + os=3D-xray + ;; + h8500hms) + basic_machine=3Dh8500-hitachi + os=3D-hms + ;; + harris) + basic_machine=3Dm88k-harris + os=3D-sysv3 + ;; + hp300-*) + basic_machine=3Dm68k-hp + ;; + hp300bsd) + basic_machine=3Dm68k-hp + os=3D-bsd + ;; + hp300hpux) + basic_machine=3Dm68k-hp + os=3D-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=3Dhppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=3Dm68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=3Dm68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=3Dhppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=3Dhppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=3Dhppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | h= p9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=3Dhppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=3Dhppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=3Dhppa1.0-hp + ;; + hppa-next) + os=3D-nextstep3 + ;; + hppaosf) + basic_machine=3Dhppa1.1-hp + os=3D-osf + ;; + hppro) + basic_machine=3Dhppa1.1-hp + os=3D-proelf + ;; + i370-ibm* | ibm*) + basic_machine=3Di370-ibm + ;; + i*86v32) + basic_machine=3D`echo $1 | sed -e 's/86.*/86-pc/'` + os=3D-sysv32 + ;; + i*86v4*) + basic_machine=3D`echo $1 | sed -e 's/86.*/86-pc/'` + os=3D-sysv4 + ;; + i*86v) + basic_machine=3D`echo $1 | sed -e 's/86.*/86-pc/'` + os=3D-sysv + ;; + i*86sol2) + basic_machine=3D`echo $1 | sed -e 's/86.*/86-pc/'` + os=3D-solaris2 + ;; + i386mach) + basic_machine=3Di386-mach + os=3D-mach + ;; + i386-vsta | vsta) + basic_machine=3Di386-unknown + os=3D-vsta + ;; + iris | iris4d) + basic_machine=3Dmips-sgi + case $os in + -irix*) + ;; + *) + os=3D-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=3Dm68k-isi + os=3D-sysv + ;; + leon-*|leon[3-9]-*) + basic_machine=3Dsparc-`echo $basic_machine | sed 's/-.*//'` + ;; + m68knommu) + basic_machine=3Dm68k-unknown + os=3D-linux + ;; + m68knommu-*) + basic_machine=3Dm68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=3D-linux + ;; + m88k-omron*) + basic_machine=3Dm88k-omron + ;; + magnum | m3230) + basic_machine=3Dmips-mips + os=3D-sysv + ;; + merlin) + basic_machine=3Dns32k-utek + os=3D-sysv + ;; + microblaze*) + basic_machine=3Dmicroblaze-xilinx + ;; + mingw64) + basic_machine=3Dx86_64-pc + os=3D-mingw64 + ;; + mingw32) + basic_machine=3Di686-pc + os=3D-mingw32 + ;; + mingw32ce) + basic_machine=3Darm-unknown + os=3D-mingw32ce + ;; + miniframe) + basic_machine=3Dm68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=3Dm68k-atari + os=3D-mint + ;; + mips3*-*) + basic_machine=3D`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=3D`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=3Dm68k-rom68k + os=3D-coff + ;; + morphos) + basic_machine=3Dpowerpc-unknown + os=3D-morphos + ;; + moxiebox) + basic_machine=3Dmoxie-unknown + os=3D-moxiebox + ;; + msdos) + basic_machine=3Di386-pc + os=3D-msdos + ;; + ms1-*) + basic_machine=3D`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=3Di686-pc + os=3D-msys + ;; + mvs) + basic_machine=3Di370-ibm + os=3D-mvs + ;; + nacl) + basic_machine=3Dle32-unknown + os=3D-nacl + ;; + ncr3000) + basic_machine=3Di486-ncr + os=3D-sysv4 + ;; + netbsd386) + basic_machine=3Di386-unknown + os=3D-netbsd + ;; + netwinder) + basic_machine=3Darmv4l-rebel + os=3D-linux + ;; + news | news700 | news800 | news900) + basic_machine=3Dm68k-sony + os=3D-newsos + ;; + news1000) + basic_machine=3Dm68030-sony + os=3D-newsos + ;; + news-3600 | risc-news) + basic_machine=3Dmips-sony + os=3D-newsos + ;; + necv70) + basic_machine=3Dv70-nec + os=3D-sysv + ;; + next | m*-next ) + basic_machine=3Dm68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=3D-nextstep2 + ;; + *) + os=3D-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=3Dm68k-harris + os=3D-cxux + ;; + nh[45]000) + basic_machine=3Dm88k-harris + os=3D-cxux + ;; + nindy960) + basic_machine=3Di960-intel + os=3D-nindy + ;; + mon960) + basic_machine=3Di960-intel + os=3D-mon960 + ;; + nonstopux) + basic_machine=3Dmips-compaq + os=3D-nonstopux + ;; + np1) + basic_machine=3Dnp1-gould + ;; + neo-tandem) + basic_machine=3Dneo-tandem + ;; + nse-tandem) + basic_machine=3Dnse-tandem + ;; + nsr-tandem) + basic_machine=3Dnsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=3Dhppa1.1-oki + os=3D-proelf + ;; + openrisc | openrisc-*) + basic_machine=3Dor32-unknown + ;; + os400) + basic_machine=3Dpowerpc-ibm + os=3D-os400 + ;; + OSE68000 | ose68000) + basic_machine=3Dm68000-ericsson + os=3D-ose + ;; + os68k) + basic_machine=3Dm68k-none + os=3D-os68k + ;; + pa-hitachi) + basic_machine=3Dhppa1.1-hitachi + os=3D-hiuxwe2 + ;; + paragon) + basic_machine=3Di860-intel + os=3D-osf + ;; + parisc) + basic_machine=3Dhppa-unknown + os=3D-linux + ;; + parisc-*) + basic_machine=3Dhppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=3D-linux + ;; + pbd) + basic_machine=3Dsparc-tti + ;; + pbb) + basic_machine=3Dm68k-tti + ;; + pc532 | pc532-*) + basic_machine=3Dns32k-pc532 + ;; + pc98) + basic_machine=3Di386-pc + ;; + pc98-*) + basic_machine=3Di386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=3Di586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=3Di686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=3Di686-pc + ;; + pentium4) + basic_machine=3Di786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=3Di586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=3Di686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=3Di686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=3Di786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=3Dpn-gould + ;; + power) basic_machine=3Dpower-ibm + ;; + ppc | ppcbe) basic_machine=3Dpowerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=3Dpowerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=3Dpowerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=3Dpowerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=3Dpowerpc64-unknown + ;; + ppc64-*) basic_machine=3Dpowerpc64-`echo $basic_machine | sed 's/^[^-]*-/= /'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=3Dpowerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=3Dpowerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=3Di386-ibm + ;; + pw32) + basic_machine=3Di586-unknown + os=3D-pw32 + ;; + rdos | rdos64) + basic_machine=3Dx86_64-pc + os=3D-rdos + ;; + rdos32) + basic_machine=3Di386-pc + os=3D-rdos + ;; + rom68k) + basic_machine=3Dm68k-rom68k + os=3D-coff + ;; + rm[46]00) + basic_machine=3Dmips-siemens + ;; + rtpc | rtpc-*) + basic_machine=3Dromp-ibm + ;; + s390 | s390-*) + basic_machine=3Ds390-ibm + ;; + s390x | s390x-*) + basic_machine=3Ds390x-ibm + ;; + sa29200) + basic_machine=3Da29k-amd + os=3D-udi + ;; + sb1) + basic_machine=3Dmipsisa64sb1-unknown + ;; + sb1el) + basic_machine=3Dmipsisa64sb1el-unknown + ;; + sde) + basic_machine=3Dmipsisa32-sde + os=3D-elf + ;; + sei) + basic_machine=3Dmips-sei + os=3D-seiux + ;; + sequent) + basic_machine=3Di386-sequent + ;; + sh) + basic_machine=3Dsh-hitachi + os=3D-hms + ;; + sh5el) + basic_machine=3Dsh5le-unknown + ;; + sh64) + basic_machine=3Dsh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=3Dsparclite-wrs + os=3D-vxworks + ;; + sps7) + basic_machine=3Dm68k-bull + os=3D-sysv2 + ;; + spur) + basic_machine=3Dspur-unknown + ;; + st2000) + basic_machine=3Dm68k-tandem + ;; + stratus) + basic_machine=3Di860-stratus + os=3D-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=3Darm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=3Dm68000-sun + ;; + sun2os3) + basic_machine=3Dm68000-sun + os=3D-sunos3 + ;; + sun2os4) + basic_machine=3Dm68000-sun + os=3D-sunos4 + ;; + sun3os3) + basic_machine=3Dm68k-sun + os=3D-sunos3 + ;; + sun3os4) + basic_machine=3Dm68k-sun + os=3D-sunos4 + ;; + sun4os3) + basic_machine=3Dsparc-sun + os=3D-sunos3 + ;; + sun4os4) + basic_machine=3Dsparc-sun + os=3D-sunos4 + ;; + sun4sol2) + basic_machine=3Dsparc-sun + os=3D-solaris2 + ;; + sun3 | sun3-*) + basic_machine=3Dm68k-sun + ;; + sun4) + basic_machine=3Dsparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=3Di386-sun + ;; + sv1) + basic_machine=3Dsv1-cray + os=3D-unicos + ;; + symmetry) + basic_machine=3Di386-sequent + os=3D-dynix + ;; + t3e) + basic_machine=3Dalphaev5-cray + os=3D-unicos + ;; + t90) + basic_machine=3Dt90-cray + os=3D-unicos + ;; + tile*) + basic_machine=3D$basic_machine-unknown + os=3D-linux-gnu + ;; + tx39) + basic_machine=3Dmipstx39-unknown + ;; + tx39el) + basic_machine=3Dmipstx39el-unknown + ;; + toad1) + basic_machine=3Dpdp10-xkl + os=3D-tops20 + ;; + tower | tower-32) + basic_machine=3Dm68k-ncr + ;; + tpf) + basic_machine=3Ds390x-ibm + os=3D-tpf + ;; + udi29k) + basic_machine=3Da29k-amd + os=3D-udi + ;; + ultra3) + basic_machine=3Da29k-nyu + os=3D-sym1 + ;; + v810 | necv810) + basic_machine=3Dv810-nec + os=3D-none + ;; + vaxv) + basic_machine=3Dvax-dec + os=3D-sysv + ;; + vms) + basic_machine=3Dvax-dec + os=3D-vms + ;; + vpp*|vx|vx-*) + basic_machine=3Df301-fujitsu + ;; + vxworks960) + basic_machine=3Di960-wrs + os=3D-vxworks + ;; + vxworks68) + basic_machine=3Dm68k-wrs + os=3D-vxworks + ;; + vxworks29k) + basic_machine=3Da29k-wrs + os=3D-vxworks + ;; + w65*) + basic_machine=3Dw65-wdc + os=3D-none + ;; + w89k-*) + basic_machine=3Dhppa1.1-winbond + os=3D-proelf + ;; + xbox) + basic_machine=3Di686-pc + os=3D-mingw32 + ;; + xps | xps100) + basic_machine=3Dxps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=3D`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=3Dymp-cray + os=3D-unicos + ;; + z8k-*-coff) + basic_machine=3Dz8k-unknown + os=3D-sim + ;; + z80-*-coff) + basic_machine=3Dz80-unknown + os=3D-sim + ;; + none) + basic_machine=3Dnone-none + os=3D-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=3Dhppa1.1-winbond + ;; + op50n) + basic_machine=3Dhppa1.1-oki + ;; + op60c) + basic_machine=3Dhppa1.1-oki + ;; + romp) + basic_machine=3Dromp-ibm + ;; + mmix) + basic_machine=3Dmmix-knuth + ;; + rs6000) + basic_machine=3Drs6000-ibm + ;; + vax) + basic_machine=3Dvax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=3Dpdp10-unknown + ;; + pdp11) + basic_machine=3Dpdp11-dec + ;; + we32k) + basic_machine=3Dwe32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=3Dsh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=3Dsparc-sun + ;; + cydra) + basic_machine=3Dcydra-cydrome + ;; + orion) + basic_machine=3Dorion-highlevel + ;; + orion105) + basic_machine=3Dclipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=3Dm68k-apple + ;; + pmac | pmac-mpw) + basic_machine=3Dpowerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recogn= ized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=3D`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=3D`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" !=3D x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=3D-auroraux + ;; + -solaris1 | -solaris1.*) + os=3D`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=3D-solaris2 + ;; + -svr4*) + os=3D-sysv4 + ;; + -unixware*) + os=3D-sysv4.2uw + ;; + -gnu/linux*) + os=3D`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos= [34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris= * \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android*= \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=3D-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=3D`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=3D`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=3D-linux-dietlibc + ;; + -linux*) + os=3D`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=3D`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=3D`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=3D-openedition + ;; + -os400*) + os=3D-os400 + ;; + -wince*) + os=3D-wince + ;; + -osfrose*) + os=3D-osfrose + ;; + -osf*) + os=3D-osf + ;; + -utek*) + os=3D-bsd + ;; + -dynix*) + os=3D-bsd + ;; + -acis*) + os=3D-aos + ;; + -atheos*) + os=3D-atheos + ;; + -syllable*) + os=3D-syllable + ;; + -386bsd) + os=3D-bsd + ;; + -ctix* | -uts*) + os=3D-sysv + ;; + -nova*) + os=3D-rtmk-nova + ;; + -ns2 ) + os=3D-nextstep2 + ;; + -nsk*) + os=3D-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=3D`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=3D-sysv4 + ;; + -tpf*) + os=3D-tpf + ;; + -triton*) + os=3D-sysv3 + ;; + -oss*) + os=3D-sysv3 + ;; + -svr4) + os=3D-sysv4 + ;; + -svr3) + os=3D-sysv3 + ;; + -sysvr4) + os=3D-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=3D-ose + ;; + -es1800*) + os=3D-ose + ;; + -xenix) + os=3D-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=3D-mint + ;; + -aros*) + os=3D-aros + ;; + -zvmoe) + os=3D-zvmoe + ;; + -dicos*) + os=3D-dicos + ;; + -nacl*) + ;; + -ios) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=3D`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various mach= ines. +# The value should be what the vendor currently ships out the door with th= eir +# machine or put another way, the most popular os provided with the machin= e. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=3D-elf + ;; + spu-*) + os=3D-elf + ;; + *-acorn) + os=3D-riscix1.2 + ;; + arm*-rebel) + os=3D-linux + ;; + arm*-semi) + os=3D-aout + ;; + c4x-* | tic4x-*) + os=3D-coff + ;; + c8051-*) + os=3D-elf + ;; + hexagon-*) + os=3D-elf + ;; + tic54x-*) + os=3D-coff + ;; + tic55x-*) + os=3D-coff + ;; + tic6x-*) + os=3D-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=3D-tops20 + ;; + pdp11-*) + os=3D-none + ;; + *-dec | vax-*) + os=3D-ultrix4.2 + ;; + m68*-apollo) + os=3D-domain + ;; + i386-sun) + os=3D-sunos4.0.2 + ;; + m68000-sun) + os=3D-sunos3 + ;; + m68*-cisco) + os=3D-aout + ;; + mep-*) + os=3D-elf + ;; + mips*-cisco) + os=3D-elf + ;; + mips*-*) + os=3D-elf + ;; + or32-*) + os=3D-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=3D-sysv3 + ;; + sparc-* | *-sun) + os=3D-sunos4.1.1 + ;; + *-be) + os=3D-beos + ;; + *-haiku) + os=3D-haiku + ;; + *-ibm) + os=3D-aix + ;; + *-knuth) + os=3D-mmixware + ;; + *-wec) + os=3D-proelf + ;; + *-winbond) + os=3D-proelf + ;; + *-oki) + os=3D-proelf + ;; + *-hp) + os=3D-hpux + ;; + *-hitachi) + os=3D-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=3D-sysv + ;; + *-cbm) + os=3D-amigaos + ;; + *-dg) + os=3D-dgux + ;; + *-dolphin) + os=3D-sysv3 + ;; + m68k-ccur) + os=3D-rtu + ;; + m88k-omron*) + os=3D-luna + ;; + *-next ) + os=3D-nextstep + ;; + *-sequent) + os=3D-ptx + ;; + *-crds) + os=3D-unos + ;; + *-ns) + os=3D-genix + ;; + i370-*) + os=3D-mvs + ;; + *-next) + os=3D-nextstep3 + ;; + *-gould) + os=3D-sysv + ;; + *-highlevel) + os=3D-bsd + ;; + *-encore) + os=3D-bsd + ;; + *-sgi) + os=3D-irix + ;; + *-siemens) + os=3D-sysv4 + ;; + *-masscomp) + os=3D-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=3D-uxpv + ;; + *-rom68k) + os=3D-coff + ;; + *-*bug) + os=3D-coff + ;; + *-apple) + os=3D-macos + ;; + *-atari*) + os=3D-mint + ;; + *) + os=3D-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not = the +# manufacturer. We pick the logical manufacturer. +vendor=3Dunknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=3Dacorn + ;; + -sunos*) + vendor=3Dsun + ;; + -cnk*|-aix*) + vendor=3Dibm + ;; + -beos*) + vendor=3Dbe + ;; + -hpux*) + vendor=3Dhp + ;; + -mpeix*) + vendor=3Dhp + ;; + -hiux*) + vendor=3Dhitachi + ;; + -unos*) + vendor=3Dcrds + ;; + -dgux*) + vendor=3Ddg + ;; + -luna*) + vendor=3Domron + ;; + -genix*) + vendor=3Dns + ;; + -mvs* | -opened*) + vendor=3Dibm + ;; + -os400*) + vendor=3Dibm + ;; + -ptx*) + vendor=3Dsequent + ;; + -tpf*) + vendor=3Dibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=3Dwrs + ;; + -aux*) + vendor=3Dapple + ;; + -hms*) + vendor=3Dhitachi + ;; + -mpw* | -macos*) + vendor=3Dapple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=3Datari + ;; + -vos*) + vendor=3Dstratus + ;; + esac + basic_machine=3D`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp=3D'" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/grub-core/lib/libgcrypt/build-aux/depcomp b/grub-core/lib/libg= crypt/build-aux/depcomp new file mode 100755 index 000000000..4ebd5b3a2 --- /dev/null +++ b/grub-core/lib/libgcrypt/build-aux/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=3D2013-05-30.07; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=3D`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=3D;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=3D`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=3D' ' +# A newline character. +nl=3D' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=3DABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=3Dabcdefghijklmnopqrstuvwxyz +digits=3D0123456789 +alpha=3D${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=3D${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=3D${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag=3D dashmflag=3D + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" =3D hp; then + # HP compiler uses -M and no extra arg. + gccflag=3D-M + depmode=3Dgcc +fi + +if test "$depmode" =3D dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=3D-xM + depmode=3Ddashmstdout +fi + +cygpath_u=3D"cygpath -u -f -" +if test "$depmode" =3D msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u=3D'sed s,\\\\,/,g' + depmode=3Dmsvisualcpp +fi + +if test "$depmode" =3D msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u=3D'sed s,\\\\,/,g' + depmode=3Dmsvc7 +fi + +if test "$depmode" =3D xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=3D-qmakedep=3Dgcc,-MF + depmode=3Dgcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=3D$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=3D-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=3D$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" =3D yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=3D$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other fi= les + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" =3D yes; then + tmpdepfile1=3D$dir$base.u + tmpdepfile2=3D$base.u + tmpdepfile3=3D$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=3D$dir$base.u + tmpdepfile2=3D$dir$base.u + tmpdepfile3=3D$dir$base.u + "$@" -M + fi + stat=3D$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=3D$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=3D$base.d + + # For projects that build the same source file twice into different obje= ct + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping= on + # the same $tmpdepfile. + lockdir=3D$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=3D100 + i=3D$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=3D$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=3D`expr $i - 1` + done + fi + i=3D`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" =3D yes; then + tmpdepfile1=3D$dir$base.d + tmpdepfile2=3D$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=3D$dir$base.d + tmpdepfile2=3D$dir$base.d + "$@" +Maked + fi + stat=3D$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" =3D yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=3D$dir$base.o.d # libtool 1.5 + tmpdepfile2=3D$dir.libs/$base.o.d # Likewise. + tmpdepfile3=3D$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=3D$dir$base.d + tmpdepfile2=3D$dir$base.d + tmpdepfile3=3D$dir$base.d + "$@" -MD + fi + + stat=3D$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" =3D yes; then + showIncludes=3D-Wc,-showIncludes + else + showIncludes=3D-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=3D$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" =3D yes; then + while test "X$1" !=3D 'X--mode=3Dcompile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=3D" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=3D-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwis= e. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" =3D yes; then + while test "X$1" !=3D 'X--mode=3Dcompile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=3Dno eat=3Dno + for arg + do + case $cleared in + no) + set ""; shift + cleared=3Dyes ;; + esac + if test $eat =3D yes; then + eat=3Dno + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=3Dyes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=3D`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the obje= ct. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" =3D yes; then + while test "X$1" !=3D 'X--mode=3Dcompile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=3D" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" =3D yes; then + while test "X$1" !=3D 'X--mode=3Dcompile'; do + shift + done + shift + fi + + IFS=3D" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u= > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p'= >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$dep= file" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=3D" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/grub-core/lib/libgcrypt/build-aux/git-log-fix b/grub-core/lib/= libgcrypt/build-aux/git-log-fix new file mode 100644 index 000000000..3e3fd95c5 --- /dev/null +++ b/grub-core/lib/libgcrypt/build-aux/git-log-fix @@ -0,0 +1,14 @@ +# This file is expected to be used via gitlog-to-changelog's --amend=3DFILE +# option. It specifies what changes to make to each given SHA1's commit +# log and metadata, using Perl-eval'able expressions. + +eb4937914db3fb7317502e97e4f0e40c1857f59d +# Fix bad formatted entry dated 2013-05-20 +s/(?s)mpi_sub.*$/cipher: Fix segv in last ECC change. +* cipher\/ecc.c (generate_key): Make sure R is initialized./ + +296f38a2bd2e25788643a42e4881faed00884a40 +# Fix bad formatted entry dated 2013-05-09 +s/(?s)Generate ECC.*$/cipher: Generate compliant ECC keys. +* cipher\/ecc.c (generate_key): Make sure a key is compliant for +using the compact representation./ diff --git a/grub-core/lib/libgcrypt/build-aux/git-log-footer b/grub-core/l= ib/libgcrypt/build-aux/git-log-footer new file mode 100644 index 000000000..c31fe936a --- /dev/null +++ b/grub-core/lib/libgcrypt/build-aux/git-log-footer @@ -0,0 +1,14 @@ + +2011-12-01 Werner Koch + + NB: Changes done before December 1st, 2011 are described in + per directory files named ChangeLog-2011. See doc/HACKING for + details. + + ----- + Copyright (C) 2011 Free Software Foundation, Inc. + + Copying and distribution of this file and/or the original GIT + commit log messages, with or without modification, are + permitted provided the copyright notice and this notice are + preserved. diff --git a/grub-core/lib/libgcrypt/build-aux/install-sh b/grub-core/lib/l= ibgcrypt/build-aux/install-sh new file mode 100755 index 000000000..377bb8687 --- /dev/null +++ b/grub-core/lib/libgcrypt/build-aux/install-sh @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=3D2011-11-20.07; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a = copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation t= he +# rights to use, copy, modify, merge, publish, distribute, sublicense, and= /or +# sell copies of the Software, and to permit persons to whom the Software = is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included = in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS = OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL= THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHE= R IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON= NEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall n= ot +# be used in advertising or otherwise to promote the sale, use or other de= al- +# ings in this Software without prior written authorization from the X Con= sor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=3D' +' +IFS=3D" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=3D${DOITPROG-} +if test -z "$doit"; then + doit_exec=3Dexec +else + doit_exec=3D$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=3D${CHGRPPROG-chgrp} +chmodprog=3D${CHMODPROG-chmod} +chownprog=3D${CHOWNPROG-chown} +cmpprog=3D${CMPPROG-cmp} +cpprog=3D${CPPROG-cp} +mkdirprog=3D${MKDIRPROG-mkdir} +mvprog=3D${MVPROG-mv} +rmprog=3D${RMPROG-rm} +stripprog=3D${STRIPPROG-strip} + +posix_glob=3D'?' +initialize_posix_glob=3D' + test "$posix_glob" !=3D "?" || { + if (set -f) 2>/dev/null; then + posix_glob=3D + else + posix_glob=3D: + fi + } +' + +posix_mkdir=3D + +# Desired mode of installed file. +mode=3D0755 + +chgrpcmd=3D +chmodcmd=3D$chmodprog +chowncmd=3D +mvcmd=3D$mvprog +rmcmd=3D"$rmprog -f" +stripcmd=3D + +src=3D +dst=3D +dir_arg=3D +dst_arg=3D + +copy_on_change=3Dfalse +no_target_directory=3D + +usage=3D"\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modifica= tion time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=3Dtrue;; + + -d) dir_arg=3Dtrue;; + + -g) chgrpcmd=3D"$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=3D$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd=3D"$chownprog $2" + shift;; + + -s) stripcmd=3D$stripprog;; + + -t) dst_arg=3D$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=3D\(\)!]) dst_arg=3D./$dst_arg;; + esac + shift;; + + -T) no_target_directory=3Dtrue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=3D$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=3D\(\)!]) dst_arg=3D./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit=3D'(exit $ret); exit $ret' + trap "ret=3D129; $do_exit" 1 + trap "ret=3D130; $do_exit" 2 + trap "ret=3D141; $do_exit" 13 + trap "ret=3D143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=3D133;; + *755) cp_umask=3D22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw=3D + else + u_plus_rw=3D'% 200' + fi + cp_umask=3D`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw=3D + else + u_plus_rw=3D,u+rw + fi + cp_umask=3D$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=3D\(\)!]) src=3D./$src;; + esac + + if test -n "$dir_arg"; then + dst=3D$src + dstdir=3D$dst + test -d "$dstdir" + dstdir_status=3D$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=3D$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=3D$dst + dst=3D$dstdir/`basename "$src"` + dstdir_status=3D0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=3D` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=3D$? + fi + fi + + obsolete_mkdir_used=3Dfalse + + if test $dstdir_status !=3D 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=3D`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=3D$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=3D22;; + + *[0-7]) + mkdir_umask=3D`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=3D$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=3D-m$mode + else + mkdir_mode=3D + fi + + posix_mkdir=3Dfalse + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) !=3D 0. + ;; + *) + tmpdir=3D${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=3D$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=3D`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=3D700;; + d????-?--*) different_mode=3D755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=3D`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" =3D "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=3D: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix=3D'/';; + [-=3D\(\)!]*) prefix=3D'./';; + *) prefix=3D'';; + esac + + eval "$initialize_posix_glob" + + oIFS=3D$IFS + IFS=3D/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=3D$oIFS + + prefixes=3D + + for d + do + test X"$d" =3D X && continue + + prefix=3D$prefix$d + if test -d "$prefix"; then + prefixes=3D + else + if $posix_mkdir; then + (umask=3D$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=3D`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=3D$prefix;; + esac + prefixes=3D"$prefixes '$qprefix'" + fi + fi + prefix=3D$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=3Dtrue + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" =3D false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=3D$dstdir/_inst.$$_ + rmtmp=3D$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=3D$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=3D`LC_ALL=3DC ls -dlL "$dst" 2>/dev/null` && + new=3D`LC_ALL=3DC ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=3D:$2:$4:$5:$6 && + set X $new && new=3D:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" =3D "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=3D" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/grub-core/lib/libgcrypt/build-aux/libtool-patch.sed b/grub-cor= e/lib/libgcrypt/build-aux/libtool-patch.sed new file mode 100644 index 000000000..ac5a3badc --- /dev/null +++ b/grub-core/lib/libgcrypt/build-aux/libtool-patch.sed @@ -0,0 +1,68 @@ +# +# This is a sed script to patch the generated libtool, +# which works well against both of libtool 2.4.2 and 2.4.7. +# +# You may use this work under the terms of a Creative Commons CC0 1.0 +# License/Waiver. +# +# CC0 Public Domain Dedication +# https://creativecommons.org/publicdomain/zero/1.0/ + +# +# This sed script applys two hunks of the patch: +# +# Part1: after the comment "# bleh windows" +# Part2: after the comment "#extension on DOS 8.3..." +# +# Only when those two parts are patched correctly, it exits with 0 or +# else, it exits with 1 +# + +# Find the part 1, by the comment +/^[ \t]*# bleh windows$/b part1_start +# Not found the part1, raise an error +$ q1 +b + +:part1_start +n +# The first line in the part 1 must be the begining of the case statement. +/^[ \t]*case \$host in$/! q1 +n +# Insert the entry for x86_64-*mingw32*, for modified versuffix. +i\ + x86_64-*mingw32*) +i\ + func_arith $current - $age +i\ + major=3D$func_arith_result +i\ + versuffix=3D"6-$major" +i\ + ;; +:part1_0 +# Find the end of the case statement +/^[ \t]*esac$/b find_part2 +# Not found the end of the case statement, raise an error +$ q1 +n +b part1_0 + +:find_part2 +/^[ \t]*# extension on DOS 8.3 file.*systems.$/b part2_process +# Not found the part2, raise an error +$ q1 +n +b find_part2 + +:part2_process +$ q1 +s/^[ \t]*\(versuffix=3D\)\(.*\)\(-$major\)\(.*\)$/\t case \$host in\n\t = x86_64-*mingw32*)\n\t \1\26\3\4\n\t ;;\n\t *)\n\t \1\2\3\4\n\t = ;;\n\t esac/ +t part2_done +n +b part2_process + +:part2_done +$ q0 +n +b part2_done diff --git a/grub-core/lib/libgcrypt/build-aux/ltmain.sh b/grub-core/lib/li= bgcrypt/build-aux/ltmain.sh new file mode 100644 index 000000000..bafa8fbb7 --- /dev/null +++ b/grub-core/lib/libgcrypt/build-aux/ltmain.sh @@ -0,0 +1,9664 @@ + +# libtool (GNU libtool) 2.4.2 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is = NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPO= SE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and e= xit +# --mode=3DMODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=3DTAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a pr= ogram +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=3DMODE' may be abbreviated as `MODE' or a unique abbreviation of= that. +# Try `$progname --help --mode=3DMODE' for a more detailed description of = MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=3Dlibtool +PACKAGE=3Dlibtool +VERSION=3D"2.4.2 Debian-2.4.2-1" +TIMESTAMP=3D"" +package_revision=3D1.3337 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=3D: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'=3D'"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=3Dxpg4; export BIN_SH # for Tru64 +DUALCASE=3D1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale=3D +lt_safe_locale=3D +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" =3D set; then + save_$lt_var=3D\$$lt_var + $lt_var=3DC + export $lt_var + lt_user_locale=3D\"$lt_var=3D\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=3D\"$lt_var=3DC; \$lt_safe_locale\" + fi" +done +LC_ALL=3DC +LANGUAGE=3DC +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath=3D"$0" + + + +: ${CP=3D"cp -f"} +test "${ECHO+set}" =3D set || ECHO=3D${as_echo-'printf %s\n'} +: ${MAKE=3D"make"} +: ${MKDIR=3D"mkdir"} +: ${MV=3D"mv -f"} +: ${RM=3D"rm -f"} +: ${SHELL=3D"${CONFIG_SHELL-/bin/sh}"} +: ${Xsed=3D"$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=3D0 +EXIT_FAILURE=3D1 +EXIT_MISMATCH=3D63 # $? =3D 63 is used to indicate version mismatch to mi= ssing. +EXIT_SKIP=3D77 # $? =3D 77 is used to indicate a skipped test to automak= e. + +exit_status=3D$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=3D' +' +IFS=3D" $lt_nl" + +dirname=3D"s,/[^/]*$,," +basename=3D"s,^.*/,," + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=3D`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" =3D "X${1}"; then + func_dirname_result=3D"${3}" + else + func_dirname_result=3D"$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=3D`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=3D`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" =3D "X${1}"; then + func_dirname_result=3D"${3}" + else + func_dirname_result=3D"$func_dirname_result${2}" + fi + func_basename_result=3D`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementa= tion + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=3D`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\$= {2}\$%%"`;; + *) func_stripname_result=3D`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\= $%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar=3D's,^/\([^/]*\).*$,\1,' +pathcdr=3D's,^/[^/]*,,' +removedotparts=3D':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes=3D's@/\{1,\}@/@g' +finalslash=3D's,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result=3D + func_normal_abspath_tpath=3D$1 + func_normal_abspath_altnamespace=3D + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=3D$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=3D/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=3D`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=3D`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" =3D / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=3D/ + fi + break + fi + func_normal_abspath_tcomponent=3D`$ECHO "$func_normal_abspath_tpath" |= $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=3D`$ECHO "$func_normal_abspath_tpath" | $SED= \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=3D$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=3D$func_normal_abspath_result/$func_nor= mal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=3D$func_normal_abspath_altnamespace$func_norm= al_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result=3D + func_normal_abspath "$1" + func_relative_path_tlibdir=3D$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=3D$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled=3D + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_pa= th_tbindir" + func_relative_path_tcancelled=3D$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=3D. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=3D${func_dirname_result} + if test "x$func_relative_path_tlibdir" =3D x ; then + # Have to descend all the way to the root! + func_relative_path_result=3D../$func_relative_path_result + func_relative_path_tcancelled=3D$func_relative_path_tbindir + break + fi + func_relative_path_result=3D../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=3D$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" !=3D x ; then + func_relative_path_result=3D${func_relative_path_result}/${func_stripn= ame_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=3D$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=3D$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=3D$func_dirname_result + progdir=3D`cd "$progdir" && pwd` + progpath=3D"$progdir/$progname" + ;; + *) + save_IFS=3D"$IFS" + IFS=3D${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS=3D"$save_IFS" + test -x "$progdir/$progname" && break + done + IFS=3D"$save_IFS" + test -n "$progdir" || progdir=3D`pwd` + progpath=3D"$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed=3D"${SED}"' -e 1s/^X//' +sed_quote_subst=3D's/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst=3D's/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex=3D's,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify=3D's|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Sed substitution to remove simple comments and empty +# lines from a Windows .def file. +sed_uncomment_deffile=3D'/^;/d; /^[ ]*$/d' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs=3D'\\' +bs2=3D'\\\\' +bs4=3D'\\\\\\\\' +dollar=3D'\$' +sed_double_backslash=3D"\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=3Dfalse +opt_help=3Dfalse +opt_quiet=3Dfalse +opt_verbose=3Dfalse +opt_warning=3D: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1= +"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help=3D"Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path=3D"$1" + my_dir_list=3D + + if test -n "$my_directory_path" && test "$opt_dry_run" !=3D ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path=3D"./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list=3D"$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=3D`$ECHO "$my_directory_path" | $SED -e "$dirnam= e"` + done + my_dir_list=3D`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS=3D"$IFS"; IFS=3D':' + for my_dir in $my_dir_list; do + IFS=3D"$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS=3D"$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a director= y. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template=3D"${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" =3D ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir=3D"${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=3D`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir=3D"${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=3D`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=3D`$ECHO "$1" | $SED "$sed_quote_subs= t"` ;; + *) + func_quote_for_eval_unquoted_result=3D"$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result=3D"\"$func_quote_for_eval_unquoted_resu= lt\"" + ;; + *) + func_quote_for_eval_result=3D"$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=3D`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg=3D"$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg=3D"\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result=3D"$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd=3D"$1" + my_fail_exp=3D"${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=3D$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd=3D"$1" + my_fail_exp=3D"${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=3D$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=3D`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0= -9_]/_/g'` + ;; + * ) + func_tr_sh_result=3D$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SE= D 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SE= D 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=3D$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=3Dexit +} + + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt=3D'1s/^\(..\).*$/\1/;q' + my_sed_short_rest=3D'1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=3D`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=3D`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=3D' sign. +func_split_long_opt () +{ + my_sed_long_opt=3D'1s/^\(--[^=3D]*\)=3D.*/\1/;q' + my_sed_long_arg=3D'1s/^--[^=3D]*=3D//' + + func_split_long_opt_name=3D`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=3D`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=3D: + + + + + +magic=3D"%%%MAGIC variable%%%" +magic_exe=3D"%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt=3D +preserve_args=3D +lo2o=3D"s/\\.lo\$/.${objext}/" +o2lo=3D"s/\\.${objext}\$/.lo/" +extracted_archives=3D +extracted_serial=3D0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd=3D + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=3D\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=3D\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=3D`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=3D`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=3D`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=3D`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf=3D'^# ### BEGIN LIBTOOL' + re_endcf=3D'^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG:= $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test "$build_libtool_libs" =3D yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" =3D yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname=3D"$1" + + re_begincf=3D"^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf=3D"^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf=3D"/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist=3D"$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=3D`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" !=3D "$macro_revision"; then + if test "$VERSION" !=3D "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSI= ON +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSI= ON +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $p= ackage_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_r= evision. +$progname: You should recreate aclocal.m4 with macros from revision $packa= ge_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=3Dfoo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=3D: +opt_dry_run=3Dfalse +opt_config=3Dfalse +opt_preserve_dup_deps=3Dfalse +opt_features=3Dfalse +opt_finish=3Dfalse +opt_help=3Dfalse +opt_help_all=3Dfalse +opt_silent=3D: +opt_warning=3D: +opt_verbose=3D: +opt_silent=3Dfalse +opt_verbose=3Dfalse + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt=3D"$1" + shift + case $opt in + --debug|-x) opt_debug=3D'set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=3D: + ;; + --config) + opt_config=3D: +func_config + ;; + --dlopen|-dlopen) + optarg=3D"$1" + opt_dlopen=3D"${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=3D: + ;; + --features) + opt_features=3D: +func_features + ;; + --finish) + opt_finish=3D: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=3D: + ;; + --help-all) + opt_help_all=3D: +opt_help=3D': help-all' + ;; + --mode) + test $# =3D 0 && func_missing_arg $opt && break + optarg=3D"$1" + opt_mode=3D"$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=3Dexit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=3Dfalse +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=3Dfalse +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=3Dfalse +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=3D: +func_append preserve_args " $opt" + opt_verbose=3Dfalse + ;; + --verbose|-v) + opt_verbose=3D: +func_append preserve_args " $opt" +opt_silent=3Dfalse + ;; + --tag) + test $# =3D 0 && func_missing_arg $opt && break + optarg=3D"$1" + opt_tag=3D"$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=3D*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$= @"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1= +"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt=3D"$opt" + shift + fi + + # preserve --debug + test "$opt_debug" =3D : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=3D: + ;; + *) + opt_duplicate_compiler_generated_deps=3D$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" !=3D yes && test "$build_old_libs" !=3D = yes; then + func_fatal_configuration "not configured to build any kind of librar= y" + fi + + # Darwin sucks + eval std_shrext=3D\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" !=3D execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help=3D"$help" + help=3D"Try \`$progname --help --mode=3D$opt_mode' for more informatio= n." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=3Dno + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=3Dyes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" =3D yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix=3D + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=3D.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result=3D"$func_dirname_result/$objdir/${fun= c_stripname_result}_ltshwrapper" +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=3D$IFS; IFS=3D'~' + for cmd in $1; do + IFS=3D$save_ifs + eval cmd=3D\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=3D$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading =3D in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=3D$1 + case $func_resolve_sysroot_result in + =3D*) + func_stripname '=3D' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=3D$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with =3D and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result=3D"=3D$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=3D$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted=3D + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=3D`func_echo_all $CC` + CC_quoted_expanded=3D`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_qu= oted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/nu= ll; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ###= END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted=3D + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=3D`func_echo_all $CC` + CC_quoted_expanded=3D`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quo= ted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=3D$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=3D${1} + if test "$build_libtool_libs" =3D yes; then + write_lobj=3D\'${2}\' + else + write_lobj=3Dnone + fi + + if test "$build_old_libs" =3D yes; then + write_oldobj=3D\'${3}\' + else + write_oldobj=3Dnone + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tm= p}"; then + func_convert_core_file_wine_to_w32_result=3D`$ECHO "$func_convert_co= re_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result=3D + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, a= nd +# $host is mingw, cygwin, or some other w32 environment. Relies on a corre= ctly +# configured wine environment available, with the winepath program in $bui= ld's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory= names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result=3D"" + if test -n "$1"; then + oldIFS=3D$IFS + IFS=3D: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=3D$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_= w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result=3D"$func_convert_core_= file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_co= nvert_core_file_wine_to_w32_result" + fi + fi + done + IFS=3D$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used = when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or = (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1)= or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file na= me +# or path in func_cygpath_result (input file name or path is assumed to be= in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or pat= h to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=3D`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result=3D + fi + else + func_cygpath_result=3D + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_= CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=3D`( cmd //c echo "$1" ) 2>/dev/nul= l | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result=3D"$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, reset= ting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" !=3D "x$2"; then + lt_replace_pathsep_chars=3D"s|$1|$2|g" + func_to_host_path_result=3D`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result=3D"$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRO= NTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result=3D"$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host forma= t. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return re= sult +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=3D$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=3D$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result=3D"$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result = in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result=3D"$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result=3D"$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result=3D"$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to= use + # LT_CYGPATH in this case. + func_to_host_file_result=3D`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environm= ent +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result=3D"$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result=3D"$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH s= et. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result=3D"$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result=3D"$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin insta= lled +# in a wine environment, working winepath, and LT_CYGPATH set. Returns re= sult +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result=3D"$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cy= gwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=3D"$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host forma= t. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. = If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinatio= ns, +# the two new functions must follow this pattern, or func_init_to_host_pat= h_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd=3D +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd=3D"func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result=3D"$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result = in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result=3D"$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=3D$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=3D"$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result=3D"$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=3D$func_stripname_result + func_to_host_path_result=3D`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment a= nd +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result=3D"$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=3D$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=3D"$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result=3D"$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=3D$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result=3D"$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed = in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns resul= t in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result=3D"$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=3D$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=3D"$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # Get the compilation command and the source file. + base_compile=3D + srcfile=3D"$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=3Dyes + suppress_output=3D + arg_mode=3Dnormal + libobj=3D + later=3D + pie_flag=3D + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg=3D"$arg" + arg_mode=3Dnormal + ;; + + target ) + libobj=3D"$arg" + arg_mode=3Dnormal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify \`-o' more than once" + arg_mode=3Dtarget + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=3Dno + continue + ;; + + -Xcompiler) + arg_mode=3Darg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=3D$func_stripname_result + lastarg=3D + save_ifs=3D"$IFS"; IFS=3D',' + for arg in $args; do + IFS=3D"$save_ifs" + func_append_quoted lastarg "$arg" + done + IFS=3D"$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=3D$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg=3D"$srcfile" + srcfile=3D"$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with \`-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj=3D"$func_basename_result" + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=3D$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=3D$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from \`$li= bobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test "$build_libtool_libs" !=3D yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=3Dno + continue + ;; + + -static) + build_libtool_libs=3Dno + build_old_libs=3Dyes + continue + ;; + + -prefer-pic) + pic_mode=3Dyes + continue + ;; + + -prefer-non-pic) + pic_mode=3Dno + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" !=3D "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell specia= l characters." + func_dirname_and_basename "$obj" "/" "" + objname=3D"$func_basename_result" + xdir=3D"$func_dirname_result" + lobj=3D${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" =3D yes; then + removelist=3D"$obj $lobj $libobj ${libobj}T" + else + removelist=3D"$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object ty= pes + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=3Ddefault + ;; + esac + if test "$pic_mode" =3D no && test "$deplibs_check_method" !=3D pass_a= ll; then + # non-PIC code in shared libraries is not supported + pic_mode=3Ddefault + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" =3D no; then + output_obj=3D`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${ob= jext} + lockfile=3D"$output_obj.lock" + else + output_obj=3D + need_locks=3Dno + lockfile=3D + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new f= ile + if test "$need_locks" =3D yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" =3D warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=3D$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=3D$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" =3D yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=3D$base_compile + + if test "$pic_mode" !=3D no; then + command=3D"$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command=3D"$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" =3D warn && + test "X`cat $lockfile 2>/dev/null`" !=3D "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" !=3D "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=3D$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" =3D yes; then + suppress_output=3D' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" =3D yes; then + if test "$pic_mode" !=3D yes; then + # Don't build PIC code + command=3D"$base_compile $qsrcfile$pie_flag" + else + command=3D"$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" =3D yes; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" =3D warn && + test "X`cat $lockfile 2>/dev/null`" !=3D "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" !=3D "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=3D$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" !=3D no; then + removelist=3D$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" =3D compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=3Dclean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each = FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be pass= ed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=3Dcompile COMPILE-COMMAND... SOURCEFI= LE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object f= ile +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=3Dexecute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlope= n' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translat= ed +into their corresponding uninstalled binary, and any of their required lib= rary +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=3Dfinish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=3Dinstall INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for instal= lation + +The rest of the components are interpreted as arguments to that command (o= nly +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=3Dlink LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbo= ls + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dls= ym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symb= ols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify ob= jects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LI= BDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and librari= es + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool l= ibraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults t= o 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or libr= ary +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object f= ile +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=3Duninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each = FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be pass= ed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" =3D :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean;= do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean;= do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=3D\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd=3D"$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir=3D + case $file in + *.la) + func_resolve_sysroot "$file" + file=3D$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname=3D + library_names=3D + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir=3D"$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir= '" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir=3D"$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=3D`cd "$dir" && pwd` + test -n "$absdir" && dir=3D"$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=3D\"\$dir\"" + else + eval "$shlibpath_var=3D\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic=3D"$magic" + + # Check if any of the arguments is a wrapper script. + args=3D + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file=3D"$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file=3D"$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if test "X$opt_dry_run" =3D Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" =3D set; then + $lt_var=3D\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd=3D"\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=3D\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" =3D execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs=3D + libdirs=3D + admincmds=3D + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=3D`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_reg= ex"` + sysroot_cmd=3D"s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd=3D + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=3D' prefixes fro= m $lib" + done + else + tmpdir=3D`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=3D/\1/g; s/\([ ']\)=3D/\1/g" $li= b \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds=3D"$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=3D\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "--------------------------------------------------------------= --------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDI= R'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=3DLIBDIR + eval flag=3D\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf= '" + fi + echo + + echo "See any operating system documentation about shared libraries = for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "--------------------------------------------------------------= --------" + fi + exit $EXIT_SUCCESS +} + +test "$opt_mode" =3D finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" =3D "$SHELL" || test "$nonopt" =3D /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog=3D"$func_quote_for_eval_result " + arg=3D$1 + shift + else + install_prog=3D + arg=3D$nonopt + fi + + # The real first argument should be the name of the installation progr= am. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=3D$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=3D: ;; + *) install_cp=3Dfalse ;; + esac + + # We need to accept at least all the BSD install flags. + dest=3D + files=3D + opts=3D + prev=3D + install_type=3D + isdir=3Dno + stripme=3D + no_mode=3D: + for arg + do + arg2=3D + if test -n "$dest"; then + func_append files " $dest" + dest=3D$arg + continue + fi + + case $arg in + -d) isdir=3Dyes ;; + -f) + if $install_cp; then :; else + prev=3D$arg + fi + ;; + -g | -m | -o) + prev=3D$arg + ;; + -s) + stripme=3D" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" =3D x-m && test -n "$install_override_mode"; then + arg2=3D$install_override_mode + no_mode=3Dfalse + fi + prev=3D + else + dest=3D$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=3D$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=3Dyes + if test "$isdir" =3D yes; then + destdir=3D"$dest" + destname=3D + else + func_dirname_and_basename "$dest" "" "." + destdir=3D"$func_dirname_result" + destname=3D"$func_basename_result" + + # Not a directory, so check to see that there is only one file speci= fied. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=3D"$magic" + + staticlibs=3D + future_libdirs=3D + current_libdirs=3D + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=3D$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names=3D + old_library=3D + relink_command=3D + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" =3D "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir=3D"$func_dirname_result" + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=3D`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" =3D "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not e= nding in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=3D`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@= %-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=3D`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@= %%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command b= efore installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname=3D"$1" + shift + + srcname=3D"$realname" + test -n "$relink_command" && srcname=3D"$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme=3D"$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme=3D"" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" !=3D "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $= RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib=3D"$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name=3D"$func_basename_result" + instname=3D"$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=3D"$destdir/$destname" + else + func_basename "$file" + destfile=3D"$func_basename_result" + destfile=3D"$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=3D$func_lo2o_result + ;; + *.$objext) + staticdest=3D"$destfile" + destfile=3D + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" =3D yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=3D$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=3D"$destdir/$destname" + else + func_basename "$file" + destfile=3D"$func_basename_result" + destfile=3D"$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext=3D"" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=3D$func_stripname_result + stripped_ext=3D".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=3D$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=3D$func_stripname_result + fi + ;; + *) + wrapper=3D$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs=3D + relink_command=3D + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=3Dyes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir=3D + if test -f "$lib"; then + func_source "$lib" + fi + libfile=3D"$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: = skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=3Dno + fi + done + + relink_command=3D + func_source "$wrapper" + + outputname=3D + if test "$fast_install" =3D no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" =3D yes; then + tmpdir=3D`func_mktempdir` + func_basename "$file$stripped_ext" + file=3D"$func_basename_result" + outputname=3D"$tmpdir/$file" + # Replace the output file specification. + relink_command=3D`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$o= utputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before insta= lling it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file=3D"$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=3D`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=3D$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=3D$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name=3D"$func_basename_result" + + # Set up the ranlib parameters. + oldlib=3D"$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=3D$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=3D" -n$current_libdirs" + exec_cmd=3D'$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" =3D install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname=3D"$1" + my_originator=3D"$2" + my_pic_p=3D"${3-no}" + my_prefix=3D`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms=3D + + if test -n "$dlfiles$dlprefiles" || test "$dlself" !=3D no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms=3D"${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened fil= es" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist=3D"$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulat= ion. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ =3D=3D 4) && (__GNUC_MINOR__ >=3D 4))= || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tes= ts. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. = */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" =3D yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=3D`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_r= esult'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_= pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols=3D"$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< = "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname= .def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"'= < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlis= t"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name=3D"$func_basename_result" + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=3D\$libfile_$func_tr_sh_result" + dlprefile_dlbasename=3D"" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=3D`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename=3D"$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=3D$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_s= ymbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_s= ymbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_sym= bol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dl= syms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] =3D +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir= /$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$ou= tput_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable=3D + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=3D" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=3D" $pic_flag" ;; + *) + if test "X$my_pic_p" !=3D Xno; then + pic_flag_for_symtable=3D" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags=3D + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_f= lag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${n= list}T"' + + # Transform the symbol file into the correct name. + symfileobj=3D"$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=3D`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$outp= ut_objdir/$my_outputname.def $symfileobj%"` + finalize_command=3D`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$ou= tput_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=3D`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symf= ileobj%"` + finalize_command=3D`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$sy= mfileobj%"` + fi + ;; + *) + compile_command=3D`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfil= eobj%"` + finalize_command=3D`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symf= ileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=3D`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=3D`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%= "` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type=3D"unknown" + win32_fileres=3D`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type=3D"x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHO= D. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|= pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=3D`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type=3D"x86 archive import";; + *) win32_libid_type=3D"x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type=3D"x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type=3D"x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=3D`$DLLTOOL --identify-strict --identify "= $1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=3D`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/=3D=3D=3D=3DMARK=3D=3D=3D=3D/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^=3D=3D=3D=3DMARK=3D=3D=3D=3D/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^=3D=3D=3D=3DMARK=3D=3D=3D=3D/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^=3D=3D=3D=3DMARK=3D=3D=3D=3D// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=3D`$NM "$func_to_tool_file_result" | eval "$= global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[a= d]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=3D`$NM "$func_to_tool_file_result" | eval "$g= lobal_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=3D`func_cygming_dll_for_implib_fallback_= core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=3D`func_cygming_dll_for_implib_fallback_= core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result=3D"" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir=3D"$1"; shift + f_ex_an_ar_oldlib=3D"$1" + if test "$lock_old_archive_extraction" =3D yes; then + lockfile=3D$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")= " \ + 'stat=3D$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" =3D yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/= $f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop=3D"$1"; shift + my_oldlibs=3D${1+"$@"} + my_oldobjs=3D"" + my_xlib=3D"" + my_xabs=3D"" + my_xdir=3D"" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=3D"$my_xlib" ;; + *) my_xabs=3D`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib=3D"$func_basename_result" + my_xlib_u=3D$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=3D$func_arith_result + my_xlib_u=3Dlt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives=3D"$extracted_archives $my_xlib_u" + my_xdir=3D"$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=3D`pwd` + cd $my_xdir || exit $? + darwin_archive=3D$my_xabs + darwin_curdir=3D`pwd` + darwin_base_archive=3D`basename "$darwin_archive"` + darwin_arches=3D`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Arch= itectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=3D`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch=3D + func_verbose "$darwin_base_archive has multiple architectures $darwin= _arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-$= {darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_a= rchive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them u= p :) + darwin_filelist=3D`find unfat-$$ -type f -name \*.o -print -o -name \= *.lo -print | $SED -e "$basename" | sort -u` + darwin_file=3D + darwin_files=3D + for darwin_file in $darwin_filelist; do + darwin_files=3D`find unfat-$$ -name $darwin_file -print | sort | $N= L2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs=3D"$my_oldobjs "`find $my_xdir -name \*.$objext -print -o= -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result=3D"$my_oldobjs" +} + + +# func_emit_wrapper [arg=3Dno] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=3D${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst=3D'$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=3D: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'=3D'\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=3Dxpg4; export BIN_SH # for Tru64 +DUALCASE=3D1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=3D\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" =3D \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version=3D'$macro_version' + notinst_deplibs=3D'$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" !=3D \"$magic\"; then + file=3D\"\$0\"" + + qECHO=3D`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=3D\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug=3D +func_parse_lt_options () +{ + lt_script_arg0=3D\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=3D1 ;; + --lt-dump-script) + lt_dump_D=3D\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e '= s%/[^/]*$%%'\` + test \"X\$lt_dump_D\" =3D \"X\$lt_script_arg0\" && lt_dump_D=3D. + lt_dump_F=3D\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e '= s%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKA= GE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=3D1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]= : \$lt_arg\" + lt_dump_args_N=3D\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir= \\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir= /\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=3D\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" =3D \"x\$file\" && thisdir=3D. + + # Follow symbolic links until we get to the real thisdir. + file=3D\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=3D\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" !=3D \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=3D\"\$destdir\" ;; + *) thisdir=3D\"\$thisdir/\$destdir\" ;; + esac + fi + + file=3D\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=3D\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=3D$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" =3D \"yes\"; then + # special case for '.' + if test \"\$thisdir\" =3D \".\"; then + thisdir=3D\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=3D\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^= \\\\/]*$%%'\` ;; + $objdir ) thisdir=3D. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=3D\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=3D\"\$absdir\" +" + + if test "$fast_install" =3D yes; then + $ECHO "\ + program=3Dlt-'$outputname'$exeext + progdir=3D\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=3D\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\"= 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" !=3D \"X\$progdir/\$program\"; }; then + + file=3D\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=3D\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program=3D'$outputname' + progdir=3D\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=3D$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" =3D yes && test -n "$shlibpath_var= " && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=3D\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=3D\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" !=3D \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) =3D=3D DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) =3D=3D DIR_SEPARATOR) || ((ch) =3D=3D DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) =3D=3D PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) =3D=3D PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale =3D 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug =3D 1; +#else +static int lt_debug =3D 0; +#endif + +const char *program_name =3D "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <=3D 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval =3D 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >=3D 0) + { + rval =3D chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash =3D 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper =3D=3D NULL) || (*wrapper =3D=3D '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] =3D=3D ':') + { + concat_name =3D xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name =3D xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p =3D wrapper; *p; p++) + if (*p =3D=3D '/') + { + has_slash =3D 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path =3D getenv ("PATH"); + if (path !=3D NULL) + { + for (p =3D path; *p; p =3D p_next) + { + const char *q; + size_t p_len; + for (q =3D p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len =3D q - p; + p_next =3D (*q =3D=3D '\0' ? q : q + 1); + if (p_len =3D=3D 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) =3D=3D NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len =3D strlen (tmp); + concat_name =3D + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] =3D '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name =3D + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] =3D '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) =3D=3D NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len =3D strlen (tmp); + concat_name =3D XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] =3D '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec =3D xstrdup (pathspec); + char *p; + int has_symlinks =3D 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) =3D=3D 0) + { + if (S_ISLNK (s.st_mode) !=3D 0) + { + has_symlinks =3D 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p =3D tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p =3D=3D tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p =3D '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec =3D realpath (pathspec, buf); + if (tmp_pathspec =3D=3D 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str !=3D NULL); + assert (pat !=3D NULL); + + len =3D strlen (str); + patlen =3D strlen (pat); + + if (patlen <=3D len) + { + str +=3D len - patlen; + if (strcmp (str, pat) =3D=3D 0) + *str =3D '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >=3D 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str =3D xstrdup (value); + setenv (name, str, 1); +#else + int len =3D strlen (name) + 1 + strlen (value) + 1; + char *str =3D XMALLOC (char, len); + sprintf (str, "%s=3D%s", name, value); + if (putenv (str) !=3D EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len =3D strlen (orig_value); + int add_len =3D strlen (add); + new_value =3D XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value =3D xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value =3D lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len =3D strlen (new_value); + while (((len =3D strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_= value[len-1])) + { + new_value[len-1] =3D '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value =3D lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") !=3D NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize =3D sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId =3D=3D VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and cal= ls + CreateProcess(). We must quote the arguments since Win32 CreateProcess= () + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') i= n a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect= is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >=3D 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012= \013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\03= 5\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\0= 14\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\= 037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc =3D 0; argv[argc] !=3D NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv =3D XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i =3D 0; i < argc; i++) + { + const char *string =3D argv[i]; + + if (string[0] =3D=3D '\0') + new_argv[i] =3D xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) !=3D NULL) + { + int quote_around =3D (strpbrk (string, SHELL_SPACE_CHARS) !=3D NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length =3D 0; + backslashes =3D 0; + if (quote_around) + length++; + for (s =3D string; *s !=3D '\0'; s++) + { + char c =3D *s; + if (c =3D=3D '"') + length +=3D backslashes + 1; + length++; + if (c =3D=3D '\\') + backslashes++; + else + backslashes =3D 0; + } + if (quote_around) + length +=3D backslashes + 1; + + quoted_string =3D XMALLOC (char, length + 1); + + p =3D quoted_string; + backslashes =3D 0; + if (quote_around) + *p++ =3D '"'; + for (s =3D string; *s !=3D '\0'; s++) + { + char c =3D *s; + if (c =3D=3D '"') + { + unsigned int j; + for (j =3D backslashes + 1; j > 0; j--) + *p++ =3D '\\'; + } + *p++ =3D c; + if (c =3D=3D '\\') + backslashes++; + else + backslashes =3D 0; + } + if (quote_around) + { + unsigned int j; + for (j =3D backslashes; j > 0; j--) + *p++ =3D '\\'; + *p++ =3D '"'; + } + *p =3D '\0'; + + new_argv[i] =3D quoted_string; + } + else + new_argv[i] =3D (char *) string; + } + new_argv[argc] =3D NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=3Dno + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=3Dyes + ;; + *) + allow_undefined=3Dyes + ;; + esac + libtool_args=3D$nonopt + base_compile=3D"$nonopt $@" + compile_command=3D$nonopt + finalize_command=3D$nonopt + + compile_rpath=3D + finalize_rpath=3D + compile_shlibpath=3D + finalize_shlibpath=3D + convenience=3D + old_convenience=3D + deplibs=3D + old_deplibs=3D + compiler_flags=3D + linker_flags=3D + dllsearchpath=3D + lib_search_path=3D`pwd` + inst_prefix_dir=3D + new_inherited_linker_flags=3D + + avoid_version=3Dno + bindir=3D + dlfiles=3D + dlprefiles=3D + dlself=3Dno + export_dynamic=3Dno + export_symbols=3D + export_symbols_regex=3D + generated=3D + libobjs=3D + ltlibs=3D + module=3Dno + no_install=3Dno + objs=3D + non_pic_objects=3D + precious_files_regex=3D + prefer_static_libs=3Dno + preload=3Dno + prev=3D + prevarg=3D + release=3D + rpath=3D + xrpath=3D + perm_rpath=3D + temp_rpath=3D + thread_safe=3Dno + vinfo=3D + vinfo_number=3Dno + weak_libs=3D + single_module=3D"${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" !=3D yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=3Dno + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" =3D yes && test -z "$link_static_flag"; t= hen + func_warning "complete static linking is impossible in this configura= tion" + fi + if test -n "$link_static_flag"; then + dlopen_self=3D$dlopen_self_static + fi + prefer_static_libs=3Dyes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=3D$dlopen_self_static + fi + prefer_static_libs=3Dbuilt + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=3D$dlopen_self_static + fi + prefer_static_libs=3Dyes + ;; + esac + build_libtool_libs=3Dno + build_old_libs=3Dyes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=3Dyes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg=3D"$1" + shift + func_quote_for_eval "$arg" + qarg=3D$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir=3D"$arg" + prev=3D + continue + ;; + dlfiles|dlprefiles) + if test "$preload" =3D no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=3Dyes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" =3D no; then + dlself=3Dneedless + export_dynamic=3Dyes + fi + prev=3D + continue + ;; + self) + if test "$prev" =3D dlprefiles; then + dlself=3Dyes + elif test "$prev" =3D dlfiles && test "$dlopen_self" !=3D yes; then + dlself=3Dyes + else + dlself=3Dneedless + export_dynamic=3Dyes + fi + prev=3D + continue + ;; + *) + if test "$prev" =3D dlfiles; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev=3D + continue + ;; + esac + ;; + expsyms) + export_symbols=3D"$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev=3D + continue + ;; + expsyms_regex) + export_symbols_regex=3D"$arg" + prev=3D + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev=3D + continue + ;; + inst_prefix) + inst_prefix_dir=3D"$arg" + prev=3D + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=3D$arg + moreargs=3D + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=3D$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object=3D + non_pic_object=3D + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" =3D none && + test "$non_pic_object" =3D none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=3D"$func_dirname_result" + + if test "$pic_object" !=3D none; then + # Prepend the subdirectory the object is found in. + pic_object=3D"$xdir$pic_object" + + if test "$prev" =3D dlfiles; then + if test "$build_libtool_libs" =3D yes && test "$dlopen_support" =3D = yes; then + func_append dlfiles " $pic_object" + prev=3D + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=3Ddlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" =3D dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev=3D + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=3D"$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" !=3D none; then + # Prepend the subdirectory the object is found in. + non_pic_object=3D"$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" =3D none ; then + arg=3D"$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=3D"$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=3D"$func_dirname_result" + + func_lo2o "$arg" + pic_object=3D$xdir$objdir/$func_lo2o_result + non_pic_object=3D$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=3D$save_arg + prev=3D + continue + ;; + precious_regex) + precious_files_regex=3D"$arg" + prev=3D + continue + ;; + release) + release=3D"-$arg" + prev=3D + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" =3D rpath; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev=3D + continue + ;; + shrext) + shrext_cmds=3D"$arg" + prev=3D + continue + ;; + weak) + func_append weak_libs " $arg" + prev=3D + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev=3D + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev=3D + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev=3D + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=3D\"\$arg\"" + prev=3D + continue + ;; + esac + fi # test -n "$prev" + + prevarg=3D"$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the = default" + ;; + + -avoid-version) + avoid_version=3Dyes + continue + ;; + + -bindir) + prev=3Dbindir + continue + ;; + + -dlopen) + prev=3Ddlfiles + continue + ;; + + -dlpreopen) + prev=3Ddlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=3Dyes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allow= ed" + fi + if test "X$arg" =3D "X-export-symbols"; then + prev=3Dexpsyms + else + prev=3Dexpsyms_regex + fi + continue + ;; + + -framework) + prev=3Dframework + continue + ;; + + -inst-prefix-dir) + prev=3Dinst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=3D$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=3D`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir=3D"$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =3D*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=3D`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=3D$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=3D$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" =3D "X-lc" || test "X$arg" =3D "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku= *) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" =3D "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" =3D "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" =3D "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" =3D "X-lc" && continue + ;; + esac + elif test "X$arg" =3D "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -module) + module=3Dyes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=3Dxcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=3D*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module=3D"${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=3Dno + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + # func_warning "\`-no-install' is ignored for $host" + # func_warning "assuming \`-no-fast-install' instead" + fast_install=3Dno + ;; + *) no_install=3Dyes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=3Dno + continue + ;; + + -objectlist) + prev=3Dobjectlist + continue + ;; + + -o) prev=3Doutput ;; + + -precious-files-regex) + prev=3Dprecious_regex + continue + ;; + + -release) + prev=3Drelease + continue + ;; + + -rpath) + prev=3Drpath + continue + ;; + + -R) + prev=3Dxrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=3D$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =3D*) + func_stripname '=3D' '' "$dir" + dir=3D$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=3Dshrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=3Dyes + continue + ;; + + -version-info) + prev=3Dvinfo + continue + ;; + + -version-number) + prev=3Dvinfo + vinfo_number=3Dyes + continue + ;; + + -weak) + prev=3Dweak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=3D$func_stripname_result + arg=3D + save_ifs=3D"$IFS"; IFS=3D',' + for flag in $args; do + IFS=3D"$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS=3D"$save_ifs" + func_stripname ' ' '' "$arg" + arg=3D$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=3D$func_stripname_result + arg=3D + save_ifs=3D"$IFS"; IFS=3D',' + for flag in $args; do + IFS=3D"$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS=3D"$save_ifs" + func_stripname ' ' '' "$arg" + arg=3D$func_stripname_result + ;; + + -Xcompiler) + prev=3Dxcompiler + continue + ;; + + -Xlinker) + prev=3Dxlinker + continue + ;; + + -XCClinker) + prev=3Dxcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg=3D"$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=3D*, -xtarget=3D* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=3D* Portland pgcc target processor selection + # --sysroot=3D* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimizat= ion + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=3D*|-xtarget=3D*|+DA*|+DD*|-q*|-= m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=3D*|--sys= root=3D*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + func_quote_for_eval "$arg" + arg=3D"$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg=3D"$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object=3D + non_pic_object=3D + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" =3D none && + test "$non_pic_object" =3D none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=3D"$func_dirname_result" + + if test "$pic_object" !=3D none; then + # Prepend the subdirectory the object is found in. + pic_object=3D"$xdir$pic_object" + + if test "$prev" =3D dlfiles; then + if test "$build_libtool_libs" =3D yes && test "$dlopen_support" =3D= yes; then + func_append dlfiles " $pic_object" + prev=3D + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=3Ddlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" =3D dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev=3D + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=3D"$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" !=3D none; then + # Prepend the subdirectory the object is found in. + non_pic_object=3D"$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" =3D none ; then + arg=3D"$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=3D"$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=3D"$func_dirname_result" + + func_lo2o "$arg" + pic_object=3D$xdir$objdir/$func_lo2o_result + non_pic_object=3D$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test "$prev" =3D dlfiles; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev=3D + elif test "$prev" =3D dlprefiles; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev=3D + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg=3D"$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" =3D yes && test -n "$export_dynamic_flag_spe= c"; then + eval arg=3D\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs=3D + # calculate the name of the file, without its directory + func_basename "$output" + outputname=3D"$func_basename_result" + libobjs_save=3D"$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=3D\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'= s/:/ /g\'\` + else + shlib_search_path=3D + fi + eval sys_lib_search_path=3D\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=3D\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir=3D"$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=3D$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=3Doldlib ;; + *.lo | *.$objext) linkmode=3Dobj ;; + *.la) linkmode=3Dlib ;; + *) linkmode=3Dprog ;; # Anything else should be a program. + esac + + specialdeplibs=3D + + libs=3D + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps ; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test "$linkmode" =3D lib; then + libs=3D"$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps=3D + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps=3D + fi + + deplibs=3D + newdependency_libs=3D + newlib_search_path=3D + need_relink=3Dno # whether we're linking any uninstalled libtool libra= ries + notinst_deplibs=3D # not-installed libtool libraries + notinst_path=3D # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes=3D"conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $fi= le" + ;; + esac + done + ;; + prog) + compile_deplibs=3D + finalize_deplibs=3D + alldeplibs=3Dno + newdlfiles=3D + newdlprefiles=3D + passes=3D"conv scan dlopen dlpreopen link" + ;; + *) passes=3D"conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" =3D "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs=3D + for deplib in $deplibs; do + tmp_deplibs=3D"$deplib $tmp_deplibs" + done + deplibs=3D"$tmp_deplibs" + fi + + if test "$linkmode,$pass" =3D "lib,link" || + test "$linkmode,$pass" =3D "prog,scan"; then + libs=3D"$deplibs" + deplibs=3D + fi + if test "$linkmode" =3D prog; then + case $pass in + dlopen) libs=3D"$dlfiles" ;; + dlpreopen) libs=3D"$dlprefiles" ;; + link) + libs=3D"$deplibs %DEPLIBS%" + test "X$link_all_deplibs" !=3D Xno && libs=3D"$libs $dependency_libs" + ;; + esac + fi + if test "$linkmode,$pass" =3D "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs=3D + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=3D$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs=3D"$dlprefiles" + fi + if test "$pass" =3D dlopen; then + # Collect dlpreopened libraries + save_deplibs=3D"$deplibs" + deplibs=3D + fi + + for deplib in $libs; do + lib=3D + found=3Dno + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=3D*) + if test "$linkmode,$pass" =3D "prog,link"; then + compile_deplibs=3D"$deplib $compile_deplibs" + finalize_deplibs=3D"$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test "$linkmode" =3D lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" !=3D lib && test "$linkmode" !=3D prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=3D$func_stripname_result + if test "$linkmode" =3D lib; then + searchdirs=3D"$newlib_search_path $lib_search_path $compiler_lib_sear= ch_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs=3D"$newlib_search_path $lib_search_path $sys_lib_search_pa= th $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib=3D"$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" =3D ".la"; then + found=3Dyes + else + found=3Dno + fi + break 2 + fi + done + done + if test "$found" !=3D yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" =3D "prog,link"; then + compile_deplibs=3D"$deplib $compile_deplibs" + finalize_deplibs=3D"$deplib $finalize_deplibs" + else + deplibs=3D"$deplib $deplibs" + test "$linkmode" =3D lib && newdependency_libs=3D"$deplib $newdepen= dency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" =3D "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names=3D + old_library=3D + func_source "$lib" + for l in $old_library $library_names; do + ll=3D"$l" + done + if test "X$ll" =3D "X$old_library" ; then # only static version availa= ble + found=3Dno + func_dirname "$lib" "" "." + ladir=3D"$func_dirname_result" + lib=3D$ladir/$old_library + if test "$linkmode,$pass" =3D "prog,link"; then + compile_deplibs=3D"$deplib $compile_deplibs" + finalize_deplibs=3D"$deplib $finalize_deplibs" + else + deplibs=3D"$deplib $deplibs" + test "$linkmode" =3D lib && newdependency_libs=3D"$deplib $newdepe= ndency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" =3D "prog,link"; then + compile_deplibs=3D"$deplib $compile_deplibs" + finalize_deplibs=3D"$deplib $finalize_deplibs" + else + deplibs=3D"$deplib $deplibs" + if test "$linkmode" =3D lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs=3D"$deplib $deplibs" + test "$pass" =3D conv && continue + newdependency_libs=3D"$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test "$pass" =3D conv; then + deplibs=3D"$deplib $deplibs" + continue + fi + if test "$pass" =3D scan; then + deplibs=3D"$deplib $deplibs" + else + compile_deplibs=3D"$deplib $compile_deplibs" + finalize_deplibs=3D"$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" =3D link; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=3D$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs=3D"$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=3D$func_resolve_sysroot_result + ;; + *.$libext) + if test "$pass" =3D conv; then + deplibs=3D"$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=3Dno + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=3D`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=3Dyes + fi + ;; + pass_all) + valid_a_lib=3Dyes + ;; + esac + if test "$valid_a_lib" !=3D yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link = in when" + echo "*** you link to this library. But I can only do this if you have = a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me= believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs=3D"$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" !=3D link; then + deplibs=3D"$deplib $deplibs" + else + compile_deplibs=3D"$deplib $compile_deplibs" + finalize_deplibs=3D"$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" =3D conv; then + deplibs=3D"$deplib $deplibs" + elif test "$linkmode" =3D prog; then + if test "$pass" =3D dlpreopen || test "$dlopen_support" !=3D yes || t= est "$build_libtool_libs" =3D no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs=3D"$deplib $compile_deplibs" + finalize_deplibs=3D"$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=3Dyes + continue + ;; + esac # case $deplib + + if test "$found" =3D yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument= \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir=3D"$func_dirname_result" + + dlname=3D + dlopen=3D + dlpreopen=3D + libdir=3D + library_names=3D + old_library=3D + inherited_linker_flags=3D + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=3Dyes + shouldnotlink=3Dno + avoidtemprpath=3D + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=3D`$ECHO "$inherited_linker_flags" | $SED 's= /-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_f= lag";; + esac + done + fi + dependency_libs=3D`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltfram= ework% -framework \1%g'` + if test "$linkmode,$pass" =3D "lib,link" || + test "$linkmode,$pass" =3D "prog,scan" || + { test "$linkmode" !=3D prog && test "$linkmode" !=3D lib; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test "$pass" =3D conv; then + # Only check for convenience libraries + deplibs=3D"$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs=3D + for deplib in $dependency_libs; do + deplibs=3D"$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + elif test "$linkmode" !=3D prog && test "$linkmode" !=3D lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + continue + fi # $pass =3D conv + + + # Get the name of the library we link against. + linklib=3D + if test -n "$old_library" && + { test "$prefer_static_libs" =3D yes || + test "$prefer_static_libs,$installed" =3D "built,no"; }; then + linklib=3D$old_library + else + for l in $old_library $library_names; do + linklib=3D"$l" + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" =3D dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" !=3D yes || + test "$build_libtool_libs" =3D no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass =3D dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=3D"$ladir" ;; + *) + abs_ladir=3D`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might f= ail" + abs_ladir=3D"$ladir" + fi + ;; + esac + func_basename "$lib" + laname=3D"$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" =3D Xyes; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$link= lib"; then + func_warning "library \`$lib' was moved." + dir=3D"$ladir" + absdir=3D"$abs_ladir" + libdir=3D"$abs_ladir" + else + dir=3D"$lt_sysroot$libdir" + absdir=3D"$lt_sysroot$libdir" + fi + test "X$hardcode_automatic" =3D Xyes && avoidtemprpath=3Dyes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"= ; then + dir=3D"$ladir" + absdir=3D"$abs_ladir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir=3D"$ladir/$objdir" + absdir=3D"$abs_ladir/$objdir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed =3D yes + func_stripname 'lib' '.la' "$laname" + name=3D$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" =3D dlpreopen; then + if test -z "$libdir" && test "$linkmode" =3D prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library= : \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=3D\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass =3D dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" =3D lib; then + deplibs=3D"$dir/$old_library $deplibs" + elif test "$linkmode,$pass" =3D "prog,link"; then + compile_deplibs=3D"$dir/$old_library $compile_deplibs" + finalize_deplibs=3D"$dir/$old_library $finalize_deplibs" + else + deplibs=3D"$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" =3D prog && test "$pass" !=3D link; then + func_append newlib_search_path " $ladir" + deplibs=3D"$lib $deplibs" + + linkalldeplibs=3Dno + if test "$link_all_deplibs" !=3D no || test -z "$library_names" || + test "$build_libtool_libs" =3D no; then + linkalldeplibs=3Dyes + fi + + tmp_libs=3D + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" =3D yes; then + deplibs=3D"$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs=3D"$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode =3D prog... + + if test "$linkmode,$pass" =3D "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" =3D no || + test "$prefer_static_libs,$installed" =3D "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass =3D prog,link... + + if test "$alldeplibs" =3D yes && + { test "$deplibs_check_method" =3D pass_all || + { test "$build_libtool_libs" =3D yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=3Dno # Whether the deplib will be linked statically + use_static_libs=3D$prefer_static_libs + if test "$use_static_libs" =3D built && test "$installed" =3D yes; then + use_static_libs=3Dno + fi + if test -n "$library_names" && + { test "$use_static_libs" =3D no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=3Dno + ;; + *) + if test "$installed" =3D no; then + func_append notinst_deplibs " $lib" + need_relink=3Dyes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule=3D"" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" =3D "X$lib"; then + dlopenmodule=3D"$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" =3D yes && test "$p= ass" =3D link; then + echo + if test "$linkmode" =3D prog; then + $ECHO "*** Warning: Linking the executable $output against the load= able module" + else + $ECHO "*** Warning: Linking the shared library $output against the = loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" =3D lib && + test "$hardcode_into_libs" =3D yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname=3D"$1" + shift + libname=3D`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname=3D"$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=3D$func_arith_result + versuffix=3D"-$major" + ;; + esac + eval soname=3D\"$soname_spec\" + else + soname=3D"$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot=3D"$soname" + func_basename "$soroot" + soname=3D"$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=3Dlibimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=3D$output_objdir + linklib=3D$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" =3D prog || test "$opt_mode" !=3D relink; then + add_shlibpath=3D + add_dir=3D + add=3D + lib_linked=3Dyes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" =3D no; then + add=3D"$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir=3D"-L$dir" ;; + *-*-sysv4*uw2*) add_dir=3D"-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir=3D"-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" !=3D "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add=3D"$dir/$old_library" + fi + elif test -n "$old_library"; then + add=3D"$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" =3D no; then + case $host in + *-*-sunos*) add_shlibpath=3D"$dir" ;; + esac + add_dir=3D"-L$dir" + add=3D"-l$name" + elif test "$hardcode_shlibpath_var" =3D no; then + add_shlibpath=3D"$dir" + add=3D"-l$name" + else + lib_linked=3Dno + fi + ;; + relink) + if test "$hardcode_direct" =3D yes && + test "$hardcode_direct_absolute" =3D no; then + add=3D"$dir/$linklib" + elif test "$hardcode_minus_L" =3D yes; then + add_dir=3D"-L$absdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=3D"-l$name" + elif test "$hardcode_shlibpath_var" =3D yes; then + add_shlibpath=3D"$dir" + add=3D"-l$name" + else + lib_linked=3Dno + fi + ;; + *) lib_linked=3Dno ;; + esac + + if test "$lib_linked" !=3D yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test "$linkmode" =3D prog; then + test -n "$add_dir" && compile_deplibs=3D"$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs=3D"$add $compile_deplibs" + else + test -n "$add_dir" && deplibs=3D"$add_dir $deplibs" + test -n "$add" && deplibs=3D"$add $deplibs" + if test "$hardcode_direct" !=3D yes && + test "$hardcode_minus_L" !=3D yes && + test "$hardcode_shlibpath_var" =3D yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" =3D prog || test "$opt_mode" =3D relink; then + add_shlibpath=3D + add_dir=3D + add=3D + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" =3D yes && + test "$hardcode_direct_absolute" =3D no; then + add=3D"$libdir/$linklib" + elif test "$hardcode_minus_L" =3D yes; then + add_dir=3D"-L$libdir" + add=3D"-l$name" + elif test "$hardcode_shlibpath_var" =3D yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add=3D"-l$name" + elif test "$hardcode_automatic" =3D yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add=3D"$inst_prefix_dir$libdir/$linklib" + else + add=3D"$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir=3D"-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=3D"-l$name" + fi + + if test "$linkmode" =3D prog; then + test -n "$add_dir" && finalize_deplibs=3D"$add_dir $finalize_deplib= s" + test -n "$add" && finalize_deplibs=3D"$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs=3D"$add_dir $deplibs" + test -n "$add" && deplibs=3D"$add $deplibs" + fi + fi + elif test "$linkmode" =3D prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" !=3D unsupported; then + test -n "$old_library" && linklib=3D"$old_library" + compile_deplibs=3D"$dir/$linklib $compile_deplibs" + finalize_deplibs=3D"$dir/$linklib $finalize_deplibs" + else + compile_deplibs=3D"-l$name -L$dir $compile_deplibs" + finalize_deplibs=3D"-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" =3D yes; then + # Not a shared library + if test "$deplibs_check_method" !=3D pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system can not link to static lib archive $l= ib." + echo "*** I have the capability to make that library automatically li= nk in when" + echo "*** you link to this library. But I can only do this if you ha= ve a" + echo "*** shared version of the library, which you do not appear to h= ave." + if test "$module" =3D yes; then + echo "*** But as you try to build a module library, libtool will st= ill create " + echo "*** a static module, that should work as long as the dlopenin= g application" + echo "*** is linked with the -dlopen flag to resolve symbols at run= time." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract s= ymbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool c= ould" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" =3D no; then + build_libtool_libs=3Dmodule + build_old_libs=3Dyes + else + build_libtool_libs=3Dno + fi + fi + else + deplibs=3D"$dir/$old_library $deplibs" + link_static=3Dyes + fi + fi # link shared/static library? + + if test "$linkmode" =3D lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" !=3D yes || + test "$build_old_libs" =3D yes || + test "$link_static" =3D yes; }; then + # Extract -R from dependency_libs + temp_deplibs=3D + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=3D$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs=3D"$temp_deplibs" + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test "$link_static" =3D no && newdependency_libs=3D"$abs_ladir/$laname = $newdependency_libs" + # ... and its dependency_libs + tmp_libs=3D + for deplib in $dependency_libs; do + newdependency_libs=3D"$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result"= ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" !=3D no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path=3D + case $deplib in + -L*) path=3D"$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=3D$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=3D$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir=3D"$dir" ;; + *) + absdir=3D`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir=3D"$dir" + fi + ;; + esac + if $GREP "^installed=3Dno" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl=3D + eval deplibrary_names=3D`${SED} -n -e 's/^library_names=3D\(.*\)$/\1/p= ' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=3D$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl=3D"$absdir/$objdir/$depdepl" + darwin_install_name=3D`${OTOOL} -L $depdepl | awk '{if (NR =3D=3D = 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=3D`${OTOOL64} -L $depdepl |= awk '{if (NR =3D=3D 2) {print $1;exit}}'` + fi + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_instal= l_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${de= pdepl}" + path=3D + fi + fi + ;; + *) + path=3D"-L$absdir/$objdir" + ;; + esac + else + eval libdir=3D`${SED} -n -e 's/^libdir=3D\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" !=3D "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path=3D"-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs=3D"$path $deplibs" ;; + esac + done + fi # link_all_deplibs !=3D no + fi # linkmode =3D lib + done # for deplib in $libs + if test "$pass" =3D link; then + if test "$linkmode" =3D "prog"; then + compile_deplibs=3D"$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs=3D"$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags=3D"$compiler_flags "`$ECHO " $new_inherited_linker_flags= " | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs=3D"$newdependency_libs" + if test "$pass" =3D dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs=3D"$deplib $deplibs" + done + fi + if test "$pass" !=3D dlopen; then + if test "$pass" !=3D conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path=3D + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path=3D + fi + + if test "$linkmode,$pass" !=3D "prog,link"; then + vars=3D"deplibs" + else + vars=3D"compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=3D\"\$$var\" + new_libs=3D + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs=3D"$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs=3D"$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs=3D"$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs=3D"$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs=3D + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=3D\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs=3D + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i=3D"" + ;; + esac + if test -n "$i" ; then + func_append tmp_libs " $i" + fi + done + dependency_libs=3D$tmp_libs + done # for pass + if test "$linkmode" =3D prog; then + dlfiles=3D"$newdlfiles" + fi + if test "$linkmode" =3D prog || test "$linkmode" =3D lib; then + dlprefiles=3D"$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" !=3D no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=3Dno + oldlibs=3D"$output" + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=3D$func_stripname_result + eval shared_ext=3D\"$shrext_cmds\" + eval libname=3D\"$libname_spec\" + ;; + *) + test "$module" =3D no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" !=3D no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=3D$func_stripname_result + eval shared_ext=3D\"$shrext_cmds\" + eval libname=3D\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=3D$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" !=3D pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libt= ool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-= libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test "$dlself" !=3D no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir=3D"$1" + + oldlibs=3D + if test -z "$rpath"; then + if test "$build_libtool_libs" =3D yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs=3D"$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=3Dconvenience + build_old_libs=3Dyes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenien= ce libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs=3D"$IFS"; IFS=3D':' + set dummy $vinfo 0 0 0 + shift + IFS=3D"$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major=3D"$1" + number_minor=3D"$2" + number_revision=3D"$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=3D$func_arith_result + age=3D"$number_minor" + revision=3D"$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current=3D"$number_major" + revision=3D"$number_minor" + age=3D"0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=3D$func_arith_result + age=3D"$number_minor" + revision=3D"$number_minor" + lt_irix_increment=3Dno + ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$= version_type'" + ;; + esac + ;; + no) + current=3D"$1" + revision=3D"$2" + age=3D"$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0= -9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0= -9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0= -9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`= $current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major=3D + versuffix=3D + verstring=3D + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=3D.$func_arith_result + versuffix=3D"$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=3D$func_arith_result + xlcverstring=3D"${wl}-compatibility_version ${wl}$minor_current ${wl}-c= urrent_version ${wl}$minor_current.$revision" + verstring=3D"-compatibility_version $minor_current -current_version $mi= nor_current.$revision" + ;; + + freebsd-aout) + major=3D".$current" + versuffix=3D".$current.$revision"; + ;; + + freebsd-elf) + major=3D".$current" + versuffix=3D".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" =3D "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=3D$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=3Dnonstopux ;; + *) verstring_prefix=3Dsgi ;; + esac + verstring=3D"$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=3D$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=3D$func_arith_result + func_arith $loop - 1 + loop=3D$func_arith_result + verstring=3D"$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=3D.$major + versuffix=3D"$major.$revision" + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=3D.$func_arith_result + versuffix=3D"$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=3D.$func_arith_result + versuffix=3D".$current.$age.$revision" + verstring=3D"$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=3D$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=3D$func_arith_result + func_arith $loop - 1 + loop=3D$func_arith_result + verstring=3D"$verstring:${iface}.0" + done + + # Make executables depend on our current version. + func_append verstring ":${current}.0" + ;; + + qnx) + major=3D".$current" + versuffix=3D".$current" + ;; + + sunos) + major=3D".$current" + versuffix=3D".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=3D$func_arith_result + versuffix=3D"-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major=3D + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring=3D + ;; + *) + verstring=3D"0.0" + ;; + esac + if test "$need_version" =3D no; then + versuffix=3D + else + versuffix=3D".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" =3D yes && test "$need_version" =3D no; then + major=3D + versuffix=3D + verstring=3D"" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" =3D yes; then + if test "$allow_undefined_flag" =3D unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=3Dno + build_old_libs=3Dyes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag=3D"$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + func_append libobjs " $symfileobj" + test "X$libobjs" =3D "X " && libobjs=3D + + if test "$opt_mode" !=3D relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist=3D + tempremovelist=3D`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objd= ir/${libname}${release}.*) + if test "X$precious_files_regex" !=3D "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" =3D yes && test "$build_libtool_libs" !=3D= convenience ; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs=3D"$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo= 2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=3D`$ECHO "$lib_search_path " | $SED "s% $path % %g= "` + # deplibs=3D`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=3D`$ECHO "$dependency_libs " | $SED "s% -L$path % = %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath=3D + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test "$hardcode_into_libs" !=3D yes || test "$build_old_libs" =3D yes;= then + dependency_libs=3D"$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreop= ened + old_dlfiles=3D"$dlfiles" + dlfiles=3D + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles=3D"$dlprefiles" + dlprefiles=3D + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test "$build_libtool_libs" =3D yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* = | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" =3D "yes"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=3D$name + libname_save=3D$libname + release_save=3D$release + versuffix_save=3D$versuffix + major_save=3D$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release=3D"" + versuffix=3D"" + major=3D"" + newdeplibs=3D + droppeddeps=3Dno + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=3D$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=3D`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib=3D"$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=3D`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib=3D"$potliblink";; + *) potlib=3D`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib=3D"" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=3Dyes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_d= eplib." + echo "*** I have the capability to make that library automatically link = in when" + echo "*** you link to this library. But I can only do this if you have = a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file startin= g" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file ma= gic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file form= at test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=3D`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=3D$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" =3D "Xyes" ; th= en + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib=3D"" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=3D`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=3D`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib=3D"$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib=3D"" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=3Dyes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_d= eplib." + echo "*** I have the capability to make that library automatically link = in when" + echo "*** you link to this library. But I can only do this if you have = a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file startin= g" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex p= attern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file form= at test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs=3D"" + tmp_deplibs=3D`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" =3D "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=3D`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" =3D "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in = this platform." + else + echo "*** Warning: inter-library dependencies are not known to be s= upported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=3Dyes + ;; + esac + ;; + esac + versuffix=3D$versuffix_save + major=3D$major_save + release=3D$release_save + libname=3D$libname_save + name=3D$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=3D`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework = /'` + ;; + esac + + if test "$droppeddeps" =3D yes; then + if test "$module" =3D yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-libra= ry" + $ECHO "*** dependencies of module $libname. Therefore, libtool will = create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extr= act symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libt= ool could" + echo "*** not find such a program. So, this module is probably use= less." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" =3D no; then + oldlibs=3D"$output_objdir/$libname.$libext" + build_libtool_libs=3Dmodule + build_old_libs=3Dyes + else + build_libtool_libs=3Dno + fi + else + echo "*** The inter-library dependencies that have been dropped here = will be" + echo "*** automatically added whenever a program is linked with this = library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" =3D no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" =3D no; then + oldlibs=3D"$output_objdir/$libname.$libext" + build_libtool_libs=3Dmodule + build_old_libs=3Dyes + else + build_libtool_libs=3Dno + fi + fi + fi + fi + # Done checking deplibs! + deplibs=3D$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework= foo" + case $host in + *-*-darwin*) + newdeplibs=3D`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -= framework \1%g'` + new_inherited_linker_flags=3D`$ECHO " $new_inherited_linker_flags" | $S= ED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=3D`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framew= ork \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs=3D + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs=3D"$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names=3D + old_library=3D + dlname=3D + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" =3D yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl=3D ;; + esac + if test "$hardcode_into_libs" =3D yes; then + # Hardcode the library paths + hardcode_libdirs=3D + dep_rpath=3D + rpath=3D"$finalize_rpath" + test "$opt_mode" !=3D relink && rpath=3D"$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=3D$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=3D"$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separ= ator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=3D\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=3D"$hardcode_libdirs" + eval "dep_rpath=3D\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath=3D + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var=3D'$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs=3D"$dep_rpath $deplibs" + fi + + shlibpath=3D"$finalize_shlibpath" + test "$opt_mode" !=3D relink && shlibpath=3D"$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var=3D'$shlibpath\$$shlibpath_var'; export $shlibpath_= var" + fi + + # Get the real and link names of the library. + eval shared_ext=3D\"$shrext_cmds\" + eval library_names=3D\"$library_names_spec\" + set dummy $library_names + shift + realname=3D"$1" + shift + + if test -n "$soname_spec"; then + eval soname=3D\"$soname_spec\" + else + soname=3D"$realname" + fi + if test -z "$dlname"; then + dlname=3D$soname + fi + + lib=3D"$output_objdir/$realname" + linknames=3D + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=3D`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o= " | $NL2SP` + test "X$libobjs" =3D "X " && libobjs=3D + + delfiles=3D + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols=3D"$output_objdir/$libname.uexp" + func_append delfiles " $export_symbols" + fi + + orig_export_symbols=3D + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED "$sed_uncomment_deffile" $export_symbols | $SED 1q`" = !=3D xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols=3D"$export_symbols" + export_symbols=3D + always_export_symbols=3Dyes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" =3D yes || test -n "$export_symbols_re= gex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols=3D"$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=3D$export_symbols_cmds + save_ifs=3D"$IFS"; IFS=3D'~' + for cmd1 in $cmds; do + IFS=3D"$save_ifs" + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=3Dyes + eval cmd=3D\"$cmd1\" + func_len " $cmd" + len=3D$func_len_result + ;; + *) + try_normal_branch=3Dno + ;; + esac + if test "$try_normal_branch" =3D yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=3Dfalse + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=3D$func_basename_result + save_libobjs=3D$libobjs + save_output=3D$output + output=3D${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=3D$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=3D\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=3D$save_output + libobjs=3D$save_libobjs + skipped_export=3Dfalse + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=3D: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS=3D"$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" !=3D "X= :"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols"= > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=3D"$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols=3D"$orig_export_sy= mbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export= _symbols"' + fi + + if test "X$skipped_export" !=3D "X:" && test -n "$orig_export_symbols"; t= hen + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,= ' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=3D$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_s= ymbols > $export_symbols + fi + + tmp_deplibs=3D + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs=3D"$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" =3D yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec=3D + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=3D$libobjs + eval libobjs=3D\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" =3D "X " && libobjs=3D + else + gentop=3D"$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" =3D "X " && libobjs=3D + fi + fi + + if test "$thread_safe" =3D yes && test -n "$thread_safe_flag_spec"; then + eval flag=3D\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" =3D relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $re= alname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" =3D yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=3D\"$module_expsym_cmds\" + cmds=3D$module_expsym_cmds + else + eval test_cmds=3D\"$module_cmds\" + cmds=3D$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=3D\"$archive_expsym_cmds\" + cmds=3D$archive_expsym_cmds + else + eval test_cmds=3D\"$archive_cmds\" + cmds=3D$archive_cmds + fi + fi + + if test "X$skipped_export" !=3D "X:" && + func_len " $test_cmds" && + len=3D$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=3D$libobjs + fi + save_output=3D$output + func_basename "$output" + output_la=3D$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds=3D + concat_cmds=3D + objlist=3D + last_robj=3D + k=3D1 + + if test -n "$save_libobjs" && test "X$skipped_export" !=3D "X:" && test= "$with_gnu_ld" =3D yes; then + output=3D${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=3D$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" !=3D "X:" && te= st "X$file_list_spec" !=3D X; then + output=3D${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj=3D + if test "$compiler_needs_object" =3D yes; then + firstobj=3D"$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=3D$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=3D$output_objdir/$output_la-${k}.$objext + eval test_cmds=3D\"$reload_cmds\" + func_len " $test_cmds" + len0=3D$func_len_result + len=3D$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=3D$func_arith_result + if test "X$objlist" =3D X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=3D$objlist + eval concat_cmds=3D\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs=3D"$objlist $last_robj" + eval concat_cmds=3D\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=3D$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=3D$func_arith_result + output=3D$output_objdir/$output_la-${k}.$objext + objlist=3D" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=3D$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=3D$concat_cmds~ + reload_objs=3D"$objlist $last_robj" + eval concat_cmds=3D\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=3D\"\${concat_cmds}~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output=3D + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols=3D"$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=3D$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=3D$concat_cmds~ + eval concat_cmds=3D\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=3D\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs=3D"$IFS"; IFS=3D'~' + for cmd in $concat_cmds; do + IFS=3D"$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=3D$? + + # Restore the uninstalled library and exit + if test "$opt_mode" =3D relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=3D"$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols"= > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=3D"$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols=3D"$orig_expor= t_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_ex= port_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exp= orts" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1= \2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filt= er" + export_symbols=3D$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_expo= rt_symbols > $export_symbols + fi + fi + + libobjs=3D$output + # Restore the value of output. + output=3D$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=3D\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" =3D "X " && libobjs=3D + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" =3D yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=3D$module_expsym_cmds + else + cmds=3D$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=3D$archive_expsym_cmds + else + cmds=3D$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=3D\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=3D"$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" =3D "X " && libobjs=3D + fi + + save_ifs=3D"$IFS"; IFS=3D'~' + for cmd in $cmds; do + IFS=3D"$save_ifs" + eval cmd=3D\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=3D$? + + # Restore the uninstalled library and exit + if test "$opt_mode" =3D relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=3D"$save_ifs" + + # Restore the uninstalled library and exit + if test "$opt_mode" =3D relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $re= alname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" !=3D "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$re= alname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" =3D yes || test "$export_dynamic" =3D yes; then + # On all known operating systems, these are identical. + dlname=3D"$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" !=3D no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libto= ol objects" + + libobj=3D$output + func_lo2o "$libobj" + obj=3D$func_lo2o_result + ;; + *) + libobj=3D + obj=3D"$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs=3D + gentop=3D + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl=3D + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=3D\"$whole_archive_flag_spec\" + reload_conv_objs=3D$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $S= ED 's|,| |g'` + else + gentop=3D"$output_objdir/${obj}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs=3D"$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" !=3D yes && libobjs=3D"$non_pic_objects" + + # Create the old-style object. + reload_objs=3D"$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED = "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### tests= uite: skip nested quoting test + + output=3D"$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" !=3D yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" !=3D default; then + # Only do commands if we really have different PIC objects. + reload_objs=3D"$libobjs $reload_conv_objs" + output=3D"$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=3D$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" =3D yes \ + && test "$dlopen_support" =3D unknown \ + && test "$dlopen_self" =3D unknown \ + && test "$dlopen_self_static" =3D unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support= ." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=3D`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltfr= amework /'` + finalize_deplibs=3D`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.lt= framework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" =3D CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=3D`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltfram= ework% -framework \1%g'` + finalize_deplibs=3D`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltfr= amework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs=3D + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs=3D"$new_libs" + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath=3D + hardcode_libdirs=3D + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=3D"$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_se= parator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=3D\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=3D`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=3D$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=3D$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=3D"$hardcode_libdirs" + eval rpath=3D\" $hardcode_libdir_flag_spec\" + fi + compile_rpath=3D"$rpath" + + rpath=3D + hardcode_libdirs=3D + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=3D"$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_se= parator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=3D\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=3D"$hardcode_libdirs" + eval rpath=3D\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath=3D"$rpath" + + if test -n "$libobjs" && test "$build_old_libs" =3D yes; then + # Transform all the library objects into standard objects. + compile_command=3D`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL= 2SP` + finalize_command=3D`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $= NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=3Dyes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross com= piling anyway. + wrappers_required=3Dno + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" !=3D yes; then + wrappers_required=3Dno + fi + ;; + *) + if test "$need_relink" =3D no || test "$build_libtool_libs" !=3D y= es; then + wrappers_required=3Dno + fi + ;; + esac + if test "$wrappers_required" =3D no; then + # Replace the output file specification. + compile_command=3D`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"= '%g'` + link_command=3D"$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=3D0 + func_show_eval "$link_command" 'exit_status=3D$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=3D`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'= "$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command=3D"$shlibpath_var=3D\"$compile_shlibpath$finalize_shlibpa= th\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command=3D"$shlibpath_var=3D\"$finalize_shlibpath\$$shlibpath_va= r\" $finalize_command" + fi + + compile_var=3D + finalize_var=3D + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath=3D + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var=3D"$runpath_var=3D\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath=3D + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var=3D"$runpath_var=3D\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" =3D yes; then + # We don't need to create a wrapper script. + link_command=3D"$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=3D`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=3D`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'= "$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" =3D relink; then + # Fast installation is not supported + link_command=3D"$compile_var$compile_command$compile_rpath" + relink_command=3D"$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" !=3D no; then + link_command=3D"$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" =3D yes; then + relink_command=3D`$ECHO "$compile_var$compile_command$compile_rpath" = | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command=3D + fi + else + link_command=3D"$compile_var$compile_command$compile_rpath" + relink_command=3D"$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=3D`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_o= bjdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdi= r/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=3D`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$= output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_res= ult"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command=3D"{ test -z \"\${$var+set}\" || $lt_unset $var || { $= var=3D; export $var; }; }; $relink_command" + elif eval var_value=3D\$$var; test -z "$var_value"; then + relink_command=3D"$var=3D; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command=3D"$var=3D$func_quote_for_eval_result; export $var; $r= elink_command" + fi + done + relink_command=3D"(cd `pwd`; $relink_command)" + relink_command=3D`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=3D$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=3D.exe + func_stripname '' '.exe' "$outputname" + outputname=3D$func_stripname_result ;; + *) exeext=3D ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=3D$func_basename_result + output_path=3D$func_dirname_result + cwrappersource=3D"$output_path/$objdir/lt-$output_name.c" + cwrapper=3D"$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 = 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" =3D "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" =3D convenience; then + oldobjs=3D"$libobjs_save $symfileobj" + addlibs=3D"$convenience" + build_libtool_libs=3Dno + else + if test "$build_libtool_libs" =3D module; then + oldobjs=3D"$libobjs_save" + build_libtool_libs=3Dno + else + oldobjs=3D"$old_deplibs $non_pic_objects" + if test "$preload" =3D yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs=3D"$old_convenience" + fi + + if test -n "$addlibs"; then + gentop=3D"$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs= " =3D yes; then + cmds=3D$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=3D"$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop=3D"$output_objdir/${outputname}x" + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=3D$oldobjs + oldobjs=3D + counter=3D1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase=3D"$func_basename_result" + case " $oldobjs " in + " ") oldobjs=3D$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=3Dlt$counter-$objbase + func_arith $counter + 1 + counter=3D$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=3D$func_to_tool_file_result + eval cmds=3D\"$old_archive_cmds\" + + func_len " $cmds" + len=3D$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=3D$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=3D" $archiver_list_spec$func_to_tool_file_result" + cmds=3D$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=3D$RANLIB + RANLIB=3D: + objlist=3D + concat_cmds=3D + save_oldobjs=3D$oldobjs + oldobjs=3D + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=3D$obj + done + eval test_cmds=3D\"$old_archive_cmds\" + func_len " $test_cmds" + len0=3D$func_len_result + len=3D$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=3D$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=3D$objlist + if test "$obj" =3D "$last_oldobj" ; then + RANLIB=3D$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=3D$concat_cmds~ + eval concat_cmds=3D\"\${concat_cmds}$old_archive_cmds\" + objlist=3D + len=3D$len0 + fi + done + RANLIB=3D$save_RANLIB + oldobjs=3D$objlist + if test "X$oldobjs" =3D "X" ; then + eval cmds=3D\"\$concat_cmds\" + else + eval cmds=3D\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library=3D + test "$build_old_libs" =3D yes && old_library=3D"$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command=3D"{ test -z \"\${$var+set}\" || $lt_unset $var || { $va= r=3D; export $var; }; }; $relink_command" + elif eval var_value=3D\$$var; test -z "$var_value"; then + relink_command=3D"$var=3D; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command=3D"$var=3D$func_quote_for_eval_result; export $var; $rel= ink_command" + fi + done + # Quote the link command for shipping. + relink_command=3D"(cd `pwd`; $SHELL $progpath $preserve_args --mode= =3Drelink $libtool_args @inst_prefix_dir@)" + relink_command=3D`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" =3D yes ; then + relink_command=3D + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" =3D yes; then + if test -z "$install_libdir"; then + break + fi + output=3D"$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs=3D + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name=3D"$func_basename_result" + func_resolve_sysroot "$deplib" + eval libdir=3D`${SED} -n -e 's/^libdir=3D\(.*\)$/\1/p' $func_resolve_sys= root_result` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=3D}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs=3D"$newdependency_libs" + newdlfiles=3D + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name=3D"$func_basename_result" + eval libdir=3D`${SED} -n -e 's/^libdir=3D\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=3D}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles=3D"$newdlfiles" + newdlprefiles=3D + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name=3D"$func_basename_result" + eval libdir=3D`${SED} -n -e 's/^libdir=3D\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=3D}$libdir/$name" + ;; + esac + done + dlprefiles=3D"$newdlprefiles" + else + newdlfiles=3D + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=3D"$lib" ;; + *) abs=3D`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles=3D"$newdlfiles" + newdlprefiles=3D + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=3D"$lib" ;; + *) abs=3D`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles=3D"$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=3D$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai= ,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" !=3D x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=3D$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=3D../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname=3D'$tdlname' + +# Names of this library. +library_names=3D'$library_names' + +# The name of the static archive. +old_library=3D'$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags=3D'$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs=3D'$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names=3D'$weak_libs' + +# Version information for $libname. +current=3D$current +age=3D$age +revision=3D$revision + +# Is this an already installed library? +installed=3D$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=3D$module + +# Files to dlopen/dlpreopen +dlopen=3D'$dlfiles' +dlpreopen=3D'$dlprefiles' + +# Directory that this library needs to be installed in: +libdir=3D'$install_libdir'" + if test "$installed" =3D no && test "$need_relink" =3D yes; then + $ECHO >> $output "\ +relink_command=3D\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S = "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$opt_mode" =3D link || test "$opt_mode" =3D relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM=3D"$nonopt" + files=3D + rmforce=3D + exit_status=3D0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=3D"$magic" + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=3Dyes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs=3D + + for file in $files; do + func_dirname "$file" "" "." + dir=3D"$func_dirname_result" + if test "X$dir" =3D X.; then + odir=3D"$objdir" + else + odir=3D"$dir/$objdir" + fi + func_basename "$file" + name=3D"$func_basename_result" + test "$opt_mode" =3D uninstall && odir=3D"$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" =3D clean; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=3D1 + continue + elif test "$rmforce" =3D yes; then + continue + fi + + rmfiles=3D"$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case "$opt_mode" in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" =3D yes ||= exit_status=3D1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" =3D ye= s || exit_status=3D1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" !=3D none; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" !=3D none; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" =3D clean ; then + noexename=3D$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=3D$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=3D$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command=3D + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command=3D + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" =3D yes && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" !=3D "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=3D1' + done + + # Try to remove the ${objdir}s in the directories where we deleted fil= es + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$opt_mode" =3D uninstall || test "$opt_mode" =3D clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$opt_mode" && { + help=3D"$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=3Dno +build_old_libs=3Dyes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=3D`case $build_libtool_libs in yes) echo no;; *) echo yes;;= esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=3D2 diff --git a/grub-core/lib/libgcrypt/build-aux/missing b/grub-core/lib/libg= crypt/build-aux/missing new file mode 100755 index 000000000..db98974ff --- /dev/null +++ b/grub-core/lib/libgcrypt/build-aux/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=3D2013-10-28.13; # UTC + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=3D$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg=3D"probably too old" +elif test $st -eq 127; then + # Program was missing. + msg=3D"missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=3Dhttp://www.perl.org/ +flex_URL=3Dhttp://flex.sourceforge.net/ +gnu_software_URL=3Dhttp://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run= :" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=3D`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps=3D"'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=3D" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/grub-core/lib/libgcrypt/build-aux/texinfo.tex b/grub-core/lib/= libgcrypt/build-aux/texinfo.tex new file mode 100644 index 000000000..5a17f9793 --- /dev/null +++ b/grub-core/lib/libgcrypt/build-aux/texinfo.tex @@ -0,0 +1,8638 @@ +% texinfo.tex -- TeX macros to handle Texinfo files. +% +% Load plain if necessary, i.e., if running under initex. +\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi +% +\def\texinfoversion{2007-05-03.09} +% +% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +% 2007 Free Software Foundation, Inc. +% +% This texinfo.tex file is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License as +% published by the Free Software Foundation; either version 3, or (at +% your option) any later version. +% +% This texinfo.tex file is distributed in the hope that it will be +% useful, but WITHOUT ANY WARRANTY; without even the implied warranty +% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this texinfo.tex file; see the file COPYING. If not, +% see . +% +% As a special exception, when this file is read by TeX when processing +% a Texinfo source document, you may use the result without +% restriction. (This has been our intent since Texinfo was invented.) +% +% Please try the latest version of texinfo.tex before submitting bug +% reports; you can get the latest version from: +% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or +% ftp://tug.org/tex/texinfo.tex +% (and all CTAN mirrors, see http://www.ctan.org). +% The texinfo.tex in any given distribution could well be out +% of date, so if that's what you're using, please check. +% +% Send bug reports to bug-texinfo@gnu.org. Please include including a +% complete document in each bug report with which we can reproduce the +% problem. Patches are, of course, greatly appreciated. +% +% To process a Texinfo manual with TeX, it's most reliable to use the +% texi2dvi shell script that comes with the distribution. For a simple +% manual foo.texi, however, you can get away with this: +% tex foo.texi +% texindex foo.?? +% tex foo.texi +% tex foo.texi +% dvips foo.dvi -o # or whatever; this makes foo.ps. +% The extra TeX runs get the cross-reference information correct. +% Sometimes one run after texindex suffices, and sometimes you need more +% than two; texi2dvi does it as many times as necessary. +% +% It is possible to adapt texinfo.tex for other languages, to some +% extent. You can get the existing language-specific files from the +% full Texinfo distribution. +% +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. + + +\message{Loading texinfo [version \texinfoversion]:} + +% If in a .fmt file, print the version number +% and turn on active characters that we couldn't do earlier because +% they might have appeared in the input file name. +\everyjob{\message{[Texinfo version \texinfoversion]}% + \catcode`+=3D\active \catcode`\_=3D\active} + + +\chardef\other=3D12 + +% We never want plain's \outer definition of \+ in Texinfo. +% For @tex, we can use \tabalign. +\let\+ =3D \relax + +% Save some plain tex macros whose names we will redefine. +\let\ptexb=3D\b +\let\ptexbullet=3D\bullet +\let\ptexc=3D\c +\let\ptexcomma=3D\, +\let\ptexdot=3D\. +\let\ptexdots=3D\dots +\let\ptexend=3D\end +\let\ptexequiv=3D\equiv +\let\ptexexclam=3D\! +\let\ptexfootnote=3D\footnote +\let\ptexgtr=3D> +\let\ptexhat=3D^ +\let\ptexi=3D\i +\let\ptexindent=3D\indent +\let\ptexinsert=3D\insert +\let\ptexlbrace=3D\{ +\let\ptexless=3D< +\let\ptexnewwrite\newwrite +\let\ptexnoindent=3D\noindent +\let\ptexplus=3D+ +\let\ptexrbrace=3D\} +\let\ptexslash=3D\/ +\let\ptexstar=3D\* +\let\ptext=3D\t + +% If this character appears in an error message or help string, it +% starts a new line in the output. +\newlinechar =3D `^^J + +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber =3D \empty % Pre-3.0. +\else + \def\linenumber{l.\the\inputlineno:\space} +\fi + +% Set up fixed words for English if not already set. +\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi +\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi +\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi +\ifx\putwordin\undefined \gdef\putwordin{in}\fi +\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is= empty)}\fi +\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Inde= x is nonexistent)}\fi +\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi +\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{I= nstance Variable of}\fi +\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi +\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi +\ifx\putwordof\undefined \gdef\putwordof{of}\fi +\ifx\putwordon\undefined \gdef\putwordon{on}\fi +\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi +\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi +\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi +\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi +\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi +\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi +\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi +% +\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi +\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi +\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi +\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi +\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi +\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi +\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi +\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi +\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi +\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi +\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi +\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi +% +\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi +\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi +\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi +\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi +\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi + +% Since the category of space is not known, we have to be careful. +\chardef\spacecat =3D 10 +\def\spaceisspace{\catcode`\ =3D\spacecat} + +% sometimes characters are active, so we need control sequences. +\chardef\colonChar =3D `\: +\chardef\commaChar =3D `\, +\chardef\dashChar =3D `\- +\chardef\dotChar =3D `\. +\chardef\exclamChar=3D `\! +\chardef\lquoteChar=3D `\` +\chardef\questChar =3D `\? +\chardef\rquoteChar=3D `\' +\chardef\semiChar =3D `\; +\chardef\underChar =3D `\_ + +% Ignore a token. +% +\def\gobble#1{} + +% The following is used inside several \edef's. +\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} + +% Hyphenation fixes. +\hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script + ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces + spell-ing spell-ings + stand-alone strong-est time-stamp time-stamps which-ever white-space + wide-spread wrap-around +} + +% Margin to add to right of even pages, to left of odd pages. +\newdimen\bindingoffset +\newdimen\normaloffset +\newdimen\pagewidth \newdimen\pageheight + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=3D0pt} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the outpu= t. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + +% Sometimes it is convenient to have everything in the transcript file +% and nothing on the terminal. We don't just call \tracingall here, +% since that produces some useless output on the terminal. We also make +% some effort to order the tracing commands to reduce output in the log +% file; cf. trace.sty in LaTeX. +% +\def\gloggingall{\begingroup \globaldefs =3D 1 \loggingall \endgroup}% +\def\loggingall{% + \tracingstats2 + \tracingpages1 + \tracinglostchars2 % 2 gives us more in etex + \tracingparagraphs1 + \tracingoutput1 + \tracingmacros2 + \tracingrestores1 + \showboxbreadth\maxdimen \showboxdepth\maxdimen + \ifx\eTeXversion\undefined\else % etex gives us more logging + \tracingscantokens1 + \tracingifs1 + \tracinggroups1 + \tracingnesting2 + \tracingassigns1 + \fi + \tracingcommands3 % 3 gives us more in etex + \errorcontextlines16 +}% + +% add check for \lastpenalty to plain's definitions. If the last thing +% we did was a \nobreak, we don't want to insert more space. +% +\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamou= nt + \removelastskip\penalty-50\smallskip\fi\fi} +\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount + \removelastskip\penalty-100\medskip\fi\fi} +\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount + \removelastskip\penalty-200\bigskip\fi\fi} + +% For @cropmarks command. +% Do @cropmarks to get crop marks. +% +\newif\ifcropmarks +\let\cropmarks =3D \cropmarkstrue +% +% Dimensions to add cropmarks at corners. +% Added by P. A. MacKay, 12 Nov. 1986 +% +\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +\newdimen\cornerlong \cornerlong=3D1pc +\newdimen\cornerthick \cornerthick=3D.3pt +\newdimen\topandbottommargin \topandbottommargin=3D.75in + +% Main output routine. +\chardef\PAGE =3D 255 +\output =3D {\onepageout{\pagecontents\PAGE}} + +\newbox\headlinebox +\newbox\footlinebox + +% \onepageout takes a vbox as an argument. Note that \pagecontents +% does insertions, but you have to call it yourself. +\def\onepageout#1{% + \ifcropmarks \hoffset=3D0pt \else \hoffset=3D\normaloffset \fi + % + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + % + % Do this outside of the \shipout so @code etc. will be expanded in + % the headline as they should be, not taken literally (outputting ''code= ). + \setbox\headlinebox =3D \vbox{\let\hsize=3D\pagewidth \makeheadline}% + \setbox\footlinebox =3D \vbox{\let\hsize=3D\pagewidth \makefootline}% + % + {% + % Have to do this stuff outside the \shipout because we want it to + % take effect in \write's, yet the group defined by the \vbox ends + % before the \shipout runs. + % + \indexdummies % don't expand commands in the output. + \normalturnoffactive % \ in index entries must not stay \, e.g., if + % the page break happens to be in the middle of an example. + % We don't want .vr (or whatever) entries like this: + % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym= }} + % "\acronym" won't work when it's read back in; + % it needs to be + % {\code {{\tt \backslashcurfont }acronym} + \shipout\vbox{% + % Do this early so pdf references go to the beginning of the page. + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi + % + \ifcropmarks \vbox to \outervsize\bgroup + \hsize =3D \outerhsize + \vskip-\topandbottommargin + \vtop to0pt{% + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% + \vss}% + \vskip\topandbottommargin + \line\bgroup + \hfil % center the page within the outer (page) hsize. + \ifodd\pageno\hskip\bindingoffset\fi + \vbox\bgroup + \fi + % + \unvbox\headlinebox + \pagebody{#1}% + \ifdim\ht\footlinebox > 0pt + % Only leave this space if the footline is nonempty. + % (We lessened \vsize for it in \oddfootingyyy.) + % The \baselineskip=3D24pt in plain's \makefootline has no effect. + \vskip 24pt + \unvbox\footlinebox + \fi + % + \ifcropmarks + \egroup % end of \vbox\bgroup + \hfil\egroup % end of (centering) \line\bgroup + \vskip\topandbottommargin plus1fill minus1fill + \boxmaxdepth =3D \cornerthick + \vbox to0pt{\vss + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% + }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% + }% + \egroup % \vbox from first cropmarks clause + \fi + }% end of \shipout\vbox + }% end of group with \indexdummies + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi +} + +\newinsert\margin \dimen\margin=3D\maxdimen + +\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=3D\maxdepth #1}} +{\catcode`\@ =3D11 +\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi +% marginal hacks, juha@viisa.uucp (Juha Takala) +\ifvoid\margin\else % marginal info is present + \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi +\dimen@=3D\dp#1 \unvbox#1 +\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi +\ifr@ggedbottom \kern-\dimen@ \vfil \fi} +} + +% Here are the rules for the cropmarks. Note that they are +% offset so that the space between them is truly \outerhsize or \outervsize +% (P. A. MacKay, 12 November, 1986) +% +\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} +\def\nstop{\vbox + {\hrule height\cornerthick depth\cornerlong width\cornerthick}} +\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} +\def\nsbot{\vbox + {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + +% Parse an argument, then pass it to #1. The argument is the rest of +% the input line (except we remove a trailing comment). #1 should be a +% macro which expects an ordinary undelimited TeX argument. +% +\def\parsearg{\parseargusing{}} +\def\parseargusing#1#2{% + \def\argtorun{#2}% + \begingroup + \obeylines + \spaceisspace + #1% + \parseargline\empty% Insert the \empty token, see \finishparsearg belo= w. +} + +{\obeylines % + \gdef\parseargline#1^^M{% + \endgroup % End of the group started in \parsearg. + \argremovecomment #1\comment\ArgTerm% + }% +} + +% First remove any @comment, then any @c comment. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} + +% Each occurrence of `\^^M' or `\^^M' is replaced by a single space. +% +% \argremovec might leave us with trailing space, e.g., +% @end itemize @c foo +% This space token undergoes the same procedure and is eventually removed +% by \finishparsearg. +% +\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} +\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} +\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% + \def\temp{#3}% + \ifx\temp\empty + % Do not use \next, perhaps the caller of \parsearg uses it; reuse \te= mp: + \let\temp\finishparsearg + \else + \let\temp\argcheckspaces + \fi + % Put the space token in: + \temp#1 #3\ArgTerm +} + +% If a _delimited_ argument is enclosed in braces, they get stripped; so +% to get _exactly_ the rest of the line, we had to prevent such situation. +% We prepended an \empty token at the very beginning and we expand it now, +% just before passing the control to \argtorun. +% (Similarly, we have to think about #3 of \argcheckspacesY above: it is +% either the null string, or it ends with \^^M---thus there is no danger +% that a pair of braces would be stripped. +% +% But first, we have to remove the trailing space token. +% +\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} + +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +% +% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my +% favourite TeX trick. --kasal, 16nov03 + +\def\parseargdef#1{% + \expandafter \doparseargdef \csname\string#1\endcsname #1% +} +\def\doparseargdef#1#2{% + \def#2{\parsearg#1}% + \def#1##1% +} + +% Several utility definitions with active space: +{ + \obeyspaces + \gdef\obeyedspace{ } + + % Make each space character in the input produce a normal interword + % space in the output. Don't allow a line break at this space, as this + % is used only in environments like @example, where each line of input + % should produce a line of output anyway. + % + \gdef\sepspaces{\obeyspaces\let =3D\tie} + + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\leavevmode \penalty \@M \ ). + \gdef\unsepspaces{\let =3D\space} +} + + +\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=3D\relax \fi \= next} + +% Define the framework for environments in texinfo.tex. It's used like th= is: +% +% \envdef\foo{...} +% \def\Efoo{...} +% +% It's the responsibility of \envdef to insert \begingroup before the +% actual body; @end closes the group after calling \Efoo. \envdef also +% defines \thisenv, so the current environment is known; @end checks +% whether the environment name matches. The \checkenv macro can also be +% used to check whether the current environment is the one expected. +% +% Non-false conditionals (@iftex, @ifset) don't fit into this, so they +% are not treated as environments; they don't open a group. (The +% implementation of @end takes care not to call \endgroup in this +% special case.) + + +% At runtime, environments start with this: +\def\startenvironment#1{\begingroup\def\thisenv{#1}} +% initialize +\let\thisenv\empty + +% ... but they get defined via ``\envdef\foo{...}'': +\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} +\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} + +% Check whether we're in the right environment: +\def\checkenv#1{% + \def\temp{#1}% + \ifx\thisenv\temp + \else + \badenverr + \fi +} + +% Environment mismatch, #1 expected: +\def\badenverr{% + \errhelp =3D \EMsimple + \errmessage{This command can appear only \inenvironment\temp, + not \inenvironment\thisenv}% +} +\def\inenvironment#1{% + \ifx#1\empty + out of any environment% + \else + in environment \expandafter\string#1% + \fi +} + +% @end foo executes the definition of \Efoo. +% But first, it executes a specialized version of \checkenv +% +\parseargdef\end{% + \if 1\csname iscond.#1\endcsname + \else + % The general wording of \badenverr may not be ideal, but... --kasal, = 06nov03 + \expandafter\checkenv\csname#1\endcsname + \csname E#1\endcsname + \endgroup + \fi +} + +\newhelp\EMsimple{Press RETURN to continue.} + + +%% Simple single-character @ commands + +% @@ prints an @ +% Kludge this until the fonts are right (grr). +\def\@{{\tt\char64}} + +% This is turned off because it was never documented +% and you can use @w{...} around a quote to suppress ligatures. +%% Define @` and @' to be the same as ` and ' +%% but suppressing ligatures. +%\def\`{{`}} +%\def\'{{'}} + +% Used to generate quoted braces. +\def\mylbrace {{\tt\char123}} +\def\myrbrace {{\tt\char125}} +\let\{=3D\mylbrace +\let\}=3D\myrbrace +\begingroup + % Definitions to produce \{ and \} commands for indices, + % and @{ and @} for the aux/toc files. + \catcode`\{ =3D \other \catcode`\} =3D \other + \catcode`\[ =3D 1 \catcode`\] =3D 2 + \catcode`\! =3D 0 \catcode`\\ =3D \other + !gdef!lbracecmd[\{]% + !gdef!rbracecmd[\}]% + !gdef!lbraceatcmd[@{]% + !gdef!rbraceatcmd[@}]% +!endgroup + +% @comma{} to avoid , parsing problems. +\let\comma =3D , + +% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent +% Others are defined by plain TeX: @` @' @" @^ @~ @=3D @u @v @H. +\let\, =3D \c +\let\dotaccent =3D \. +\def\ringaccent#1{{\accent23 #1}} +\let\tieaccent =3D \t +\let\ubaraccent =3D \b +\let\udotaccent =3D \d + +% Other special characters: @questiondown @exclamdown @ordf @ordm +% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. +\def\questiondown{?`} +\def\exclamdown{!`} +\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} + +% Dotless i and dotless j, used for accents. +\def\imacro{i} +\def\jmacro{j} +\def\dotless#1{% + \def\temp{#1}% + \ifx\temp\imacro \ptexi + \else\ifx\temp\jmacro \j + \else \errmessage{@dotless can be used only with i or j}% + \fi\fi +} + +% The \TeX{} logo, as in plain, but resetting the spacing so that a +% period following counts as ending a sentence. (Idea found in latex.) +% +\edef\TeX{\TeX \spacefactor=3D1000 } + +% @LaTeX{} logo. Not quite the same results as the definition in +% latex.ltx, since we use a different font for the raised A; it's most +% convenient for us to use an explicitly smaller font, rather than using +% the \scriptstyle font (since we don't reset \scriptstyle and +% \scriptscriptstyle). +% +\def\LaTeX{% + L\kern-.36em + {\setbox0=3D\hbox{T}% + \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}% + \kern-.15em + \TeX +} + +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ =3D 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty =3D \@M + \gdef\tie{\leavevmode\penalty\tiepenalty\ } +} + +% @: forces normal size whitespace following. +\def\:{\spacefactor=3D1000 } + +% @* forces a line break. +\def\*{\hfil\break\hbox{}\ignorespaces} + +% @/ allows a line break. +\let\/=3D\allowbreak + +% @. is an end-of-sentence period. +\def\.{.\spacefactor=3D\endofsentencespacefactor\space} + +% @! is an end-of-sentence bang. +\def\!{!\spacefactor=3D\endofsentencespacefactor\space} + +% @? is an end-of-sentence query. +\def\?{?\spacefactor=3D\endofsentencespacefactor\space} + +% @frenchspacing on|off says whether to put extra space after punctuation. +% +\def\onword{on} +\def\offword{off} +% +\parseargdef\frenchspacing{% + \def\temp{#1}% + \ifx\temp\onword \plainfrenchspacing + \else\ifx\temp\offword \plainnonfrenchspacing + \else + \errhelp =3D \EMsimple + \errmessage{Unknown @frenchspacing option `\temp', must be on/off}% + \fi\fi +} + +% @w prevents a word break. Without the \leavevmode, @w at the +% beginning of a paragraph, when TeX is still in vertical mode, would +% produce a whole line of output instead of starting the paragraph. +\def\w#1{\leavevmode\hbox{#1}} + +% @group ... @end group forces ... to be all on one page, by enclosing +% it in a TeX vbox. We use \vtop instead of \vbox to construct the box +% to keep its height that of a normal line. According to the rules for +% \topskip (p.114 of the TeXbook), the glue inserted is +% max (\topskip - \ht (first item), 0). If that height is large, +% therefore, no glue is inserted, and the space between the headline and +% the text is small, which looks bad. +% +% Another complication is that the group might be very large. This can +% cause the glue on the previous page to be unduly stretched, because it +% does not have much material. In this case, it's better to add an +% explicit \vfill so that the extra space is at the bottom. The +% threshold for doing this is if the group is more than \vfilllimit +% percent of a page (\vfilllimit can be changed inside of @tex). +% +\newbox\groupbox +\def\vfilllimit{0.7} +% +\envdef\group{% + \ifnum\catcode`\^^M=3D\active \else + \errhelp =3D \groupinvalidhelp + \errmessage{@group invalid in context where filling is enabled}% + \fi + \startsavinginserts + % + \setbox\groupbox =3D \vtop\bgroup + % Do @comment since we are called inside an environment such as + % @example, where each end-of-line in the input causes an + % end-of-line in the output. We don't want the end-of-line after + % the `@group' to put extra space in the output. Since @group + % should appear on a line by itself (according to the Texinfo + % manual), we don't worry about eating any user text. + \comment +} +% +% The \vtop produces a box with normal height and large depth; thus, TeX p= uts +% \baselineskip glue before it, and (when the next line of text is done) +% \lineskip glue after it. Thus, space below is not quite equal to space +% above. But it's pretty close. +\def\Egroup{% + % To get correct interline space between the last line of the group + % and the first line afterwards, we have to propagate \prevdepth. + \endgraf % Not \par, as it may have been set to \lisppar. + \global\dimen1 =3D \prevdepth + \egroup % End the \vtop. + % \dimen0 is the vertical size of the group's box. + \dimen0 =3D \ht\groupbox \advance\dimen0 by \dp\groupbox + % \dimen2 is how much space is left on the page (more or less). + \dimen2 =3D \pageheight \advance\dimen2 by -\pagetotal + % if the group doesn't fit on the current page, and it's a big big + % group, force a page break. + \ifdim \dimen0 > \dimen2 + \ifdim \pagetotal < \vfilllimit\pageheight + \page + \fi + \fi + \box\groupbox + \prevdepth =3D \dimen1 + \checkinserts +} +% +% TeX puts in an \escapechar (i.e., `@') at the beginning of the help +% message, so this ends up printing `@group can only ...'. +% +\newhelp\groupinvalidhelp{% +group can only be used in environments such as @example,^^J% +where each line of input produces a line of output.} + +% @need space-in-mils +% forces a page break if there is not space-in-mils remaining. + +\newdimen\mil \mil=3D0.001in + +% Old definition--didn't work. +%\parseargdef\need{\par % +%% This method tries to make TeX break the page naturally +%% if the depth of the box does not fit. +%{\baselineskip=3D0pt% +%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak +%\prevdepth=3D-1000pt +%}} + +\parseargdef\need{% + % Ensure vertical mode, so we don't make a big box in the middle of a + % paragraph. + \par + % + % If the @need value is less than one line space, it's useless. + \dimen0 =3D #1\mil + \dimen2 =3D \ht\strutbox + \advance\dimen2 by \dp\strutbox + \ifdim\dimen0 > \dimen2 + % + % Do a \strut just to make the height of this box be normal, so the + % normal leading is inserted relative to the preceding line. + % And a page break here is fine. + \vtop to #1\mil{\strut\vfil}% + % + % TeX does not even consider page breaks if a penalty added to the + % main vertical list is 10000 or more. But in order to see if the + % empty box we just added fits on the page, we must make it consider + % page breaks. On the other hand, we don't want to actually break the + % page after the empty box. So we use a penalty of 9999. + % + % There is an extremely small chance that TeX will actually break the + % page at this \penalty, if there are no other feasible breakpoints in + % sight. (If the user is using lots of big @group commands, which + % almost-but-not-quite fill up a page, TeX will have a hard time doing + % good page breaking, for example.) However, I could not construct an + % example where a page broke at this \penalty; if it happens in a real + % document, then we can reconsider our strategy. + \penalty9999 + % + % Back up by the size of the box, whether we did a page break or not. + \kern -#1\mil + % + % Do not allow a page break right after this kern. + \nobreak + \fi +} + +% @br forces paragraph break (and is undocumented). + +\let\br =3D \par + +% @page forces the start of a new page. +% +\def\page{\par\vfill\supereject} + +% @exdent text.... +% outputs text on separate line in roman font, starting at standard page m= argin + +% This records the amount of indent in the innermost environment. +% That's how much \exdent should take out. +\newskip\exdentamount + +% This defn is used inside fill environments such as @defun. +\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\bre= ak} + +% This defn is used inside nofill environments such as @example. +\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount + \leftline{\hskip\leftskip{\rm#1}}}} + +% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current +% paragraph. For more general purposes, use the \margin insertion +% class. WHICH is `l' or `r'. +% +\newskip\inmarginspacing \inmarginspacing=3D1cm +\def\strutdepth{\dp\strutbox} +% +\def\doinmargin#1#2{\strut\vadjust{% + \nobreak + \kern-\strutdepth + \vtop to \strutdepth{% + \baselineskip=3D\strutdepth + \vss + % if you have multiple lines of stuff to put here, you'll need to + % make the vbox yourself of the appropriate size. + \ifx#1l% + \llap{\ignorespaces #2\hskip\inmarginspacing}% + \else + \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% + \fi + \null + }% +}} +\def\inleftmargin{\doinmargin l} +\def\inrightmargin{\doinmargin r} +% +% @inmargin{TEXT [, RIGHT-TEXT]} +% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; +% else use TEXT for both). +% +\def\inmargin#1{\parseinmargin #1,,\finish} +\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. + \setbox0 =3D \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \def\lefttext{#1}% have both texts + \def\righttext{#2}% + \else + \def\lefttext{#1}% have only one text + \def\righttext{#1}% + \fi + % + \ifodd\pageno + \def\temp{\inrightmargin\righttext}% odd page -> outside is right marg= in + \else + \def\temp{\inleftmargin\lefttext}% + \fi + \temp +} + +% @include file insert text of that file as input. +% +\def\include{\parseargusing\filenamecatcodes\includezzz} +\def\includezzz#1{% + \pushthisfilestack + \def\thisfile{#1}% + {% + \makevalueexpandable + \def\temp{\input #1 }% + \expandafter + }\temp + \popthisfilestack +} +\def\filenamecatcodes{% + \catcode`\\=3D\other + \catcode`~=3D\other + \catcode`^=3D\other + \catcode`_=3D\other + \catcode`|=3D\other + \catcode`<=3D\other + \catcode`>=3D\other + \catcode`+=3D\other + \catcode`-=3D\other +} + +\def\pushthisfilestack{% + \expandafter\pushthisfilestackX\popthisfilestack\StackTerm +} +\def\pushthisfilestackX{% + \expandafter\pushthisfilestackY\thisfile\StackTerm +} +\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% + \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% +} + +\def\popthisfilestack{\errthisfilestackempty} +\def\errthisfilestackempty{\errmessage{Internal error: + the stack of filenames is empty.}} + +\def\thisfile{} + +% @center line +% outputs that line, centered. +% +\parseargdef\center{% + \ifhmode + \let\next\centerH + \else + \let\next\centerV + \fi + \next{\hfil \ignorespaces#1\unskip \hfil}% +} +\def\centerH#1{% + {% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break + }% +} +\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} + +% @sp n outputs n lines of vertical space + +\parseargdef\sp{\vskip #1\baselineskip} + +% @comment ...line which is ignored... +% @c is the same as @comment +% @ignore ... @end ignore is another way to write a comment + +\def\comment{\begingroup \catcode`\^^M=3D\other% +\catcode`\@=3D\other \catcode`\{=3D\other \catcode`\}=3D\other% +\commentxxx} +{\catcode`\^^M=3D\other \gdef\commentxxx#1^^M{\endgroup}} + +\let\c=3D\comment + +% @paragraphindent NCHARS +% We'll use ems for NCHARS, close enough. +% NCHARS can also be the word `asis' or `none'. +% We cannot feasibly implement @paragraphindent asis, though. +% +\def\asisword{asis} % no translation, these are keywords +\def\noneword{none} +% +\parseargdef\paragraphindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \defaultparindent =3D 0pt + \else + \defaultparindent =3D #1em + \fi + \fi + \parindent =3D \defaultparindent +} + +% @exampleindent NCHARS +% We'll use ems for NCHARS like @paragraphindent. +% It seems @exampleindent asis isn't necessary, but +% I preserve it to make it similar to @paragraphindent. +\parseargdef\exampleindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \lispnarrowing =3D 0pt + \else + \lispnarrowing =3D #1em + \fi + \fi +} + +% @firstparagraphindent WORD +% If WORD is `none', then suppress indentation of the first paragraph +% after a section heading. If WORD is `insert', then do indent at such +% paragraphs. +% +% The paragraph indentation is suppressed or not by calling +% \suppressfirstparagraphindent, which the sectioning commands do. +% We switch the definition of this back and forth according to WORD. +% By default, we suppress indentation. +% +\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} +\def\insertword{insert} +% +\parseargdef\firstparagraphindent{% + \def\temp{#1}% + \ifx\temp\noneword + \let\suppressfirstparagraphindent =3D \dosuppressfirstparagraphindent + \else\ifx\temp\insertword + \let\suppressfirstparagraphindent =3D \relax + \else + \errhelp =3D \EMsimple + \errmessage{Unknown @firstparagraphindent option `\temp'}% + \fi\fi +} + +% Here is how we actually suppress indentation. Redefine \everypar to +% \kern backwards by \parindent, and then reset itself to empty. +% +% We also make \indent itself not actually do anything until the next +% paragraph. +% +\gdef\dosuppressfirstparagraphindent{% + \gdef\indent{% + \restorefirstparagraphindent + \indent + }% + \gdef\noindent{% + \restorefirstparagraphindent + \noindent + }% + \global\everypar =3D {% + \kern -\parindent + \restorefirstparagraphindent + }% +} + +\gdef\restorefirstparagraphindent{% + \global \let \indent =3D \ptexindent + \global \let \noindent =3D \ptexnoindent + \global \everypar =3D {}% +} + + +% @asis just yields its argument. Used with @table, for example. +% +\def\asis#1{#1} + +% @math outputs its argument in math mode. +% +% One complication: _ usually means subscripts, but it could also mean +% an actual _ character, as in @math{@var{some_variable} + 1}. So make +% _ active, and distinguish by seeing if the current family is \slfam, +% which is what @var uses. +{ + \catcode`\_ =3D \active + \gdef\mathunderscore{% + \catcode`\_=3D\active + \def_{\ifnum\fam=3D\slfam \_\else\sb\fi}% + } +} +% Another complication: we want \\ (and @\) to output a \ character. +% FYI, plain.tex uses \\ as a temporary control sequence (why?), but +% this is not advertised and we don't care. Texinfo does not +% otherwise define @\. +% +% The \mathchar is class=3D0=3Dordinary, family=3D7=3Dttfam, position=3D5C= =3D\. +\def\mathbackslash{\ifnum\fam=3D\ttfam \mathchar"075C \else\backslash \fi} +% +\def\math{% + \tex + \mathunderscore + \let\\ =3D \mathbackslash + \mathactive + $\finishmath +} +\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. + +% Some active characters (such as <) are spaced differently in math. +% We have to reset their definitions in case the @math was an argument +% to a command which sets the catcodes (such as @item or @section). +% +{ + \catcode`^ =3D \active + \catcode`< =3D \active + \catcode`> =3D \active + \catcode`+ =3D \active + \gdef\mathactive{% + \let^ =3D \ptexhat + \let< =3D \ptexless + \let> =3D \ptexgtr + \let+ =3D \ptexplus + } +} + +% @bullet and @minus need the same treatment as @math, just above. +\def\bullet{$\ptexbullet$} +\def\minus{$-$} + +% @dots{} outputs an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in the cm +% typewriter fonts as three actual period characters; on the other hand, +% in other typewriter fonts three periods are wider than 1.5em. So do +% whichever is larger. +% +\def\dots{% + \leavevmode + \setbox0=3D\hbox{...}% get width of three periods + \ifdim\wd0 > 1.5em + \dimen0 =3D \wd0 + \else + \dimen0 =3D 1.5em + \fi + \hbox to \dimen0{% + \hskip 0pt plus.25fil + .\hskip 0pt plus1fil + .\hskip 0pt plus1fil + .\hskip 0pt plus.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \dots + \spacefactor=3D\endofsentencespacefactor +} + +% @comma{} is so commas can be inserted into text without messing up +% Texinfo's parsing. +% +\let\comma =3D , + +% @refill is a no-op. +\let\refill=3D\relax + +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test r= uns. +% This is done with @novalidate (before @setfilename). +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate =3D \linksfalse + +% @setfilename is done at the beginning of every texinfo file. +% So open here the files we need to have open while reading the input. +% This makes it possible to make a .fmt file for texinfo. +\def\setfilename{% + \fixbackslash % Turn off hack to swallow `\input texinfo'. + \iflinks + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=3D\jobname.aux + \fi % \openindices needs to do some work in any case. + \openindices + \let\setfilename=3D\comment % Ignore extra @setfilename cmds. + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. + \openin 1 texinfo.cnf + \ifeof 1 \else \input texinfo.cnf \fi + \closein 1 + % + \comment % Ignore the actual filename. +} + +% Called from \setfilename. +% +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% +} + +% @bye. +\outer\def\bye{\pagealignmacro\tracingstats=3D1\ptexend} + + +\message{pdf,} +% adobe `portable' document format +\newcount\tempnum +\newcount\lnkcount +\newtoks\filename +\newcount\filenamelength +\newcount\pgn +\newtoks\toksA +\newtoks\toksB +\newtoks\toksC +\newtoks\toksD +\newbox\boxA +\newcount\countA +\newif\ifpdf +\newif\ifpdfmakepagedest + +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=3D1 +% can be set). So we test for \relax and 0 as well as \undefined, +% borrowed from ifpdf.sty. +\ifx\pdfoutput\undefined +\else + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput + \else + \pdftrue + \fi + \fi +\fi + +% PDF uses PostScript string constants for the names of xref targets, +% for display in the outlines, and in other places. Thus, we have to +% double any backslashes. Otherwise, a name like "\node" will be +% interpreted as a newline (\n), followed by o, d, e. Not good. +% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html +% (and related messages, the final outcome is that it is up to the TeX +% user to double the backslashes and otherwise make the string valid, so +% that's what we do). + +% double active backslashes. +% +{\catcode`\@=3D0 \catcode`\\=3D\active + @gdef@activebackslashdouble{% + @catcode`@\=3D@active + @let\=3D@doublebackslash} +} + +% To handle parens, we must adopt a different approach, since parens are +% not active characters. hyperref.dtx (which has the same problem as +% us) handles it with this amazing macro to replace tokens, with minor +% changes for Texinfo. It is included here under the GPL by permission +% from the author, Heiko Oberdiek. +% +% #1 is the tokens to replace. +% #2 is the replacement. +% #3 is the control sequence with the string. +% +\def\HyPsdSubst#1#2#3{% + \def\HyPsdReplace##1#1##2\END{% + ##1% + \ifx\\##2\\% + \else + #2% + \HyReturnAfterFi{% + \HyPsdReplace##2\END + }% + \fi + }% + \xdef#3{\expandafter\HyPsdReplace#3#1\END}% +} +\long\def\HyReturnAfterFi#1\fi{\fi#1} + +% #1 is a control sequence in which to do the replacements. +\def\backslashparens#1{% + \xdef#1{#1}% redefine it as its expansion; the definition is simply + % \lastnode when called from \setref -> \pdfmkdest. + \HyPsdSubst{(}{\realbackslash(}{#1}% + \HyPsdSubst{)}{\realbackslash)}{#1}% +} + +\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images +with PDF output, and none of those formats could be found. (.eps cannot +be supported due to the design of the PDF format; use regular TeX (DVI +output) for that.)} + +\ifpdf + \input pdfcolor + \pdfcatalog{/PageMode /UseOutlines} + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (dit= to). + \def\dopdfimage#1#2#3{% + \def\imagewidth{#2}\setbox0 =3D \hbox{\ignorespaces #2}% + \def\imageheight{#3}\setbox2 =3D \hbox{\ignorespaces #3}% + % + % pdftex (and the PDF format) support .png, .jpg, .pdf (among + % others). Let's try in that order. + \let\pdfimgext=3D\empty + \begingroup + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \openin 1 #1.pdf \ifeof 1 + \errhelp =3D \nopdfimagehelp + \errmessage{Could not find image file #1 for pdf}% + \else \gdef\pdfimgext{pdf}% + \fi + \else \gdef\pdfimgext{JPG}% + \fi + \else \gdef\pdfimgext{jpeg}% + \fi + \else \gdef\pdfimgext{jpg}% + \fi + \else \gdef\pdfimgext{png}% + \fi + \closein 1 + \endgroup + % + % without \immediate, pdftex seg faults when the same image is + % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) + \ifnum\pdftexversion < 14 + \immediate\pdfimage + \else + \immediate\pdfximage + \fi + \ifdim \wd0 >0pt width \imagewidth \fi + \ifdim \wd2 >0pt height \imageheight \fi + \ifnum\pdftexversion<13 + #1.\pdfimgext + \else + {#1.\pdfimgext}% + \fi + \ifnum\pdftexversion < 14 \else + \pdfrefximage \pdflastximage + \fi} + % + \def\pdfmkdest#1{{% + % We have to set dummies so commands such as @code, and characters + % such as \, aren't expanded when present in a section title. + \indexnofonts + \turnoffactive + \activebackslashdouble + \makevalueexpandable + \def\pdfdestname{#1}% + \backslashparens\pdfdestname + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + }} + % + % used to mark target names; must be expandable. + \def\pdfmkpgn#1{#1} + % + % by default, use a color that is dark enough to print on paper as + % nearly black, but still distinguishable for online viewing. + % (Defined in pdfcolor.tex.) + \let\urlcolor =3D \BrickRed + \let\linkcolor =3D \BrickRed + \def\endlink{\Black\pdfendlink} + % + % Adding outlines to PDF; macros for calculating structure of outlines + % come from Petr Olsak + \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% + \else \csname#1\endcsname \fi} + \def\advancenumber#1{\tempnum=3D\expnumber{#1}\relax + \advance\tempnum by 1 + \expandafter\xdef\csname#1\endcsname{\the\tempnum}} + % + % #1 is the section text, which is what will be displayed in the + % outline by the pdf viewer. #2 is the pdf expression for the number + % of subentries (or empty, for subsubsections). #3 is the node text, + % which might be empty if this toc entry had no corresponding node. + % #4 is the page number + % + \def\dopdfoutline#1#2#3#4{% + % Generate a link to the node text if that exists; else, use the + % page number. We could generate a destination for the section + % text in the case where a section has no node, but it doesn't + % seem worth the trouble, since most documents are normally structured. + \def\pdfoutlinedest{#3}% + \ifx\pdfoutlinedest\empty + \def\pdfoutlinedest{#4}% + \else + % Doubled backslashes in the name. + {\activebackslashdouble \xdef\pdfoutlinedest{#3}% + \backslashparens\pdfoutlinedest}% + \fi + % + % Also double the backslashes in the display string. + {\activebackslashdouble \xdef\pdfoutlinetext{#1}% + \backslashparens\pdfoutlinetext}% + % + \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% + } + % + \def\pdfmakeoutlines{% + \begingroup + % Thanh's hack / proper braces in bookmarks + \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=3D\mylbrace + \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=3D\myrbrace + % + % Read toc silently, to get counts of subentries for \pdfoutline. + \def\numchapentry##1##2##3##4{% + \def\thischapnum{##2}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + }% + \def\numsecentry##1##2##3##4{% + \advancenumber{chap\thischapnum}% + \def\thissecnum{##2}% + \def\thissubsecnum{0}% + }% + \def\numsubsecentry##1##2##3##4{% + \advancenumber{sec\thissecnum}% + \def\thissubsecnum{##2}% + }% + \def\numsubsubsecentry##1##2##3##4{% + \advancenumber{subsec\thissubsecnum}% + }% + \def\thischapnum{0}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + % + % use \def rather than \let here because we redefine \chapentry et + % al. a second time, below. + \def\appentry{\numchapentry}% + \def\appsecentry{\numsecentry}% + \def\appsubsecentry{\numsubsecentry}% + \def\appsubsubsecentry{\numsubsubsecentry}% + \def\unnchapentry{\numchapentry}% + \def\unnsecentry{\numsecentry}% + \def\unnsubsecentry{\numsubsecentry}% + \def\unnsubsubsecentry{\numsubsubsecentry}% + \readdatafile{toc}% + % + % Read toc second time, this time actually producing the outlines. + % The `-' means take the \expnumber as the absolute number of + % subentries, which we calculated on our first read of the .toc abov= e. + % + % We use the node names as the destinations. + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% count is always zero + \dopdfoutline{##1}{}{##3}{##4}}% + % + % PDF outlines are displayed using system fonts, instead of + % document fonts. Therefore we cannot use special characters, + % since the encoding is unknown. For example, the eogonek from + % Latin 2 (0xea) gets translated to a | character. Info from + % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. + % + % xx to do this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Right + % now, I guess we'll just let the pdf reader have its way. + \indexnofonts + \setupdatafile + \catcode`\\=3D\active \otherbackslash + \input \jobname.toc + \endgroup + } + % + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \ifx\p\space\else\addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \fi + \nextsp} + \def\getfilename#1{\filenamelength=3D0\expandafter\skipspaces#1|\relax} + \ifnum\pdftexversion < 14 + \let \startlink \pdfannotlink + \else + \let \startlink \pdfstartlink + \fi + % make a live url in pdf output. + \def\pdfurl#1{% + \begingroup + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=3D\empty + \makevalueexpandable + \leavevmode\urlcolor + \startlink attr{/Border [0 0 0]}% + user{/Subtype /Link /A << /S /URI /URI (#1) >>}% + \endgroup} + \def\pdfgettoks#1.{\setbox\boxA=3D\hbox{\toksA=3D{#1.}\toksB=3D{}\maketo= ks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1=3D{\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=3D1\let\next=3D\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=3D#1\toksD=3D{#1}\toksA=3D{#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=3D\countA\else\makelink\fi + \ifx\first.\let\next=3D\done\else + \let\next=3D\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC=3D{}\global\countA=3D0} + \def\pdflink#1{% + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} + \linkcolor #1\endlink} + \def\done{\edef\st{\global\noexpand\toksA=3D{\the\toksB}}\st} +\else + \let\pdfmkdest =3D \gobble + \let\pdfurl =3D \gobble + \let\endlink =3D \relax + \let\linkcolor =3D \relax + \let\pdfmakeoutlines =3D \relax +\fi % \ifx\pdfoutput + + +\message{fonts,} + +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname ten#1\endcsname % change the current font +} + +% Select #1 fonts with the current style. +% +\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsnam= e} + +\def\rm{\fam=3D0 \setfontstyle{rm}} +\def\it{\fam=3D\itfam \setfontstyle{it}} +\def\sl{\fam=3D\slfam \setfontstyle{sl}} +\def\bf{\fam=3D\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=3D\ttfam \setfontstyle{tt}} + +% Texinfo sort of supports the sans serif font style, which plain TeX does= not. +% So we set up a \sf. +\newfam\sffam +\def\sf{\fam=3D\sffam \setfontstyle{sf}} +\let\li =3D \sf % Sometimes we call it \li, not \sf. + +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + + +% Default leading. +\newdimen\textleading \textleading =3D 13.2pt + +% Set the baselineskip to #1, and the lineskip and strut size +% correspondingly. There is no deep meaning behind these magic numbers +% used as factors; they just match (closely enough) what Knuth defined. +% +\def\lineskipfactor{.08333} +\def\strutheightpercent{.70833} +\def\strutdepthpercent {.29167} +% +\def\setleading#1{% + \normalbaselineskip =3D #1\relax + \normallineskip =3D \lineskipfactor\normalbaselineskip + \normalbaselines + \setbox\strutbox =3D\hbox{% + \vrule width0pt height\strutheightpercent\baselineskip + depth \strutdepthpercent \baselineskip + }% +} + +% +% PDF CMaps. See also LaTeX's t1.cmap. +% +% \cmapOT1 +\ifpdf + \begingroup + \catcode`\^^M=3D\active \def^^M{^^J}% Output line endings as the ^^J c= har. + \catcode`\%=3D12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1-0) +%%Title: (TeX-OT1-0 TeX OT1 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1) +/Supplement 0 +>> def +/CMapName /TeX-OT1-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<23> <26> <0023> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +40 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1IT + \begingroup + \catcode`\^^M=3D\active \def^^M{^^J}% Output line endings as the ^^J c= har. + \catcode`\%=3D12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1IT-0) +%%Title: (TeX-OT1IT-0 TeX OT1IT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1IT) +/Supplement 0 +>> def +/CMapName /TeX-OT1IT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<25> <26> <0025> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +42 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<23> <0023> +<24> <00A3> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1IT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1TT + \begingroup + \catcode`\^^M=3D\active \def^^M{^^J}% Output line endings as the ^^J c= har. + \catcode`\%=3D12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1TT-0) +%%Title: (TeX-OT1TT-0 TeX OT1TT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1TT) +/Supplement 0 +>> def +/CMapName /TeX-OT1TT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +5 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<21> <26> <0021> +<28> <5F> <0028> +<61> <7E> <0061> +endbfrange +32 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <2191> +<0C> <2193> +<0D> <0027> +<0E> <00A1> +<0F> <00BF> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<20> <2423> +<27> <2019> +<60> <2018> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1TT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +\else + \expandafter\let\csname cmapOT1\endcsname\gobble + \expandafter\let\csname cmapOT1IT\endcsname\gobble + \expandafter\let\csname cmapOT1TT\endcsname\gobble +\fi + + +% Set the font macro #1 to the font named #2, adding on the +% specified font prefix (normally `cm'). +% #3 is the font's design size, #4 is a scale factor, #5 is the CMap +% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass +% empty to omit). +\def\setfont#1#2#3#4#5{% + \font#1=3D\fontprefix#2#3 scaled #4 + \csname cmap#5\endcsname#1% +} +% This is what gets called when #5 of \setfont is empty. +\let\cmap\gobble + + +% Use cm as the default font prefix. +% To specify the font prefix, you must define \fontprefix +% before you read in texinfo.tex. +\ifx\fontprefix\undefined +\def\fontprefix{cm} +\fi +% Support font families that don't use the same naming scheme as CM. +\def\rmshape{r} +\def\rmbshape{bx} %where the normal face is bold +\def\bfshape{b} +\def\bxshape{bx} +\def\ttshape{tt} +\def\ttbshape{tt} +\def\ttslshape{sltt} +\def\itshape{ti} +\def\itbshape{bxti} +\def\slshape{sl} +\def\slbshape{bxsl} +\def\sfshape{ss} +\def\sfbshape{ss} +\def\scshape{csc} +\def\scbshape{csc} + +% Definitions for a main text size of 11pt. This is the default in +% Texinfo. +% +\def\definetextfontsizexi{% +% Text fonts (11.2pt, magstep1). +\def\textnominalsize{11pt} +\edef\mainmagstep{\magstephalf} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=3Dcmmi10 scaled \mainmagstep +\font\textsy=3Dcmsy10 scaled \mainmagstep + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstep1}{OT1} +\setfont\deftt\ttshape{10}{\magstep1}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} +\def\df{\let\tentt=3D\deftt \let\tenbf =3D \defbf \let\tenttsl=3D\defttsl = \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=3Dcmmi9 +\font\smallsy=3Dcmsy9 + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=3Dcmmi8 +\font\smallersy=3Dcmsy8 + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=3D\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=3Dcmmi12 scaled \magstep3 +\font\titlesy=3Dcmsy10 scaled \magstep4 +\def\authorrm{\secrm} +\def\authortt{\sectt} + +% Chapter (and unnumbered) fonts (17.28pt). +\def\chapnominalsize{17pt} +\setfont\chaprm\rmbshape{12}{\magstep2}{OT1} +\setfont\chapit\itbshape{10}{\magstep3}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep3}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} +\setfont\chapsf\sfbshape{17}{1000}{OT1} +\let\chapbf=3D\chaprm +\setfont\chapsc\scbshape{10}{\magstep3}{OT1} +\font\chapi=3Dcmmi12 scaled \magstep2 +\font\chapsy=3Dcmsy10 scaled \magstep3 + +% Section fonts (14.4pt). +\def\secnominalsize{14pt} +\setfont\secrm\rmbshape{12}{\magstep1}{OT1} +\setfont\secit\itbshape{10}{\magstep2}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep2}{OT1} +\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\secsf\sfbshape{12}{\magstep1}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep2}{OT1} +\font\seci=3Dcmmi12 scaled \magstep1 +\font\secsy=3Dcmsy10 scaled \magstep2 + +% Subsection fonts (13.15pt). +\def\ssecnominalsize{13pt} +\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} +\setfont\ssecit\itbshape{10}{1315}{OT1IT} +\setfont\ssecsl\slbshape{10}{1315}{OT1} +\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} +\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1315}{OT1} +\font\sseci=3Dcmmi12 scaled \magstephalf +\font\ssecsy=3Dcmsy10 scaled 1315 + +% Reduced fonts for @acro in text (10pt). +\def\reducednominalsize{10pt} +\setfont\reducedrm\rmshape{10}{1000}{OT1} +\setfont\reducedtt\ttshape{10}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{1000}{OT1} +\setfont\reducedit\itshape{10}{1000}{OT1IT} +\setfont\reducedsl\slshape{10}{1000}{OT1} +\setfont\reducedsf\sfshape{10}{1000}{OT1} +\setfont\reducedsc\scshape{10}{1000}{OT1} +\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} +\font\reducedi=3Dcmmi10 +\font\reducedsy=3Dcmsy10 + +% reset the current fonts +\textfonts +\rm +} % end of 11pt text font size definitions + + +% Definitions to make the main text be 10pt Computer Modern, with +% section, chapter, etc., sizes following suit. This is for the GNU +% Press printing of the Emacs 22 manual. Maybe other manuals in the +% future. Used with @smallbook, which sets the leading to 12pt. +% +\def\definetextfontsizex{% +% Text fonts (10pt). +\def\textnominalsize{10pt} +\edef\mainmagstep{1000} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=3Dcmmi10 scaled \mainmagstep +\font\textsy=3Dcmsy10 scaled \mainmagstep + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstephalf}{OT1} +\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} +\def\df{\let\tentt=3D\deftt \let\tenbf =3D \defbf \let\tenttsl=3D\defttsl = \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=3Dcmmi9 +\font\smallsy=3Dcmsy9 + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=3Dcmmi8 +\font\smallersy=3Dcmsy8 + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=3D\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=3Dcmmi12 scaled \magstep3 +\font\titlesy=3Dcmsy10 scaled \magstep4 +\def\authorrm{\secrm} +\def\authortt{\sectt} + +% Chapter fonts (14.4pt). +\def\chapnominalsize{14pt} +\setfont\chaprm\rmbshape{12}{\magstep1}{OT1} +\setfont\chapit\itbshape{10}{\magstep2}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep2}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\chapsf\sfbshape{12}{\magstep1}{OT1} +\let\chapbf\chaprm +\setfont\chapsc\scbshape{10}{\magstep2}{OT1} +\font\chapi=3Dcmmi12 scaled \magstep1 +\font\chapsy=3Dcmsy10 scaled \magstep2 + +% Section fonts (12pt). +\def\secnominalsize{12pt} +\setfont\secrm\rmbshape{12}{1000}{OT1} +\setfont\secit\itbshape{10}{\magstep1}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep1}{OT1} +\setfont\sectt\ttbshape{12}{1000}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} +\setfont\secsf\sfbshape{12}{1000}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep1}{OT1} +\font\seci=3Dcmmi12 +\font\secsy=3Dcmsy10 scaled \magstep1 + +% Subsection fonts (10pt). +\def\ssecnominalsize{10pt} +\setfont\ssecrm\rmbshape{10}{1000}{OT1} +\setfont\ssecit\itbshape{10}{1000}{OT1IT} +\setfont\ssecsl\slbshape{10}{1000}{OT1} +\setfont\ssectt\ttbshape{10}{1000}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} +\setfont\ssecsf\sfbshape{10}{1000}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1000}{OT1} +\font\sseci=3Dcmmi10 +\font\ssecsy=3Dcmsy10 + +% Reduced fonts for @acro in text (9pt). +\def\reducednominalsize{9pt} +\setfont\reducedrm\rmshape{9}{1000}{OT1} +\setfont\reducedtt\ttshape{9}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{900}{OT1} +\setfont\reducedit\itshape{9}{1000}{OT1IT} +\setfont\reducedsl\slshape{9}{1000}{OT1} +\setfont\reducedsf\sfshape{9}{1000}{OT1} +\setfont\reducedsc\scshape{10}{900}{OT1} +\setfont\reducedttsl\ttslshape{10}{900}{OT1TT} +\font\reducedi=3Dcmmi9 +\font\reducedsy=3Dcmsy9 + +% reduce space between paragraphs +\divide\parskip by 2 + +% reset the current fonts +\textfonts +\rm +} % end of 10pt text font size definitions + + +% We provide the user-level command +% @fonttextsize 10 +% (or 11) to redefine the text font size. pt is assumed. +% +\def\xword{10} +\def\xiword{11} +% +\parseargdef\fonttextsize{% + \def\textsizearg{#1}% + \wlog{doing @fonttextsize \textsizearg}% + % + % Set \globaldefs so that documents can use this inside @tex, since + % makeinfo 4.8 does not support it, but we need it nonetheless. + % + \begingroup \globaldefs=3D1 + \ifx\textsizearg\xword \definetextfontsizex + \else \ifx\textsizearg\xiword \definetextfontsizexi + \else + \errhelp=3D\EMsimple + \errmessage{@fonttextsize only supports `10' or `11', not `\textsizear= g'} + \fi\fi + \endgroup +} + + +% In order for the font changes to affect most math symbols and letters, +% we have to define the \textfont of the standard families. Since +% texinfo doesn't allow for producing subscripts and superscripts except +% in the main text, we don't bother to reset \scriptfont and +% \scriptscriptfont (which would also require loading a lot more fonts). +% +\def\resetmathfonts{% + \textfont0=3D\tenrm \textfont1=3D\teni \textfont2=3D\tensy + \textfont\itfam=3D\tenit \textfont\slfam=3D\tensl \textfont\bffam=3D\ten= bf + \textfont\ttfam=3D\tentt \textfont\sffam=3D\tensf +} + +% The font-changing commands redefine the meanings of \tenSTYLE, instead +% of just \STYLE. We do this because \STYLE needs to also set the +% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire +% \tenSTYLE to set the current font. +% +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used in +% the LaTeX logo and acronyms. +% +% This all needs generalizing, badly. +% +\def\textfonts{% + \let\tenrm=3D\textrm \let\tenit=3D\textit \let\tensl=3D\textsl + \let\tenbf=3D\textbf \let\tentt=3D\texttt \let\smallcaps=3D\textsc + \let\tensf=3D\textsf \let\teni=3D\texti \let\tensy=3D\textsy + \let\tenttsl=3D\textttsl + \def\curfontsize{text}% + \def\lsize{reduced}\def\lllsize{smaller}% + \resetmathfonts \setleading{\textleading}} +\def\titlefonts{% + \let\tenrm=3D\titlerm \let\tenit=3D\titleit \let\tensl=3D\titlesl + \let\tenbf=3D\titlebf \let\tentt=3D\titlett \let\smallcaps=3D\titlesc + \let\tensf=3D\titlesf \let\teni=3D\titlei \let\tensy=3D\titlesy + \let\tenttsl=3D\titlettsl + \def\curfontsize{title}% + \def\lsize{chap}\def\lllsize{subsec}% + \resetmathfonts \setleading{25pt}} +\def\titlefont#1{{\titlefonts\rm #1}} +\def\chapfonts{% + \let\tenrm=3D\chaprm \let\tenit=3D\chapit \let\tensl=3D\chapsl + \let\tenbf=3D\chapbf \let\tentt=3D\chaptt \let\smallcaps=3D\chapsc + \let\tensf=3D\chapsf \let\teni=3D\chapi \let\tensy=3D\chapsy + \let\tenttsl=3D\chapttsl + \def\curfontsize{chap}% + \def\lsize{sec}\def\lllsize{text}% + \resetmathfonts \setleading{19pt}} +\def\secfonts{% + \let\tenrm=3D\secrm \let\tenit=3D\secit \let\tensl=3D\secsl + \let\tenbf=3D\secbf \let\tentt=3D\sectt \let\smallcaps=3D\secsc + \let\tensf=3D\secsf \let\teni=3D\seci \let\tensy=3D\secsy + \let\tenttsl=3D\secttsl + \def\curfontsize{sec}% + \def\lsize{subsec}\def\lllsize{reduced}% + \resetmathfonts \setleading{16pt}} +\def\subsecfonts{% + \let\tenrm=3D\ssecrm \let\tenit=3D\ssecit \let\tensl=3D\ssecsl + \let\tenbf=3D\ssecbf \let\tentt=3D\ssectt \let\smallcaps=3D\ssecsc + \let\tensf=3D\ssecsf \let\teni=3D\sseci \let\tensy=3D\ssecsy + \let\tenttsl=3D\ssecttsl + \def\curfontsize{ssec}% + \def\lsize{text}\def\lllsize{small}% + \resetmathfonts \setleading{15pt}} +\let\subsubsecfonts =3D \subsecfonts +\def\reducedfonts{% + \let\tenrm=3D\reducedrm \let\tenit=3D\reducedit \let\tensl=3D\reducedsl + \let\tenbf=3D\reducedbf \let\tentt=3D\reducedtt \let\reducedcaps=3D\redu= cedsc + \let\tensf=3D\reducedsf \let\teni=3D\reducedi \let\tensy=3D\reducedsy + \let\tenttsl=3D\reducedttsl + \def\curfontsize{reduced}% + \def\lsize{small}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallfonts{% + \let\tenrm=3D\smallrm \let\tenit=3D\smallit \let\tensl=3D\smallsl + \let\tenbf=3D\smallbf \let\tentt=3D\smalltt \let\smallcaps=3D\smallsc + \let\tensf=3D\smallsf \let\teni=3D\smalli \let\tensy=3D\smallsy + \let\tenttsl=3D\smallttsl + \def\curfontsize{small}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallerfonts{% + \let\tenrm=3D\smallerrm \let\tenit=3D\smallerit \let\tensl=3D\smallersl + \let\tenbf=3D\smallerbf \let\tentt=3D\smallertt \let\smallcaps=3D\smalle= rsc + \let\tensf=3D\smallersf \let\teni=3D\smalleri \let\tensy=3D\smallersy + \let\tenttsl=3D\smallerttsl + \def\curfontsize{smaller}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{9.5pt}} + +% Set the fonts to use with the @small... environments. +\let\smallexamplefonts =3D \smallfonts + +% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample +% can fit this many characters: +% 8.5x11=3D86 smallbook=3D72 a4=3D90 a5=3D69 +% If we use \scriptfonts (8pt), then we can fit this many characters: +% 8.5x11=3D90+ smallbook=3D80 a4=3D90+ a5=3D77 +% For me, subjectively, the few extra characters that fit aren't worth +% the additional smallness of 8pt. So I'm making the default 9pt. +% +% By the way, for comparison, here's what fits with @example (10pt): +% 8.5x11=3D71 smallbook=3D60 a4=3D75 a5=3D58 +% +% I wish the USA used A4 paper. +% --karl, 24jan03. + + +% Set up the default fonts, so we can use them for creating boxes. +% +\definetextfontsizexi + +% Define these so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + +% Count depth in font-changes, for error checks +\newcount\fontdepth \fontdepth=3D0 + +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000}{OT1} +\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000}{OT1} +\setfont\shortconttt\ttshape{12}{1000}{OT1TT} + +%% Add scribe-like font environments, plus @l for inline lisp (usually sans +%% serif) and @ii for TeX italic + +% \smartitalic{ARG} outputs arg in italics, followed by an italic correcti= on +% unless the following character is such as not to need one. +\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else + \ptexslash\fi\fi\fi} +\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} +\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} + +% like \smartslanted except unconditionally uses \ttsl. +% @var is set to this for defun arguments. +\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx} + +% like \smartslanted except unconditionally use \sl. We never want +% ttsl for book titles, do we? +\def\cite#1{{\sl #1}\futurelet\next\smartitalicx} + +\let\i=3D\smartitalic +\let\slanted=3D\smartslanted +\let\var=3D\smartslanted +\let\dfn=3D\smartslanted +\let\emph=3D\smartitalic + +% @b, explicit bold. +\def\b#1{{\bf #1}} +\let\strong=3D\b + +% @sansserif, explicit sans. +\def\sansserif#1{{\sf #1}} + +% We can't just use \exhyphenpenalty, because that only has effect at +% the end of a paragraph. Restore normal hyphenation at the end of the +% group within which \nohyphenation is presumably called. +% +\def\nohyphenation{\hyphenchar\font =3D -1 \aftergroup\restorehyphenation} +\def\restorehyphenation{\hyphenchar\font =3D `- } + +% Set sfcode to normal for the chars that usually have another value. +% Can't use plain's \frenchspacing because it uses the `\x notation, and +% sometimes \x has an active definition that messes things up. +% +\catcode`@=3D11 + \def\plainfrenchspacing{% + \sfcode\dotChar =3D\@m \sfcode\questChar=3D\@m \sfcode\exclamChar=3D\= @m + \sfcode\colonChar=3D\@m \sfcode\semiChar =3D\@m \sfcode\commaChar =3D\= @m + \def\endofsentencespacefactor{1000}% for @. and friends + } + \def\plainnonfrenchspacing{% + \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 + \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 + \def\endofsentencespacefactor{3000}% for @. and friends + } +\catcode`@=3D\other +\def\endofsentencespacefactor{3000}% default + +\def\t#1{% + {\tt \rawbackslash \plainfrenchspacing #1}% + \null +} +\def\samp#1{`\tclose{#1}'\null} +\setfont\keyrm\rmshape{8}{1000}{OT1} +\font\keysy=3Dcmsy9 +\def\key#1{{\keyrm\textfont2=3D\keysy \leavevmode\hbox{% + \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% + \vbox{\hrule\kern-0.4pt + \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% + \kern-0.4pt\hrule}% + \kern-.06em\raise0.4pt\hbox{\angleright}}}} +\def\key #1{{\nohyphenation \uppercase{#1}}\null} +% The old definition, with no lozenge: +%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + +% @file, @option are the same as @samp. +\let\file=3D\samp +\let\option=3D\samp + +% @code is a modification of @t, +% which makes spaces the same size as normal in the surrounding text. +\def\tclose#1{% + {% + % Change normal interword space to be same as for the current font. + \spaceskip =3D \fontdimen2\font + % + % Switch to typewriter. + \tt + % + % But `\ ' produces the large typewriter interword space. + \def\ {{\spaceskip =3D 0pt{} }}% + % + % Turn off hyphenation. + \nohyphenation + % + \rawbackslash + \plainfrenchspacing + #1% + }% + \null +} + +% We *must* turn on hyphenation at `-' and `_' in @code. +% Otherwise, it is too hard to avoid overfull hboxes +% in the Emacs manual, the Library manual, etc. + +% Unfortunately, TeX uses one parameter (\hyphenchar) to control +% both hyphenation at - and hyphenation within words. +% We must therefore turn them both off (\tclose does that) +% and arrange explicitly to hyphenate at a dash. +% -- rms. +{ + \catcode`\-=3D\active \catcode`\_=3D\active + \catcode`\'=3D\active \catcode`\`=3D\active + % + \global\def\code{\begingroup + \catcode\rquoteChar=3D\active \catcode\lquoteChar=3D\active + \let'\codequoteright \let`\codequoteleft + % + \catcode\dashChar=3D\active \catcode\underChar=3D\active + \ifallowcodebreaks + \let-\codedash + \let_\codeunder + \else + \let-\realdash + \let_\realunder + \fi + \codex + } +} + +\def\realdash{-} +\def\codedash{-\discretionary{}{}{}} +\def\codeunder{% + % this is all so @math{@code{var_name}+1} can work. In math mode, _ + % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) + % will therefore expand the active definition of _, which is us + % (inside @code that is), therefore an endless loop. + \ifusingtt{\ifmmode + \mathchar"075F % class 0=3Dordinary, family 7=3Dttfam, pos = 0x5F=3D_. + \else\normalunderscore \fi + \discretionary{}{}{}}% + {\_}% +} +\def\codex #1{\tclose{#1}\endgroup} + +% An additional complication: the above will allow breaks after, e.g., +% each of the four underscores in __typeof__. This is undesirable in +% some manuals, especially if they don't have long identifiers in +% general. @allowcodebreaks provides a way to control this. +% +\newif\ifallowcodebreaks \allowcodebreakstrue + +\def\keywordtrue{true} +\def\keywordfalse{false} + +\parseargdef\allowcodebreaks{% + \def\txiarg{#1}% + \ifx\txiarg\keywordtrue + \allowcodebreakstrue + \else\ifx\txiarg\keywordfalse + \allowcodebreaksfalse + \else + \errhelp =3D \EMsimple + \errmessage{Unknown @allowcodebreaks option `\txiarg'}% + \fi\fi +} + +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. + +% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), +% `example' (@kbd uses ttsl only inside of @example and friends), +% or `code' (@kbd uses normal tty font always). +\parseargdef\kbdinputstyle{% + \def\txiarg{#1}% + \ifx\txiarg\worddistinct + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% + \else\ifx\txiarg\wordexample + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% + \else\ifx\txiarg\wordcode + \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \else + \errhelp =3D \EMsimple + \errmessage{Unknown @kbdinputstyle option `\txiarg'}% + \fi\fi\fi +} +\def\worddistinct{distinct} +\def\wordexample{example} +\def\wordcode{code} + +% Default is `distinct.' +\kbdinputstyle distinct + +\def\xkey{\key} +\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% +\ifx\one\xkey\ifx\threex\three \key{#2}% +\else{\tclose{\kbdfont\look}}\fi +\else{\tclose{\kbdfont\look}}\fi} + +% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. +\let\indicateurl=3D\code +\let\env=3D\code +\let\command=3D\code + +% @uref (abbreviation for `urlref') takes an optional (comma-separated) +% second argument specifying the text to display and an optional third +% arg as text to display instead of (rather than in addition to) the url +% itself. First (mandatory) arg is the url. Perhaps eventually put in +% a hypertex \special here. +% +\def\uref#1{\douref #1,,,\finish} +\def\douref#1,#2,#3,#4\finish{\begingroup + \unsepspaces + \pdfurl{#1}% + \setbox0 =3D \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 =3D \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \code{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=3D\uref + +% rms does not like angle brackets --karl, 17may97. +% So now @email is just like @uref, unless we are pdf. +% +%\def\email#1{\angleleft{\tt #1}\angleright} +\ifpdf + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 =3D \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} +\else + \let\email=3D\uref +\fi + +% Check if we are currently using a typewriter font. Since all the +% Computer Modern typewriter fonts have zero interword stretch (and +% shrink), and it is reasonable to expect all typewriter fonts to have +% this property, we can check that font parameter. +% +\def\ifmonospace{\ifdim\fontdimen3\font=3D0pt } + +% Typeset a dimension, e.g., `in' or `pt'. The only reason for the +% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. +% +\def\dmn#1{\thinspace #1} + +\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} + +% @l was never documented to mean ``switch to the Lisp font'', +% and it is not used as such in any manual I can find. We need it for +% Polish suppressed-l. --karl, 22sep96. +%\def\l#1{{\li #1}\null} + +% Explicit font changes: @r, @sc, undocumented @ii. +\def\r#1{{\rm #1}} % roman font +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +% @acronym for "FBI", "NATO", and the like. +% We print this one point size smaller, since it's intended for +% all-uppercase. +% +\def\acronym#1{\doacronym #1,,\finish} +\def\doacronym#1,#2,#3\finish{% + {\selectfonts\lsize #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} + +% @abbr for "Comput. J." and the like. +% No font change, but don't do end-of-sentence spacing. +% +\def\abbr#1{\doabbr #1,,\finish} +\def\doabbr#1,#2,#3\finish{% + {\plainfrenchspacing #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} + +% @pounds{} is a sterling sign, which Knuth put in the CM italic font. +% +\def\pounds{{\it\$}} + +% @euro{} comes from a separate font, depending on the current style. +% We use the free feym* fonts from the eurosym package by Henrik +% Theiling, which support regular, slanted, bold and bold slanted (and +% "outlined" (blackboard board, sort of) versions, which we don't need). +% It is available from http://www.ctan.org/tex-archive/fonts/eurosym. +% +% Although only regular is the truly official Euro symbol, we ignore +% that. The Euro is designed to be slightly taller than the regular +% font height. +% +% feymr - regular +% feymo - slanted +% feybr - bold +% feybo - bold slanted +% +% There is no good (free) typewriter version, to my knowledge. +% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wid= e. +% Hmm. +% +% Also doesn't work in math. Do we need to do math with euro symbols? +% Hope not. +% +% +\def\euro{{\eurofont e}} +\def\eurofont{% + % We set the font at each command, rather than predefining it in + % \textfonts and the other font-switching commands, so that + % installations which never need the symbol don't have to have the + % font installed. + % + % There is only one designed size (nominal 10pt), so we always scale + % that to the current nominal size. + % + % By the way, simply using "at 1em" works for cmr10 and the like, but + % does not work for cmbx10 and other extended/shrunken fonts. + % + \def\eurosize{\csname\curfontsize nominalsize\endcsname}% + % + \ifx\curfontstyle\bfstylename + % bold: + \font\thiseurofont =3D \ifusingit{feybo10}{feybr10} at \eurosize + \else + % regular: + \font\thiseurofont =3D \ifusingit{feymo10}{feymr10} at \eurosize + \fi + \thiseurofont +} + +% @registeredsymbol - R in a circle. The font for the R should really +% be smaller yet, but lllsize is the best we can do for now. +% Adapted from the plain.tex definition of \copyright. +% +\def\registeredsymbol{% + $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + \hfil\crcr\Orb}}% + }$% +} + +% @textdegree - the normal degrees sign. +% +\def\textdegree{$^\circ$} + +% Laurent Siebenmann reports \Orb undefined with: +% Textures 1.7.7 (preloaded format=3Dplain 93.10.14) (68K) 16 APR 2004 = 02:38 +% so we'll define it if necessary. +% +\ifx\Orb\undefined +\def\Orb{\mathhexbox20D} +\fi + + +\message{page headings,} + +\newskip\titlepagetopglue \titlepagetopglue =3D 1.5in +\newskip\titlepagebottomglue \titlepagebottomglue =3D 2pc + +% First the title page. Must do @settitle before @titlepage. +\newif\ifseenauthor +\newif\iffinishedtitlepage + +% Do an implicit @contents or @shortcontents after @end titlepage if the +% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. +% +\newif\ifsetcontentsaftertitlepage + \let\setcontentsaftertitlepage =3D \setcontentsaftertitlepagetrue +\newif\ifsetshortcontentsaftertitlepage + \let\setshortcontentsaftertitlepage =3D \setshortcontentsaftertitlepagetr= ue + +\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \center= line{#1}% + \endgroup\page\hbox{}\page} + +\envdef\titlepage{% + % Open one extra group, as we want to close it in the middle of \Etitlep= age. + \begingroup + \parindent=3D0pt \textfonts + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the seco= nd. + \let\oldpage =3D \page + \def\page{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + \let\page =3D \oldpage + \page + \null + }% +} + +\def\Etitlepage{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents =3D \relax + \global\let\contents =3D \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents =3D \relax + \global\let\shortcontents =3D \relax + \fi +} + +\def\finishtitlepage{% + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +%%% Macros to be used within @titlepage: + +\let\subtitlerm=3D\tenrm +\def\subtitlefont{\subtitlerm \normalbaselineskip =3D 13pt \normalbaseline= s} + +\def\authorfont{\authorrm \normalbaselineskip =3D 16pt \normalbaselines + \let\tt=3D\authortt} + +\parseargdef\title{% + \checkenv\titlepage + \leftline{\titlefonts\rm #1} + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +} + +\parseargdef\subtitle{% + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% +} + +% @author should come last, but may come many times. +% It can also be used inside @quotation. +% +\parseargdef\author{% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\authorfont \leftline{#1}}% + \fi +} + + +%%% Set up page headings and footings. + +\let\thispage=3D\folio + +\newtoks\evenheadline % headline on even pages +\newtoks\oddheadline % headline on odd pages +\newtoks\evenfootline % footline on even pages +\newtoks\oddfootline % footline on odd pages + +% Now make TeX use those variables +\headline=3D{{\textfonts\rm \ifodd\pageno \the\oddheadline + \else \the\evenheadline \fi}} +\footline=3D{{\textfonts\rm \ifodd\pageno \the\oddfootline + \else \the\evenfootline \fi}\HEADINGShook} +\let\HEADINGShook=3D\relax + +% Commands to set those variables. +% For example, this is what @headings on does +% @evenheading @thistitle|@thispage|@thischapter +% @oddheading @thischapter|@thispage|@thistitle +% @evenfooting @thisfile|| +% @oddfooting ||@thisfile + + +\def\evenheading{\parsearg\evenheadingxxx} +\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} +\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% +\global\evenheadline=3D{\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddheading{\parsearg\oddheadingxxx} +\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} +\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% +\global\oddheadline=3D{\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% + +\def\evenfooting{\parsearg\evenfootingxxx} +\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} +\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% +\global\evenfootline=3D{\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddfooting{\parsearg\oddfootingxxx} +\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} +\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% + \global\oddfootline =3D {\rlap{\centerline{#2}}\line{#1\hfil#3}}% + % + % Leave some space for the footline. Hopefully ok to assume + % @evenfooting will not be used by itself. + \global\advance\pageheight by -12pt + \global\advance\vsize by -12pt +} + +\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} + + +% @headings double turns headings on for double-sided printing. +% @headings single turns headings on for single-sided printing. +% @headings off turns them off. +% @headings on same as @headings double, retained for compatibili= ty. +% @headings after turns on double-sided headings after this page. +% @headings doubleafter turns on double-sided headings after this page. +% @headings singleafter turns on single-sided headings after this page. +% By default, they are off at the start of a document, +% and turned `on' after @end titlepage. + +\def\headings #1 {\csname HEADINGS#1\endcsname} + +\def\HEADINGSoff{% +\global\evenheadline=3D{\hfil} \global\evenfootline=3D{\hfil} +\global\oddheadline=3D{\hfil} \global\oddfootline=3D{\hfil}} +\HEADINGSoff +% When we turn headings on, set the page number to 1. +% For double-sided printing, put current file name in lower left corner, +% chapter name on inside top of right hand pages, document +% title on inside top of left hand pages, and page numbers on outside top +% edge of all pages. +\def\HEADINGSdouble{% +\global\pageno=3D1 +\global\evenfootline=3D{\hfil} +\global\oddfootline=3D{\hfil} +\global\evenheadline=3D{\line{\folio\hfil\thistitle}} +\global\oddheadline=3D{\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro =3D \chapoddpage +} +\let\contentsalignmacro =3D \chappager + +% For single-sided printing, chapter title goes across top left of page, +% page number on top right. +\def\HEADINGSsingle{% +\global\pageno=3D1 +\global\evenfootline=3D{\hfil} +\global\oddfootline=3D{\hfil} +\global\evenheadline=3D{\line{\thischapter\hfil\folio}} +\global\oddheadline=3D{\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro =3D \chappager +} +\def\HEADINGSon{\HEADINGSdouble} + +\def\HEADINGSafter{\let\HEADINGShook=3D\HEADINGSdoublex} +\let\HEADINGSdoubleafter=3D\HEADINGSafter +\def\HEADINGSdoublex{% +\global\evenfootline=3D{\hfil} +\global\oddfootline=3D{\hfil} +\global\evenheadline=3D{\line{\folio\hfil\thistitle}} +\global\oddheadline=3D{\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro =3D \chapoddpage +} + +\def\HEADINGSsingleafter{\let\HEADINGShook=3D\HEADINGSsinglex} +\def\HEADINGSsinglex{% +\global\evenfootline=3D{\hfil} +\global\oddfootline=3D{\hfil} +\global\evenheadline=3D{\line{\thischapter\hfil\folio}} +\global\oddheadline=3D{\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro =3D \chappager +} + +% Subroutines used in generating headings +% This produces Day Month Year style of output. +% Only define if not already defined, in case a txi-??.tex file has set +% up a different format (e.g., txi-cs.tex does this). +\ifx\today\undefined +\def\today{% + \number\day\space + \ifcase\month + \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr + \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug + \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec + \fi + \space\number\year} +\fi + +% @settitle line... specifies the title of the document, for headings. +% It generates no output of its own. +\def\thistitle{\putwordNoTitle} +\def\settitle{\parsearg{\gdef\thistitle}} + + +\message{tables,} +% Tables -- @table, @ftable, @vtable, @item(x). + +% default indentation of table text +\newdimen\tableindent \tableindent=3D.8in +% default indentation of @itemize and @enumerate text +\newdimen\itemindent \itemindent=3D.3in +% margin between end of table item and start of table text. +\newdimen\itemmargin \itemmargin=3D.1in + +% used internally for \itemindent minus \itemmargin +\newdimen\itemmax + +% Note @table, @ftable, and @vtable define @item, @itemx, etc., with +% these defs. +% They also define \itemindex +% to index the item name in whatever manner is desired (perhaps none). + +\newif\ifitemxneedsnegativevskip + +\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobrea= k\fi} + +\def\internalBitem{\smallbreak \parsearg\itemzzz} +\def\internalBitemx{\itemxpar \parsearg\itemzzz} + +\def\itemzzz #1{\begingroup % + \advance\hsize by -\rightskip + \advance\hsize by -\tableindent + \setbox0=3D\hbox{\itemindicate{#1}}% + \itemindex{#1}% + \nobreak % This prevents a break before @itemx. + % + % If the item text does not fit in the space we have, put it on a line + % by itself, and do not allow a page break either before or after that + % line. We do not start a paragraph here because then if the next + % command is, e.g., @kindex, the whatsit would get put into the + % horizontal list on a line by itself, resulting in extra blank space. + \ifdim \wd0>\itemmax + % + % Make this a paragraph so we get the \parskip glue and wrapping, + % but leave it ragged-right. + \begingroup + \advance\leftskip by-\tableindent + \advance\hsize by\tableindent + \advance\rightskip by0pt plus1fil + \leavevmode\unhbox0\par + \endgroup + % + % We're going to be starting a paragraph, but we don't want the + % \parskip glue -- logically it's part of the @item we just started. + \nobreak \vskip-\parskip + % + % Stop a page break at the \parskip glue coming up. However, if + % what follows is an environment such as @example, there will be no + % \parskip glue; then the negative vskip we just inserted would + % cause the example and the item to crash together. So we use this + % bizarre value of 10001 as a signal to \aboveenvbreak to insert + % \parskip glue after all. Section titles are handled this way also. + % + \penalty 10001 + \endgroup + \itemxneedsnegativevskipfalse + \else + % The item text fits into the space. Start a paragraph, so that the + % following text (if any) will end up on the same line. + \noindent + % Do this with kerns and \unhbox so that if there is a footnote in + % the item text, it can migrate to the main vertical list and + % eventually be printed. + \nobreak\kern-\tableindent + \dimen0 =3D \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 b= y -\wd0 + \unhbox0 + \nobreak\kern\dimen0 + \endgroup + \itemxneedsnegativevskiptrue + \fi +} + +\def\item{\errmessage{@item while not in a list environment}} +\def\itemx{\errmessage{@itemx while not in a list environment}} + +% @table, @ftable, @vtable. +\envdef\table{% + \let\itemindex\gobble + \tablecheck{table}% +} +\envdef\ftable{% + \def\itemindex ##1{\doind {fn}{\code{##1}}}% + \tablecheck{ftable}% +} +\envdef\vtable{% + \def\itemindex ##1{\doind {vr}{\code{##1}}}% + \tablecheck{vtable}% +} +\def\tablecheck#1{% + \ifnum \the\catcode`\^^M=3D\active + \endgroup + \errmessage{This command won't work in this context; perhaps the probl= em is + that we are \inenvironment\thisenv}% + \def\next{\doignore{#1}}% + \else + \let\next\tablex + \fi + \next +} +\def\tablex#1{% + \def\itemindicate{#1}% + \parsearg\tabley +} +\def\tabley#1{% + {% + \makevalueexpandable + \edef\temp{\noexpand\tablez #1\space\space\space}% + \expandafter + }\temp \endtablez +} +\def\tablez #1 #2 #3 #4\endtablez{% + \aboveenvbreak + \ifnum 0#1>0 \advance \leftskip by #1\mil \fi + \ifnum 0#2>0 \tableindent=3D#2\mil \fi + \ifnum 0#3>0 \advance \rightskip by #3\mil \fi + \itemmax=3D\tableindent + \advance \itemmax by -\itemmargin + \advance \leftskip by \tableindent + \exdentamount=3D\tableindent + \parindent =3D 0pt + \parskip =3D \smallskipamount + \ifdim \parskip=3D0pt \parskip=3D2pt \fi + \let\item =3D \internalBitem + \let\itemx =3D \internalBitemx +} +\def\Etable{\endgraf\afterenvbreak} +\let\Eftable\Etable +\let\Evtable\Etable +\let\Eitemize\Etable +\let\Eenumerate\Etable + +% This is the counter used by @enumerate, which is really @itemize + +\newcount \itemno + +\envdef\itemize{\parsearg\doitemize} + +\def\doitemize#1{% + \aboveenvbreak + \itemmax=3D\itemindent + \advance\itemmax by -\itemmargin + \advance\leftskip by \itemindent + \exdentamount=3D\itemindent + \parindent=3D0pt + \parskip=3D\smallskipamount + \ifdim\parskip=3D0pt \parskip=3D2pt \fi + \def\itemcontents{#1}% + % @itemize with no arg is equivalent to @itemize @bullet. + \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + \let\item=3D\itemizeitem +} + +% Definition of @item while inside @itemize and @enumerate. +% +\def\itemizeitem{% + \advance\itemno by 1 % for enumerations + {\let\par=3D\endgraf \smallbreak}% reasonable place to break + {% + % If the document has an @itemize directly after a section title, a + % \nobreak will be last on the list, and \sectionheading will have + % done a \vskip-\parskip. In that case, we don't want to zero + % parskip, or the item text will crash with the heading. On the + % other hand, when there is normal text preceding the item (as there + % usually is), we do want to zero parskip, or there would be too much + % space. In that case, we won't have a \nobreak before. At least + % that's the theory. + \ifnum\lastpenalty<10000 \parskip=3D0in \fi + \noindent + \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% + \vadjust{\penalty 1200}}% not good to break after first line of item. + \flushcr +} + +% \splitoff TOKENS\endmark defines \first to be the first token in +% TOKENS, and \rest to be the remainder. +% +\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% + +% Allow an optional argument of an uppercase letter, lowercase letter, +% or number, to specify the first label in the enumerated list. No +% argument is the same as `1'. +% +\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} +\def\enumeratey #1 #2\endenumeratey{% + % If we were given no argument, pretend we were given `1'. + \def\thearg{#1}% + \ifx\thearg\empty \def\thearg{1}\fi + % + % Detect if the argument is a single token. If so, it might be a + % letter. Otherwise, the only valid thing it can be is a number. + % (We will always have one token, because of the test we just made. + % This is a good thing, since \splitoff doesn't work given nothing at + % all -- the first parameter is undelimited.) + \expandafter\splitoff\thearg\endmark + \ifx\rest\empty + % Only one token in the argument. It could still be anything. + % A ``lowercase letter'' is one whose \lccode is nonzero. + % An ``uppercase letter'' is one whose \lccode is both nonzero, and + % not equal to itself. + % Otherwise, we assume it's a number. + % + % We need the \relax at the end of the \ifnum lines to stop TeX from + % continuing to look for a . + % + \ifnum\lccode\expandafter`\thearg=3D0\relax + \numericenumerate % a number (we hope) + \else + % It's a letter. + \ifnum\lccode\expandafter`\thearg=3D\expandafter`\thearg\relax + \lowercaseenumerate % lowercase letter + \else + \uppercaseenumerate % uppercase letter + \fi + \fi + \else + % Multiple tokens in the argument. We hope it's a number. + \numericenumerate + \fi +} + +% An @enumerate whose labels are integers. The starting integer is +% given in \thearg. +% +\def\numericenumerate{% + \itemno =3D \thearg + \startenumeration{\the\itemno}% +} + +% The starting (lowercase) letter is in \thearg. +\def\lowercaseenumerate{% + \itemno =3D \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=3D0 + \errmessage{No more lowercase letters in @enumerate; get a bigger + alphabet}% + \fi + \char\lccode\itemno + }% +} + +% The starting (uppercase) letter is in \thearg. +\def\uppercaseenumerate{% + \itemno =3D \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=3D0 + \errmessage{No more uppercase letters in @enumerate; get a bigger + alphabet} + \fi + \char\uccode\itemno + }% +} + +% Call \doitemize, adding a period to the first argument and supplying the +% common last two arguments. Also subtract one from the initial value in +% \itemno, since @item increments \itemno. +% +\def\startenumeration#1{% + \advance\itemno by -1 + \doitemize{#1.}\flushcr +} + +% @alphaenumerate and @capsenumerate are abbreviations for giving an arg +% to @enumerate. +% +\def\alphaenumerate{\enumerate{a}} +\def\capsenumerate{\enumerate{A}} +\def\Ealphaenumerate{\Eenumerate} +\def\Ecapsenumerate{\Eenumerate} + + +% @multitable macros +% Amy Hendrickson, 8/18/94, 3/6/96 +% +% @multitable ... @end multitable will make as many columns as desired. +% Contents of each column will wrap at width given in preamble. Width +% can be specified either with sample text given in a template line, +% or in percent of \hsize, the current width of text on page. + +% Table can continue over pages but will only break between lines. + +% To make preamble: +% +% Either define widths of columns in terms of percent of \hsize: +% @multitable @columnfractions .25 .3 .45 +% @item ... +% +% Numbers following @columnfractions are the percent of the total +% current hsize to be used for each column. You may use as many +% columns as desired. + + +% Or use a template: +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item ... +% using the widest term desired in each column. + +% Each new table line starts with @item, each subsequent new column +% starts with @tab. Empty columns may be produced by supplying @tab's +% with nothing between them for as many times as empty columns are needed, +% ie, @tab@tab@tab will produce two empty columns. + +% @item, @tab do not need to be on their own lines, but it will not hurt +% if they are. + +% Sample multitable: + +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item first col stuff @tab second col stuff @tab third col +% @item +% first col stuff +% @tab +% second col stuff +% @tab +% third col +% @item first col stuff @tab second col stuff +% @tab Many paragraphs of text may be used in any column. +% +% They will wrap at the width determined by the template. +% @item@tab@tab This will be in third column. +% @end multitable + +% Default dimensions may be reset by user. +% @multitableparskip is vertical space between paragraphs in table. +% @multitableparindent is paragraph indent in table. +% @multitablecolmargin is horizontal space to be left between columns. +% @multitablelinespace is space to leave between table items, baseline +% to baseline. +% 0pt means it depends on current normal line spacing. +% +\newskip\multitableparskip +\newskip\multitableparindent +\newdimen\multitablecolspace +\newskip\multitablelinespace +\multitableparskip=3D0pt +\multitableparindent=3D6pt +\multitablecolspace=3D12pt +\multitablelinespace=3D0pt + +% Macros used to set up halign preamble: +% +\let\endsetuptable\relax +\def\xendsetuptable{\endsetuptable} +\let\columnfractions\relax +\def\xcolumnfractions{\columnfractions} +\newif\ifsetpercent + +% #1 is the @columnfraction, usually a decimal number like .5, but might +% be just 1. We just use it, whatever it is. +% +\def\pickupwholefraction#1 {% + \global\advance\colcount by 1 + \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% + \setuptable +} + +\newcount\colcount +\def\setuptable#1{% + \def\firstarg{#1}% + \ifx\firstarg\xendsetuptable + \let\go =3D \relax + \else + \ifx\firstarg\xcolumnfractions + \global\setpercenttrue + \else + \ifsetpercent + \let\go\pickupwholefraction + \else + \global\advance\colcount by 1 + \setbox0=3D\hbox{#1\unskip\space}% Add a normal word space as a + % separator; typically that is always in the input, any= way. + \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% + \fi + \fi + \ifx\go\pickupwholefraction + % Put the argument back for the \pickupwholefraction call, so + % we'll always have a period there to be parsed. + \def\go{\pickupwholefraction#1}% + \else + \let\go =3D \setuptable + \fi% + \fi + \go +} + +% multitable-only commands. +% +% @headitem starts a heading row, which we typeset in bold. +% Assignments have to be global since we are inside the implicit group +% of an alignment entry. Note that \everycr resets \everytab. +\def\headitem{\checkenv\multitable \crcr \global\everytab=3D{\bf}\the\ever= ytab}% +% +% A \tab used to include \hskip1sp. But then the space in a template +% line is not enough. That is bad. So let's go back to just `&' until +% we encounter the problem it was intended to solve again. +% --karl, nathan@acm.org, 20apr99. +\def\tab{\checkenv\multitable &\the\everytab}% + +% @multitable ... @end multitable definitions: +% +\newtoks\everytab % insert after every tab. +% +\envdef\multitable{% + \vskip\parskip + \startsavinginserts + % + % @item within a multitable starts a normal row. + % We use \def instead of \let so that if one of the multitable entries + % contains an @itemize, we don't choke on the \item (seen as \crcr aka + % \endtemplate) expanding \doitemize. + \def\item{\crcr}% + % + \tolerance=3D9500 + \hbadness=3D9500 + \setmultitablespacing + \parskip=3D\multitableparskip + \parindent=3D\multitableparindent + \overfullrule=3D0pt + \global\colcount=3D0 + % + \everycr =3D {% + \noalign{% + \global\everytab=3D{}% + \global\colcount=3D0 % Reset the column counter. + % Check for saved footnotes, etc. + \checkinserts + % Keeps underfull box messages off when table breaks over pages. + %\filbreak + % Maybe so, but it also creates really weird page breaks when the + % table breaks over pages. Wouldn't \vfil be better? Wait until the + % problem manifests itself, so it can be fixed for real --karl. + }% + }% + % + \parsearg\domultitable +} +\def\domultitable#1{% + % To parse everything between @multitable and @item: + \setuptable#1 \endsetuptable + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. + \halign\bgroup &% + \global\advance\colcount by 1 + \multistrut + \vtop{% + % Use the current \colcount to find the correct column width: + \hsize=3D\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start = at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=3D0pt + \ifnum\colcount=3D1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=3D\multitablecolspace: + \leftskip=3D\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spuri= ous + % blank line, when TeX decides to break the line at the space before= the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole coun= try. + % Is automatically provided with highlighting sequences respectively + % marking characters. + \noindent\ignorespaces##\unskip\multistrut + }\cr +} +\def\Emultitable{% + \crcr + \egroup % end the \halign + \global\setpercentfalse +} + +\def\setmultitablespacing{% + \def\multistrut{\strut}% just use the standard line spacing + % + % Compute \multitablelinespace (if not defined by user) for use in + % \multitableparskip calculation. We used define \multistrut based on + % this, but (ironically) that caused the spacing to be off. + % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. +\ifdim\multitablelinespace=3D0pt +\setbox0=3D\vbox{X}\global\multitablelinespace=3D\the\baselineskip +\global\advance\multitablelinespace by-\ht0 +\fi +%% Test to see if parskip is larger than space between lines of +%% table. If not, do nothing. +%% If so, set to same dimension as multitablelinespace. +\ifdim\multitableparskip>\multitablelinespace +\global\multitableparskip=3D\multitablelinespace +\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller + %% than skip between lines in the ta= ble. +\fi% +\ifdim\multitableparskip=3D0pt +\global\multitableparskip=3D\multitablelinespace +\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller + %% than skip between lines in the ta= ble. +\fi} + + +\message{conditionals,} + +% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, +% @ifnotxml always succeed. They currently do nothing; we don't +% attempt to check whether the conditionals are properly nested. But we +% have to remember that they are conditionals, so that @end doesn't +% attempt to close an environment group. +% +\def\makecond#1{% + \expandafter\let\csname #1\endcsname =3D \relax + \expandafter\let\csname iscond.#1\endcsname =3D 1 +} +\makecond{iftex} +\makecond{ifnotdocbook} +\makecond{ifnothtml} +\makecond{ifnotinfo} +\makecond{ifnotplaintext} +\makecond{ifnotxml} + +% Ignore @ignore, @ifhtml, @ifinfo, and the like. +% +\def\direntry{\doignore{direntry}} +\def\documentdescription{\doignore{documentdescription}} +\def\docbook{\doignore{docbook}} +\def\html{\doignore{html}} +\def\ifdocbook{\doignore{ifdocbook}} +\def\ifhtml{\doignore{ifhtml}} +\def\ifinfo{\doignore{ifinfo}} +\def\ifnottex{\doignore{ifnottex}} +\def\ifplaintext{\doignore{ifplaintext}} +\def\ifxml{\doignore{ifxml}} +\def\ignore{\doignore{ignore}} +\def\menu{\doignore{menu}} +\def\xml{\doignore{xml}} + +% Ignore text until a line `@end #1', keeping track of nested conditionals. +% +% A count to remember the depth of nesting. +\newcount\doignorecount + +\def\doignore#1{\begingroup + % Scan in ``verbatim'' mode: + \obeylines + \catcode`\@ =3D \other + \catcode`\{ =3D \other + \catcode`\} =3D \other + % + % Make sure that spaces turn into tokens that match what \doignoretext w= ants. + \spaceisspace + % + % Count number of #1's that we've seen. + \doignorecount =3D 0 + % + % Swallow text until we reach the matching `@end #1'. + \dodoignore{#1}% +} + +{ \catcode`_=3D11 % We want to use \_STOP_ which cannot appear in texinfo = source. + \obeylines % + % + \gdef\dodoignore#1{% + % #1 contains the command name as a string, e.g., `ifinfo'. + % + % Define a command to find the next `@end #1'. + \long\def\doignoretext##1^^M@end #1{% + \doignoretextyyy##1^^M@#1\_STOP_}% + % + % And this command to find another #1 command, at the beginning of a + % line. (Otherwise, we would consider a line `@c @ifset', for + % example, to count as an @ifset for nesting.) + \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% + % + % And now expand that command. + \doignoretext ^^M% + }% +} + +\def\doignoreyyy#1{% + \def\temp{#1}% + \ifx\temp\empty % Nothing found. + \let\next\doignoretextzzz + \else % Found a nested condition, ... + \advance\doignorecount by 1 + \let\next\doignoretextyyy % ..., look for another. + % If we're here, #1 ends with ^^M\ifinfo (for example). + \fi + \next #1% the token \_STOP_ is present just after this macro. +} + +% We have to swallow the remaining "\_STOP_". +% +\def\doignoretextzzz#1{% + \ifnum\doignorecount =3D 0 % We have just found the outermost @end. + \let\next\enddoignore + \else % Still inside a nested condition. + \advance\doignorecount by -1 + \let\next\doignoretext % Look for the next @end. + \fi + \next +} + +% Finish off ignored text. +{ \obeylines% + % Ignore anything after the last `@end #1'; this matters in verbatim + % environments, where otherwise the newline after an ignored conditional + % would result in a blank line in the output. + \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% +} + + +% @set VAR sets the variable VAR to an empty value. +% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. +% +% Since we want to separate VAR from REST-OF-LINE (which might be +% empty), we can't just use \parsearg; we have to insert a space of our +% own to delimit the rest of the line, and then take it out again if we +% didn't need it. +% We rely on the fact that \parsearg sets \catcode`\ =3D10. +% +\parseargdef\set{\setyyy#1 \endsetyyy} +\def\setyyy#1 #2\endsetyyy{% + {% + \makevalueexpandable + \def\temp{#2}% + \edef\next{\gdef\makecsname{SET#1}}% + \ifx\temp\empty + \next{}% + \else + \setzzz#2\endsetzzz + \fi + }% +} +% Remove the trailing space \setxxx inserted. +\def\setzzz#1 \endsetzzz{\next{#1}} + +% @clear VAR clears (i.e., unsets) the variable VAR. +% +\parseargdef\clear{% + {% + \makevalueexpandable + \global\expandafter\let\csname SET#1\endcsname=3D\relax + }% +} + +% @value{foo} gets the text saved in variable foo. +\def\value{\begingroup\makevalueexpandable\valuexxx} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} +{ + \catcode`\- =3D \active \catcode`\_ =3D \active + % + \gdef\makevalueexpandable{% + \let\value =3D \expandablevalue + % We don't want these characters active, ... + \catcode`\-=3D\other \catcode`\_=3D\other + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. + \let-\realdash \let_\normalunderscore + } +} + +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). +% +\def\expandablevalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {[No value for ``#1'']}% + \message{Variable `#1', used in @value, is not set.}% + \else + \csname SET#1\endcsname + \fi +} + +% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined +% with @set. +% +% To get special treatment of `@end ifset,' call \makeond and the redefine. +% +\makecond{ifset} +\def\ifset{\parsearg{\doifset{\let\next=3D\ifsetfail}}} +\def\doifset#1#2{% + {% + \makevalueexpandable + \let\next=3D\empty + \expandafter\ifx\csname SET#2\endcsname\relax + #1% If not set, redefine \next. + \fi + \expandafter + }\next +} +\def\ifsetfail{\doignore{ifset}} + +% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been +% defined with @set, or has been undefined with @clear. +% +% The `\else' inside the `\doifset' parameter is a trick to reuse the +% above code: if the variable is not set, do nothing, if it is set, +% then redefine \next to \ifclearfail. +% +\makecond{ifclear} +\def\ifclear{\parsearg{\doifset{\else \let\next=3D\ifclearfail}}} +\def\ifclearfail{\doignore{ifclear}} + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory=3D\comment + +% @defininfoenclose. +\let\definfoenclose=3D\comment + + +\message{indexing,} +% Index generation facilities + +% Define \newwrite to be identical to plain tex's \newwrite +% except not \outer, so it can be used within macros and \if's. +\edef\newwrite{\makecsname{ptexnewwrite}} + +% \newindex {foo} defines an index named foo. +% It automatically defines \fooindex such that +% \fooindex ...rest of line... puts an entry in the index foo. +% It also defines \fooindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is foo. +% The name of an index should be no more than 2 characters long +% for the sake of vms. +% +\def\newindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 % Open the file + \fi + \expandafter\xdef\csname#1index\endcsname{% % Define @#1index + \noexpand\doindex{#1}} +} + +% @defindex foo =3D=3D \newindex{foo} +% +\def\defindex{\parsearg\newindex} + +% Define @defcodeindex, like @defindex except put all entries in @code. +% +\def\defcodeindex{\parsearg\newcodeindex} +% +\def\newcodeindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 + \fi + \expandafter\xdef\csname#1index\endcsname{% + \noexpand\docodeindex{#1}}% +} + + +% @synindex foo bar makes index foo feed into index bar. +% Do this instead of @defindex foo if you don't want it as a separate inde= x. +% +% @syncodeindex foo bar similar, but put all entries made for index foo +% inside @code. +% +\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} +\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} + +% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), +% #3 the target index (bar). +\def\dosynindex#1#2#3{% + % Only do \closeout if we haven't already done it, else we'll end up + % closing the target index. + \expandafter \ifx\csname donesynindex#2\endcsname \undefined + % The \closeout helps reduce unnecessary open files; the limit on the + % Acorn RISC OS is a mere 16 files. + \expandafter\closeout\csname#2indfile\endcsname + \expandafter\let\csname\donesynindex#2\endcsname =3D 1 + \fi + % redefine \fooindfile: + \expandafter\let\expandafter\temp\expandafter=3D\csname#3indfile\endcsna= me + \expandafter\let\csname#2indfile\endcsname=3D\temp + % redefine \fooindex: + \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% +} + +% Define \doindex, the driver for all \fooindex macros. +% Argument #1 is generated by the calling \fooindex macro, +% and it is "foo", the name of the index. + +% \doindex just uses \parsearg; it calls \doind for the actual work. +% This is because \doind is more useful to call from other macros. + +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. + +\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} +\def\singleindexer #1{\doind{\indexname}{#1}} + +% like the previous two, but they put @code around the argument. +\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} +\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} + +% Take care of Texinfo commands that can appear in an index entry. +% Since there are some commands we want to expand, and others we don't, +% we have to laboriously prevent expansion for those that we don't. +% +\def\indexdummies{% + \escapechar =3D `\\ % use backslash in output files. + \def\@{@}% change to @@ when we switch to @ as escape char in index file= s. + \def\ {\realbackslash\space }% + % + % Need these in case \tex is in effect and \{ is a \delimiter again. + % But can't use \lbracecmd and \rbracecmd because texindex assumes + % braces and backslashes are used only as delimiters. + \let\{ =3D \mylbrace + \let\} =3D \myrbrace + % + % I don't entirely understand this, but when an index entry is + % generated from a macro call, the \endinput which \scanmacro inserts + % causes processing to be prematurely terminated. This is, + % apparently, because \indexsorttmp is fully expanded, and \endinput + % is an expandable command. The redefinition below makes \endinput + % disappear altogether for that purpose -- although logging shows that + % processing continues to some further point. On the other hand, it + % seems \endinput does not hurt in the printed index arg, since that + % is still getting written without apparent harm. + % + % Sample source (mac-idx3.tex, reported by Graham Percival to + % help-texinfo, 22may06): + % @macro funindex {WORD} + % @findex xyz + % @end macro + % ... + % @funindex commtest + % + % The above is not enough to reproduce the bug, but it gives the flavor. + % + % Sample whatsit resulting: + % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} + % + % So: + \let\endinput =3D \empty + % + % Do the redefinitions. + \commondummies +} + +% For the aux and toc files, @ is the escape character. So we want to +% redefine everything using @ as the escape character (instead of +% \realbackslash, still used for index files). When everything uses @, +% this will be simpler. +% +\def\atdummies{% + \def\@{@@}% + \def\ {@ }% + \let\{ =3D \lbraceatcmd + \let\} =3D \rbraceatcmd + % + % Do the redefinitions. + \commondummies + \otherbackslash +} + +% Called from \indexdummies and \atdummies. +% +\def\commondummies{% + % + % \definedummyword defines \#1 as \string\#1\space, thus effectively + % preventing its expansion. This is used only for control% words, + % not control letters, because the \space would be incorrect for + % control characters, but is needed to separate the control word + % from whatever follows. + % + % For control letters, we have \definedummyletter, which omits the + % space. + % + % These can be used both for control words that take an argument and + % those that do not. If it is followed by {arg} in the input, then + % that will dutifully get written to the index (or wherever). + % + \def\definedummyword ##1{\def##1{\string##1\space}}% + \def\definedummyletter##1{\def##1{\string##1}}% + \let\definedummyaccent\definedummyletter + % + \commondummiesnofonts + % + \definedummyletter\_% + % + % Non-English letters. + \definedummyword\AA + \definedummyword\AE + \definedummyword\L + \definedummyword\OE + \definedummyword\O + \definedummyword\aa + \definedummyword\ae + \definedummyword\l + \definedummyword\oe + \definedummyword\o + \definedummyword\ss + \definedummyword\exclamdown + \definedummyword\questiondown + \definedummyword\ordf + \definedummyword\ordm + % + % Although these internal commands shouldn't show up, sometimes they do. + \definedummyword\bf + \definedummyword\gtr + \definedummyword\hat + \definedummyword\less + \definedummyword\sf + \definedummyword\sl + \definedummyword\tclose + \definedummyword\tt + % + \definedummyword\LaTeX + \definedummyword\TeX + % + % Assorted special characters. + \definedummyword\bullet + \definedummyword\comma + \definedummyword\copyright + \definedummyword\registeredsymbol + \definedummyword\dots + \definedummyword\enddots + \definedummyword\equiv + \definedummyword\error + \definedummyword\euro + \definedummyword\expansion + \definedummyword\minus + \definedummyword\pounds + \definedummyword\point + \definedummyword\print + \definedummyword\result + \definedummyword\textdegree + % + % We want to disable all macros so that they are not expanded by \write. + \macrolist + % + \normalturnoffactive + % + % Handle some cases of @value -- where it does not contain any + % (non-fully-expandable) commands. + \makevalueexpandable +} + +% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% +\def\commondummiesnofonts{% + % Control letters and accents. + \definedummyletter\!% + \definedummyaccent\"% + \definedummyaccent\'% + \definedummyletter\*% + \definedummyaccent\,% + \definedummyletter\.% + \definedummyletter\/% + \definedummyletter\:% + \definedummyaccent\=3D% + \definedummyletter\?% + \definedummyaccent\^% + \definedummyaccent\`% + \definedummyaccent\~% + \definedummyword\u + \definedummyword\v + \definedummyword\H + \definedummyword\dotaccent + \definedummyword\ringaccent + \definedummyword\tieaccent + \definedummyword\ubaraccent + \definedummyword\udotaccent + \definedummyword\dotless + % + % Texinfo font commands. + \definedummyword\b + \definedummyword\i + \definedummyword\r + \definedummyword\sc + \definedummyword\t + % + % Commands that take arguments. + \definedummyword\acronym + \definedummyword\cite + \definedummyword\code + \definedummyword\command + \definedummyword\dfn + \definedummyword\emph + \definedummyword\env + \definedummyword\file + \definedummyword\kbd + \definedummyword\key + \definedummyword\math + \definedummyword\option + \definedummyword\pxref + \definedummyword\ref + \definedummyword\samp + \definedummyword\strong + \definedummyword\tie + \definedummyword\uref + \definedummyword\url + \definedummyword\var + \definedummyword\verb + \definedummyword\w + \definedummyword\xref +} + +% \indexnofonts is used when outputting the strings to sort the index +% by, and when constructing control sequence names. It eliminates all +% control sequences and just writes whatever the best ASCII sort string +% would be for a given command (usually its argument). +% +\def\indexnofonts{% + % Accent commands should become @asis. + \def\definedummyaccent##1{\let##1\asis}% + % We can just ignore other control letters. + \def\definedummyletter##1{\let##1\empty}% + % Hopefully, all control words can become @asis. + \let\definedummyword\definedummyaccent + % + \commondummiesnofonts + % + % Don't no-op \tt, since it isn't a user-level command + % and is used in the definitions of the active chars like <, >, |, etc. + % Likewise with the other plain tex font commands. + %\let\tt=3D\asis + % + \def\ { }% + \def\@{@}% + % how to handle braces? + \def\_{\normalunderscore}% + % + % Non-English letters. + \def\AA{AA}% + \def\AE{AE}% + \def\L{L}% + \def\OE{OE}% + \def\O{O}% + \def\aa{aa}% + \def\ae{ae}% + \def\l{l}% + \def\oe{oe}% + \def\o{o}% + \def\ss{ss}% + \def\exclamdown{!}% + \def\questiondown{?}% + \def\ordf{a}% + \def\ordm{o}% + % + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% + % + % Assorted special characters. + % (The following {} will end up in the sort string, but that's ok.) + \def\bullet{bullet}% + \def\comma{,}% + \def\copyright{copyright}% + \def\registeredsymbol{R}% + \def\dots{...}% + \def\enddots{...}% + \def\equiv{=3D=3D}% + \def\error{error}% + \def\euro{euro}% + \def\expansion{=3D=3D>}% + \def\minus{-}% + \def\pounds{pounds}% + \def\point{.}% + \def\print{-|}% + \def\result{=3D>}% + \def\textdegree{degrees}% + % + % We need to get rid of all macros, leaving only the arguments (if prese= nt). + % Of course this is not nearly correct, but it is the best we can do for= now. + % makeinfo does not expand macros in the argument to @deffn, which ends = up + % writing an index entry, and texindex isn't prepared for an index sort = entry + % that starts with \. + % + % Since macro invocations are followed by braces, we can just redefine t= hem + % to take a single TeX argument. The case of a macro invocation that + % goes to end-of-line is not handled. + % + \macrolist +} + +\let\indexbackslash=3D0 %overridden during \printindex. +\let\SETmarginindex=3D\relax % put index entries in margin (undocumented)? + +% Most index entries go through here, but \dosubind is the general case. +% #1 is the index name, #2 is the entry text. +\def\doind#1#2{\dosubind{#1}{#2}{}} + +% Workhorse for all \fooindexes. +% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). +% +\def\dosubind#1#2#3{% + \iflinks + {% + % Store the main index entry text (including the third arg). + \toks0 =3D {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 =3D \expandafter{\the\toks0 \space #3}% + \fi + % + \edef\writeto{\csname#1indfile\endcsname}% + % + \safewhatsit\dosubindwrite + }% + \fi +} + +% Write the entry in \toks0 to the index file: +% +\def\dosubindwrite{% + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% + \fi + % + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % Process the index entry with all font commands turned off, to + % get the string to sort by. + {\indexnofonts + \edef\temp{\the\toks0}% need full expansion + \xdef\indexsorttmp{\temp}% + }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% + }% + \temp +} + +% Take care of unwanted page breaks/skips around a whatsit: +% +% If a skip is the last thing on the list now, preserve it +% by backing up by \lastskip, doing the \write, then inserting +% the skip again. Otherwise, the whatsit generated by the +% \write or \pdfdest will make \lastskip zero. The result is that +% sequences like this: +% @end defun +% @tindex whatever +% @defun ... +% will have extra space inserted, because the \medbreak in the +% start of the @defun won't see the skip inserted by the @end of +% the previous defun. +% +% But don't do any of this if we're not in vertical mode. We +% don't want to do a \vskip and prematurely end a paragraph. +% +% Avoid page breaks due to these extra skips, too. +% +% But wait, there is a catch there: +% We'll have to check whether \lastskip is zero skip. \ifdim is not +% sufficient for this purpose, as it ignores stretch and shrink parts +% of the skip. The only way seems to be to check the textual +% representation of the skip. +% +% The following is almost like \def\zeroskipmacro{0.0pt} except that +% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). +% +\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} +% +\newskip\whatsitskip +\newcount\whatsitpenalty +% +% ..., ready, GO: +% +\def\safewhatsit#1{% +\ifhmode + #1% +\else + % \lastskip and \lastpenalty cannot both be nonzero simultaneously. + \whatsitskip =3D \lastskip + \edef\lastskipmacro{\the\lastskip}% + \whatsitpenalty =3D \lastpenalty + % + % If \lastskip is nonzero, that means the last item was a + % skip. And since a skip is discardable, that means this + % -\skip0 glue we're inserting is preceded by a + % non-discardable item, therefore it is not a potential + % breakpoint, therefore no \nobreak needed. + \ifx\lastskipmacro\zeroskipmacro + \else + \vskip-\whatsitskip + \fi + % + #1% + % + \ifx\lastskipmacro\zeroskipmacro + % If \lastskip was zero, perhaps the last item was a penalty, and + % perhaps it was >=3D10000, e.g., a \nobreak. In that case, we want + % to re-insert the same penalty (values >10000 are used for various + % signals); since we just inserted a non-discardable item, any + % following glue (such as a \parskip) would be a breakpoint. For exam= ple: + % + % @deffn deffn-whatever + % @vindex index-whatever + % Description. + % would allow a break between the index-whatever whatsit + % and the "Description." paragraph. + \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi + \else + % On the other hand, if we had a nonzero \lastskip, + % this make-up glue would be preceded by a non-discardable item + % (the whatsit from the \write), so we must insert a \nobreak. + \nobreak\vskip\whatsitskip + \fi +\fi +} + +% The index entry written in the file actually looks like +% \entry {sortstring}{page}{topic} +% or +% \entry {sortstring}{page}{topic}{subtopic} +% The texindex program reads in these files and writes files +% containing these kinds of lines: +% \initial {c} +% before the first topic whose initial is c +% \entry {topic}{pagelist} +% for a topic that is used without subtopics +% \primary {topic} +% for the beginning of a topic that is used with subtopics +% \secondary {subtopic}{pagelist} +% for each subtopic. + +% Define the user-accessible indexing commands +% @findex, @vindex, @kindex, @cindex. + +\def\findex {\fnindex} +\def\kindex {\kyindex} +\def\cindex {\cpindex} +\def\vindex {\vrindex} +\def\tindex {\tpindex} +\def\pindex {\pgindex} + +\def\cindexsub {\begingroup\obeylines\cindexsub} +{\obeylines % +\gdef\cindexsub "#1" #2^^M{\endgroup % +\dosubind{cp}{#2}{#1}}} + +% Define the macros used in formatting output of the sorted index material. + +% @printindex causes a particular index (the ??s file) to get printed. +% It does not print any chapter heading (usually an @unnumbered). +% +\parseargdef\printindex{\begingroup + \dobreak \chapheadingskip{10000}% + % + \smallfonts \rm + \tolerance =3D 9500 + \plainfrenchspacing + \everypar =3D {}% don't want the \kern\-parindent from indentation suppr= ession. + % + % See if the index file exists and is nonempty. + % Change catcode of @ here so that if the index file contains + % \initial {@} + % as its first line, TeX doesn't complain about mismatched braces + % (because it thinks @} is a control sequence). + \catcode`\@ =3D 11 + \openin 1 \jobname.#1s + \ifeof 1 + % \enddoublecolumns gets confused if there is no text in the index, + % and it loses the chapter title and the aux file entries for the + % index. The easiest way to prevent this problem is to make sure + % there is some text. + \putwordIndexNonexistent + \else + % + % If the index file exists but is empty, then \openin leaves \ifeof + % false. We have to make TeX try to read something from the file, so + % it can discover if there is anything in it. + \read 1 to \temp + \ifeof 1 + \putwordIndexIsEmpty + \else + % Index files are almost Texinfo source, but we use \ as the escape + % character. It would be better to use @, but that's too big a chan= ge + % to make right now. + \def\indexbackslash{\backslashcurfont}% + \catcode`\\ =3D 0 + \escapechar =3D `\\ + \begindoublecolumns + \input \jobname.#1s + \enddoublecolumns + \fi + \fi + \closein 1 +\endgroup} + +% These macros are used by the sorted index file itself. +% Change them to control the appearance of the index. + +\def\initial#1{{% + % Some minor font changes for the special characters. + \let\tentt=3D\sectt \let\tt=3D\sectt \let\sf=3D\sectt + % + % Remove any glue we may have, we'll be inserting our own. + \removelastskip + % + % We like breaks before the index initials, so insert a bonus. + \nobreak + \vskip 0pt plus 3\baselineskip + \penalty 0 + \vskip 0pt plus -3\baselineskip + % + % Typeset the initial. Making this add up to a whole number of + % baselineskips increases the chance of the dots lining up from column + % to column. It still won't often be perfect, because of the stretch + % we need before each entry, but it's better. + % + % No shrink because it confuses \balancecolumns. + \vskip 1.67\baselineskip plus .5\baselineskip + \leftline{\secbf #1}% + % Do our best not to break after the initial. + \nobreak + \vskip .33\baselineskip plus .1\baselineskip +}} + +% \entry typesets a paragraph consisting of the text (#1), dot leaders, and +% then page number (#2) flushed to the right margin. It is used for index +% and table of contents entries. The paragraph is indented by \leftskip. +% +% A straightforward implementation would start like this: +% \def\entry#1#2{... +% But this frozes the catcodes in the argument, and can cause problems to +% @code, which sets - active. This problem was fixed by a kludge--- +% ``-'' was active throughout whole index, but this isn't really right. +% +% The right solution is to prevent \entry from swallowing the whole text. +% --kasal, 21nov03 +\def\entry{% + \begingroup + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % Do not fill out the last line with white space. + \parfillskip =3D 0in + % + % No extra space above this paragraph. + \parskip =3D 0in + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits =3D 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent =3D 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip =3D 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing + % columns. + \vskip 0pt plus1pt + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp =3D +} +\def\doentry{% + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. +} +\def\finishentry#1{% + % #1 is the page number. + % + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \def\tempa{{\rm }}% + \def\tempb{#1}% + \edef\tempc{\tempa}% + \edef\tempd{\tempb}% + \ifx\tempc\tempd + \ % + \else + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#1.% + \ \the\toksA + \else + \ #1% + \fi + \fi + \par + \endgroup +} + +% Like plain.tex's \dotfill, except uses up at least 1 em. +\def\indexdotfill{\cleaders + \hbox{$\mathsurround=3D0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fil= l} + +\def\primary #1{\line{#1\hfil}} + +\newskip\secondaryindent \secondaryindent=3D0.5cm +\def\secondary#1#2{{% + \parfillskip=3D0in + \parskip=3D0in + \hangindent=3D1in + \hangafter=3D1 + \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill + \ifpdf + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \else + #2 + \fi + \par +}} + +% Define two-column mode, which we use to typeset indexes. +% Adapted from the TeXbook, page 416, which is to say, +% the manmac.tex format used to print the TeXbook itself. +\catcode`\@=3D11 + +\newbox\partialpage +\newdimen\doublecolumnhsize + +\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % Grab any single-column material above us. + \output =3D {% + % + % Here is a possibility not foreseen in manmac: if we accumulate a + % whole lot of material, we might end up calling this \output + % routine twice in a row (see the doublecol-lose test, which is + % essentially a couple of indexes with @setchapternewpage off). In + % that case we just ship out what is in \partialpage with the normal + % output routine. Generally, \partialpage will be empty when this + % runs and this will be a no-op. See the indexspread.tex test case. + \ifvoid\partialpage \else + \onepageout{\pagecontents\partialpage}% + \fi + % + \global\setbox\partialpage =3D \vbox{% + % Unvbox the main output page. + \unvbox\PAGE + \kern-\topskip \kern\baselineskip + }% + }% + \eject % run that output routine to set \partialpage + % + % Use the double-column output routine for subsequent pages. + \output =3D {\doublecolumnout}% + % + % Change the page size parameters. We could do this once outside this + % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 + % format, but then we repeat the same computation. Repeating a couple + % of assignments once per index is clearly meaningless for the + % execution time, so we may as well do it in one place. + % + % First we halve the line length, less a little for the gutter between + % the columns. We compute the gutter based on the line length, so it + % changes automatically with the paper format. The magic constant + % below is chosen so that the gutter has the same value (well, +-<1pt) + % as it did when we hard-coded it. + % + % We put the result in a separate register, \doublecolumhsize, so we + % can restore it in \pagesofar, after \hsize itself has (potentially) + % been clobbered. + % + \doublecolumnhsize =3D \hsize + \advance\doublecolumnhsize by -.04154\hsize + \divide\doublecolumnhsize by 2 + \hsize =3D \doublecolumnhsize + % + % Double the \vsize as well. (We don't need a separate register here, + % since nobody clobbers \vsize.) + \vsize =3D 2\vsize +} + +% The double-column output routine for all double-column pages except +% the last. +% +\def\doublecolumnout{% + \splittopskip=3D\topskip \splitmaxdepth=3D\maxdepth + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. + \dimen@ =3D \vsize + \divide\dimen@ by 2 + \advance\dimen@ by -\ht\partialpage + % + % box0 will be the left-hand column, box2 the right. + \setbox0=3D\vsplit255 to\dimen@ \setbox2=3D\vsplit255 to\dimen@ + \onepageout\pagesofar + \unvbox255 + \penalty\outputpenalty +} +% +% Re-output the contents of the output page -- any previous material, +% followed by the two boxes we just split, in box0 and box2. +\def\pagesofar{% + \unvbox\partialpage + % + \hsize =3D \doublecolumnhsize + \wd0=3D\hsize \wd2=3D\hsize + \hbox to\pagewidth{\box0\hfil\box2}% +} +% +% All done with double columns. +\def\enddoublecolumns{% + % The following penalty ensures that the page builder is exercised + % _before_ we change the output routine. This is necessary in the + % following situation: + % + % The last section of the index consists only of a single entry. + % Before this section, \pagetotal is less than \pagegoal, so no + % break occurs before the last section starts. However, the last + % section, consisting of \initial and the single \entry, does not + % fit on the page and has to be broken off. Without the following + % penalty the page builder will not be exercised until \eject + % below, and by that time we'll already have changed the output + % routine to the \balancecolumns version, so the next-to-last + % double-column page will be processed with \balancecolumns, which + % is wrong: The two columns will go to the main vertical list, with + % the broken-off section in the recent contributions. As soon as + % the output routine finishes, TeX starts reconsidering the page + % break. The two columns and the broken-off section both fit on the + % page, because the two columns now take up only half of the page + % goal. When TeX sees \eject from below which follows the final + % section, it invokes the new output routine that we've set after + % \balancecolumns below; \onepageout will try to fit the two columns + % and the final section into the vbox of \pageheight (see + % \pagebody), causing an overfull box. + % + % Note that glue won't work here, because glue does not exercise the + % page builder, unlike penalties (see The TeXbook, pp. 280-281). + \penalty0 + % + \output =3D {% + % Split the last of the double-column material. Leave it on the + % current page, no automatic page break. + \balancecolumns + % + % If we end up splitting too much material for the current page, + % though, there will be another page break right after this \output + % invocation ends. Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. (We hope \balancecolumns will never be + % called on to balance too much material, but if it is, this makes + % the output somewhat more palatable.) + \global\output =3D {\onepageout{\pagecontents\PAGE}}% + }% + \eject + \endgroup % started in \begindoublecolumns + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize (after the + % \endgroup where \vsize got restored). + \pagegoal =3D \vsize +} +% +% Called at the end of the double column material. +\def\balancecolumns{% + \setbox0 =3D \vbox{\unvbox255}% like \box255 but more efficient, see p.1= 20. + \dimen@ =3D \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \divide\dimen@ by 2 % target to split to + %debug\message{final 2-column material height=3D\the\ht0, target=3D\the\= dimen@.}% + \splittopskip =3D \topskip + % Loop until we get a decent breakpoint. + {% + \vbadness =3D 10000 + \loop + \global\setbox3 =3D \copy0 + \global\setbox1 =3D \vsplit3 to \dimen@ + \ifdim\ht3>\dimen@ + \global\advance\dimen@ by 1pt + \repeat + }% + %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.= }% + \setbox0=3D\vbox to\dimen@{\unvbox1}% + \setbox2=3D\vbox to\dimen@{\unvbox3}% + % + \pagesofar +} +\catcode`\@ =3D \other + + +\message{sectioning,} +% Chapters, sections, etc. + +% \unnumberedno is an oxymoron, of course. But we count the unnumbered +% sections so that we can refer to them unambiguously in the pdf +% outlines by their "section number". We avoid collisions with chapter +% numbers by starting them at 10000. (If a document ever has 10000 +% chapters, we're in trouble anyway, I'm sure.) +\newcount\unnumberedno \unnumberedno =3D 10000 +\newcount\chapno +\newcount\secno \secno=3D0 +\newcount\subsecno \subsecno=3D0 +\newcount\subsubsecno \subsubsecno=3D0 + +% This counter is funny since it counts through charcodes of letters A, B,= ... +\newcount\appendixno \appendixno =3D `\@ +% +% \def\appendixletter{\char\the\appendixno} +% We do the following ugly conditional instead of the above simple +% construct for the sake of pdftex, which needs the actual +% letter in the expansion, not just typeset. +% +\def\appendixletter{% + \ifnum\appendixno=3D`A A% + \else\ifnum\appendixno=3D`B B% + \else\ifnum\appendixno=3D`C C% + \else\ifnum\appendixno=3D`D D% + \else\ifnum\appendixno=3D`E E% + \else\ifnum\appendixno=3D`F F% + \else\ifnum\appendixno=3D`G G% + \else\ifnum\appendixno=3D`H H% + \else\ifnum\appendixno=3D`I I% + \else\ifnum\appendixno=3D`J J% + \else\ifnum\appendixno=3D`K K% + \else\ifnum\appendixno=3D`L L% + \else\ifnum\appendixno=3D`M M% + \else\ifnum\appendixno=3D`N N% + \else\ifnum\appendixno=3D`O O% + \else\ifnum\appendixno=3D`P P% + \else\ifnum\appendixno=3D`Q Q% + \else\ifnum\appendixno=3D`R R% + \else\ifnum\appendixno=3D`S S% + \else\ifnum\appendixno=3D`T T% + \else\ifnum\appendixno=3D`U U% + \else\ifnum\appendixno=3D`V V% + \else\ifnum\appendixno=3D`W W% + \else\ifnum\appendixno=3D`X X% + \else\ifnum\appendixno=3D`Y Y% + \else\ifnum\appendixno=3D`Z Z% + % The \the is necessary, despite appearances, because \appendixletter is + % expanded while writing the .toc file. \char\appendixno is not + % expandable, thus it is written literally, thus all appendixes come out + % with the same letter (or @) in the toc without it. + \else\char\the\appendixno + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} + +% Each @chapter defines this as the name of the chapter. +% page headings and footings can use it. @section does likewise. +% However, they are not reliable, because we don't use marks. +\def\thischapter{} +\def\thissection{} + +\newcount\absseclevel % used to calculate proper heading level +\newcount\secbase\secbase=3D0 % @raisesections/@lowersections modify this = count + +% @raisesections: treat @section as chapter, @subsection as section, etc. +\def\raisesections{\global\advance\secbase by -1} +\let\up=3D\raisesections % original BFox name + +% @lowersections: treat @chapter as section, @section as subsection, etc. +\def\lowersections{\global\advance\secbase by 1} +\let\down=3D\lowersections % original BFox name + +% we only have subsub. +\chardef\maxseclevel =3D 3 +% +% A numbered section within an unnumbered changes to unnumbered too. +% To achive this, remember the "biggest" unnum. sec. we are currently in: +\chardef\unmlevel =3D \maxseclevel +% +% Trace whether the current chapter is an appendix or not: +% \chapheadtype is "N" or "A", unnumbered chapters are ignored. +\def\chapheadtype{N} + +% Choose a heading macro +% #1 is heading type +% #2 is heading level +% #3 is text for heading +\def\genhead#1#2#3{% + % Compute the abs. sec. level: + \absseclevel=3D#2 + \advance\absseclevel by \secbase + % Make sure \absseclevel doesn't fall outside the range: + \ifnum \absseclevel < 0 + \absseclevel =3D 0 + \else + \ifnum \absseclevel > 3 + \absseclevel =3D 3 + \fi + \fi + % The heading type: + \def\headtype{#1}% + \if \headtype U% + \ifnum \absseclevel < \unmlevel + \chardef\unmlevel =3D \absseclevel + \fi + \else + % Check for appendix sections: + \ifnum \absseclevel =3D 0 + \edef\chapheadtype{\headtype}% + \else + \if \headtype A\if \chapheadtype N% + \errmessage{@appendix... within a non-appendix chapter}% + \fi\fi + \fi + % Check for numbered within unnumbered: + \ifnum \absseclevel > \unmlevel + \def\headtype{U}% + \else + \chardef\unmlevel =3D 3 + \fi + \fi + % Now print the heading: + \if \headtype U% + \ifcase\absseclevel + \unnumberedzzz{#3}% + \or \unnumberedseczzz{#3}% + \or \unnumberedsubseczzz{#3}% + \or \unnumberedsubsubseczzz{#3}% + \fi + \else + \if \headtype A% + \ifcase\absseclevel + \appendixzzz{#3}% + \or \appendixsectionzzz{#3}% + \or \appendixsubseczzz{#3}% + \or \appendixsubsubseczzz{#3}% + \fi + \else + \ifcase\absseclevel + \chapterzzz{#3}% + \or \seczzz{#3}% + \or \numberedsubseczzz{#3}% + \or \numberedsubsubseczzz{#3}% + \fi + \fi + \fi + \suppressfirstparagraphindent +} + +% an interface: +\def\numhead{\genhead N} +\def\apphead{\genhead A} +\def\unnmhead{\genhead U} + +% @chapter, @appendix, @unnumbered. Increment top-level counter, reset +% all lower-level sectioning counters to zero. +% +% Also set \chaplevelprefix, which we prepend to @float sequence numbers +% (e.g., figures), q.v. By default (before any chapter), that is empty. +\let\chaplevelprefix =3D \empty +% +\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapte= rzzz +\def\chapterzzz#1{% + % section resetting is \global in case the chapter is in a group, such + % as an @include file. + \global\secno=3D0 \global\subsecno=3D0 \global\subsubsecno=3D0 + \global\advance\chapno by 1 + % + % Used for \float. + \gdef\chaplevelprefix{\the\chapno.}% + \resetallfloatnos + % + \message{\putwordChapter\space \the\chapno}% + % + % Write the actual heading. + \chapmacro{#1}{Ynumbered}{\the\chapno}% + % + % So @section and the like are numbered underneath this chapter. + \global\let\section =3D \numberedsec + \global\let\subsection =3D \numberedsubsec + \global\let\subsubsection =3D \numberedsubsubsec +} + +\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appen= dixzzz +\def\appendixzzz#1{% + \global\secno=3D0 \global\subsecno=3D0 \global\subsubsecno=3D0 + \global\advance\appendixno by 1 + \gdef\chaplevelprefix{\appendixletter.}% + \resetallfloatnos + % + \def\appendixnum{\putwordAppendix\space \appendixletter}% + \message{\appendixnum}% + % + \chapmacro{#1}{Yappendix}{\appendixletter}% + % + \global\let\section =3D \appendixsec + \global\let\subsection =3D \appendixsubsec + \global\let\subsubsection =3D \appendixsubsubsec +} + +\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls u= nnumberedzzz +\def\unnumberedzzz#1{% + \global\secno=3D0 \global\subsecno=3D0 \global\subsubsecno=3D0 + \global\advance\unnumberedno by 1 + % + % Since an unnumbered has no number, no prefix for figures. + \global\let\chaplevelprefix =3D \empty + \resetallfloatnos + % + % This used to be simply \message{#1}, but TeX fully expands the + % argument to \message. Therefore, if #1 contained @-commands, TeX + % expanded them. For example, in `@unnumbered The @cite{Book}', TeX + % expanded @cite (which turns out to cause errors because \cite is meant + % to be executed, not expanded). + % + % Anyway, we don't want the fully-expanded definition of @cite to appear + % as a result of the \message, we just want `@cite' itself. We use + % \the to achieve this: TeX expands \the only once, + % simply yielding the contents of . (We also do this for + % the toc entries.) + \toks0 =3D {#1}% + \message{(\the\toks0)}% + % + \chapmacro{#1}{Ynothing}{\the\unnumberedno}% + % + \global\let\section =3D \unnumberedsec + \global\let\subsection =3D \unnumberedsubsec + \global\let\subsubsection =3D \unnumberedsubsubsec +} + +% @centerchap is like @unnumbered, but the heading is centered. +\outer\parseargdef\centerchap{% + % Well, we could do the following in a group, but that would break + % an assumption that \chapmacro is called at the outermost level. + % Thus we are safer this way: --kasal, 24feb04 + \let\centerparametersmaybe =3D \centerparameters + \unnmhead0{#1}% + \let\centerparametersmaybe =3D \relax +} + +% @top is like @unnumbered. +\let\top\unnumbered + +% Sections. +\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz +\def\seczzz#1{% + \global\subsecno=3D0 \global\subsubsecno=3D0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% +} + +\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendi= xsectionzzz +\def\appendixsectionzzz#1{% + \global\subsecno=3D0 \global\subsubsecno=3D0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% +} +\let\appendixsec\appendixsection + +\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumber= edseczzz +\def\unnumberedseczzz#1{% + \global\subsecno=3D0 \global\subsubsecno=3D0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% +} + +% Subsections. +\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numbered= subseczzz +\def\numberedsubseczzz#1{% + \global\subsubsecno=3D0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subse= cno}% +} + +\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendix= subseczzz +\def\appendixsubseczzz#1{% + \global\subsubsecno=3D0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno}% +} + +\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumb= eredsubseczzz +\def\unnumberedsubseczzz#1{% + \global\subsubsecno=3D0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno}% +} + +% Subsubsections. +\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsub= subseczzz +\def\numberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynumbered}% + {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsub= subseczzz +\def\appendixsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecn= o}% +} + +\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumbere= dsubsubseczzz +\def\unnumberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubse= cno}% +} + +% These macros control what the section commands do, according +% to what kind of chapter we are in (ordinary, appendix, or unnumbered). +% Define them by default for a numbered chapter. +\let\section =3D \numberedsec +\let\subsection =3D \numberedsubsec +\let\subsubsection =3D \numberedsubsubsec + +% Define @majorheading, @heading and @subheading + +% NOTE on use of \vbox for chapter headings, section headings, and such: +% 1) We use \vbox rather than the earlier \line to permit +% overlong headings to fold. +% 2) \hyphenpenalty is set to 10000 because hyphenation in a +% heading is obnoxious; this forbids it. +% 3) Likewise, headings look best if no \parindent is used, and +% if justification is not attempted. Hence \raggedright. + + +\def\majorheading{% + {\advance\chapheadingskip by 10pt \chapbreak }% + \parsearg\chapheadingzzz +} + +\def\chapheading{\chapbreak \parsearg\chapheadingzzz} +\def\chapheadingzzz#1{% + {\chapfonts \vbox{\hyphenpenalty=3D10000\tolerance=3D5000 + \parindent=3D0pt\raggedright + \rm #1\hfill}}% + \bigskip \par\penalty 200\relax + \suppressfirstparagraphindent +} + +% @heading, @subheading, @subsubheading. +\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} + +% These macros generate a chapter, section, etc. heading only +% (including whitespace, linebreaking, etc. around it), +% given all the information in convenient, parsed form. + +%%% Args are the skip and penalty (usually negative) +\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\f= i} + +%%% Define plain chapter starts, and page on/off switching for it +% Parameter controlling skip before chapter headings (if needed) + +\newskip\chapheadingskip + +\def\chapbreak{\dobreak \chapheadingskip {-4000}} +\def\chappager{\par\vfill\supereject} +\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\= fi} + +\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} + +\def\CHAPPAGoff{% +\global\let\contentsalignmacro =3D \chappager +\global\let\pchapsepmacro=3D\chapbreak +\global\let\pagealignmacro=3D\chappager} + +\def\CHAPPAGon{% +\global\let\contentsalignmacro =3D \chappager +\global\let\pchapsepmacro=3D\chappager +\global\let\pagealignmacro=3D\chappager +\global\def\HEADINGSon{\HEADINGSsingle}} + +\def\CHAPPAGodd{% +\global\let\contentsalignmacro =3D \chapoddpage +\global\let\pchapsepmacro=3D\chapoddpage +\global\let\pagealignmacro=3D\chapoddpage +\global\def\HEADINGSon{\HEADINGSdouble}} + +\CHAPPAGon + +% Chapter opening. +% +% #1 is the text, #2 is the section type (Ynumbered, Ynothing, +% Yappendix, Yomitfromtoc), #3 the chapter number. +% +% To test against our argument. +\def\Ynothingkeyword{Ynothing} +\def\Yomitfromtockeyword{Yomitfromtoc} +\def\Yappendixkeyword{Yappendix} +% +\def\chapmacro#1#2#3{% + \pchapsepmacro + {% + \chapfonts \rm + % + % Have to define \thissection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. + \gdef\thissection{#1}% + \gdef\thischaptername{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \setbox0 =3D \hbox{}% + \def\toctype{unnchap}% + \gdef\thischapternum{}% + \gdef\thischapter{#1}% + \else\ifx\temptype\Yomitfromtockeyword + \setbox0 =3D \hbox{}% contents like unnumbered, but no toc entry + \def\toctype{omit}% + \gdef\thischapternum{}% + \gdef\thischapter{}% + \else\ifx\temptype\Yappendixkeyword + \setbox0 =3D \hbox{\putwordAppendix{} #3\enspace}% + \def\toctype{app}% + \xdef\thischapternum{\appendixletter}% + % We don't substitute the actual chapter name into \thischapter + % because we don't want its macros evaluated now. And we don't + % use \thissection because that changes with each section. + % + \xdef\thischapter{\putwordAppendix{} \appendixletter: + \noexpand\thischaptername}% + \else + \setbox0 =3D \hbox{#3\enspace}% + \def\toctype{numchap}% + \xdef\thischapternum{\the\chapno}% + \xdef\thischapter{\putwordChapter{} \the\chapno: + \noexpand\thischaptername}% + \fi\fi\fi + % + % Write the toc entry for this chapter. Must come before the + % \donoderef, because we include the current node name in the toc + % entry, and \donoderef resets it to empty. + \writetocentry{\toctype}{#1}{#3}% + % + % For pdftex, we have to write out the node definition (aka, make + % the pdfdest) after any page break, but before the actual text has + % been typeset. If the destination for the pdf outline is after the + % text, then jumping from the outline may wind up with the text not + % being visible, for instance under high magnification. + \donoderef{#2}% + % + % Typeset the actual heading. + \vbox{\hyphenpenalty=3D10000 \tolerance=3D5000 \parindent=3D0pt \ragge= dright + \hangindent=3D\wd0 \centerparametersmaybe + \unhbox0 #1\par}% + }% + \nobreak\bigskip % no page break after a chapter title + \nobreak +} + +% @centerchap -- centered and unnumbered. +\let\centerparametersmaybe =3D \relax +\def\centerparameters{% + \advance\rightskip by 3\rightskip + \leftskip =3D \rightskip + \parfillskip =3D 0pt +} + + +% I don't think this chapter style is supported any more, so I'm not +% updating it with the new noderef stuff. We'll see. --karl, 11aug03. +% +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} +% +\def\unnchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=3D10000\tolerance=3D5000 + \parindent=3D0pt\raggedright + \rm #1\hfill}}\bigskip \par\nobreak +} +\def\chfopen #1#2{\chapoddpage {\chapfonts +\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil= }}% +\par\penalty 5000 % +} +\def\centerchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=3D10000\tolerance=3D5000 + \parindent=3D0pt + \hfill {\rm #1}\hfill}}\bigskip \par\nobreak +} +\def\CHAPFopen{% + \global\let\chapmacro=3D\chfopen + \global\let\centerchapmacro=3D\centerchfopen} + + +% Section titles. These macros combine the section number parts and +% call the generic \sectionheading to do the printing. +% +\newskip\secheadingskip +\def\secheadingbreak{\dobreak \secheadingskip{-1000}} + +% Subsection titles. +\newskip\subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} + +% Subsubsection titles. +\def\subsubsecheadingskip{\subsecheadingskip} +\def\subsubsecheadingbreak{\subsecheadingbreak} + + +% Print any size, any type, section title. +% +% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is +% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the +% section number. +% +\def\sectionheading#1#2#3#4{% + {% + % Switch to the right set of fonts. + \csname #2fonts\endcsname \rm + % + % Insert space above the heading. + \csname #2headingbreak\endcsname + % + % Only insert the space after the number if we have a section number. + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + \ifx\temptype\Ynothingkeyword + \setbox0 =3D \hbox{}% + \def\toctype{unn}% + \gdef\thissection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, + % and don't redefine \thissection. + \setbox0 =3D \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=3D\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 =3D \hbox{#4\enspace}% + \def\toctype{app}% + \gdef\thissection{#1}% + \else + \setbox0 =3D \hbox{#4\enspace}% + \def\toctype{num}% + \gdef\thissection{#1}% + \fi\fi\fi + % + % Write the toc entry (before \donoderef). See comments in \chapmacro. + \writetocentry{\toctype\sectionlevel}{#1}{#4}% + % + % Write the node reference (=3D pdf destination for pdftex). + % Again, see comments in \chapmacro. + \donoderef{#3}% + % + % Interline glue will be inserted when the vbox is completed. + % That glue will be a valid breakpoint for the page, since it'll be + % preceded by a whatsit (usually from the \donoderef, or from the + % \writetocentry if there was no node). We don't want to allow that + % break, since then the whatsits could end up on page n while the + % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. + \nobreak + % + % Output the actual section heading. + \vbox{\hyphenpenalty=3D10000 \tolerance=3D5000 \parindent=3D0pt \ragge= dright + \hangindent=3D\wd0 % zero if no section number + \unhbox0 #1}% + }% + % Add extra space after the heading -- half of whatever came above it. + % Don't allow stretch, though. + \kern .5 \csname #2headingskip\endcsname + % + % Do not let the kern be a potential breakpoint, as it would be if it + % was followed by glue. + \nobreak + % + % We'll almost certainly start a paragraph next, so don't let that + % glue accumulate. (Not a breakpoint because it's preceded by a + % discardable item.) + \vskip-\parskip + % + % This is purely so the last item on the list is a known \penalty > + % 10000. This is so \startdefun can avoid allowing breakpoints after + % section headings. Otherwise, it would insert a valid breakpoint betwe= en: + % + % @section sec-whatever + % @deffn def-whatever + \penalty 10001 +} + + +\message{toc,} +% Table of contents. +\newwrite\tocfile + +% Write an entry to the toc file, opening it if necessary. +% Called from @chapter, etc. +% +% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} +% We append the current node name (if any) and page number as additional +% arguments for the \{chap,sec,...}entry macros which will eventually +% read this. The node name is used in the pdf outlines as the +% destination to jump to. +% +% We open the .toc file for writing here instead of at @setfilename (or +% any other fixed time) so that @contents can be anywhere in the document. +% But if #1 is `omit', then we don't do anything. This is used for the +% table of contents chapter openings themselves. +% +\newif\iftocfileopened +\def\omitkeyword{omit}% +% +\def\writetocentry#1#2#3{% + \edef\writetoctype{#1}% + \ifx\writetoctype\omitkeyword \else + \iftocfileopened\else + \immediate\openout\tocfile =3D \jobname.toc + \global\tocfileopenedtrue + \fi + % + \iflinks + {\atdummies + \edef\temp{% + \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% + \temp + }% + \fi + \fi + % + % Tell \shipout to create a pdf destination on each page, if we're + % writing pdf. These are used in the table of contents. We can't + % just write one on every page because the title pages are numbered + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. + \ifpdf \global\pdfmakepagedesttrue \fi +} + + +% These characters do not print properly in the Computer Modern roman +% fonts, so we must take special care. This is more or less redundant +% with the Texinfo input format setup at the end of this file. +% +\def\activecatcodes{% + \catcode`\"=3D\active + \catcode`\$=3D\active + \catcode`\<=3D\active + \catcode`\>=3D\active + \catcode`\\=3D\active + \catcode`\^=3D\active + \catcode`\_=3D\active + \catcode`\|=3D\active + \catcode`\~=3D\active +} + + +% Read the toc file, which is essentially Texinfo input. +\def\readtocfile{% + \setupdatafile + \activecatcodes + \input \jobname.toc +} + +\newskip\contentsrightmargin \contentsrightmargin=3D1in +\newcount\savepageno +\newcount\lastnegativepageno \lastnegativepageno =3D -1 + +% Prepare to read what we've written to \tocfile. +% +\def\startcontents#1{% + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \def\thischapter{}% + \chapmacro{#1}{Yomitfromtoc}{}% + % + \savepageno =3D \pageno + \begingroup % Set up to handle contents files properly. + \raggedbottom % Worry more about breakpoints than the bot= tom. + \advance\hsize by -\contentsrightmargin % Don't use the full line leng= th. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno =3D \lastnegativepageno \fi +} + + +% Normal (long) toc. +\def\contents{% + \startcontents{\putwordTOC}% + \openin 1 \jobname.toc + \ifeof 1 \else + \readtocfile + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \ifeof 1 \else + \pdfmakeoutlines + \fi + \closein 1 + \endgroup + \lastnegativepageno =3D \pageno + \global\pageno =3D \savepageno +} + +% And just the chapters. +\def\summarycontents{% + \startcontents{\putwordShortTOC}% + % + \let\numchapentry =3D \shortchapentry + \let\appentry =3D \shortchapentry + \let\unnchapentry =3D \shortunnchapentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=3D\shortcontrm \let\bf=3D\shortcontbf + \let\sl=3D\shortcontsl \let\tt=3D\shortconttt + \rm + \hyphenpenalty =3D 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\numsecentry##1##2##3##4{} + \let\appsecentry =3D \numsecentry + \let\unnsecentry =3D \numsecentry + \let\numsubsecentry =3D \numsecentry + \let\appsubsecentry =3D \numsecentry + \let\unnsubsecentry =3D \numsecentry + \let\numsubsubsecentry =3D \numsecentry + \let\appsubsubsecentry =3D \numsecentry + \let\unnsubsubsecentry =3D \numsecentry + \openin 1 \jobname.toc + \ifeof 1 \else + \readtocfile + \fi + \closein 1 + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno =3D \pageno + \global\pageno =3D \savepageno +} +\let\shortcontents =3D \summarycontents + +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `A' for an appendix, or `3' for a chapter. +% +\def\shortchaplabel#1{% + % This space should be enough, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + % + % We'd like to right-justify chapter numbers, but that looks strange + % with appendix letters. And right-justifying numbers and + % left-justifying letters looks strange when there is less than 10 + % chapters. Have to read the whole toc once to know how many chapters + % there are before deciding ... + \hbox to 1em{#1\hss}% +} + +% These macros generate individual entries in the table of contents. +% The first argument is the chapter or section name. +% The last argument is the page number. +% The arguments in between are the chapter number, section number, ... + +% Chapters, in the main contents. +\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} +% +% Chapters, in the short toc. +% See comments in \dochapentry re vbox and related settings. +\def\shortchapentry#1#2#3#4{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egr= oup}% +} + +% Appendices, in the main contents. +% Need the word Appendix, and a fixed-size box. +% +\def\appendixbox#1{% + % We use M since it's probably the widest letter. + \setbox0 =3D \hbox{\putwordAppendix{} M}% + \hbox to \wd0{\putwordAppendix{} #1\hss}} +% +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} + +% Unnumbered chapters. +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egrou= p}} + +% Sections. +\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\let\appsecentry=3D\numsecentry +\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} + +% Subsections. +\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\let\appsubsecentry=3D\numsubsecentry +\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} + +% And subsubsections. +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\let\appsubsubsecentry=3D\numsubsubsecentry +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} + +% This parameter controls the indentation of the various levels. +% Same as \defaultparindent. +\newdimen\tocindent \tocindent =3D 15pt + +% Now for the actual typesetting. In all these, #1 is the text and #2 is t= he +% page number. +% +% If the toc has to be broken over pages, we want it to be at chapters +% if at all possible; hence the \penalty. +\def\dochapentry#1#2{% + \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselin= eskip + \begingroup + \chapentryfonts + \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \endgroup + \nobreak\vskip .25\baselineskip plus.1\baselineskip +} + +\def\dosecentry#1#2{\begingroup + \secentryfonts \leftskip=3D\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsecentry#1#2{\begingroup + \subsecentryfonts \leftskip=3D2\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsubsecentry#1#2{\begingroup + \subsubsecentryfonts \leftskip=3D3\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +% We use the same \entry macro as for the index entries. +\let\tocentry =3D \entry + +% Space between chapter (or whatever) number and the title. +\def\labelspace{\hskip1em \relax} + +\def\dopageno#1{{\rm #1}} +\def\doshortpageno#1{{\rm #1}} + +\def\chapentryfonts{\secfonts \rm} +\def\secentryfonts{\textfonts} +\def\subsecentryfonts{\textfonts} +\def\subsubsecentryfonts{\textfonts} + + +\message{environments,} +% @foo ... @end foo. + +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% +% Since these characters are used in examples, it should be an even number= of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% +\def\point{$\star$} +\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} +\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} + +% The @error{} command. +% Adapted from the TeXbook's \boxit. +% +\newbox\errorbox +% +{\tentt \global\dimen0 =3D 3em}% Width of the box. +\dimen2 =3D .55pt % Thickness of rules +% The text. (`r' is open on the right, `e' somewhat less so on the left.) +\setbox0 =3D \hbox{\kern-.75pt \reducedsf error\kern-1.5pt} +% +\setbox\errorbox=3D\hbox to \dimen0{\hfil + \hsize =3D \dimen0 \advance\hsize by -5.8pt % Space to left+right. + \advance\hsize by -2\dimen2 % Rules. + \vbox{% + \hrule height\dimen2 + \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. + \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. + \kern3pt\vrule width\dimen2}% Space to right. + \hrule height\dimen2} + \hfil} +% +\def\error{\leavevmode\lower.7ex\copy\errorbox} + +% @tex ... @end tex escapes into raw Tex temporarily. +% One exception: @ is still an escape character, so that @end tex works. +% But \@ or @@ will get a plain tex @ character. + +\envdef\tex{% + \catcode `\\=3D0 \catcode `\{=3D1 \catcode `\}=3D2 + \catcode `\$=3D3 \catcode `\&=3D4 \catcode `\#=3D6 + \catcode `\^=3D7 \catcode `\_=3D8 \catcode `\~=3D\active \let~=3D\tie + \catcode `\%=3D14 + \catcode `\+=3D\other + \catcode `\"=3D\other + \catcode `\|=3D\other + \catcode `\<=3D\other + \catcode `\>=3D\other + \escapechar=3D`\\ + % + \let\b=3D\ptexb + \let\bullet=3D\ptexbullet + \let\c=3D\ptexc + \let\,=3D\ptexcomma + \let\.=3D\ptexdot + \let\dots=3D\ptexdots + \let\equiv=3D\ptexequiv + \let\!=3D\ptexexclam + \let\i=3D\ptexi + \let\indent=3D\ptexindent + \let\noindent=3D\ptexnoindent + \let\{=3D\ptexlbrace + \let\+=3D\tabalign + \let\}=3D\ptexrbrace + \let\/=3D\ptexslash + \let\*=3D\ptexstar + \let\t=3D\ptext + \let\frenchspacing=3D\plainfrenchspacing + % + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=3D0pt \endldots\= ,$\fi}% + \def\@{@}% +} +% There is no need to define \Etex. + +% Define @lisp ... @end lisp. +% @lisp environment forms a group so it can rebind things, +% including the definition of @end lisp (which normally is erroneous). + +% Amount to narrow the margins by for @lisp. +\newskip\lispnarrowing \lispnarrowing=3D0.4in + +% This is the definition that ^^M gets inside @lisp, @example, and other +% such environments. \null is better than a space, since it doesn't +% have any width. +\def\lisppar{\null\endgraf} + +% This space is always present above and below environments. +\newskip\envskipamount \envskipamount =3D 0pt + +% Make spacing and below environment symmetrical. We use \parskip here +% to help in doing that, since in @example-like environments \parskip +% is reset to zero; thus the \afterenvbreak inserts no space -- but the +% start of the next paragraph will insert \parskip. +% +\def\aboveenvbreak{{% + % =3D10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. + \ifnum \lastpenalty=3D10000 \else + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip + % it's not a good place to break if the last penalty was \nobreak + % or better ... + \ifnum\lastpenalty<10000 \penalty-50 \fi + \vskip\envskipamount + \fi + \fi +}} + +\let\afterenvbreak =3D \aboveenvbreak + +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it wi= ll +% also clear it, so that its embedded environments do the narrowing again. +\let\nonarrowing=3D\relax + +% @cartouche ... @end cartouche: draw rectangle w/rounded corners around +% environment contents. +\font\circle=3Dlcircle10 +\newdimen\circthick +\newdimen\cartouter\newdimen\cartinner +\newskip\normbskip\newskip\normpskip\newskip\normlskip +\circthick=3D\fontdimen8\circle +% +\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth +\def\ctr{{\hskip 6pt\circle\char'010}} +\def\cbl{{\circle\char'012\hskip -6pt}} +\def\cbr{{\hskip 6pt\circle\char'011}} +\def\carttop{\hbox to \cartouter{\hskip\lskip + \ctl\leaders\hrule height\circthick\hfil\ctr + \hskip\rskip}} +\def\cartbot{\hbox to \cartouter{\hskip\lskip + \cbl\leaders\hrule height\circthick\hfil\cbr + \hskip\rskip}} +% +\newskip\lskip\newskip\rskip + +\envdef\cartouche{% + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=3D\leftskip \rskip=3D\rightskip + \leftskip=3D0pt\rightskip=3D0pt % we want these *outside*. + \cartinner=3D\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=3D\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either + % side, and for 6pt waste from + % each corner char, and rule thickness + \normbskip=3D\baselineskip \normpskip=3D\parskip \normlskip=3D\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing =3D t% + \vbox\bgroup + \baselineskip=3D0pt\parskip=3D0pt\lineskip=3D0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \kern3pt + \hsize=3D\cartinner + \baselineskip=3D\normbskip + \lineskip=3D\normlskip + \parskip=3D\normpskip + \vskip -\parskip + \comment % For explanation, see the end of \def\group. +} +\def\Ecartouche{% + \ifhmode\par\fi + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup + \checkinserts +} + + +% This macro is called at the beginning of all the @example variants, +% inside a group. +\def\nonfillstart{% + \aboveenvbreak + \hfuzz =3D 12pt % Don't be fussy + \sepspaces % Make spaces be word-separators rather than space tokens. + \let\par =3D \lisppar % don't ignore blank lines + \obeylines % each line of input is a line of output + \parskip =3D 0pt + \parindent =3D 0pt + \emergencystretch =3D 0pt % don't try to avoid overfull boxes + \ifx\nonarrowing\relax + \advance \leftskip by \lispnarrowing + \exdentamount=3D\lispnarrowing + \else + \let\nonarrowing =3D \relax + \fi + \let\exdent=3D\nofillexdent +} + +% If you want all examples etc. small: @set dispenvsize small. +% If you want even small examples the full size: @set dispenvsize nosmall. +% This affects the following displayed environments: +% @example, @display, @format, @lisp +% +\def\smallword{small} +\def\nosmallword{nosmall} +\let\SETdispenvsize\relax +\def\setnormaldispenv{% + \ifx\SETdispenvsize\smallword + % end paragraph for sake of leading, in case document has no blank + % line. This is redundant with what happens in \aboveenvbreak, but + % we need to do it before changing the fonts, and it's inconvenient + % to change the fonts afterward. + \ifnum \lastpenalty=3D10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} +\def\setsmalldispenv{% + \ifx\SETdispenvsize\nosmallword + \else + \ifnum \lastpenalty=3D10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} + +% We often define two environments, @foo and @smallfoo. +% Let's do it by one command: +\def\makedispenv #1#2{ + \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2} + \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2} + \expandafter\let\csname E#1\endcsname \afterenvbreak + \expandafter\let\csname Esmall#1\endcsname \afterenvbreak +} + +% Define two synonyms: +\def\maketwodispenvs #1#2#3{ + \makedispenv{#1}{#3} + \makedispenv{#2}{#3} +} + +% @lisp: indented, narrowed, typewriter font; @example: same as @lisp. +% +% @smallexample and @smalllisp: use smaller fonts. +% Originally contributed by Pavel@xerox. +% +\maketwodispenvs {lisp}{example}{% + \nonfillstart + \tt\quoteexpand + \let\kbdfont =3D \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return +} +% @display/@smalldisplay: same as @lisp except keep current font. +% +\makedispenv {display}{% + \nonfillstart + \gobble +} + +% @format/@smallformat: same as @display except don't narrow margins. +% +\makedispenv{format}{% + \let\nonarrowing =3D t% + \nonfillstart + \gobble +} + +% @flushleft: same as @format, but doesn't obey \SETdispenvsize. +\envdef\flushleft{% + \let\nonarrowing =3D t% + \nonfillstart + \gobble +} +\let\Eflushleft =3D \afterenvbreak + +% @flushright. +% +\envdef\flushright{% + \let\nonarrowing =3D t% + \nonfillstart + \advance\leftskip by 0pt plus 1fill + \gobble +} +\let\Eflushright =3D \afterenvbreak + + +% @quotation does normal linebreaking (hence we can't use \nonfillstart) +% and narrows the margins. We keep \parskip nonzero in general, since +% we're doing normal filling. So, when using \aboveenvbreak and +% \afterenvbreak, temporarily make \parskip 0. +% +\envdef\quotation{% + {\parskip=3D0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \parindent=3D0pt + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level dow= n. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \advance\rightskip by \lispnarrowing + \exdentamount =3D \lispnarrowing + \else + \let\nonarrowing =3D \relax + \fi + \parsearg\quotationlabel +} + +% We have retained a nonzero parskip for the environment, since we're +% doing normal filling. +% +\def\Equotation{% + \par + \ifx\quotationauthor\undefined\else + % indent a bit. + \leftline{\kern 2\leftskip \sl ---\quotationauthor}% + \fi + {\parskip=3D0pt \afterenvbreak}% +} + +% If we're given an argument, typeset it in bold with a colon after. +\def\quotationlabel#1{% + \def\temp{#1}% + \ifx\temp\empty \else + {\bf #1: }% + \fi +} + + +% LaTeX-like @verbatim...@end verbatim and @verb{...} +% If we want to allow any as delimiter, +% we need the curly braces so that makeinfo sees the @verb command, eg: +% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org +% +% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. +% +% [Knuth] p.344; only we need to do the other characters Texinfo sets +% active too. Otherwise, they get lost as the first character on a +% verbatim line. +\def\dospecials{% + \do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% + \do\<\do\>\do\|\do\@\do+\do\"% +} +% +% [Knuth] p. 380 +\def\uncatcodespecials{% + \def\do##1{\catcode`##1=3D\other}\dospecials} +% +% [Knuth] pp. 380,381,391 +% Disable Spanish ligatures ?` and !` of \tt font +\begingroup + \catcode`\`=3D\active\gdef`{\relax\lq} +\endgroup +% +% Setup for the @verb command. +% +% Eight spaces for a tab +\begingroup + \catcode`\^^I=3D\active + \gdef\tabeightspaces{\catcode`\^^I=3D\active\def^^I{\ \ \ \ \ \ \ \ }} +\endgroup +% +\def\setupverb{% + \tt % easiest (and conventionally used) font for verbatim + \def\par{\leavevmode\endgraf}% + \catcode`\`=3D\active + \tabeightspaces + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces +} + +% Setup for the @verbatim environment +% +% Real tab expansion +\newdimen\tabw \setbox0=3D\hbox{\tt\space} \tabw=3D8\wd0 % tab amount +% +\def\starttabbox{\setbox0=3D\hbox\bgroup} + +% Allow an option to not replace quotes with a regular directed right +% quote/apostrophe (char 0x27), but instead use the undirected quote +% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it +% the default, but it works for pasting with more pdf viewers (at least +% evince), the lilypond developers report. xpdf does work with the +% regular 0x27. +% +\def\codequoteright{% + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else + \char'15 + \fi +} +% +% and a similar option for the left quote char vs. a grave accent. +% Modern fonts display ASCII 0x60 as a grave accent, so some people like +% the code environments to do likewise. +% +\def\codequoteleft{% + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + `% + \else + \char'22 + \fi +} +% +\begingroup + \catcode`\^^I=3D\active + \gdef\tabexpand{% + \catcode`\^^I=3D\active + \def^^I{\leavevmode\egroup + \dimen0=3D\wd0 % the width so far, or since the previous tab + \divide\dimen0 by\tabw + \multiply\dimen0 by\tabw % compute previous multiple of \tabw + \advance\dimen0 by\tabw % advance to next multiple of \tabw + \wd0=3D\dimen0 \box0 \starttabbox + }% + } + \catcode`\'=3D\active + \gdef\rquoteexpand{\catcode\rquoteChar=3D\active \def'{\codequoteright}}% + % + \catcode`\`=3D\active + \gdef\lquoteexpand{\catcode\lquoteChar=3D\active \def`{\codequoteleft}}% + % + \gdef\quoteexpand{\rquoteexpand \lquoteexpand}% +\endgroup + +% start the verbatim environment. +\def\setupverbatim{% + \let\nonarrowing =3D t% + \nonfillstart + % Easiest (and conventionally used) font for verbatim + \tt + \def\par{\leavevmode\egroup\box0\endgraf}% + \catcode`\`=3D\active + \tabexpand + \quoteexpand + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces + \everypar{\starttabbox}% +} + +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a +% right brace, after last delimiter expect closing brace: +% +% \def\doverb'{'#1'}'{#1} +% +% [Knuth] p. 382; only eat outer {} +\begingroup + \catcode`[=3D1\catcode`]=3D2\catcode`\{=3D\other\catcode`\}=3D\other + \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] +\endgroup +% +\def\verb{\begingroup\setupverb\doverb} +% +% +% Do the @verbatim magic: define the macro \doverbatim so that +% the (first) argument ends when '@end verbatim' is reached, ie: +% +% \def\doverbatim#1@end verbatim{#1} +% +% For Texinfo it's a lot easier than for LaTeX, +% because texinfo's \verbatim doesn't stop at '\end{verbatim}': +% we need not redefine '\', '{' and '}'. +% +% Inspired by LaTeX's verbatim command set [latex.ltx] +% +\begingroup + \catcode`\ =3D\active + \obeylines % + % ignore everything up to the first ^^M, that's the newline at the end + % of the @verbatim input line itself. Otherwise we get an extra blank + % line in the output. + \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. +\endgroup +% +\envdef\verbatim{% + \setupverbatim\doverbatim +} +\let\Everbatim =3D \afterenvbreak + + +% @verbatiminclude FILE - insert text of file in verbatim environment. +% +\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} +% +\def\doverbatiminclude#1{% + {% + \makevalueexpandable + \setupverbatim + \input #1 + \afterenvbreak + }% +} + +% @copying ... @end copying. +% Save the text away for @insertcopying later. +% +% We save the uninterpreted tokens, rather than creating a box. +% Saving the text in a box would be much easier, but then all the +% typesetting commands (@smallbook, font changes, etc.) have to be done +% beforehand -- and a) we want @copying to be done first in the source +% file; b) letting users define the frontmatter in as flexible order as +% possible is very desirable. +% +\def\copying{\checkenv{}\begingroup\scanargctxt\docopying} +\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} +% +\def\insertcopying{% + \begingroup + \parindent =3D 0pt % paragraph indentation looks wrong on title page + \scanexp\copyingtext + \endgroup +} + + +\message{defuns,} +% @defun etc. + +\newskip\defbodyindent \defbodyindent=3D.4in +\newskip\defargsindent \defargsindent=3D50pt +\newskip\deflastargmargin \deflastargmargin=3D18pt +\newcount\defunpenalty + +% Start the processing of @deffn: +\def\startdefun{% + \ifnum\lastpenalty<10000 + \medbreak + \defunpenalty=3D10003 % Will keep this @deffn together with the + % following @def command, see below. + \else + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we need to allow a + % break somewhere. Check specifically for penalty 10002, inserted + % by \printdefunline, instead of 10000, since the sectioning + % commands also insert a nobreak penalty, and we don't want to allow + % a break between a section heading and a defun. + % + % As a minor refinement, we avoid "club" headers by signalling + % with penalty of 10003 after the very first @deffn in the + % sequence (see above), and penalty of 10002 after any following + % @def command. + \ifnum\lastpenalty=3D10002 \penalty2000 \else \defunpenalty=3D10002 \fi + % + % Similarly, after a section heading, do not allow a break. + % But do insert the glue. + \medskip % preceded by discardable penalty, so not a breakpoint + \fi + % + \parindent=3D0in + \advance\leftskip by \defbodyindent + \exdentamount=3D\defbodyindent +} + +\def\dodefunx#1{% + % First, check whether we are in the right environment: + \checkenv#1% + % + % As above, allow line break if we have multiple x headers in a row. + % It's not a great place, though. + \ifnum\lastpenalty=3D10002 \penalty3000 \else \defunpenalty=3D10002 \fi + % + % And now, it's time to reuse the body of the original defun: + \expandafter\gobbledefun#1% +} +\def\gobbledefun#1\startdefun{} + +% \printdefunline \deffnheader{text} +% +\def\printdefunline#1#2{% + \begingroup + % call \deffnheader: + #1#2 \endheader + % common ending: + \interlinepenalty =3D 10000 + \advance\rightskip by 0pt plus 1fil + \endgraf + \nobreak\vskip -\parskip + \penalty\defunpenalty % signal to \startdefun and \dodefunx + % Some of the @defun-type tags do not enable magic parentheses, + % rendering the following check redundant. But we don't optimize. + \checkparencounts + \endgroup +} + +\def\Edefun{\endgraf\medbreak} + +% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; +% the only thing remainnig is to define \deffnheader. +% +\def\makedefun#1{% + \expandafter\let\csname E#1\endcsname =3D \Edefun + \edef\temp{\noexpand\domakedefun + \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% + \temp +} + +% \domakedefun \deffn \deffnx \deffnheader +% +% Define \deffn and \deffnx, without parameters. +% \deffnheader has to be defined explicitly. +% +\def\domakedefun#1#2#3{% + \envdef#1{% + \startdefun + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#2{\dodefunx#1}% + \def#3% +} + +%%% Untyped functions: + +% @deffn category name args +\makedefun{deffn}{\deffngeneral{}} + +% @deffn category class name args +\makedefun{defop}#1 {\defopon{#1\ \putwordon}} + +% \defopon {category on}class name args +\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deffngeneral {subind}category name args +% +\def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% +} + +%%% Typed functions: + +% @deftypefn category type name args +\makedefun{deftypefn}{\deftypefngeneral{}} + +% @deftypeop category class type name args +\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} + +% \deftypeopon {category on}class type name args +\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#= 2}} } + +% \deftypefngeneral {subind}category type name args +% +\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% + \dosubind{fn}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +%%% Typed variables: + +% @deftypevr category type var args +\makedefun{deftypevr}{\deftypecvgeneral{}} + +% @deftypecv category class type var args +\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} + +% \deftypecvof {category of}class type var args +\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#= 2}} } + +% \deftypecvgeneral {subind}category type var args +% +\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% + \dosubind{vr}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +%%% Untyped variables: + +% @defvr category var args +\makedefun{defvr}#1 {\deftypevrheader{#1} {} } + +% @defcv category class var args +\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} + +% \defcvof {category of}class var args +\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } + +%%% Type: +% @deftp category name args +\makedefun{deftp}#1 #2 #3\endheader{% + \doind{tp}{\code{#2}}% + \defname{#1}{}{#2}\defunargs{#3\unskip}% +} + +% Remaining @defun-like shortcuts: +\makedefun{defun}{\deffnheader{\putwordDeffunc} } +\makedefun{defmac}{\deffnheader{\putwordDefmac} } +\makedefun{defspec}{\deffnheader{\putwordDefspec} } +\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } +\makedefun{defvar}{\defvrheader{\putwordDefvar} } +\makedefun{defopt}{\defvrheader{\putwordDefopt} } +\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } +\makedefun{defmethod}{\defopon\putwordMethodon} +\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} +\makedefun{defivar}{\defcvof\putwordInstanceVariableof} +\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} + +% \defname, which formats the name of the @def (not the args). +% #1 is the category, such as "Function". +% #2 is the return type, if any. +% #3 is the function name. +% +% We are followed by (but not passed) the arguments, if any. +% +\def\defname#1#2#3{% + % Get the values of \leftskip and \rightskip as they were outside the @d= ef... + \advance\leftskip by -\defbodyindent + % + % How we'll format the type name. Putting it in brackets helps + % distinguish it from the body text that may end up on the next line + % just below it. + \def\temp{#1}% + \setbox0=3D\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\= fi} + % + % Figure out line sizes for the paragraph shape. + % The first line needs space for \box0; but if \rightskip is nonzero, + % we need only space for the part of \box0 which exceeds it: + \dimen0=3D\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip + % The continuations: + \dimen2=3D\hsize \advance\dimen2 by -\defargsindent + % (plain.tex says that \dimen1 should be used only as global.) + \parshape 2 0in \dimen0 \defargsindent \dimen2 + % + % Put the type name to the right margin. + \noindent + \hbox to 0pt{% + \hfil\box0 \kern-\hsize + % \hsize has to be shortened this way: + \kern\leftskip + % Intentionally do not respect \rightskip, since we need the space. + }% + % + % Allow all lines to be underfull without complaint: + \tolerance=3D10000 \hbadness=3D10000 + \exdentamount=3D\defbodyindent + {% + % defun fonts. We use typewriter by default (used to be bold) because: + % . we're printing identifiers, they should be in tt in principle. + % . in languages with many accents, such as Czech or French, it's + % common to leave accents off identifiers. The result looks ok in + % tt, but exceedingly strange in rm. + % . we don't want -- and --- to be treated as ligatures. + % . this still does not fix the ?` and !` ligatures, but so far no + % one has made identifiers using them :). + \df \tt + \def\temp{#2}% return value type + \ifx\temp\empty\else \tclose{\temp} \fi + #3% output function name + }% + {\rm\enskip}% hskip 0.5 em of \tenrm + % + \boldbrax + % arguments will be output next, if any. +} + +% Print arguments in slanted roman (not ttsl), inconsistently with using +% tt for the name. This is because literal text is sometimes needed in +% the argument list (groff manual), and ttsl and tt are not very +% distinguishable. Prevent hyphenation at `-' chars. +% +\def\defunargs#1{% + % use sl by default (not ttsl), + % tt for the names. + \df \sl \hyphenchar\font=3D0 + % + % On the other hand, if an argument has two dashes (for instance), we + % want a way to get ttsl. Let's try @var for that. + \let\var=3D\ttslanted + #1% + \sl\hyphenchar\font=3D45 +} + +% We want ()&[] to print specially on the defun line. +% +\def\activeparens{% + \catcode`\(=3D\active \catcode`\)=3D\active + \catcode`\[=3D\active \catcode`\]=3D\active + \catcode`\&=3D\active +} + +% Make control sequences which act like normal parenthesis chars. +\let\lparen =3D ( \let\rparen =3D ) + +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +{ + \activeparens + \global\let(=3D\lparen \global\let)=3D\rparen + \global\let[=3D\lbrack \global\let]=3D\rbrack + \global\let& =3D \& + + \gdef\boldbrax{\let(=3D\opnr\let)=3D\clnr\let[=3D\lbrb\let]=3D\rbrb} + \gdef\magicamp{\let&=3D\amprm} +} + +\newcount\parencount + +% If we encounter &foo, then turn on ()-hacking afterwards +\newif\ifampseen +\def\amprm#1 {\ampseentrue{\bf\ }} + +\def\parenfont{% + \ifampseen + % At the first level, print parens in roman, + % otherwise use the default font. + \ifnum \parencount=3D1 \rm \fi + \else + % The \sf parens (in \boldbrax) actually are a little bolder than + % the contained text. This is especially needed for [ and ] . + \sf + \fi +} +\def\infirstlevel#1{% + \ifampseen + \ifnum\parencount=3D1 + #1% + \fi + \fi +} +\def\bfafterword#1 {#1 \bf} + +\def\opnr{% + \global\advance\parencount by 1 + {\parenfont(}% + \infirstlevel \bfafterword +} +\def\clnr{% + {\parenfont)}% + \infirstlevel \sl + \global\advance\parencount by -1 +} + +\newcount\brackcount +\def\lbrb{% + \global\advance\brackcount by 1 + {\bf[}% +} +\def\rbrb{% + {\bf]}% + \global\advance\brackcount by -1 +} + +\def\checkparencounts{% + \ifnum\parencount=3D0 \else \badparencount \fi + \ifnum\brackcount=3D0 \else \badbrackcount \fi +} +\def\badparencount{% + \errmessage{Unbalanced parentheses in @def}% + \global\parencount=3D0 +} +\def\badbrackcount{% + \errmessage{Unbalanced square braces in @def}% + \global\brackcount=3D0 +} + + +\message{macros,} +% @macro. + +% To do this right we need a feature of e-TeX, \scantokens, +% which we arrange to emulate with a temporary file in ordinary TeX. +\ifx\eTeXversion\undefined + \newwrite\macscribble + \def\scantokens#1{% + \toks0=3D{#1}% + \immediate\openout\macscribble=3D\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \input \jobname.tmp + } +\fi + +\def\scanmacro#1{% + \begingroup + \newlinechar`\^^M + \let\xeatspaces\eatspaces + % Undo catcode changes of \startcontents and \doprintindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. Previously, we had + % \catcode`\\=3D\other instead. We'll see whether a problem appears + % with macro expansion. --kasal, 19aug04 + \catcode`\@=3D0 \catcode`\\=3D\active \escapechar=3D`\@ + % ... and \example + \spaceisspace + % + % Append \endinput to make sure that TeX does not see the ending newli= ne. + % I've verified that it is necessary both for e-TeX and for ordinary T= eX + % --kasal, 29nov03 + \scantokens{#1\endinput}% + \endgroup +} + +\def\scanexp#1{% + \edef\temp{\noexpand\scanmacro{#1}}% + \temp +} + +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? + +% List of all defined macros in the form +% \definedummyword\macro1\definedummyword\macro2... +% Currently is also contains all @aliases; the list can be split +% if there is a need. +\def\macrolist{} + +% Add the macro to \macrolist +\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} +\def\addtomacrolistxxx#1{% + \toks0 =3D \expandafter{\macrolist\definedummyword#1}% + \xdef\macrolist{\the\toks0}% +} + +% Utility routines. +% This does \let #1 =3D #2, with \csnames; that is, +% \let \csname#1\endcsname =3D \csname#2\endcsname +% (except of course we have to play expansion games). +% +\def\cslet#1#2{% + \expandafter\let + \csname#1\expandafter\endcsname + \csname#2\endcsname +} + +% Trim leading and trailing spaces off a string. +% Concepts from aro-bend problem 15 (see CTAN). +{\catcode`\@=3D11 +\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} +\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} +\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} +\def\unbrace#1{#1} +\unbrace{\gdef\trim@@@ #1 } #2@{#1} +} + +% Trim a single trailing ^^M off a string. +{\catcode`\^^M=3D\other \catcode`\Q=3D3% +\gdef\eatcr #1{\eatcra #1Q^^MQ}% +\gdef\eatcra#1^^MQ{\eatcrb#1Q}% +\gdef\eatcrb#1Q#2Q{#1}% +} + +% Macro bodies are absorbed as an argument in a context where +% all characters are catcode 10, 11 or 12, except \ which is active +% (as in normal texinfo). It is necessary to change the definition of \. + +% It's necessary to have hard CRs when the macro is executed. This is +% done by making ^^M (\endlinechar) catcode 12 when reading the macro +% body, and then making it the \newlinechar in \scanmacro. + +\def\scanctxt{% + \catcode`\"=3D\other + \catcode`\+=3D\other + \catcode`\<=3D\other + \catcode`\>=3D\other + \catcode`\@=3D\other + \catcode`\^=3D\other + \catcode`\_=3D\other + \catcode`\|=3D\other + \catcode`\~=3D\other +} + +\def\scanargctxt{% + \scanctxt + \catcode`\\=3D\other + \catcode`\^^M=3D\other +} + +\def\macrobodyctxt{% + \scanctxt + \catcode`\{=3D\other + \catcode`\}=3D\other + \catcode`\^^M=3D\other + \usembodybackslash +} + +\def\macroargctxt{% + \scanctxt + \catcode`\\=3D\other +} + +% \mbodybackslash is the definition of \ in @macro bodies. +% It maps \foo\ =3D> \csname macarg.foo\endcsname =3D> #N +% where N is the macro parameter number. +% We define \csname macarg.\endcsname to be \realbackslash, so +% \\ in macro replacement text gets you a backslash. + +{\catcode`@=3D0 @catcode`@\=3D@active + @gdef@usembodybackslash{@let\=3D@mbodybackslash} + @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} +} +\expandafter\def\csname macarg.\endcsname{\realbackslash} + +\def\macro{\recursivefalse\parsearg\macroxxx} +\def\rmacro{\recursivetrue\parsearg\macroxxx} + +\def\macroxxx#1{% + \getargs{#1}% now \macname is the macname and \argl the arglist + \ifx\argl\empty % no arguments + \paramno=3D0% + \else + \expandafter\parsemargdef \argl;% + \fi + \if1\csname ismacro.\the\macname\endcsname + \message{Warning: redefining \the\macname}% + \else + \expandafter\ifx\csname \the\macname\endcsname \relax + \else \errmessage{Macro name \the\macname\space already defined}\fi + \global\cslet{macsave.\the\macname}{\the\macname}% + \global\expandafter\let\csname ismacro.\the\macname\endcsname=3D1% + \addtomacrolist{\the\macname}% + \fi + \begingroup \macrobodyctxt + \ifrecursive \expandafter\parsermacbody + \else \expandafter\parsemacbody + \fi} + +\parseargdef\unmacro{% + \if1\csname ismacro.#1\endcsname + \global\cslet{#1}{macsave.#1}% + \global\expandafter\let \csname ismacro.#1\endcsname=3D0% + % Remove the macro name from \macrolist: + \begingroup + \expandafter\let\csname#1\endcsname \relax + \let\definedummyword\unmacrodo + \xdef\macrolist{\macrolist}% + \endgroup + \else + \errmessage{Macro #1 not defined}% + \fi +} + +% Called by \do from \dounmacro on each macro. The idea is to omit any +% macro definitions that have been changed to \relax. +% +\def\unmacrodo#1{% + \ifx #1\relax + % remove this + \else + \noexpand\definedummyword \noexpand#1% + \fi +} + +% This makes use of the obscure feature that if the last token of a +% is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. +\def\getargs#1{\getargsxxx#1{}} +\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} +\def\getmacname #1 #2\relax{\macname=3D{#1}} +\def\getmacargs#1{\def\argl{#1}} + +% Parse the optional {params} list. Set up \paramno and \paramlist +% so \defmacro knows what to do. Define \macarg.blah for each blah +% in the params list, to be ##N where N is the position in that list. +% That gets used by \mbodybackslash (above). + +% We need to get `macro parameter char #' into several definitions. +% The technique used is stolen from LaTeX: let \hash be something +% unexpandable, insert that wherever you need a #, and then redefine +% it to # just before using the token list produced. +% +% The same technique is used to protect \eatspaces till just before +% the macro is used. + +\def\parsemargdef#1;{\paramno=3D0\def\paramlist{}% + \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} +\def\parsemargdefxxx#1,{% + \if#1;\let\next=3D\relax + \else \let\next=3D\parsemargdefxxx + \advance\paramno by 1% + \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname + {\xeatspaces{\hash\the\paramno}}% + \edef\paramlist{\paramlist\hash\the\paramno,}% + \fi\next} + +% These two commands read recursive and nonrecursive macro bodies. +% (They're different since rec and nonrec macros end differently.) + +\long\def\parsemacbody#1@end macro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\long\def\parsermacbody#1@end rmacro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% + +% This defines the macro itself. There are six cases: recursive and +% nonrecursive macros of zero, one, and many arguments. +% Much magic with \expandafter here. +% \xdef is used so that macro definitions will survive the file +% they're defined in; @include reads the file inside a group. +\def\defmacro{% + \let\hash=3D##% convert placeholders to macro parameter chars + \ifrecursive + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\scanmacro{\temp}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup\noexpand\scanmacro{\temp}}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{\egroup\noexpand\scanmacro{\temp}}% + \fi + \else + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \expandafter\noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \fi + \fi} + +\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + +% \braceorline decides whether the next nonwhitespace character is a +% {. If so it reads up to the closing }, if not, it reads the whole +% line. Whatever was read is then fed to the next control sequence +% as an argument (by \parsebrace or \parsearg) +\def\braceorline#1{\let\macnamexxx=3D#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup\else + \expandafter\parsearg + \fi \macnamexxx} + + +% @alias. +% We need some trickery to remove the optional spaces around the equal +% sign. Just make them active and then expand them all to nothing. +\def\alias{\parseargusing\obeyspaces\aliasxxx} +\def\aliasxxx #1{\aliasyyy#1\relax} +\def\aliasyyy #1=3D#2\relax{% + {% + \expandafter\let\obeyedspace=3D\empty + \addtomacrolist{#1}% + \xdef\next{\global\let\makecsname{#1}=3D\makecsname{#2}}% + }% + \next +} + + +\message{cross references,} + +\newwrite\auxfile +\newif\ifhavexrefs % True if xref values are known. +\newif\ifwarnedxrefs % True if we warned once that they aren't known. + +% @inforef is relatively simple. +\def\inforef #1{\inforefzzz #1,,,,**} +\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} = \file{\ignorespaces #3{}}, + node \samp{\ignorespaces#1{}}} + +% @node's only job in TeX is to define \lastnode, which is used in +% cross-references. The @node line might or might not have commas, and +% might or might not have spaces before the first comma, like: +% @node foo , bar , ... +% We don't want such trailing spaces in the node name. +% +\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} +% +% also remove a trailing comma, in case of something like this: +% @node Help-Cross, , , Cross-refs +\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} + +\let\nwnode=3D\node +\let\lastnode=3D\empty + +% Write a cross-reference definition for the current node. #1 is the +% type (Ynumbered, Yappendix, Ynothing). +% +\def\donoderef#1{% + \ifx\lastnode\empty\else + \setref{\lastnode}{#1}% + \global\let\lastnode=3D\empty + \fi +} + +% @anchor{NAME} -- define xref target at arbitrary point. +% +\newcount\savesfregister +% +\def\savesf{\relax \ifhmode \savesfregister=3D\spacefactor \fi} +\def\restoresf{\relax \ifhmode \spacefactor=3D\savesfregister \fi} +\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} + +% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an +% anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name taken from \thissection, +% or the anchor name. +% 2) NAME-snt - section number and type, passed as the SNT arg, or +% empty for anchors. +% 3) NAME-pg - the page number. +% +% This is called from \donoderef, \anchor, and \dofloat. In the case of +% floats, there is an additional part, which is not written here: +% 4) NAME-lof - the text as it should appear in a @listoffloats. +% +\def\setref#1#2{% + \pdfmkdest{#1}% + \iflinks + {% + \atdummies % preserve commands, but don't expand them + \edef\writexrdef##1##2{% + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% + \toks0 =3D \expandafter{\thissection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during= \shipout + }% + \fi +} + +% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is +% the node name, #2 the name of the Info cross-reference, #3 the printed +% node name, #4 the name of the Info file, #5 the name of the printed +% manual. All but the node name can be omitted. +% +\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} +\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} +\def\ref#1{\xrefX[#1,,,,,,,]} +\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \unsepspaces + \def\printedmanual{\ignorespaces #5}% + \def\printedrefname{\ignorespaces #3}% + \setbox1=3D\hbox{\printedmanual\unskip}% + \setbox0=3D\hbox{\printedrefname\unskip}% + \ifdim \wd0 =3D 0pt + % No printed node name was explicitly given. + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax + % Use the node name inside the square brackets. + \def\printedrefname{\ignorespaces #1}% + \else + % Use the actual chapter/section title appear inside + % the square brackets. Use the real section title if we have it. + \ifdim \wd1 > 0pt + % It is in another manual, so we don't have it. + \def\printedrefname{\ignorespaces #1}% + \else + \ifhavexrefs + % We know the real title if we have the xref values. + \def\printedrefname{\refx{#1-title}{}}% + \else + % Otherwise just copy the Info node name. + \def\printedrefname{\ignorespaces #1}% + \fi% + \fi + \fi + \fi + % + % Make link in pdf output. + \ifpdf + \leavevmode + \getfilename{#4}% + {\indexnofonts + \turnoffactive + % See comments at \activebackslashdouble. + {\activebackslashdouble \xdef\pdfxrefdest{#1}% + \backslashparens\pdfxrefdest}% + % + \ifnum\filenamelength>0 + \startlink attr{/Border [0 0 0]}% + goto file{\the\filename.pdf} name{\pdfxrefdest}% + \else + \startlink attr{/Border [0 0 0]}% + goto name{\pdfmkpgn{\pdfxrefdest}}% + \fi + }% + \linkcolor + \fi + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". We distinguish them by the + % LABEL-title being set to a magic string. + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + \iffloat\Xthisreftitle + % If the user specified the print name (third arg) to the ref, + % print it instead of our usual "Figure 1.2". + \ifdim\wd0 =3D 0pt + \refx{#1-snt}{}% + \else + \printedrefname + \fi + % + % if the user also gave the printed manual name (fifth arg), append + % "in MANUALNAME". + \ifdim \wd1 > 0pt + \space \putwordin{} \cite{\printedmanual}% + \fi + \else + % node/anchor (non-float) references. + % + % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not + % insert empty discretionaries after hyphens, which means that it will + % not find a line break at a hyphen in a node names. Since some manua= ls + % are best written with fairly long node names, containing hyphens, th= is + % is a loss. Therefore, we give the text of the node name again, so it + % is as if TeX is seeing it for the first time. + \ifdim \wd1 > 0pt + \putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedman= ual}% + \else + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 =3D \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % output the `[mynode]' via a macro so it can be overridden. + \xrefprintnodename\printedrefname + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + \fi + \fi + \endlink +\endgroup} + +% This macro is called from \xrefX for the `[nodename]' part of xref +% output. It's a separate macro only so it can be changed more easily, +% since square brackets don't work well in some documents. Particularly +% one that Bob is working on :). +% +\def\xrefprintnodename#1{[#1]} + +% Things referred to by \setref. +% +\def\Ynothing{} +\def\Yomitfromtoc{} +\def\Ynumbered{% + \ifnum\secno=3D0 + \putwordChapter@tie \the\chapno + \else \ifnum\subsecno=3D0 + \putwordSection@tie \the\chapno.\the\secno + \else \ifnum\subsubsecno=3D0 + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno + \else + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubse= cno + \fi\fi\fi +} +\def\Yappendix{% + \ifnum\secno=3D0 + \putwordAppendix@tie @char\the\appendixno{}% + \else \ifnum\subsecno=3D0 + \putwordSection@tie @char\the\appendixno.\the\secno + \else \ifnum\subsubsecno=3D0 + \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno + \else + \putwordSection@tie + @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} + +% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named N= AME. +% If its value is nonempty, SUFFIX is output afterward. +% +\def\refx#1#2{% + {% + \indexnofonts + \otherbackslash + \expandafter\global\expandafter\let\expandafter\thisrefX + \csname XR#1\endcsname + }% + \ifx\thisrefX\relax + % If not defined, say something at least. + \angleleft un\-de\-fined\angleright + \iflinks + \ifhavexrefs + \message{\linenumber Undefined cross reference `#1'.}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.= }% + \fi + \fi + \fi + \else + % It's defined, so just use it. + \thisrefX + \fi + #2% Output the suffix in any case. +} + +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. +% +\def\xrdef#1#2{% + {% The node name might contain 8-bit characters, which in our current + % implementation are changed to commands like @'e. Don't let these + % mess up the control sequence name. + \indexnofonts + \turnoffactive + \xdef\safexrefname{#1}% + }% + % + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xr= ef + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR\safexrefname\endcsname + % it was a float, and we have the (safe) float type in \iffloattype. + \expandafter\let\expandafter\floatlist + \csname floatlist\iffloattype\endcsname + % + % Is this the first time we've seen this float type? + \expandafter\ifx\floatlist\relax + \toks0 =3D {\do}% yes, so just \do + \else + % had it before, so preserve previous elements in list. + \toks0 =3D \expandafter{\floatlist\do}% + \fi + % + % Remember this xref in the control sequence \floatlistFLOATTYPE, + % for later use in \listoffloats. + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 + {\safexrefname}}% + \fi +} + +% Read the last existing aux file, if any. No error if none exists. +% +\def\tryauxfile{% + \openin 1 \jobname.aux + \ifeof 1 \else + \readdatafile{aux}% + \global\havexrefstrue + \fi + \closein 1 +} + +\def\setupdatafile{% + \catcode`\^^@=3D\other + \catcode`\^^A=3D\other + \catcode`\^^B=3D\other + \catcode`\^^C=3D\other + \catcode`\^^D=3D\other + \catcode`\^^E=3D\other + \catcode`\^^F=3D\other + \catcode`\^^G=3D\other + \catcode`\^^H=3D\other + \catcode`\^^K=3D\other + \catcode`\^^L=3D\other + \catcode`\^^N=3D\other + \catcode`\^^P=3D\other + \catcode`\^^Q=3D\other + \catcode`\^^R=3D\other + \catcode`\^^S=3D\other + \catcode`\^^T=3D\other + \catcode`\^^U=3D\other + \catcode`\^^V=3D\other + \catcode`\^^W=3D\other + \catcode`\^^X=3D\other + \catcode`\^^Z=3D\other + \catcode`\^^[=3D\other + \catcode`\^^\=3D\other + \catcode`\^^]=3D\other + \catcode`\^^^=3D\other + \catcode`\^^_=3D\other + % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 = etc. + % in xref tags, i.e., node names. But since ^^e4 notation isn't + % supported in the main text, it doesn't seem desirable. Furthermore, + % that is not enough: for node names that actually contain a ^ + % character, we would end up writing a line like this: 'xrdef {'hat + % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first + % argument, and \hat is not an expandable control sequence. It could + % all be worked out, but why? Either we support ^^ or we don't. + % + % The other change necessary for this was to define \auxhat: + % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter + % and then to call \auxhat in \setq. + % + \catcode`\^=3D\other + % + % Special characters. Should be turned off anyway, but... + \catcode`\~=3D\other + \catcode`\[=3D\other + \catcode`\]=3D\other + \catcode`\"=3D\other + \catcode`\_=3D\other + \catcode`\|=3D\other + \catcode`\<=3D\other + \catcode`\>=3D\other + \catcode`\$=3D\other + \catcode`\#=3D\other + \catcode`\&=3D\other + \catcode`\%=3D\other + \catcode`+=3D\other % avoid \+ for paranoia even though we've turned it = off + % + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=3D\other + % + % Make the characters 128-255 be printing characters. + {% + \count1=3D128 + \def\loop{% + \catcode\count1=3D\other + \advance\count1 by 1 + \ifnum \count1<256 \loop \fi + }% + }% + % + % @ is our escape character in .aux files, and we need braces. + \catcode`\{=3D1 + \catcode`\}=3D2 + \catcode`\@=3D0 +} + +\def\readdatafile#1{% +\begingroup + \setupdatafile + \input\jobname.#1 +\endgroup} + + +\message{insertions,} +% including footnotes. + +\newcount \footnoteno + +% The trailing space in the following definition for supereject is +% vital for proper filling; pages come out unaligned when you do a +% pagealignmacro call if that space before the closing brace is +% removed. (Generally, numeric constants should always be followed by a +% space to prevent strange expansion errors.) +\def\supereject{\par\penalty -20000\footnoteno =3D0 } + +% @footnotestyle is meaningful for info output only. +\let\footnotestyle=3D\comment + +{\catcode `\@=3D11 +% +% Auto-number footnotes. Otherwise like plain. +\gdef\footnote{% + \let\indent=3D\ptexindent + \let\noindent=3D\ptexnoindent + \global\advance\footnoteno by \@ne + \edef\thisfootno{$^{\the\footnoteno}$}% + % + % In case the footnote comes at the end of a sentence, preserve the + % extra spacing after we do the footnote number. + \let\@sf\empty + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi + % + % Remove inadvertent blank space before typesetting the footnote number. + \unskip + \thisfootno\@sf + \dofootnote +}% + +% Don't bother with the trickery in plain.tex to not require the +% footnote text as a parameter. Our footnotes don't need to be so general. +% +% Oh yes, they do; otherwise, @ifset (and anything else that uses +% \parseargline) fails inside footnotes because the tokens are fixed when +% the footnote is read. --karl, 16nov96. +% +\gdef\dofootnote{% + \insert\footins\bgroup + % We want to typeset this text as a normal paragraph, even if the + % footnote reference occurs in (for example) a display environment. + % So reset some parameters. + \hsize=3D\pagewidth + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox + \floatingpenalty\@MM + \leftskip\z@skip + \rightskip\z@skip + \spaceskip\z@skip + \xspaceskip\z@skip + \parindent\defaultparindent + % + \smallfonts \rm + % + % Because we use hanging indentation in footnotes, a @noindent appears + % to exdent this text, so make it be a no-op. makeinfo does not use + % hanging indentation so @noindent can still be needed within footnote + % text after an @example or the like (not that this is good style). + \let\noindent =3D \relax + % + % Hang the footnote text off the number. Use \everypar in case the + % footnote extends for more than one paragraph. + \everypar =3D {\hang}% + \textindent{\thisfootno}% + % + % Don't crash into the line above the footnote text. Since this + % expands into a box, it must come within the paragraph, lest it + % provide a place where TeX can split the footnote. + \footstrut + \futurelet\next\fo@t +} +}%end \catcode `\@=3D11 + +% In case a @footnote appears in a vbox, save the footnote text and create +% the real \insert just after the vbox finished. Otherwise, the insertion +% would be lost. +% Similarly, if a @footnote appears inside an alignment, save the footnote +% text to a box and make the \insert when a row of the table is finished. +% And the same can be done for other insert classes. --kasal, 16nov03. + +% Replace the \insert primitive by a cheating macro. +% Deeper inside, just make sure that the saved insertions are not spilled +% out prematurely. +% +\def\startsavinginserts{% + \ifx \insert\ptexinsert + \let\insert\saveinsert + \else + \let\checkinserts\relax + \fi +} + +% This \insert replacement works for both \insert\footins{foo} and +% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo= }. +% +\def\saveinsert#1{% + \edef\next{\noexpand\savetobox \makeSAVEname#1}% + \afterassignment\next + % swallow the left brace + \let\temp =3D +} +\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} +\def\savetobox#1{\global\setbox#1 =3D \vbox\bgroup \unvbox#1} + +\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} + +\def\placesaveins#1{% + \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname + {\box#1}% +} + +% eat @SAVE -- beware, all of them have catcode \other: +{ + \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) + \gdef\gobblesave @SAVE{} +} + +% initialization: +\def\newsaveins #1{% + \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% + \next +} +\def\newsaveinsX #1{% + \csname newbox\endcsname #1% + \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts + \checksaveins #1}% +} + +% initialize: +\let\checkinserts\empty +\newsaveins\footins +\newsaveins\margin + + +% @image. We use the macros from epsf.tex to support this. +% If epsf.tex is not installed and @image is used, we complain. +% +% Check for and read epsf.tex up front. If we read it only at @image +% time, we might be inside a group, and then its definitions would get +% undone and the next image would fail. +\openin 1 =3D epsf.tex +\ifeof 1 \else + % Do not bother showing banner with epsf.tex v2.7k (available in + % doc/epsf.tex and on ctan). + \def\epsfannounce{\toks0 =3D }% + \input epsf.tex +\fi +\closein 1 +% +% We will only complain once about lack of epsf.tex. +\newif\ifwarnednoepsf +\newhelp\noepsfhelp{epsf.tex must be installed for images to + work. It is also included in the Texinfo distribution, or you can get + it from ftp://tug.org/tex/epsf.tex.} +% +\def\image#1{% + \ifx\epsfbox\undefined + \ifwarnednoepsf \else + \errhelp =3D \noepsfhelp + \errmessage{epsf.tex not found, images will be ignored}% + \global\warnednoepsftrue + \fi + \else + \imagexxx #1,,,,,\finish + \fi +} +% +% Arguments to @image: +% #1 is (mandatory) image filename; we tack on .eps extension. +% #2 is (optional) width, #3 is (optional) height. +% #4 is (ignored optional) html alt text. +% #5 is (ignored optional) extension. +% #6 is just the usual extra ignored arg for parsing this stuff. +\newif\ifimagevmode +\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup + \catcode`\^^M =3D 5 % in case we're inside an example + \normalturnoffactive % allow _ et al. in names + % If the image is by itself, center it. + \ifvmode + \imagevmodetrue + \nobreak\bigskip + % Usually we'll have text after the image which will insert + % \parskip glue, so insert it here too to equalize the space + % above and below. + \nobreak\vskip\parskip + \nobreak + \line\bgroup + \fi + % + % Output the image. + \ifpdf + \dopdfimage{#1}{#2}{#3}% + \else + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 =3D \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=3D#2\r= elax \fi + \setbox0 =3D \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=3D#3\r= elax \fi + \epsfbox{#1.eps}% + \fi + % + \ifimagevmode \egroup \bigbreak \fi % space after the image +\endgroup} + + +% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, +% etc. We don't actually implement floating yet, we always include the +% float "here". But it seemed the best name for the future. +% +\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} + +% There may be a space before second and/or third parameter; delete it. +\def\eatcommaspace#1, {#1,} + +% #1 is the optional FLOATTYPE, the text label for this float, typically +% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, +% this float will not be numbered and cannot be referred to. +% +% #2 is the optional xref label. Also must be present for the float to +% be referable. +% +% #3 is the optional positioning argument; for now, it is ignored. It +% will somehow specify the positions allowed to float to (here, top, botto= m). +% +% We keep a separate counter for each FLOATTYPE, which we reset at each +% chapter-level command. +\let\resetallfloatnos=3D\empty +% +\def\dofloat#1,#2,#3,#4\finish{% + \let\thiscaption=3D\empty + \let\thisshortcaption=3D\empty + % + % don't lose footnotes inside @float. + % + % BEWARE: when the floats start float, we have to issue warning whenever= an + % insert appears inside a float which could possibly float. --kasal, 26m= ay04 + % + \startsavinginserts + % + % We can't be used inside a paragraph. + \par + % + \vtop\bgroup + \def\floattype{#1}% + \def\floatlabel{#2}% + \def\floatloc{#3}% we do nothing with this yet. + % + \ifx\floattype\empty + \let\safefloattype=3D\empty + \else + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + \fi + % + % If label is given but no type, we handle that as the empty type. + \ifx\floatlabel\empty \else + % We want each FLOATTYPE to be numbered separately (Figure 1, + % Table 1, Figure 2, ...). (And if no label, no number.) + % + \expandafter\getfloatno\csname\safefloattype floatno\endcsname + \global\advance\floatno by 1 + % + {% + % This magic value for \thissection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % + \edef\thissection{\floatmagic=3D\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi + % + % start with \parskip glue, I guess. + \vskip\parskip + % + % Don't suppress indentation if a float happens to start a section. + \restorefirstparagraphindent +} + +% we have these possibilities: +% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap +% @float Foo,lbl & no caption: Foo 1.1 +% @float Foo & @caption{Cap}: Foo: Cap +% @float Foo & no caption: Foo +% @float ,lbl & Caption{Cap}: 1.1: Cap +% @float ,lbl & no caption: 1.1 +% @float & @caption{Cap}: Cap +% @float & no caption: +% +\def\Efloat{% + \let\floatident =3D \empty + % + % In all cases, if we have a float type, it comes first. + \ifx\floattype\empty \else \def\floatident{\floattype}\fi + % + % If we have an xref label, the number comes next. + \ifx\floatlabel\empty \else + \ifx\floattype\empty \else % if also had float type, need tie first. + \appendtomacro\floatident{\tie}% + \fi + % the number. + \appendtomacro\floatident{\chaplevelprefix\the\floatno}% + \fi + % + % Start the printed caption with what we've constructed in + % \floatident, but keep it separate; we need \floatident again. + \let\captionline =3D \floatident + % + \ifx\thiscaption\empty \else + \ifx\floatident\empty \else + \appendtomacro\captionline{: }% had ident, so need a colon between + \fi + % + % caption text. + \appendtomacro\captionline{\scanexp\thiscaption}% + \fi + % + % If we have anything to print, print it, with space before. + % Eventually this needs to become an \insert. + \ifx\captionline\empty \else + \vskip.5\parskip + \captionline + % + % Space below caption. + \vskip\parskip + \fi + % + % If have an xref label, write the list of floats info. Do this + % after the caption, to avoid chance of it being a breakpoint. + \ifx\floatlabel\empty \else + % Write the text that goes in the lof to the aux file as + % \floatlabel-lof. Besides \floatident, we include the short + % caption if specified, else the full caption if specified, else not= hing. + {% + \atdummies + % + % since we read the caption text in the macro world, where ^^M + % is turned into a normal character, we have to scan it back, so + % we don't write the literal three characters "^^M" into the aux f= ile. + \scanexp{% + \xdef\noexpand\gtemp{% + \ifx\thisshortcaption\empty + \thiscaption + \else + \thisshortcaption + \fi + }% + }% + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident + \ifx\gtemp\empty \else : \gtemp \fi}}% + }% + \fi + \egroup % end of \vtop + % + % place the captured inserts + % + % BEWARE: when the floats start floating, we have to issue warning + % whenever an insert appears inside a float which could possibly + % float. --kasal, 26may04 + % + \checkinserts +} + +% Append the tokens #2 to the definition of macro #1, not expanding either. +% +\def\appendtomacro#1#2{% + \expandafter\def\expandafter#1\expandafter{#1#2}% +} + +% @caption, @shortcaption +% +\def\caption{\docaption\thiscaption} +\def\shortcaption{\docaption\thisshortcaption} +\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} +\def\defcaption#1#2{\egroup \def#1{#2}} + +% The parameter is the control sequence identifying the counter we are +% going to use. Create it if it doesn't exist and assign it to \floatno. +\def\getfloatno#1{% + \ifx#1\relax + % Haven't seen this figure type before. + \csname newcount\endcsname #1% + % + % Remember to reset this floatno at the next chap. + \expandafter\gdef\expandafter\resetallfloatnos + \expandafter{\resetallfloatnos #1=3D0 }% + \fi + \let\floatno#1% +} + +% \setref calls this to get the XREFLABEL-snt value. We want an @xref +% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we +% first read the @float command. +% +\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% + +% Magic string used for the XREFLABEL-title value, so \xrefX can +% distinguish floats from other xref types. +\def\floatmagic{!!float!!} + +% #1 is the control sequence we are passed; we expand into a conditional +% which is true if #1 represents a float ref. That is, the magic +% \thissection value which we \setref above. +% +\def\iffloat#1{\expandafter\doiffloat#1=3D=3D\finish} +% +% #1 is (maybe) the \floatmagic string. If so, #2 will be the +% (safe) float type for this float. We set \iffloattype to #2. +% +\def\doiffloat#1=3D#2=3D#3\finish{% + \def\temp{#1}% + \def\iffloattype{#2}% + \ifx\temp\floatmagic +} + +% @listoffloats FLOATTYPE - print a list of floats like a table of content= s. +% +\parseargdef\listoffloats{% + \def\floattype{#1}% floattype + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + % + % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. + \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax + \ifhavexrefs + % if the user said @listoffloats foo but never @float foo. + \message{\linenumber No `\safefloattype' floats to list.}% + \fi + \else + \begingroup + \leftskip=3D\tocindent % indent these entries like a toc + \let\do=3D\listoffloatsdo + \csname floatlist\safefloattype\endcsname + \endgroup + \fi +} + +% This is called on each entry in a list of floats. We're passed the +% xref label, in the form LABEL-title, which is how we save it in the +% aux file. We strip off the -title and look up \XRLABEL-lof, which +% has the text we're supposed to typeset here. +% +% Figures without xref labels will not be included in the list (since +% they won't appear in the aux file). +% +\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} +\def\listoffloatsdoentry#1-title\finish{{% + % Can't fully expand XR#1-lof because it can contain anything. Just + % pass the control sequence. On the other hand, XR#1-pg is just the + % page number, and we want to fully expand that so we can get a link + % in pdf output. + \toksA =3D \expandafter{\csname XR#1-lof\endcsname}% + % + % use the same \entry macro we use to generate the TOC and index. + \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% + \writeentry +}} + + +\message{localization,} + +% @documentlanguage is usually given very early, just after +% @setfilename. If done too late, it may not override everything +% properly. Single argument is the language abbreviation. +% It would be nice if we could set up a hyphenation file here. +% +\parseargdef\documentlanguage{% + \tex % read txi-??.tex file in plain TeX. + % Read the file if it exists. + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp =3D \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \input txi-#1.tex + \fi + \closein 1 + \endgroup +} +\newhelp\nolanghelp{The given language definition file cannot be found or +is empty. Maybe you need to install it? In the current directory +should work if nowhere else does.} + +% Set the catcode of characters 128 through 255 to the specified number. +% +\def\setnonasciicharscatcode#1{% + \count255=3D128 + \loop\ifnum\count255<256 + \global\catcode\count255=3D#1 + \advance\count255 by 1 + \repeat +} + +% @documentencoding sets the definition of non-ASCII characters +% according to the specified encoding. +% +\parseargdef\documentencoding{% + % Encoding being declared for the document. + \def\declaredencoding{\csname #1.enc\endcsname}% + % + % Supported encodings: names converted to tokens in order to be able + % to compare them with \ifx. + \def\ascii{\csname US-ASCII.enc\endcsname}% + \def\latnine{\csname ISO-8859-15.enc\endcsname}% + \def\latone{\csname ISO-8859-1.enc\endcsname}% + \def\lattwo{\csname ISO-8859-2.enc\endcsname}% + \def\utfeight{\csname UTF-8.enc\endcsname}% + % + \ifx \declaredencoding \ascii + \asciichardefs + % + \else \ifx \declaredencoding \lattwo + \setnonasciicharscatcode\active + \lattwochardefs + % + \else \ifx \declaredencoding \latone + \setnonasciicharscatcode\active + \latonechardefs + % + \else \ifx \declaredencoding \latnine + \setnonasciicharscatcode\active + \latninechardefs + % + \else \ifx \declaredencoding \utfeight + \setnonasciicharscatcode\active + \utfeightchardefs + % + \else + \message{Unknown document encoding #1, ignoring.}% + % + \fi % utfeight + \fi % latnine + \fi % latone + \fi % lattwo + \fi % ascii +} + +% A message to be logged when using a character that isn't available +% the default font encoding (OT1). +% +\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} + +% Take account of \c (plain) vs. \, (Texinfo) difference. +\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} + +% First, make active non-ASCII characters in order for them to be +% correctly categorized when TeX reads the replacement text of +% macros containing the character definitions. +\setnonasciicharscatcode\active +% +% Latin1 (ISO-8859-1) character definitions. +\def\latonechardefs{% + \gdef^^a0{~} + \gdef^^a1{\exclamdown} + \gdef^^a2{\missingcharmsg{CENT SIGN}} + \gdef^^a3{{\pounds}} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\missingcharmsg{YEN SIGN}} + \gdef^^a6{\missingcharmsg{BROKEN BAR}} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\copyright} + \gdef^^aa{\ordf} + \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}} + \gdef^^ac{$\lnot$} + \gdef^^ad{\-} + \gdef^^ae{\registeredsymbol} + \gdef^^af{\=3D{}} + % + \gdef^^b0{\textdegree} + \gdef^^b1{$\pm$} + \gdef^^b2{$^2$} + \gdef^^b3{$^3$} + \gdef^^b4{\'{}} + \gdef^^b5{$\mu$} + \gdef^^b6{\P} + % + \gdef^^b7{$^.$} + \gdef^^b8{\cedilla\ } + \gdef^^b9{$^1$} + \gdef^^ba{\ordm} + % + \gdef^^bb{\missingcharmsg{RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK}} + \gdef^^bc{$1\over4$} + \gdef^^bd{$1\over2$} + \gdef^^be{$3\over4$} + \gdef^^bf{\questiondown} + % + \gdef^^c0{\`A} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\~A} + \gdef^^c4{\"A} + \gdef^^c5{\ringaccent A} + \gdef^^c6{\AE} + \gdef^^c7{\cedilla C} + \gdef^^c8{\`E} + \gdef^^c9{\'E} + \gdef^^ca{\^E} + \gdef^^cb{\"E} + \gdef^^cc{\`I} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\"I} + % + \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER ETH}} + \gdef^^d1{\~N} + \gdef^^d2{\`O} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\~O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\O} + \gdef^^d9{\`U} + \gdef^^da{\'U} + \gdef^^db{\^U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\missingcharmsg{LATIN CAPITAL LETTER THORN}} + \gdef^^df{\ss} + % + \gdef^^e0{\`a} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\~a} + \gdef^^e4{\"a} + \gdef^^e5{\ringaccent a} + \gdef^^e6{\ae} + \gdef^^e7{\cedilla c} + \gdef^^e8{\`e} + \gdef^^e9{\'e} + \gdef^^ea{\^e} + \gdef^^eb{\"e} + \gdef^^ec{\`{\dotless i}} + \gdef^^ed{\'{\dotless i}} + \gdef^^ee{\^{\dotless i}} + \gdef^^ef{\"{\dotless i}} + % + \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER ETH}} + \gdef^^f1{\~n} + \gdef^^f2{\`o} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\~o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\o} + \gdef^^f9{\`u} + \gdef^^fa{\'u} + \gdef^^fb{\^u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\missingcharmsg{LATIN SMALL LETTER THORN}} + \gdef^^ff{\"y} +} + +% Latin9 (ISO-8859-15) encoding character definitions. +\def\latninechardefs{% + % Encoding is almost identical to Latin1. + \latonechardefs + % + \gdef^^a4{\euro} + \gdef^^a6{\v S} + \gdef^^a8{\v s} + \gdef^^b4{\v Z} + \gdef^^b8{\v z} + \gdef^^bc{\OE} + \gdef^^bd{\oe} + \gdef^^be{\"Y} +} + +% Latin2 (ISO-8859-2) character definitions. +\def\lattwochardefs{% + \gdef^^a0{~} + \gdef^^a1{\missingcharmsg{LATIN CAPITAL LETTER A WITH OGONEK}} + \gdef^^a2{\u{}} + \gdef^^a3{\L} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\v L} + \gdef^^a6{\'S} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\v S} + \gdef^^aa{\cedilla S} + \gdef^^ab{\v T} + \gdef^^ac{\'Z} + \gdef^^ad{\-} + \gdef^^ae{\v Z} + \gdef^^af{\dotaccent Z} + % + \gdef^^b0{\textdegree} + \gdef^^b1{\missingcharmsg{LATIN SMALL LETTER A WITH OGONEK}} + \gdef^^b2{\missingcharmsg{OGONEK}} + \gdef^^b3{\l} + \gdef^^b4{\'{}} + \gdef^^b5{\v l} + \gdef^^b6{\'s} + \gdef^^b7{\v{}} + \gdef^^b8{\cedilla\ } + \gdef^^b9{\v s} + \gdef^^ba{\cedilla s} + \gdef^^bb{\v t} + \gdef^^bc{\'z} + \gdef^^bd{\H{}} + \gdef^^be{\v z} + \gdef^^bf{\dotaccent z} + % + \gdef^^c0{\'R} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\u A} + \gdef^^c4{\"A} + \gdef^^c5{\'L} + \gdef^^c6{\'C} + \gdef^^c7{\cedilla C} + \gdef^^c8{\v C} + \gdef^^c9{\'E} + \gdef^^ca{\missingcharmsg{LATIN CAPITAL LETTER E WITH OGONEK}} + \gdef^^cb{\"E} + \gdef^^cc{\v E} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\v D} + % + \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER D WITH STROKE}} + \gdef^^d1{\'N} + \gdef^^d2{\v N} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\H O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\v R} + \gdef^^d9{\ringaccent U} + \gdef^^da{\'U} + \gdef^^db{\H U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\cedilla T} + \gdef^^df{\ss} + % + \gdef^^e0{\'r} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\u a} + \gdef^^e4{\"a} + \gdef^^e5{\'l} + \gdef^^e6{\'c} + \gdef^^e7{\cedilla c} + \gdef^^e8{\v c} + \gdef^^e9{\'e} + \gdef^^ea{\missingcharmsg{LATIN SMALL LETTER E WITH OGONEK}} + \gdef^^eb{\"e} + \gdef^^ec{\v e} + \gdef^^ed{\'\i} + \gdef^^ee{\^\i} + \gdef^^ef{\v d} + % + \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER D WITH STROKE}} + \gdef^^f1{\'n} + \gdef^^f2{\v n} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\H o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\v r} + \gdef^^f9{\ringaccent u} + \gdef^^fa{\'u} + \gdef^^fb{\H u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\cedilla t} + \gdef^^ff{\dotaccent{}} +} + +% UTF-8 character definitions. +% +% This code to support UTF-8 is based on LaTeX's utf8.def, with some +% changes for Texinfo conventions. It is included here under the GPL by +% permission from Frank Mittelbach and the LaTeX team. +% +\newcount\countUTFx +\newcount\countUTFy +\newcount\countUTFz + +\gdef\UTFviiiTwoOctets#1#2{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\endcsname} +% +\gdef\UTFviiiThreeOctets#1#2#3{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} +% +\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} + +\gdef\UTFviiiDefined#1{% + \ifx #1\relax + \message{\linenumber Unicode char \string #1 not defined for Texinfo}% + \else + \expandafter #1% + \fi +} + +\begingroup + \catcode`\~13 + \catcode`\"12 + + \def\UTFviiiLoop{% + \global\catcode\countUTFx\active + \uccode`\~\countUTFx + \uppercase\expandafter{\UTFviiiTmp}% + \advance\countUTFx by 1 + \ifnum\countUTFx < \countUTFy + \expandafter\UTFviiiLoop + \fi} + + \countUTFx =3D "C2 + \countUTFy =3D "E0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiTwoOctets\string~}} + \UTFviiiLoop + + \countUTFx =3D "E0 + \countUTFy =3D "F0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiThreeOctets\string~}} + \UTFviiiLoop + + \countUTFx =3D "F0 + \countUTFy =3D "F4 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiFourOctets\string~}} + \UTFviiiLoop +\endgroup + +\begingroup + \catcode`\"=3D12 + \catcode`\<=3D12 + \catcode`\.=3D12 + \catcode`\,=3D12 + \catcode`\;=3D12 + \catcode`\!=3D12 + \catcode`\~=3D13 + + \gdef\DeclareUnicodeCharacter#1#2{% + \countUTFz =3D "#1\relax + \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)= }% + \begingroup + \parseXMLCharref + \def\UTFviiiTwoOctets##1##2{% + \csname u8:##1\string ##2\endcsname}% + \def\UTFviiiThreeOctets##1##2##3{% + \csname u8:##1\string ##2\string ##3\endcsname}% + \def\UTFviiiFourOctets##1##2##3##4{% + \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \gdef\UTFviiiTmp{#2}% + \endgroup} + + \gdef\parseXMLCharref{% + \ifnum\countUTFz < "A0\relax + \errhelp =3D \EMsimple + \errmessage{Cannot define Unicode char value < 00A0}% + \else\ifnum\countUTFz < "800\relax + \parseUTFviiiA,% + \parseUTFviiiB C\UTFviiiTwoOctets.,% + \else\ifnum\countUTFz < "10000\relax + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% + \else + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiA!% + \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% + \fi\fi\fi + } + + \gdef\parseUTFviiiA#1{% + \countUTFx =3D \countUTFz + \divide\countUTFz by 64 + \countUTFy =3D \countUTFz + \multiply\countUTFz by 64 + \advance\countUTFx by -\countUTFz + \advance\countUTFx by 128 + \uccode `#1\countUTFx + \countUTFz =3D \countUTFy} + + \gdef\parseUTFviiiB#1#2#3#4{% + \advance\countUTFz by "#10\relax + \uccode `#3\countUTFz + \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} +\endgroup + +\def\utfeightchardefs{% + \DeclareUnicodeCharacter{00A0}{\tie} + \DeclareUnicodeCharacter{00A1}{\exclamdown} + \DeclareUnicodeCharacter{00A3}{\pounds} + \DeclareUnicodeCharacter{00A8}{\"{ }} + \DeclareUnicodeCharacter{00A9}{\copyright} + \DeclareUnicodeCharacter{00AA}{\ordf} + \DeclareUnicodeCharacter{00AD}{\-} + \DeclareUnicodeCharacter{00AE}{\registeredsymbol} + \DeclareUnicodeCharacter{00AF}{\=3D{ }} + + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} + \DeclareUnicodeCharacter{00B4}{\'{ }} + \DeclareUnicodeCharacter{00B8}{\cedilla{ }} + \DeclareUnicodeCharacter{00BA}{\ordm} + \DeclareUnicodeCharacter{00BF}{\questiondown} + + \DeclareUnicodeCharacter{00C0}{\`A} + \DeclareUnicodeCharacter{00C1}{\'A} + \DeclareUnicodeCharacter{00C2}{\^A} + \DeclareUnicodeCharacter{00C3}{\~A} + \DeclareUnicodeCharacter{00C4}{\"A} + \DeclareUnicodeCharacter{00C5}{\AA} + \DeclareUnicodeCharacter{00C6}{\AE} + \DeclareUnicodeCharacter{00C7}{\cedilla{C}} + \DeclareUnicodeCharacter{00C8}{\`E} + \DeclareUnicodeCharacter{00C9}{\'E} + \DeclareUnicodeCharacter{00CA}{\^E} + \DeclareUnicodeCharacter{00CB}{\"E} + \DeclareUnicodeCharacter{00CC}{\`I} + \DeclareUnicodeCharacter{00CD}{\'I} + \DeclareUnicodeCharacter{00CE}{\^I} + \DeclareUnicodeCharacter{00CF}{\"I} + + \DeclareUnicodeCharacter{00D1}{\~N} + \DeclareUnicodeCharacter{00D2}{\`O} + \DeclareUnicodeCharacter{00D3}{\'O} + \DeclareUnicodeCharacter{00D4}{\^O} + \DeclareUnicodeCharacter{00D5}{\~O} + \DeclareUnicodeCharacter{00D6}{\"O} + \DeclareUnicodeCharacter{00D8}{\O} + \DeclareUnicodeCharacter{00D9}{\`U} + \DeclareUnicodeCharacter{00DA}{\'U} + \DeclareUnicodeCharacter{00DB}{\^U} + \DeclareUnicodeCharacter{00DC}{\"U} + \DeclareUnicodeCharacter{00DD}{\'Y} + \DeclareUnicodeCharacter{00DF}{\ss} + + \DeclareUnicodeCharacter{00E0}{\`a} + \DeclareUnicodeCharacter{00E1}{\'a} + \DeclareUnicodeCharacter{00E2}{\^a} + \DeclareUnicodeCharacter{00E3}{\~a} + \DeclareUnicodeCharacter{00E4}{\"a} + \DeclareUnicodeCharacter{00E5}{\aa} + \DeclareUnicodeCharacter{00E6}{\ae} + \DeclareUnicodeCharacter{00E7}{\cedilla{c}} + \DeclareUnicodeCharacter{00E8}{\`e} + \DeclareUnicodeCharacter{00E9}{\'e} + \DeclareUnicodeCharacter{00EA}{\^e} + \DeclareUnicodeCharacter{00EB}{\"e} + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} + + \DeclareUnicodeCharacter{00F1}{\~n} + \DeclareUnicodeCharacter{00F2}{\`o} + \DeclareUnicodeCharacter{00F3}{\'o} + \DeclareUnicodeCharacter{00F4}{\^o} + \DeclareUnicodeCharacter{00F5}{\~o} + \DeclareUnicodeCharacter{00F6}{\"o} + \DeclareUnicodeCharacter{00F8}{\o} + \DeclareUnicodeCharacter{00F9}{\`u} + \DeclareUnicodeCharacter{00FA}{\'u} + \DeclareUnicodeCharacter{00FB}{\^u} + \DeclareUnicodeCharacter{00FC}{\"u} + \DeclareUnicodeCharacter{00FD}{\'y} + \DeclareUnicodeCharacter{00FF}{\"y} + + \DeclareUnicodeCharacter{0100}{\=3DA} + \DeclareUnicodeCharacter{0101}{\=3Da} + \DeclareUnicodeCharacter{0102}{\u{A}} + \DeclareUnicodeCharacter{0103}{\u{a}} + \DeclareUnicodeCharacter{0106}{\'C} + \DeclareUnicodeCharacter{0107}{\'c} + \DeclareUnicodeCharacter{0108}{\^C} + \DeclareUnicodeCharacter{0109}{\^c} + \DeclareUnicodeCharacter{010A}{\dotaccent{C}} + \DeclareUnicodeCharacter{010B}{\dotaccent{c}} + \DeclareUnicodeCharacter{010C}{\v{C}} + \DeclareUnicodeCharacter{010D}{\v{c}} + \DeclareUnicodeCharacter{010E}{\v{D}} + + \DeclareUnicodeCharacter{0112}{\=3DE} + \DeclareUnicodeCharacter{0113}{\=3De} + \DeclareUnicodeCharacter{0114}{\u{E}} + \DeclareUnicodeCharacter{0115}{\u{e}} + \DeclareUnicodeCharacter{0116}{\dotaccent{E}} + \DeclareUnicodeCharacter{0117}{\dotaccent{e}} + \DeclareUnicodeCharacter{011A}{\v{E}} + \DeclareUnicodeCharacter{011B}{\v{e}} + \DeclareUnicodeCharacter{011C}{\^G} + \DeclareUnicodeCharacter{011D}{\^g} + \DeclareUnicodeCharacter{011E}{\u{G}} + \DeclareUnicodeCharacter{011F}{\u{g}} + + \DeclareUnicodeCharacter{0120}{\dotaccent{G}} + \DeclareUnicodeCharacter{0121}{\dotaccent{g}} + \DeclareUnicodeCharacter{0124}{\^H} + \DeclareUnicodeCharacter{0125}{\^h} + \DeclareUnicodeCharacter{0128}{\~I} + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} + \DeclareUnicodeCharacter{012A}{\=3DI} + \DeclareUnicodeCharacter{012B}{\=3D{\dotless{i}}} + \DeclareUnicodeCharacter{012C}{\u{I}} + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} + + \DeclareUnicodeCharacter{0130}{\dotaccent{I}} + \DeclareUnicodeCharacter{0131}{\dotless{i}} + \DeclareUnicodeCharacter{0132}{IJ} + \DeclareUnicodeCharacter{0133}{ij} + \DeclareUnicodeCharacter{0134}{\^J} + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} + \DeclareUnicodeCharacter{0139}{\'L} + \DeclareUnicodeCharacter{013A}{\'l} + + \DeclareUnicodeCharacter{0141}{\L} + \DeclareUnicodeCharacter{0142}{\l} + \DeclareUnicodeCharacter{0143}{\'N} + \DeclareUnicodeCharacter{0144}{\'n} + \DeclareUnicodeCharacter{0147}{\v{N}} + \DeclareUnicodeCharacter{0148}{\v{n}} + \DeclareUnicodeCharacter{014C}{\=3DO} + \DeclareUnicodeCharacter{014D}{\=3Do} + \DeclareUnicodeCharacter{014E}{\u{O}} + \DeclareUnicodeCharacter{014F}{\u{o}} + + \DeclareUnicodeCharacter{0150}{\H{O}} + \DeclareUnicodeCharacter{0151}{\H{o}} + \DeclareUnicodeCharacter{0152}{\OE} + \DeclareUnicodeCharacter{0153}{\oe} + \DeclareUnicodeCharacter{0154}{\'R} + \DeclareUnicodeCharacter{0155}{\'r} + \DeclareUnicodeCharacter{0158}{\v{R}} + \DeclareUnicodeCharacter{0159}{\v{r}} + \DeclareUnicodeCharacter{015A}{\'S} + \DeclareUnicodeCharacter{015B}{\'s} + \DeclareUnicodeCharacter{015C}{\^S} + \DeclareUnicodeCharacter{015D}{\^s} + \DeclareUnicodeCharacter{015E}{\cedilla{S}} + \DeclareUnicodeCharacter{015F}{\cedilla{s}} + + \DeclareUnicodeCharacter{0160}{\v{S}} + \DeclareUnicodeCharacter{0161}{\v{s}} + \DeclareUnicodeCharacter{0162}{\cedilla{t}} + \DeclareUnicodeCharacter{0163}{\cedilla{T}} + \DeclareUnicodeCharacter{0164}{\v{T}} + + \DeclareUnicodeCharacter{0168}{\~U} + \DeclareUnicodeCharacter{0169}{\~u} + \DeclareUnicodeCharacter{016A}{\=3DU} + \DeclareUnicodeCharacter{016B}{\=3Du} + \DeclareUnicodeCharacter{016C}{\u{U}} + \DeclareUnicodeCharacter{016D}{\u{u}} + \DeclareUnicodeCharacter{016E}{\ringaccent{U}} + \DeclareUnicodeCharacter{016F}{\ringaccent{u}} + + \DeclareUnicodeCharacter{0170}{\H{U}} + \DeclareUnicodeCharacter{0171}{\H{u}} + \DeclareUnicodeCharacter{0174}{\^W} + \DeclareUnicodeCharacter{0175}{\^w} + \DeclareUnicodeCharacter{0176}{\^Y} + \DeclareUnicodeCharacter{0177}{\^y} + \DeclareUnicodeCharacter{0178}{\"Y} + \DeclareUnicodeCharacter{0179}{\'Z} + \DeclareUnicodeCharacter{017A}{\'z} + \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} + \DeclareUnicodeCharacter{017C}{\dotaccent{z}} + \DeclareUnicodeCharacter{017D}{\v{Z}} + \DeclareUnicodeCharacter{017E}{\v{z}} + + \DeclareUnicodeCharacter{01C4}{D\v{Z}} + \DeclareUnicodeCharacter{01C5}{D\v{z}} + \DeclareUnicodeCharacter{01C6}{d\v{z}} + \DeclareUnicodeCharacter{01C7}{LJ} + \DeclareUnicodeCharacter{01C8}{Lj} + \DeclareUnicodeCharacter{01C9}{lj} + \DeclareUnicodeCharacter{01CA}{NJ} + \DeclareUnicodeCharacter{01CB}{Nj} + \DeclareUnicodeCharacter{01CC}{nj} + \DeclareUnicodeCharacter{01CD}{\v{A}} + \DeclareUnicodeCharacter{01CE}{\v{a}} + \DeclareUnicodeCharacter{01CF}{\v{I}} + + \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} + \DeclareUnicodeCharacter{01D1}{\v{O}} + \DeclareUnicodeCharacter{01D2}{\v{o}} + \DeclareUnicodeCharacter{01D3}{\v{U}} + \DeclareUnicodeCharacter{01D4}{\v{u}} + + \DeclareUnicodeCharacter{01E2}{\=3D{\AE}} + \DeclareUnicodeCharacter{01E3}{\=3D{\ae}} + \DeclareUnicodeCharacter{01E6}{\v{G}} + \DeclareUnicodeCharacter{01E7}{\v{g}} + \DeclareUnicodeCharacter{01E8}{\v{K}} + \DeclareUnicodeCharacter{01E9}{\v{k}} + + \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} + \DeclareUnicodeCharacter{01F1}{DZ} + \DeclareUnicodeCharacter{01F2}{Dz} + \DeclareUnicodeCharacter{01F3}{dz} + \DeclareUnicodeCharacter{01F4}{\'G} + \DeclareUnicodeCharacter{01F5}{\'g} + \DeclareUnicodeCharacter{01F8}{\`N} + \DeclareUnicodeCharacter{01F9}{\`n} + \DeclareUnicodeCharacter{01FC}{\'{\AE}} + \DeclareUnicodeCharacter{01FD}{\'{\ae}} + \DeclareUnicodeCharacter{01FE}{\'{\O}} + \DeclareUnicodeCharacter{01FF}{\'{\o}} + + \DeclareUnicodeCharacter{021E}{\v{H}} + \DeclareUnicodeCharacter{021F}{\v{h}} + + \DeclareUnicodeCharacter{0226}{\dotaccent{A}} + \DeclareUnicodeCharacter{0227}{\dotaccent{a}} + \DeclareUnicodeCharacter{0228}{\cedilla{E}} + \DeclareUnicodeCharacter{0229}{\cedilla{e}} + \DeclareUnicodeCharacter{022E}{\dotaccent{O}} + \DeclareUnicodeCharacter{022F}{\dotaccent{o}} + + \DeclareUnicodeCharacter{0232}{\=3DY} + \DeclareUnicodeCharacter{0233}{\=3Dy} + \DeclareUnicodeCharacter{0237}{\dotless{j}} + + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} + \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} + \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} + \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} + \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} + \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} + \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} + \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} + \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} + \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} + \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} + \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} + + \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} + \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} + + \DeclareUnicodeCharacter{1E20}{\=3DG} + \DeclareUnicodeCharacter{1E21}{\=3Dg} + \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} + \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} + \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} + \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} + \DeclareUnicodeCharacter{1E26}{\"H} + \DeclareUnicodeCharacter{1E27}{\"h} + + \DeclareUnicodeCharacter{1E30}{\'K} + \DeclareUnicodeCharacter{1E31}{\'k} + \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} + \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} + \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} + \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} + \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} + \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} + \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} + \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} + \DeclareUnicodeCharacter{1E3E}{\'M} + \DeclareUnicodeCharacter{1E3F}{\'m} + + \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} + \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} + \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} + \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} + \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} + \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} + \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} + \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} + \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} + \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} + + \DeclareUnicodeCharacter{1E54}{\'P} + \DeclareUnicodeCharacter{1E55}{\'p} + \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} + \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} + \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} + \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} + \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} + \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} + \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} + \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} + + \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} + \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} + \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} + \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} + \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} + \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} + \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} + \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} + \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} + \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} + + \DeclareUnicodeCharacter{1E7C}{\~V} + \DeclareUnicodeCharacter{1E7D}{\~v} + \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} + \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} + + \DeclareUnicodeCharacter{1E80}{\`W} + \DeclareUnicodeCharacter{1E81}{\`w} + \DeclareUnicodeCharacter{1E82}{\'W} + \DeclareUnicodeCharacter{1E83}{\'w} + \DeclareUnicodeCharacter{1E84}{\"W} + \DeclareUnicodeCharacter{1E85}{\"w} + \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} + \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} + \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} + \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} + \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} + \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} + \DeclareUnicodeCharacter{1E8C}{\"X} + \DeclareUnicodeCharacter{1E8D}{\"x} + \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} + \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} + + \DeclareUnicodeCharacter{1E90}{\^Z} + \DeclareUnicodeCharacter{1E91}{\^z} + \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} + \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} + \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} + \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} + \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} + \DeclareUnicodeCharacter{1E97}{\"t} + \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} + \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} + + \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} + \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} + + \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} + \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} + \DeclareUnicodeCharacter{1EBC}{\~E} + \DeclareUnicodeCharacter{1EBD}{\~e} + + \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} + \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} + \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} + \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} + + \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} + \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} + + \DeclareUnicodeCharacter{1EF2}{\`Y} + \DeclareUnicodeCharacter{1EF3}{\`y} + \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} + + \DeclareUnicodeCharacter{1EF8}{\~Y} + \DeclareUnicodeCharacter{1EF9}{\~y} + + \DeclareUnicodeCharacter{2013}{--} + \DeclareUnicodeCharacter{2014}{---} + \DeclareUnicodeCharacter{2022}{\bullet} + \DeclareUnicodeCharacter{2026}{\dots} + \DeclareUnicodeCharacter{20AC}{\euro} + + \DeclareUnicodeCharacter{2192}{\expansion} + \DeclareUnicodeCharacter{21D2}{\result} + + \DeclareUnicodeCharacter{2212}{\minus} + \DeclareUnicodeCharacter{2217}{\point} + \DeclareUnicodeCharacter{2261}{\equiv} +}% end of \utfeightchardefs + + +% US-ASCII character definitions. +\def\asciichardefs{% nothing need be done + \relax +} + +% Make non-ASCII characters printable again for compatibility with +% existing Texinfo documents that may use them, even without declaring a +% document encoding. +% +\setnonasciicharscatcode \other + + +\message{formatting,} + +\newdimen\defaultparindent \defaultparindent =3D 15pt + +\chapheadingskip =3D 15pt plus 4pt minus 2pt +\secheadingskip =3D 12pt plus 3pt minus 2pt +\subsecheadingskip =3D 9pt plus 2pt minus 2pt + +% Prevent underfull vbox error messages. +\vbadness =3D 10000 + +% Don't be so finicky about underfull hboxes, either. +\hbadness =3D 2000 + +% Following George Bush, just get rid of widows and orphans. +\widowpenalty=3D10000 +\clubpenalty=3D10000 + +% Use TeX 3.0's \emergencystretch to help line breaking, but if we're +% using an old version of TeX, don't do anything. We want the amount of +% stretch added to depend on the line length, hence the dependence on +% \hsize. We call this whenever the paper size is set. +% +\def\setemergencystretch{% + \ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% + \else + \emergencystretch =3D .15\hsize + \fi +} + +% Parameters in order: 1) textheight; 2) textwidth; +% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; +% 7) physical page height; 8) physical page width. +% +% We also call \setleading{\textleading}, so the caller should define +% \textleading. The caller should also set \parskip. +% +\def\internalpagesizes#1#2#3#4#5#6#7#8{% + \voffset =3D #3\relax + \topskip =3D #6\relax + \splittopskip =3D \topskip + % + \vsize =3D #1\relax + \advance\vsize by \topskip + \outervsize =3D \vsize + \advance\outervsize by 2\topandbottommargin + \pageheight =3D \vsize + % + \hsize =3D #2\relax + \outerhsize =3D \hsize + \advance\outerhsize by 0.5in + \pagewidth =3D \hsize + % + \normaloffset =3D #4\relax + \bindingoffset =3D #5\relax + % + \ifpdf + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + \fi + % + \setleading{\textleading} + % + \parindent =3D \defaultparindent + \setemergencystretch +} + +% @letterpaper (the default). +\def\letterpaper{{\globaldefs =3D 1 + \parskip =3D 3pt plus 2pt minus 1pt + \textleading =3D 13.2pt + % + % If page is nothing but text, make it come out even. + \internalpagesizes{46\baselineskip}{6in}% + {\voffset}{.25in}% + {\bindingoffset}{36pt}% + {11in}{8.5in}% +}} + +% Use @smallbook to reset parameters for 7x9.25 trim size. +\def\smallbook{{\globaldefs =3D 1 + \parskip =3D 2pt plus 1pt + \textleading =3D 12pt + % + \internalpagesizes{7.5in}{5in}% + {\voffset}{.25in}% + {\bindingoffset}{16pt}% + {9.25in}{7in}% + % + \lispnarrowing =3D 0.3in + \tolerance =3D 700 + \hfuzz =3D 1pt + \contentsrightmargin =3D 0pt + \defbodyindent =3D .5cm +}} + +% Use @smallerbook to reset parameters for 6x9 trim size. +% (Just testing, parameters still in flux.) +\def\smallerbook{{\globaldefs =3D 1 + \parskip =3D 1.5pt plus 1pt + \textleading =3D 12pt + % + \internalpagesizes{7.4in}{4.8in}% + {-.2in}{-.4in}% + {0pt}{14pt}% + {9in}{6in}% + % + \lispnarrowing =3D 0.25in + \tolerance =3D 700 + \hfuzz =3D 1pt + \contentsrightmargin =3D 0pt + \defbodyindent =3D .4cm +}} + +% Use @afourpaper to print on European A4 paper. +\def\afourpaper{{\globaldefs =3D 1 + \parskip =3D 3pt plus 2pt minus 1pt + \textleading =3D 13.2pt + % + % Double-side printing via postscript on Laserjet 4050 + % prints double-sided nicely when \bindingoffset=3D10mm and \hoffset=3D-= 6mm. + % To change the settings for a different printer or situation, adjust + % \normaloffset until the front-side and back-side texts align. Then + % do the same for \bindingoffset. You can set these for testing in + % your texinfo source file like this: + % @tex + % \global\normaloffset =3D -6mm + % \global\bindingoffset =3D 10mm + % @end tex + \internalpagesizes{51\baselineskip}{160mm} + {\voffset}{\hoffset}% + {\bindingoffset}{44pt}% + {297mm}{210mm}% + % + \tolerance =3D 700 + \hfuzz =3D 1pt + \contentsrightmargin =3D 0pt + \defbodyindent =3D 5mm +}} + +% Use @afivepaper to print on European A5 paper. +% From romildo@urano.iceb.ufop.br, 2 July 2000. +% He also recommends making @example and @lisp be small. +\def\afivepaper{{\globaldefs =3D 1 + \parskip =3D 2pt plus 1pt minus 0.1pt + \textleading =3D 12.5pt + % + \internalpagesizes{160mm}{120mm}% + {\voffset}{\hoffset}% + {\bindingoffset}{8pt}% + {210mm}{148mm}% + % + \lispnarrowing =3D 0.2in + \tolerance =3D 800 + \hfuzz =3D 1.2pt + \contentsrightmargin =3D 0pt + \defbodyindent =3D 2mm + \tableindent =3D 12mm +}} + +% A specific text layout, 24x15cm overall, intended for A4 paper. +\def\afourlatex{{\globaldefs =3D 1 + \afourpaper + \internalpagesizes{237mm}{150mm}% + {\voffset}{4.6mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + % + % Must explicitly reset to 0 because we call \afourpaper. + \globaldefs =3D 0 +}} + +% Use @afourwide to print on A4 paper in landscape format. +\def\afourwide{{\globaldefs =3D 1 + \afourpaper + \internalpagesizes{241mm}{165mm}% + {\voffset}{-2.95mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + \globaldefs =3D 0 +}} + +% @pagesizes TEXTHEIGHT[,TEXTWIDTH] +% Perhaps we should allow setting the margins, \topskip, \parskip, +% and/or leading, also. Or perhaps we should compute them somehow. +% +\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} +\def\pagesizesyyy#1,#2,#3\finish{{% + \setbox0 =3D \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=3D#2\relax \= fi + \globaldefs =3D 1 + % + \parskip =3D 3pt plus 2pt minus 1pt + \setleading{\textleading}% + % + \dimen0 =3D #1 + \advance\dimen0 by \voffset + % + \dimen2 =3D \hsize + \advance\dimen2 by \normaloffset + % + \internalpagesizes{#1}{\hsize}% + {\voffset}{\normaloffset}% + {\bindingoffset}{44pt}% + {\dimen0}{\dimen2}% +}} + +% Set default to letter. +% +\letterpaper + + +\message{and turning on texinfo input format.} + +% Define macros to output various characters with catcode for normal text. +\catcode`\"=3D\other +\catcode`\~=3D\other +\catcode`\^=3D\other +\catcode`\_=3D\other +\catcode`\|=3D\other +\catcode`\<=3D\other +\catcode`\>=3D\other +\catcode`\+=3D\other +\catcode`\$=3D\other +\def\normaldoublequote{"} +\def\normaltilde{~} +\def\normalcaret{^} +\def\normalunderscore{_} +\def\normalverticalbar{|} +\def\normalless{<} +\def\normalgreater{>} +\def\normalplus{+} +\def\normaldollar{$}%$ font-lock fix + +% This macro is used to make a character print one way in \tt +% (where it can probably be output as-is), and another way in other fonts, +% where something hairier probably needs to be done. +% +% #1 is what to print if we are indeed using \tt; #2 is what to print +% otherwise. Since all the Computer Modern typewriter fonts have zero +% interword stretch (and shrink), and it is reasonable to expect all +% typewriter fonts to have this, we can check that font parameter. +% +\def\ifusingtt#1#2{\ifdim \fontdimen3\font=3D0pt #1\else #2\fi} + +% Same as above, but check for italic font. Actually this also catches +% non-italic slanted fonts since it is impossible to distinguish them from +% italic fonts. But since this is only used by $ and it uses \sl anyway +% this is not a problem. +\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} + +% Turn off all special characters except @ +% (and those which the user can use as if they were ordinary). +% Most of these we simply print from the \tt font, but for some, we can +% use math or other variants that look better in normal text. + +\catcode`\"=3D\active +\def\activedoublequote{{\tt\char34}} +\let"=3D\activedoublequote +\catcode`\~=3D\active +\def~{{\tt\char126}} +\chardef\hat=3D`\^ +\catcode`\^=3D\active +\def^{{\tt \hat}} + +\catcode`\_=3D\active +\def_{\ifusingtt\normalunderscore\_} +\let\realunder=3D_ +% Subroutine for the previous macro. +\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07e= m } + +\catcode`\|=3D\active +\def|{{\tt\char124}} +\chardef \less=3D`\< +\catcode`\<=3D\active +\def<{{\tt \less}} +\chardef \gtr=3D`\> +\catcode`\>=3D\active +\def>{{\tt \gtr}} +\catcode`\+=3D\active +\def+{{\tt \char 43}} +\catcode`\$=3D\active +\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix + +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have \everyjob (or @setfilename) turn them o= n. +% \otherifyactive is called near the end of this file. +\def\otherifyactive{\catcode`+=3D\other \catcode`\_=3D\other} + +% Used sometimes to turn off (effectively) the active characters even after +% parsing them. +\def\turnoffactive{% + \normalturnoffactive + \otherbackslash +} + +\catcode`\@=3D0 + +% \backslashcurfont outputs one backslash character in current font, +% as in \char`\\. +\global\chardef\backslashcurfont=3D`\\ +\global\let\rawbackslashxx=3D\backslashcurfont % let existing .??s files = work + +% \realbackslash is an actual character `\' with catcode other, and +% \doublebackslash is two of them (for the pdf outlines). +{\catcode`\\=3D\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} + +% In texinfo, backslash is an active character; it prints the backslash +% in fixed width font. +\catcode`\\=3D\active +@def@normalbackslash{{@tt@backslashcurfont}} +% On startup, @fixbackslash assigns: +% @let \ =3D @normalbackslash + +% \rawbackslash defines an active \ to do \backslashcurfont. +% \otherbackslash defines an active \ to be a literal `\' character with +% catcode other. +@gdef@rawbackslash{@let\=3D@backslashcurfont} +@gdef@otherbackslash{@let\=3D@realbackslash} + +% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +% the literal character `\'. +% +@def@normalturnoffactive{% + @let\=3D@normalbackslash + @let"=3D@normaldoublequote + @let~=3D@normaltilde + @let^=3D@normalcaret + @let_=3D@normalunderscore + @let|=3D@normalverticalbar + @let<=3D@normalless + @let>=3D@normalgreater + @let+=3D@normalplus + @let$=3D@normaldollar %$ font-lock fix + @unsepspaces +} + +% Make _ and + \other characters, temporarily. +% This is canceled by @fixbackslash. +@otherifyactive + +% If a .fmt file is being used, we don't want the `\input texinfo' to show= up. +% That is what \eatinput is for; after that, the `\' should revert to prin= ting +% a backslash. +% +@gdef@eatinput input texinfo{@fixbackslash} +@global@let\ =3D @eatinput + +% On the other hand, perhaps the file did not have a `\input texinfo'. Then +% the first `\' in the file would cause an error. This macro tries to fix +% that, assuming it is called before the first `\' could plausibly occur. +% Also turn back on active characters that might appear in the input +% file name, in case not using a pre-dumped format. +% +@gdef@fixbackslash{% + @ifx\@eatinput @let\ =3D @normalbackslash @fi + @catcode`+=3D@active + @catcode`@_=3D@active +} + +% Say @foo, not \foo, in error messages. +@escapechar =3D `@@ + +% These look ok in all fonts, so just make them not special. +@catcode`@& =3D @other +@catcode`@# =3D @other +@catcode`@% =3D @other + + +@c Local variables: +@c eval: (add-hook 'write-file-hooks 'time-stamp) +@c page-delimiter: "^\\\\message" +@c time-stamp-start: "def\\\\texinfoversion{" +@c time-stamp-format: "%:y-%02m-%02d.%02H" +@c time-stamp-end: "}" +@c End: + +@c vim:sw=3D2: + +@ignore + arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 +@end ignore diff --git a/grub-core/lib/libgcrypt/cipher/ChangeLog b/grub-core/lib/libgc= rypt/cipher/ChangeLog deleted file mode 100644 index 1b3694f58..000000000 --- a/grub-core/lib/libgcrypt/cipher/ChangeLog +++ /dev/null @@ -1,3990 +0,0 @@ -2010-08-19 Werner Koch - - * cipher.c (gcry_cipher_open): Remove double release of the module. - Fixes bug#1263. - -2010-06-10 Jeff Johnson (wk) - - * ecc.c (ecc_generate_ext): Parse transient-key flag. - (generate_key): Add arg TRANSIENT_KEY and use it to set the random - level. - -2010-04-12 Brad Hards (wk) - - Spelling fixes. - -2010-03-26 Werner Koch - - * tiger.c (asn): Unfetter the old TIGER from an OID. - (TIGER_CONTEXT): Add field VARIANT. - (tiger_init): Factor code out to ... - (do_init): New. - (tiger1_init, tiger2_init): New. - (_gcry_digest_spec_tiger1, _gcry_digest_spec_tiger2): New. - * md.c (digest_table): Add TIGER1 and TIGER2 variants. - -2009-12-11 Werner Koch - - * sha256.c (Cho, Maj, Sum0, Sum1): Turn macros into inline - functions. - (transform): Partly unroll to interweave the chain variables - - * sha512.c (ROTR, Ch, Maj, Sum0, Sum1): Turn macros into inline - functions. - (transform): Partly unroll to interweave the chain variables. - Suggested by Christian Grothoff. - -2009-12-10 Werner Koch - - * Makefile.am (o_flag_munging): New. - (tiger.o, tiger.lo): Use it. - - * cipher.c (do_ctr_encrypt): Add arg OUTBUFLEN. Check for - suitable value. Add check for valid inputlen. Wipe temporary - memory. - (do_ctr_decrypt): Likewise. - (do_cbc_encrypt, do_cbc_decrypt): Add arg OUTBUFLEN. Check for - suitable value. Move check for valid inputlen to here; change - returned error from INV_ARG to INV_LENGTH. - (do_ecb_encrypt, do_ecb_decrypt): Ditto. - (do_cfb_encrypt, do_cfb_decrypt): Ditto. - (do_ofb_encrypt, do_ofb_decrypt): Ditto. - (cipher_encrypt, cipher_encrypt): Adjust for above changes. - (gcry_cipher_encrypt, gcry_cipher_decrypt): Simplify. - -2009-12-09 Werner Koch - - * cipher.c (gcry_cipher_open): Allow for GCRY_CIPHER_MODE_AESWRAP. - (cipher_encrypt, cipher_decrypt): Ditto. - (do_aeswrap_encrypt, do_aeswrap_decrypt): New. - (struct gcry_cipher_handle): Add field marks. - (cipher_setkey, cipher_setiv): Update marks flags. - (cipher_reset): Reset marks. - (cipher_encrypt, cipher_decrypt): Add new arg OUTBUFLEN. - (gcry_cipher_encrypt, gcry_cipher_decrypt): Pass outbuflen to - cipher_encrypt. Replace GPG_ERR_TOO_SHORT by - GPG_ERR_BUFFER_TOO_SHORT. - -2009-08-21 Werner Koch - - * dsa.c (dsa_generate_ext): Release retfactors array before - setting it to NULL. Reported by Daiko Ueno. - -2009-07-02 Werner Koch - - * md.c (md_read): Fix incomplete check for NULL. - Reported by Fabian Kail. - -2009-03-31 Werner Koch - - * rsa.c (rsa_check_secret_key): Return GPG_ERR_BAD_SECKEY and not - GPG_ERR_PUBKEY_ALGO. - -2009-02-16 Werner Koch - - * rsa.c (generate_x931): Do not initialize TBL with automatic - variables. - * whirlpool.c, tiger.c, sha256.c, sha1.c, rmd160.c, md5.c - * md4.c, crc.c: Remove memory.h. This is garbage from gnupg. - Reported by Dan Fandrich. - -2009-01-22 Werner Koch - - * ecc.c (compute_keygrip): Remove superfluous const. - -2009-01-06 Werner Koch - - * rmd160.c (oid_spec_rmd160): Add TeleTrust identifier. - -2008-12-10 Werner Koch - - * dsa.c (generate): Add arg DOMAIN and use it if specified. - (generate_fips186): Ditto. - (dsa_generate_ext): Parse and check the optional "domain" - parameter and pass them to the generate functions. - - * rijndael.c (rijndael_names): Add "AES128" and "AES-128". - (rijndael192_names): Add "AES-192". - (rijndael256_names): Add "AES-256". - -2008-12-05 Werner Koch - - * dsa.c (generate): Add arg TRANSIENT_KEY and use it to detrmine - the RNG quality needed. - (dsa_generate_ext): Parse the transient-key flag und pass it to - generate. - -2008-11-28 Werner Koch - - * dsa.c (generate_fips186): Add arg DERIVEPARMS and use the seed - value if available. - - * primegen.c (_gcry_generate_fips186_2_prime): Fix inner p loop. - -2008-11-26 Werner Koch - - * primegen.c (_gcry_generate_fips186_3_prime): New. - * dsa.c (generate_fips186): Add arg USE_FIPS186_2. - (dsa_generate_ext): Parse new flag use-fips183-2. - -2008-11-25 Werner Koch - - * dsa.c (generate_fips186): New. - (dsa_generate_ext): Use new function if derive-parms are given or - if in FIPS mode. - * primegen.c (_gcry_generate_fips186_2_prime): New. - -2008-11-24 Werner Koch - - * pubkey.c (gcry_pk_genkey): Insert code to output extrainfo. - (pubkey_generate): Add arg R_EXTRAINFO and pass it to the extended - key generation function. - * rsa.c (gen_x931_parm_xp, gen_x931_parm_xi): New. - (generate_x931): Generate params if not given. - (rsa_generate_ext): Parse use-x931 flag. Return p-q-swapped - indicator. - * dsa.c (dsa_generate_ext): Put RETFACTORS into R_EXTRAINFO if - possible. - - * pubkey.c (gcry_pk_genkey): Remove parsing of almost all - parameters and pass the parameter S-expression to pubkey_generate. - (pubkey_generate): Simplify by requitring modules to parse the - parameters. Remove the special cases for Elgamal and ECC. - (sexp_elements_extract_ecc): Add arg EXTRASPEC and use it. Fix - small memory leak. - (sexp_to_key): Pass EXTRASPEC to sexp_elements_extract_ecc. - (pubkey_table) [USE_ELGAMAL]: Add real extraspec. - * rsa.c (rsa_generate_ext): Adjust for new calling convention. - * dsa.c (dsa_generate_ext): Ditto. - * elgamal.c (_gcry_elg_generate): Ditto. Rename to elg_generate_ext. - (elg_generate): New. - (_gcry_elg_generate_using_x): Remove after merging code with - elg_generate_ext. - (_gcry_pubkey_extraspec_elg): New. - (_gcry_elg_check_secret_key, _gcry_elg_encrypt, _gcry_elg_sign)=20 - (_gcry_elg_verify, _gcry_elg_get_nbits): Make static and remove - _gcry_ prefix. - * ecc.c (_gcry_ecc_generate): Rename to ecc_generate_ext and - adjust for new calling convention. - (_gcry_ecc_get_param): Rename to ecc_get_param and make static. - (_gcry_pubkey_extraspec_ecdsa): Add ecc_generate_ext and - ecc_get_param. -=09 -2008-11-20 Werner Koch - - * pubkey.c (pubkey_generate): Add arg DERIVEPARMS. - (gcry_pk_genkey): Parse derive-parms and pass it to above. - * rsa.c (generate_x931): New. - (rsa_generate_ext): Add arg DERIVEPARMS and call new function in - fips mode or if DERIVEPARMS is given. - * primegen.c (_gcry_derive_x931_prime, find_x931_prime): New. - -2008-11-19 Werner Koch - - * rsa.c (rsa_decrypt): Use gcry_create_nonce for blinding. - (generate): Rename to generate_std. - -2008-11-05 Werner Koch - - * md.c (md_open): Use a switch to set the Bsize. - (prepare_macpads): Fix long key case for SHA384 and SHA512. - - * cipher.c (gcry_cipher_handle): Add field EXTRASPEC. - (gcry_cipher_open): Set it. - (gcry_cipher_ctl): Add private control code to disable weak key - detection and to return the current input block. - * des.c (_tripledes_ctx): Add field FLAGS. - (do_tripledes_set_extra_info): New. - (_gcry_cipher_extraspec_tripledes): Add new function. - (do_tripledes_setkey): Disable weak key detection. - -2008-10-24 Werner Koch - - * md.c (digest_table): Allow MD5 in fips mode. - (md_register_default): Take special action for MD5. - (md_enable, gcry_md_hash_buffer): Ditto. - -2008-09-30 Werner Koch - - * rijndael.c (do_setkey): Properly align "t" and "tk". - (prepare_decryption): Properly align "w". Fixes bug #936. - -2008-09-18 Werner Koch - - * pubkey.c (gcry_pk_genkey): Parse domain parameter. - (pubkey_generate): Add new arg DOMAIN and remove special case for - DSA with qbits. - * rsa.c (rsa_generate): Add dummy args QBITS, NAME and DOMAIN and - rename to rsa_generate_ext. Change caller. - (_gcry_rsa_generate, _gcry_rsa_check_secret_key)=20 - (_gcry_rsa_encrypt, _gcry_rsa_decrypt, _gcry_rsa_sign)=20 - (_gcry_rsa_verify, _gcry_rsa_get_nbits): Make static and remove - _gcry_ prefix. - (_gcry_pubkey_spec_rsa, _gcry_pubkey_extraspec_rsa): Adjust names. - * dsa.c (dsa_generate_ext): New. - (_gcry_dsa_generate): Replace code by a call to dsa_generate. - (_gcry_dsa_check_secret_key, _gcry_dsa_sign, _gcry_dsa_verify) - (_gcry_dsa_get_nbits): Make static and remove _gcry prefix. - (_gcry_dsa_generate2): Remove. - (_gcry_pubkey_spec_dsa): Adjust to name changes. - (_gcry_pubkey_extraspec_rsa): Add dsa_generate_ext. - -2008-09-16 Werner Koch - - * ecc.c (run_selftests): Add arg EXTENDED. - -2008-09-12 Werner Koch - - * rsa.c (test_keys): Do a bad case signature check. - * dsa.c (test_keys): Do a bad case check. - - * cipher.c (_gcry_cipher_selftest): Add arg EXTENDED and pass it - to the called tests. - * md.c (_gcry_md_selftest): Ditto. - * pubkey.c (_gcry_pk_selftest): Ditto. - * rijndael.c (run_selftests): Add arg EXTENDED and pass it to the - called tests. - (selftest_fips_128): Add arg EXTENDED and run only one test - non-extended mode. - (selftest_fips_192): Add dummy arg EXTENDED. - (selftest_fips_256): Ditto. - * hmac-tests.c (_gcry_hmac_selftest): Ditto. - (run_selftests): Ditto. - (selftests_sha1): Add arg EXTENDED and run only one test - non-extended mode. - (selftests_sha224, selftests_sha256): Ditto. - (selftests_sha384, selftests_sha512): Ditto. - * sha1.c (run_selftests): Add arg EXTENDED and pass it to the - called test. - (selftests_sha1): Add arg EXTENDED and run only one test - non-extended mode. - * sha256.c (run_selftests): Add arg EXTENDED and pass it to the - called tests. - (selftests_sha224): Add arg EXTENDED and run only one test - non-extended mode. - (selftests_sha256): Ditto. - * sha512.c (run_selftests): Add arg EXTENDED and pass it to the - called tests. - (selftests_sha384): Add arg EXTENDED and run only one test - non-extended mode. - (selftests_sha512): Ditto. - * des.c (run_selftests): Add arg EXTENDED and pass it to the - called test. - (selftest_fips): Add dummy arg EXTENDED. - * rsa.c (run_selftests): Add dummy arg EXTENDED. - - * dsa.c (run_selftests): Add dummy arg EXTENDED. - - * rsa.c (extract_a_from_sexp): New. - (selftest_encr_1024): Check that the ciphertext does not match the - plaintext. - (test_keys): Improve tests and return an error status. - (generate): Return an error if test_keys fails. - * dsa.c (test_keys): Add comments and return an error status. - (generate): Return an error if test_keys failed. - -2008-09-11 Werner Koch - - * rsa.c (_gcry_rsa_decrypt): Return an error instead of calling - BUG in case of a practically impossible condition. - (sample_secret_key, sample_public_key): New. - (selftest_sign_1024, selftest_encr_1024): New. - (selftests_rsa): Implement tests. - * dsa.c (sample_secret_key, sample_public_key): New. - (selftest_sign_1024): New. - (selftests_dsa): Implement tests. - -2008-09-09 Werner Koch - - * hmac-tests.c (selftests_sha1): Add tests. - (selftests_sha224, selftests_sha384, selftests_sha512): Make up tests. - - * hash-common.c, hash-common.h: New. - * sha1.c (selftests_sha1): Add 3 tests. - * sha256.c (selftests_sha256, selftests_sha224): Ditto. - * sha512.c (selftests_sha512, selftests_sha384): Ditto. - -2008-08-29 Werner Koch - - * pubkey.c (gcry_pk_get_keygrip): Remove the special case for RSA - and check whether a custom computation function has been setup. - * rsa.c (compute_keygrip): New. - (_gcry_pubkey_extraspec_rsa): Setup this function. - * ecc.c (compute_keygrip): New. - (_gcry_pubkey_extraspec_ecdsa): Setup this function. - -2008-08-28 Werner Koch - - * cipher.c (cipher_decrypt, cipher_encrypt): Return an error if - mode NONE is used. - (gcry_cipher_open): Allow mode NONE only with a debug flag set and - if not in FIPS mode. - -2008-08-26 Werner Koch - - * pubkey.c (pubkey_generate): Add arg KEYGEN_FLAGS. - (gcry_pk_genkey): Implement new parameter "transient-key" and - pass it as flags to pubkey_generate. - (pubkey_generate): Make use of an ext_generate function. - * rsa.c (generate): Add new arg transient_key and pass appropriate - args to the prime generator. - (_gcry_rsa_generate): Factor all code out to ... - (rsa_generate): .. new func with extra arg KEYGEN_FLAGS. - (_gcry_pubkey_extraspec_ecdsa): Setup rsa_generate. - * primegen.c (_gcry_generate_secret_prime)=20 - (_gcry_generate_public_prime): Add new arg RANDOM_LEVEL. - -2008-08-21 Werner Koch - - * primegen.c (_gcry_generate_secret_prime) - (_gcry_generate_public_prime): Use a constant macro for the random - level. -=09 -2008-08-19 Werner Koch - - * pubkey.c (sexp_elements_extract_ecc) [!USE_ECC]: Do not allow - allow "curve" parameter. - -2008-08-15 Werner Koch - - * pubkey.c (_gcry_pk_selftest): New. - * dsa.c (selftests_dsa, run_selftests): New. - * rsa.c (selftests_rsa, run_selftests): New. - * ecc.c (selftests_ecdsa, run_selftests): New. - - * md.c (_gcry_md_selftest): New. - * sha1.c (run_selftests, selftests_sha1): New. - * sha256.c (selftests_sha224, selftests_sha256, run_selftests): New. - * sha512.c (selftests_sha384, selftests_sha512, run_selftests): New. - - * des.c (selftest): Remove static variable form selftest. - (des_setkey): No on-the-fly self test in fips mode. - (tripledes_set3keys): Ditto. - - * cipher.c (_gcry_cipher_setkey, _gcry_cipher_setiv):=20 - - * dsa.c (generate): Bail out in fips mode if NBITS is less than 1024. - * rsa.c (generate): Return an error code if the the requested size - is less than 1024 and we are in fpis mode. - (_gcry_rsa_generate): Take care of that error code. - - * ecc.c (generate_curve): In fips mode enable only NIST curves. - - * cipher.c (_gcry_cipher_selftest): New. - - * sha512.c (_gcry_digest_extraspec_sha384) - (_gcry_digest_extraspec_sha512): New. - * sha256.c (_gcry_digest_extraspec_sha224) - (_gcry_digest_extraspec_sha256): New. - * sha1.c (_gcry_digest_extraspec_sha1): New. - * ecc.c (_gcry_pubkey_extraspec_ecdsa): New. - * dsa.c (_gcry_pubkey_extraspec_dsa): New. - * rsa.c (_gcry_pubkey_extraspec_rsa): New. - * rijndael.c (_gcry_cipher_extraspec_aes) - (_gcry_cipher_extraspec_aes192, _gcry_cipher_extraspec_aes256): New. - * des.c (_gcry_cipher_extraspec_tripledes): New. - - * cipher.c (gcry_cipher_register): Rename to _gcry_cipher_register. - Add arg EXTRASPEC. - (dummy_extra_spec): New. - (cipher_table_entry): Add extraspec field. - * md.c (_gcry_md_register): Rename to _gcry_md_register. Add - arg EXTRASPEC. - (dummy_extra_spec): New. - (digest_table_entry): Add extraspec field. - * pubkey.c (gcry_pk_register): Rename to _gcry_pk_register. Add - arg EXTRASPEC. - (dummy_extra_spec): New. - (pubkey_table_entry): Add extraspec field. - - * ac.c: Let most public functions return GPG_ERR_UNSUPPORTED in - fips mode. - - * pubkey.c (pubkey_table_entry): Add field FIPS_ALLOWED and mark - appropriate algorithms. - (dummy_generate, dummy_check_secret_key, dummy_encrypt)=20 - (dummy_decrypt, dummy_sign, dummy_verify, dummy_get_nbits): Signal - a fips error when used. - (gcry_pk_register): In fips mode do not allow to register new - algorithms. - - * md.c (digest_table): Add field FIPS_ALLOWED and mark appropriate - algorithms. - (md_register_default): In fips mode register only fips algorithms. - (gcry_md_register): In fips mode do not allow to register new - algorithms. - (gcry_md_get): Signal a fips error if called. - (gcry_md_hash_buffer): Do not allow rmd160 when not in fips mode. - (md_start_debug): Disable in fips_mode. - - * md.c (gcry_md_register_default): Rename to .. - (md_register_default): .. this. - (md_digest): Remove this commented fucntion. - * pubkey.c (gcry_pk_register_default): Rename to .. - (pk_register_default): .. this. - - * cipher.c (cipher_table_entry): Add field FIPS_ALLOWED. - (gcry_cipher_register_default): Register only fips approved - algorithms. - (gcry_cipher_register): Do not allow to register new ciphers. - (cipher_setiv): Signal fips error. -=09 - * cipher (gcry_cipher_register_default): Rename to .. - (cipher_register_default): .. this. - (REGISTER_DEFAULT_CIPHERS): Adjust for that change. - -2008-07-05 Werner Koch - - * random-daemon.c, random.h, rndhw.c, rndunix.c, rand-internal.h - * random.c, rndegd.c, rndlinux.c, rndw32.c: Move to ../cipher. - * Makefile.am: Remove random stuff. - -2008-06-24 Szakats Istvan (wk) - - * ac.c (_gcry_ac_key_destroy, _gcry_ac_key_pair_generate): Relase - some more memory. - -2008-04-22 Werner Koch - - * rijndael.c (_gcry_aes_cfb_enc, _gcry_aes_cbc_enc)=20 - (_gcry_aes_cfb_dec, _gcry_aes_cbc_dec): Use Padlock if possible. - -2008-04-18 Werner Koch - - * sha1.c (transform_aligned): Remove. That is will obviosuly not - work because we need a scratch working area and our internal API - does not allow to modify the buffers. - - * rijndael.c: Factor tables out to .. - * rijndael-tables.h: .. new. - - * ac.c (ac_data_extract): Make static. - - * camellia.h [HAVE_CONFIG_H]: Include config.h. - - * rndw32.c (registry_poll): Only print the performance data - problem warning once. Suggested by Simon Josefsson. - -2008-03-19 Werner Koch - - * cipher.c (gcry_cipher_open) [USE_AES]: Init bulk encryption only - if requested. Suggested by Dirk Stoecker. - -2008-03-18 Werner Koch - - * sha1.c: Include stdint.h. - (transform): Add arg NBLOCKS so that we can work on more than one - block and avoid updates of the chaining variables. Changed all - callers to use 1. - (sha1_write): Replace loop around transform. - (transform_aligned) [WORDS_BIGENDIAN]: New. - (TRANSFORM): New macro to replace all direct calls of transform. - -2008-03-17 Werner Koch - - * rijndael.c (_gcry_aes_cfb_dec): New. - (do_encrypt): Factor code out to .. - (do_encrypt_aligned): .. New. - (_gcry_aes_cfb_enc, _gcry_aes_cfb_dec): Use new function. - (do_decrypt): Factor code out to .. - (do_decrypt_aligned): .. new. - (_gcry_aes_cbc_enc, _gcry_aes_cbc_dec): New. - * cipher.c (struct gcry_cipher_handle): Put field IV into new - union U_IV to enforce proper alignment. Change all users. - (do_cfb_decrypt): Optimize. - (do_cbc_encrypt, do_cbc_decrypt): Optimize. - -2008-03-15 Werner Koch - - * rijndael.c (_gcry_aes_cfb_enc): New. - * cipher.c (struct gcry_cipher_handle): Add field ALGO and BULK. - (gcry_cipher_open): Set ALGO and BULK. - (do_cfb_encrypt): Optimize. - -2008-02-18 Werner Koch - - * rsa.c (_gcry_rsa_verify) [IS_DEVELOPMENT_VERSION]: Print - intermediate results. - -2008-01-08 Werner Koch - - * random.c (add_randomness): Do not just increment - POOL_FILLED_COUNTER but update it by the actual amount of data. - -2007-12-13 Werner Koch - - * pubkey.c (sexp_data_to_mpi): Support SHA-224. - -2007-12-05 Werner Koch - - * rijndael.c (USE_PADLOCK): Depend on ENABLE_PADLOCK_SUPPORT. - * rndhw.c (USE_PADLOCK): Ditto - - * rsa.c (secret): Fixed condition test for using CRT. Reported by - Dean Scarff. Fixes bug#864. - (_gcry_rsa_check_secret_key): Return an erro if the optional - parameters are missing. - * pubkey.c (sexp_elements_extract): Add arg ALGO_NAME. Changed all - callers to pass NULL. Add hack to allow for optional RSA - parameters. - (sexp_to_key): Pass algo name to sexp_elements_extract. - -2007-12-03 Werner Koch - - * random.c (gcry_random_add_bytes): Implement it. - * rand-internal.h (RANDOM_ORIGIN_EXTERNAL): New. - -2007-11-30 Werner Koch - - * rndhw.c: New. - * rndlinux.c (_gcry_rndlinux_gather_random): Try to read 50% - directly from the hwrng. - * random.c (do_fast_random_poll): Also run the hw rng fast poll. - (_gcry_random_dump_stats): Tell whether the hw rng failed. - -2007-11-29 Werner Koch - - * rijndael.c (USE_PADLOCK): Define new macro used for ia32. - (RIJNDAEL_context) [USE_PADLOCK]: Add fields USE_PADLOCK and - PADLOCK_KEY. - (do_setkey) [USE_PADLOCK]: Enable padlock if available for 128 bit - AES. - (do_padlock) [USE_PADLOCK]: New. - (rijndael_encrypt, rijndael_decrypt) [USE_PADLOCK]: Divert to - do_padlock. - * cipher.c (cipher_context_alignment_t): New. Use it in this - module in place of PROPERLY_ALIGNED_TYPE. - (NEED_16BYTE_ALIGNED_CONTEXT): Define macro for ia32. - (struct gcry_cipher_handle): Add field HANDLE_OFFSET. - (gcry_cipher_open): Take care of increased alignment requirements. - (gcry_cipher_close): Ditto. - -2007-11-28 Werner Koch - - * sha256.c (asn224): Fixed wrong template. It happened due to a - bug in RFC4880. SHA-224 is not in the stable version of libgcrypt - so the consequences are limited to users of this devel version. - -2007-10-31 Werner Koch - - * ac.c (gcry_ac_data_new): Remove due to the visibility wrapper. - (gcry_ac_data_destroy, gcry_ac_data_copy, gcry_ac_data_length)=20 - (gcry_ac_data_set, gcry_ac_data_get_name, gcry_ac_data_get_index)=20 - (gcry_ac_data_to_sexp, gcry_ac_data_from_sexp)=20 - (gcry_ac_data_clear, gcry_ac_io_init, gcry_ac_open)=20 - (gcry_ac_close, gcry_ac_key_init, gcry_ac_key_pair_generate)=20 - (gcry_ac_key_pair_extract, gcry_ac_key_destroy)=20 - (gcry_ac_key_pair_destroy, gcry_ac_key_data_get)=20 - (gcry_ac_key_test, gcry_ac_key_get_nbits, gcry_ac_key_get_grip)=20 - (gcry_ac_data_encrypt, gcry_ac_data_decrypt, gcry_ac_data_sign)=20 - (gcry_ac_data_verify, gcry_ac_data_encode, gcry_ac_data_decode)=20 - (gcry_ac_mpi_to_os, gcry_ac_mpi_to_os_alloc, gcry_ac_os_to_mpi)=20 - (gcry_ac_data_encrypt_scheme, gcry_ac_data_decrypt_scheme)=20 - (gcry_ac_data_sign_scheme, gcry_ac_data_verify_scheme)=20 - (gcry_ac_io_init_va): Ditto. - (gcry_ac_id_to_name, gcry_ac_name_to_id): Remove as these - deprecated functions are now implemented by visibility.c. - -2007-10-26 Werner Koch - - * rndw32.c: Disable debug flag. - -2007-10-25 Werner Koch - - * rndw32.c: Updated from current cryptlib snapshot and modified - for our use. Removed support from pre NT systems. - (slow_gatherer_windows95): Remove. - (_gcry_rndw32_gather_random): Require an NT platform. - (init_system_rng, read_system_rng, read_mbm_data): New. - (slow_gatherer_windowsNT): Rename to ... - (slow_gatherer): .. this. Read system RNG and MBM. - (registry_poll): New with code factored out from slow_gatherer. - -2007-08-23 Werner Koch - - * random.c (pool_filled_counter): New. - (add_randomness): Use it. - -2007-08-22 Werner Koch - - * rndw32.c, rndunix.c: Switched to LGPL. - -2007-05-30 Werner Koch - - * camellia.h, camellia.c: Replace by new LGPL version and adjusted - camellia.h. - -2007-05-09 Marcus Brinkmann - - * ac.c (_gcry_ac_io_init_va, _gcry_ac_io_write, _gcry_ac_io_read): - Adjust users of gcry_ac_io_t because union is not anonymous - anymore. - -2007-05-02 Werner Koch - - * camellia-glue.c (camellia_setkey, camellia_encrypt) - (camellia_decrypt): Recalculated used stack size in called - functions. - * camellia.h: Redefine external symbols. - -2007-05-02 David Shaw - - * Makefile.am, cipher.c: Add Camellia. - - * camellia-glue.c: New. The necessary glue to interface libgcrypt - to the stock NTT Camellia distribution. - - * camellia.h, camellia.c: The stock NTT Camellia distribution - (GPL). - -2007-04-30 David Shaw - - * cipher.c: Use #if instead of #ifdef as configure defines the - USE_cipher defines as 0 for disabled. - -2007-04-30 Werner Koch - - * rndegd.c (_gcry_rndegd_set_socket_name): New. - -2007-04-30 Marcus Brinkmann - - * ecc.c (ec2os): Fix relocation of short numbers. - - * ecc.c (generate_key): Do not allocate D, which will be allocated - by GEN_K. Remove G. Fix test if g_x, g_y resp. q_x, q_y are - requested. - (_gcry_ecc_generate): Release unneeded members of SK. - * pubkey.c (sexp_to_key): Release NAME. - -2007-04-28 Marcus Brinkmann - - * ac.c (gcry_ac_mpi): Remove member NAME_PROVIDED. - (ac_data_mpi_copy, _gcry_ac_data_set, _gcry_ac_data_get_name) - (_gcry_ac_data_get_index, ac_data_construct): Adjust handling of - NAME accordingly. - -2007-04-20 Werner Koch - - * ecc.c (domain_parms): Add standard brainpool curves. - -2007-04-18 Werner Koch - - * ecc.c (generate_curve): Implement alias mechanism. - - * pubkey.c (sexp_elements_extract_ecc): New. - (sexp_to_key): Add special case for ecc. - (sexp_to_key, sexp_to_sig, sexp_to_enc, gcry_pk_genkey): Replace - name_terminated stuff by a call to _gcry_sexp_nth_string. - (gcry_pk_get_keygrip): Ditto. - -2007-04-16 Werner Koch - - * ecc.c (_gcry_ecc_generate): Renamed DUMMY to CURVE and use it. - -2007-04-13 Marcus Brinkmann - - * ac.c (ac_data_construct): Cast const away to suppress compiler - warning. - - * ecc.c (ecc_generate): Avoid compiler warning for unused argument - DUMMY. - (ecc_verify): Avoid compiler warning for unused arguments CMP and - OPAQUEV. - -2007-04-06 Werner Koch - - * sha1.c (oid_spec_sha1): Add another oid from X9.62. - -2007-03-28 Werner Koch - - * pubkey.c (gcry_pk_genkey): Do not issue misc-key-info if it is - empty. - (gcry_pk_genkey): New parameter "curve". - - * ecc.c: Entirely rewritten with only a few traces of the old - code left. - (_gcry_ecc_generate): New. - (generate_key) New arg NAME. - (generate_curve): Ditto. Return actual number of NBITS. - -2007-03-26 Werner Koch - - * pubkey.c (gcry_pk_genkey): Increase size of SKEY array and add a - runtime bounds check. - -2007-03-23 Werner Koch - - * ecc.c (ecc_ctx_init, ecc_ctx_free, ecc_mod, ecc_mulm): New. - (duplicate_point, sum_points, escalar_mult): Don't use a - copy of base->p. Replaced all mpi_mulm by ecc_mulm so that we can - experiment with different algorithms. - (generate_key, check_secret_key, sign, verify): Initialize a - computation context for use by ecc_mulm. - -2007-03-22 Werner Koch - - * pubkey.c (pubkey_table): Initialize ECC. - * Makefile.am (EXTRA_libcipher_la_SOURCES): Add ecc.c. - * ecc.c: New. Heavily reformatted and changed for use in libgcrypt. - (point_init): New. - (escalar_mult): Make arg R the first arg to be similar to the mpi - functions. - (duplicate_point): Ditto - (sum_points): Ditto - (sign, verify): Remove unneeded copy operations. - (sum_points): Removed memory leaks and optimized some compares. - (verify): Simplified input check. - -2007-03-14 Werner Koch - - * random.c (MASK_LEVEL): Removed macro as it was used only at one - place. Open coded it there. - (gcry_randomize, _gcry_update_random_seed_file) - (_gcry_fast_random_poll): Factor lock code out to .. - (lock_pool, unlock_pool): .. new. - (initialize): Look the pool while allocating.=20 - (read_random_source, do_fast_random_poll): Moved intialization to ... - (initialize): .. here. - (_gcry_enable_quick_random_gen): No more need for initialization. - (is_initialized): Moved this global flag to .. - (initialize): .. here and changed all users to unconditionally call - initialize. - (add_randomness): Remove initalization here. It simply can't - happen.=20 - - * random.c (enum random_origins): Moved to .. - * rand-internal.h: .. here. - * rndunix.c (_gcry_rndunix_gather_random): Use enum in prototype - for ORIGIN and renamed REQUESTOR to ORIGIN. - * rndegd.c (_gcry_rndegd_gather_random): Ditto. - * rndlinux.c (_gcry_rndlinux_gather_random): Ditto. - * rndw32.c (_gcry_rndw32_gather_random): Ditto. - (_gcry_rndw32_gather_random_fast): Ditto. - -2007-03-13 Werner Koch - - * random.c (enum random_origins): New. - (add_randomness): Renamed arg SOURCE to ORIGIN. - (read_random_source): Renamed arg REQUESTOR to ORIGIN. - (getfnc_gather_random): Removed static variable because this - function is only called one and thus we don't need this - optimization. - (_gcry_quick_random_gen): Removed and replaced by.. - (_gcry_enable_quick_random_gen): .. this. It is onlyu used to - enable it and it does not make sense to disable it later. Changed - the only one caller too. - (get_random_bytes): Removed. - (gcry_random_bytes, gcry_random_bytes_secure): Implement in terms - of gcry_randomize. - * random-daemon.c (_gcry_daemon_get_random_bytes): Removed. - -2007-02-23 Werner Koch - - * elgamal.c (generate): Removed unused variable TEMP. - (test_keys): New arg NODIE. - (generate_using_x, _gcry_elg_generate_using_x): New. - * pubkey.c (pubkey_generate): New arg XVALUE and direct call to - the new elgamal generate fucntion. - (gcry_pk_genkey): Parse the new "xvalue" tag. - -2007-02-22 Werner Koch - - * pubkey.c (sexp_data_to_mpi): Handle dynamically allocated - algorithms. Suggested by Neil Dunbar. Fixes bug#596. - - * rndw32.c (_gcry_rndw32_gather_random_fast): Make it return void. - - * cipher.c (gcry_cipher_algo_name): Simplified. - - * random.c: Use the daemon only if compiled with USE_RANDOM_DAEMON.=20 - - * Makefile.am (libcipher_la_SOURCES): Build random-daemon support - only if requested. - -2007-02-21 Werner Koch - - * random.c (rndpool, keypool): Make unsigned. - (mix_pool): Change char* variables to unsigned char*. - (gcry_randomize): Make arg BUFFER a void*. - (gcry_create_nonce): Ditto. - - * rmd160.c (gcry_rmd160_mixblock): Make BUFFER a void*. - (_gcry_rmd160_hash_buffer): Make OUTBUF and BUFFER void*. - * sha1.c (_gcry_sha1_hash_buffer): Ditto. - - * cipher.c (gcry_cipher_encrypt, cry_cipher_decrypt): Change - buffer args to void*. - (gcry_cipher_register): Make ALGORITHM_ID a int *. - - * md.c (md_start_debug): Make SUFFIX a const char*. Use snprintf. - (gcry_md_debug): New. - (gcry_md_ctl): Changed arg BUFFER from unsigned char*. - - * md.c (md_write): Make INBUF a const void*. - (gcry_md_write): Remove needless cast. - * crc.c (crc32_write): Make INBUF a const void* - (update_crc32, crc24rfc2440_write): Ditto. - * sha512.c (sha512_write, transform): Ditto. - * sha256.c (sha256_write, transform): Ditto. - * rmd160.c (rmd160_write, transform): Ditto. - * md5.c (md5_write, transform): Ditto. - * md4.c (md4_write, transform): Ditto. - * sha1.c (sha1_write, transform): Ditto. - - * tiger.c (tiger_write, transform): Ditto. - * whirlpool.c (whirlpool_write, whirlpool_add, transform): Ditto. - - * elgamal.c (elg_names): Change to a const*. - * dsa.c (dsa_names): Ditto. - * rsa.c (rsa_names): Ditto. - * pubkey.c (gcry_pk_lookup_func_name): Make ALIASES a const. - -2007-02-20 Werner Koch - - * rndlinux.c (open_device): Remove unsused arg MINOR. - -2007-01-30 Werner Koch - - * sha256.c (oid_spec_sha256): Add alias from pkcs#1. - * sha512.c (oid_spec_sha512): Ditto. - (oid_spec_sha384): Ditto. - -2006-12-18 Werner Koch - - * rndlinux.c (set_cloexec_flag): New. - (open_device): Set close-on-exit flags. Suggested by Max - Kellermann. Fixes Debian#403613. - - * Makefile.am (AM_CPPFLAGS, AM_CFLAGS): Splitted and merged - Moritz' changes. - (INCLUDES): Removed. - -2006-11-30 Werner Koch - - * serpent.c (byte_swap_32): Remove trailing semicolon. - -2006-11-15 Werner Koch - - * Makefile.am (INCLUDES): Include ../src/ - -2006-11-03 Werner Koch - - * random.c [HAVE_GETTIMEOFDAY]: Included sys/time.h and not - sys/times.h. Reported by Rafa=C3=ABl Carr=C3=A9. - -2006-11-05 Moritz Schulte - - * Makefile.am (AM_CFLAGS): Added -I$(top_builddir)/src so that the - new gcrypt.h is used, not the one installed in the system. - -2006-10-25 Werner Koch - - * primegen.c (prime_generate_internal): Tweaked use of secure - memory and entropy use. Safe unused primes from the pool. Allocate - at least a pool of 30. - (save_pool_prime, get_pool_prime): New. - -2006-10-23 Werner Koch - - * ac.c (_gcry_ac_data_from_sexp): Reset sexp_tmp for failsafe - means. Release sexp_cur if needed. Reported by Dirk Stoecker. - - * pubkey.c (pubkeys_registered_lock): Intialized it. It is not - realy needed because this is a mere initialization to 0 anyway. - Noted by Victor Stinner. - -2006-10-17 Werner Koch - - * dsa.c (_gcry_dsa_generate2): New. - (generate): New arg QBITS. Add sanity checks for reasonable qbits - and nbits. - * pubkey.c (gcry_pk_genkey): Parse an qbits element. - (pubkey_generate): New arg QBITS. Pass it to the DSA generation. - -2006-10-05 Werner Koch - - * md.c (gcry_md_algo_info) : Check that the algo is - available. - -2006-10-04 David Shaw (wk) -=20 - * tiger.c (round): Rename to tiger_round as gcc 4 has a built-in - round function that this conflicts with. -=20 -2006-09-11 Werner Koch - - * rndw32.c (slow_gatherer_windowsNT): While adding data use the - size of the diskPerformance and not its address. Has been fixed in - GnuPG more than a year ago. Noted by Lee Fisher. - -2006-08-30 Werner Koch - - * pubkey.c (sexp_data_to_mpi): Need to allow "ripemd160" here as - this is the canonical name. - -2006-08-29 Hye-Shik Chang (wk) - - * seed.c: New. - -2006-08-03 Werner Koch - - * random-daemon.c (_gcry_daemon_initialize_basics): Don't - initialize the socket. Remove arg SOCKETNAME. - (connect_to_socket): Make sure that daemon is set to -1 on error. - (call_daemon): Initialize the socket on the first call. - (_gcry_daemon_randomize, _gcry_daemon_get_random_bytes)=20 - (_gcry_daemon_create_nonce): New arg SOCKETNAME. - * random.c (initialize): Call new daemon initializator. - (get_random_bytes, gcry_randomize, gcry_create_nonce): Pass socket - name to daemon call and reset allow_daemon on failure. - -2006-07-26 Werner Koch - - * rmd160.c (_gcry_rmd160_mixblock): Add cast to transform call. - - * blowfish.c (selftest): Cast string to usnigned char*. - - * primegen.c (prime_generate_internal): Cast unsigned/char* - mismatch in calling m_out_of_n. - (is_prime): Changed COUNT to unsigned int *. - - * ac.c (_gcry_ac_data_copy): Initialize DATA_MPIS. - - * random.c (gcry_create_nonce): Update the pid after a fork. - Reported by Uoti Urpala. - -2006-07-04 Marcus Brinkmann - - * sha512.c: Fix typo in copyright notice. - -2006-06-21 Werner Koch - - * rsa.c (_gcry_rsa_generate): Replace xcalloc by calloc. - * pubkey.c (gcry_pk_encrypt, gcry_pk_sign): Ditto. - (sexp_to_key, sexp_to_sig, sexp_to_enc, gcry_pk_encrypt)=20 - (gcry_pk_sign, gcry_pk_genkey, gcry_pk_get_keygrip): Ditto.=20 - * md.c (md_copy): Ditto. -=09 -2006-04-22 Moritz Schulte - - * random-daemon.c (_gcry_daemon_initialize_basics): New argument: - SOCKETNAME. Passing on to connect_to_socket() if non-NULL. - (connect_to_socket, writen, readn, call_daemon): New functions. - (_gcry_daemon_randomize, _gcry_daemon_get_random_bytes)=20 - (_gcry_daemon_create_nonce): Call call_daemon(). - (RANDOM_DAEMON_SOCKET): New symbol. - (daemon_socket): New static variable. - - * random.h (_gcry_daemon_initialize_basics): New parameter: - SOCKETNAME. - (_gcry_set_random_daemon_socket): New declaration. - - * random.c (initialize_basics): Pass DAEMON_SOCKET_NAME to - _gcry_daemon_initialize_basics. - (_gcry_set_random_daemon_socket): New function, setting - DAEMON_SOCKET_NAME. - -2006-04-01 Moritz Schulte - - * ac.c (eme_pkcs_v1_5_encode): Use KEY_SIZE directly, no need to - call gcry_ac_key_get_nbits. - (eme_pkcs_v1_5_decode): Likewise. - (ac_es_dencode_prepare_pkcs_v1_5): Fill options_em structure with - key_size. - (_gcry_ac_data_dump, gcry_ac_data_dump): New functions. - (_gcry_ac_data_to_sexp, _gcry_ac_data_from_sexp): More or less - rewritten; changed S-Expression format so that it matches the one - used in pubkey.c. - -2006-03-15 Werner Koch - - * random-daemon.c: New. - * random.c (_gcry_use_random_daemon): New. - (get_random_bytes, gcry_randomize, gcry_create_nonce): Try - diverting to the daemon functions. - -2006-03-14 Werner Koch - - * random.c (lock_seed_file): New. - (read_seed_file, _gcry_update_random_seed_file): Use it. - - * random.c (gcry_create_nonce): Detect a fork and re-seed. - (read_pool): Fixed the fork detection; it used to work only for - multi-threaded processes. - -2006-03-12 Brad Hards (wk) - - * md.c (md_open): Use new variable macpads_Bsize instead of - hardwiring the block size. Changed at all places. - -2006-03-10 Brad Hards (wk, patch 2005-04-22) - - * md.c, sha256.c: Add support for SHA-224. - (sha224_init): New. -=09 -2006-01-18 Brad Hards (wk 2006-03-07) - - * cipher.c (cipher_encrypt, cipher_decrypt, do_ofb_encrypt) - (do_ofb_decrypt, gcry_cipher_open): Implement Output Feedback Mode. - -2005-11-02 Moritz Schulte - - * pubkey.c (gcry_pk_algo_name): Return "?" instead of NULL for - unknown algorithm IDs. - * cipher.c (cipher_algo_to_string): Likewise. - -2005-11-01 Moritz Schulte - - * pubkey.c (gcry_pk_algo_info): Don't forget to break after switch - case. - -2005-09-19 Werner Koch - - * dsa.c (generate): Add preliminary support for 2 and 4 keys. - Return an error code if the key size is not supported. - (_gcry_dsa_generate): Return an error. - -2005-08-22 Werner Koch - - * primegen.c (check_prime): New arg RM_ROUNDS. - (prime_generate_internal): Call it here with 5 rounds as used - before. - (gcry_prime_check): But here with 64 rounds. - (is_prime): Make sure never to use less than 5 rounds. - -2005-04-16 Moritz Schulte - - * ac.c (_gcry_ac_init): New function. - -2005-04-12 Moritz Schulte - - * ac.c (_gcry_ac_io_write, _gcry_ac_io_read): Initialize err to - make the compiler happy. - Always use errno, now that gcry_malloc() is guaranteed to set - errno on failure. - (_gcry_ac_data_to_sexp): Don't forget to goto out after error in - loop. - (_gcry_ac_data_to_sexp): Remove unused variable: mpi_list; - (_gcry_ac_data_to_sexp): Always deallocate sexp_buffer. - (_gcry_ac_data_from_sexp): Don't forget to initialize data_set_new. - (_gcry_ac_data_from_sexp): Handle special case, which is - necessary, since gcry_sexp_nth() does not distinguish between - "element does not exist" and "element is the empty list". - (_gcry_ac_io_init_va): Use assert to make sure that mode and type - are correct. - Use gcry_error_t types where gcry_err_code_t types have been used - before. - -2005-04-11 Moritz Schulte - - * ac.c (_gcry_ac_data_sign_scheme): Don't forget to initialize - buffer. - - * whirlpool.c: New file. - * md.c (digest_table): Add whirlpool. - * Makefile.am (EXTRA_libcipher_la_SOURCES): Added: whirlpool.c. - -2005-03-30 Moritz Schulte - - * ac.c (_gcry_ac_data_from_sexp): Use length of SEXP_CUR, not - length of SEXP; do not forget to set SEXP_TMP to NULL after it has - been released. - - (struct gcry_ac_mpi): New member: name_provided. - (_gcry_ac_data_set): Rename variable `name_final' to `name_cp'; - remove const qualifier; change code to not cast away const - qualifiers; use name_provided member as well. - (_gcry_ac_data_set, _gcry_ac_data_get_name): Use name_provided - member of named mpi structure. - - (gcry_ac_name_to_id): Do not forget to initialize err. - (_gcry_ac_data_get_index): Do not forget to initialize mpi_return; - use gcry_free() instead of free(); remove unnecessary cast; rename - mpi_return and name_return to mpi_cp and name_cp; adjust code. - (ac_data_mpi_copy): Do not cast away const qualifier. - (ac_data_values_destroy): Likewise. - (ac_data_construct): Likewise. - - (ac_data_mpi_copy): Initialize flags to GCRY_AC_FLAG_DEALLOC. - (ac_data_extract): Use GCRY_AC_FLAG_DEALLOC instead of - GCRY_AC_FLAG_COPY. - - (_gcry_ac_io_init_va, _gcry_ac_io_init, gcry_ac_io_init) - (gcry_ac_io_init_va, _gcry_ac_io_write, _gcry_ac_io_read) - (_gcry_ac_io_read_all, _gcry_ac_io_process): New functions. - (gry_ac_em_dencode_t): Use gcry_ac_io_t in prototype instead of - memroy strings directly; adjust encode/decode functions to use io - objects. - (emsa_pkcs_v1_5_encode_data_cb): New function ... - (emsa_pkcs_v1_5_encode): ... use it here. - (ac_data_dencode): Use io objects. - (_gcry_ac_data_encode, _gcry_ac_data_decode, gcry_ac_data_encode) - (gcry_ac_data_decode): Likewise. - (_gcry_ac_data_encrypt_scheme, gcry_ac_data_encrypt_scheme) - (_gcry_ac_data_decrypt_scheme, gcry_ac_data_decrypt_scheme) - (_gcry_ac_data_sign_scheme, gcry_ac_data_sign_scheme) - (_gcry_ac_data_verify_scheme, gcry_ac_data_verify_scheme): - Likewise. - -2005-03-23 Werner Koch - - * rndw32.c (_gcry_rndw32_gather_random_fast): While adding data - use the size of the object and not the one of its address. Bug - reported by Sascha Kiefer. - -2005-03-19 Moritz Schulte - - * cipher.c (do_cbc_encrypt): Be careful to not overwrite data, - which is to be used later on. This happend, in case CTS is - enabled and OUTBUF is equal to INBUF. - -2005-02-25 Werner Koch - - * pubkey.c (gcry_pk_get_keygrip): Allow for shadowed-private-key. - -2005-02-13 Moritz Schulte - - * serpent.c: Updated from 1.2 branch: - - s/u32_t/u32/ and s/byte_t/byte/. Too match what we have always - used and are using in all other files too - (serpent_test): Moved prototype out of a fucntion. - -2005-02-07 Moritz Schulte - - * ac.c: Major parts rewritten. - * pubkey.c (_gcry_pk_get_elements): New function. - -2004-12-09 Werner Koch - - * serpent.c (serpent_setkey): Moved prototype of serpent_test to - outer scope. - -2004-09-11 Moritz Schulte - - * pubkey.c (pubkey_table): Added an alias entry for GCRY_PK_ELG_E. - -2004-08-23 Moritz Schulte - - * ac.c: Do not include . - * rndegd.c: Likewise. - * sha1.c: Likewise. - * rndunix.c: Likewise. - * rndlinux.c: Likewise. - * rmd160.c: Likewise. - * md5.c: Likewise. - * md4.c: Likewise. - * cipher.c: Likewise. - * crc.c: Likewise. - * blowfish.c: Likewise. - - * pubkey.c (dummy_generate, dummy_check_secret_key) - (dummy_encrypt, dummy_decrypt, dummy_sign, dummy_verify): Return - err code GPG_ERR_NOT_IMPLEMENTED instead of aborting through - log_bug(). - (dummy_get_nbits): Return 0 instead of aborting though log_bug(). - -2004-08-19 Werner Koch - - * pubkey.c (sexp_data_to_mpi): Changed the zero random byte - substituting code to actually do clever things. Thanks to - Matthias Urlichs for noting the implementation problem. - -2004-08-09 Moritz Schulte - - * pubkey.c (gcry_pk_sign): Fixed memory leak; fix provided by - Modestas Vainius. - -2004-07-16 Werner Koch - - * rijndael.c (do_encrypt): Fix alignment problem. Bugs found by - Matthias Urlichs. - (do_decrypt): Ditto. - (keySched, keySched2): Use 2 macros along with unions in the key - schedule context. - -2004-07-14 Moritz Schulte - - * rsa.c (_gcry_rsa_decrypt): Don't forget to free "a". Thanks to - Nikos Mavroyanopoulos. - -2004-05-09 Werner Koch - - * random.c (read_pool): Mix the PID in to better protect after a - fork. - -2004-07-04 Moritz Schulte - - * serpent.c: Use "u32_t" instead of "unsigned long", do not - declare S-Box variables as "register". Fixes failure on - OpenBSD/sparc64, reported by Nikolay Sturm. - -2004-05-07 Werner Koch - - * random.c (initialize): Factored out some code to .. - (initialize_basics): .. new function. - (_gcry_random_initialize): Just call initialize_basics unless the - new arg FULL is set to TRUE. - (_gcry_fast_random_poll): Don't do anything unless the random - system has been really initialized. - -2004-05-07 Moritz Schulte - - * ac.c (gcry_ac_open): Do not dereference NULL pointer. Reported - by Umberto Salsi. - -2004-02-20 Werner Koch - - * primegen.c (check_prime): New args CB_FUNC and CB_ARG; call them - at different stages. Pass these arguments through all callers. - -2004-02-06 Werner Koch - - * des.c: Add a new OID as used by pkcs#12. - - * rfc2268.c: New. Taken from libgcrypt.=20 - * cipher.c: Setup the rfc2268 algorithm. - -2004-01-25 Moritz Schulte - - * primegen.c (prime_generate_internal): Do not forget to free - `q_factor'; fixed by Brieuc Jeunhomme. - (prime_generate_internal): Do not forget to free `prime'. - -2004-01-14 Moritz Schulte - - * ac.c (gcry_ac_data_set): New argument: flags; slightly - rewritten. - (gcry_ac_data_get_name, gcry_ac_data_get_index): Likewise. - (gcry_ac_key_pair_generate): New argument: misc_data; modified - order of arguments. - (gcry_ac_key_test): New argument: handle. - (gcry_ac_key_get_nbits, gcry_ac_key_get_grip): Likewise. - Use GCRY_AC_FLAG_NO_BLINDING instead of - GCRY_AC_DATA_FLAG_NO_BLINDING. - (gcry_ac_mpi): New member: flags. - (gcry_ac_data_search, gcry_ac_data_add): Removed functions. - -2003-12-22 Werner Koch - - * primegen.c (is_prime): Release A2. - -2003-12-19 Werner Koch - - * md.c: Moved a couple of functions down below the data structure - definitions. - (struct gcry_md_context): New field ACTUAL_HANDLE_SIZE. - (md_open): Set it here. - (strcut gcry_md_list): New field ACTUAL_STRUCT_SIZE. - (md_enable): Set it here. - (md_close): Wipe the context memory. - secure memory. - * cipher.c (struct gcry_cipher_handle): New field ACTUAL_HANDLE_SIZE. - (gcry_cipher_open): Set it here. - (gcry_cipher_close): Use it to always wipe out the handle data. - - * ac.c (gcry_ac_open): Make sure HANDLE gets initialized even when - the function is not successful. - (gcry_ac_close): Allow a NULL handle. - (gcry_ac_key_destroy, gcry_ac_key_pair_destroy): Ditto. - (gcry_ac_key_get_grip): Return INV_OBJ on error. - - * primegen.c (prime_generate_internal): Fixed error code for - failed malloc. Replaced the !err if chain by gotos. - (gcry_prime_group_generator): Remove the extra sanity check. - - * md.c: Minor code and comment cleanups. - -2003-12-16 Werner Koch - - * primegen.c (gen_prime): Doc fix. Thanks to Newton Hammet. - -2003-12-11 Werner Koch - - * rndunix.c (slow_poll): Don't use #warning but #error. - - * rndegd.c: Changed indentation. - (my_make_filename): Removd the var_arg cruft becuase we - don't need it here. Changed caller.=20=20 - - * rndlinux.c: Changed indentation. - (open_device): Remove the superfluous stat call and clarify - comment. - - * rsa.c: Changed indentation. - (secret): Use the standard algorithm if p, q and u are not - available. - (rsa_blind, rsa_unblind): Renamed from _gcry_rsa_blind, - _gcry_rsa_unblind and moved more to the top. - - * md4.c: Changed indentation. Removed unnecessary casts. - * md5.c, rmd160.c, sha1.c, tiger.c: Ditto. - * rijndael.c, twofish.c: Ditto. - * serpent.c: Removed unnecessary casts. - * sha256.c, sha512.c: Ditto. - -2003-12-09 Werner Koch - - * dsa.c: Unified indentation style. - * elgamal.c: Ditto.=20 - * des.c (des_key_schedule): Code beautifications. - * blowfish.c: Changed indentation style. - * cast5.c (do_cast_setkey): Ditto. - - * pubkey.c (gcry_pk_encrypt): Replaced the chain of if(!err) tests - by straightforward gotos. Other cleanups. - (gcry_pk_decrypt): Ditto. - (gcry_pk_sign): Ditto. - (gcry_pk_verify): Ditto. - (gcry_pk_genkey): Ditto. Use strtoul instead of strtol. - (gcry_pk_ctl): Use GPG_ERR_INV_ARG to indicate bad arguments. - -2003-12-07 Werner Koch - - * pubkey.c (gcry_pk_register_default): Undef the helper macro. - (gcry_pk_map_name): Allow NULL for string. - (sexp_to_key): Use memcpy and not strncpy. Use gcry_free and not - free. - (sexp_to_sig): Ditto. - (sexp_to_enc): Ditto. Replaced the chain of if(!err) tests by - straightforward gotos. - -2003-12-05 Werner Koch - - * cipher.c: Documentation cleanups. - (gcry_cipher_mode_from_oid): Allow NULL for STRING. - -2003-12-03 Werner Koch - - * elgamal.c (sign, do_encrypt, gen_k): Make sure that a small K is - only used for encryption. - -2003-11-18 Werner Koch - - * random.h (rndw32_set_dll_name): Removed unused prototype. - - * Makefile.am (EXTRA_DIST): Added Manifest. - -2003-11-11 Werner Koch - - * Manifest: New. - -2003-11-04 Werner Koch - - * md.c (gcry_md_hash_buffer): Use shortcut for SHA1 - * sha1.c (_gcry_sha1_hash_buffer): New. - - * random.c: Reformatted most functions. - (mix_pool): Moved the failsafe_digest from global - scope to here. - (do_fast_random_poll): Use the generic fucntions even if a fast - gathering function has been used. - (read_pool): Detect a fork and retry. - (gcry_randomize, get_random_bytes): Don't distinguish anymore - between weak and strong random. - (gcry_create_nonce): New. - -2003-10-31 Werner Koch - - * rndw32.c (slow_gatherer_windowsNT): Use a plain buffer for the - disk performance values and not the W32 API structure. - - * dsa.c (verify): s/exp/ex/ due to shadowing of a builtin. - * elgamal.c (verify): Ditto. - - * ac.c (gcry_ac_data_get_index): s/index/idx/ - (gcry_ac_data_copy_internal): Remove the cast in _gcry_malloc. - (gcry_ac_data_add): Must use gcry_realloc instead of realloc. - * pubkey.c (sexp_elements_extract): s/index/idx/ as tribute to the - forehackers. - (gcry_pk_encrypt): Removed shadowed definition of I. Reordered - arguments to malloc for clarity. - (gcry_pk_sign, gcry_pk_genkey): Ditto. - * primegen.c (prime_generate_internal): s/random/randomlevel/. - -2003-10-27 Moritz Schulte - - * pubkey.c (gcry_pk_encrypt): Don't forget to deallocate pkey. - -2003-10-27 Werner Koch - - * random.c (gcry_random_add_bytes): Return if buflen is zero to - avoid gcc warning about unsed parameter. - (MASK_LEVEL): Simplified; does now work for signed and unsigned - w/o warnings. - - * md.c (md_start_debug): Removed the const from SUFFIX, because - this function is called from the control fucntion which does not - require const. - - Prefixed all (pubkey,digest,cipher}_spec_* globale variables with - _gcry_. - - * ac.c (ac_key_identifiers): Made static. - - * random.c (getfnc_gather_random,getfnc_fast_random_poll): Move - prototypes to .. - * rand-internal.h: .. here=20 - * random.c (getfnc_gather_random): Include rndw32 gatherer. - * rndunix.c, rndw32.c, rndegd.c: Include them here. - * rndlinux.c (_gcry_rndlinux_gather_random): Prepend the _gcry_ - prefix. Changed all callers. - * rndegd.c (_gcry_rndegd_gather_random): Likewise. - (_gcry_rndegd_connect_socket): Likewise. - * rndunix.c (_gcry_rndunix_gather_random): Likewise. - (waitpid): Made static. - * rndw32.c: Removed the old and unused winseed.dll cruft. - (_gcry_rndw32_gather_random_fast): Renamed from - gather_random_fast. - (_gcry_rndw32_gather_random): Renamed from gather_random. Note, - that the changes 2003-04-08 somehow got lost. - - * sha512.c (sha512_init, sha384_init): Made static. - - * cipher.c (do_ctr_decrypt): Removed "return" from this void - function. - -2003-10-24 Moritz Schulte - - * serpent.c: Fix an issue on big-endian systems. - - * rndw32.c: Removed IS_MODULE -cruft. - * rndlinux.c (rndlinux_gather_random): Likewise. - -2003-10-10 Werner Koch - - * primegen.c (gen_prime): Bail out if NBITS is less than 16. - (prime_generate_internal): Initialize prime variable to suppress - compiler warning. Check pbits, initialize qbits when passed as - zero. - - * primegen.c (prime_generate_internal): New arg - ALL_FACTORS. Changed all callers. - (gcry_prime_generate): Make the factors arg optional. Request - all_factors. Make sure PRIME is set to NULL even on error. - (gcry_prime_group_generator): New. - (gcry_prime_release_factors): New. - -2003-10-06 Werner Koch - - * primegen.c (gen_prime): Assert that NBITS is never zero, it - would cause a segv. - -2003-09-28 Moritz Schulte - - * ac.c: Include "cipher.h". - -2003-09-27 Moritz Schulte - - * rndegd.c (do_read): Return nread instead of nbytes; thanks to - Michael Caerwyn. - -2003-09-04 Werner Koch - - * pubkey.c (_gcry_pk_aliased_algo_name): New. - * ac.c (gcry_ac_open): Use it here. - - * Makefile.am (EXTRA_libcipher_la_SOURCES): Add serpent.c - -2003-09-02 Moritz Schulte - - * primegen.c (gcry_prime_check, gcry_prime_generate): New - functions. - (prime_generate_internal): New function, based on - _gcry_generate_elg_prime. - (_gcry_generate_elg_prime): Rewritten as a wrapper for - prime_generate_internal. - -2003-08-28 Werner Koch - - * pubkey.c (gcry_pk_encrypt): Don't include the flags list in the - return value. This does not make sense and breaks any programs - parsing the output strictly (e.g. current gpgsm). - (gcry_pk_encrypt): If aliases for the algorithm name exists, take - the first one instead of the regular name to adhere to SPKI - conventions. - (gcry_pk_genkey): Ditto. - (gcry_pk_sign): Ditto. Removed unused KEY_ALGO_NAME. - -2003-08-19 Moritz Schulte - - * cipher.c: Add support for Serpent - * serpent.c: New file. - -2003-08-10 Moritz Schulte - - * rsa.c (_gcry_rsa_blind, _gcry_rsa_unblind): Declare static. - -2003-08-09 Timo Schulz - - * random.c (getfnc_gather_random): Don't check NAME_OF_DEV_RANDOM - two times, but also the NAME_OF_DEV_URANDOM device. -=09 -2003-08-08 Moritz Schulte - - * pubkey.c (sexp_to_enc): Fixed extraction of S-Expression: do not - fail if no `flags' sub S-Expression is found. - -2003-07-27 Werner Koch - - * md.c (gcry_md_lookup_func_oid): Allow for empty OID lists. - -2003-07-23 Moritz Schulte - - * ac.c (gcry_ac_data_construct): New argument: include_flags, only - include `flags' S-expression, if include_flags is true. Adjust - callers. Thanks for triggering a bug caused by `flags' - sub-S-expression where they are not expected to Ralf Schneider. - -2003-07-21 Moritz Schulte - - * pubkey.c (gcry_pk_lookup_func_name): Use new member name - `aliases' instead of `sexp_names'. - - * ac.c (gcry_ac_key_data_get): New function. - - * cipher.c (gcry_cipher_lookup_func_name): Fix return value. - -2003-07-20 Moritz Schulte - - * blowfish.c: Adjusted for new gcry_cipher_spec_t structure. - * cast5.c: Likewise. - * twofish.c: Likewise. - * arcfour.c: Likewise. - * rijndael.c (rijndael_oids, rijndael192_oids, rijndael256_oids): - New variables, adjust for new gcry_cipher_spec_t structure. - * des.c (oids_tripledes): New variable, adjust for new - gcry_cipher_spec_t structure. - - * md.c (oid_table): Removed. - - * tiger.c (oid_spec_tiger): New variable. - (digest_spec_tiger): Adjusted for new gry_md_spec_t structure. - - * sha512.c (oid_spec_sha512): New variable. - (digest_spec_sha512): Adjusted for new gry_md_spec_t structure. - - * sha512.c (oid_spec_sha384): New variable. - (digest_spec_sha384): Adjusted for new gry_md_spec_t structure. - - * sha256.c (oid_spec_sha256): New variable. - (digest_spec_sha256): Adjusted for new gry_md_spec_t structure. - - * sha1.c (oid_spec_sha1): New variable. - (digest_spec_sha1): Adjusted for new gry_md_spec_t structure. - - * rmd160.c (oid_spec_rmd160): New variable. - (digest_spec_rnd160): Adjusted for new gry_md_spec_t structure. - - * md5.c (oid_spec_md5): New variable. - (digest_spec_md5): Adjusted for new gry_md_spec_t structure. - - * md4.c (oid_spec_md4): New variable. - (digest_spec_md4): Adjusted for new gry_md_spec_t structure. - - * crc.c (digest_spec_crc32, digest_spec_crc32_rfc1510, - digest_spec_crc32_rfc2440): Adjusted for new gry_md_spec_t - structure. - -2003-07-19 Moritz Schulte - - * md.c (gcry_md_lookup_func_oid): New function. - (search_oid): New function, copied from cipher.c. - (gcry_md_map_name): Adjust for new search_oid_interface. - - * cipher.c (oid_table): Removed table. - (gcry_cipher_lookup_func_oid): New function. - (search_oid): Rewritten to use the module functions. - (gcry_cipher_map_name): Adjust for new search_oid interface. - (gcry_cipher_mode_from_oid): Likewise. - -2003-07-18 Werner Koch - - * md.c (gcry_md_hash_buffer): Convert ERR to gpg_error_t in - gpg_strerror. - -2003-07-14 Moritz Schulte - - * cipher.c (gcry_cipher_lookup_func_name): Also check the cipher - name aliases, not just the primary name. - (gcry_cipher_map_name): Remove kludge for aliasing Rijndael to - AES. - - * arcfour.c, blowfish.c, cast5.c, des.c, twofish.c: Adjust cipher - specification structures. - - * rijndael.c (rijndael_names, rijndael192_names, - rijndael256_names): New variables, use them in the cipher - specifications. - - * rmd160test.c: Removed file. - - * ac.c, arcfour.c, blowfish.c, cast5.c, cipher.c, des.c, dsa.c, - elgamal.c, md.c, pubkey.c, random.c, rijndael.c, rsa.c, twofish.c: - Used gcry_err* wrappers for libgpg symbols. - - * primegen.c (gen_prime): Correct the order arguments to - extra_check. - -2003-07-12 Moritz Schulte - - * ac.c: Replaced all public occurences of gpg_error_t with - gcry_error_t. - * cipher.c: Likewise. - * md.c: Likewise. - * pubkey.c: Likewise. - * random.c: Likewise. - - * cipher.c: Added support for TWOFISH128. - -2003-07-08 Moritz Schulte - - * ac.c (gcry_ac_data_copy_internal): New function, based on - gcry_ac_data_copy. - (gcry_ac_data_copy): Made public, use gcry_ac_data_copy_internal. - (gcry_ac_key_init): Use gcry_ac_data_copy_internal. - -2003-07-07 Moritz Schulte - - * ac.c (gcry_ac_data_set): Only release old MPI value if it is - different from the new value. Bug reported by Simon Josefsson - . - - * pubkey.c (gcry_pk_list): New function. - * md.c (gcry_md_list): New function. - - * ac.c (gcry_ac_key_pair_generate): Fix calculation of format - string size. - -2003-07-05 Moritz Schulte - - * md.c: Named struct of digest_table `digest_table_entry'. - (digest_table_entry): New member: algorithm; filled in. - (digest_table_entry): Removed unused member: flags. - (gcry_md_register): New argument: algorithm_id, filled in. - (gcry_md_register_default): Used algorithm ID from module - structure. - (gcry_md_map_name): Likewise. - (md_enable): Likewise. - (md_read): Likewise. - (gcry_md_info): Likewise. - - * pubkey.c: Named truct for pubkey_table `pubkey_table_entry'. - (pubkey_table_entry): New member: algorithm; filled in. - (gcry_pk_register_default): Used algorithm ID from pubkey_table. - (gcry_pk_register): New argument: algorithm_id, filled in. - (gcry_pk_map_name): Used algorithm ID from module structure. - (gcry_pk_decrypt): Likewise. - (gcry_pk_encrypt): Likewise. - (gcry_pk_verify): Likewise. - (gcry_pk_sign): Likewise. - (gcry_pk_testkey): Likewise. - (gcry_pk_genkey): Likewise. - (gcry_pk_get_nbits): Likewise. - (sexp_to_key): Removed unused variable: algo. - (sexp_to_sig): Likewise. - - * cipher.c: Named struct for cipher_table `cipher_table_entry'. - (cipher_table_entry): New member: algorithm; filled in. - (gcry_cipher_register_default): Used algorithm ID from - cipher_table. - (gcry_cipher_register): New argument: algorithm_id, filled in. - (gcry_cipher_map_name): Used algorithm ID from module structure. - - * arcfour.c (cipher_spec_arcfour): Removed algorithm ID. - * blowfish.c (cipher_spec_blowfish): Likewise. - * cast5.c (cipher_spec_cast5): Likewise. - * crc.c (digest_spec_crc32): Likewise. - * crc.c (digest_spec_crc32_rfc1510): Likewise. - * crc.c (digest_spec_crc32_rfc2440): Likewise. - * des.c (cipher_spec_des): Likewise. - * des.c (cipher_spec_tripledes): Likewise. - * dsa.c (pubkey_spec_dsa): Likewise. - * elgamal.c (pubkey_spec_elg): Likewise. - * md4.c (digest_spec_md4): Likewise. - * md5.c (digest_spec_md5): Likewise. - * aes.c (cipher_spec_aes): Likewise. - * aes.c (cipher_spec_aes192): Likewise. - * aes.c (cipher_spec_aes256): Likewise. - * rsa.c (pubkey_spec_rsa): Likewise. - * sha1.c (digest_spec_sha1): Likewise. - * sha256.c (digest_spec_sha256): Likewise. - * sha512.c (digest_spec_sha512): Likewise. - * tiger.c (digest_spec_tiger): Likewise. - * twofish.c (cipher_spec_twofish): Likewise. - * twofish.c (cipher_spec_twofish128): Likewise. - - * Makefile.am (EXTRA_libcipher_la_SOURCES): Fix list of source - files; reported by Simon Josefsson . - - * pubkey.c: Replaced all occurences of `id' with `algorithm', - since `id' is a keyword in obj-c. - * md.c: Likewise. - * cipher.c: Likewise. - - * crc.c, md4.c, md5.c, rmd160.c, sha1.c, sha256.c, tiger.c: - Replaced all occurences of gcry_digest_spec_t with gcry_md_spec_t. - - * dsa.c, rsa.c, elgamal.c: Replaced all occurencens of - gcry_pubkey_spec_t with gcry_pk_spec_t. - - * md.c: Replaced all occurences of gcry_digest_spec_t with - gcry_md_spec_t. - (gcry_digest_register_default): Renamed to ... - (gcry_md_register_default): ... this; adjusted callers. - (gcry_digest_lookup_func_name): Renamed to ... - (gcry_md_lookup_func_name): ... this; adjusted callers. - (gcry_digest_lookup_name): Renamed to ... - (gcry_md_lookup_name): ... this; adjusted callers. - (gcry_digest_register): Renamed to ... - (gcry_md_register): ... this. - (gcry_digest_unregister): Renamed to ... - (gcry_md_unregister): ... this. - - * pubkey.c (gcry_pubkey_register): Renamed to ... - (gcry_pk_register): ... this. - (gcry_pubkey_unregister): Renamed to ... - (gcry_pk_unregister): ... this. - Replaced all occurences of gcry_pubkey_spec_t with gcry_pk_spec_t. - (gcry_pubkey_register_default): Renamed to ... - (gcry_pk_register_default): ... this; adjusted callers. - (gcry_pubkey_lookup_func_name): Renamed to ... - (gcry_pk_lookup_func_name): ... this; adjusted callers. - (gcry_pubkey_lookup_name): Renamed to ... - (gcry_pk_lookup_name): ... this; adjusted callers. - - * md.c (gcry_md_hash_buffer): Fix error checking. Thanks to Simon - Josefsson . - -2003-07-04 Moritz Schulte - - * cipher.c (gcry_cipher_list): New function. - -2003-07-01 Moritz Schulte - - * pubkey.c (sexp_to_sig): Accept a `flags' S-expression to be more - consistent with sexp_to_enc. - -2003-06-30 Moritz Schulte - - * Makefile.am (libcipher_la_SOURCES): Added: ac.c. - - * pubkey.c (_gcry_pk_module_lookup): New function. - (_gcry_pk_module_release): New function. - -2003-06-29 Moritz Schulte - - * ac.c: New file. - -2003-06-26 Werner Koch - - * md.c (gcry_md_hash_buffer): Trigger BUG correcly with new API. - -2003-06-19 Werner Koch - - * md.c (gcry_md_is_enabled): Fixed.=20 - -2003-06-18 Werner Koch - - * cipher.c (gcry_cipher_get_algo_keylen): New. - (gcry_cipher_get_algo_blklen): New. - -2003-06-18 Moritz Schulte - - * arcfour.c, cipher.c, blowfish.c, md.c, cast5.c, pubkey.c, crc.c, - des.c, dsa.c, elgamal.c, md4.c, md5.c, random.c, rijndael.c, - rmd160.c, rsa.c, sha1.c, sha256.c, sha512.c, tiger.c, twofish.c: - Replaced older types GcryDigestSpec, GcryCipherSpec and - GcryPubkeySpec with newer types: gcry_digest_spec_t, - gcry_cipher_spec_t and gcry_pubkey_spec_t. - - * md.c (gcry_digest_id_new): Removed function. - (gcry_digest_register): Removed code for generating a new module - ID. - - * pubkey.c (gcry_pubkey_id_new): Removed function. - (gcry_pubkey_register): Removed code for generating a new module - ID. - - * cipher.c, md.c, pubkey.c: Replace old type GcryModule with newer - one: gcry_module_t. - (gcry_cipher_id_new): Removed function. - (gcry_cipher_register): Removed code for generating a new module - ID. - - * cipher.c (gcry_cipher_register): Adjust call to - _gcry_module_add. - (gcry_cipher_register_default): Likewise. - * pubkey.c (gcry_pubkey_register_default): Likewise. - (gcry_pubkey_register): Likewise. - * md.c (gcry_digest_register_default): Likewise. - (gcry_digest_register): Likewise. - - * md.c (gcry_digest_lookup_func_id): Removed function. - (gcry_digest_lookup_id): Likewise. - (gcry_digest_id_new): Use _gcry_module_lookup_id instead of - gcry_digest_lookup_id. - (digest_algo_to_string): Likewise. - (check_digest_algo): Likewise. - (md_enable): Likewise. - (md_digest_length): Likewise. - (md_asn_oid): Likewise. - - * pubkey.c (gcry_pubkey_lookup_id): Removed function. - (gcry_pubkey_lookup_func_id): Likewise. - (gcry_pubkey_id_new): Use _gcry_module_lookup_id instead of - gcry_pubkey_id_new. - (gcry_pk_algo_name): Likewise. - (disable_pubkey_algo): Likewise. - (check_pubkey_algo): Likewise. - (pubkey_get_npkey): Likewise. - (pubkey_get_nskey): Likewise. - (pubkey_get_nsig): Likewise. - (pubkey_get_nenc): Likewise. - (pubkey_generate): Likewise. - (pubkey_check_secret_key): Likewise. - (pubkey_encrypt): Likewise. - (pubkey_decrypt): Likewise. - (pubkey_sign): Likewise. - (pubkey_verify): Likewise. - (gcry_pk_algo_info): Likewise. - - * cipher.c (gcry_cipher_lookup_func_id): Removed function. - (gcry_cipher_lookup_id): Likewise. - (cipher_algo_to_string): use _gcry_module_lookup_id instead of - gcry_cipher_lookup_id. - (disable_cipher_algo): Likewise. - (check_cipher_algo): Likewise. - (cipher_get_blocksize): Likewise. - (gcry_cipher_open): Likewise. - (gcry_cipher_id_new): Likewise. - -2003-06-17 Moritz Schulte - - * Makefile.am (GCRYPT_MODULES): Set to @GCRYPT_CIPHERS@, - @GCRYPT_PUBKEY_CIPHERS@, @GCRYPT_DIGESTS@ and @GCRYPT_RANDOM@. - (libcipher_la_DEPENDENCIES): Set to $(GCRYPT_MODULES). - (libcipher_la_LIBADD): Likewise. - (AM_CFLAGS): Added: @GPG_ERROR_CFLAGS@. - (EXTRA_libcipher_la_SOURCES): Added all conditional sources. - - * md.c (md_open): Use _gcry_fast_random_poll instead of - fast_random_poll. - * cipher.c (gcry_cipher_open): Likewise. - - * random.h (fast_random_poll): Removed macro. - - * blowfish.c, md4.c, md5.c, rmd160.c, sha1.c, sha256.c, sha512.c, - tiger.c: Use Autoconf's WORDS_BIGENDIAN instead of our own - BIG_ENDIAN_HOST. - -2003-06-16 Moritz Schulte - - * random.c (getfnc_gather_random): Do not special-case - USE_ALL_RANDOM_MODULES, make it the default. - - * dsa.c: Replace last occurences of old type names with newer - names (i.e. replace MPI with gcry_mpi_t). - * elgamal.c: Likewise. - * primegen.c: Likewise. - * pubkey.c: Likewise. - * rsa.c: Likewise. - -2003-06-14 Moritz Schulte - - * des.c (des_setkey): Add selftest check. - (tripledes_set3keys): Likewise. - (do_tripledes_setkey): Remove selftest check. - (do_des_setkey): Likewise. - -2003-06-11 Moritz Schulte - - * md.c (_gcry_md_init): New function. - * cipher.c (_gcry_cipher_init): New function. - * pubkey.c (_gcry_pk_init): New function. - -2003-06-13 Werner Koch - - * md.c (gcry_md_get_algo): Reverted to old API. This is a - convenience function anyway and error checking is not approriate. - (gcry_md_is_secure): New. - (gcry_md_is_enabled): New. - -2003-06-12 Werner Koch - - * cipher.c (gcry_cipher_open): Make sure HANDLE is set to NULL on - error. - -2003-06-11 Werner Koch - - * md.c (gcry_md_open): Make sure H receives either NULL or an - valid handle. - (gcry_md_copy): Swapped arguments so that it is more in lione with - md_open and most other API fucntions like memcpy (destination - comes first). Make sure HANDLE is set to NULL on error. -=09 - * rijndael.c (do_encrypt): Hack to force correct alignment. It - seems not to be not sufficient, though. We should rework this - fucntions and remove all these ugly casts. Let the compiler - optimize or have an assembler implementation. - -2003-06-09 Moritz Schulte - - * Makefile.am: Removed rules serpent, since that is not commited - yet. - -2003-06-08 Moritz Schulte - - * pubkey.c (gcry_pk_encrypt): Improve calculation for size of the - format string. - -2003-06-07 Moritz Schulte - - * arcfour.c, bithelp.h, blowfish.c, cast5.c, cipher.c, crc.c, - des.c, dsa.c, elgamal.c, md4.c, md5.c, md.c, primegen.c, pubkey.c, - rand-internal.h, random.c, random.h, rijndael.c, rmd160.c, - rmd160test.c, rmd.h, rndeged.c, rndlinux.c, rndunix.c, rndw32.c, - rsa.c, sha1.c, sha256.c, sha512.c, tiger.c, twofish.c: Edited all - preprocessor instructions to remove whitespace before the '#'. - This is not required by C89, but there are some compilers out - there that don't like it. Replaced any occurence of the now - deprecated type names with the new ones. -=09 -2003-06-04 Moritz Schulte - - * pubkey.c (gcry_pk_encrypt): Construct an arg_list and use - gcry_sexp_build_array instead of gcry_sexp_build. - (gcry_pk_sign): Likewise. - (gcry_pk_genkey): Likewise. - -2003-06-01 Moritz Schulte - - * dsa.c (_gcry_dsa_generate): Do not check wether the algorithm ID - does indeed belong to DSA. - (_gcry_dsa_sign): Likewise. - (_gcry_dsa_verify): Likewise. - (_gcry_dsa_get_nbits): Likewise. - - * elgamal.c (_gcry_elg_check_secret_key): Do not check wether the - algorithm ID does indeed belong to ElGamal. - (_gcry_elg_encrypt): Likewise. - (_gcry_elg_decrypt): Likewise. - (_gcry_elg_sign): Likewise. - (_gcry_elg_verify): Likewise. - (_gcry_elg_get_nbits): Likewise. - (_gcry_elg_generate): Likewise. - - * rsa.c (_gcry_rsa_generate): Do not check wether the algorithm ID - does indeed belong to RSA. - (_gcry_rsa_encrypt): Likewise. - (_gcry_rsa_decrypt): Likewise. - (_gcry_rsa_sign): Likewise. - (_gcry_rsa_verify): Likewise. - (_gcry_rsa_get_nbits): Likewise. - -2003-05-30 Moritz Schulte - - * md.c (md_get_algo): Return zero in case to algorithm is enabled. - - * md.c (gcry_md_info): Adjusted for new no-errno-API. - (md_final): Likewise. - (gcry_md_get_algo): Likewise. - * pubkey.c (gcry_pk_get_keygrip): Likewise. - (gcry_pk_ctl): Likewise. - (gcry_pk_algo_info): Likewise. - * des.c (selftest): Likewise. - -2003-05-29 Moritz Schulte - - * md.c (md_enable): Do not forget to release module on error. - (gcry_md_open): Adjusted for new no-errno-API. - (md_open): Likewise. - (md_copy): Likewise. - (gcry_md_copy): Likewise. - (gcry_md_setkey): Likewise. - (gcry_md_algo_info): Likewise. - - * cipher.c (gcry_cipher_open): Adjusted for new no-errno-API and - also fixed a locking bug. - (gcry_cipher_encrypt): Adjusted for new no-errno-API. - (gcry_cipher_decrypt): Likewise. - (gcry_cipher_ctl): Likewise. - (gcry_cipher_info): Likewise. - (gcry_cipher_algo_info): Likewise. - -2003-05-28 Moritz Schulte - - * md.c (md_enable): Adjusted for libgpg-error. - (gcry_md_enable): Likewise. - (gcry_digest_register_default): Likewise. - (gcry_digest_register): Likewise. - (check_digest_algo): Likewise. - (prepare_macpads): Likewise. - (gcry_md_setkey): Likewise. - (gcry_md_ctl): Likewise. - (gcry_md_get): Likewise. - (gcry_md_algo_info): Likewise. - (gcry_md_info): Likewise. - * dsa.c (_gcry_dsa_generate): Likewise. - (_gcry_dsa_check_secret_key): Likewise. - (_gcry_dsa_sign): Likewie. - (_gcry_dsa_verify): Likewise. - * twofish.c (do_twofish_setkey): Likewise. - (twofish_setkey): Likewise. - * cipher.c (gcry_cipher_register): Likewise. - -2003-05-25 Moritz Schulte - - * rijndael.c (do_setkey): Adjusted for libgpg-error. - (rijndael_setkey): Likewise. - * random.c (gcry_random_add_bytes): Likewise. - * elgamal.c (_gcry_elg_generate): Likewise. - (_gcry_elg_check_secret_key): Likewise. - (_gcry_elg_encrypt): Likewise. - (_gcry_elg_decrypt): Likewise. - (_gcry_elg_sign): Likewise. - (_gcry_elg_verify): Likewise. - * rsa.c (_gcry_rsa_generate): Likewise. - (_gcry_rsa_check_secret_key): Likewise. - (_gcry_rsa_encrypt): Likewise. - (_gcry_rsa_decrypt): Likewise. - (_gcry_rsa_sign): Likewise. - (_gcry_rsa_verify): Likewise. - * pubkey.c (dummy_generate, dummy_check_secret_key, dummy_encrypt, - dummy_decrypt, dummy_sign, dummy_verify): Likewise. - (gcry_pubkey_register): Likewise. - (check_pubkey_algo): Likewise. - (pubkey_generate): Likewise. - (pubkey_check_secret_key): Likewise. - (pubkey_encrypt): Likewise. - (pubkey_decrypt): Likewise. - (pubkey_sign): Likewise. - (pubkey_verify): Likewise. - (sexp_elements_extract): Likewise. - (sexp_to_key): Likewise. - (sexp_to_sig): Likewise. - (sexp_to_enc): Likewise. - (sexp_data_to_mpi): Likewise. - (gcry_pk_encrypt): Likewise. - (gcry_pk_decrypt): Likewise. - (gcry_pk_sign): Likewise. - (gcry_pk_verify): Likewise. - (gcry_pk_testkey): Likewise. - (gcry_pk_genkey): Likewise. - (gcry_pk_ctl): Likewise. - * cipher.c (dummy_setkey): Likewise. - (check_cipher_algo): Likewise. - (gcry_cipher_open): Likewise. - (cipher_setkey): Likewise. - (gcry_cipher_ctl): Likewise. - (cipher_encrypt): Likewise. - (gcry_cipher_encrypt): Likewise. - (cipher_decrypt): Likewise. - (gcry_cipher_decrypt): Likewise. - (gcry_cipher_info): Likewise. - (gcry_cipher_algo_info): Likewise. - * cast5.c (cast_setkey): Likewise. - (do_cast_setkey): Likewise. - * arcfour.c (arcfour_setkey): Likewise. - (do_arcfour_setkey): Likewise. - * blowfish.c (do_bf_setkey): Likewise. - (bf_setkey): Likewise. - * des.c (do_des_setkey): Likewise. - (do_tripledes_setkey): Likewise. - -2003-05-22 Moritz Schulte - - * tiger.c: Merged code ussing the U64_C macro from GnuPG. - - * sha512.c: Likewise. - -2003-05-17 Moritz Schulte - - * pubkey.c (gcry_pk_genkey): Fix type: acquire a lock, instead of - releasing it. - -2003-05-11 Moritz Schulte - - * pubkey.c (gcry_pk_testkey): Call REGISTER_DEFAULT_CIPHERS. - (gcry_pk_ctl): Likewise. - -2003-04-27 Moritz Schulte - - * pubkey.c (gcry_pk_genkey): Release sexp after extracted data has - been used. - - * md.c (gcry_md_get_algo_dlen): Simplified, simply call - md_digest_length to do the job. - - * des.c (do_des_setkey): Check for selftest failure not only - during initialization. - (do_tripledes_setkey): Include check for selftest failure. - - * pubkey.c (gcry_pubkey_register_default): New macro - `pubkey_use_dummy', use it. - - * elgamal.c (elg_names): New variable. - (pubkey_spec_elg): Include elg_names. - - * dsa.c (dsa_names): New variable. - (pubkey_spec_dsa): Include dsa_names. - - * rsa.c (rsa_names): New variable. - (pubkey_spec_rsa): Include rsa_names. - - * pubkey.c (gcry_pubkey_lookup_func_name): Compare name also with - the names listed in `sexp_names'. - -2003-04-24 Moritz Schulte - - * pubkey.c (sexp_to_key): New variables: module, pubkey. Adjusted - to new module interface. - (sexp_to_key): Changend type of argument `retalgo' from `int *' to - `GcryModule **'. Adjusted all callers. Removed argument: - r_algotblidx. - (sexp_to_sig): Changend type of argument `retalgo' from `int *' to - `GcryModule **'. Adjusted all callers. - (sexp_to_enc): Likewise. - - (pubkey_get_npkey, pubkey_get_nskey, pubkey_get_nsig, - pubkey_get_nenc): Use strlen to find out the number. - - * rsa.c: Adjust pubkey_spec_rsa to new internal interface. - * dsa.c: Likewise. - * elgamal.c: Likewise. - -2003-04-17 Moritz Schulte - - * pubkey.c (sexp_elements_extract): New function. - * pubkey.c (sexp_to_key): Removed variable `idx', added `err', use - sexp_elements_extract. - (sexp_to_sig): Likewise. - (sexp_to_enc): Likewise. - - * pubkey.c: Terminate list correctly. - * md.c: Include sha512/sha384 in digest_table. - -2003-04-16 Moritz Schulte - - * Makefile.am: Include support for sha512.c. - - * sha512.c: New file, merged from GnuPG, with few modifications - for libgcrypt. - - * rand-internal.h: Removed declarations for constructor functions. - - * md.c (md_copy): Call _gcry_module_use for incrementing the usage - counter of the digest modules. - - * rsa.c: Do not include "rsa.h". - * dsa.c: Do not include "dsa.h". - * elgamal.c: Do not include "elgamal.h". - * des.c: Do not include "des.h". - * cast5.c: Do not include "cast5.h". - * blowfish.c: Do not include "blowfish.h". - * arcfour.c: Do not include "arcfour.h". - - * Makefile.am (libcipher_la_DEPENDENCIES): Removed. - (libcipher_la_LIBADD): Removed. - Use Automake conditionals for conditional compilation. - -2003-04-13 Moritz Schulte - - * cipher.c (gcry_cipher_open): Call REGISTER_DEFAULT_CIPHERS. - - * md.c (gcry_md_list): New member: module. - (md_enable): New variable: module, changed use of module and - digest. - (md_enable): Initialize member: module. - (md_close): Call _gcry_module_release. - - * cipher.c (gcry_cipher_open): New variable: module, changed use of - module and cipher. - (struct gcry_cipher_handle): New member: module. - (gcry_cipher_open): Initialize member: module. - (gcry_cipher_close): Call _gcry_module_release. - -2003-04-09 Moritz Schulte -=09 - * cipher.c: Include "ath.h". - * md.c: Likewise. - * pubkey.c: Likewise. - - * cipher.c (ciphers_registered_lock): New variable. - * md.c (digests_registered_lock): New variable. - * pubkey.c (pubkeys_registered_lock): New variable. - - * rndlinux.c (gnupgext_version, func_table): Removed definitions. - (gnupgext_enum_func): Removed function. - (_gcry_rndlinux_constructor): Removed function. - - * rndegd.c (gnupgext_version, func_table): Removed definitions. - (gnupgext_enum_func): Removed function. - (_gcry_rndegd_constructor): Removed function. - - * rndunix.c (gnupgext_version, func_table): Removed definitions. - (gnupgext_enum_func): Removed function. - (_gcry_rndunix_constructor): Removed function. - - * rndw32.c (gnupgext_version, func_table): Removed definitions. - (gnupgext_enum_func): Removed function. - (_gcry_rndw32_constructor): Removed function. - - * rndegd.c (rndegd_connect_socket): Simplify code for creating the - egd socket address. - (rndegd_connect_socket): Call log_fatal use instead of - g10_log_fatal. - (egd_gather_random): Renamed to ... - (rndegd_gather_random): ... here. - -2003-04-08 Moritz Schulte - - * rndlinux.c: Do not include "dynload.h". - * rndunix.c: Likewise. - * rndw32.c: Likewise. - - * rndegd.c (rndegd_connect_socket): Factored out from ... - (egd_gather_random): here; call it. - (egd_socket): New variable. - (egd_gather_random): Initialize fd with egd_socket, do not declare - fd static. - (do_read): Merged few changes from GnuPG. FIXME - not finished? - Do not include "dynload.h". - - * rndw32.c (gather_random): Renamed to rndw32_gather_random, do - not declare static. - (gather_random_fast): Renamed to rndw32_gather_random_fast, do not - declare static. - - * rndunix.c (gather_random): Renamed to rndunix_gather_random, do - not declare static. - * rndegd.c (gather_random): Renamed to rndegd_gather_random, do - not declare static. - * rndlinux.c (gather_random): Renamed to rndlinux_gather_random, - do not declare static. - -2003-04-07 Moritz Schulte - - * Makefile.am (libcipher_la_SOURCES): Removed construct.c. - (libcipher_la_SOURCES): Added sha1.c, sha256.c, rmd160.c, md4.c, - md5.c, tiger.c and crc.c - (EXTRA_PROGRAMS): Removed sha1, sha256, rmd160, md4, md5, tiger - and crc. Removed definitions: EXTRA_md4_SOURCES, - EXTRA_md5_SOURCES, EXTRA_rmd160_SOURCES, EXTRA_sha1_SOURCES, - EXTRA_sha256_SOURCES, EXTRA_tiger_SOURCES and EXTRA_crc_SOURCES, - BUILT_SOURCES, DISTCLEANFILES. - - * pubkey.c: Do not include "elgamal.h", "dsa.h" and "rsa.h". - - * Makefile.am (libcipher_la_SOURCES): Removed rsa.h, elgamal.h, - dsa.h, des.h, cast5.h, arcfour.h and blowfish.h. - - * rsa.h: Removed file. - * elgamal.h: Removed file. - * dsa.h: Removed file. - * des.h: Removed file. - * cast5.h: Removed file. - * arcfour.h: Removed file. - * blowfish.h: Removed file. - - * Makefile.am (libcipher_la_SOURCES): Removed dynload.c and - dynload.h. - - * rsa.c (pubkey_spec_rsa): New variable. - * dsa.c (pubkey_spec_rsa): New variable. - * elgamal.c (pubkey_spec_elg): New variable. -=09 - * rsa.c (_gcry_rsa_get_info): Removed function. - * elgamal.c (_gcry_elg_get_info): Removed function. - * dsa.c (_gcry_dsa_get_info): Removed function. - - * tiger.c (tiger_get_info): Removed function. - (gnupgext_version, func_table): Removed definitions. - (gnupgext_enum_func): Removed function. - (_gcry_tiger_constructor): Removed function. -=09 - * sha1.c (sha1_get_info): Removed function. - (gnupgext_version, func_table): Removed definitions. - (gnupgext_enum_func): Removed function. - (_gcry_sha1_constructor): Removed function. - - * sha256.c (sha256_get_info): Removed function. - (gnupgext_version, func_table): Removed definitions. - (gnupgext_enum_func): Removed function. - (_gcry_sha256_constructor): Removed function. - - * rmd160.c (rmd160_get_info): Removed function. - (gnupgext_version, func_table): Removed definitions. - (gnupgext_enum_func): Removed function. - (_gcry_rmd160_constructor): Removed function. - - * md5.c (md5_get_info): Removed function. - (gnupgext_version, func_table): Removed definitions. - (gnupgext_enum_func): Removed function. - (_gcry_md5_constructor): Removed function. - - * md4.c (md4_get_info): Removed function. - (gnupgext_version, func_table): Removed definitions. - (gnupgext_enum_func): Removed function. - (_gcry_md4_constructor): Removed function. - - * crc.c (crc_get_info): Removed function. - - * arcfour.c (do_arcfour_setkey): Changed type of context argument - to `void *', added local variable for cast, adjusted callers. - (arcfour_setkey): Likewise. - (encrypt_stream): Likewise. - * cast5.c (cast_setkey): Likewise. - (encrypt_block): Likewise. - * rijndael.c (rijndael_setkey): Likewise. - (rijndael_encrypt): Likewise. - (rijndael_decrypt): Likewise. - * twofish.c (twofish_setkey): Likewise. - (twofish_encrypt): Likewise. - (twofish_decrypt): Likewise. - * des.c (do_des_setkey): Likewise. - (do_des_encrypt): Likewise. - (do_des_encrypt): Likewise. - (do_tripledes_encrypt): Likewise. - (do_tripledes_encrypt): Likewise. - * blowfish.c (bf_setkey: Likewise. - (encrypt_block): Likewise. - (decrypt_block): Likewise. -=09 - * arcfour.c (encrypt_stream): Likewise. - - * rijndael.c (gnupgext_version, func_table): Removed definitions. - (gnupgext_enum_func) Removed function.=09 -=09 - * twofish.c (gnupgext_version, func_table): Removed definitions. - (gnupgext_enum_func) Removed function.=09 - - * cast5.c (CIPHER_ALGO_CAST5): Removed. - - * blowfish.c (FNCCAST_SETKEY, FNCCAST_CRYPT): Removed macros. - (CIPHER_ALGO_BLOWFISH): Removed symbol. - * cast5.c (FNCCAST_SETKEY, FNCCAST_CRYPT): Likewise. - * des.c (selftest_failed): Removed. - (initialized): New variable. - (do_des_setkey): Run selftest, if not yet done. - (FNCCAST_SETKEY, FNCCAST_CRYPT): Removed macros. - - * arcfour.c (_gcry_arcfour_get_info): Removed function. - * blowfish.c (_gcry_blowfish_get_info): Removed function. - * cast5.c (_gcry_cast5_get_info): Removed function. - * des.c (_gcry_des_get_info): Removed function. - * rijndael.c (_gcry_rijndael_get_info): Removed function. - * twofish.c (_gcry_twofish_get_info): Removed function. - - * arcfour.c (cipher_spec_arcfour): New variable. - * twofish.c (cipher_spec_twofish, cipher_spec_twofish128): New - variables. - * rijndael.c (cipher_spec_aes, cipher_spec_aes192, - cipher_spec256): New variables. - * des.c (cipher_spec_des, cipher_spec_tripledes): New variables. - * cast5.c (cipher_spec_cast5): New variable. - * blowfish.c (cipher_spec_blowfish): Likewise. -=09 - * twofish.c: Do not include "dynload.h". - * rijndael.c: Likewise. - * des.c: Likewise. - * cast5.c: Likewise. - * blowfish.c: Likewise. - * cipher.c: Likewise. - * crc.c: Likewise. - * md4.c: Likewise. - * md5.c: Likewise. - * md.c: Likewise. - * pubkey.c: Likewise. - * rijndael.c: Likewise. - * sha1.c: Likewise. - * sha256.c: Likewise. - - * arcfour.c: Include "cipher.h". - * twofish.c: Likewise. - * rijndael.c: Likewise. - * des.c: Likewise. - * cast5.c: Likewise. - * blowfish.c: Likewise. - - * twofish.c (twofish_setkey): Declared argument `key' const. - (twofish_encrypt): Declared argument `inbuf' const. - (twofish_decrypt): Likewise. - - * rijndael.c (rijndael_setkey): Declared argument `key' const. - (rijndael_encrypt): Declared argument `inbuf' const. - (rijndael_decrypt): Likewise. - - * des.c (do_des_setkey): Declared argument `key' const. - (do_tripledes_setkey): Likewise. - (do_des_encrypt): Declared argument `inbuf' const. - (do_des_decrypt): Likewise. - (do_tripledes_encrypt): Likewise. - (do_tripledes_decrypt): Likewise. - - * cast5.c (encrypt_block): Declared argument `inbuf' const. - (decrypt_block): Likewise. - (cast_setkey): Declared argument `key' const. - - * blowfish.c (do_bf_setkey): Declared argument `key' const. - (encrypt_block): Declared argument `inbuf' const. - (encrypt_block): Likewise. - -=09 - - * cipher.c: Remove CIPHER_ALGO_DUMMY related code. - Removed struct cipher_table_s. - Changed definition of cipher_table. - Removed definition of disabled_algos. - (ciphers_registered, default_ciphers_registered): New variables. - (REGISTER_DEFAULT_CIPHERS): New macro. - (dummy_setkey): Declared argument `key' const. - (dummy_encrypt_block): Declared argument `inbuf' const. - (dummy_encrypt_block): Likewise. - (dummy_encrypt_stream): Likewise. - (dummy_encrypt_stream): Likewise. - (dummy_setkey): Use `unsigned char' instead of `byte'. - (dummy_encrypt_block): Likewise. - (dummy_decrypt_block): Likewise. - (dummy_encrypt_stream): Likewise. - (dummy_decrypt_stream): Likewise. - (gcry_cipher_register_default): New function. - (gcry_cipher_lookup_func_id): New function. - (gcry_cipher_lookup_func_name): New function. - (gcry_cipher_lookup_id): New function. - (gcry_cipher_lookup_name): New function. - (gcry_cipher_id_new): New function. - (gcry_cipher_register): New function. - (gcry_cipher_unregister): New function. - (setup_cipher_table): Removed function. - (load_cipher_modules): Removed function. - (gcry_cipher_map_name): Adjusted to use new module management. - (cipher_algo_to_string): Likewise. - (disable_cipher_algo): Likewise. - (check_cipher_algo): Likewise. - (cipher_get_keylen): Likewise. - (cipher_get_blocksize): Likewise. - (gcry_cipher_open): Likewise. - (struct gcry_cipher_handle): Replaced members algo, algo_index, - blocksize, setkey, encrypt, decrypt, stencrypt, stdecrypt with one - member: cipher. - (gcry_cipher_open): Adjusted code for new handle structure. - (cipher_setkey): Likewise. - (cipher_setiv): Likewise. - (cipher_reset): Likewise. - (do_ecb_encrypt): Likewise. - (do_ecb_decrypt): Likewise. - (do_cbc_encrypt): Likewise. - (do_cbc_decrypt): Likewise. - (do_cfb_encrypt): Likewise. - (do_cfb_decrypt): Likewise. - (do_ctr_encrypt): Likewise. - (cipher_encrypt): Likewise. - (gcry_cipher_encrypt): Likewise. - (cipher_decrypt): Likewise. - (gcry_cipher_decrypt): Likewise. - (cipher_sync): Likewise. - (gcry_cipher_ctl): Likewise. - - * pubkey.c: Removed struct pubkey_table_s. - Changed definition of pubkey_table. - Removed definition of disabled_algos. - (pubkeys_registered, default_pubkeys_registered): New variables. - (REGISTER_DEFAULT_PUBKEYS): New macro. - (setup_pubkey_table): Removed function. - (load_pubkey_modules): Removed function. - (gcry_pubkey_register_default): New function. - (gcry_pubkey_lookup_func_id): New function. - (gcry_pubkey_lookup_func_name): New function. - (gcry_pubkey_lookup_id): New function. - (gcry_pubkey_lookup_name): New function. - (gcry_pubkey_id_new): New function. - (gcry_pubkey_register): New function. - (gcry_pubkey_unregister): New function. - (gcry_pk_map_name): Adjusted to use new module management. - (gcry_pk_algo_name): Likewise. - (disable_pubkey_algo): Likewise. - (check_pubkey_algo): Likewise. - (pubkey_get_npkey): Likewise. - (pubkey_get_nskey): Likewise. - (pubkey_get_nsig): Likewise. - (pubkey_get_nenc): Likewise. - (pubkey_generate): Likewise. - (pubkey_check_secret_key): Likewise. - (pubkey_encrypt): Likewise. - (pubkey_decrypt): Likewise. - (pubkey_sign): Likewise. - (pubkey_verify): Likewise. - (gcry_pk_get_nbits): Likewise. - (gcry_pk_algo_info): Likewise. - - * md.c: Removed struct md_digest_list_s. - (digest_list): Changed definition. - (digests_registered, default_digests_registered): New variables. - (REGISTER_DEFAULT_DIGESTS): New macro. - (new_list_item): Removed function. - (setup_md_table): Removed function. - (load_digest_module): Removed function. - (gcry_digest_register_default): New function. - (gcry_digest_lookup_func_id): New function. - (gcry_digest_lookup_func_name): New function. - (gcry_digest_lookup_id): New function. - (gcry_digest_lookup_name): New function. - (gcry_digest_id_new): New function. - (gcry_digest_register): New function. - (gcry_digest_unregister): New function. - (GcryDigestEntry): New type. - (struct gcry_md_context): Adjusted type of `list'. - (gcry_md_map_name): Adjusted to use new module management. - (digest_algo_to_string): Likewise. - (check_digest_algo): Likewise. - (md_enable): Likewise. - (md_digest_length): Likewise. - (md_asn_oid): Likewise. - -2003-04-07 Moritz Schulte - - * pubkey.c: Replaced PUBKEY_ALGO_DSA with GCRY_PK_DSA, - PUBKEY_ALGO_RSA with GCRY_PK_RSA and PUBKEY_ALGO_ELGAMAL with - GCRY_PK_ELG. - - * dsa.c: Replaced PUBKEY_ALGO_DSA with GCRY_PK_DSA. - -2003-04-01 Moritz Schulte - - * des.c: Removed checks for GCRY_CIPHER_3DES and GCRY_CIPHER_DES. - -2003-03-31 Moritz Schulte - - * tiger.c (tiger_get_info): Do not declare static. - * sha256.c (sha256_get_info): Likewise. - * sha1.c (sha1_get_info): Likewise. - * rmd160.c (rmd160_get_info): Likewise. - * md5.c (md5_get_info): Likewise. - * md4.c (md4_get_info): Likewise. - * crc.c (crc_get_info): Likewise. - - * md.c (load_digest_module): Call setup_md_table during - initialization. - (new_list_item): Link new element into digest_list. - - * cipher.c (do_ctr_decrypt): Made do_ctr_encrypt act as a wrapper - for do_ctr_encrypt, since these functions are identical. - -2003-03-30 Simon Josefsson - - * cipher.c (struct gcry_cipher_handle): Add counter field. - (gcry_cipher_open): Add CTR. - (cipher_reset): Clear counter field. - (do_ctr_encrypt, do_ctr_decrypt): New functions. - (cipher_encrypt, cipher_decrypt): Call CTR functions. - (gcry_cipher_ctl): Add SET_CTR to set counter. - -2003-03-30 Moritz Schulte - - * rsa.c (_gcry_rsa_blind): New function. - (_gcry_rsa_unblind): New function. - (_gcry_rsa_decrypt): Use _gcry_rsa_blind and _gcry_rsa_decrypt. - -2003-03-26 Moritz Schulte - - * dynload.c (_gcry_enum_gnupgext_pubkeys): Adjust `encrypt' and - `decrypt' function arguments. - (_gcry_enum_gnupgext_pubkeys): Likewise. - * dynload.h: Likewise. -=09 - * pubkey.c (dummy_decrypt): Add argument: int flags. - (dummy_encrypt): Likewise. - - * elgamal.c (_gcry_elg_encrypt): Add argument: int flags. - (_gcry_elg_decrypt): Likewise. - - * rsa.c (_gcry_rsa_encrypt): Add argument: int flags. - (_gcry_rsa_decrypt): Likewise. - - * pubkey.c: Add `flags' argument to members `encrypt' and - `decrypt' of struct `pubkey_table_s'. - - * rsa.h: Add `flags' argument to function declarations. - * elgamal.h: Likewise. - - * pubkey.c (sexp_data_to_mpi): New variable: int parsed_flags. - (sexp_data_to_mpi): Set `parsed_flags'. - (sexp_data_to_mpi): New argument: int *flags. - (gcry_pk_encrypt): New variable: int flags. - (gcry_pk_encrypt): Pass `flags' to pubkey_encrypt. - (pubkey_encrypt): New variable: int flags. - (pubkey_encrypt): Pass `flags' to pubkey encrypt function. - (pubkey_decrypt): Likewise. - (pubkey_decrypt): Pass `flags' to pubkey encrypt function. - (gcry_pk_encrypt): Include `flags' s-exp in return list. - (sexp_to_enc): New argument: int *flags. - (gcry_pk_decrypt): New variable: int flags. - (gcry_pk_decrypt): Pass `flags' to pubkey_decrypt. - (sexp_to_enc): New variable: int parsed_flags. - (sexp_to_enc): Set `parsed_flags'. - -2003-03-22 Simon Josefsson - - * cipher.c (gcry_cipher_open, do_cbc_encrypt) - (gcry_cipher_encrypt): Support GCRY_CIPHER_CBC_MAC. - (gcry_cipher_ctl): Support GCRYCTL_SET_CBC_MAC. - -2003-03-19 Werner Koch - - * primegen.c (gen_prime): New args EXTRA_CHECK and EXTRA_CHECK_ARG - to allow for a user callback. Changed all callers. - (_gcry_generate_secret_prime) - (_gcry_generate_public_prime): Ditto, pass them to gen_prime. - * rsa.c (check_exponent): New. - (generate): Use a callback to ensure that a given exponent is - actually generated. - -2003-03-12 Moritz Schulte - - * primegen.c: Initialize `no_of_small_prime_numbers' statically. - (gen_prime): Remove calculation of `no_of_small_prime_numbers'. - -2003-03-03 Moritz Schulte - - * md.c (gcry_md_ctl): Rewritten to use same style like the other - functions dispatchers. - -2003-03-02 Moritz Schulte - - * cipher.c (struct gcry_cipher_handle): New member: algo_index. - (gcry_cipher_open): Allocate memory for two cipher contexts. - Initialize algo_index. - (cipher_setkey): Duplicate context into reserved memory. - (cipher_reset): New function, which resets the context and clear - the IV. - (gcry_cipher_ctl): Call cipher_reset. - -2003-02-23 Moritz Schulte - - * cipher.c: Remove (bogus) `digitp' macro definition. - * md.c: Likewise. - - * blowfish.c (burn_stack): Removed. - * arcfour.c (burn_stack): Likewise. - * cast5.c (burn_stack): Likewise. - * des.c (burn_stack): Likewise. - * md4.c (burn_stack): Likewise. - * md5.c (burn_stack): Likewise. - * random.c (burn_stack): Likewise. - * rijndael.c (burn_stack): Likewise. - * rmd160.c (burn_stack): Likewise. - * sha1.c (burn_stack): Likewise. - * sha256.c (burn_stack): Likewise. - * tiger.c (burn_stack): Likewise. - * twofish.c (burn_stack): Likewise. - - * blowfish.c: Changed all occurences of burn_stack to - _gcry_burn_stack. - * arcfour.c: Likewise. - * cast5.c: Likewise. - * des.c: Likewise. - * md4.c: Likewise. - * md5.c: Likewise. - * random.c: Likewise. - * rijndael.c: Likewise. - * rmd160.c: Likewise. - * sha1.c: Likewise. - * sha256.c: Likewise. - * tiger.c: Likewise. - * twofish.c: Likewise. - - * arcfour.c (_gcry_arcfour_get_info): Use GCRY_CIPHER_ARCFOUR - instead of hard-coded value `301'. - -2003-01-24 Werner Koch - - * random.c (_gcry_register_random_progress): New. - (_gcry_random_progress): New. - - * rndlinux.c (gather_random): Call the random progress function.=20 - -2003-01-23 Werner Koch - - * rsa.c (generate): New arg USE_E to request a specific public - exponent. - (_gcry_rsa_generate): Ditto. - * elgamal.c (_gcry_elg_generate): Must add an dummy argument - instead of USE_E. - * dsa.c (_gcry_dsa_generate): Ditto. - * pubkey.c (dummy_generate): Ditto. - (pubkey_generate): Add USE_E arg and pass it down. - (gcry_pk_genkey): Detect "rsa-use-e" parameter and pass it to generate. - - * pubkey.c (sexp_to_enc): New arg RET_MODERN. - (gcry_pk_decrypt): Make use of it to return a real S-expression. - Return better error codes. - (gcry_pk_verify): Return better error codes. - -2003-01-21 Werner Koch - - * random.c (gcry_random_add_bytes): Add QUALITY argument, let - function return an error code and disable its core for now. - -2003-01-21 Timo Schulz - - * random.c (gcry_random_add_bytes): New. Function to add external - random to the pool. -=09 -2003-01-20 Simon Josefsson - - * crc.c: New. - * Makefile.am (EXTRA_PROGRAMS, EXTRA_crc_SOURCES): Add crc.c. - * md.c (gcry_md_get_algo_dlen): Add values for CRC. - -2003-01-20 Werner Koch - - * sha256.c: New. - * bithelp.h (ror): New. - * Makfile.am: Add sha256.c. - * md.c (oid_table): Add values for SHA256 et al. - (gcry_md_get_algo_dlen): Likewise - -2003-01-20 Werner Koch - - * pubkey.c (gcry_pk_get_keygrip): Implemented keygrips for DSA - and ElGamal. - -2003-01-17 Werner Koch - - * cipher.c (gcry_cipher_encrypt): Reworked so that the output will - never contain the plaintext even if the caller did not checked the - return value. - - * md.c (gcry_md_get_algo): Changed error code to GCRYERR_GENERAL - because we don't have an invalid md algo but no algorithm enabled. - - * pubkey.c (gcry_pk_genkey): Changed error code for bounds check - of table parameters to GCRYERR_INTERNAL. - - * md.c (gcry_md_open): Partly reverted Timo's change from - 2002-10-10 by removing the check for the algorithm. An algorithm - of 0 is allowed and anyway we should not double check it or check - it using a different function. Also fixed the flags check. - - * pubkey.c (gcry_pk_encrypt): Make sure that R_CIPH points to NULL - on error. - (gcry_pk_decrypt): Ditto for R_PLAIN. - (gcry_pk_sign): Ditto for R_SIG. - (gcry_pk_genkey): Ditto for R_KEY. - -2003-01-16 Werner Koch - - * md.c (gcry_md_write): Changed 2nd argument type to void*. - (gcry_md_hash_buffer): Changed type of boths buffers to void*. - (gcry_md_setkey): Changed 2nd argument type to void*. - -2003-01-15 Werner Koch - - * pubkey.c (sexp_data_to_mpi): New. This handles pkcs1 padding. - (gcry_pk_sign, gcry_pk_verify): Use it here. - (gcry_pk_encrypt): And here. - (pubkey_verify): Add debug code. - (sexp_to_enc): Handle flags in the input and return the pkcs1 flag - in a new parameter. - (gcry_pk_decrypt): Prepare for future pkcs1 handling. - -2002-12-19 Werner Koch - - * random.c (_gcry_random_initialize): New. - -2002-12-16 Werner Koch - - * cipher.c: Added a Teletrust specific OID for 3DES. - -2002-12-12 Werner Koch - - * md.c: Added another oddball OIW OID (sha-1WithRSAEncryption). - -2002-11-23 Werner Koch - - * md.c (load_digest_module): Enlarged checked_algos bitmap. - * md4.c (func_table): Fixed entry for md4.=20 - Both by Simon Josephson. - (transform): Copy data to get the alignment straight. Tested only - on i386. - -2002-11-10 Simon Josefsson - - * cipher.c (gcry_cipher_open): Don't reject CTS flag. - (do_cbc_encrypt, do_cbc_decrypt, cipher_encrypt)=20 - (gcry_cipher_encrypt, cipher_decrypt) - (gcry_cipher_decrypt): Support CTS flag. - (gcry_cipher_ctl): Toggle CTS flag. - -2002-11-10 Werner Koch - - * md4.c: New. By Simon Josefsson. - * Makefile.am (EXTRA_PROGRAMS): Add md4.c.=20 - * md.c (oid_table,gcry_md_get_algo_dlen): MD4 support.=20 - -2002-10-14 Werner Koch - - * arcfour.c (do_encrypt_stream): Don't use increment op when - assigning to the same variable. - -2002-10-10 Timo Schulz - - * pubkey.c (gcry_pk_genkey): Check boundaries. -=09 - * md.c (gcry_md_open): Check that algo is available and only - valid flag values are used. - (gcry_md_get_algo): Add error handling. -=09 -2002-09-26 Werner Koch - - * md.c: Include an OID for TIGER. - * tiger.c (tiger_get_info): Use a regular OID. - -2002-09-17 Werner Koch - - * random.c: Replaced mutex.h by the new ath.h. Changed all calls. - -2002-09-16 Werner Koch - - * arcfour.c (do_encrypt_stream): Use register modifier and modulo. - According to Nikos Mavroyanopoulos this increases perfromace on - i386 system noticable. And I always tought gcc is clever enough. - * md5.c (transform): Use register modifier. - * rmd160.c (transform): Ditto. - * sha1.c (transform): Ditto. We hope that there are 6 free registers. - * random.c (gcry_randomize): Rewrote to avoid malloc calls. - - * rndlinux.c (gather_random): Replaced remaining fprintfs by log_*. - * arcfour.c (do_arcfour_setkey): Ditto. - * twofish.c (do_twofish_setkey): Ditto. - * rndegd.c (gather_random): Ditto. - * rijndael.c (do_setkey): Ditto. - * random.c (_gcry_random_dump_stats): Ditto.=20 - * primegen.c (_gcry_generate_elg_prime): Ditto. - * des.c (_gcry_des_get_info): Ditto. - * cast5.c (do_cast_setkey): Ditto. - * blowfish.c (do_bf_setkey): Ditto. - -2002-08-26 Werner Koch - - * des.c (weak_keys): Fixed one entry in the table and compared - all entries against the literature. - (selftest): Checksum the weak key table. - -2002-08-21 Werner Koch - - * pubkey.c: Enable keygrip calculation for "openpgp-rsa". - -2002-08-17 Werner Koch - - * cipher.c (setup_cipher_table): Don't overwrite the DES entry - with the entry for DUMMY. - -2002-08-14 Werner Koch - - * des.c (do_des_setkey,do_des_encrypt, do_des_decrypt): New. - (_gcry_des_get_info): Support plain old DES. - * cipher.c (setup_cipher_table): Put DES into the table. - -2002-07-25 Werner Koch - - * rndunix.c (_gcry_rndunix_constructor): Prefixed with _gcry_. - Noted by Stephan Austermuehle. - -2002-07-08 Timo Schulz - - * rndw32.c: Replaced the m_ memory functions with the real=20 - gcry_ functions. Renamed all g10_ prefixed functions to log_. -=09 -2002-06-12 Werner Koch - - * rsa.c (generate): Use e =3D 65537 for now. - -2002-06-11 Werner Koch - - * pubkey.c (gcry_pk_get_keygrip): Allow a "protected-private-key". - -2002-06-05 Timo Schulz - - * cipher.c (gcry_cipher_encrypt, gcry_cipher_decrypt): - Check that the input size is a multiple of the blocksize. -=09 -2002-05-23 Werner Koch - - * md.c (oid_table): Add an rsadsi OID for MD5. - -2002-05-21 Werner Koch - - * primegen.c, elgamal.c, dsa.c (progress): Do not print anything - by default. Pass an extra identifying string to the callback and - reserved 2 argumenst for current and total counters. Changed the - register function prototype. - -2002-05-17 Werner Koch - - * rndegd.c (rndegd_constructor): Fixed name of register function - and prefixed the function name with _gcry_. - * rndw32.c (rndw32_constructor): Ditto. - * tiger.c (tiger_constructor): Ditto. - - * Makefile.am: Removed all dynamic loading stuff. - * dynload.c: Ditto. Now only used for the constructor system. - -2002-05-15 Werner Koch - - * random.c (gcry_random_bytes,gcry_random_bytes_secure) - (gcry_randomize): Make sure we are initialized. - -2002-05-14 Werner Koch - - Changed license of most files to the LGPL. - -2002-05-02 Werner Koch - - * random.c (_gcry_fast_random_poll): Initialize the module so the - mutex can be used. - - * primegen.c (small_prime_numbers): Moved table from smallprime.c - * smallprime.c: File removed. - - * des.c (leftkey_swap, rightkey_swap, working_memcmp): Made static. - - * cipher.c (gcry_cipher_map_name): Map "RIJNDAEL" to "AES". - * rijndael.c (rijndael_get_info): We do only support a 128 bit - blocksize so it makes sense to change the algorithm strings to - AES. - - * tiger.c (tiger_final): Removed superfluous token pasting operators. - * md5.c (md5_final): Ditto. - -2002-04-30 Werner Koch - - * cipher.c: Fixed list of copyright years. - -2002-03-18 Werner Koch - - * random.c (initialize): Initialize the new pool lock mutex. - (_gcry_fast_random_poll): Add locking and moved main - code out to... - (do_fast_random_poll): new function. - (read_pool): Use the new function here. - (get_random_bytes): Add locking. - (_gcry_update_random_seed_file): Ditto. - -2002-03-11 Werner Koch - - * md.c: Add rsaSignatureWithripemd160 to OID table. - -2002-02-20 Werner Koch - - * sha1.c: Removed a left over comment note. The code has been - rewritten from scratch in 1998. Thanks to Niels M=C3=B6ller for - reporting this misleading comment. - -2002-02-18 Werner Koch - - * rndunix.c (rndunix_constructor): Use the the new prefixed - function name. Reported by Jordi Mallach. - -2002-02-10 Werner Koch - - * random.c (mix_pool): Carry an extra failsafe_digest buffer - around to make the function more robust. - -2002-02-08 Werner Koch - - * random.c (add_randomness): Xor new data into the pool and not - just copy it. This avoids any choosen input attacks which are not - serious in our setting because an outsider won't be able to mix - data in and even then we keep going with a PRNG. Thanks to Stefan - Keller for pointing this out. - -2002-01-04 Werner Koch - - * pubkey.c (gcry_pk_genkey): Do not release skey - it is static. - - * primegen.c (gen_prime): Of course we should use set_bit - and not set_highbit to set the second high bit. - -2001-12-18 Werner Koch - - * rsa.c (generate): Loop until we find the exact modulus size. - Changed the exponent to 41. - (rsa_get_info): s/usage/r_usage/ to avoid shadow warnings. - * primegen.c (gen_prime): Set 2 high order bits for secret primes. - - * Makefile.am (DISTCLEANFILES): Include construct.c. - -2001-12-17 Werner Koch - - * pubkey.c (gcry_pk_get_keygrip): New - experimental. - -2001-12-11 Werner Koch - - * cipher.c: Added OIDs for AES. - (gcry_cipher_mode_from_oid): New. - (gcry_cipher_map_name): Moved OID search code to .. - (search_oid): .. new function. - -2001-12-10 Werner Koch - - * pubkey.c (gcry_pk_encrypt): Find the signature algorithm by name - and not by number. -=09 - * pubkey.c (gcry_pk_encrypt,gcry_pk_decrypt,gcry_pk_sign) - (gcry_pk_verify,gcry_pk_testkey, gcry_pk_genkey) - (gcry_pk_get_nbits): Release the arrays. Noted by Nikos - Mavroyanopoulos. - -2001-12-06 Werner Koch - - * cipher.c (gcry_cipher_map_name): Look also for OIDs prefixed - with "oid." or "OID.". - -2001-12-05 Werner Koch - - * pubkey.c (algo_info_table): Fixed entry for openpgp-rsa.=20 - -2001-11-24 Werner Koch - - * pubkey.c: Added the rsaEncryption OID to the tables. - (sexp_to_key): Add an arg to return the index of the algorithm, - changed all callers. - (gcry_pk_sign): Find the signature algorithm by name and not by - number. - (gcry_pk_get_nbits): Fixed so that we can now really pass a secret - key to get the result. -=09 - * md.c (gcry_md_map_name): Look also for OIDs prefixed with "oid." - or "OID." so that an OID string can be used as an S-Exp token. - -2001-11-20 Werner Koch - - * md.c (gcry_md_map_name): Lookup by OID if the the name begins - with a digit. - (oid_table): New. -=09 -2001-11-16 Werner Koch - - * md.c (gcry_md_info): New operator GCRYCTL_IS_ALGO_ENABLED. - -2001-11-07 Werner Koch - - * md.c (gcry_md_hash_buffer): Close the handle which was left open - for algorithms other than rmd160. - -2001-08-08 Werner Koch - - * rndw32.c (gather_random): Use toolhelp in addition to the NT - gatherer for Windows2000. Suggested by Sami Tolvanen. - - * random.c (read_pool): Fixed length check, this used to be one - byte to strict. Made an assert out of it because the caller has - already made sure that only poolsize bytes are requested. - Reported by Marcus Brinkmann. - -2001-08-03 Werner Koch - - * cipher.c (cipher_encrypt, cipher_decrypt): Prepare to return - errors. We have to change the interface to all ciphers to make - this really work but we should do so to prepare for hardware - encryption modules. - (gcry_cipher_encrypt, gcry_cipher_decrypt): Return the error and - set lasterr.=20 - (gcry_cipher_ctl): Make sure that errors from setkey are returned. - -2001-08-02 Werner Koch - - * rndlinux.c (gather_random): casted a size_t arg to int so that - the format string is correct. Casting is okay here and avoids - translation changes.=20 - - * random.c (fast_random_poll): Do not check the return code of - getrusage. - - * rndunix.c: Add a signal.h header to avoid warnings on Solaris 7 - and 8. - - * tiger.c (print_abc,print_data): Removed. - - * rijndael.c, des.c, blowfish.c, twofish.c, cast5.c, arcfour.c - (burn_stack): New. Add wrappers for most functions to be able to - call burn_stack after the function invocation. This methods seems - to be the most portable way to zeroise the stack used. It does - only work on stack frame based machines but it is highly portable - and has no side effects. Just setting the automatic variables at - the end of a function to zero does not work well because the - compiler will optimize them away - marking them as volatile would - be bad for performance. - * md5.c, sha1.c, rmd160.c, tiger.c (burn_stack): Likewise. - * random.c (burn_stack): New. - (mix_pool): Use it here to burn the stack of the mixblock function. - - * primegen.c (_gcry_generate_elg_prime): Freed q at 3 places. - Thanks to Tommi Komulainen. - - * arcfour.c (arcfour_setkey): Check the minimim keylength against - bytes and not bits. - (selftest): Must reset the key before decryption.=20 - -2001-05-31 Werner Koch - - * sha1.c (sha1_init): Made static. - - Changed all g10_ prefixed function names as well as some mpi_ - function names to cope with the introduced naming changes. -=09 - * md.c (prepare_macpads): Made key const. - -2001-05-28 Werner Koch - - * rndegd.c (gather_random): Removed the use of tty_printf. - -2001-03-29 Werner Koch - - * md5.c (md5_final): Fixed calculation of hashed length. Thanks - to disastry@saiknes.lv for pointing out that it was horrible wrong - for more than 512MB of input. - * sha1.c (sha1_final): Ditto. - * rmd160.c (rmd160_final): Ditto. - * tiger.c (tiger_final): Ditto. - - * blowfish.c (encrypt,do_encrypt): Changed name to do_encrypt to - avoid name clashes with an encrypt function in stdlib.h of - Dynix/PIX. Thanks to Gene Carter. - * elgamal.c (encrypt,do_encrypt): Ditto. - - * twofish.c (gnupgext_enum_func): Use only when when compiled as a - module. - * rijndael.c (gnupgext_enum_func): Ditto. - - * tiger.c (tiger_get_info): Return "TIGER192" and not just - "TIGER". By Edwin Woudt. -=09 - * random.c: Always include time.h - standard requirement. Thanks - to James Troup. - - * rndw32.c: Fixes to the macros. - -2001-01-11 Werner Koch - - * cipher.c (cipher_encrypt,gcry_cipher_encrypt): Use blocksize and - not 8. - -2000-12-19 Werner Koch - - Major change: - Removed all GnuPG stuff and renamed this piece of software - to gcrypt.=20 - -2000-11-14 Werner Koch - - * dsa.c (test_keys): Replaced mpi_alloc by gcry_mpi_new and - mpi_free by gcry_mpi_release. - * elgamal.c (test_keys,generate): Ditto, also for mpi_alloc_secure. - * rsa.c (test_keys,generate,rsa_verify): Ditto. - * primegen.c (generate_elg_prime): Ditto. - (gen_prime): Ditto and removed nlimbs. - - * rsa.c (generate): Allocate 2 more vars in secure memory. - - * Makefile.am (OMIT_DEPENDENCIES): Hack to work around dependency - problems. - -2000-10-09 Werner Koch - - * arcfour.c, arcfour.h: New. - * cipher.c (cipher_encrypt, cipher_decrypt): Add stream mode. - (setup_cipher_table): Add Arcfour. - (gcry_cipher_open): Kludge to allow stream mode. - -Wed Oct 4 13:16:18 CEST 2000 Werner Koch - - * sha1.c (transform): Use rol() macro. Actually this is not needed - for a newer gcc but there are still aoter compilers. - - * rsa.c (test_keys): Use new random function.=20 - - * md.c (gcry_md_setkey): New function to overcome problems with - const conflics.=20=20 - (gcry_md_ctl): Pass set key to the new functions. - - * rijndael.c: New. - * cipher.c: Add Rijndael support. - -Mon Sep 18 16:35:45 CEST 2000 Werner Koch - - * rndlinux.c (open_device): Loose random device checking. - By Nils Ellmenreich. - - * random.c (fast_random_poll): Check ENOSYS for getrusage. - * rndunix.c: Add 2 sources for QNX. By Sam Roberts. - - * pubkey.c (gcry_pk_algo_info): Add GCRYCTL_GET_ALGO_USAGE. - - * rsa.c: Changed the comment about the patent. - (secret): Speed up by using the CRT. For a 2k keys this - is about 3 times faster. - (stronger_key_check): New but unused code to check the secret key. - * Makefile.am: Included rsa.[ch]. - * pubkey.c: Enabled RSA support. - (pubkey_get_npkey): Removed RSA workaround. - -Mon Jul 31 10:04:47 CEST 2000 Werner Koch - - * pubkey.c: Replaced all gcry_sexp_{car,cdr}_{data,mpi} by the new - gcry_sexp_nth_{data,mpi} functions. - -Tue Jul 25 17:44:15 CEST 2000 Werner Koch - - * pubkey.c (exp_to_key,sexp_to_sig,sexp_to_enc,gcry_pk_encrypt, - gcry_pk_decrypt,gcry_pk_sign,gcry_pk_genkey): Changed to work with - the new S-Exp interface. - -Mon Jul 17 16:35:47 CEST 2000 Werner Koch - - * random.c (gather_faked): Replaced make_timestamp by time(2) again. - -Fri Jul 14 19:38:23 CEST 2000 Werner Koch - - * md.c (gcry_md_ctl): Support GCRYCTL_{START,STOP}_DUMP. - - * Makefile.am: Never compile mingw32 as module. - - * Makefile.am: Tweaked module build and removed libtool - - * Makefile.am: Replaced -O1 by -O. Suggested by Alec Habig. - - * elgamal.c (sign): Removed inactive code. - - * rsa.c, rsa.h: New based on the old module version (only in CVS for now= ). - * pubkey.c (setup_pubkey_table): Added commented support for RSA. - - * rndunix.c (waitpid): New. For UTS 2.1. All by Dave Dykstra. - (my_popen): Do the FD_CLOEXEC only if it is available - (start_gatherer): Cope with missing _SC_OPEN_MAX - - * rndunix.c: Add some more headers for QNX. By Sam Roberts. - - * rndegd.c (gather_random): Shortcut level 0. - * rndunix.c (gather_random): Ditto. - * rndw32.c (gather_random): Ditto. - - * rndw32.c: Replaced with code from Cryptlib and commented the old stuff. - * rndw32.c: Add some debuging code enabled by an environment variable. - - * random.c (read_seed_file): Binary open for DOSish system - (update_random_seed_file): Ditto. - * random.c [MINGW32]: Include process.h for getpid. - * random.c (fast_random_poll): Add clock_gettime() as fallback for - system which support this POSIX.4 fucntion. By Sam Roberts. - - * random.c (read_seed_file): Removed the S_ISLNK test becuase it - is already covered by !S_ISREG and is not defined in Unixware. - Reported by Dave Dykstra. - (update_random_seed_file): Silently ignore update request when pool - is not filled. - - * random.c (read_seed_file): New. - (set_random_seed_file): New. - (read_pool): Try to read the seeding file. - (update_random_seed_file): New. - - (read_pool): Do an initial extra seeding when level 2 quality random - is requested the first time. This requestes at least POOLSIZE/2 bytes - of entropy. Compined with the seeding file this should make normal - random bytes cheaper and increase the quality of the random bytes - used for key generation. - - * random.c (read_pool): Print a more friendly error message in - cases when too much random is requested in one call. - - * random.c (fast_random_poll): Check whether RUSAGE_SELF is defined; - this is not the case for some ESIX and Unixware, although they have - getrusage(). - - * primegen.c (generate_elg_prime): All primes are now generated with - the lowest random quality level. Because they are public anyway we - don't need stronger random and by this we do not drain the systems - entropy so much. - - * primegen.c (register_primegen_progress): New. - * dsa.c (register_pk_dsa_progress): New. - * elgamal.c (register_pk_elg_progress): New. - - * elgamal.c (wiener_map): New. - (gen_k): Use a much smaller k. - (generate): Calculate the qbits using the wiener map and - choose an x at a size comparable to the one choosen in gen_k - - * rmd160.c (rmd160_get_info): Moved casting to the left side due to a - problem with UTS4.3. Suggested by Dave Dykstra. - * sha1.c (sha1_get_info): Ditto. - * tiger.c (tiger_get_info): Ditto. - * md5.c (md5_get_info): Ditto - * des.c (des_get_info): Ditto. - * blowfish.c (blowfish_get_info): Ditto. - * cast5.c (cast5_get_info): Ditto. - * twofish.c (twofish_get_info): Ditto. - -Fri Mar 24 11:25:45 CET 2000 Werner Koch - - * md.c (md_open): Add hmac arg and allocate space for the pads. - (md_finalize): Add HMAC support. - (md_copy): Ditto. - (md_close): Ditto. - (gcry_md_reset): Ditto. - (gcry_md_ctl): Ditto. - (prepare_macpdas): New. - -Mon Mar 13 19:22:46 CET 2000 Werner Koch - - * md.c (gcry_md_hash_buffer): Add support for the other algorithms. - -Mon Jan 31 16:37:34 CET 2000 Werner Koch - - * genprime.c (generate_elg_prime): Fixed returned factors which never - worked for non-DSA keys. - -Thu Jan 27 18:00:44 CET 2000 Werner Koch - - * pubkey.c (sexp_to_key): Fixed mem leaks in case of errors. - -Mon Jan 24 22:24:38 CET 2000 Werner Koch - - * pubkey.c (gcry_pk_decrypt): Implemented. - (gcry_pk_encrypt): Implemented. - (gcry_pk_testkey): New. - (gcry_pk_genkey): New. - (pubkey_decrypt): Made static. - (pubkey_encrypt): Ditto. - (pubkey_check_secret_key): Ditto. - (pubkey_generate): Ditto. - -Mon Jan 24 13:04:28 CET 2000 Werner Koch - - * pubkey.c (pubkey_nbits): Removed and replaced by ... - (gcry_pk_get_nbits): this new one. - -Wed Dec 8 21:58:32 CET 1999 Werner Koch - - * dsa.c: s/mpi_powm/gcry_mpi_powm/g - * elgamal.c: Ditto. - * primegen.c: Ditto. - - * : Replaced g10_opt_verbose by g10_log_verbosity(). - - * Makefile.am (INCLUDES): removed intl, add ../gcrypt - -Fri Nov 19 17:15:20 CET 1999 Werner Koch - - * dynload.c (cmp_filenames): New to replaced compare_filename() in - module. - (register_cipher_extension): Removed the tilde expansion stuff. - * rndeg.c (my_make_filename): New. - - * : Replaced header util.h by g10lib.h - - * random.c (gather_faked): Replaced make_timestamp by time(2). - Disabled wrning printed with tty_printf. - * rndlinux.c (gather_random): Always use fprintf instead of tty_xxx; - this should be replaced by a callback function. - - * primegen.c (gen_prime): Use gcry_mpi_randomize. - (is_prime): Ditto. - * elgamal.c (test_keys): Ditto. - * dsa.c (test_keys): Ditto. - - * cipher.c (gcry_cipher_close): Die on invalid handle. - -Mon Nov 15 21:36:02 CET 1999 Werner Koch - - * elgamal.c (gen_k): Use the new random API. - (generate): Ditto. - * dsa.c (gen_k): Ditto. - (generate): Ditto. - -Sat Nov 13 17:44:23 CET 1999 Werner Koch - - * pubkey.c (disable_pubkey_algo): Made static. - (gcry_pk_ctl): New. - - * random.c (get_random_bits): Renamed to ... - (get_random_bytes): ... this and made static. - (gcry_random_bytes): New. - (gcry_random_bytes_secure): New. - (randomize_buffer): Renamed to ... - (gcry_randomize): ...this. - - * md.c (gcry_md_hash_buffer): New. - - * pubkey.c (gcry_pk_algo_info): 4 new commands. - (pubkey_get_npkey): Made static. - (pubkey_get_nskey): Made static. - (pubkey_get_nsig): Made static. - (pubkey_get_nenc): Made static. - - * pubkey.c: Removed all G10ERR_xxx. - * cipher.c: Changed all GCRYERR_INV_ALGO to GCRYERR_INV_CIPHER_ALGO. - * md.c: Changed all GCRYERR_INV_ALGO to GCRYERR_INV_MD_ALGO. - * cast5.c (cast_setkey): Changed errocodes to GCRYERR_xxx. - * blowfish.c: Ditto. - * des.c: Ditto. - * twofish.c: Ditto. - * dsa.c: Ditto. - * elgamal.c: Ditto. - - * g10c.c: Removed - - * cipher.c (gcry_cipher_open): Replaced alloc functions and return NULL - if we are out of core. - * dynload.c: Replaced all memory allocation functions. - * md.c: Ditto. - * primegen.c: Ditto. - * pubkey.c: Ditto. - * random.c: Ditto. - * rndw32.c: Ditto. - * elgamal.c: Ditto. - * dsa.c: Ditto. - -Tue Oct 26 14:10:21 CEST 1999 Werner Koch - - * elgamal.c (sign): Hugh found strange code here. Replaced by BUG(). - - * cipher.c: Merged with gcrypt/symapi.c. - - * pubkey.c (string_to_pubkey_algo): Renamed function to ... - (gcry_pk_map_name): ... this. - (pubkey_algo_to_string): Renamed function to ... - (gcry_pk_algo_name): ... this. - (gcry_pk_algo_info): New. - * pubkey.c: Merged with gcrypt/pkapi.c. - - * md.c (md_reset): Clear finalized; thanks to Ulf Moeller for - fixing this bug. - - * md.c: Merged with gcrypt/mdapi.c - -Wed Sep 15 14:39:59 CEST 1999 Michael Roth - - * des.c: Various speed improvements: One bit pre rotation - trick after initial permutation (Richard Outerbridge). - Finished test of SSLeay Tripple-DES patterns. - -Wed Sep 15 16:22:17 CEST 1999 Werner Koch - - * rndw32.c: New. - -Mon Sep 13 10:51:29 CEST 1999 Werner Koch - - * bithelp.h: New. - * rmd160.h, sha1.h, md5.h: Use the rol macro from bithelp.h - -Tue Sep 7 16:23:36 CEST 1999 Werner Koch - - * Makefile.am: Fixed seds for latest egcc. By Ollivier Robert. - -Mon Sep 6 19:59:08 CEST 1999 Werner Koch - - * des.c (selftest): Add some testpattern - -Mon Aug 30 20:38:33 CEST 1999 Werner Koch - - * cipher.c (do_cbc_encrypt): Fixed serious bug occuring when not using - in place encryption. Pointed out by Frank Stajano. - -Mon Jul 26 09:34:46 CEST 1999 Werner Koch - - * md5.c (md5_final): Fix for a SCO cpp bug. - -Thu Jul 15 10:15:35 CEST 1999 Werner Koch - - * elgamal.c (elg_check_secret_key,elg_encrypt - elg_decrypt,elg_sign,elg_verify): Sanity check on the args. - * dsa.c (dsa_check_secret_key,dsa_sign,dsa_verify): Ditto. - - * pubkey.c (disable_pubkey_algo): New. - (check_pubkey_algo2): Look at disabled algo table. - * cipher.c (disable_cipher_algo): New. - (check_cipher_algo): Look at disabled algo table. - -Wed Jul 7 13:08:40 CEST 1999 Werner Koch - - * Makefile.am: Support for libtool. - -Fri Jul 2 11:45:54 CEST 1999 Werner Koch - - * dsa.c (gen_k): Changed algorithm to consume less random bytes - * elgamal.c (gen_k): Ditto. - - * random.c (random_dump_stats): New. - -Thu Jul 1 12:47:31 CEST 1999 Werner Koch - - * primegen.c, elgamal.c, dsa.c (progess): New and replaced all - fputc with a call to this function. - -Sat Jun 26 12:15:59 CEST 1999 Werner Koch - - * rndegd.c (do_write): s/ssize_t/int/ due to SunOS 4.1 probs. - - * cipher.c (do_cbc_encrypt, do_cbc_decrypt): New. - - * dynload.c (HAVE_DL_SHL_LOAD): Map hpux API to dlopen (Dave Dykstra). - * Makefile.am (install-exec-hook): Removed. - -Sun May 23 14:20:22 CEST 1999 Werner Koch - - * cipher.c (setup_cipher_table): Enable Twofish - - * random.c (fast_random_poll): Disable use of times() for mingw32. - -Mon May 17 21:54:43 CEST 1999 Werner Koch - - * dynload.c (register_internal_cipher_extension): Minor init fix. - -Tue May 4 15:47:53 CEST 1999 Werner Koch - - * primegen.c (gen_prime): Readded the Fermat test. Fixed the bug - that we didn't correct for step when passing the prime to the - Rabin-Miller test which led to bad performance (Stefan Keller). - (check_prime): Add a first Fermat test. - -Sun Apr 18 10:11:28 CEST 1999 Werner Koch - - * cipher.c (cipher_setiv): Add ivlen arg, changed all callers. - - * random.c (randomize_buffer): alway use secure memory because - we can't use m_is_secure() on a statically allocated buffer. - - * twofish.c: Replaced some macros by a loop to reduce text size. - * Makefile.am (twofish): No more need for sed editing. - -Fri Apr 9 12:26:25 CEST 1999 Werner Koch - - * cipher.c (cipher_open): Reversed the changes for AUTO_CFB. - - * blowfish.c: Dropped the Blowfish 160 mode. - * cipher.c (cipher_open): Ditto. - (setup_cipher_table): Ditto. And removed support of twofish128 - -Wed Apr 7 20:51:39 CEST 1999 Werner Koch - - * random.c (get_random_bits): Can now handle requests > POOLSIZE - - * cipher.c (cipher_open): Now uses standard CFB for automode if - the blocksize is gt 8 (according to rfc2440). - - * twofish.c: Applied Matthew Skala's patches for 256 bit key. - -Tue Apr 6 19:58:12 CEST 1999 Werner Koch - - * random.c (get_random_bits): Can now handle requests > POOLSIZE - - * cipher.c (cipher_open): Now uses standard CFB for automode if - the blocksize is gt 8 (according to rfc2440). - -Sat Mar 20 11:44:21 CET 1999 Werner Koch - - * rndlinux.c (tty_printf) [IS_MODULE]: Removed. - - * rndegd.c (gather_random): Some fixes. - -Wed Mar 17 13:09:03 CET 1999 Werner Koch - - * rndegd.c (do_read): New. - (gather_random): Changed the implementation. - -Mon Mar 8 20:47:17 CET 1999 Werner Koch - - * dynload.c (DLSYM_NEEDS_UNDERSCORE): Renamed. - -Fri Feb 26 17:55:41 CET 1999 Werner Koch - - * md.c: Nearly a total rewrote. - -Wed Feb 24 11:07:27 CET 1999 Werner Koch - - * cipher.c (context): Fixed alignment - * md.c: Ditto. - - * rndegd.c: New - -Mon Feb 22 20:04:00 CET 1999 Werner Koch - - * rndegd.c: New. - -Wed Feb 10 17:15:39 CET 1999 Werner Koch - - * Makefile.am: Modules are now figured out by configure - * construct.c: New. Generated by configure. Changed all modules - to work with that. - * sha1.h: Removed. - * md5.h: Removed. - - * twofish.c: Changed interface to allow Twofish/256 - - * rndunix.c (start_gatherer): Die on SIGPIPE. - -Wed Jan 20 18:59:49 CET 1999 Werner Koch - - * rndunix.c (gather_random): Fix to avoid infinite loop. - -Sun Jan 17 11:04:33 CET 1999 Werner Koch - - * des.c (is_weak_key): Replace system memcmp due to bugs - in SunOS's memcmp. - (des_get_info): Return error on failed selftest. - * twofish.c (twofish_setkey): Return error on failed selftest or - invalid keylength. - * cast5.c (cast_setkey): Ditto. - * blowfish.c (bf_setkey): Return error on failed selftest. - -Tue Jan 12 11:17:18 CET 1999 Werner Koch - - * random.c (random_is_faked): New. - - * tiger.c: Only compile if we have the u64 type - -Sat Jan 9 16:02:23 CET 1999 Werner Koch - - * rndunix.c (gather_random): check for setuid. - - * Makefile.am: Add a way to staically link random modules - -Thu Jan 7 18:00:58 CET 1999 Werner Koch - - * md.c (md_stop_debug): Do a flush first. - (md_open): size of buffer now depends on the secure parameter - -Sun Jan 3 15:28:44 CET 1999 Werner Koch - - * rndunix.c (start_gatherer): Fixed stupid =3D=3D/=3D bug - -1998-12-31 Geoff Keating - - * des.c (is_weak_key): Rewrite loop end condition. - -Tue Dec 29 14:41:47 CET 1998 Werner Koch - - * random.c: add unistd.h for getpid(). - (RAND_MAX): Fallback value for Sun. - -Wed Dec 23 17:12:24 CET 1998 Werner Koch - - * md.c (md_copy): Reset debug. - -Mon Dec 14 21:18:49 CET 1998 Werner Koch - - * random.c (read_random_source): Changed the interface to the - random gathering function. - (gather_faked): Use new interface. - * dynload.c (dynload_getfnc_fast_random_poll): Ditto. - (dynload_getfnc_gather_random): Ditto. - * rndlinux.c (gather_random): Ditto. - * rndunix.c (gather_random): Ditto. - -Sat Dec 12 18:40:32 CET 1998 Werner Koch - - * dynload.c (SYMBOL_VERSION): New to cope with system which needs - underscores. - - * rndunix.c: Rewrote large parts - -Thu Dec 10 20:15:36 CET 1998 Werner Koch - - * dynload.c (load_extension): increased needed verbosity level. - - * random.c (fast_random_poll): Fallback to a default fast random - poll function. - (read_random_source): Always use the faked entroy gatherer if no - gather module is available. - * rndlinux.c (fast_poll): Removed. - * rndunix.c (fast_poll): Removed. - - -Wed Nov 25 12:33:41 1998 Werner Koch (wk@isil.d.shuttle.de) - - * rand-*.c: Removed. - * rndlinux.c : New. - * rndunix.c : New. - * random.c : Restructured the interface to the gather modules. - (intialize): Call constructor functions - (read_radnom_source): Moved to here. - * dynload.c (dynload_getfnc_gather_random): New. - (dynload_getfnc_fast_random_poll): New. - (register_internal_cipher_extension): New. - (register_cipher_extension): Support of internal modules. - -Sun Nov 8 17:44:36 1998 Werner Koch (wk@isil.d.shuttle.de) - - * rand-unix.c (read_random_source): Removed the assert. - -Mon Oct 19 18:34:30 1998 me,,, (wk@tobold) - - * pubkey.c: Hack to allow us to give some info about RSA keys back. - -Thu Oct 15 11:47:57 1998 Werner Koch (wk@isil.d.shuttle.de) - - * dynload.c: Support for DLD - -Wed Oct 14 12:13:07 1998 Werner Koch (wk@isil.d.shuttle.de) - - * rand-unix.c: Now uses names from configure for /dev/random. - -1998-10-10 SL Baur - - * Makefile.am: fix sed -O substitutions to catch -O6, etc. - -Tue Oct 6 10:06:32 1998 Werner Koch (wk@isil.d.shuttle.de) - - * rand-unix.c (HAVE_GETTIMEOFDAY): Fixed (was ..GETTIMEOFTIME :-) - * rand-dummy.c (HAVE_GETTIMEOFDAY): Ditto. - -Mon Sep 28 13:23:09 1998 Werner Koch (wk@isil.d.shuttle.de) - - * md.c (md_digest): New. - (md_reset): New. - -Wed Sep 23 12:27:02 1998 Werner Koch (wk@isil.d.shuttle.de) - - * tiger.c (TIGER_CONTEXT): moved "buf", so that it is 64 bit aligned. - -Mon Sep 21 06:22:53 1998 Werner Koch (wk@(none)) - - * des.c: Some patches from Michael. - -Thu Sep 17 19:00:06 1998 Werner Koch (wk@(none)) - - * des.c : New file from Michael Roth - -Mon Sep 14 11:10:55 1998 Werner Koch (wk@(none)) - - * blowfish.c (bf_setkey): Niklas Hernaeus patch to detect weak keys. - -Mon Sep 14 09:19:25 1998 Werner Koch (wk@(none)) - - * dynload.c (RTLD_NOW): Now defined to 1 if it is undefined. - -Mon Sep 7 17:04:33 1998 Werner Koch (wk@(none)) - - * Makefile.am: Fixes to allow a different build directory - -Thu Aug 6 17:25:38 1998 Werner Koch,mobil,,, (wk@tobold) - - * random.c (get_random_byte): Removed and changed all callers - to use get_random_bits() - -Mon Jul 27 10:30:22 1998 Werner Koch (wk@(none)) - - * cipher.c : Support for other blocksizes - (cipher_get_blocksize): New. - * twofish.c: New. - * Makefile.am: Add twofish module. - -Mon Jul 13 21:30:52 1998 Werner Koch (wk@isil.d.shuttle.de) - - * random.c (read_pool): Simple alloc if secure_alloc is not set. - (get_random_bits): Ditto. - -Thu Jul 9 13:01:14 1998 Werner Koch (wk@isil.d.shuttle.de) - - * dynload.c (load_extension): Function now nbails out if - the program is run setuid. - -Wed Jul 8 18:58:23 1998 Werner Koch (wk@isil.d.shuttle.de) - - * rmd160.c (rmd160_hash_buffer): New. - -Thu Jul 2 10:50:30 1998 Werner Koch (wk@isil.d.shuttle.de) - - * cipher.c (cipher_open): algos >=3D100 use standard CFB - -Thu Jun 25 11:18:25 1998 Werner Koch (wk@isil.d.shuttle.de) - - * Makefile.am: Support for extensions - -Thu Jun 18 12:09:38 1998 Werner Koch (wk@isil.d.shuttle.de) - - * random.c (mix_pool): simpler handling for level 0 - -Mon Jun 15 14:40:48 1998 Werner Koch (wk@isil.d.shuttle.de) - - * tiger.c: Removed from dist, will reappear as dynload module - -Sat Jun 13 14:16:57 1998 Werner Koch (wk@isil.d.shuttle.de) - - * pubkey.c: Major changes to allow extensions. Changed the inteface - of all public key ciphers and added the ability to load extensions - on demand. - - * misc.c: Removed. - -Wed Jun 10 07:52:08 1998 Werner Koch,mobil,,, (wk@tobold) - - * dynload.c: New. - * cipher.c: Major changes to allow extensions. - -Mon Jun 8 22:43:00 1998 Werner Koch (wk@isil.d.shuttle.de) - - * cipher.c: Major internal chnages to support extensions. - * blowfish.c (blowfish_get_info): New and made all internal - functions static, changed heder. - * cast5.c (cast5_get_info): Likewise. - -Mon Jun 8 12:27:52 1998 Werner Koch (wk@isil.d.shuttle.de) - - * tiger.c (transform): Fix for big endian - - * cipher.c (do_cfb_decrypt): Big endian fix. - -Fri May 22 07:30:39 1998 Werner Koch (wk@isil.d.shuttle.de) - - * md.c (md_get_oid): Add a new one for TIGER. - -Thu May 21 13:24:52 1998 Werner Koch (wk@isil.d.shuttle.de) - - * cipher.c: Add support for a dummy cipher - -Thu May 14 15:40:36 1998 Werner Koch (wk@isil.d.shuttle.de) - - * rmd160.c (transform): fixed sigbus - I should better - add Christian von Roques's new implemenation of rmd160_write. - -Fri May 8 18:07:44 1998 Werner Koch (wk@isil.d.shuttle.de) - - * rand-internal.h, rand-unix.c, rand-w32.c, rand_dummy.c: New - * random.c: Moved system specific functions to rand-****.c - -Fri May 8 14:01:17 1998 Werner Koch (wk@isil.d.shuttle.de) - - * random.c (fast_random_poll): add call to gethrtime. - -Tue May 5 21:28:55 1998 Werner Koch (wk@isil.d.shuttle.de) - - * elgamal.c (elg_generate): choosing x was not correct, could - yield 6 bytes which are not from the random pool, tsss, tsss.. - -Tue May 5 14:09:06 1998 Werner Koch (wk@isil.d.shuttle.de) - - * primegen.c (generate_elg_prime): Add arg mode, changed all - callers and implemented mode 1. - -Mon Apr 27 14:41:58 1998 Werner Koch (wk@isil.d.shuttle.de) - - * cipher.c (cipher_get_keylen): New. - -Sun Apr 26 14:44:52 1998 Werner Koch (wk@isil.d.shuttle.de) - - * tiger.c, tiger.h: New. - -Wed Apr 8 14:57:11 1998 Werner Koch (wk@isil.d.shuttle.de) - - * misc.c (check_pubkey_algo2): New. - -Tue Apr 7 18:46:49 1998 Werner Koch (wk@isil.d.shuttle.de) - - * cipher.c: New - * misc.c (check_cipher_algo): Moved to cipher.c - * cast5.c: Moved many functions to cipher.c - * blowfish.c: Likewise. - -Sat Apr 4 19:52:08 1998 Werner Koch (wk@isil.d.shuttle.de) - - * cast5.c: Implemented and tested. - -Wed Apr 1 16:38:27 1998 Werner Koch (wk@isil.d.shuttle.de) - - * elgamal.c (elg_generate): Faster generation of x in some cases. - -Thu Mar 19 13:54:48 1998 Werner Koch (wk@isil.d.shuttle.de) - - * blowfish.c (blowfish_decode_cfb): changed XOR operation - (blowfish_encode_cfb): Ditto. - -Thu Mar 12 14:04:05 1998 Werner Koch (wk@isil.d.shuttle.de) - - * sha1.c (transform): Rewrote - - * blowfish.c (encrypt): Unrolled for rounds =3D=3D 16 - (decrypt): Ditto. - -Tue Mar 10 16:32:08 1998 Werner Koch (wk@isil.d.shuttle.de) - - * rmd160.c (transform): Unrolled the loop. - -Tue Mar 10 13:05:14 1998 Werner Koch (wk@isil.d.shuttle.de) - - * random.c (read_pool): Add pool_balance stuff. - (get_random_bits): New. - - * elgamal.c (elg_generate): Now uses get_random_bits to generate x. - - -Tue Mar 10 11:33:51 1998 Werner Koch (wk@isil.d.shuttle.de) - - * md.c (md_digest_length): New. - -Tue Mar 10 11:27:41 1998 Werner Koch (wk@isil.d.shuttle.de) - - * dsa.c (dsa_verify): Works. - -Mon Mar 9 12:59:08 1998 Werner Koch (wk@isil.d.shuttle.de) - - * dsa.c, dsa.h: Removed some unused code. - -Wed Mar 4 10:39:22 1998 Werner Koch (wk@isil.d.shuttle.de) - - * md.c (md_open): Add call to fast_random_poll. - blowfish.c (blowfish_setkey): Ditto. - -Tue Mar 3 13:32:54 1998 Werner Koch (wk@isil.d.shuttle.de) - - * rmd160.c (rmd160_mixblock): New. - * random.c: Restructured to start with a new RNG implementation. - * random.h: New. - -Mon Mar 2 19:21:46 1998 Werner Koch (wk@isil.d.shuttle.de) - - * gost.c, gost.h: Removed because they did only contain trash. - -Sun Mar 1 16:42:29 1998 Werner Koch (wk@isil.d.shuttle.de) - - * random.c (fill_buffer): removed error message if n =3D=3D -1. - -Fri Feb 27 16:39:34 1998 Werner Koch (wk@isil.d.shuttle.de) - - * md.c (md_enable): No init if called twice. - -Thu Feb 26 07:57:02 1998 Werner Koch (wk@isil.d.shuttle.de) - - * primegen.c (generate_elg_prime): Changed the progress printing. - (gen_prime): Ditto. - -Tue Feb 24 12:28:42 1998 Werner Koch (wk@isil.d.shuttle.de) - - * md5.c, md.5 : Replaced by a modified version of md5.c from - GNU textutils 1.22. - -Wed Feb 18 14:08:30 1998 Werner Koch (wk@isil.d.shuttle.de) - - * md.c, md.h : New debugging support - -Mon Feb 16 10:08:47 1998 Werner Koch (wk@isil.d.shuttle.de) - - * misc.c (cipher_algo_to_string): New - (pubkey_algo_to_string): New. - (digest_algo_to_string): New. - - - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - 2007, 2008, 2009, 2010 Free Software Foundation, Inc. - - This file is free software; as a special exception the author gives - unlimited permission to copy and/or distribute it, with or without - modifications, as long as this notice is preserved. - - This file is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY, to the extent permitted by law; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/grub-core/lib/libgcrypt/cipher/ChangeLog-2011 b/grub-core/lib/= libgcrypt/cipher/ChangeLog-2011 index 05516c99e..1ce6bd1e6 100644 --- a/grub-core/lib/libgcrypt/cipher/ChangeLog-2011 +++ b/grub-core/lib/libgcrypt/cipher/ChangeLog-2011 @@ -1,9 +1,37 @@ 2011-12-01 Werner Koch =20 - NB: ChangeLog files are no longer manually maintained. Starting - on December 1st, 2011 we put change information only in the GIT - commit log, and generate a top-level ChangeLog file from logs at - "make dist". See doc/HACKING for details. + NB: ChangeLog files are no longer manually maintained. Starting + on December 1st, 2011 we put change information only in the GIT + commit log, and generate a top-level ChangeLog file from logs at + "make dist". See doc/HACKING for details. + +2011-09-16 Werner Koch + + * primegen.c (_gcry_primegen_init): New. + +2011-09-15 Werner Koch + + * cipher-cbc.c, cipher-cfb.c, cipher-ofb.c, cipher-ctr.c: New. + * cipher-aeswrap.c: New. + * cipher-internal.h: New. + * cipher.c (cipher_context_alignment_t, struct gcry_cipher_handle) + (CTX_MAGIC_NORMAL, CTX_MAGIC_SECURE, NEED_16BYTE_ALIGNED_CONTEXT) + (MAX_BLOCKSIZE): Move to cipher-internal.h. + (do_aeswrap_encrypt, do_aeswrap_encrypt) + (do_cbc_encrypt, do_cbc_decrypt, do_ctr_encrypt, do_ctr_decrypt) + (do_ofb_encrypt, do_ofb_decrypt, do_ctr_encrypt): Move to the + respective new cipher-foo.c files. + (do_ctr_decrypt): Remove. + +2011-09-15 Werner Koch + + * pubkey.c (gcry_pk_list): Remove. + (gcry_pk_unregister): Remove. + * md.c (gcry_md_list): Remove. + (gcry_md_unregister): Remove. + * cipher.c (gcry_cipher_list): Remove. + (gcry_cipher_unregister): Remove. + * ac.c: Remove. =20 2011-06-29 Werner Koch =20 @@ -4245,3 +4273,7 @@ Mon Feb 16 10:08:47 1998 Werner Koch (wk@isil.d.shu= ttle.de) This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Local Variables: +buffer-read-only: t +End: diff --git a/grub-core/lib/libgcrypt/cipher/Makefile.am b/grub-core/lib/lib= gcrypt/cipher/Makefile.am index 76cdc96ad..c3d642b2a 100644 --- a/grub-core/lib/libgcrypt/cipher/Makefile.am +++ b/grub-core/lib/libgcrypt/cipher/Makefile.am @@ -19,65 +19,258 @@ =20 # Process this file with automake to produce Makefile.in =20 -EXTRA_DIST =3D Manifest - # Need to include ../src in addition to top_srcdir because gcrypt.h is # a built header. -AM_CPPFLAGS =3D -I../src -I$(top_srcdir)/src +AM_CPPFLAGS =3D -I../src -I$(top_srcdir)/src -I../mpi -I$(top_srcdir)/mpi AM_CFLAGS =3D $(GPG_ERROR_CFLAGS) =20 +AM_CCASFLAGS =3D $(NOEXECSTACK_FLAGS) + +EXTRA_DIST =3D gost-s-box.c + +CLEANFILES =3D gost-s-box +DISTCLEANFILES =3D gost-sb.h =20 noinst_LTLIBRARIES =3D libcipher.la =20 -GCRYPT_MODULES =3D @GCRYPT_CIPHERS@ @GCRYPT_PUBKEY_CIPHERS@ @GCRYPT_DIGEST= S@ +GCRYPT_MODULES =3D @GCRYPT_CIPHERS@ @GCRYPT_PUBKEY_CIPHERS@ \ + @GCRYPT_DIGESTS@ @GCRYPT_KDFS@ =20 libcipher_la_DEPENDENCIES =3D $(GCRYPT_MODULES) libcipher_la_LIBADD =3D $(GCRYPT_MODULES) =20 libcipher_la_SOURCES =3D \ -cipher.c pubkey.c ac.c md.c kdf.c \ -hmac-tests.c \ -bithelp.h \ -primegen.c \ -hash-common.c hash-common.h \ -rmd.h + cipher.c cipher-internal.h \ + cipher-cbc.c \ + cipher-cfb.c \ + cipher-ofb.c \ + cipher-ctr.c \ + cipher-aeswrap.c \ + cipher-ccm.c \ + cipher-cmac.c \ + cipher-gcm.c \ + cipher-poly1305.c \ + cipher-ocb.c \ + cipher-xts.c \ + cipher-eax.c \ + cipher-siv.c \ + cipher-gcm-siv.c \ + cipher-selftest.c cipher-selftest.h \ + pubkey.c pubkey-internal.h pubkey-util.c \ + md.c \ + mac.c mac-internal.h \ + mac-hmac.c mac-cmac.c mac-gmac.c mac-poly1305.c \ + poly1305.c poly1305-internal.h \ + kdf.c kdf-internal.h \ + bithelp.h \ + bufhelp.h \ + primegen.c \ + hash-common.c hash-common.h \ + dsa-common.c rsa-common.c \ + sha1.h =20 EXTRA_libcipher_la_SOURCES =3D \ -arcfour.c \ -blowfish.c \ -cast5.c \ -crc.c \ -des.c \ -dsa.c \ -elgamal.c \ -ecc.c \ -idea.c \ -md4.c \ -md5.c \ -rijndael.c rijndael-tables.h \ -rmd160.c \ -rsa.c \ -seed.c \ -serpent.c \ -sha1.c \ -sha256.c \ -sha512.c \ -tiger.c \ -whirlpool.c \ -twofish.c \ -rfc2268.c \ -camellia.c camellia.h camellia-glue.c + asm-common-aarch64.h \ + asm-common-amd64.h \ + asm-common-s390x.h \ + asm-inline-s390x.h \ + asm-poly1305-aarch64.h \ + asm-poly1305-amd64.h \ + asm-poly1305-s390x.h \ + arcfour.c arcfour-amd64.S \ + blowfish.c blowfish-amd64.S blowfish-arm.S \ + cast5.c cast5-amd64.S cast5-arm.S \ + chacha20.c chacha20-amd64-ssse3.S chacha20-amd64-avx2.S \ + chacha20-armv7-neon.S chacha20-aarch64.S \ + chacha20-ppc.c chacha20-s390x.S \ + cipher-gcm-ppc.c cipher-gcm-intel-pclmul.c cipher-gcm-armv7-neon.S \ + cipher-gcm-armv8-aarch32-ce.S cipher-gcm-armv8-aarch64-ce.S \ + crc.c crc-intel-pclmul.c crc-armv8-ce.c \ + crc-armv8-aarch64-ce.S \ + crc-ppc.c \ + des.c des-amd64.S \ + dsa.c \ + elgamal.c \ + ecc.c ecc-curves.c ecc-misc.c ecc-common.h \ + ecc-ecdh.c ecc-ecdsa.c ecc-eddsa.c ecc-gost.c ecc-sm2.c \ + idea.c \ + gost28147.c gost.h \ + gostr3411-94.c \ + md4.c \ + md5.c \ + poly1305-s390x.S \ + rijndael.c rijndael-internal.h rijndael-tables.h \ + rijndael-aesni.c rijndael-padlock.c \ + rijndael-amd64.S rijndael-arm.S \ + rijndael-ssse3-amd64.c rijndael-ssse3-amd64-asm.S \ + rijndael-vaes.c rijndael-vaes-avx2-amd64.S \ + rijndael-armv8-ce.c rijndael-armv8-aarch32-ce.S \ + rijndael-armv8-aarch64-ce.S rijndael-aarch64.S \ + rijndael-ppc.c rijndael-ppc9le.c \ + rijndael-p10le.c rijndael-gcm-p10le.s \ + rijndael-ppc-common.h rijndael-ppc-functions.h \ + rijndael-s390x.c \ + rmd160.c \ + rsa.c \ + salsa20.c salsa20-amd64.S salsa20-armv7-neon.S \ + scrypt.c \ + seed.c \ + serpent.c serpent-sse2-amd64.S \ + sm4.c sm4-aesni-avx-amd64.S sm4-aesni-avx2-amd64.S \ + serpent-avx2-amd64.S serpent-armv7-neon.S \ + sha1.c sha1-ssse3-amd64.S sha1-avx-amd64.S sha1-avx-bmi2-amd64.S \ + sha1-avx2-bmi2-amd64.S sha1-armv7-neon.S sha1-armv8-aarch32-ce.S \ + sha1-armv8-aarch64-ce.S sha1-intel-shaext.c \ + sha256.c sha256-ssse3-amd64.S sha256-avx-amd64.S \ + sha256-avx2-bmi2-amd64.S \ + sha256-armv8-aarch32-ce.S sha256-armv8-aarch64-ce.S \ + sha256-intel-shaext.c sha256-ppc.c \ + sha512.c sha512-ssse3-amd64.S sha512-avx-amd64.S \ + sha512-avx2-bmi2-amd64.S \ + sha512-armv7-neon.S sha512-arm.S \ + sha512-ppc.c sha512-ssse3-i386.c \ + sm3.c sm3-avx-bmi2-amd64.S sm3-aarch64.S \ + keccak.c keccak_permute_32.h keccak_permute_64.h keccak-armv7-neon.S \ + stribog.c \ + tiger.c \ + whirlpool.c whirlpool-sse2-amd64.S \ + twofish.c twofish-amd64.S twofish-arm.S twofish-aarch64.S \ + twofish-avx2-amd64.S \ + rfc2268.c \ + camellia.c camellia.h camellia-glue.c camellia-aesni-avx-amd64.S \ + camellia-aesni-avx2-amd64.h camellia-vaes-avx2-amd64.S \ + camellia-aesni-avx2-amd64.S camellia-arm.S camellia-aarch64.S \ + blake2.c \ + blake2b-amd64-avx2.S blake2s-amd64-avx.S + +gost28147.lo: gost-sb.h +gost-sb.h: gost-s-box + ./gost-s-box $@ + +gost-s-box: gost-s-box.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \ + $(CPPFLAGS_FOR_BUILD) -o $@ $(srcdir)/gost-s-box.c + =20 if ENABLE_O_FLAG_MUNGING -o_flag_munging =3D sed -e 's/-O\([2-9s][2-9s]*\)/-O1/' -e 's/-Ofast/-O1/g' +o_flag_munging =3D sed -e 's/-O\([2-9sgz][2-9sgz]*\)/-O1/' -e 's/-Ofast/-O= 1/g' else o_flag_munging =3D cat endif =20 =20 # We need to lower the optimization for this module. -tiger.o: $(srcdir)/tiger.c - `echo $(COMPILE) -c $(srcdir)/tiger.c | $(o_flag_munging) ` +tiger.o: $(srcdir)/tiger.c Makefile + `echo $(COMPILE) -c $< | $(o_flag_munging) ` + +tiger.lo: $(srcdir)/tiger.c Makefile + `echo $(LTCOMPILE) -c $< | $(o_flag_munging) ` + + +# We need to disable instrumentation for these modules as they use cc as +# thin assembly front-end and do not tolerate in-between function calls +# inserted by compiler as those functions may clobber the XMM registers. +if ENABLE_INSTRUMENTATION_MUNGING +instrumentation_munging =3D sed \ + -e 's/-fsanitize[=3D,\-][=3D,a-z,A-Z,0-9,\,,\-]*//g' \ + -e 's/-fprofile[=3D,\-][=3D,a-z,A-Z,0-9,\,,\-]*//g' \ + -e 's/-fcoverage[=3D,\-][=3D,a-z,A-Z,0-9,\,,\-]*//g' +else +instrumentation_munging =3D cat +endif + +rijndael-aesni.o: $(srcdir)/rijndael-aesni.c Makefile + `echo $(COMPILE) -c $< | $(instrumentation_munging) ` + +rijndael-aesni.lo: $(srcdir)/rijndael-aesni.c Makefile + `echo $(LTCOMPILE) -c $< | $(instrumentation_munging) ` + +rijndael-ssse3-amd64.o: $(srcdir)/rijndael-ssse3-amd64.c Makefile + `echo $(COMPILE) -c $< | $(instrumentation_munging) ` + +rijndael-ssse3-amd64.lo: $(srcdir)/rijndael-ssse3-amd64.c Makefile + `echo $(LTCOMPILE) -c $< | $(instrumentation_munging) ` + +cipher-gcm-intel-pclmul.o: $(srcdir)/cipher-gcm-intel-pclmul.c Makefile + `echo $(COMPILE) -c $< | $(instrumentation_munging) ` + +cipher-gcm-intel-pclmul.lo: $(srcdir)/cipher-gcm-intel-pclmul.c Makefile + `echo $(LTCOMPILE) -c $< | $(instrumentation_munging) ` + +sha1-intel-shaext.o: $(srcdir)/sha1-intel-shaext.c Makefile + `echo $(COMPILE) -c $< | $(instrumentation_munging) ` + +sha1-intel-shaext.lo: $(srcdir)/sha1-intel-shaext.c Makefile + `echo $(LTCOMPILE) -c $< | $(instrumentation_munging) ` + +sha256-intel-shaext.o: $(srcdir)/sha256-intel-shaext.c Makefile + `echo $(COMPILE) -c $< | $(instrumentation_munging) ` + +sha256-intel-shaext.lo: $(srcdir)/sha256-intel-shaext.c Makefile + `echo $(LTCOMPILE) -c $< | $(instrumentation_munging) ` + +sha256-ssse3-i386.o: $(srcdir)/sha256-ssse3-i386.c Makefile + `echo $(COMPILE) -c $< | $(instrumentation_munging) ` + +sha256-ssse3-i386.lo: $(srcdir)/sha256-ssse3-i386.c Makefile + `echo $(LTCOMPILE) -c $< | $(instrumentation_munging) ` + +crc-intel-pclmul.o: $(srcdir)/crc-intel-pclmul.c Makefile + `echo $(COMPILE) -c $< | $(instrumentation_munging) ` + +crc-intel-pclmul.lo: $(srcdir)/crc-intel-pclmul.c Makefile + `echo $(LTCOMPILE) -c $< | $(instrumentation_munging) ` + +if ENABLE_PPC_VCRYPTO_EXTRA_CFLAGS +ppc_vcrypto_cflags =3D -maltivec -mvsx -mcrypto +else +ppc_vcrypto_cflags =3D +endif + +rijndael-ppc.o: $(srcdir)/rijndael-ppc.c Makefile + `echo $(COMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_munging)= ` + +rijndael-ppc.lo: $(srcdir)/rijndael-ppc.c Makefile + `echo $(LTCOMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_mungin= g) ` + +rijndael-ppc9le.o: $(srcdir)/rijndael-ppc9le.c Makefile + `echo $(COMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_munging)= ` + +rijndael-ppc9le.lo: $(srcdir)/rijndael-ppc9le.c Makefile + `echo $(LTCOMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_mungin= g) ` + +rijndael-p10le.o: $(srcdir)/rijndael-p10le.c Makefile + `echo $(COMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_munging)= ` + +rijndael-p10le.lo: $(srcdir)/rijndael-p10le.c Makefile + `echo $(LTCOMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_mungin= g) ` + +sha256-ppc.o: $(srcdir)/sha256-ppc.c Makefile + `echo $(COMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_munging)= ` + +sha256-ppc.lo: $(srcdir)/sha256-ppc.c Makefile + `echo $(LTCOMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_mungin= g) ` + +sha512-ppc.o: $(srcdir)/sha512-ppc.c Makefile + `echo $(COMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_munging)= ` + +sha512-ppc.lo: $(srcdir)/sha512-ppc.c Makefile + `echo $(LTCOMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_mungin= g) ` + +chacha20-ppc.o: $(srcdir)/chacha20-ppc.c Makefile + `echo $(COMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_munging)= ` + +chacha20-ppc.lo: $(srcdir)/chacha20-ppc.c Makefile + `echo $(LTCOMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_mungin= g) ` + +crc-ppc.o: $(srcdir)/crc-ppc.c Makefile + `echo $(COMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_munging)= ` + +crc-ppc.lo: $(srcdir)/crc-ppc.c Makefile + `echo $(LTCOMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_mungin= g) ` + +cipher-gcm-ppc.o: $(srcdir)/cipher-gcm-ppc.c Makefile + `echo $(COMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_munging)= ` =20 -tiger.lo: $(srcdir)/tiger.c - `echo $(LTCOMPILE) -c $(srcdir)/tiger.c | $(o_flag_munging) ` +cipher-gcm-ppc.lo: $(srcdir)/cipher-gcm-ppc.c Makefile + `echo $(LTCOMPILE) $(ppc_vcrypto_cflags) -c $< | $(instrumentation_mungin= g) ` diff --git a/grub-core/lib/libgcrypt/cipher/Manifest b/grub-core/lib/libgcr= ypt/cipher/Manifest deleted file mode 100644 index 0cd64f71f..000000000 --- a/grub-core/lib/libgcrypt/cipher/Manifest +++ /dev/null @@ -1,73 +0,0 @@ -# Manifest - checksums of the cipher directory -# Copyright 2003 Free Software Foundation, Inc. -# -# This file is part of Libgcrypt. -# -# Libgcrypt is free software; you can redistribute it and/or modify -# it under the terms of the GNU Lesser general Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# Libgcrypt is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - -# Checksums for all source files in this directory. Format is -# filename, blanks, base-64 part of an OpenPGP detached signature -# without the header lines. Blank lines and lines beginning with a -# hash mark are ignored. A tool to process this file is available by -# cvs -d :pserver:anoncvs@cvs.gnupg.org:/cvs/wk co misc-scripts/manifest-t= ool -# -# The special entry "$names$" holds a signature over all sorted -# filenames excluding itself. - - -# Algorithm API -cipher.c iQCVAwUAQDzrVjEAnp832S/7AQIPDgP+OVJ/YNWY5m7c09EBbPAzL/WsGoj6wrBNM= mkRlMOqTHeh+OOtjuFHt1f9uhfM2Nzl7sJ5+h4ryZKLEZmQPRMTZTnAqkvGdsrJWJnigUA9QwYd= V0ONqC9C63gpuG465gO9TZVOqlQu/FTxSRuTQYUulkaBNG71n8nZEOusBVwV2YA=3D=3D58xH -pubkey.c iQCVAwUAP9XQ3jEAnp832S/7AQJ5UgQAyHfEBvPVJ8wTRg8c7ixS2GiVmIgwIo5tv= QaiQJTPWASevvYrB+2Z2qa9cATyu50ACjLzbaquGBgPzjJV3dU/qttT1gCqRuN/LCNvXFe5qnIZ= ezejc3RAadFNTw/pOTHq0wxD1Keg66ruei9R36Nba59pEQIWIBXTfubRft2hMYk=3D=3DE09t -ac.c iQCVAwUAQDzsOzEAnp832S/7AQJCBQP/WI6EV/dsR4rmha6RVhvkjZo17kQ8z6pIl5J3c= XOvqEkIFeD2HYu3HHrWST5l7yXlffhpDkVHkfMih4ruK76q6Fm0dxZ98pO4C/dVtgimlvvcy/wO= QjpzsE0fYAe1BYdg81LJ09X33vW5x6C29lunfKROO2tPlV5i8ffeoFvmMF8=3D=3Dj26g -md.c iQCVAwUAP+NFGjEAnp832S/7AQJs8wP/Qdk0EAKsyr3O1/pmOSN8AG4rPKbd6KDTzvoBP= AN4upFwKYY4hWwvy12Q3YU9DmECrzZkRCXHR7mljVQKs6B7CRZJKjFKmOELpcJDtKvu40vTs1bO= H4k9iJYZpGgRA83nkQ+ELAcphAbCA+KIpVr2K4mCJAB0FhpC2uOQ50JHAko=3D=3DBeF6 -primegen.c iQCVAwUAQDzsoDEAnp832S/7AQKYRwP/TqAQBm1rHTnF0HYE05PqXfWlOqa6Eos= qVpaOcs/OIW6PaqX0xH1UlrukK7jNOjK3xC4o1qNQ1UKzz2dvQaq1bMvNNizeavxAh10SJZc0hI= c/ofc83IbjLh8SZVWQ67JxjsUd3DOXmSmhPZ+Pqd7cUIiw8fDoF+I9EZqy3COu1wY=3D=3D1ebT - -# Algorithm implementations -arcfour.c iQCVAwUAP9XR/TEAnp832S/7AQJcRwP6AlvYEx++fpT4mIYo0xRDqKEQeqMQvbaR= hIg2eV74JxItpHa3q5YsYIl+n1yUz5g35JRWWXSWmAZBwO5wLKsHii4kRUhgrKWnSoQZoPpl49L= 5+N3R58ON3S0ru5lsBiEJEze3xplf2vqwrH9v1QHVD+gU7UTlfNqrIJoOUXN+1O4=3D=3DTq+x -blowfish.c iQCVAwUAP9XTETEAnp832S/7AQJaEgQAgiqqfuO+zQtscgTB0rvOzVymIKjRKjY= hFuLjVuc79G4z1RCAffvIn/YM2d7kt+Z/QF7zjcTAOgETCQL1XokpX2zz9HPAMi2tlDY5zsDufT= Nqj0n4WBL9nM7w6XAvsiwP1B3bqCTv9SjJV4KbxJ58vw1yQE+sqW74R/QIHFvC7mU=3D=3DwZnX -cast5.c iQCVAwUAP9XT6DEAnp832S/7AQJ3xgP/ehLjEN3GELGudbqeo91Xd+PqitHrkuBbtR= IYX7Udd/fyXLN+h8rMJVyIQX2m+mpxbBxudVU3x8/DNT8B0ZHAwK6qqJmEBLLhEYPgIuF76i9LM= rP1KqUPhAwRZ2OppjIIugBQ+rP74aD4eLyd/aKQHNuXML8QGWR6KwQShohXM5I=3D=3D/BRh -crc.c iQCVAwUAP7ouejEAnp832S/7AQIgwQQApg5Nm63tH5DQkbN+zPzMO9Ygoj3ukxfFTyTB= PYSXYKMiTjEbESegaU40uN8jnz2vprcIQWcgZfzO4+opEJMcI35aPwzEk0vKOp0S/PrBLUY2rJf= nDVkX5XgJFZa2Q7LLe826UEBzTVYW924utiCCe8oOaOEWVNpg1mqdknu3M9o=3D=3Dkz5D -des.c iQCVAwUAQCN2oDEAnp832S/7AQL/jwP6Auoq6nZCDBjpgc9tDzuIRwa9DqyuM3gX94uv= gEpUwdHszb2bG43dz03kVmcYxtj1MzXbyCeCZOwox0b2SKmLgxIbrNP6yGbzVdTj6592gDYuf/Z= Xmc1ZNJ1DDldcPQ0n9fXUipUPwyPaNWo3mSZaNcMKSWWzdK0J6ciG6nk7SWI=3D=3D9k/t -dsa.c iQCVAwUAP9XZHDEAnp832S/7AQLBRgP/XrBzTEYx5ccMj1MMb6sg37liEHdIyyy49zjv= t6jUqxj4RuwVEN8S6v3u4q/QyJkHAi1E0EkREgENlyHW6PKWhYbcrd0vPIAN15yjnl2yqtrCrJI= mexUCoqJJewK0E4JOicGbabTil8MZjk+mbhEPnjJBqOkyP1w0i31pEDgE/8M=3D=3DpC8s -elgamal.c iQCVAwUAP9XbYzEAnp832S/7AQLXagQA3HrvspZfbTGgmUH0IqLQTJ0exUPxJv5D= ET2TvoIy62trDmMN6lTAj5P+a7jQ8udcu0w+mR2vXUHcxUpNA2PxLaMwGzNSY4zRDNe9r3SFTDr= Fm6m4y9Ko2e8XtEA+WF6P/XLpck4Jn7vMEDmVGPwkNd22kXFFE8dBGwG6i5Hk1Mk=3D=3DoBUs -md4.c iQCVAwUAP9h50DEAnp832S/7AQJhHgQAzNA/B6MWFDlCtPkIVaW8RpP1Eg0ZNMsy0s7S= JkopOCBlu6CwXUOKe+8ppcSxhjYKh4i4uQr/QtfipYlBjzKJGnrafoF/NugXNCOHSTGT11TvK7m= CiBuUMVgvZGAlOJImk6eTTfUjRrMfaXM/SWl8bdJ4ZpzdjEyVh89r7I5JrGk=3D=3Dx2UD -md5.c iQCVAwUAP9h7LzEAnp832S/7AQJUGQP/c0cbf6WZXCzmjufHxiE9FAQBzTsA0WtaNqdF= cHl7fhmikGtknlaED8n5a7eYd/C481UQW6Wgq/oZdsvgoPWPhG3fOCy2CFP9cZVXITuMSf0ucyZ= TFUJNO15fnZ+nDfsUv+JPdv1aSeRinAUtfAcSKfkSyR9BCPZvkx+tgU6cphU=3D=3DZv+h -rijndael.c iQCVAwUAP9h9cTEAnp832S/7AQKF1AP+P2L/tPqDJRDg+/fwbOk8Ts0MNxnvvYE= m3gE73TKuLt1S+B2+jkrZcKNvM5VGPnVMJbnS0lmIK04nmedHCOftGTOwhGulZAHHIaKGystT3J= ql4iPws/JMgAjE7Fyxh5WZMtB9yEljKBpJ5XNqhrMvvxcHpnyP3+YzIXNwzk34V+c=3D=3DdJ5k -rmd160.c iQCVAwUAP9h+bTEAnp832S/7AQK1OgP+PNKF6Nzi6X93easVlksdLqKEsArCAw2Qj= GWDGyxTnbiJM55qAl9JxR1mn3V+oOL7izLLwTt6EYK9evhzfcxY5N5Mni85RAcsLPsuAfQDEzjI= 6GUWHtQUKPbM+BaorzfhQjYFSZyvum/dZYJ/WfiwwwhqqIKyVU2ZFSqA38YGC/c=3D=3D9jdA -rsa.c iQCVAwUAP9iHIzEAnp832S/7AQKAYwQAuWtnMte54QHN+Hij9t4sGuypXogajOb1vQQw= GgS0fKsaBZsuSP2amze4o5diIvsQTsFQ4CzjvqoCVuBDoHM3xkSD8wGDizgvtCamAxkdbF7wmzl= dKFn8SpJqlVwWQMP6kk1IjXHEuYb4IDWGTbVMhfEu+eOlU8+PSK4IhZqNvt4=3D=3D/3hp -serpent.c iQCVAwUAP9h/VzEAnp832S/7AQLyCwP/d1zbmb7l/PriZNa9/Z7mo01XFe5MnAqC= fIwhl9GjeaMszcoS37jECNq5nLvrTTFIIJpm3rvBePwiCG4Wwx1I18HCxaP198pcSaR+BLOJ3Aj= 52EZPrxtqlDKuFr38ZOP5giyUqUYVYGVdrz4kRMNWAZQK53GeJnGhXCnhxojLEgA=3D=3Dck46 -sha1.c iQCVAwUAP9iATTEAnp832S/7AQKcSwQAwAs/HnNqho3lU1ZUgCPNt5P2/Brm6W21+wW= WGKJkSrra/c4NYVKJGDDwlsFE0b9ln1uZt7bHReFkKXK3JnrKTmNVcx/Cy64iCMRNMhaM72Mqy7= wWx5yHBAmMBxzFGnNQKbmeY52zeGih5HsNLSibc2pPuOViWo2JPJ5Ci/wIwl8=3D=3D/wtO -sha256.c iQCVAwUAP9iAtzEAnp832S/7AQJD2QP/UqvL0hhjG1wEFbGrdkV9tba1sMDXdnnK6= X7HdLuRpVAgNiQiFf8JDmntd/dZ2Q71p4Uae2ctqve4WoEijPUZPjACnpuZfx0SEQL0lQBkwxzJ= p7lz9ujVtwQ2cM/aYexJkXcWgGcloJNLM3JbWPGIJnuYbr/IwJ6RQF9vgj0357o=3D=3DUWO1 -sha512.c iQCVAwUAP9iBTDEAnp832S/7AQIPBAQA28CJSUQLiW0s2x9u8/OH2eKnxPjA4sZmb= 50WP7920Lem66P31C3BrOqwfBot4RLhjL+zh/+Uc4s3HPwApZuj9E4BxNMlqLv+Tqk++DAbdaOe= YT4jeUt+mlhQQ6mH/RDsy32rZsNsGQ2bUGxazZmfG++PL3JyhawqCy00SUDr/o0=3D=3DH+0X -tiger.c iQCVAwUAP9iCfjEAnp832S/7AQKufwP/fryv3MqSOYY+90325DH7X3/CtekxeooN0s= cGsHX0fxBakWSMecTNrj33KPddLS46gU/S89zIc2N/Bw/7EVIAXVFA3/3Ip+OrFOuIMO4Py1sCd= B8o2Y+5ygv8iXLcsXIq1O0av79i9g774V3uaXa2qN9ZnXe0AEhcy8FHJ2i/wro=3D=3D5XVB -twofish.c iQCVAwUAP9iD6TEAnp832S/7AQKUnQP/Rq8FaYeHTG7HbZuqAs9pbPitzjDbkdZd= dmInWR7NmevBkKvhsJALjVooc0KGQfo2lAAmy3Xi/4QQN8VPn51DVjDIgf7x+DQh/9TFJHMccxI= 9asUgi4+TNnmMqLU1k3N8S2PjyZ1sjeC8B79fKPpwCzj72WkqPkzZw3l2jArr+dU=3D=3DNdJT -rfc2268.c iQCVAwUAQCN+3jEAnp832S/7AQLv1gQA1hJh29hAjKi4uLSGxXvJ6cyYmPdmevdK= rbLnuHZWtHe4xvCgy/nTdEojEpxgLp/hL/ogasuWRC1W16Wiz9ryxf7YR0uhZWayO/bQNagpfU5= MIkJTLuKqqgpwYumCSQfOugXVAqcgEzj+13eeyJaFVrzwrNa67sh84nmbjOjNjvE=3D=3D0zBq - -# Random number related -random.c iQCVAwUAP7nsITEAnp832S/7AQK4SAQAtvfUgrtGOQ2PlxGMla0qJLPHjJacMwgq0= ecusiI79elPdDsFfCCk6dK1Ug2kFbNm22nCGHNcUquqbX7noi7ZVQnmPBQXzyLNZd7GmrawRZfd= lRerTUDBpSnR8V8ui/5+YYp627E7kKGC0hPSgqXFql6oBMIfno0LZwFJTjIevRY=3D=3DL419 -random.h iQCVAwUAP7ovKDEAnp832S/7AQJ3bQQAjnPebnyTC7sphAv2I7uIz+yPgw1ZfbVhL= v+OiWDlO9ish+fRyyMpy+HELBOgZjJdgRegqhlZC6qyns5arM/VglYi+PzvdLO3hIqHE/YFfpIF= Pz8wBrcmlqrYyd3CsGqcYsfjocXNttCBLeSWmoJ09ltKQH8yzJf3oAgN6X1yuc4=3D=3DeNoU -rand-internal.h iQCVAwUAP7ouvDEAnp832S/7AQLYnAQAhdI7ERoJVCkV8GiV7MjaUxv1WI= L7iZ+jIOvVhv4fNyhCGCGoEtTjkyput/lj7Nsh3FXEqRhypGGrCLf47x/gua5n+BwffogxVyUDq= iOyyGhNTPpe3fQcNBvbPCtco8yMK4GJO5G3BqzlPyN+BMeogLymyV6Sm1mvh5LZDyAFbfQ=3D= =3DtZSE -rndlinux.c iQCVAwUAP9iPYTEAnp832S/7AQL6/AP/ZDrbOkVuB9qJ7sKeX1MImZEsz3mi0xP= ovJzaBtBU7a0idcUKrWYOvQFWRlLUeq0iCT6+h2l5bniP7q7hepzlKa+VPY9VWaQthqeJm2l5LN= 6QQ5PyMfBq04QuBncw9BJnCGmEyTLt3RxIXBAPdxmiVxtcRIFUqCBtQvoUXGLvemw=3D=3Dt37k -rndegd.c iQCVAwUAP9iPRDEAnp832S/7AQImBQP/WHKg+hKXcm1pQvilzML0jZpwK5PAMM4uB= nnPJNIXWOYBO6I/Xg9d/tPLg8NlmmtyQCo2Eu0ybDSt+8mu+dWveAys+0LTi0MIqeP9BMzCKz8d= nWH6+S8huLXwTF3m0IrqM0JLb6b71GK9SOq6sWQ22yW5vf61hXP8kH9dhIaoMZs=3D=3DFaHV -rndunix.c iQCVAwUAP9iQlzEAnp832S/7AQL/KgQA29GnvcD4Xb5qjDMBgW9THEE4+4lfex/6= k+Fh0IT61OLJsWVLJ7bJpRntburw4uQm4Tf7CO8vaiDFDYhKKrzXeOF1fmdpcL8hA+fNp9I/MUO= c4e9kN9+YJ9wikVa0SZj1OBfhzgcFLd1xOtulkr3ii52HLF9vhrxzkgVwvD10Bi8=3D=3D2cML -rndw32.c iQCVAwUAP9iRKDEAnp832S/7AQIuaAQA3AJr3WqnxNDsWCIdvehf8Suotthj+laX8= nJsvDfFhXPKcXDpsg0wTTXSnnKgyED53+uYiMDnVRsxeWAyhKwvx1MjjlaSMMjzbH6isWTH8FaW= pLgrxEkXoPeNqYf5FXpdUkcUxGX2RkQeuX/cIfiHLNE9CV0usaF2jysjBX2iERY=3D=3DEEnO - -# Helper -bithelp.h iQCVAwUAP7ouPTEAnp832S/7AQKXggQAqjcgvihIF3WclOgw1JV2rbARw4ISIDRM= FqdaNCqBRx6BwEz3UGsEIlz6+iR1sS/reqN61WvtjLb+D0+tujAkGrgQJhFLG85WtG2tB5UVoI3= am1fpkwiRm+bR4rv0rGk0BYk81bC7+l4KrK9o5lVp4lCsrorlUKsd48lNmBHyAXM=3D=3DmDDN -rmd.h iQCVAwUAP7oumjEAnp832S/7AQJiJQP/V4bJwjZaYndJzV+KRnIDbl1koHuw+ZK5heMY= Vu8Qk4ylqv//BGyeRa3jZCcfPHI35q6HilCs2VBm8hiBMjHSqY/VPn2ZQ0yg/lt6qEvl7YjsLmy= MICvjG+ncszHoq9pRvnF3vTnM18sPIioXLk8fskuM0XOCNBs0ARBAQjY9UGI=3D=3DolUN - -# Configuration -Makefile.am iQCVAwUAQCN33TEAnp832S/7AQKFJAQAz7BDkC814q+QiuE/jnutJHR5qlgbrm= 3ikGbQwdRzYUscst4bCCWy3uKL/sIPGLg+JQXtF5FnsQy3s4D9BOYhp72cA9ktYK65hhi4pNm/J= Q0lXkZMNfk8Go5lNzKezlWwHvkMwRXR0Fep0wPdyeaKW5BfaW2ABvgep6Bp+hHEbyg=3D=3DzSyi -$names$ iQCVAwUAQCN3EDEAnp832S/7AQJXLAP8DvHTpm5DkTF35EmzeKpi9ie59AZcZanD19= ir/e/7+PaQxr2riuLHDGwFKTju+dcvvBsqrygXOC378GXVWzIF2OZwS4EdDcJ+pgojo9UpsqpKs= JHouY4Ugx5cQialxba462kUn8hcihSBnMyc4LzbJ5WQ4puQuqy544d2x94+2ms=3D=3DG4Ls diff --git a/grub-core/lib/libgcrypt/cipher/ac.c b/grub-core/lib/libgcrypt/= cipher/ac.c deleted file mode 100644 index 63f6fcd11..000000000 --- a/grub-core/lib/libgcrypt/cipher/ac.c +++ /dev/null @@ -1,3301 +0,0 @@ -/* ac.c - Alternative interface for asymmetric cryptography. - Copyright (C) 2003, 2004, 2005, 2006 - 2007, 2008 Free Software Foundation, Inc. - - This file is part of Libgcrypt. - - Libgcrypt is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser general Public License as - published by the Free Software Foundation; either version 2.1 of - the License, or (at your option) any later version. - - Libgcrypt is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program; if not, see . - */ - -#include -#include -#include -#include -#include -#include - -#include "g10lib.h" -#include "cipher.h" -#include "mpi.h" - -=0C - -/* At the moment the ac interface is a wrapper around the pk - interface, but this might change somewhen in the future, depending - on how many people prefer the ac interface. */ - -/* Mapping of flag numbers to the according strings as it is expected - for S-expressions. */ -static struct number_string -{ - int number; - const char *string; -} ac_flags[] =3D - { - { GCRY_AC_FLAG_NO_BLINDING, "no-blinding" }, - }; - -/* The positions in this list correspond to the values contained in - the gcry_ac_key_type_t enumeration list. */ -static const char *ac_key_identifiers[] =3D - { - "private-key", - "public-key" - }; - -/* These specifications are needed for key-pair generation; the caller - is allowed to pass additional, algorithm-specific `specs' to - gcry_ac_key_pair_generate. This list is used for decoding the - provided values according to the selected algorithm. */ -struct gcry_ac_key_generate_spec -{ - int algorithm; /* Algorithm for which this flag is - relevant. */ - const char *name; /* Name of this flag. */ - size_t offset; /* Offset in the cipher-specific spec - structure at which the MPI value - associated with this flag is to be - found. */ -} ac_key_generate_specs[] =3D - { - { GCRY_AC_RSA, "rsa-use-e", offsetof (gcry_ac_key_spec_rsa_t, e) }, - { 0 } - }; - -/* Handle structure. */ -struct gcry_ac_handle -{ - int algorithm; /* Algorithm ID associated with this - handle. */ - const char *algorithm_name; /* Name of the algorithm. */ - unsigned int flags; /* Flags, not used yet. */ - gcry_module_t module; /* Reference to the algorithm - module. */ -}; - -/* A named MPI value. */ -typedef struct gcry_ac_mpi -{ - char *name; /* Self-maintained copy of name. */ - gcry_mpi_t mpi; /* MPI value. */ - unsigned int flags; /* Flags. */ -} gcry_ac_mpi_t; - -/* A data set, that is simply a list of named MPI values. */ -struct gcry_ac_data -{ - gcry_ac_mpi_t *data; /* List of named values. */ - unsigned int data_n; /* Number of values in DATA. */ -}; - -/* A single key. */ -struct gcry_ac_key -{ - gcry_ac_data_t data; /* Data in native ac structure. */ - gcry_ac_key_type_t type; /* Type of the key. */ -}; - -/* A key pair. */ -struct gcry_ac_key_pair -{ - gcry_ac_key_t public; - gcry_ac_key_t secret; -}; - -=0C - -/* - * Functions for working with data sets. - */ - -/* Creates a new, empty data set and store it in DATA. */ -gcry_error_t -_gcry_ac_data_new (gcry_ac_data_t *data) -{ - gcry_ac_data_t data_new; - gcry_error_t err; - - if (fips_mode ()) - return gpg_error (GPG_ERR_NOT_SUPPORTED); - - data_new =3D gcry_malloc (sizeof (*data_new)); - if (! data_new) - { - err =3D gcry_error_from_errno (errno); - goto out; - } - - data_new->data =3D NULL; - data_new->data_n =3D 0; - *data =3D data_new; - err =3D 0; - - out: - - return err; -} - -/* Destroys all the entries in DATA, but not DATA itself. */ -static void -ac_data_values_destroy (gcry_ac_data_t data) -{ - unsigned int i; - - for (i =3D 0; i < data->data_n; i++) - if (data->data[i].flags & GCRY_AC_FLAG_DEALLOC) - { - gcry_mpi_release (data->data[i].mpi); - gcry_free (data->data[i].name); - } -} - -/* Destroys the data set DATA. */ -void -_gcry_ac_data_destroy (gcry_ac_data_t data) -{ - if (data) - { - ac_data_values_destroy (data); - gcry_free (data->data); - gcry_free (data); - } -} - -/* This function creates a copy of the array of named MPIs DATA_MPIS, - which is of length DATA_MPIS_N; the copy is stored in - DATA_MPIS_CP. */ -static gcry_error_t -ac_data_mpi_copy (gcry_ac_mpi_t *data_mpis, unsigned int data_mpis_n, - gcry_ac_mpi_t **data_mpis_cp) -{ - gcry_ac_mpi_t *data_mpis_new; - gcry_error_t err; - unsigned int i; - gcry_mpi_t mpi; - char *label; - - data_mpis_new =3D gcry_calloc (data_mpis_n, sizeof (*data_mpis_new)); - if (! data_mpis_new) - { - err =3D gcry_error_from_errno (errno); - goto out; - } - memset (data_mpis_new, 0, sizeof (*data_mpis_new) * data_mpis_n); - - err =3D 0; - for (i =3D 0; i < data_mpis_n; i++) - { - /* Copy values. */ - - label =3D gcry_strdup (data_mpis[i].name); - mpi =3D gcry_mpi_copy (data_mpis[i].mpi); - if (! (label && mpi)) - { - err =3D gcry_error_from_errno (errno); - gcry_mpi_release (mpi); - gcry_free (label); - break; - } - - data_mpis_new[i].flags =3D GCRY_AC_FLAG_DEALLOC; - data_mpis_new[i].name =3D label; - data_mpis_new[i].mpi =3D mpi; - } - if (err) - goto out; - - *data_mpis_cp =3D data_mpis_new; - err =3D 0; - - out: - - if (err) - if (data_mpis_new) - { - for (i =3D 0; i < data_mpis_n; i++) - { - gcry_mpi_release (data_mpis_new[i].mpi); - gcry_free (data_mpis_new[i].name); - } - gcry_free (data_mpis_new); - } - - return err; -} - -/* Create a copy of the data set DATA and store it in DATA_CP. */ -gcry_error_t -_gcry_ac_data_copy (gcry_ac_data_t *data_cp, gcry_ac_data_t data) -{ - gcry_ac_mpi_t *data_mpis =3D NULL; - gcry_ac_data_t data_new; - gcry_error_t err; - - if (fips_mode ()) - return gpg_error (GPG_ERR_NOT_SUPPORTED); - - /* Allocate data set. */ - data_new =3D gcry_malloc (sizeof (*data_new)); - if (! data_new) - { - err =3D gcry_error_from_errno (errno); - goto out; - } - - err =3D ac_data_mpi_copy (data->data, data->data_n, &data_mpis); - if (err) - goto out; - - data_new->data_n =3D data->data_n; - data_new->data =3D data_mpis; - *data_cp =3D data_new; - - out: - - if (err) - gcry_free (data_new); - - return err; -} - -/* Returns the number of named MPI values inside of the data set - DATA. */ -unsigned int -_gcry_ac_data_length (gcry_ac_data_t data) -{ - return data->data_n; -} - - -/* Add the value MPI to DATA with the label NAME. If FLAGS contains - GCRY_AC_FLAG_COPY, the data set will contain copies of NAME - and MPI. If FLAGS contains GCRY_AC_FLAG_DEALLOC or - GCRY_AC_FLAG_COPY, the values contained in the data set will - be deallocated when they are to be removed from the data set. */ -gcry_error_t -_gcry_ac_data_set (gcry_ac_data_t data, unsigned int flags, - const char *name, gcry_mpi_t mpi) -{ - gcry_error_t err; - gcry_mpi_t mpi_cp; - char *name_cp; - unsigned int i; - - name_cp =3D NULL; - mpi_cp =3D NULL; - - if (fips_mode ()) - return gpg_error (GPG_ERR_NOT_SUPPORTED); - - if (flags & ~(GCRY_AC_FLAG_DEALLOC | GCRY_AC_FLAG_COPY)) - { - err =3D gcry_error (GPG_ERR_INV_ARG); - goto out; - } - - if (flags & GCRY_AC_FLAG_COPY) - { - /* Create copies. */ - - flags |=3D GCRY_AC_FLAG_DEALLOC; - name_cp =3D gcry_strdup (name); - mpi_cp =3D gcry_mpi_copy (mpi); - if (! (name_cp && mpi_cp)) - { - err =3D gcry_error_from_errno (errno); - goto out; - } - } - - /* Search for existing entry. */ - for (i =3D 0; i < data->data_n; i++) - if (! strcmp (name, data->data[i].name)) - break; - if (i < data->data_n) - { - /* An entry for NAME does already exist. */ - if (data->data[i].flags & GCRY_AC_FLAG_DEALLOC) - { - gcry_mpi_release (data->data[i].mpi); - gcry_free (data->data[i].name); - } - } - else - { - /* Create a new entry. */ - - gcry_ac_mpi_t *ac_mpis; - - ac_mpis =3D gcry_realloc (data->data, - sizeof (*data->data) * (data->data_n + 1)); - if (! ac_mpis) - { - err =3D gcry_error_from_errno (errno); - goto out; - } - - if (data->data !=3D ac_mpis) - data->data =3D ac_mpis; - data->data_n++; - } - - data->data[i].name =3D name_cp ? name_cp : ((char *) name); - data->data[i].mpi =3D mpi_cp ? mpi_cp : mpi; - data->data[i].flags =3D flags; - err =3D 0; - - out: - - if (err) - { - gcry_mpi_release (mpi_cp); - gcry_free (name_cp); - } - - return err; -} - -/* Stores the value labelled with NAME found in the data set DATA in - MPI. The returned MPI value will be released in case - gcry_ac_data_set is used to associate the label NAME with a - different MPI value. */ -gcry_error_t -_gcry_ac_data_get_name (gcry_ac_data_t data, unsigned int flags, - const char *name, gcry_mpi_t *mpi) -{ - gcry_mpi_t mpi_return; - gcry_error_t err; - unsigned int i; - - if (fips_mode ()) - return gpg_error (GPG_ERR_NOT_SUPPORTED); - - if (flags & ~(GCRY_AC_FLAG_COPY)) - { - err =3D gcry_error (GPG_ERR_INV_ARG); - goto out; - } - - for (i =3D 0; i < data->data_n; i++) - if (! strcmp (name, data->data[i].name)) - break; - if (i =3D=3D data->data_n) - { - err =3D gcry_error (GPG_ERR_NOT_FOUND); - goto out; - } - - if (flags & GCRY_AC_FLAG_COPY) - { - mpi_return =3D gcry_mpi_copy (data->data[i].mpi); - if (! mpi_return) - { - err =3D gcry_error_from_errno (errno); /* FIXME? */ - goto out; - } - } - else - mpi_return =3D data->data[i].mpi; - - *mpi =3D mpi_return; - err =3D 0; - - out: - - return err; -} - -/* Stores in NAME and MPI the named MPI value contained in the data - set DATA with the index IDX. NAME or MPI may be NULL. The - returned MPI value will be released in case gcry_ac_data_set is - used to associate the label NAME with a different MPI value. */ -gcry_error_t -_gcry_ac_data_get_index (gcry_ac_data_t data, unsigned int flags, - unsigned int idx, - const char **name, gcry_mpi_t *mpi) -{ - gcry_error_t err; - gcry_mpi_t mpi_cp; - char *name_cp; - - name_cp =3D NULL; - mpi_cp =3D NULL; - - if (fips_mode ()) - return gpg_error (GPG_ERR_NOT_SUPPORTED); - - if (flags & ~(GCRY_AC_FLAG_COPY)) - { - err =3D gcry_error (GPG_ERR_INV_ARG); - goto out; - } - - if (idx >=3D data->data_n) - { - err =3D gcry_error (GPG_ERR_INV_ARG); - goto out; - } - - if (flags & GCRY_AC_FLAG_COPY) - { - /* Return copies to the user. */ - if (name) - { - name_cp =3D gcry_strdup (data->data[idx].name); - if (! name_cp) - { - err =3D gcry_error_from_errno (errno); - goto out; - } - } - if (mpi) - { - mpi_cp =3D gcry_mpi_copy (data->data[idx].mpi); - if (! mpi_cp) - { - err =3D gcry_error_from_errno (errno); - goto out; - } - } - } - - if (name) - *name =3D name_cp ? name_cp : data->data[idx].name; - if (mpi) - *mpi =3D mpi_cp ? mpi_cp : data->data[idx].mpi; - err =3D 0; - - out: - - if (err) - { - gcry_mpi_release (mpi_cp); - gcry_free (name_cp); - } - - return err; -} - -/* Convert the data set DATA into a new S-Expression, which is to be - stored in SEXP, according to the identifiers contained in - IDENTIFIERS. */ -gcry_error_t -_gcry_ac_data_to_sexp (gcry_ac_data_t data, gcry_sexp_t *sexp, - const char **identifiers) -{ - gcry_sexp_t sexp_new; - gcry_error_t err; - char *sexp_buffer; - size_t sexp_buffer_n; - size_t identifiers_n; - const char *label; - gcry_mpi_t mpi; - void **arg_list; - size_t data_n; - unsigned int i; - - sexp_buffer_n =3D 1; - sexp_buffer =3D NULL; - arg_list =3D NULL; - err =3D 0; - - if (fips_mode ()) - return gpg_error (GPG_ERR_NOT_SUPPORTED); - - /* Calculate size of S-expression representation. */ - - i =3D 0; - if (identifiers) - while (identifiers[i]) - { - /* For each identifier, we add "()". */ - sexp_buffer_n +=3D 1 + strlen (identifiers[i]) + 1; - i++; - } - identifiers_n =3D i; - - if (! identifiers_n) - /* If there are NO identifiers, we still add surrounding braces so - that we have a list of named MPI value lists. Otherwise it - wouldn't be too much fun to process these lists. */ - sexp_buffer_n +=3D 2; - - data_n =3D _gcry_ac_data_length (data); - for (i =3D 0; i < data_n; i++) - { - err =3D gcry_ac_data_get_index (data, 0, i, &label, NULL); - if (err) - break; - /* For each MPI we add "(