././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.7460864 pynacl-1.6.2/0000755000175100017510000000000015125531066012460 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/CHANGELOG.rst0000644000175100017510000001277315125531055014511 0ustar00runnerrunnerChangelog ========= 1.6.2 (2026-01-01) ------------------ * Updated ``libsodium`` to 1.0.20-stable (2025-12-31 build) to resolve ``CVE-2025-69277``. 1.6.1 (2025-11-10) ------------------ * The ``MAKE`` environment variable can now be used to specify the ``make`` binary that should be used in the build process. 1.6.0 (2025-09-11) ------------------ * **BACKWARDS INCOMPATIBLE:** Removed support for Python 3.6 and 3.7. * Added support for the low level AEAD AES bindings. * Added support for ``crypto_core_ed25519_from_uniform``. * Update ``libsodium`` to 1.0.20-stable (2025-08-27 build). * Added support for free-threaded Python 3.14. * Added support for Windows on ARM wheels. 1.5.0 (2022-01-07) ------------------ * **BACKWARDS INCOMPATIBLE:** Removed support for Python 2.7 and Python 3.5. * **BACKWARDS INCOMPATIBLE:** We no longer distribute ``manylinux1`` wheels. * Added ``manylinux2014``, ``manylinux_2_24``, ``musllinux``, and macOS ``universal2`` wheels (the latter supports macOS ``arm64``). * Update ``libsodium`` to 1.0.18-stable (July 25, 2021 release). * Add inline type hints. 1.4.0 (2020-05-25) ------------------ * Update ``libsodium`` to 1.0.18. * **BACKWARDS INCOMPATIBLE:** We no longer distribute 32-bit ``manylinux1`` wheels. Continuing to produce them was a maintenance burden. * Added support for Python 3.8, and removed support for Python 3.4. * Add low level bindings for extracting the seed and the public key from crypto_sign_ed25519 secret key * Add low level bindings for deterministic random generation. * Add ``wheel`` and ``setuptools`` setup_requirements in ``setup.py`` (#485) * Fix checks on very slow builders (#481, #495) * Add low-level bindings to ed25519 arithmetic functions * Update low-level blake2b state implementation * Fix wrong short-input behavior of SealedBox.decrypt() (#517) * Raise CryptPrefixError exception instead of InvalidkeyError when trying to check a password against a verifier stored in a unknown format (#519) * Add support for minimal builds of libsodium. Trying to call functions not available in a minimal build will raise an UnavailableError exception. To compile a minimal build of the bundled libsodium, set the SODIUM_INSTALL_MINIMAL environment variable to any non-empty string (e.g. ``SODIUM_INSTALL_MINIMAL=1``) for setup. 1.3.0 2018-09-26 ---------------- * Added support for Python 3.7. * Update ``libsodium`` to 1.0.16. * Run and test all code examples in PyNaCl docs through sphinx's doctest builder. * Add low-level bindings for chacha20-poly1305 AEAD constructions. * Add low-level bindings for the chacha20-poly1305 secretstream constructions. * Add low-level bindings for ed25519ph pre-hashed signing construction. * Add low-level bindings for constant-time increment and addition on fixed-precision big integers represented as little-endian byte sequences. * Add low-level bindings for the ISO/IEC 7816-4 compatible padding API. * Add low-level bindings for libsodium's crypto_kx... key exchange construction. * Set hypothesis deadline to None in tests/test_pwhash.py to avoid incorrect test failures on slower processor architectures. GitHub issue #370 1.2.1 - 2017-12-04 ------------------ * Update hypothesis minimum allowed version. * Infrastructure: add proper configuration for readthedocs builder runtime environment. 1.2.0 - 2017-11-01 ------------------ * Update ``libsodium`` to 1.0.15. * Infrastructure: add jenkins support for automatic build of ``manylinux1`` binary wheels * Added support for ``SealedBox`` construction. * Added support for ``argon2i`` and ``argon2id`` password hashing constructs and restructured high-level password hashing implementation to expose the same interface for all hashers. * Added support for 128 bit ``siphashx24`` variant of ``siphash24``. * Added support for ``from_seed`` APIs for X25519 key pair generation. * Dropped support for Python 3.3. 1.1.2 - 2017-03-31 ------------------ * reorder link time library search path when using bundled libsodium 1.1.1 - 2017-03-15 ------------------ * Fixed a circular import bug in ``nacl.utils``. 1.1.0 - 2017-03-14 ------------------ * Dropped support for Python 2.6. * Added ``shared_key()`` method on ``Box``. * You can now pass ``None`` to ``nonce`` when encrypting with ``Box`` or ``SecretBox`` and it will automatically generate a random nonce. * Added support for ``siphash24``. * Added support for ``blake2b``. * Added support for ``scrypt``. * Update ``libsodium`` to 1.0.11. * Default to the bundled ``libsodium`` when compiling. * All raised exceptions are defined mixing-in ``nacl.exceptions.CryptoError`` 1.0.1 - 2016-01-24 ------------------ * Fix an issue with absolute paths that prevented the creation of wheels. 1.0 - 2016-01-23 ---------------- * PyNaCl has been ported to use the new APIs available in cffi 1.0+. Due to this change we no longer support PyPy releases older than 2.6. * Python 3.2 support has been dropped. * Functions to convert between Ed25519 and Curve25519 keys have been added. 0.3.0 - 2015-03-04 ------------------ * The low-level API (`nacl.c.*`) has been changed to match the upstream NaCl C/C++ conventions (as well as those of other NaCl bindings). The order of arguments and return values has changed significantly. To avoid silent failures, `nacl.c` has been removed, and replaced with `nacl.bindings` (with the new argument ordering). If you have code which calls these functions (e.g. `nacl.c.crypto_box_keypair()`), you must review the new docstrings and update your code/imports to match the new conventions. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/INSTALL.rst0000644000175100017510000000320115125531055014312 0ustar00runnerrunnerInstallation ============ Binary wheel install -------------------- PyNaCl ships as a binary wheel on macOS, Windows and Linux ``manylinux1`` [#many]_ , so all dependencies are included. Make sure you have an up-to-date pip and run: .. code-block:: console $ pip install pynacl Faster wheel build ------------------ You can define the environment variable ``LIBSODIUM_MAKE_ARGS`` to pass arguments to ``make`` and enable `parallelization`_: .. code-block:: console $ LIBSODIUM_MAKE_ARGS=-j4 pip install pynacl Linux source build ------------------ PyNaCl relies on `libsodium`_, a portable C library. A copy is bundled with PyNaCl so to install you can run: .. code-block:: console $ pip install pynacl If you'd prefer to use the version of ``libsodium`` provided by your distribution, you can disable the bundled copy during install by running: .. code-block:: console $ SODIUM_INSTALL=system pip install pynacl .. warning:: Usage of the legacy ``easy_install`` command provided by setuptools is generally discouraged, and is completely unsupported in PyNaCl's case. .. _parallelization: https://www.gnu.org/software/make/manual/html_node/Parallel.html .. _libsodium: https://github.com/jedisct1/libsodium .. [#many] `manylinux1 wheels `_ are built on a baseline linux environment based on Centos 5.11 and should work on most x86 and x86_64 glibc based linux environments. GNU Make (gmake) may be required for newer versions of PyNaCl. You can set the binary to use by setting the ``MAKE`` environment variable: .. code-block:: console $ MAKE=gmake pip install pynacl ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/LICENSE0000644000175100017510000002273615125531055013475 0ustar00runnerrunner Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/MANIFEST.in0000644000175100017510000000243215125531055014215 0ustar00runnerrunnerinclude noxfile.py include LICENSE include README.rst include CHANGELOG.rst include INSTALL.rst include pyproject.toml # libsodium files recursive-include src/libsodium * recursive-include src/libsodium *.S recursive-include src/libsodium *.ac recursive-include src/libsodium *.am recursive-include src/libsodium *.c recursive-include src/libsodium *.exp recursive-include src/libsodium *.guess recursive-include src/libsodium *.h recursive-include src/libsodium *.in recursive-include src/libsodium *.m4 recursive-include src/libsodium *.markdown recursive-include src/libsodium *.sh recursive-include src/libsodium *.sub # test files recursive-include docs *.png recursive-include docs *.py recursive-include docs *.rst recursive-include docs Makefile recursive-include docs/vectors/c-source *.c prune docs/_build recursive-include tests *.py recursive-include tests/data * # Remove CFFI files global-exclude __pycache__/* # Add PyNaCl header files recursive-include src/bindings *.py *.h # Remove our CI files recursive-exclude .github * # Remove readthedocs config exclude .readthedocs.yml # Remove the coverage config exclude .coveragerc # exclude codecov exclude codecov.yml # Remove release automation script exclude release.py # Exclude the libsodium msvc zip exclude src/libsodium*.zip ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.7460864 pynacl-1.6.2/PKG-INFO0000644000175100017510000002337115125531066013563 0ustar00runnerrunnerMetadata-Version: 2.4 Name: PyNaCl Version: 1.6.2 Summary: Python binding to the Networking and Cryptography (NaCl) library Home-page: https://github.com/pyca/pynacl/ Author-email: The PyNaCl developers License: Apache-2.0 Project-URL: Homepage, https://github.com/pyca/pynacl Project-URL: Bug Tracker, https://github.com/pyca/pynacl/issues Project-URL: Documentation, https://pynacl.readthedocs.io Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Programming Language :: Python :: Free Threading :: 3 - Stable Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3.14 Requires-Python: >=3.8 License-File: LICENSE License-File: licenses/LICENSE.libsodium.txt Requires-Dist: cffi>=1.4.1; platform_python_implementation != "PyPy" and python_version < "3.9" Requires-Dist: cffi>=2.0.0; platform_python_implementation != "PyPy" and python_version >= "3.9" Provides-Extra: tests Requires-Dist: pytest>=7.4.0; extra == "tests" Requires-Dist: pytest-cov>=2.10.1; extra == "tests" Requires-Dist: pytest-xdist>=3.5.0; extra == "tests" Requires-Dist: hypothesis>=3.27.0; extra == "tests" Provides-Extra: docs Requires-Dist: sphinx<7; extra == "docs" Requires-Dist: sphinx_rtd_theme; extra == "docs" Dynamic: description Dynamic: home-page Dynamic: license-file =============================================== PyNaCl: Python binding to the libsodium library =============================================== .. image:: https://img.shields.io/pypi/v/pynacl.svg :target: https://pypi.org/project/PyNaCl/ :alt: Latest Version PyNaCl is a Python binding to `libsodium`_, which is a fork of the `Networking and Cryptography library`_. These libraries have a stated goal of improving usability, security and speed. It supports Python 3.8+ as well as PyPy 3. .. _libsodium: https://github.com/jedisct1/libsodium .. _Networking and Cryptography library: https://nacl.cr.yp.to/ Features -------- * Digital signatures * Secret-key encryption * Public-key encryption * Hashing and message authentication * Password based key derivation and password hashing `Changelog`_ ------------ .. _Changelog: https://pynacl.readthedocs.io/en/latest/changelog/ Installation ============ Binary wheel install -------------------- PyNaCl ships as a binary wheel on macOS, Windows and Linux ``manylinux1`` [#many]_ , so all dependencies are included. Make sure you have an up-to-date pip and run: .. code-block:: console $ pip install pynacl Faster wheel build ------------------ You can define the environment variable ``LIBSODIUM_MAKE_ARGS`` to pass arguments to ``make`` and enable `parallelization`_: .. code-block:: console $ LIBSODIUM_MAKE_ARGS=-j4 pip install pynacl Linux source build ------------------ PyNaCl relies on `libsodium`_, a portable C library. A copy is bundled with PyNaCl so to install you can run: .. code-block:: console $ pip install pynacl If you'd prefer to use the version of ``libsodium`` provided by your distribution, you can disable the bundled copy during install by running: .. code-block:: console $ SODIUM_INSTALL=system pip install pynacl .. warning:: Usage of the legacy ``easy_install`` command provided by setuptools is generally discouraged, and is completely unsupported in PyNaCl's case. .. _parallelization: https://www.gnu.org/software/make/manual/html_node/Parallel.html .. _libsodium: https://github.com/jedisct1/libsodium .. [#many] `manylinux1 wheels `_ are built on a baseline linux environment based on Centos 5.11 and should work on most x86 and x86_64 glibc based linux environments. GNU Make (gmake) may be required for newer versions of PyNaCl. You can set the binary to use by setting the ``MAKE`` environment variable: .. code-block:: console $ MAKE=gmake pip install pynacl Changelog ========= 1.6.2 (2026-01-01) ------------------ * Updated ``libsodium`` to 1.0.20-stable (2025-12-31 build) to resolve ``CVE-2025-69277``. 1.6.1 (2025-11-10) ------------------ * The ``MAKE`` environment variable can now be used to specify the ``make`` binary that should be used in the build process. 1.6.0 (2025-09-11) ------------------ * **BACKWARDS INCOMPATIBLE:** Removed support for Python 3.6 and 3.7. * Added support for the low level AEAD AES bindings. * Added support for ``crypto_core_ed25519_from_uniform``. * Update ``libsodium`` to 1.0.20-stable (2025-08-27 build). * Added support for free-threaded Python 3.14. * Added support for Windows on ARM wheels. 1.5.0 (2022-01-07) ------------------ * **BACKWARDS INCOMPATIBLE:** Removed support for Python 2.7 and Python 3.5. * **BACKWARDS INCOMPATIBLE:** We no longer distribute ``manylinux1`` wheels. * Added ``manylinux2014``, ``manylinux_2_24``, ``musllinux``, and macOS ``universal2`` wheels (the latter supports macOS ``arm64``). * Update ``libsodium`` to 1.0.18-stable (July 25, 2021 release). * Add inline type hints. 1.4.0 (2020-05-25) ------------------ * Update ``libsodium`` to 1.0.18. * **BACKWARDS INCOMPATIBLE:** We no longer distribute 32-bit ``manylinux1`` wheels. Continuing to produce them was a maintenance burden. * Added support for Python 3.8, and removed support for Python 3.4. * Add low level bindings for extracting the seed and the public key from crypto_sign_ed25519 secret key * Add low level bindings for deterministic random generation. * Add ``wheel`` and ``setuptools`` setup_requirements in ``setup.py`` (#485) * Fix checks on very slow builders (#481, #495) * Add low-level bindings to ed25519 arithmetic functions * Update low-level blake2b state implementation * Fix wrong short-input behavior of SealedBox.decrypt() (#517) * Raise CryptPrefixError exception instead of InvalidkeyError when trying to check a password against a verifier stored in a unknown format (#519) * Add support for minimal builds of libsodium. Trying to call functions not available in a minimal build will raise an UnavailableError exception. To compile a minimal build of the bundled libsodium, set the SODIUM_INSTALL_MINIMAL environment variable to any non-empty string (e.g. ``SODIUM_INSTALL_MINIMAL=1``) for setup. 1.3.0 2018-09-26 ---------------- * Added support for Python 3.7. * Update ``libsodium`` to 1.0.16. * Run and test all code examples in PyNaCl docs through sphinx's doctest builder. * Add low-level bindings for chacha20-poly1305 AEAD constructions. * Add low-level bindings for the chacha20-poly1305 secretstream constructions. * Add low-level bindings for ed25519ph pre-hashed signing construction. * Add low-level bindings for constant-time increment and addition on fixed-precision big integers represented as little-endian byte sequences. * Add low-level bindings for the ISO/IEC 7816-4 compatible padding API. * Add low-level bindings for libsodium's crypto_kx... key exchange construction. * Set hypothesis deadline to None in tests/test_pwhash.py to avoid incorrect test failures on slower processor architectures. GitHub issue #370 1.2.1 - 2017-12-04 ------------------ * Update hypothesis minimum allowed version. * Infrastructure: add proper configuration for readthedocs builder runtime environment. 1.2.0 - 2017-11-01 ------------------ * Update ``libsodium`` to 1.0.15. * Infrastructure: add jenkins support for automatic build of ``manylinux1`` binary wheels * Added support for ``SealedBox`` construction. * Added support for ``argon2i`` and ``argon2id`` password hashing constructs and restructured high-level password hashing implementation to expose the same interface for all hashers. * Added support for 128 bit ``siphashx24`` variant of ``siphash24``. * Added support for ``from_seed`` APIs for X25519 key pair generation. * Dropped support for Python 3.3. 1.1.2 - 2017-03-31 ------------------ * reorder link time library search path when using bundled libsodium 1.1.1 - 2017-03-15 ------------------ * Fixed a circular import bug in ``nacl.utils``. 1.1.0 - 2017-03-14 ------------------ * Dropped support for Python 2.6. * Added ``shared_key()`` method on ``Box``. * You can now pass ``None`` to ``nonce`` when encrypting with ``Box`` or ``SecretBox`` and it will automatically generate a random nonce. * Added support for ``siphash24``. * Added support for ``blake2b``. * Added support for ``scrypt``. * Update ``libsodium`` to 1.0.11. * Default to the bundled ``libsodium`` when compiling. * All raised exceptions are defined mixing-in ``nacl.exceptions.CryptoError`` 1.0.1 - 2016-01-24 ------------------ * Fix an issue with absolute paths that prevented the creation of wheels. 1.0 - 2016-01-23 ---------------- * PyNaCl has been ported to use the new APIs available in cffi 1.0+. Due to this change we no longer support PyPy releases older than 2.6. * Python 3.2 support has been dropped. * Functions to convert between Ed25519 and Curve25519 keys have been added. 0.3.0 - 2015-03-04 ------------------ * The low-level API (`nacl.c.*`) has been changed to match the upstream NaCl C/C++ conventions (as well as those of other NaCl bindings). The order of arguments and return values has changed significantly. To avoid silent failures, `nacl.c` has been removed, and replaced with `nacl.bindings` (with the new argument ordering). If you have code which calls these functions (e.g. `nacl.c.crypto_box_keypair()`), you must review the new docstrings and update your code/imports to match the new conventions. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/README.rst0000644000175100017510000000157115125531055014151 0ustar00runnerrunner=============================================== PyNaCl: Python binding to the libsodium library =============================================== .. image:: https://img.shields.io/pypi/v/pynacl.svg :target: https://pypi.org/project/PyNaCl/ :alt: Latest Version PyNaCl is a Python binding to `libsodium`_, which is a fork of the `Networking and Cryptography library`_. These libraries have a stated goal of improving usability, security and speed. It supports Python 3.8+ as well as PyPy 3. .. _libsodium: https://github.com/jedisct1/libsodium .. _Networking and Cryptography library: https://nacl.cr.yp.to/ Features -------- * Digital signatures * Secret-key encryption * Public-key encryption * Hashing and message authentication * Password based key derivation and password hashing `Changelog`_ ------------ .. _Changelog: https://pynacl.readthedocs.io/en/latest/changelog/ ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.6100867 pynacl-1.6.2/docs/0000755000175100017510000000000015125531066013410 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/Makefile0000644000175100017510000001267415125531055015060 0ustar00runnerrunner# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PyNaCl.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PyNaCl.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/PyNaCl" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PyNaCl" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.6100867 pynacl-1.6.2/docs/_static/0000755000175100017510000000000015125531066015036 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/_static/ed25519.png0000644000175100017510000026623315125531055016554 0ustar00runnerrunnerPNG  IHDRfS pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_FaIDATxu|?>wWH.!!$b (RZ(V@)=AC BBܓs1w{{ّ׼Bp O#.?)D}zA}~wg,^mNW A\#}q#F4ѻ[ #T}:8+FaFx:O _gjAevF.+0::Tv6 _Gg|cQ˄5R eH)UF;ʌn3*ٷZV!1F 3YfM}C)3lesy6WsCzB!O{T$% rT U*++?~J]ځ vfkQѱI&uֵD P]]]ZZ*e2YMMSAQT,bX,D"P(\`mGW{0c40"YM*7#Toٸq=࿫Y|~ }}}kCA_S.gfffffz*===777??_my{{ԩS'88f[E9R{+ЯAt0̐29Cnj!6=鄿1 _VZ<(hL!l-`tp WnCB w>NO{]kܤ'fqFaׯ_{nzzRD%$$$44Y(D"H`&JRL&dRիWeeeUUUHԠAm5j eE<)tw4 9)+Z9,.ilwvQqdukqē'Olvxxx۶m4iΜ?ETegg?}ƍ)))WWרo[n666E0_(ШHńԦK]扖w EDV¤;mllZ &ѣ2ҚCt5hBq۵kW/yё#G:TZZخ](___E"Z{ݺuƍ#G0`@XXؿko盡D[dca"!Cʐq5cO*^`1^;M[7h~ruZqq'7q2 ?Ñ4֠OP^|~JZZߗ,aν=}tҥΝCQ}Fܹy2aOh6m~~~||}>|( Vb$Uz #5=7|I}䟆"=EpDAp|b}F@Pk/FK*{iX&Or.^"[n 2do޼!H8lٲ޽{k4Ç:uaÆ&z&ˏ\qqq׮][fͫW:d08iOui@Fzth(TA8V8G խ6Ji=]nTӡ'V3W39cA#F/9 T }JGHԝ #ӈ?QG_ zZ3ĀU$BѾ}>|̘1΍7СC tϚ5kʕ]tٵkB}&)@o6%M7bĈaÆIЙiTNMr|4B% voZl "#R^HEpO?bsPNu夃$]ҨI!U(55542{lV|ׯ_~}…!!![mݺʕ+W\wmݺU 0Hu w\4nի}?~ݠA"s͐~v(5h3-T_Ͷ@fQfjT/ꩇA 눜_P.`БO/Z Zj`D >ycbtܛ7o޼y{n >>h4<ҥKz\]]x~{!aؘ1cRRRa;SLy⅓Z[lY`Aaaa6m> k&:WRg<=RD噂E!$@lc*.)*NB!+9BP.9">9\^PV#8:G59b |a%kIBTj5jԣG:t]իGh܏=6x`C[J5kV\\9۷o\.@&x1)))--M^xqbIIĉGT* g.] ޽~ǦM τ 6mtYCEsTZMh}{3gp?=6;}0W:,=ޮG7 @! '`IjC={ey1cꅆzfU ōhfNί;wWUߦ̈́޽6۷v+rKJ6FCQ <ޱ?^8bDGAt?P4tp`ZǏ 6B('''T~~~PE(PrDSl6[Wp;qD֭#"";6l0b{lذaÆ ߼yc!44~jzD`5"YFߨ\$O$ Gb|jQ57Msr%eb0 DI+0D HO\//Yᑑbo_UQ1e&M& kúuf/(|y]/v-[NްYp>?CNN^ySi4 V(\6{߉Ξ]3iR7s0-gX}SRRRVVB:}"hȑ ,xbddd=4hp8YYYGr(d2H5oܸt͛oذ!))Yf8;99?g1b.Y$⢢3g,\tu:u<{L&1yqb..MUs[lCZDb2đ0d>)JzR`ocKDwahןpaP*;>Gv)&p(siݺ ._z?c8D-Z|Esss>} d׮]խ[ԩS͚5[֖b8p`Μ9Z2D-UUUÇ3] b0 !3 pfH`JwOfyZ4s }t03gzuvb3eJR9,m5jذ8[6n\RU%yPhk ˯<}j}]]Q0uNNtÆꊄ~9ׂ蘙Illllll,>zhV1uTBGFx9s&++ zuyf޼y V1bڵk?NCjjjƍgggn:*#V4R+ꂣ2l׭ۏLqB^ 8~ j\.A(N>o6i$44:gpܰ06ݭ[7ooozyxx4h@(#FO-R(555ݺusrr x[puu 6ݞzj„ QQQsaن1~6 2KDt*Gn7TĂ@w?ҼވI\L`ӟT_gS(}5\ zyp֬ݻTN×E٫{,r??RcMZ 45 @^ #>cY2L$ᔔ6oı#F;v_3[yE*v#ojR3Y  u+ 鉟!SD]E@/e#+P  ;+snd]0D. B_ǯՒ\?CW{ `gu*.Ќ54|'OlܸqŊ Q=撑$FT9֭ӥVTLQifn'K+͠&̻gkyl 24Na4XF+ aY3w_ z&]˗5QO٤2סJn U=|1EGgZvGyyY]]rJXd{:0'oϟ_`ɓ(HuiƇAɁM M i6ͤ<6_GeQ _Lg4@,#?z:ٟZp۠ 5w t+nMHm۶oݺ[n >SNϟ_t… u!j@KzGJ>dHa( 5mNڈlDFCϨ|WyH@(FTN:M=vu8J%(ih."_H[lYn]rrrLL F%MOO2dH޽R'̙ch?IcT͠fchE3ZZhH÷Fk2!I+hx(sFʗq^4xTek D.j7;_bw.)YP4(pO@tX?CQ=vhJbLJ4hڵׯ@~"jFFƂ Zly3f&|AGtX"''(Z)TJ$n4f ,]^=ncc3uf͚O9 Q:Q!3](n6SRB=F5G湮vݺӦ4 >^*fҖ>KQp8waMܽ}|2&ʥ>}Fjժ}vrr2/O"$''_z4lo8p`PPIKBM7]̑jLZ,PrTݤf<ʽ(*\&=v#GGGѣ|դ<חadfM=*hR*ڻ9}e˖|hJEEūW߿ڵ'OTVVr8X"mmmB!ǃJRTJ$DRPPUTT$H0 ssskݺu#""BBBH*H}a;F35GD SK3110DכC>L†%E6mެl6 aJ%Mlի!~ C-&;077799o߾}ׯl{{{ *++ tO "\^&Mº[ai :0iYBh9WnQg%C$dKxH&Hf5ȸsNNnL.h4Yl68ST)U*˽LJf 3hZsEQ6V.PTVlf>veN.(ժU6m<hFՠL&+++ήH$D._eԨQ666BP,D"{{{z f3)c~3YHn<@i\1j%Ŗ1f( ÌR //VUUeee:u趓B$7JiyH$"R3^R|???O)**WH$"O>mѢZBBBΜ9cvlZ1}"V3w3瀡C)Y%]ibRZס`菪ۙ-[9sfUV8p`ѢEׯ%.GEE@oݺ599dddX>_jʕ+ƍ۵kסC  .ѣw/^1bDuu={JKK7o޿?vpp>L>ή`Ȑ!&MH$aaa |/Y򼼼7VUU;ӳѣ2dHXXkjjZnݭ[7a [RϤ-$ۈh&Y̾IM2 !Bt%I|Ig9,Tynʱyi#`୪ C,i_~ٽ{w} tqF EѲ2 :uiӦ;w<~ð;v׫W7oׯ_zzÇ=1rH=q2)))..PEAxΝ`.䔓3s9s}7ŋh(ޢE ;;+Wd2>;u֪#F艷%dr[1'yM"s&* s>Հ((vx3Ԥ~q4; k$ѓVh1<lllz} x+j6m֭[wrrj֬CF|||]V^^~͛WWW߿_Po|L&#aw=y9sPmݺa?_'M}v'tZ9dȐr'\]]4hӪUw=zԤp9VIn=fv`%Cga̠$ג (bhm"xzJOIR2Sh h4"(::K.>jǎ˗/Dj"(666''gٲe(J(c6j믿~Lj={4mt饥@#ݻw7nܸdɒ)]eee``VU= н{]v*< g cQhW5:Y`%zkk6ʯ + =HxeffܹS,3FծYbݻ~)b;vvvv-[r7~ELL UVBd˖-۰aaqqq$!!Af͚Ϟ=ر#Zj*V{!XO?9sjZ&uťy?syyAU,++==gϞl62hFVgeeUWW$h0,Պ:$c)3K4X"%] Lo0ɝ(s/DǂQT*UjjjqqqPPP:u0 ̔JJR(B>ð\ӼysH$'''"ׯ )++{P(lܸJz9 -[DJrݺuƍsppb%HJ%oذayy/X,V- yj>DM4!:/˫?|hӦM1 +,,tsscXo޼888-[r8Z2[&T*mڴihh(Z-FЕ f`.ޱ%ɦ.77# Cf`˦kѵT=yԙEVKh,wkY~j HT"4kL` h-V ¯=y&0Z;m݊N_X I]h*"(u-z~_z 0͎g>l zyShrR\\|, T_ Lg7Z`U3Yi Aϙ%MYDâaLpfJRT ''uUweo]5vÇ'OVTl6VTT;41Ijc͡R[`,i=8\eA0.g  qg k׮={h4Z|ȑ.]Z|%_W{#&i'kM 2X0vz&X#6Y PNx}Kqqqf2 ð֭[ߺuˊid ~qc ,2#T6 (*m&htw6:TAU6m Di^+1,\rc%> Z_LϖB;CH~~6q"J bbcc[TUBTTY a6[CitfT6:dT9TDP/lɚCY**j9hjT* -A5i2AIoݺ5 }RC5Q% uRDji%(G*`lj0)ÜIÌr!49EBÄ9HCu$l44-^ #CEL:ЇE0ia7P5EjЛQeb7ү67mnnn4{LPi y%Vzf‹+f0fJa-R =@PV%=cP&ӠGv=egHs_+z;#忘 s(4b4IT9Yлb1(m&. iӆ~ؙ_'q0UzoIfψNIO.CuFOL:bxn3en.jZVT08NPHRLΧ Ibt*6FJKK xcA{{{.{ҥ]  TÇD"OOO+d%T3,|>>nnnujd{K""V{ڵk/^XZZJ ghVÆ 'LЮ];ooo>t,aW ^^^  lP@ڙ+yd9D e:R4w'=GZ&R7nɩN:ڵnܸ#"={vرUUU=zhڴ@ [+W8ѱΝ;QQQOgJMMÇ]VN#G4o?5/Lj#tx1M٤xs1 w޹sn߾sVkggѠAHDW Eyyﳲ޼yɓtWTTT.]zI!q|y\\Cq/,YRT*պuƎd˙3gFy-=SuiMJL t҃|5 ^7ln~~aRO>cƌ .+ٳgWٳ+yԩO<1!՟W>t ~ f\fS~ Eh6o}gt h^ѫ}GHi^P =>|?ΝT*:PPPp:ѥK+W0laj)**4hWxm?.|}}j_TiZnҤIӦMr2Ѡ=a6"%غssNtȑ#VrFCaOxԩS!~ȑ#333>,YO<_޺dž]y`x׷CHbZH ,GvssˣPDBk{DAs ЩSc^|ʕ+~-IT|REEE' ?~0m޼ڵk_x1y{][ha&4>/kLB re6)"Ҽ&)M o( mw52 X *R$aި7$#J:׫=z~֯_?<<w^zV\n:nngRXX]1ڭ[3fܼy3>>ڱcŋ#F|ܹݻϝ;7++?~O芲FM(` X(}׏Rbccz/// pqqyݳg***lvFڵ+//_n]UUᾅXtܹs[¦.׮]QՒn2eʋ/߿o HߨQȩS޻w~+V}vJJʅ fΜ 4 KՖ鲟z<|LLܹs ) ԭO#ljjuYYk׮޽{8q~4ÇxZM4T*ϝ;k}vRRyD5k@ m:RT˗/-[F|]yy9kC v(RP\\|?sDnҍPVV6nܸ޽{oݺw!Q-##˦⭒]lG R6kҺMf8yI?omiғV2lJ.tkݳ.;19 g%Do߾|rڴi<OW\:yӧO%ɢEx<޸qF$:tмyvN8m۶<z%K\pJAAA>>> t޼ys2dD"۷oӦMgϞp„77;B) Z ?SN|>֭[]tR113WWWgff޿޽{O<0>""b„ aaaQ QH$֭KJJ._|Igg?CR,_{ԩbX*nذڵk!!!򋳳seeƍSSS1 kӦ̈́ `Em۶=|PVs8 &P9AV(~q$@ pD"+fڵ$''̝;^^^vvv+V ܹ3-**Zf۷fϞ-??M|PT 4нpj///\eJJJJKK]\\f֭r\VO>}Dݻwo߾}vv-k֬nܸ!<~ˁ:t8u9m4\?q ͚5sqq۷/q 8ZT_^zl399Y$! al6M6={tww rss~px<D/_olSfgffk46dC|HI9'Nxub=z' *_~]VVH$;v_0jիWcakfʔ)ބK!uceTZUVF-!aÆ#G;͐Zc;JKK VQՊe˖hZ__HL/i莀)R"ɱwi"yQjQo95RHN9(zWmR7e|{h\$rjQ{_TTDlcYT7x%%%, Y8ZðϋD:l ]\\t(M8YÇ :/YӧSm6RԤIÇƆꉟWU}MrB kٲ,X R æMzݺuk"n32'%%nذJ吡 ,ȿX%KЬ>ݻW h4ggf͚) /88FUBDLP(<<<ڷo?qĉ'&''CRh4{+))Yvmxxx-tT*|ݻwn߾ `5-莆)J%I>|;6n8{l=gRIx^Էn8~vk#7o1)4_IkPmFS|'(Ä8e,!gԌhH~ ._~ҥ4JT9|ڵk߽{WVV6lذ#y:>~Ewҥo߾fz-rvv޶miOj+55uK,9{Aaeza;0apNyOѣ-޲e˲e,XpܠomTTf+Vl۶СC͚5#Ti>>>]t0駟&O 7S= ر.io۶m? V+&}H #>}@Q}ڵ7npBttttt4-Z(00cǎŋ9s&//~:uSEp~.]:o޼iӦ5k *aaaسٳ'4KS"## %͛Scbbtuuҥy:,&{P=PR?DõpmNSl;!g(D5ji~֙WOՔ [";4A`?sRh4>}(z%3 rrr}:uܼy񸸸[!C3&++bΝ-Z(***-->>ET*߿_"00)6mٲh4He ؿgCS ~bbb:u=zdTZŭ4)4l`/󀺤59׏xSSq`hYx˝'7"Yv2l'#CaޞZC_7̣Cm19X,ڵk48TE١u*s⃩ƻ_͛7ӧå[:t5 :" Ӫm``a:7Hӥ|2d46AQDDAN=zeooK ))AWXj*6uVè_4:ږlgQkR L64dF1=IUFҨm6Y]( Ĵr" eN٦^Au])+NO3#yr, j8 k̀54慦x |֭[,Y=eʔI&t~nnn>pt4it:t}bb\.oҤIrr+WlmmwI:VUUuܹŋgffwѢE 64XqËfrܔt2j*kv:i*b&P7Z"\gϘf*ksZrJYVpy{+Gp[ߎiU9o=^,y2^[P7ǿiC)[޼y3h 2dUƼdee-]ڶ:d1B1T!x01IhFj1gzehɊXf{yy3bd(d%jI%we57ND%$\tR9*fOiE!+V7OE_:uΒG` ϨLyƍCBf͚^ٳg2̌ECRL?~|С0%<<|ƍzXn0TMMwTTuXrŋuԑ4WVVzyyuؑR158i3eF~d{]\U^qi܌^}mI,}bCIuJYQ>.&᪢硌R+_^t)ZB^zѣG_~d[MAA͛7/^ܾ}{aoo?tЫWZ(̝;}vRVV  ņх&1LqF5j*^| 'Km,yxUYsӓV}rutLנ&_n9Y|wB^bgBӼS0t d"rWVV>}޽{7o|\.WKp8l6f( "++o߾χ AAAm۶m۶mDDl=.s-Kӧ!CMՂ13ǭ܅jпQR%%%͙3ݻ6m? 4{PC3lj,=h&.VaÆ7~{Ջ'c*t*{n ȟߙRU,WK5 (/zըj޿9WPߐ"1fC! WR͖QӆI n>LHHx߽{-Pp8|>_$D"%'+**d2T*Jx7oS~}==PEJmhF&;;{W\[.{Ӄ mDj0|adhN,*!]VVW\9ydF3gΜ+W(ڰaC[[[C:h%Ë I?nGRիW bĈ֭#qkqq ί(P[z.Ϳ:aҞ,*Ot wR#PbHLDMIyyy~~~ZZڻw T*U(gnWޅ v l."}#L3# {tL db e^ g4 YSW^ݻD"z*ad HUJFػyNGHzW.M}0o_ ۧ&43\գߌ\ozeӝ&Ş!$*~L%3djT= 3eRZCՆ0 K!CJJ-*̼UD֦M'O7$b \(qp 7뽙d<upyWq,UxCy7{pKcrD5Y=UU"i=+~W6r0`t}.]ݻqي)V{c"[w[ZVU?ӑ'pwix?Ԫ*/?Q DQ*LNWX1R&0 }qtTׯL&vQ~yW.S<#y;xBWv]{]eP`q?}!ߝBGN.*`SqT3z.?4X%:& *`tMx)JR}^h[^(#yMè?G,{p_i}g,/WC>Ko)?hHilFѩ遫L1E]$UU&U$UbsmZ8_.P  AP ;5 j0,KQp @V |Z{;l6jq`5ÿCLY)2SA (V} źlTe!(EY8Nhϔ3+҄bȓ/x׎wpQꬫIi}:l$ri^T5or.|QV Tq/ٹ41#@;p,6 (PA@PAA 'aqLժ0TZs@O!6NqLZe(A(APT  _p"%DP.lfsmMl kYcZVVUUJY841LI+V&iZQfsZp l|BwρPwN % 8x˗a0k6n4Ue)ٯvGzwlv_WPr\+~' xڻ4x*p-5ᗘ>6hPESg6H&D, buO^$}J.^YHCOHיS& =`zRjU-*K}*F Al_Gd9  @w8G8GTq!4DvA">Mb7aZV#U)Ur\)/KK_l4jSQD|@# (U9<{EL4PnժٳgGm'>o WZR!誒 H[pmKsE<⊒g.^ҟm:دe#lq\^Sd+(;S z3ӦM\R?~СC!m졩 ̳|/R;"БDž4NZQY]9"]lj+eri\#ɑVgI2J_hR;F,^|' S mvAB].X bsm\k!6)յsΧO 4oD"8%y~/rt~Egʼn<]YXtπ>Y)[Ri2ջcv,^I Ё9u>7pISg3-jT@WAG  8p|>bĉׯ__~,B%1:V$MU>5/ޏ/`s׶qdxTZhal``FR6~Z̯ިtyuv Yk!_ժ{:BƏs@O>u$Xd`UȊʋfLRb G@/ըkRϒI?DY|&4|ދӼ jjً3xj8ѕo*ռ%MQ#2t6 khHa/vM$i4PXQQ1hРGh`shѫ Ű_K;uLl_覻kW yT<҂iUuJQ.~'z+PG*OwWӲ<[zl"o}OZ;R+<$$UVΝcC`aZeyo(pK!/\a嬗 ~VVl>{zm$H*3Xl@xQUYjNQ %,cJhq UoHTLo76k?;;33!L ѵ_=^ gc:y6*YWfذL.L rYN\ؾD\gm'ȥytIe]u4*ؾN~Ӟ,"o]6P 7.߁Sѱ[gϜzhBqaZZU%ʪx]^8Ae"3FlWǤ!X|4 %IҪ 6ǦY܎z-{Ci=gh}/0M+!2cXhdZI3'zШͭE`bqLLU5IjO $5׉l8Q&VeZz<CW&̾DK0+p<][ʥy%ϊr/+eR..ޱ~$@<+8\a1vjPxiUV(ZJY;nY*Ke IBVj@ iJ6Uw iuvI-Ϙ_=^AMl ?Mۻ7F*53>z)M/c1 w:HISN'Oׯ1&iWFI̦ B!hfy3ˏNP t jyT2\.ɗVgT \V>8 UbZV P.goG^{jcy_DUz71Z\j5rFʵB" q'jmD6~NQvN ] mBO!Z&3k1YAP6d:=3mag..W6Ffb/ӳܑ:m&X+IZ ʴ@@(uOa1!eBk]*96lޥzi<]V++JB(QKԊRgyg./w TJy1?EBdx#l1_A/+AЖ!˵Z0c oTs豳gߐa ey*=am_IjT*,ŋd* II>dt0$]0FŒ2zՕU$AʪP'Rq֫WXҚG%y[ū%Miڋ/A}ӧL?TFqٔ__ϟs\Zck h 5ʕ+͛aX͝j ǐ߿?88 uFRVTTԶm۷ 3CeRJ&CͶdVUUM6}=!izb_1:@P|cN۷oG[ɻN:5`}}w}vjW׾v_mj&[RI?399&omm#G>yktڵ4jԨ{<6[5j!C~<8 _{kpŊRw N/*IX| |xҤI,رc0K.ݺuJeeeC=ww}ץKW^Z +Wk47nN1F!(y mRid6ߛ B ͅ\)u,pbϐ/2  Z-E@\AT.ziR|(GfkPI zolٲܹsgϞD$dP)IK\X4& z^!;Րn*WVV 1 mcmG7nLNNMKK9s& 33sٲeUUU666zOrrreee˴Z-*))3s S]TKS)/:޹ uze3ןu8&zςD|wDDhkZ\0Vb>qKe=@rr;d[臑ZJ# l-C嗄xӐH$ŕP(%IeeF |> B&1aXyVrɐXt-H2TT&*}=j4O* F8r kzxx4m̙3AAA^^^M6̜93((hѢEÆ ޫ(aF dL3 ֊y҂YMNE AznIE>@0Ԋ, 鈈@Ym>۸e~p@\2iL*߲}X#a7l2:::***((*RIbw<)nG炂/v===H"\opppppp:uիlggg\HEc(̯4C& %!>P:,f_V^Ç{{{gggj]!CM&ƏI[nnn߾}}}}Zl  &&fɒ%r[n(Yfݙ{s49itdlX8P+5j>[*y,(qsD!l%% @`:CėW.;qҜS<8r肳RBYlw#G[jպu-ZԫWO,3jMHY uAAARRݻwoݺc lvnn@ ڵX,DBb) T*JkjjS۷ooݺu1bbbbcc###CBBTG3yy  R?;=z";È}4v}w0[o;P(8FWT,_uZfF!.#Á$ 0\NyZ1+FPy| 8O/_|;w\r!6ٺu눈 1~xkjj^zС;wx:uL<9223%%oETVVV˗7nܸxy<^Æ ;`u뚴뗡<TTj&B3e˖߿oѢÁ[S;lذT6MJB'WT$*n>>k*6 Tp?(.\cQIɬ_j`^55(4$p5={u6K "=/36mf3Wu!陯֮ޫ~dF0v*:"G/=Ln(--k6BH@?gǎΝ={СC,N:-ZhӦMDDD:u3B#+dee:uj0K.qqqīcbb_xnnnnnn 4޽/w^reܹG>}Ff`*Q yM^EcT5bHi4DM  899vS 6lذEX >>>08=5_e46  _-:OnS\.o>{fϮSM} '&&['FZ]-up_’۷n޺MضQ7o:Y,9{oO7hBF"8뗵k+~ (9 YZZUv8Z-& Qqjx߷o=^bDžf]@$@T_ҩSN:8v֭۷EрM*q_CCCN U4`*ÿ[NNN>}8zΝC<C:tHOO?qĺu:u4jԨ @1yFcZWn@es2PɟDm@dTxa#_1cɓ'H@@rI m`*Y4ˈa40 |!b?4;vܱ}~QޏePy6'4Wo=]`:jOFpl, *3844vS(Yr7:tË/nݺ(6l2...<<<00P N0]vܹsbHͫWfΜyŰSNBݶ)~̝;wذaK,ٵk|1c0`~2ImX\8zd&mrBAD,pgP%ƪ*ݽVIM$jfӳNzj4(:MZf’,֩fqBG˘X!: YrFw F tM9;9(h'󯿬*/Ӕo_[dP- RTYvLs J&SϔU'ymF|޽s߿ݶmQFٳg{_˗/ B :Us@j =z kа ]V^~ H:3~RVM:ux Z@kB ݻ Ł*OOCz|Ap ưmV }¾k׮I*55oߎ߳gc{ܹ[n5jڴiP 8yýϝ;Hd5ʏ6wʕٳgoٲt޽h<;=)*LSI$ 4,9`қ9s/ٳgҥK, q\4idȐ!fΜ9ׯ={61/666k׮7o޽{j={BBBfΜ۷oݻbr56mlj֬Ybxڵ߾}`􎀙;ne 6O`ʰqf);g N€V T?ML |ْj\a%mIiYtt~v;!0F S\ :rM?i棇bINOC(qyիWwElkמ?~GNHH5jsgz6 =5mz~˖-K.uttܸq#a=d2S ! 6-TGU Eqq1Цݻ'NA{'[n7oޔJׯ_XPNdX~zFFs||\.GQnڴimڴ!DKXy{{#ruṯ"z+{.:)%"ѐFB@ xYs++j ֣{[ ()MhM.1ȨdAKXdRo߾4iҡCBS>YK`,YrӦM͛77nW 4ͦ[ǪU-[6rH>?:9pL2%((WT, ͮ9r$é_D"Q*0T(ْa(]2.Q>|P( MOo]NKb_KPԊB\5J}NU;;30"x.?ຨ5u'"=aÆs\.|>,ի۷o'M~T*?~\VVV^={{{VC8R^b\円r8^&إҔ\޸qcCG AG͛7SNHG̘A^pQwQiðJ+V̘1ϟ?匎;k.MvA4pnܸQPP#`>s "afڵkwΝ'OݻsZe>’6VK"[zʪ '3NKnH (999kPSb HNGVbccB! , x7z5j(ϟ0aByy[AAAddիsf͚Z3:u4~x;͛w=z+GYbEݺujۆ ܲ'O ۷܈sn~zſ[Ϟ=oYHqMj{T"7C &YTn߾=00K&X~֬Yu޽{@@?sʿ c&0 sww8y򤓓dzjvQוN>}nɒ% bL tju _cĸ:$t ѣ: I5@Bktk蟱zDR ǣ.]TRR? nٴiSyy+WBaEEq0TTT 3J̙3!!!UVh4b?cMM͏?H$_hQxx8_bŬYt"\s:wܤI'N̞=0cI籵o/Gm_`/55]rPi㸗׶mol6={>hʕ~~~/...2EQ0gGGǑ#Gv: <Օ~ ߽{1czFX ,jdO&Bz?)N`)'b":rbPK7N?ToEx%KR3*֭[vvv>KKKE"YC r ۷ ͛Ǐ[hQQ۷4ik:;;w)==]_G7l#::zӦMDur8ݻ/[,''0Qx/) ~4_F4䤡SN:uՀ W5g7 s#F>|^üyLcD?G=bhd[1gh3]L#8Zຘ{B4hpl:>7@!Wp@MF ̓1 >M4>jԨÇGDD4mڴk׮ݻwxc3fjZ611w٣GFDD uR۷o7nl)d4U;Nɰݻw )ݢX!gouhccūJ';G MRx`T+>H*ڰ?,!Eo޼)˩*ɓ'O<ٳg۷Yƍ4h Puڵŋs8TӧOn㤇tӧ ^zT{鸙~:>SLYԻأGE׬YCOTu&&l*Ck׮]twzV,>[]jQM̼gS[V{5) _{Eli+n&%**wssskjjoPf8hZFp)SZjɒ%֭ׯNfgϞ"X, V]r N< CIVrJ:u  $G芬ƍ۲e̙368Wk׮=i֬YVlVo0͌3V ZOղãŔ=~|//3Ҙ]]v3gΎ;ڴicxw޽/^ݺukܸT*5d۹\˗/߾}f͚zF9sfVV닊<<<1c .|Eiiѣ7nlٲ9s4lJbxٲelԽ{B5o5zW^]tNhEl6ɉ0[Q0>}zZ:uQ4eڵӧO0`Çkâu0]aLejj/_Pcɒ%ϼ2q˗eeehT+AcR2_l:UV OJggGC c cŚ6mjr ji]v_gMFP*%Dt-++#l%ʮFJOO?w9bĈ/^TTT̛7o۶m&L8w`^^ފ+h_גɈ#0-QN3ܺuA1{X?fc߿?==]v[nK ٳ={.]tРAGĨZ{bShm,S~TTTl%4:6WW^vڠk׮Λ7oݺuÇbB⫮޻w߽{WRRryxիw9zU4͡C~/rssW\hѢ|-bZ9wիWb1 Jc/\5qݻ'$$Hjii… ۴isŋ۷O/X?rLj>Phlj3,=cK\6I&|o߾, +_z fPYxL&۷o_qqq^^Ν;]]]<< P@1}ʖwa zd2ٕ+W5kFﻬZ-wY|yBBBLL?3ǰitKJJvhѢ6mܽ{wΆFIq&fAu& 'UaZwssݻ׽{OmGVשSgСÆ ?ׯ_oҤIhhK\\kr1 jժLB5s;{vӑ}&BhI2;j4୔]mfNN #7v5͖cB"iX,={vbbAlҼyN:=z 0HE3eF}uiӦկ_ᅦݼys&K^c?EӎQd42C/-$ԤR(A(9CxZԩS;w >ԩSW\Yj_^^^UUP(x<^޽'J  _~=wnooooosYfrpLH9\ÚfZm4kԩsZO<M&1c>>>fDѧzJOOsŋoܸxG٣GOh=LZ?%%.))YhQFV^j\.flԨBPV i~ZUDRSS3x%&]]rLlè?Og)ղfB ˗/2雩>FL23zmѢE-fϞ}o߾}ƍ-Z)ITLT?{ //~D"z#@KǨa Q)Z̝P +UnQ?RneF (-[  &xyy#G(JJ{888;vUV(V5kVZZO```ZZK``͋/bbbiΚ\G@|jd$[ ?h.\o>{l̘1pcqTi%n3 Q>a„ &}Ç7nHHH `ԩ.SaXr\&d2\.+**޽{_]]j[h1jԨm6jԈ* <5LdӴISFɪn \.W*>!=O\PTzS|>LJH`!@ap80SڵLJ`D{]t4www.LzUpy,_)/¼;l{IR*W 3Xæ"W6lXUU՛7oRRR^~͛*bAgEa팢X,vtt VTNNN֭kԨѬ_ƤԪ6sT*U(~-5: ,Xp!<wŊ 2Q7neFx݌pm\[ 8reVZYH12U6z2ٵlْ8MJ%4Ld2D"Jkjj H$*"H(zyyΘ1cݺu^`jӧG2:zT}fL ɔJ%p JrJ&`ӦM+VЅ bht@Dr*. y1i-Ca! Y)..uVX%0MR轎2o?K$ r8{tyfS+S.cȤAd ¨J$ѣGp:DF$%Cjz V@Q._*jlTd0"mÇeee49gjV(Mg"[倱۵kV]ha/Z|yH5MF?r!ae l3 " 2L,&4@vcDžE6f5s(ײV 8"W9smIsի":U1v u 9nJ4kDήT%Kp8>ͿO>֓j <0bhPRFHMP}'Den8/EdrF7!P4iO 1SG~V T ֢H:8L MuK.5k z*짚5糅!oFI$# G`r%b7~ q0h8sO>ЀN^FI!6۷' 6DzBOK E`TJ1U k٭[7=U{P3<*vX 8tR6 rIUл&X3 ތ5`1OCCh'ta a8`6m8دk+܀v r7[._ DgE btG<SNZ{uEEEQU$jGʼx_70+ P^=`ۼ=`3zH3%=IU`R8>swԿ2O>ӧnƦ۷5_ϤMԨ6erz͠v:Aڪ E!+ztIhVVӧO;t蠫`$ iW:wę3gԛ7o~Mm7naihih@ 6 B@Q n4K*pBرADJ2 /X, >>>..."b~09<{SZpdHh7MIYZ0|PwBBL&sh0 kŨ{3Bz})H FᙯϦ޼y3++K.AapȑM48s:u5k 0ƒf1H|@HFlL"rbAPGcfC˗/?~YPP@$b|.R njH$ W^˖-4hX1zñ%9Z31[L2hŒf͈ h6!C nƤaz&]B1o޼5k`fccx<>|CVk˗/q&U3FTc4&T4+)R_oo;m^|Ǐoܸqݬ,X, h߾}XX-,Z- B555999egg?|Notttv"""h¸@2DdPTF(L:-qqf*h1ܽ{m۶0)Xx004b"&aZZ3fÇ)SɨPd03|>۷o۶'N9=ځɷ tP?uP=?t4T7nHIIٻwo۶m$988-_͛UUUfCWWWܽ{wժU;wa%\.7**j۶m 髽~VaEI2@謙޾}1Ь@j#ѕTZ}̙04iZK.,[/o YM)SھT"pX_|9{lcʔ)gΜ65ɉ1c|׌3j5?JΛç6GNҘoQV|RlҤI``L&3MZݺuk??j|T:&,Tށ;vXqxÏ?ifz鼌oÇH)cƌ̴n)$~b勆+҄THӔZT^s3fUV1eh Q*\.Eo4DCO&T{nz sG%d!Ӻ/29 \[[_tÇFڵkWTT͛׆La}@j*jOoC6399۷fGY׆WR PjJ{ցhn&_fap惉jKy&Bu+V$ur0`QD"ӧ9 "M$. ݂kBшݻw_xgҤI{NMM5TdpG;:51h&$&rW؍7BcGg }aw,>@3\.da51'tysAp=D,_0*3} 2$;;{ i"U#"3\I.]nܸ_i:vh[8%uõghbbxbh2(&Zj/_nР!Ho7j*erZQ'GC?sܔ7ab[) Ʀ_Ćaeh6.{n^|ŋtBao!M6QY ϑFݻӧtBFlJYQu DFj<8BWDPG 6LyBd8?[3rz<2I}|㙄hԡ(73i R@!TnCr83gR+@<`{5&&ٳNJJb³sqҼ[wgTGwR*RL&$$p+T.2#'& F=, aXcǎ a42_ ֒Xƨvp3|WjIEBҁYyj~(((8|pddI70 8qBь?U!0ŒUgEuBEŋvvve^ߊ5{jwL O[{[1eH>Lz 9,RФAiӦ{֭{ӧsAٳg8p`ƏjIH)hJ:6Vg+ Uҩ_׌cwR.^جY8B9i4nT(kFd*a,)֣8FWkI w}ʜP5˜[C,(}K7ATOOmgggo+((ڵlٲo>oo#G޽ʕ+07ـ'VgϞɓ'c&HHXRRbkkgϞx??+WNoѣDZc`:Ԯ];]hfݯADeCZIrHQ =5% q1555--szF7.4IBz:jƜ]BomښVpj We8+Tb0Xf(A#Q4'Ԓ֭[]v@X\\\b`RM>l6op8#ׯ_UUUbbbvvvZZéz#L@~EU%I4y+T~^S Ikư&4x{{{xx\v͐a7smHXYPE5hJ&Ju3I3u9,ӃfavwbXAVfF53fյm۶G=|phh(zHK^^J]fxW## rcsmjL%=a˗ԩӨQ#ԫzwm|%iLrfosΉ'FW9r_yIX8h$y $`EI ?iӦ|>B#oڈD"7SRR;X,.,,Hq?u4={6,, OpyÇ^4(DU"= Yg,>|خ];?ˌ3ƌk׮*&H'N 6kΜ9(ht4V_o@@@ΝO>=g"Gqw}lٲ˗/c 3ta߾}]tڵɓB!bqYYٸq㪫 w [#̝7ʢz rBӧO-͛G5&&MڼyݣGAH=}_Mz>&Ψ.ayXz…ׯ_C0d3IKW.}!++\*JRɧO5XD"X,vtt ":={={677WR3 Օbyzzcر ǁf韥_4Sl4ER9z(^wGiiX,3fSa_uE狀իӧׯ_?// >|Q>^8)ɻ]Hr Dz˫W^Zy͛Ǐ t\x<@`kkfkk+t#τBLLĉnݚ(Hjr\&=}t̘1B]~=55sʔ)4`R &M20@ébwBIڟŋ?|ƌ" 2Ms,}4xٳGWyȱcF_/ḴgqVKJJRdgg?yOOOyh֭ۿ{{{P( aRT*r";;/_|]RRҖ-[P ԩSxxՅm۶m޼K.?cll,nnn.]믿HL6[Y^qQQH$?~!fȯ^/))̟?_V]\ àVƍsrr,I@ IUmfgg̘b^|i.Y%Q I ̟?ڵgOFbݥhJ +H P![@ q=Vn|eefv5/}dff82**##+VСΩ3ƍ2L] \*iii+Vzq ۷\¿7RQ+JnnŜ9sXfa)#Gt&گ3f~z^zeffP)e7>2PXgr<$$Yf u%233n{ L:ٳg\z'VOYy=LMM]b޳gO<M땤$ &( C6XvvydƍvvvK.2xk0TͯjcccaanHV1%BȓMUJP >_vu?eM4?߸qcÆ #s[L-nڴ p9T/5GW\D2dc^^⛌8>enn>|ÇRRR^y9mۆpӧy8>GqE`mݺp^zgϞᡝ͚5;H${yJ={|KV\  zڵkq3_.]^Ǐ9s.?2 U,"gFF… ) Zn 033;vlddD"c2,**jڴi8o&M?N+S}Y$n;'(~\g=zAOPD|r-[Jo~_R^^i&+++ hu2S5!׮]zÇ=ո1YAO>njjFM'GT*y1cpy]x1--V?(W^]p!1112d˗uF,9_ޞXV޸K𵕙iii9uWTT4tPk ;v,YPQQ1i$W1ciXgxU(,5{&55tɒ%,OкvVZv\kk]GDDdffR3E.gggyܹsWիkCCC?|uPЇe@KKK???___[[[+++kkkM\*VVV⊊ < ׷ݻwo߾}PPSn8{ER!~`OvPcH{TmllڶmQoP:ͻqƖ-[/^GUЀ9,w7n_tŋGՈ̊߿`jj-]vurr}(//dr@CP(=իҰaC___???-ӯV=xGw/Zl٨QWeKgϞpm۶^[bb޽{++,ggg<رcK.}pݺu?^ݻw{{{[[[6i$$$$((ɉpG/SL9s۷o"$N`+;S4%50ֶiӦdҢ"D"$\.w.\8p@3Mqpp&@Pu lyR A7666==}z4_'*((Xn]ƍ׬YcMRPPpڵY,ϙ3g۶mx= I-bʕ+sA!X-tRffݦMooo"ϐ>|Ço߾m\.u^jf3ƸdREBH }$ZEQDBZN DV_oQBEcy/6:=p]W/OڴiÕxǏ&&&iiiz {7ou֢E @||BUfeenݚ[XXGƞ={6(({M6csrr!> ]1  III"L7 ѱ5kL>UV :xyy]zuΜ9!k9o9a=;9$=Xn2kC:PSj>B]qT?\^ =g/,+\$#vPprCCC od_ӗ/_%CO?C=wǏ'O~ϟ?O4)::pȑ;vGEE<^UTDÇϟ'NXO<8pƍ322V^Oᯘ&&&Ι3'mbri%dF888tÇ88^AʫvpЕؚL/i_y+\CD#Cb"0L\w8סT+:VT?Z,2=LdO>}wT0h!^6˦eee޽k޼9Y'H$ϡC|||"##w޽ƍ x[RM8~+W?<<  K,EAAմiӌ5EgիWǎf)BVV) Uÿkʔ)iiibƩ\`x<Wh'O ׸B+ALLL9x`nݘJ$͛7ݻnݺ%ƍ2/Зkx'O>G3*F$bPz:&' i]zZeDdiK؃pCÇ_~Ӳ晰yE8B^ KSYݻwzbɰ0lƍ666ӧOOOO]r5>taҥ,u O>v(RRRfΜ~z+ݣ]ƴ3JGUs9:U*--uww5jpŰ넚Җ-[n޼Ν;oԨmB<-R+ wJz?//` gLjl2 j2(b,ø_U˖-C#0Й\j67n_n K"(88]vbQBg +ȺNrooaÆ1jИ-7| hgg=vP T '_ox8OL֢E&MtÐg(:MÇy<^@@=r>Z.\P # DBavh>vURdQZ3?Y2zjuG+W_rE. ХfXD&vv.*S3'(%: .:-5ZfMvŽ,q($&M:w\EEEW\Y\\"zDrmw2իFBt:\ݻR-\= S\u: @W$Ck1733=YE_=i'زeKvoZaw_팩@.-ŧLGZ:Ķ8dfȐ!QQQ Xvm6m"""&C\.TǏj?6lأGcBY͚5sqq!hθAz5SK <]"h 8轝h˺wsskӦ qy~~~_kz`6<>&RPj~'>F?088… ǏcƌٳYܾY("4G޽ ,--Ϝ9ax^rqqqiݺgψ $&\z,$O{BAtzi2dhYKsp&4*xر#SS?[^S:Lhb#X][LɓnݺA 0 7n\TTԊ+>|0a„vڭZӧOdxZO`vWUR޿ޮ]ɓ''''^Ç#Fs`y<^n233?̲s .; ׅ6DÕI>oiiIhѤ]:T^OFtԩNx<xGҞr(s1 ZPT L":Oɓ~i5+}[rB`zuݺuo߾]]]׬YӴiΝ;߾}esOϿy?ܹsf͚_VrrrbDZn GNׂ`f_,赣S#24l ˆrĈ111o޼!#1&=n6mt"wR!J;lc՝d'o%\V$B&9uP(^xqԩũT*''֭[w!00řO<... 6ڵѣ[nC8>,MXܰa;w0*'>ܸZ%^OKwW>RZRaPĀ>#",-VVVgNVxmC,fkkB( /i8tǁRᄀ^;YQQqݶm豠yv*aP(رcǎ%IBBo߾Sˬ[ةu <kvv"(@j7-&Z&f΄LfB&:,څHk^|E ṵƎ7.[٣/+ԩZPÒ=ѭcncNG[ݻw .ŠB?itZ91Yjڵgnn:k֬ĤR\T*q*>%]v S4:Gt"sG}Aa8cHLvshיJJ޽{w̨e!kҩ%8٪ɸ@P'aĭ3,a#dJfj`U!%ۂj B@ دOCG >\&ܖ~'^d2H$RkVZhѢYf BKKKSSS@`aaBpѹZlaXttt({y0:Sb+U*噜g@ [[uhP5F!P (׵ *}{<ɀ0פ6k9VMjPEd5u#lLuc~3gN&MB7uGd7o6jϡ`\rHetjFE|>C. 60@NClwݛ 66p[XX,\GZNCDZe˖T>eCeqףXZZjqXZ3T*o޸Ыub A|Fp-8$. 54^ .-H(mm45V%@<< 1X95* li\\0߁ iұiHFoE4 PbRTseuzRcҹbw5Pbr1aرcn݊55Ng#JKK߽{>/R}2P!@Nv cf^zEcm(kO9ăt’C3$?|~AAU5V* 61DN`$="v& jea%zQ"+/W*HV x@Ҽ!ӳ g ]߉(2'''ݛ%RVθ=Fwc̘1AAAd%&&j!0G>Bl(Dǹ5s$^P'#PZ[[[XXhqXj΄d`x'B 4;xKK,[_b L@W"xN>kX/LB "^ F&@ 浞=|** ӲV8:fv{[y* ZwpaN 3o/VVV8u+Wnݺs43PIg+:_~7$!<^x ԉ%giv|5;`yBXa XQ^P@P*e2 jT 00^vFv~m!bqr23R2 P PTI$RZE"x<0O\&OO?dd l$}H ZeiD-X@- "22qLfWqQǍeDror僾 TEƍҏPNjr-up9;;WVVj!3"TqY+*nr u?V^i\xgn @6yERDvrsX9hMǪ vˁ7izd/i_~,l,>llnmqM`*Woi÷yqojp8/WD~0ŧ҂.h3R|@:MG ?jyeYѝXxH$=z=G+Fc![PPホ ҨggC6eZiԨBO$AIKK * *g`Zg&]]]+++hg}1`M{SaaB[KBJ MU*>so͗=.ud6@KOulkZmfiNHU] .,L(*6nȚukETQ66J0fOoܡ24M>=вc+`T9SHK޽y|iO"@ZUݸq wh0~&7!!!![l۷͛7MLLpTNt06 &Bw:qt:mU5p]cՃ-,VUS –jV%ar [+B66EETiA PRȤҊԸT\!41@ UMijhIQUǴULԺ~qWff+F-SCu~fӋ[vlI kb+†NX%Y7D_:nLU]hܹ6d<`rI֭[_paСEEUb8!!AU}ԞJ'6FUM0;129Q4oޜ嘭<@i l_ {Gk;/E,ETQ~i~iRlR Pײw+BbBїC×^_3k/@* Xt-b)B9Y8i157s +,@sԵߪ! ۆ>|`y(^ʾ\ʋ>r;fu}iIII޽@:)!,Ov'N ńSft~ypppbbD"!X6 LfȓD|U\vV777 òtq YXֆs섬rts9L4UJw|G\s,}T$>`Ʋr췉~ڷlʚi[gnTJeg89^|={vqqM<<<{^ d:4KMS{WxFHr"%]N~pG_>oϦEO_}l8P]J'#F%L{5A0^XoF oܲf=zB)NNNnnn*,Q >CqUo-9L튯oeee^^NإBXB@-i&((? U'נ"j~DSØ/'Lqcg"IJڷo_xx?aؒ%KXf4?T\?4V׭[RtVsxecvif۾n yH -$$?D7bv1'S v1+ "88XRmE N8wD9Q\49~O TW7X (3H&ΪXO#\rWWC{ҥ[lapuV kwgϮn\D<T*U(Ν?hW9SQ:!=z[MTJLD$:U%`Mm\jIח&I0`XjS[DբNUZ)Rv#b@d_3\stʆ'!z*F]!sssGZIB"a@LRt#hB#ipqVKJA=D*$DTJob0 OhnggwɁ.\pI$T i#"RRk=^WZeh`o ~5OLd54I0Hl5Tbhč+,c@2t-@1$7]|US"F^xPW({TqccQ7PqTb̄<̐\Pءc脤D3`F]Nib>@/V? ѰTY,PǪIk9&H^U<dw-BwR)1I޶mז-looȑ={eC*,={sG i#\>'aD83vѕFcKŐb3U/*lrZ8jFXC!i2+A*Rd<P7TIXZhd&.Uۥ YK7|*j\%mC,2:5 <2k@bJ,P(lذaZZZaa! LbijϢyyB @ >0 @C 1AcL  |/XPsK M+|L(B!&bz0Rz4UPy? ,eYy%"Y3chggw̙^z-Yd֭^.2/0,d::QF3,Ю%pTj^ &_AoVCװF> 5#= Vb5 2`FҰtXX7&uC@J4σ1.;y0Q ЅdQ|&Te]vCmI' 'O溻kٳ6mis܉720!Y1qXۜXt|Zh`)Zxp j%:ԢT5b0G&*d6V(Uk<_M!W1eοLp H4)ey˗/&"06{ ٰaCZi{֭>VVT7Lѥ'~ՈC~`aa0a^=}||XggSN1j&"V}ZV׮]4hN#Z Ϟ=wǏ322 YtwwtvvqwwСCAAAeeH$&-<==}}};tХK-ZDb_W,BYrj.D*O*A kU%gzb5B&5TRUȵ,Ũ$ ZLLLqlm)C.,SHZm߿gYpSL`8/O<늑Bݜ6<v E"|P(vvv7߿```pppPPP($b{٥KBP(Riiiizzϟ֬YS؎;v޽W^&jzj&7SI|;J \)HKV$^.Ym-PkQIL[%y;hy0 `aP($n5n&E` 3)ެ5jJ+++&Eܾ}{qqߢE ;wLNNvpp;w. 8pիyq6mP'Vk\\짏~jrŋ.\`gQFfٳgf<== N6ߟ|/A***CͨXC"O ssTT̤*i .`fZ]vYYY,%d*zƍ[zuzzjuhh%Klll~71TݻW^jXL ׭[wUbJJJTTLITܿ2` =J:Ix?ciiy{+۷ogϞݤIŋ+ʍ7FGGرcРALԊXUbgkk-[.Xʕ+޽vϞ=ۣGΝ;ٳG,f/-&m85=2v"}۞ـU 5K_5 F2\- ookmlТ[FVQX} vH°UbUp  #S.Cm/mNԊJRh m66 <(ĕ+ׯ_׈4ў*Z|ӧOA&Mlll _>9iBBٳg ###ǎz]vA޽{>y'...""ѣk׮pBLLLe2Y>}óvNv'1b… ׯҥ ֧Vqqm6nܨR 2uԞ={@@ E~/99ԩSǎ5k޽{ׯ_ϒ~S`6{ Ee#&2TQ@bc -+"R;êzuI,߿O,-ҷ#PCc$+$;㷪+(#| (<tgCW#STOw&) 5nٳggʩu14.''Ν;YYYD,hBB©SfϞM}fΜxذ'\iz1>~> jSkmbUbFH$z t%rw ?uֱcڵ qƥK4'jL&4hеk׮_ޯ_?'qK$A Զmŋnz۶m;וl w'GÇ>}nڴNQQQ1ѣG+G^puL_@{Ѵi۵k۷oL7d}1m_*-F֣dRhedTCqg7}'̴ZO"`@;ޞ$j*P{"ZPq&СbUԒҐKbzDɞ#%%ݻw:(CݻӧO߹s֭[-Z(++2e aO>GDD>|7nj*===%%};v,##{%%%VVV/_lРA->~Hes]M|@\n~ {AwIIرcw9k֬ǏO0 =T nk߾}7nѣG%>hJ}I(WӢWɚ1Q7nhnkUH?D᯦skWÝKn&ijFrD@R W +{D.SP q޽;ǻuΞi7tsa33;ww̙Rt 6%c٭]V*fee^T  ðe˖xI&.]铙L&tߢҎ.97ݼyǍGoߞ#JǍwڵ7NzL="J֧O7nx\EQNRFaGe! "z.XMrFR0j jx@"5q@y•@($A `WxC *Fr'%EkY \1 a0ԇT*TjffWK\2cL~ qT 򖕕mڴ9Jj 1=jW^￝ MTyx`.i?8;7o^~?h}1952dȐG5k֌evqYZdi k)ۊ1`wZ1 2%O\';LT|Tj ļlj"h] &hi5dVY@Dm|; >lQnmkPIV&i& ի;cPv(A@O8lZʪ_~/^#Uӊ@TVʡ߶m M/227޾}͛OBȸ Scgѣ¹sJR@725 "::zʕڵ8pZ yQ-.iZW:Hf9H҂5*M ӡSRٲUƍUmNd#2!dƪja5%LR),,,>61% PMhmf2yF1rHJuYtU:W%4mڵ@Qd")w>60o|>ʔ)/_vuuutt"*}tر䀄{ >|#G6mPVYY{ɓ'O6@(--]jU;o}i~DmrVjݺu6m֮]kjj:w\ƱVIx d,Xļy&`uV # U C@@ GҴ+ww=ݛQ Շ<666LH>F;}AŴQF;Ȅ-꿧]Zjղe3g |;{X&Y11ʛLܖN J(^I~g rfdd͜9"7te˖ 2dCU(*J&?~%r֭X:uĕׯ_8p=zs/ &| f͢Qӧ۷ngH$_}|͚5k0 [jϣ1bpv: H$9#>I(Z P G@5 Frǩa512V PWhZBLF k iKKKq &"o -,ٷȆ֑iZA6( 'N\p۷"iH\]IBr%UF}hy@h27oT*Ǐ622e˖ӧO|7떖dʊP&fdd~z۶mO,.bִiS2$k޽iii="QFw;99 >Zx\cƌqss۶mpNi(q0R1 |z*?Yhm6뉏www}UV۴iӋ/,Nj~˗/]I .͞=ڵkEP٣GC^r܊X,fǟ={ₓ<hB*R]I?pBro ڵk[nݪUUV)+VxիWk֬i߾=Aj,jd$ }v/ U30iF1RLkVSB ^f @k&EN~ //@=9XV;W1El+i5WWӧ[ݺu{EyZ;ڬ_1.o2շTVJKKnM4I,=ztϞ=˖-;v,a<111jB,\~ʕ)S <ŋ&M0cǎvrqq9s&ޱW^m߾}ƍ8+Gpƞ*˗/Z?wٳgM0a޼yÇgzG_"𳒒~ .͟?Ç.]|˗/ 4ߺukH[[[;;,Vkh B$i`Q@H@ TFJR- V#rR^Z6Ĵ+ՙW'.ed} j ?3W[߿wqqAtc>ѹkP? `VVV RB+dnnnOjĄ {jxM=22ӧW\ٳgWzYlll~~KBBB:uꔝ=`WWנ˗/|7666ZUPPp=z&Nxqby&$$dڵ=zhڴ)8I~K.e]+=]\A5 WH$Uk0rf1*zW{{VS 0;?)=]P<ôBIZU9O=)$ɪ8&ϯeϘ1Q%Tj, ]'7Hiceavo߾W^SNy󦛛y,tF ~,3MF-(~zyWDYԩ=ZF۲2ˆLaRPz(fz S}B_BHz;v еk/_謄 {8uogOn^7nƍԨL&}c_KTJ$zω|c>~k3S&k-[ݽ{}B0!!-#Z VQ<Qu2";wΟ?M6Ǐ <#fx[%淏LnuobHUK,ٲe˪UX #%!!aȐ!999Ǐ533+xԯ<~Oq}L-Da_rۯR=<=M{%K [$򽪁Mf:| Uf_"EQQQz!S>*]CB~A@"0=I&KWP L؛H_~ri)H+֭[T*a-=:F> s?@H_;Tdd$`ӦM(W]BoP)QN:E$Z1A/_lnnCZ1XOK#@ԅ2I!|lذa & 2J9IDD!( uG!GL8RHÇoW-;33355A`YfqeI `Un~PxǏ{yy?~<8%?\R߂{g:HE_5eGD"Yd m׮]8--D[Dѣx".+@M %}j"/^3gΌ3Ν+>|8eʔٳg?>--xl߾}۶mcؿ[o‘nmm=dB}SrX BT@ 0"|C9sTTTԁDBu (/$riI›z \t ǙիWTTWdM !,((ؼy3n%7o^nn!l:+]ҦukbiR}yUiiiYYp;v  ,XsݻwW^ 7vٲe˝;wm۶m'OZb+w11XDW ZRgii̙3qt\\NFCKnJ$a%7ͣ7kh"+z:uTyy9"1b˗/t 2tfH zo?[* tk)Z4o200ӧ3׮]8qE1r̘1< 9rHǎ>|Ϟ=1c… ?իW s=zӧOOLL0` ^|MD{{ݻ*=uV2\+Q`M aNIzlmm]v=}k׮8.ن^3T_qUٙoPmn_\$/^XhчƌӼy_5::Z+ХA2HyܹaÆ5m~?rHdddǎ?rAR&OdN;vbC洔_7oޔ=zT*ʕ+[lId{ٹsiӦyEjǏw9rdz|}};tPXX뒒tYk֬YdddJJQ/_^ZZzj"=%d@R X @4WVK*jj7"##y058,Z{;ǷFeşSzVV֮]^(6h`'NHJJۯJ=zhӦM}3ηv.-񯍞,Jɓ'<e2eHHPPPPP#iHuJ2'''333111>>>))))) |}};uԵknݺxPs Ԓ߮]um٫x5"'QߵkWjj\./**?f̘ci :k׮c'N=a„D͛/_|ԩ?ŋϝ;W~}P8tھzj&wǽ{ sU#oc4L$ ]> cٗ͛WZZv%K`9}<IR[;'M#V`N"J^xq7odddqVVV666xJ MD2G1uss رcXXXÆ 4>!.ꐼ`I&j*Ɵ-j9k{`U*x>߲eK+++\kT*U* XEEX,yhѢݻwYYY>>> 4 0`T*}AF:^"o!+6)BK^vs6l-@( *Y›j󨩹 Ɐ"I+/_$&&~177'I*͛7bG777777 hԨ3 .Q(WoO>+'+u +{vΝ;3F=|رW\A :;Hh兽~\eKKK>j*}":Gɤ7?S!+=L-Y_nccӊ TjO-jCbO(|v ЀųEׁ:::߸q u} P,!;L8Q3дiH+XU&)Y\]Q ՁQ^'s玵۷o VdQ#x9٣[|j(H|ƨ˖{!@?!`b3A^r͝;ǒb<%QyZŞgkhU^nݲ !=RK6/9O }sȑ#LQ+SIt~4c,պ8~x?C-G')LݦRrQܾ}͛7uN>\oQ*BVQAo?<YfvK=Vn"NȈQhSW^J۵kwmxCM~ֽ.JxW=\eeest%##6>k1݀ϡ(/#4Ǐ3aD9 qw_;]?UtR+ooo$Ni-~THko?~gϞG):tr,l,Z޴ 8\(W<jÆ %%%dUӪA.+<q\Nv4 ўE |rKKKssŋ'&&qrӮ^zXDEYcV &\oڞP闂俣=H{zرc?vNlt6% (2Yr[ OL!á޼y;;;]|Ѓ#7[4y$ ZUw=777Zq{UDΠDZHRwCqqq?-a-H(p!Ieܥ2pm<k֭2IaI[Di{`Id=z\pVvvv111ktH|$>ɉ3] >=ԣKO<4i Cv lx, SD>PP:uE }~z<啕߿*夆f1JY&eه  .%!@*?~|ƍIII[駟,tOZVJ`r]@4 RVV/>|X._v (@(] p̬JRT* ._YobbbX)%%%"H*T*@gg8h{# yrL&ɔJ%^CӦM{ٽ{M[}9,N "g]h(N5C`Ȕ177WAAAΝ;kUUQvBS['4cܡ^58(7dddw***Zh1o޼`B #-8pY!!91pdqqqW\yD" СCPP@ Cq|>R eeeeee%ew&:V*,/UՖ8SDe9$,J[@杽tL>*F`ΨPu]7& S)))/xcƌy:K|g&_1P$$#!!SnZq͑;vt 1ss} Sx8뭇6"|Q\?MTMxi(Y5PTٳCf7&cS81^,,,ONkb!߽{?~~~}KKKώYfV)N 9}ݼy?x{Y--<QyI^:u*4Ȑu_TT޻woBŋT:eĎIs\*y˜5GGGgh Y;F >>>oܸq`` n2555d2THII~zqq1$*33BױcݻmV+~&vk$\?/)))ׯ?p… ͛ik"syvg͎N+'.ieL%`2N+KcF !.&&&.^ЩS<\t*8:#._ܰaCXX z4hЅ ȾJz똌EfD&8)S>~␭_*U?YONVx:k֙Fo&@ _(gG \}{t.Z ЬY6o̩[6iLrܹZT󧥥?o)WHHȦMt֍1䫔gϞZn}ݯToD%\..q÷gY aUv RjNѺ1f ^Z^|e֭x͛q!DҪU'jEV#Jw܉' ݼy3SZZ۶mñ𝝝nJ ?fVEE/9YX 7ΌbNZt`w:VǔeTZ\Lj?AErg}xVJOO߹s'k׮NQQQ8tDVΝ;"RD/^#i;vh a\-w:cbbpj,.?H>{0ANL= ;5  ."P7ܨj"+.vY|kXK$;|ʈ#p3\@@7TrJMP ϘV"l۶?Ŋ1ֺWT֭[TEWf\\>h]t rb`H,B"œ'gv[>cMNǏ'?JKK 6l;!P )))cƌׯP~eTrBX纑233Gh߾=;*Uu<<+i8 z"3p `?b򒸼H$QyN6}ˏ=62|a)))߿?_~圆S,Jr={ [Msϟ,]\ XGo=/L,I 2RG)փJ@уi#2Fn6>dG];s2ED1;j)lҨQ#&O>}ϙ3q"([n7NRՆf KKK.]^r+0WRIJ̹ ~R*jOެ@d,9QAD.Ŋx $qo=sR0sE'x7oܾ}ĉ7o^pQ:uhkk+ ...`@V'%%歓'O3UUTT4sL ?@KDЏzCH?-[ƏO yΉéSO$6|?hwvv|>GzǏ#"">\XXdee=~˗' D MMM/_꘍O?{iN_|uSdǍvڵ3fƲ$>۸E\qDZڧ3g`[z,Rh LIV:+Ԅ&,^g}|oї{o/ G4Ҏ$d?N8կ_?[4hիWMp .M:Yo˗Vƒ+r<+++%%ET^xqÆ C"h|P(Ξ= Νgjzweɉi;46 :W?z3gΌ?ɓ M$" J(:/;wIDDĨQt?О)v I-P+͸sZye ~qqV.󅦱G$<[h3߽{_]]xOߟXjk~-=Z8/0M:$(ª8,<5ڏinK&mxgbAUlZɈIagUQ%,*mʀϨU؇=657咭ccuC[> (X,9gB2E)< 9SKnQ.{8rǏqL"H. &W$%J$~aڴi!!!QQQdjEϕB}Q@}@]Zy<(g&v|s6Zmfv$_hjjXO\PJ*>s`NƓc Q8 0/4 ak`P6qj?V`nV ]M\YuN"ˤhZX*Fe! G{ȰϨV[LD͗*9Ur ǗUJ˾LR%IZ*0o 0r0wlj]Mwm eF-o+ZJ~ZZE dir#'e{p TFuwϞ=Z-ZDԏ⿧LKupp+++WHc0eiQoz~FZ.mGˤw"Z!Ȉ?ߚC[)))qqq/ݼyS+ Drׯ3ϵ:KרP(۷'C_ 4>Ҋ¤;s\M:|疩# ʰ3_:q'8aS|^eYB^zsfYC(Q}@nݺebbҨQO>+66@RRRfŋkVF㥴tҤI#FAi < 2$R.I3fggzbիWR)1;VZfٳg!EEE߰at˗/߻w/9Ǐw﮶I$;wPBcqn2:}YQ; >'6]?iJ %? i( .]6mZ.]ߟ_= 8q";{3gt&Xeh ;<{A0 zСCdB-qQ˿'[:dju늋 D=z~~cZWTT"pBII ޽{WTTDnݻww!B5o߾-J۶m(---** #::!*k.((7onaak׮sOeDBjUJS3N[X˷4eAS#Qb18 ԩ޽{ӧ?~رo'K[Kv"?|pǏ]v,9C/esiܸɓ'7n7)e,JʹNV727oJJʇƍDZ^reĉD={XYY-[_7o]\\RRRRSS;uuV@P\\`R;99}wDӧO۵kGu˫h۶-ҥ111Gܹsqw233ӎ;RSS#Gtvv>x`BBH$?~YjVSSSxٳgbbb,XPYYGT*8$''_~VMMM.]r3g|%33u&L2d!ӦM2eJ5XBX[=<*ˋ_Ү%y <L al1az#srg:ftpp4iҤI={vܹ{mݺu˖-vvvm۶m֬Yppp===]]]-,,T*KvvvRRRrrW^xQ\\  7oȑ#tZ]J|Qx[* zFT.Y䯿0`ѣG& " N I:Ɵ?#(w}6lسg.^XVV?|P4xYYY9k֬'NL6mǎֹ.6ben}"!̍Ѫ{[ 6tvvyZ5ڼysEE6 "[VV֥KӧѣG;88ٳرcSSӨVZݽ{{2L(իQF?sAA  IR|>..N"ԫWO&Ʀ?yQP1SNɸՋ/SSSq\%ommѣ֭[DCmٲeƌU8WRVvvV lX700t'o+HˤeE읛{x"3wi0Ż]XaٱY$&k!`0Zc999 >|HMM B&r\+|B __ߦMݻ۷˖-[d  @3(hYjT9\Z.))qtt+/((1cƥK-[fPU%IJ$hO&q`11q:W,Aob0wgzݻwǎS*&L^zG3cǎeddo9{lDDDDDKKK;|cbb2zh>aaNaJZdɔ)SBCC|O˗{暚N<9<<[,ifȑx/\P(rssgΜ|aÆUVVݻ700ݻwUӁ[E9ˊ?*9TO_Joavm<oV01P @5ja([&)UR*YQU?b[{[fCaY ^V H$ܨlnnnnnn)VVV~ʕkFGG/\pĉ`U{ԣܸqC,>Ə޽ 6,_Q䢒ǿ]~yXPכ6m4i-~7Kd/_l۶VGJ_*KJ ߙG2a<7i0Yo/,yjbbjR+ejL+d> &5hukA`w:HD"ѡCpرBXVVpB\^Q0$$lٲP++K.1u߇Xb[Y/Ξ lKb Qxj+t~mR{15NP1jl'Ňqo.~G38," 7XZZ>|4%%1:1"it>Y4K7]]L[{X )*\.;&N+ERb~:=s)JR[XX|+WFjR۷{%Woٳg3JsC\k [ l1}gKH!S2B:E 13`}l,}x<-ZԾ}ULex-;xChn$cK5ݕ ȉ '`_ѳSo+++ܹWjݲ677dD,b߿y]vmժ&w.J׬Y3pc'srݻǏX0:|=}B;8 Y'Xf8 ;šQչP-HQ_z+ژ%ƍ:#S>ˇgdd<|022iiiB/ ߿aÆ~~~&&&ZLP.>}KJJJIIILLT(vvvZիW=d2YZZڰaHtQ˫WMvA0E /:t 3 /U\`Y~Lg6dU`" M@`Mqa!,N:kRR8UzhmǬ@<Ȁ{)0ZU*Ϗ9r̙͛O>SN80`trr ԩa۷o?}Ν;uiѢEr`iM1y Z_vf(""">|(Ƚ!ݓ6Ԋ}m@fWrI] ,VC7,Tr37˃N7'g(Dw}7sr?Ʌʸ}_RÇ;w{l<̙3i.--Zx1{rt] kM7n,ė/_||}yuoL%Y^-{'zYqsqͣ5٢lRuU=xWrXÇuXۇsa...;v rGQ^vڅ3ڀS <yٿېa7Jl f|\= DZZ|֭[YA7nh׮s<J8&.۶mKҽ "rתc S{.8~x<忰*++;;;@aR_L+ Eu떖Fsί^3IhUQFL̞f,bl1Z(Y/;vL(PFSSΏMHHaMj/U:mP]bZ!LԣG&H5kb1gbCFkXmUe=m,}BׂCPgj}Z7Qɓ'-ZSm3z%ɼy~- ʺ,?~cx<^XX˗/sA7ʊewGT輫VTvX$H1@B}ͽiZ{'db.iVU Zh͛oQFϟ1ZG@cffc vl2txO" %AEuǠ&I0P`߼Y'O߉9j@ rvvx}UGjV:ӀV6VZl@vm>|uua,Kˈ0V^^; ,"3Ur r  kM 2k:uϟo8ɥK 0ց)$ %K ŵjժK.W\xFh<|͉B}B:dlmRĢbkzTyђ<19̙CVmEEEݻw244tԨQd#G$&& Uj7nܹse˖ Ч*.xl̘1w{.`цz0Qv75 }ke9 {5!>djR!0 6iLbTjj<#B hꬺ^sQᏵhd?LtR#$v;cүp "=EV0Vsd@K5[ޒUZw!CX{r`ZAZ:f!WLFTLֺuk _255_c@%K>|#""ѣG8m:zŋ]\\>|pAr42v>}bjv'#QT$aj^0 )`HU ;mS*ZEIjSZ @ev B)or{=b|LҴ:rXu?촐@KdL+GɮBUg2ļǜ$(b6V5D gY-ۈaXxxxeeeAAƍ׬Yyҥ{:u* ::Z.'6M.eee%%%>PٙjRᄡQ~Q0浞0 F$h5gtE|rrJ@ * FOzP: H`i1:tΕJ[3^OV9gKLQ|u+++nY@ԩT*nzu Oi\~}gF D7|ZO˦VZ-2PN#fU?IIU(#VGdA@S BVsy !]X?I\}Lp]P k]rbQ@ `Y~d>]3 *>>>͛7zTw˗ǎ۽{'֬YcbbT*b1@T*311x8qywX88---(88XV-.R$W) I%T kAZsiN 'k:,PEZZ*a ݢؑt.DFD*hf&Ep}Q 75{^Yz1(((44ҥK"HuRp󲲲}eggf͚x={TTT>}իWss-[_%%%޽;wN_xJ޽;AmcvZ hQz  sy\:N;k|u_qRlscTBh[ǡW>(TjhN@W&!lԩ?>w'~xM6};vѣJeϞ=!7n<~a"## ްaC׮]}}}Q1uس߰0\` jS"icOAm jjy:9&H&Y "KC!@:)Fc&쵱PJj8T}qUђ-&*+(Nk:󉭛bo nn.annnx Ůo'٠Vsssmll sӂ=… vza޽G[!ѻ08h~7`ܶ @x<@*HGn0j(_L]\&-C]Do>7Z:OPv,Z;> BDt&+ӛno&rcɉEˎ?үDq03g憅-^n#6DBWTjٲ#G-Zt }(NNN?ׯ7nܘ1rN:EDD( ݳgϾ[%tw~O/7^KEY@ ݢQh@PcKa4fCXM1ʨ?ҥeJg|&gAYW:QTbGW꡵ad8OE|x322O>=f̘ "cX%u85]>Vk/Z :tС?ۏ=z̘1M4A <Ի2,11͛xÇ3g$b9r X СÉ',,,yzQ@u{;@ <0{o!3ݭῳ8=&c66pF'(CqU3rrrZd̙3o߾oݻwo߾Gmڴ'}JT/_yߏ͚5۲eСCh; {xx $''}:::Zŋ~D"ԨBZ=@m+cÀPn]:s[YXZ>{xq)D%x5bBaB+PKbnCdᅓZCTKΉbq,  y*2`m˗/8zYjjjqq11`iihnnneeecc[[[d򊊊rLVZZZTTgfz7.?ϟp4IپU,"Fk8q+:"0PQVͫ "A][XሣF9TL"!Ĉk#(N1 􊝱b8C]V{P*%%%YYY>|HII)//L&fbaaѸq㠠zyzz:88XXXS)++IKK7o޿{+7n8r4 d&5-$7@/&U@.dVM A &{1t":#.BTrFŐ|i%@p$csSƅgggggMRu2L`Q;z-$!ʀ6lذo߾ƍB J+p28(꭪1RX^VQS cAJou;zt&;J9 -@%uBJ!uֆpqO# Ts)`!Eg=|> 45yLy9H3ʉ_!n2p]@:RG pP_@æ/(ʸqf;F?ڧ7'AUU*!RL!GzI E\ԷxZA|Hp *:GaBLQخE?V III1=ƺsvkN;enMbuP 'PWC,?ʓ<;A+O Ӂ̄NH;K"C V;o4BoWl6eclL)0 S9l~ӝB̦ 0j @@TM:gvX7d80y.mD0˒+j 4LiL\.m$;K.1Sm1`g'YFS ?˔1}hPDŽLpAMٵ͋{ -SM`U` :4TG- FN 4qM4CiRS }F䩨?0OD~JU195,hb,$l-ž튫D^:Y^i;V^{ux(Gõ"W?~ܥs6m;xʳ\ryH rviayif'ի%Ǧ熝0zG4 3^oAF5Q׿J4;m?~GI4hĴ&<1 kV, *+b=>O\rԩ~qL0(מг9n1)2CXuȑ%$&SS of1k^%͎Lf\\-,\-F57ly`((/KJJ=z(q4ZI`6jԸcǎtsNn'FpH57TL7-.m%:@͙uLQJ(NZ,y%NA`^xLmn3QF@I6?5WXQs+4%$g )]B78yP[YGŧONOO9rիW߾}kgg7j(gggʽ{~w<z1ݭ%^ EIB,WRCdt\- ES x[L8>(Gby[5s.kWےJ&&&;w믿ryjjjFrrrÉ@2ӧ8JHLJeEEʕ++=6_x1NkJ &OL_%"j;!qA004iW'`0h487FBHh!`7)wͯ#)ݻ{}ޞۊ T*uxxj:uVyC*[2a3~N{U|_ȼTawMӴm|~~nOOO\]FM۵,^ H$V5Jbxtt4L4MT*ac+ j!F(KxZXȂ(oP~853hRu}jpC<ȏUA<I( ۶///|>u=___?>>ڶf|>N_^^noorX8iL&>>>TUt:F! ^W.Q|B3> _PFVlmm-fcF!*`tg&b2:!J X#AI!BF+0 csssQ~E6,aH%D{FYc~NoWX;.؂Bh5p+elbuE>J\x27h̐. H0{HN-BJBH*+ό!=]| J}JP܀.,&!sq@f_yX/ bVmfGQْD3[@p|' *#x2@+d|O 2#w"Tr==H \V9҄⷇qKAhuDmMO]c ?IENDB`././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.6110866 pynacl-1.6.2/docs/api/0000755000175100017510000000000015125531066014161 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/api/hash.rst0000644000175100017510000000571015125531055015637 0ustar00runnerrunnernacl.hash ========= .. currentmodule:: nacl.hash .. function:: sha256(message, encoder) Hashes ``message`` with SHA256. :param bytes message: The message to hash. :param encoder: A class that is able to encode the hashed message. :return bytes: The hashed message. .. function:: sha512(message, encoder) Hashes ``message`` with SHA512. :param bytes message: The message to hash. :param encoder: A class that is able to encode the hashed message. :return bytes: The hashed message. .. function:: blake2b(data, digest_size=BLAKE2B_BYTES, key=b'', \ salt=b'', person=b'', encoder=nacl.encoding.HexEncoder) One-shot blake2b digest :param data: the digest input byte sequence :type data: bytes :param digest_size: the requested digest size; must be at most :py:data:`.BLAKE2B_BYTES_MAX`; the default digest size is :py:data:`.BLAKE2B_BYTES` :type digest_size: int :param key: the key to be set for keyed MAC/PRF usage; if set, the key must be at most :py:data:`.BLAKE2B_KEYBYTES_MAX` long :type key: bytes :param salt: an initialization salt at most :py:data:`.BLAKE2B_SALTBYTES` long; it will be zero-padded if needed :type salt: bytes :param person: a personalization string at most :py:data:`.BLAKE2B_PERSONALBYTES` long; it will be zero-padded if needed :type person: bytes :param encoder: the encoder to use on returned digest :type encoder: class :return: encoded bytes data :rtype: the return type of the chosen encoder .. function:: siphash24(message, key=b'', encoder=nacl.encoding.HexEncoder) Computes a keyed MAC of ``message`` using siphash-2-4 :param message: The message to hash. :type message: bytes :param key: the message authentication key to be used It must be a :py:data:`.SIPHASH_KEYBYTES` long bytes sequence :type key: bytes(:py:data:`.SIPHASH_KEYBYTES`) :param encoder: A class that is able to encode the hashed message. :return: The hashed message. :rtype: bytes(:py:data:`.SIPHASH_BYTES`) long bytes sequence .. function:: siphashx24(message, key=b'', encoder=nacl.encoding.HexEncoder) .. versionadded:: 1.2 Computes a keyed MAC of ``message`` using the extended output length variant of siphash-2-4 :param message: The message to hash. :type message: bytes :param key: the message authentication key to be used It must be a :py:data:`.SIPHASHX_KEYBYTES` long bytes sequence :type key: bytes(:py:data:`.SIPHASHX_KEYBYTES`) :param encoder: A class that is able to encode the hashed message. :return: The hashed message. :rtype: bytes(:py:data:`.SIPHASHX_BYTES`) long bytes sequence :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/api/hashlib.rst0000644000175100017510000000551515125531055016331 0ustar00runnerrunnernacl.hashlib ============ .. currentmodule:: nacl.hashlib The :py:mod:`nacl.hashlib` module exposes directly usable implementations of raw constructs which libsodium exposes with simplified APIs, like the ones in :py:mod:`nacl.hash` and in :py:mod:`nacl.pwhash`. The :py:class:`~.blake2b` and :py:func:`~.scrypt` implementations are as API compatible as possible with the corresponding ones added to cpython standard library's hashlib module in cpython's version 3.6. .. class:: blake2b(data=b'', digest_size=BYTES, key=b'', salt=b'', person=b'') Returns an hash object which exposes an API mostly compatible to python3.6's hashlib.blake2b (the only difference being missing support for tree hashing parameters in the constructor) The methods :py:func:`update`, :py:func:`copy`, :func:`digest` and :func:`hexdigest` have the same semantics as described in hashlib documentation. Each instance exposes the :py:attr:`digest_size`, :py:attr:`block_size` :py:attr:`name` properties as required by hashlib API. .. attribute:: MAX_DIGEST_SIZE the maximum allowed value of the requested digest_size .. attribute:: MAX_KEY_SIZE the maximum allowed size of the password parameter .. attribute:: PERSON_SIZE the maximum size of the personalization .. attribute:: SALT_SIZE the maximum size of the salt .. function:: scrypt(password, salt='', n=2**20, r=8, p=1,\ maxmem=2**25, dklen=64) Derive a raw cryptographic key using the scrypt KDF. :param password: the input password :type password: bytes :param salt: a crypographically-strong random salt :type salt: bytes :param n: CPU/Memory cost factor :type n: int :param r: block size multiplier: the used block size will be 128 * r :type r: int :param p: requested parallelism: the number of independently running scrypt constructs which will contribute to the final key generation :type p: int :param maxmem: maximum memory the whole scrypt construct will be entitled to use :type maxmem: int :param dklen: length of the derived key :type dklen: int :return: a buffer dklen bytes long containing the derived key :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. Implements the same signature as the ``hashlib.scrypt`` implemented in cpython version 3.6 The recommended values for n, r, p in 2012 were n = 2**14, r = 8, p = 1; as of 2016, libsodium suggests using n = 2**14, r = 8, p = 1 in a "interactive" setting and n = 2**20, r = 8, p = 1 in a "sensitive" setting. The total memory usage will respectively be a little greater than 16MB in the "interactive" setting, and a little greater than 1GB in the "sensitive" setting. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/api/pwhash.rst0000644000175100017510000002453315125531055016212 0ustar00runnerrunnernacl.pwhash =========== .. module:: nacl.pwhash The package pwhash provides implementations of modern *memory-hard* password hashing construction exposing modules with a uniform API. Functions exposed at top level ------------------------------ The top level module only provides the functions implementing ascii encoded hashing and verification. .. function:: str(password, \ opslimit=OPSLIMIT_INTERACTIVE, \ memlimit=MEMLIMIT_INTERACTIVE) Returns a password verifier hash, generated with the password hasher chosen as a default by libsodium. :param password: password used to seed the key derivation procedure; it length must be between :py:const:`PASSWD_MIN` and :py:const:`PASSWD_MAX` :type password: bytes :param opslimit: the time component (operation count) of the key derivation procedure's computational cost; it must be between :py:const:`OPSLIMIT_MIN` and :py:const:`OPSLIMIT_MAX` :type opslimit: int :param memlimit: the memory occupation component of the key derivation procedure's computational cost; it must be between :py:const:`MEMLIMIT_MIN` and :py:const:`MEMLIMIT_MAX` :type memlimit: int :returns: the ascii encoded password hash along with a prefix encoding the used hashing construct, the random generated salt and the operation and memory limits used to generate the password hash :rtype: bytes As of PyNaCl version 1.2 this is :py:func:`nacl.pwhash.argon2id.str`. .. versionadded:: 1.2 .. function:: verify(password_hash, password) This function checks if hashing the proposed password, with the same construction and parameters encoded in the password hash would generate the same encoded string, thus verifying the correct password has been proposed in an authentication attempt. .. versionadded:: 1.2 .. rubric:: Module level constants The top level module defines the constants related to the :py:func:`str` hashing construct and its corresponding :py:func:`verify` password verifier. .. py:data:: PASSWD_MIN .. py:data:: PASSWD_MAX minimum and maximum length of the password to hash .. py:data:: PWHASH_SIZE maximum size of the encoded hash .. py:data:: OPSLIMIT_MIN .. py:data:: OPSLIMIT_MAX minimum and maximum operation count for the hashing construct .. py:data:: MEMLIMIT_MIN .. py:data:: MEMLIMIT_MAX minimum and maximum memory occupation for the hashing construct and the recommended values for the opslimit and memlimit parameters .. py:data:: MEMLIMIT_INTERACTIVE .. py:data:: OPSLIMIT_INTERACTIVE recommended values for the interactive user authentication password check case, leading to a sub-second hashing time .. py:data:: MEMLIMIT_SENSITIVE .. py:data:: OPSLIMIT_SENSITIVE recommended values for generating a password hash/derived key meant to protect sensitive data, leading to a multi-second hashing time .. py:data:: MEMLIMIT_MODERATE .. py:data:: OPSLIMIT_MODERATE values leading to a hashing time and memory cost intermediate between the interactive and the sensitive cases Per-mechanism password hashing implementation modules ----------------------------------------------------- Along with the respective :py:func:`str` and :py:func:`verify` functions, the modules implementing named password hashing constructs expose also a :py:func:`kdf` function returning a raw pseudo-random bytes sequence derived from the input parameters nacl.pwhash.argon2id """""""""""""""""""" .. module:: nacl.pwhash.argon2id .. function:: kdf(size, password, salt, \ opslimit=OPSLIMIT_SENSITIVE, \ memlimit=MEMLIMIT_SENSITIVE, \ encoder=nacl.encoding.RawEncoder) Derive a ``size`` bytes long key from a caller-supplied ``password`` and ``salt`` pair using the ``argon2id`` partially data dependent memory-hard construct. :param size: derived key size, must be between :py:const:`BYTES_MIN` and :py:const:`BYTES_MAX` :type size: int :param password: password used to seed the key derivation procedure; it length must be between :py:const:`PASSWD_MIN` and :py:const:`PASSWD_MAX` :type password: bytes :param salt: **RANDOM** salt used in the key derivation procedure; its length must be exactly :py:const:`.SALTBYTES` :type salt: bytes :param opslimit: the time component (operation count) of the key derivation procedure's computational cost; it must be between :py:const:`OPSLIMIT_MIN` and :py:const:`OPSLIMIT_MAX` :type opslimit: int :param memlimit: the memory occupation component of the key derivation procedure's computational cost; it must be between :py:const:`MEMLIMIT_MIN` and :py:const:`MEMLIMIT_MAX` :type memlimit: int :rtype: bytes The default settings for opslimit and memlimit are those deemed correct for generating a key, which can be used to protect sensitive data for a long time, leading to a multi-second hashing time. .. versionadded:: 1.2 .. function:: str(password, \ opslimit=OPSLIMIT_INTERACTIVE, \ memlimit=MEMLIMIT_INTERACTIVE) Returns a password verifier hash, generated with the ``argon2id`` password hasher. See: :py:func:`nacl.pwhash.str` for the general API. .. versionadded:: 1.2 .. function:: verify(password_hash, password) This function verifies the proposed ``password``, using ``password_hash`` as a password verifier. See: :py:func:`nacl.pwhash.verify` for the general API. .. versionadded:: 1.2 .. rubric:: Module level constants The module defines the constants related to the :py:func:`kdf` raw hashing construct .. py:data:: SALTBYTES the length of the random bytes sequence passed in as a salt to the :py:func:`kdf` .. py:data:: BYTES_MIN .. py:data:: BYTES_MAX the minimum and maximum allowed values for the ``size`` parameter of the :py:func:`kdf` The meaning of each of the constants .. py:data:: PASSWD_MIN .. py:data:: PASSWD_MAX .. py:data:: PWHASH_SIZE .. py:data:: OPSLIMIT_MIN .. py:data:: OPSLIMIT_MAX .. py:data:: MEMLIMIT_MIN .. py:data:: MEMLIMIT_MAX .. py:data:: MEMLIMIT_INTERACTIVE .. py:data:: OPSLIMIT_INTERACTIVE .. py:data:: MEMLIMIT_SENSITIVE .. py:data:: OPSLIMIT_SENSITIVE .. py:data:: MEMLIMIT_MODERATE .. py:data:: OPSLIMIT_MODERATE is the same as in :py:mod:`nacl.hash`. nacl.pwhash.argon2i """"""""""""""""""" .. module:: nacl.pwhash.argon2i .. function:: kdf(size, password, salt, \ opslimit=OPSLIMIT_SENSITIVE, \ memlimit=MEMLIMIT_SENSITIVE, \ encoder=nacl.encoding.RawEncoder) Derive a ``size`` bytes long key from a caller-supplied ``password`` and ``salt`` pair using the ``argon2i`` data independent memory-hard construct. See: py:func:`nacl.pwhash.argon2id.kdf` for the general API. .. versionadded:: 1.2 .. function:: str(password, \ opslimit=OPSLIMIT_INTERACTIVE, \ memlimit=MEMLIMIT_INTERACTIVE) Returns a password verifier hash, generated with the ``argon2i`` password hasher. See: :py:func:`nacl.pwhash.str` for the general API. .. versionadded:: 1.2 .. function:: verify(password_hash, password) This function verifies the proposed ``password``, using ``password_hash`` as a password verifier. See: :py:func:`nacl.pwhash.verify` for the general API. .. versionadded:: 1.2 .. rubric:: Module level constants The meaning of each of the constants .. py:data:: PASSWD_MIN .. py:data:: PASSWD_MAX .. py:data:: PWHASH_SIZE .. py:data:: SALTBYTES .. py:data:: BYTES_MIN .. py:data:: BYTES_MAX .. py:data:: OPSLIMIT_MIN .. py:data:: OPSLIMIT_MAX .. py:data:: MEMLIMIT_MIN .. py:data:: MEMLIMIT_MAX .. py:data:: MEMLIMIT_INTERACTIVE .. py:data:: OPSLIMIT_INTERACTIVE .. py:data:: MEMLIMIT_SENSITIVE .. py:data:: OPSLIMIT_SENSITIVE .. py:data:: MEMLIMIT_MODERATE .. py:data:: OPSLIMIT_MODERATE is the same as in :py:mod:`nacl.pwhash` and :py:mod:`nacl.pwhash.argon2id` nacl.pwhash.scrypt """""""""""""""""" .. module:: nacl.pwhash.scrypt .. function:: kdf(size, password, salt, \ opslimit=OPSLIMIT_SENSITIVE, \ memlimit=MEMLIMIT_SENSITIVE, \ encoder=nacl.encoding.RawEncoder) Derive a ``size`` bytes long key from a caller-supplied ``password`` and ``salt`` pair using the ``scrypt`` data dependent memory-hard construct. See: :py:func:`nacl.pwhash.argon2id.kdf` for the general API. :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. .. versionadded:: 1.2 .. function:: str(password, \ opslimit=OPSLIMIT_INTERACTIVE, \ memlimit=MEMLIMIT_INTERACTIVE) Returns a password verifier hash, generated with the ``scrypt`` password hasher. See: :py:func:`nacl.pwhash.str` for the general API. :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. .. versionadded:: 1.2 .. function:: verify(password_hash, password) This function verifies the proposed ``password``, using ``password_hash`` as a password verifier. See: py:func:`nacl.pwhash.verify` for the general API. :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. .. versionadded:: 1.2 .. rubric:: Module level constants The meaning of each of the constants .. py:data:: PASSWD_MIN .. py:data:: PASSWD_MAX .. py:data:: PWHASH_SIZE .. py:data:: SALTBYTES .. py:data:: BYTES_MIN .. py:data:: BYTES_MAX .. py:data:: OPSLIMIT_MIN .. py:data:: OPSLIMIT_MAX .. py:data:: MEMLIMIT_MIN .. py:data:: MEMLIMIT_MAX .. py:data:: MEMLIMIT_INTERACTIVE .. py:data:: OPSLIMIT_INTERACTIVE .. py:data:: MEMLIMIT_SENSITIVE .. py:data:: OPSLIMIT_SENSITIVE .. py:data:: MEMLIMIT_MODERATE .. py:data:: OPSLIMIT_MODERATE is the same as in :py:mod:`nacl.pwhash` and :py:mod:`nacl.pwhash.argon2id` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/changelog.rst0000644000175100017510000000003615125531055016066 0ustar00runnerrunner.. include:: ../CHANGELOG.rst ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/conf.py0000644000175100017510000001400415125531055014704 0ustar00runnerrunner# # This file is execfile()d with the current directory set to its containing dir # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. try: import sphinx_rtd_theme except ImportError: sphinx_rtd_theme = None # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) import nacl # flake8: noqa # -- General configuration ---------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = "1.0" # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named "sphinx.ext.*") or your custom ones. extensions = [ "sphinx.ext.autodoc", "sphinx.ext.doctest", "sphinx.ext.intersphinx", "sphinx.ext.viewcode", ] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] # The suffix of source filenames. source_suffix = ".rst" # The encoding of source files. # source_encoding = "utf-8-sig" # The master toctree document. master_doc = "index" # General information about the project. project = "PyNaCl" copyright = "2013, Donald Stufft and Individual Contributors" # The version info for the project you"re documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = "".join(nacl.__version__.split(".")[:2]) # The full version, including alpha/beta/rc tags. release = nacl.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = "" # Else, today_fmt is used as the format for a strftime call. # today_fmt = "%B %d, %Y" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ["_build"] # The reST default role (used for this markup: `text`) to use for all documents # default_role = None # If true, "()" will be appended to :func: etc. cross-reference text. # add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). # add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. # show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] # -- Options for HTML output -------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. if sphinx_rtd_theme: html_theme = "sphinx_rtd_theme" else: html_theme = "default" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". # html_title = None # A shorter title for the navigation bar. Default is the same as html_title. # html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. # html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. # html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] # If not "", a "Last updated on:" timestamp is inserted at every page bottom, # using the given strftime format. # html_last_updated_fmt = "%b %d, %Y" # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True # Custom sidebar templates, maps document names to template names. # html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. # html_additional_pages = {} # If false, no module index is generated. # html_domain_indices = True # If false, no index is generated. # html_use_index = True # If true, the index is split into individual pages for each letter. # html_split_index = False # If true, links to the reST sources are added to the pages. # html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. # html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. # html_use_opensearch = "" # This is the file name suffix for HTML files (e.g. ".xhtml"). # html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = "PyNaCldoc" intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} # Retry requests in the linkcheck builder so that we're resilient against # transient network errors. linkcheck_retries = 10 linkcheck_timeout = 5 linkcheck_ignore = [ "https://www.gnu.org/software/make/manual/html_node/Parallel.html" ] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/doing-a-release.rst0000644000175100017510000000077615125531055017106 0ustar00runnerrunnerDoing A Release =============== To run a PyNaCl release follow these steps: * Update the version number in ``src/nacl/__init__.py``. * Update ``README.rst`` changelog section with the date of the release. * Send a pull request with these items and wait for it to be merged. * Run ``python release.py release {version}`` Once the release script completes you can verify that the sdist and wheels are present on PyPI and then send a new PR to bump the version to the next major version (e.g. ``1.2.0.dev1``). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/encoding.rst0000644000175100017510000000235015125531055015726 0ustar00runnerrunnerEncoders ======== .. currentmodule:: nacl.encoding PyNaCl supports a simple method of encoding and decoding messages in different formats. Encoders are simple classes with staticmethods that encode/decode and are typically passed as a keyword argument `encoder` to various methods. For example you can generate a signing key and encode it in hex with: .. code-block:: python hex_key = nacl.signing.SigningKey.generate().encode(encoder=nacl.encoding.HexEncoder) Then you can later decode it from hex: .. code-block:: python signing_key = nacl.signing.SigningKey(hex_key, encoder=nacl.encoding.HexEncoder) Built in Encoders ----------------- .. class:: RawEncoder .. class:: HexEncoder .. class:: Base16Encoder .. class:: Base32Encoder .. class:: Base64Encoder .. class:: URLSafeBase64Encoder Defining your own Encoder ------------------------- Defining your own encoder is easy. Each encoder is simply a class with 2 static methods. For example here is the hex encoder: .. code-block:: python import binascii class HexEncoder(object): @staticmethod def encode(data): return binascii.hexlify(data) @staticmethod def decode(data): return binascii.unhexlify(data) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/exceptions.rst0000644000175100017510000000474715125531055016335 0ustar00runnerrunnerExceptions ========== .. currentmodule:: nacl.exceptions All of the exceptions raised from PyNaCl-exposed methods/functions are subclasses of :py:exc:`nacl.exceptions.CryptoError`. This means downstream users can just wrap cryptographic operations inside a .. code-block:: python try: # cryptographic operations except nacl.exceptions.CryptoError: # cleanup after any kind of exception # raised from cryptographic-related operations These are the exceptions implemented in :py:mod:`nacl.exceptions`: PyNaCl specific exceptions -------------------------- .. class:: CryptoError Base exception for all nacl related errors .. class:: BadSignatureError Raised when the signature was forged or otherwise corrupt. .. class:: InvalidkeyError Raised on password/key verification mismatch .. class:: UnavailableError is a subclass of :class:`~nacl.exceptions.RuntimeError`, raised when trying to call functions not available in a minimal build of libsodium. PyNaCl exceptions mixing-in standard library ones ------------------------------------------------- Both for clarity and for compatibility with previous releases of the PyNaCl, the following exceptions mix-in the same-named standard library exception to :py:class:`~nacl.exceptions.CryptoError`. .. class:: RuntimeError is a subclass of both CryptoError and standard library's RuntimeError, raised for internal library errors .. class:: AssertionError is a subclass of both CryptoError and standard library's AssertionError, raised by default from :py:func:`~nacl.utils.ensure` when the checked condition is `False` .. class:: TypeError is a subclass of both CryptoError and standard library's TypeError .. class:: ValueError is a subclass of both CryptoError and standard library's ValueError Utility functions for exception handling ---------------------------------------- .. function:: ensure(cond, *args, raising=nacl.exceptions.AssertionError) Returns if a condition is true, otherwise raise a caller-configurable :py:class:`Exception` :param cond: the condition to be checked :type cond: bool :param sequence args: the arguments to be passed to the exception's constructor :param raising: the exception to be raised if `cond` is `False` :type raising: exception Example usage: .. code-block:: python nacl.exceptions.ensure( a == 1 or a == 2, "a must be either 1 or 2" ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/hashing.rst0000644000175100017510000001503415125531055015564 0ustar00runnerrunnerHashing ======= .. currentmodule:: nacl.hash Cryptographic secure hash functions are irreversible transforms of input data to a fixed length `digest`. The standard properties of a cryptographic hash make these functions useful both for standalone usage as data integrity checkers, as well as ``black-box`` building blocks of other kind of algorithms and data structures. All of the hash functions exposed in :py:mod:`nacl.hash` can be used as data integrity checkers. Integrity check examples ------------------------ Message's creator perspective (:py:func:`~nacl.hash.sha256`, :py:func:`~nacl.hash.sha512`, :py:func:`~nacl.hash.blake2b`) .. testcode:: import nacl.encoding import nacl.hash HASHER = nacl.hash.sha256 # could be nacl.hash.sha512 or nacl.hash.blake2b instead # define a 1024 bytes log message msg = 16*b'256 BytesMessage' digest = HASHER(msg, encoder=nacl.encoding.HexEncoder) # now send msg and digest to the user print(nacl.encoding.HexEncoder.encode(msg)) print(digest) .. testoutput:: b'3235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d6573736167653235362042797465734d657373616765' b'12b413c70c148d79bb57a1542156c5f35e24ad77c38e8c0e776d055e827cdd45' Message's user perspective (:py:func:`~nacl.hash.sha256`, :py:func:`~nacl.hash.sha512`, :py:func:`~nacl.hash.blake2b`) .. testcode:: from nacl.bindings.utils import sodium_memcmp import nacl.encoding import nacl.hash HASHER = nacl.hash.sha256 # could be nacl.hash.sha512 or nacl.hash.blake2b instead # we received a 1024 bytes long message and it hex encoded digest received_msg = nacl.encoding.HexEncoder.decode( b'3235362042797465734d6573736167653235362042797465734d657373616765' b'3235362042797465734d6573736167653235362042797465734d657373616765' b'3235362042797465734d6573736167653235362042797465734d657373616765' b'3235362042797465734d6573736167653235362042797465734d657373616765' b'3235362042797465734d6573736167653235362042797465734d657373616765' b'3235362042797465734d6573736167653235362042797465734d657373616765' b'3235362042797465734d6573736167653235362042797465734d657373616765' b'3235362042797465734d6573736167653235362042797465734d657373616765' ) dgst = b'12b413c70c148d79bb57a1542156c5f35e24ad77c38e8c0e776d055e827cdd45' shortened = received_msg[:-1] modified = b'modified' + received_msg[:-8] orig_dgs = HASHER(received_msg, encoder=nacl.encoding.HexEncoder) shrt_dgs = HASHER(shortened, encoder=nacl.encoding.HexEncoder) mdfd_dgs = HASHER(modified, encoder=nacl.encoding.HexEncoder) def eq_chk(dgs0, dgs1): if sodium_memcmp(dgs0, dgs1): return 'equals' return 'is different from' MSG = 'Digest of {0} message {1} original digest' for chk in (('original', orig_dgs), ('truncated', shrt_dgs), ('modified', mdfd_dgs)): print(MSG.format(chk[0], eq_chk(dgst, chk[1]))) .. testoutput:: Digest of original message equals original digest Digest of truncated message is different from original digest Digest of modified message is different from original digest Additional hashing usages for :class:`~nacl.hash.blake2b` --------------------------------------------------------- As already hinted above, traditional cryptographic hash functions can be used as building blocks for other uses, typically combining a secret-key with the message via some construct like the ``HMAC`` one. The :class:`~nacl.hash.blake2b` hash function can be used directly both for message authentication and key derivation, replacing the ``HMAC`` construct and the ``HKDF`` one by setting the additional parameters ``key``, ``salt`` and ``person``. Please note that **key stretching procedures** like ``HKDF`` or the one outlined in `Key derivation`_ are **not** suited to derive a *cryptographically-strong* key from a *low-entropy input* like a plain-text password or to compute a strong *long-term stored* hash used as password verifier. See the :ref:`password-hashing` section for some more information and usage examples of the password hashing constructs provided in :py:mod:`~nacl.pwhash`. Message authentication ---------------------- To authenticate a message, using a secret key, the blake2b function must be called as in the following example. Message authentication example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. testcode:: import nacl.encoding import nacl.utils from nacl.hash import blake2b msg = 16*b'256 BytesMessage' msg2 = 16*b'256 bytesMessage' auth_key = nacl.utils.random(size=64) # the simplest way to get a cryptographic quality auth_key # is to generate it with a cryptographic quality # random number generator auth1_key = nacl.utils.random(size=64) # generate a different key, just to show the mac is changed # both with changing messages and with changing keys mac0 = blake2b(msg, key=auth_key, encoder=nacl.encoding.HexEncoder) mac1 = blake2b(msg, key=auth1_key, encoder=nacl.encoding.HexEncoder) mac2 = blake2b(msg2, key=auth_key, encoder=nacl.encoding.HexEncoder) for i, mac in enumerate((mac0, mac1, mac2)): print('Mac{0} is: {1}.'.format(i, mac)) .. testoutput:: Mac0 is: b'...'. Mac1 is: b'...'. Mac2 is: b'...'. Key derivation -------------- The blake2b algorithm can replace a key derivation function by following the lines of: Key derivation example ~~~~~~~~~~~~~~~~~~~~~~ .. testcode:: import nacl.encoding import nacl.utils from nacl.hash import blake2b master_key = nacl.utils.random(64) derivation_salt = nacl.utils.random(16) personalization = b'' derived = blake2b(b'', key=master_key, salt=derivation_salt, person=personalization, encoder=nacl.encoding.RawEncoder) By repeating the key derivation procedure before encrypting our messages, and sending the derivation_salt along with the encrypted message, we can expect to never reuse a key, drastically reducing the risks which ensue from such a reuse. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/index.rst0000644000175100017510000000112515125531055015246 0ustar00runnerrunner.. include:: ../README.rst Contents -------- .. toctree:: :maxdepth: 2 public secret signing hashing password_hashing Support Features ---------------- .. toctree:: :maxdepth: 2 encoding exceptions utils .. toctree:: :caption: Api Documentation :maxdepth: 3 :glob: api/hash api/pwhash api/hashlib .. toctree:: :caption: The PyNaCl open source project :maxdepth: 2 install doing-a-release vectors/index changelog Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/install.rst0000644000175100017510000000003415125531055015603 0ustar00runnerrunner.. include:: ../INSTALL.rst ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/password_hashing.rst0000644000175100017510000002266315125531055017514 0ustar00runnerrunner.. _password-hashing: Password hashing ================ .. currentmodule:: nacl.pwhash Password hashing and password based key derivation mechanisms in actual use are all based on the idea of iterating a hash function many times on a combination of the password and a random ``salt``, which is stored along with the hash, and allows verifying a proposed password while avoiding clear-text storage. The latest developments in password hashing have been *memory-hard* and *tunable* mechanisms, pioneered by ``scrypt`` [SD2012]_, and followed-on by the schemes submitted to the **Password Hashing Competition** [PHC]_. The :py:mod:`nacl.pwhash` module exposes both the **PHC** recommended partially data dependent ``argon2id`` and the data independent ``argon2i`` mechanisms alongside to the ``scrypt`` one. In the case of password storage, it's usually suggested to give preference to data dependent mechanisms, therefore the default mechanism suggested by ``libsodium`` since version 1.0.15, and therefore by ``PyNaCl`` since version 1.2 is ``argon2id``. If you think in your use-case the risk of potential timing-attacks stemming from data-dependency is greater than the potential time/memory trade-offs stemming out of data-independency, you should prefer ``argon2i`` to ``argon2id`` or ``scrypt`` Hashers and parameters ---------------------- PyNaCl exposes the functions and the associated parameters needed to exploit the password hashing constructions in a uniform way in the modules :py:mod:`~nacl.pwhash.argon2id`, :py:mod:`~nacl.pwhash.argon2i` and :py:mod:`~nacl.pwhash.scrypt`, therefore, if you need to change your choice of construction, you simply need to replace one module name with another in the example below. Further, if you just want to use a default chosen construction, you can directly call :py:func:`nacl.pwhash.str` or :py:func:`nacl.pwhash.kdf` to use the preferred construct in modular crypt password hashing or key derivation mode. Password storage and verification --------------------------------- All implementations of the modular crypt hasher `str` function internally generate a random salt, and return a hash encoded in ascii modular crypt format, which can be stored in a shadow-like file .. doctest:: :pyversion: >= 3.4 >>> import nacl.pwhash >>> password = b'my password' >>> for i in range(4): ... print(nacl.pwhash.str(password)) ... b'$argon2id$v=19$m=65536,t=2,p=1$...' b'$argon2id$v=19$m=65536,t=2,p=1$...' b'$argon2id$v=19$m=65536,t=2,p=1$...' b'$argon2id$v=19$m=65536,t=2,p=1$...' >>> >>> # if needed, each hasher is exposed ... # in just the same way: ... for i in range(4): ... print(nacl.pwhash.scrypt.str(password)) ... b'$7$C6..../...' b'$7$C6..../...' b'$7$C6..../...' b'$7$C6..../...' >>> >>> for i in range(4): ... print(nacl.pwhash.argon2i.str(password)) ... b'$argon2i$v=19$m=32768,t=4,p=1$...' b'$argon2i$v=19$m=32768,t=4,p=1$...' b'$argon2i$v=19$m=32768,t=4,p=1$...' b'$argon2i$v=19$m=32768,t=4,p=1$...' >>> >>> # and ... >>> for i in range(4): ... print(nacl.pwhash.argon2id.str(password)) ... b'$argon2id$v=19$m=65536,t=2,p=1$...' b'$argon2id$v=19$m=65536,t=2,p=1$...' b'$argon2id$v=19$m=65536,t=2,p=1$...' b'$argon2id$v=19$m=65536,t=2,p=1$...' >>> To verify a user-proposed password, the :py:func:`~nacl.pwhash.verify` function checks the stored hash prefix, and dispatches verification to the correct checker, which in turn extracts the used salt, memory and operation count parameters from the modular format string and checks the compliance of the proposed password with the stored hash .. doctest:: :pyversion: >= 3.4 >>> import nacl.pwhash >>> hashed = (b'$7$C6..../....qv5tF9KG2WbuMeUOa0TCoqwLHQ8s0TjQdSagne' ... b'9NvU0$3d218uChMvdvN6EwSvKHMASkZIG51XPIsZQDcktKyN7' ... ) >>> correct = b'my password' >>> wrong = b'My password' >>> # while the result will be True on password match, ... # on mismatch an exception will be raised ... res = nacl.pwhash.verify(hashed, correct) >>> print(res) True >>> >>> res2 = nacl.pwhash.verify_scryptsalsa208sha256(hashed, wrong) Traceback (most recent call last): ... nacl.exceptions.InvalidkeyError: Wrong password >>> # the verify function raises an exception ... # also when it is run against a password hash ... # starting with a prefix it doesn't know ... wrong_hash = (b'$?$C6..../....qv5tF9KG2WbuMeUOa0TCoqwLHQ8s0TjQdSagne' ... b'9NvU0$3d218uChMvdvN6EwSvKHMASkZIG51XPIsZQDcktKyN7' ... ) >>> res = nacl.pwhash.verify(wrong_hash, correct) Traceback (most recent call last): ... nacl.exceptions.CryptPrefixError: given password_hash is not in a supported format Key derivation -------------- Alice needs to send a secret message to Bob, using a shared password to protect the content. She generates a random salt, combines it with the password using one of the `kdf` functions and sends the message along with the salt and key derivation parameters. .. testcode:: from nacl import pwhash, secret, utils password = b'password shared between Alice and Bob' message = b"This is a message for Bob's eyes only" kdf = pwhash.argon2i.kdf salt = utils.random(pwhash.argon2i.SALTBYTES) ops = pwhash.argon2i.OPSLIMIT_SENSITIVE mem = pwhash.argon2i.MEMLIMIT_SENSITIVE # or, if there is a need to use scrypt: # kdf = pwhash.scrypt.kdf # salt = utils.random(pwhash.scrypt.SALTBYTES) # ops = pwhash.scrypt.OPSLIMIT_SENSITIVE # mem = pwhash.scrypt.MEMLIMIT_SENSITIVE Alices_key = kdf(secret.SecretBox.KEY_SIZE, password, salt, opslimit=ops, memlimit=mem) Alices_box = secret.SecretBox(Alices_key) nonce = utils.random(secret.SecretBox.NONCE_SIZE) encrypted = Alices_box.encrypt(message, nonce) # now Alice must send to Bob both the encrypted message # and the KDF parameters: salt, opslimit and memlimit; # using the same kdf mechanism, parameters **and password** # Bob is able to derive the correct key to decrypt the message Bobs_key = kdf(secret.SecretBox.KEY_SIZE, password, salt, opslimit=ops, memlimit=mem) Bobs_box = secret.SecretBox(Bobs_key) received = Bobs_box.decrypt(encrypted) print(received.decode('utf-8')) .. testoutput:: This is a message for Bob's eyes only if Eve manages to get the encrypted message, and tries to decrypt it with a incorrect password, even if she does know all of the key derivation parameters, she would derive a different key. Therefore the decryption would fail and an exception would be raised .. doctest:: :pyversion: >= 3.4 >>> # ops, mem and salt are the same used by Alice ... >>> >>> guessed_pw = b'I think Alice shared this password with Bob' >>> >>> Eves_key = pwhash.argon2i.kdf(secret.SecretBox.KEY_SIZE, ... guessed_pw, salt, ... opslimit=ops, memlimit=mem) >>> Eves_box = secret.SecretBox(Eves_key) >>> intercepted = Eves_box.decrypt(encrypted) Traceback (most recent call last): ... nacl.exceptions.CryptoError: Decryption failed. Ciphertext failed ... Contrary to the hashed password storage case where a serialization format is well-defined, in the raw key derivation case the library user must take care to store (and retrieve) both a reference to the kdf used to derive the secret key and all the derivation parameters. These parameters are needed to later generate the same secret key from the password. Module level constants for operation and memory cost tweaking ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ To help in selecting the correct values for the tweaking parameters for the used construction, all the implementation modules provide suggested values for the `opslimit` and `memlimit` parameters with the names: * `OPSLIMIT_INTERACTIVE` * `MEMLIMIT_INTERACTIVE` * `OPSLIMIT_SENSITIVE` * `MEMLIMIT_SENSITIVE` * `OPSLIMIT_MODERATE` * `MEMLIMIT_MODERATE` and the corresponding minimum and maximum allowed values in: * `OPSLIMIT_MIN` * `MEMLIMIT_MIN` * `OPSLIMIT_MAX` * `MEMLIMIT_MAX` Further, for each construction, pwhash modules expose the following constants: * `STRPREFIX` * `PWHASH_SIZE` * `SALTBYTES` * `BYTES_MIN` * `BYTES_MAX` In general, the _INTERACTIVE values are recommended in the case of hashes stored for interactive password checking, and lead to a sub-second password verification time, with a memory consumption in the tens of megabytes range, while the _SENSITIVE values are meant to store hashes for password protecting sensitive data, and lead to hashing times exceeding one second, with memory consumption in the hundred of megabytes range. The _MODERATE values, suggested for ``argon2`` mechanisms are meant to run the construct at a runtime and memory cost intermediate between _INTERACTIVE and _SENSITIVE. .. [SD2012] A nice overview of password hashing history is available in Solar Designer's presentation `Password security: past, present, future `_ .. [PHC] The Argon2 recommendation is prominently shown in the `Password Hashing Competition `_ site, along to the special recognition shortlist and the original call for submissions. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/public.rst0000644000175100017510000002506015125531055015421 0ustar00runnerrunnerPublic Key Encryption ===================== .. currentmodule:: nacl.public Imagine Alice wants something valuable shipped to her. Because it's valuable, she wants to make sure it arrives securely (i.e. hasn't been opened or tampered with) and that it's not a forgery (i.e. it's actually from the sender she's expecting it to be from and nobody's pulling the old switcheroo). One way she can do this is by providing the sender (let's call him Bob) with a high-security box of her choosing. She provides Bob with this box, and something else: a padlock, but a padlock without a key. Alice is keeping that key all to herself. Bob can put items in the box then put the padlock onto it. But once the padlock snaps shut, the box cannot be opened by anyone who doesn't have Alice's private key. Here's the twist though: Bob also puts a padlock onto the box. This padlock uses a key Bob has published to the world, such that if you have one of Bob's keys, you know a box came from him because Bob's keys will open Bob's padlocks (let's imagine a world where padlocks cannot be forged even if you know the key). Bob then sends the box to Alice. In order for Alice to open the box, she needs two keys: her private key that opens her own padlock, and Bob's well-known key. If Bob's key doesn't open the second padlock, then Alice knows that this is not the box she was expecting from Bob, it's a forgery. This bidirectional guarantee around identity is known as mutual authentication. Examples -------- nacl.public.Box ~~~~~~~~~~~~~~~ The :class:`~nacl.public.Box` class uses the given public and private (secret) keys to derive a shared key, which is used with the nonce given to encrypt the given messages and to decrypt the given ciphertexts. The same shared key will be generated from both pairing of keys, so given two key pairs belonging to Alice (pkalice, skalice) and Bob (pkbob, skbob), the key derived from (pkalice, skbob) will equal that from (pkbob, skalice). This is how the system works: .. testcode:: import nacl.utils from nacl.public import PrivateKey, Box # Generate Bob's private key, which must be kept secret skbob = PrivateKey.generate() # Bob's public key can be given to anyone wishing to send # Bob an encrypted message pkbob = skbob.public_key # Alice does the same and then Alice and Bob exchange public keys skalice = PrivateKey.generate() pkalice = skalice.public_key # Bob wishes to send Alice an encrypted message so Bob must make a Box with # his private key and Alice's public key bob_box = Box(skbob, pkalice) # This is our message to send, it must be a bytestring as Box will treat it # as just a binary blob of data. message = b"Kill all humans" PyNaCl can automatically generate a random nonce for us, making the encryption very simple: .. testcode:: # Encrypt our message, it will be exactly 40 bytes longer than the # original message as it stores authentication information and the # nonce alongside it. encrypted = bob_box.encrypt(message) However, if we need to use an explicit nonce, it can be passed along with the message: .. testcode:: # This is a nonce, it *MUST* only be used once, but it is not considered # secret and can be transmitted or stored alongside the ciphertext. A # good source of nonces are just sequences of 24 random bytes. nonce = nacl.utils.random(Box.NONCE_SIZE) encrypted = bob_box.encrypt(message, nonce) Finally, the message is decrypted (regardless of how the nonce was generated): .. testcode:: # Alice creates a second box with her private key to decrypt the message alice_box = Box(skalice, pkbob) # Decrypt our message, an exception will be raised if the encryption was # tampered with or there was otherwise an error. plaintext = alice_box.decrypt(encrypted) print(plaintext.decode('utf-8')) .. testoutput:: Kill all humans nacl.public.SealedBox ~~~~~~~~~~~~~~~~~~~~~ The :class:`~nacl.public.SealedBox` class encrypts messages addressed to a specified key-pair by using ephemeral sender's key pairs, which will be discarded just after encrypting a single plaintext message. This kind of construction allows sending messages, which only the recipient can decrypt without providing any kind of cryptographic proof of sender's authorship. .. warning:: By design, the recipient will have no means to trace the ciphertext to a known author, since the sending key pair itself is not bound to any sender's identity, and the sender herself will not be able to decrypt the ciphertext she just created, since the private part of the key cannot be recovered after use. This is how the system works: .. testcode:: import nacl.utils from nacl.public import PrivateKey, SealedBox # Generate Bob's private key, as we've done in the Box example skbob = PrivateKey.generate() pkbob = skbob.public_key # Alice wishes to send a encrypted message to Bob, # but prefers the message to be untraceable sealed_box = SealedBox(pkbob) # This is Alice's message message = b"Kill all kittens" # Encrypt the message, it will carry the ephemeral key public part # to let Bob decrypt it encrypted = sealed_box.encrypt(message) Now, Bob wants to read the secret message he just received; therefore he must create a SealedBox using his own private key: .. testcode:: unseal_box = SealedBox(skbob) # decrypt the received message plaintext = unseal_box.decrypt(encrypted) print(plaintext.decode('utf-8')) .. testoutput:: Kill all kittens Reference --------- .. class:: PublicKey(public_key, encoder) The public key counterpart to an Curve25519 :class:`~nacl.public.PrivateKey` for encrypting messages. :param bytes public_key: Encoded Curve25519 public key. :param encoder: A class that is able to decode the ``public_key``. .. class:: PrivateKey(private_key, encoder) Private key for decrypting messages using the Curve25519 algorithm. .. warning:: This **must** be protected and remain secret. Anyone who knows the value of your :class:`~nacl.public.PrivateKey` can decrypt any message encrypted by the corresponding :class:`~nacl.public.PublicKey` :param bytes private_key: The private key used to decrypt messages. :param encoder: A class that is able to decode the ``private_key``. .. attribute:: public_key An instance of :class:`~.nacl.public.PublicKey` that corresponds with the private key. .. classmethod:: generate() Generates a random :class:`~nacl.public.PrivateKey` object :return: An instance of :class:`~nacl.public.PrivateKey`. .. class:: Box(private_key, public_key) The Box class boxes and unboxes messages between a pair of keys The ciphertexts generated by :class:`~nacl.public.Box` include a 16 byte authenticator which is checked as part of the decryption. An invalid authenticator will cause the decrypt function to raise an exception. The authenticator is not a signature. Once you've decrypted the message you've demonstrated the ability to create arbitrary valid message, so messages you send are repudiable. For non-repudiable messages, sign them after encryption. :param private_key: An instance of :class:`~nacl.public.PrivateKey` used to encrypt and decrypt messages :param public_key: An instance of :class:`~nacl.public.PublicKey` used to encrypt and decrypt messages .. classmethod:: decode(encoded, encoder) Decodes a serialized :class:`~nacl.public.Box`. :return: An instance of :class:`~nacl.public.Box`. .. method:: encrypt(plaintext, nonce, encoder) Encrypts the plaintext message using the given `nonce` (or generates one randomly if omitted) and returns the ciphertext encoded with the encoder. .. warning:: It is **VITALLY** important that the nonce is a nonce, i.e. it is a number used only once for any given key. If you fail to do this, you compromise the privacy of the messages encrypted. :param bytes plaintext: The plaintext message to encrypt. :param bytes nonce: The nonce to use in the encryption. :param encoder: A class that is able to decode the ciphertext. :return: An instance of :class:`~nacl.utils.EncryptedMessage`. .. method:: decrypt(ciphertext, nonce, encoder) Decrypts the ciphertext using the `nonce` (explicitly, when passed as a parameter or implicitly, when omitted, as part of the ciphertext) and returns the plaintext message. :param bytes ciphertext: The encrypted message to decrypt. :param bytes nonce: The nonce to use in the decryption. :param encoder: A class that is able to decode the plaintext. :return bytes: The decrypted plaintext. .. method:: shared_key() Returns the Curve25519 shared secret, that can then be used as a key in other symmetric ciphers. .. warning:: It is **VITALLY** important that you use a nonce with your symmetric cipher. If you fail to do this, you compromise the privacy of the messages encrypted. Ensure that the key length of your cipher is 32 bytes. :return bytes: The shared secret. .. class:: SealedBox(receiver_key) The SealedBox class can box and unbox messages sent to a receiver key using an ephemeral sending key pair. .. method:: encrypt(plaintext, encoder) Encrypt the message using a Box constructed from an ephemeral key-pair and the receiver key. The public part of the ephemeral key-pair will be enclosed in the returned ciphertext. The private part of the ephemeral key-pair will be scrubbed before returning the ciphertext, therefore, the sender will not be able to decrypt the message. :param bytes plaintext: The plaintext message to encrypt. :param encoder: A class that is able to decode the ciphertext. :return bytes: The public part of the ephemeral key pair, followed by the encrypted ciphertext .. method:: decrypt(ciphertext, encoder) Decrypt the message using a Box constructed from the receiver key and the ephemeral key enclosed in the ciphertext. :param bytes ciphertext: The ciphertext message to decrypt. :param encoder: A class that is able to decode the ciphertext. :return bytes: The decrypted message Algorithm ~~~~~~~~~ * **Public Keys:** `Curve25519 high-speed elliptic curve cryptography `_ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/secret.rst0000644000175100017510000003305015125531055015426 0ustar00runnerrunnerSecret Key Encryption ===================== .. currentmodule:: nacl.secret Secret key encryption (also called symmetric key encryption) is analogous to a safe. You can store something secret through it and anyone who has the key can open it and view the contents. :class:`~nacl.secret.SecretBox` and :class:`~nacl.secret.Aead` functions as just such a safe, and like any good safe any attempts to tamper with the contents are easily detected. Secret key encryption allows you to store or transmit data over insecure channels without leaking the contents of that message, nor anything about it other than the length. Example with SecretBox ---------------------- .. testcode:: import nacl.secret import nacl.utils # This must be kept secret, this is the combination to your safe key = nacl.utils.random(nacl.secret.SecretBox.KEY_SIZE) # This is your safe, you can use it to encrypt or decrypt messages box = nacl.secret.SecretBox(key) # This is our message to send, it must be a bytestring as SecretBox will # treat it as just a binary blob of data. message = b"The president will be exiting through the lower levels" PyNaCl can automatically generate a random nonce for us, making the encryption very simple: .. testcode:: # Encrypt our message, it will be exactly 40 bytes longer than the # original message as it stores authentication information and the # nonce alongside it. encrypted = box.encrypt(message) assert len(encrypted) == len(message) + box.NONCE_SIZE + box.MACBYTES However, if we need to use an explicit nonce, it can be passed along with the message: .. testcode:: # This is a nonce, it *MUST* only be used once, but it is not considered # secret and can be transmitted or stored alongside the ciphertext. A # good source of nonces are just sequences of 24 random bytes. nonce = nacl.utils.random(nacl.secret.SecretBox.NONCE_SIZE) encrypted = box.encrypt(message, nonce) If you need to get the ciphertext and the authentication data without the nonce, you can get the `ciphertext` attribute of the :class:`~nacl.utils.EncryptedMessage` instance returned by :meth:`~nacl.secret.SecretBox.encrypt`: .. testcode:: nonce = nacl.utils.random(nacl.secret.SecretBox.NONCE_SIZE) encrypted = box.encrypt(message, nonce) # since we are transmitting the nonce by some other means, # we just need to get the ciphertext and authentication data ctext = encrypted.ciphertext # ctext is just nacl.secret.SecretBox.MACBYTES longer # than the original message assert len(ctext) == len(message) + box.MACBYTES Finally, the message is decrypted (regardless of how the nonce was generated): .. testcode:: # Decrypt our message, an exception will be raised if the encryption was # tampered with or there was otherwise an error. plaintext = box.decrypt(encrypted) print(plaintext.decode('utf-8')) .. testoutput:: The president will be exiting through the lower levels Example with Aead ----------------- .. testcode:: import nacl.secret import nacl.utils # This must be kept secret, this is the combination to your safe key = nacl.utils.random(nacl.secret.Aead.KEY_SIZE) # This is your safe, you can use it to encrypt or decrypt messages box = nacl.secret.Aead(key) # This is our message to send, it must be a bytestring as Aead will # treat it as just a binary blob of data. message = b"The president will be exiting through the upper levels" PyNaCl can automatically generate a random nonce for us, making the encryption very simple: .. testcode:: # Encrypt our message with (optionally) additional authenticated data, # it will be exactly 40 bytes longer than the original message as it # stores authentication information and the nonce alongside it. aad = b'POTUS' encrypted = box.encrypt(message, aad) #encrypted = box.encrypt(message) would suffice if aad is not needed. assert len(encrypted) == len(message) + box.NONCE_SIZE + box.MACBYTES However, if we need to use an explicit nonce, it can be passed along with the message: .. testcode:: # This is a nonce, it *MUST* only be used once, but it is not considered # secret and can be transmitted or stored alongside the ciphertext. A # good source of nonces are just sequences of 24 random bytes. nonce = nacl.utils.random(nacl.secret.Aead.NONCE_SIZE) encrypted = box.encrypt(message, aad, nonce) If you need to get the ciphertext and the authentication data without the nonce, you can get the `ciphertext` attribute of the :class:`~nacl.utils.EncryptedMessage` instance returned by :meth:`~nacl.secret.Aead.encrypt`: .. testcode:: aad = b'POTUS' nonce = nacl.utils.random(nacl.secret.Aead.NONCE_SIZE) encrypted = box.encrypt(message, aad, nonce) # since we are transmitting the nonce by some other means, # we just need to get the ciphertext and authentication data ctext = encrypted.ciphertext # ctext is just nacl.secret.Aead.MACBYTES longer # than the original message assert len(ctext) == len(message) + box.MACBYTES Finally, the message is decrypted (regardless of how the nonce was generated): .. testcode:: # Decrypt our message, an exception will be raised if the encryption was # tampered with or there was otherwise an error. aad = b'POTUS' plaintext = box.decrypt(encrypted, aad) #plaintext = box.decrypt(encrypted) would suffice if aad was not used. print(plaintext.decode('utf-8')) .. testoutput:: The president will be exiting through the upper levels Requirements ------------ Key ~~~ The 32 bytes key given to :class:`~nacl.secret.SecretBox` or :class:`~nacl.secret.Aead` must be kept secret. It is the combination to your "safe" and anyone with this key will be able to decrypt the data, or encrypt new data. Nonce ~~~~~ The 24-byte nonce (`Number used once `_) given to :meth:`~nacl.secret.SecretBox.encrypt`, :meth:`~nacl.secret.SecretBox.decrypt`, :meth:`~nacl.secret.Aead.encrypt` and :meth:`~nacl.secret.Aead.decrypt` must **NEVER** be reused for a particular key. Reusing a nonce may give an attacker enough information to decrypt or forge other messages. A nonce is not considered secret and may be freely transmitted or stored in plaintext alongside the ciphertext. A nonce does not need to be random or unpredictable, nor does the method of generating them need to be secret. A nonce could simply be a counter incremented with each message encrypted, which can be useful in connection-oriented protocols to reject duplicate messages ("replay attacks"). A bidirectional connection could use the same key for both directions, as long as their nonces never overlap (e.g. one direction always sets the high bit to "1", the other always sets it to "0"). If you use a counter-based nonce along with a key that is persisted from one session to another (e.g. saved to disk), you must store the counter along with the key, to avoid accidental nonce reuse on the next session. For this reason, many protocols derive a new key for each session, reset the counter to zero with each new key, and never store the derived key or the counter. You can safely generate random nonces by calling: :func:`~nacl.utils.random` with ``SecretBox.NONCE_SIZE`` for SecretBox and :func:`~nacl.utils.random` with ``Aead.NONCE_SIZE`` for Aead. Aad ~~~ :class:`~nacl.secret.Aead` supports Authenticated Encryption with Associated Data. :meth:`~nacl.secret.Aead.encrypt` and :meth:`~nacl.secret.Aead.decrypt` accept an optional, arbitrary long “additional data” parameter. These data are not present in the ciphertext, but are mixed in the computation of the authentication tag. A typical use for these data is to authenticate version numbers, timestamps or monotonically increasing counters in order to discard previous messages and prevent replay attacks. A default empty bytes object will be used if not set when calling :meth:`~nacl.secret.Aead.encrypt` or :meth:`~nacl.secret.Aead.decrypt`. Reference --------- .. class:: SecretBox(key, encoder) The SecretBox class encrypts and decrypts messages using the given secret key. The ciphertexts generated by :class:`~nacl.secret.Secretbox` include a 16 byte authenticator which is checked as part of the decryption. An invalid authenticator will cause the decrypt function to raise an exception. The authenticator is not a signature. Once you've decrypted the message you've demonstrated the ability to create arbitrary valid message, so messages you send are repudiable. For non-repudiable messages, sign them after encryption. :param bytes key: The secret key used to encrypt and decrypt messages. :param encoder: A class that is able to decode the ``key``. .. method:: encrypt(plaintext, nonce, encoder) Encrypts the plaintext message using the given `nonce` (or generates one randomly if omitted) and returns the ciphertext encoded with the encoder. .. warning:: It is **VITALLY** important that the nonce is a nonce, i.e. it is a number used only once for any given key. If you fail to do this, you compromise the privacy of the messages encrypted. Give your nonces a different prefix, or have one side use an odd counter and one an even counter. Just make sure they are different. :param bytes plaintext: The plaintext message to encrypt. :param bytes nonce: The nonce to use in the encryption. :param encoder: A class that is able to decode the ciphertext. :return: An instance of :class:`~nacl.utils.EncryptedMessage`. .. method:: decrypt(ciphertext, nonce, encoder) Decrypts the ciphertext using the `nonce` (explicitly, when passed as a parameter or implicitly, when omitted, as part of the ciphertext) and returns the plaintext message. :param bytes ciphertext: The encrypted message to decrypt. :param bytes nonce: The nonce to use in the decryption. :param encoder: A class that is able to decode the plaintext. :return bytes: The decrypted plaintext. .. class:: Aead(key, encoder) The AEAD class encrypts and decrypts messages using the given secret key. Unlike :class:`~nacl.secret.SecretBox`, AEAD supports authenticating non-confidential data received alongside the message, such as a length or type tag. Like :class:`~nacl.secret.Secretbox`, this class provides authenticated encryption. An inauthentic message will cause the decrypt function to raise an exception. Likewise, the authenticator should not be mistaken for a (public-key) signature: recipients (with the ability to decrypt messages) are capable of creating arbitrary valid message; in particular, this means AEAD messages are repudiable. For non-repudiable messages, sign them after encryption. :param key: The secret key used to encrypt and decrypt messages :param encoder: The encoder class used to decode the given key .. method:: encrypt(plaintext, aad, nonce, encoder) Encrypts the plaintext message using the given `nonce` (or generates one randomly if omitted) and returns the ciphertext encoded with the encoder. .. warning:: It is vitally important for :param nonce: to be unique. By default, it is generated randomly; [:class:`Aead`] uses XChacha20 for extended (192b) nonce size, so the risk of reusing random nonces is negligible. It is *strongly recommended* to keep this behaviour, as nonce reuse will compromise the privacy of encrypted messages. Should implicit nonces be inadequate for your application, the second best option is using split counters; e.g. if sending messages encrypted under a shared key between 2 users, each user can use the number of messages it sent so far, prefixed or suffixed with a 1bit user id. Note that the counter must **never** be rolled back (due to overflow, on-disk state being rolled back to an earlier backup, ...) :param plaintext: [:class:`bytes`] The plaintext message to encrypt :param aad: [:class:`bytes`] The aad to be used in the authentication process :param nonce: [:class:`bytes`] The nonce to use in the encryption :param encoder: The encoder to use to encode the ciphertext :return: An instance of :class:`~nacl.utils.EncryptedMessage`. .. method:: decrypt(ciphertext, aad, nonce, encoder) Decrypts the ciphertext using the `nonce` (explicitly, when passed as a parameter or implicitly, when omitted, as part of the ciphertext) and returns the plaintext message. :param ciphertext: [:class:`bytes`] The encrypted message to decrypt :param aad: [:class:`bytes`] The aad to be used in the authentication process :param nonce: [:class:`bytes`] The nonce used when encrypting the ciphertext :param encoder: The encoder used to decode the ciphertext. :return bytes: The decrypted plaintext. Algorithm details ----------------- :Encryption for SecretBox: `XSalsa20 stream cipher `_ :Encryption for Aead: `XChaCha20 stream cipher `_ :Aead Construction: `IETF ChaCha20 Poly1305 `_ :Authentication: `Poly1305 MAC `_ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/signing.rst0000644000175100017510000003034115125531055015577 0ustar00runnerrunnerDigital Signatures ================== .. currentmodule:: nacl.signing You can use a digital signature for many of the same reasons that you might sign a paper document. A valid digital signature gives a recipient reason to believe that the message was created by a known sender such that they cannot deny sending it (authentication and non-repudiation) and that the message was not altered in transit (integrity). Digital signatures allow you to publish a public key, and then you can use your private signing key to sign messages. Others who have your public key can then use it to validate that your messages are actually authentic. Example ------- Signing and verifying a message without encoding the key or message Signer's perspective (:class:`~nacl.signing.SigningKey`) .. testcode:: from nacl.signing import SigningKey # Generate a new random signing key signing_key = SigningKey.generate() # Sign a message with the signing key signed = signing_key.sign(b"Attack at Dawn") # Obtain the verify key for a given signing key verify_key = signing_key.verify_key # Serialize the verify key to send it to a third party verify_key_bytes = verify_key.encode() Verifier's perspective (:class:`~nacl.signing.VerifyKey`) .. testcode:: from nacl.signing import VerifyKey # Create a VerifyKey object from a hex serialized public key verify_key = VerifyKey(verify_key_bytes) # Check the validity of a message's signature # The message and the signature can either be passed together, or # separately if the signature is decoded to raw bytes. # These are equivalent: verify_key.verify(signed) verify_key.verify(signed.message, signed.signature) # Alter the signed message text forged = signed[:-1] + bytes([int(signed[-1]) ^ 1]) # Will raise nacl.exceptions.BadSignatureError, since the signature check # is failing verify_key.verify(forged) .. testoutput:: Traceback (most recent call last): ... nacl.exceptions.BadSignatureError: Signature was forged or corrupt Example ------- Signing and verifying a message encoded with HexEncoder Signer's perspective (:class:`~nacl.signing.SigningKey`) .. testcode:: from nacl.encoding import HexEncoder from nacl.signing import SigningKey # Generate a new random signing key signing_key = SigningKey.generate() # Sign a message with the signing key signed_hex = signing_key.sign(b"Attack at Dawn", encoder=HexEncoder) # Obtain the verify key for a given signing key verify_key = signing_key.verify_key # Serialize the verify key to send it to a third party verify_key_hex = verify_key.encode(encoder=HexEncoder) Verifier's perspective (:class:`~nacl.signing.VerifyKey`) .. testcode:: from nacl.encoding import HexEncoder from nacl.signing import VerifyKey # Create a VerifyKey object from a hex serialized public key verify_key = VerifyKey(verify_key_hex, encoder=HexEncoder) # Check the validity of a message's signature # The message and the signature can either be passed together, or # separately if the signature is decoded to raw bytes. # These are equivalent: verify_key.verify(signed_hex, encoder=HexEncoder) signature_bytes = HexEncoder.decode(signed_hex.signature) verify_key.verify(signed_hex.message, signature_bytes, encoder=HexEncoder) # Alter the signed message text forged = signed_hex[:-1] + bytes([int(signed_hex[-1]) ^ 1]) # Will raise nacl.exceptions.BadSignatureError, since the signature check # is failing verify_key.verify(forged) .. testoutput:: Traceback (most recent call last): ... nacl.exceptions.BadSignatureError: Signature was forged or corrupt Example ------- Signing and verifying a message encoded with Base64Encoder Signer's perspective (:class:`~nacl.signing.SigningKey`) .. testcode:: from nacl.encoding import Base64Encoder from nacl.signing import SigningKey # Generate a new random signing key signing_key = SigningKey.generate() # Sign a message with the signing key signed_b64 = signing_key.sign(b"Attack at Dawn", encoder=Base64Encoder) # Obtain the verify key for a given signing key verify_key = signing_key.verify_key # Serialize the verify key to send it to a third party verify_key_b64 = verify_key.encode(encoder=Base64Encoder) Verifier's perspective (:class:`~nacl.signing.VerifyKey`) .. testcode:: from nacl.encoding import Base64Encoder from nacl.signing import VerifyKey # Create a VerifyKey object from a base64 serialized public key verify_key = VerifyKey(verify_key_b64, encoder=Base64Encoder) # Check the validity of a message's signature # The message and the signature can either be passed together, or # separately if the signature is decoded to raw bytes. # These are equivalent: verify_key.verify(signed_b64, encoder=Base64Encoder) signature_bytes = Base64Encoder.decode(signed_b64.signature) verify_key.verify(signed_b64.message, signature_bytes, encoder=Base64Encoder) # Alter the signed message text forged = signed_b64[:-1] + bytes([int(signed_b64[-1]) ^ 1]) # Will raise nacl.exceptions.BadSignatureError, since the signature check # is failing verify_key.verify(forged) .. testoutput:: Traceback (most recent call last): ... nacl.exceptions.BadSignatureError: Signature was forged or corrupt Reference --------- .. class:: SigningKey(seed, encoder) Private key for producing digital signatures using the Ed25519 algorithm. Signing keys are produced from a 32-byte (256-bit) random seed value. This value can be passed into the :class:`~nacl.signing.SigningKey` as a :func:`bytes` whose length is 32. .. warning:: This **must** be protected and remain secret. Anyone who knows the value of your :class:`~nacl.signing.SigningKey` or its seed can masquerade as you. :param bytes seed: Random 32-byte value (i.e. private key). :param encoder: A class that is able to decode the ``seed``. .. attribute:: verify_key An instance of :class:`~.nacl.signing.VerifyKey` (i.e. public key) that corresponds with the signing key. .. classmethod:: generate() Generates a random :class:`~nacl.signing.SigningKey` object :return: An instance of :class:`~nacl.signing.SigningKey`. .. method:: sign(message, encoder) Sign a message using this key. :param bytes message: The data to be signed. :param encoder: A class that is able to decode the signed message. :return: An instance of :class:`~nacl.signing.SignedMessage`. .. class:: VerifyKey(key, encoder) The public key counterpart to an Ed25519 :class:`~nacl.signing.SigningKey` for producing digital signatures. :param bytes key: A serialized Ed25519 public key. :param encoder: A class that is able to decode the ``key``. .. method:: verify(smessage, signature, encoder) Verifies the signature of a signed message. :param bytes smessage: The signed message to verify. This is either the original message or the concatenated signature and message. :param bytes signature: The signature of the message to verify against. If the value of ``smessage`` is the concatenated signature and message, this parameter can be ``None``. :param encoder: A class that is able to decode the secret message and signature. :return bytes: The message if successfully verified. :raises nacl.exceptions.BadSignatureError: This is raised if the signature is invalid. .. class:: SignedMessage() A bytes subclass that holds a messaged that has been signed by a :class:`SigningKey`. .. attribute:: signature The signature contained within the :class:`~nacl.signing.SignedMessage`. .. attribute:: message The message contained within the :class:`~nacl.signing.SignedMessage`. Ed25519 ------- Ed25519 is a public-key signature system with several attractive features: * **Fast single-signature verification:** Ed25519 takes only 273364 cycles to verify a signature on Intel's widely deployed Nehalem/Westmere lines of CPUs. (This performance measurement is for short messages; for very long messages, verification time is dominated by hashing time.) Nehalem and Westmere include all Core i7, i5, and i3 CPUs released between 2008 and 2010, and most Xeon CPUs released in the same period. * **Even faster batch verification:** Ed25519 performs a batch of 64 separate signature verifications (verifying 64 signatures of 64 messages under 64 public keys) in only 8.55 million cycles, i.e., under 134000 cycles per signature. Ed25519 fits easily into L1 cache, so contention between cores is negligible: a quad-core 2.4GHz Westmere verifies 71000 signatures per second, while keeping the maximum verification latency below 4 milliseconds. * **Very fast signing:** Ed25519 takes only 87548 cycles to sign a message. A quad-core 2.4GHz Westmere signs 109000 messages per second. * **Fast key generation:** Key generation is almost as fast as signing. There is a slight penalty for key generation to obtain a secure random number from the operating system; /dev/urandom under Linux costs about 6000 cycles. * **High security level:** This system has a 2^128 security target; breaking it has similar difficulty to breaking NIST P-256, RSA with ~3000-bit keys, strong 128-bit block ciphers, etc. The best attacks known actually cost more than 2^140 bit operations on average, and degrade quadratically in success probability as the number of bit operations drops. * **Collision resilience:** Hash-function collisions do not break this system. This adds a layer of defense against the possibility of weakness in the selected hash function. * **No secret array indices:** Ed25519 never reads or writes data from secret addresses in RAM; the pattern of addresses is completely predictable. Ed25519 is therefore immune to cache-timing attacks, hyperthreading attacks, and other side-channel attacks that rely on leakage of addresses through the CPU cache. * **No secret branch conditions:** Ed25519 never performs conditional branches based on secret data; the pattern of jumps is completely predictable. Ed25519 is therefore immune to side-channel attacks that rely on leakage of information through the branch-prediction unit. * **Small signatures:** Ed25519 signatures are only 512-bits (64 bytes), one of the smallest signature sizes available. * **Small keys:** Ed25519 keys are only 256-bits (32 bytes), making them small enough to easily copy and paste. Ed25519 also allows the public key to be derived from the private key, meaning that it doesn't need to be included in a serialized private key in cases you want both. * **Deterministic:** Unlike (EC)DSA, Ed25519 does not rely on an entropy source when signing messages (which has lead to `catastrophic private key `_ compromises), but instead computes signature nonces from a combination of a hash of the signing key's "seed" and the message to be signed. This avoids using an entropy source for nonces, which can be a potential attack vector if the entropy source is not generating good random numbers. Even a single reused nonce can lead to a complete disclosure of the private key in these schemes, which Ed25519 avoids entirely by being deterministic instead of tied to an entropy source. The numbers 87548 and 273364 shown above are official `eBATS `_ reports for a Westmere CPU (Intel Xeon E5620, hydra2). Ed25519 signatures are elliptic-curve signatures, carefully engineered at several levels of design and implementation to achieve very high speeds without compromising security. Algorithm ~~~~~~~~~ * **Signatures:** `Ed25519 digital signature system `_ .. image:: _static/ed25519.png :k: Ed25519 private key (passed into :class:`~nacl.signing.SigningKey`) :A: Ed25519 public key derived from k :M: message to be signed :R: a deterministic nonce value calculated from a combination of private key data RH and the message M :S: Ed25519 signature ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/utils.rst0000644000175100017510000000227415125531055015305 0ustar00runnerrunnerUtilities ========= .. currentmodule:: nacl.utils .. class:: EncryptedMessage A ``bytes`` subclass that holds a message that has been encrypted by a :class:`~nacl.secret.SecretBox` or :class:`~nacl.public.Box`. The full content of the ``bytes`` object is the combined ``nonce`` and ``ciphertext``. .. attribute:: nonce The nonce used during the encryption of the :class:`EncryptedMessage`. .. attribute:: ciphertext The ciphertext contained within the :class:`EncryptedMessage`. .. function:: random(size=32) Returns a random bytestring with the given ``size``. :param bytes size: The size of the random bytestring. :return bytes: The random bytestring. .. function:: randombytes_deterministic(size, seed, encoder=encoding.RawEncoder) Returns ``size`` number of deterministically generated pseudorandom bytes from a 32 byte seed. :param bytes size: The size of the random bytestring. :param bytes seed: The seed for the bytestring. This should be 32 bytes or a TypeError will be thrown. :param encoder: The encoder class used to encode the produced bytes. :return bytes: The random bytestring. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.6120865 pynacl-1.6.2/docs/vectors/0000755000175100017510000000000015125531066015075 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/vectors/argon2_vectors.rst0000644000175100017510000000664715125531055020577 0ustar00runnerrunnerArgon2 constructs reference vectors ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Since libsodium implements a different API for argon2 constructs than the one exposed by the reference implementation available at `The password hash Argon2... `, the ``kats`` data provided along to the reference implementation sources cannot be directly used as test vectors in PyNaCl tests. Therefore, we are using a python driver for the command line ``argon2``, which can be built following the instruction in the reference implementation sources. Vector generation """"""""""""""""" The ``argondriver.py`` requires setting, via the command line option ``-x``, the path to the argon2 executable; and as a default generates hex-encoded raw hash data on standard output. Setting the ``-e`` option on the command line allows generating modular crypt formatted hashes. The other command line options influence the minimum and maximum sizes of generated parameters as shown in the driver's command line help, which is printed by inserting the ``-h`` option in the command line. To generate vector data files in ``tests/data``, the argondriver.py have been called to generate password hashes with parameters compatible with ``libsodium``'s implementation; in particular, the minimum operations count must be 3 for ``argon2i`` and 1 for ``argon2id``, and the salt length must be 16 for raw hashes, and can vary for modular crypt formatted hashes. The full command lines used in generating the vectors are: for raw argon2i .. code-block:: bash python3 docs/vectors/python/argondriver.py \ -x ~/phc-winner-argon2/argon2 \ -c argon2i \ -s 16 -S 16 -p 8 -P 16 -m 14 -M 18 \ -l 18 -L 32 -t 3 -T 5 -n 10 \ -w tests/data/raw_argon2id_hashes.json for raw argon2id .. code-block:: bash python3 docs/vectors/python/argondriver.py \ -x ~/phc-winner-argon2/argon2 \ -c argon2id \ -s 16 -S 16 -p 8 -P 16 -m 14 -M 18 \ -l 18 -L 32 -t 1 -T 5 -n 10 \ -w tests/data/raw_argon2id_hashes.json for modular crypt argon2i .. code-block:: bash python3 docs/vectors/python/argondriver.py \ -x ~/phc-winner-argon2/argon2 \ -c argon2i -e \ -s 8 -S 16 -p 8 -P 16 -m 14 -M 18 \ -l 18 -L 32 -t 3 -T 5 -n 10 \ -w tests/data/modular_crypt_argon2id_hashes.json for modular crypt argon2id .. code-block:: bash python3 docs/vectors/python/argondriver.py \ -x ~/phc-winner-argon2/argon2 \ -c argon2id -e \ -s 8 -S 16 -p 8 -P 16 -m 14 -M 18 \ -l 18 -L 32 -t 1 -T 5 -n 10 \ -w tests/data/modular_crypt_argon2id_hashes.json Code for the vector generator driver """""""""""""""""""""""""""""""""""" The code for ``argondriver.py`` is available inside the ``docs/vectors/python`` directory of PyNaCl distribution and can also be directly downloaded from :download:`argondriver.py <./python/argondriver.py>`. .. put the and... sentence under a ..only:: builder_html when readthedocs begins to correctly support the directive .. literalinclude:: python/argondriver.py :language: python :caption: argondriver.py ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/vectors/blake2_vectors.rst0000644000175100017510000000510715125531055020535 0ustar00runnerrunnerBlake2b reference vectors ^^^^^^^^^^^^^^^^^^^^^^^^^ While the blake2b construction is a keyed hash and variable output length algorithm which can optionally be initialized with limited size salt and personalization parameters, the `known answers`_ json file in the reference `blake2`_ sources just provides vectors for default length hash with empty salt and personalization. To fill this test gap, we used both the pyblake and the libsodium implemented generators provided by `crypto test vectors`_ for the `blake2b` mechanism to generate twenty vectors in each of `test/data/crypto-test-vectors-blake2-nosalt-nopersonalization.txt` and `test/data/crypto-test-vectors-blake2-salt-personalization.txt` Vector generation """"""""""""""""" After cloning the github project with .. code-block:: bash $ git clone https://github.com/jedisct1/crypto-test-vectors.git the needed source files will be available in the `nosalt-nopersonalization` and `salt-personalization` subdirectories of `crypto-test-vectors/crypto/hash/blake2/blake2b/`. To run the python generators, after ensuring the needed `pyblake2`_ module is available in the python environment, it will be enough to run the following commands at the shell prompt: .. code-block:: bash $ BLAKE="${PWD}/crypto-test-vectors/crypto/hash/blake2/blake2b" $ NOPERS="${BLAKE}/nosalt-nopersonalization/generators" $ PERSON="${BLAKE}/salt-personalization/generators" $ python "${NOPERS}/pyblake2/generator.py" 10 > py_nopers_vectors $ python "${PERSON}/pyblake2/generator.py" 10 > py_pers_vectors On linux systems, after installing the required `libsodium` development package, the C-language generators, can get built by running: .. code-block:: bash $ BLAKE="${PWD}/crypto-test-vectors/crypto/hash/blake2/blake2b" $ NOPERS="${BLAKE}/nosalt-nopersonalization/generators" $ PERSON="${BLAKE}/salt-personalization/generators" $ for i in "${NOPERS}/libsodium" "${PERSON}/libsodium"; do (cd "${i}" && make); done and then run by executing: .. code-block:: bash $ BLAKE="${PWD}/crypto-test-vectors/crypto/hash/blake2/blake2b" $ NOPERS="${BLAKE}/nosalt-nopersonalization/generators" $ PERSON="${BLAKE}/salt-personalization/generators" $ "${NOPERS}/libsodium/generator" 10 > py_nopers_vectors_c $ "${PERSON}/libsodium/generator" 10 > py_pers_vectors_c .. _blake2: https://github.com/BLAKE2/BLAKE2 .. _known answers: https://github.com/BLAKE2/BLAKE2/blob/master/testvectors/blake2-kat.json .. _crypto test vectors: https://github.com/jedisct1/crypto-test-vectors .. _pyblake2: https://pythonhosted.org/pyblake2/ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/vectors/bundled_library_build.rst0000644000175100017510000000250315125531055022145 0ustar00runnerrunner.. _building-a-local-library: Building the bundled library ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you you want to avoid a system-wide installation of libsodium's development files just for compiling and running the tests, you can instead install the library and header files inside PyNaCl's sources. Linux systems """"""""""""" On Linux (and presumably other UNIX-like systems), after entering the PyNaCl source directory you must execute the following commands: .. code-block:: bash $ mkdir -p build/libsodium $ cd build/libsodium $ ../../src/libsodium/configure --prefix=$PWD --disable-shared $ make $ make install $ cd ../.. If all went well, .. code-block:: bash $ ls build/libsodium/{lib,include} should generate something like the following output: .. code-block:: bash build/libsodium/include: sodium sodium.h build/libsodium/lib: libsodium.a libsodium.la pkgconfig If you now define and export the .. code-block:: bash $ SODIUMINCL="-I${PWD}/build/libsodium/include" $ export SODIUMINCL $ SODIUMLIB="-L${PWD}/build/libsodium/lib" $ export SODIUMLIB environment variables, you can instruct the compiler to use the just-installed library by simply dereferencing the path flags on the c compier command line .. code-block:: bash $ cc ${SODIUMINCL} ${SODIUMLIB} ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.6120865 pynacl-1.6.2/docs/vectors/c-source/0000755000175100017510000000000015125531066016615 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/vectors/c-source/sealbox_test_vectors.c0000644000175100017510000001332115125531055023220 0ustar00runnerrunner/* * Copyright 2017 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Test vector generator/checker for libsodium's box_seal APIs * to build in a unix-like environment, use a command line like * $ cc sealbox_test_vectors.c -I${IPATH} -L${LPATH} -lsodium -o sealbox_test_vectors * with IPATH and LPATH defined to respectively point to libsodium's include path * and to the directory containing the link library libsodium.a or libsodium.o * */ #include #include #include int checkone (char *hxsecret, char *hxpub, size_t ptlen, char *hxplaintext, size_t crlen, char *hxencrypted) { int pklen = crypto_box_PUBLICKEYBYTES; int sklen = crypto_box_SECRETKEYBYTES; char *skr = sodium_malloc (sklen); char *pub = sodium_malloc (pklen); char *txt = sodium_malloc (ptlen); char *crpt = sodium_malloc (crlen); char *outp = sodium_malloc (ptlen); int rs = sodium_hex2bin (skr, sklen, hxsecret, 2 * sklen, NULL, NULL, NULL); rs |= sodium_hex2bin (pub, pklen, hxpub, 2 * pklen, NULL, NULL, NULL); rs |= sodium_hex2bin (txt, ptlen, hxplaintext, strlen (hxplaintext), NULL, NULL, NULL); rs |= sodium_hex2bin (crpt, crlen, hxencrypted, strlen (hxencrypted), NULL, NULL, NULL); if (rs == 0) rs = crypto_box_seal_open (outp, crpt, crlen, pub, skr); if (rs == 0) rs = sodium_memcmp (outp, txt, ptlen); sodium_free (crpt); sodium_free (txt); sodium_free (skr); sodium_free (pub); return rs; } void gentestline (int minmsglen, int maxmsglen) { int pklen = crypto_box_PUBLICKEYBYTES; int sklen = crypto_box_SECRETKEYBYTES; size_t txtlen = minmsglen + randombytes_uniform (maxmsglen - minmsglen + 1); size_t encrlen = txtlen + crypto_box_SEALBYTES; char *skr = sodium_malloc (sklen); char *pub = sodium_malloc (pklen); char *txt = sodium_malloc (txtlen); char *crpt = sodium_malloc (encrlen); crypto_box_keypair (pub, skr); randombytes_buf (txt, txtlen); crypto_box_seal (crpt, txt, txtlen, pub); char *hskr = sodium_malloc (sklen * 2 + 1); char *hpub = sodium_malloc (pklen * 2 + 1); char *htxt = sodium_malloc (txtlen * 2 + 1); char *hkrp = sodium_malloc (encrlen * 2 + 1); sodium_bin2hex (hskr, sklen * 2 + 1, skr, sklen); sodium_bin2hex (hpub, pklen * 2 + 1, pub, pklen); sodium_bin2hex (htxt, txtlen * 2 + 1, txt, txtlen); sodium_bin2hex (hkrp, encrlen * 2 + 1, crpt, encrlen); printf ("%s\t%s\t%zu:%s\t%zu:%s\n", hskr, hpub, txtlen, htxt, encrlen, hkrp); } int main (int argc, char **argv) { /* * If called without any argument, the resulting executable will * read and hex decode the secret and public part of the receiver key, * the original plaintext and the ciphertext, and then * check if the message resulting from decrypting ciphertext with * the secret key is equal to the given plaintext * * If called with a sequence of integer arguments, sealbox_test_vectors * will generate the requested number of reference lines, encrypting * random messages. * */ if (sodium_init () == -1) { exit (1); } if (argc == 1) { size_t lsz = 0; char *line = NULL; ssize_t lln = 0; int res; char hxsecret[2 * crypto_box_SECRETKEYBYTES + 1]; char hxpub[2 * crypto_box_PUBLICKEYBYTES + 1]; char hxplaintext[2048 + 1]; char hxencrypted[2048 + 2 * crypto_box_SEALBYTES + 1]; char cmpplaintext[5 + 2048 + 1]; char cmpencrypted[5 + 2048 + 2 * crypto_box_SEALBYTES + 1]; size_t ptlen = 0; size_t crlen = 0; while (lln = getline (&line, &lsz, stdin) > 0) { if (lln > 0) { if (strncmp (line, "#", 1) == 0 || strncmp (line, "\n", 1) == 0 || strncmp (line, "\r", 1) == 0) continue; sscanf (line, "%s%s%s%s", hxsecret, hxpub, cmpplaintext, cmpencrypted); sscanf (cmpplaintext, "%zu:%s", &ptlen, hxplaintext); sscanf (cmpencrypted, "%zu:%s", &crlen, hxencrypted); if (ptlen == 0) memset(hxplaintext, 0, sizeof(hxplaintext)); if (crlen == 0) memset(hxencrypted, 0, sizeof(hxencrypted)); res = checkone (hxsecret, hxpub, ptlen, hxplaintext, crlen, hxencrypted); char *rsstr = (res == 0) ? "OK" : "FAIL"; printf ("%s\t%s\t%zu:%s\t%zu:%s\t%s\n", hxsecret, hxpub, ptlen, hxplaintext, crlen, hxencrypted, rsstr); } free (line); line = NULL; } } else { int nlines = atoi (argv[1]); int minmsgl = 128; int maxmsgl = 128; if (argc == 3) { minmsgl = atoi (argv[2]); maxmsgl = atoi (argv[2]) * 2; } else if (argc == 4) { minmsgl = atoi (argv[2]); maxmsgl = atoi (argv[3]); } for (int i = 0; i < nlines; i++) { gentestline (minmsgl, maxmsgl); } } } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/vectors/c-source/secretstream_test_vector.c0000644000175100017510000001062415125531055024104 0ustar00runnerrunner/* * Copyright 2018 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Test vector generator/checker for libsodium's crypto_secretstream APIs * to build in a unix-like environment, use a command line like * $ cc secretstream_test_vector.c \ * -I${IPATH} -L${LPATH} -lsodium \ * -o secretstream_test_vector * with IPATH and LPATH defined to respectively point to libsodium's include path * and to the directory containing the link library libsodium.a or libsodium.o * */ #include #include #include #include #define MAX_AD_SIZE 32 #define MAX_CHUNK_SIZE 512 #define CHK(cmd) \ do { if ((rc = (cmd)) != 0) { \ fprintf(stderr, "api call failed, code=%d", rc); \ exit(1); \ }} while(0) int usage(int argc, char **argv) { fprintf(stderr, "Usage: %s [-c num_chunks] [-r]\n", argv[0]); return 1; } int main (int argc, char **argv) { int c, rc; int num_chunks = 1; int rekey = 0; crypto_secretstream_xchacha20poly1305_state state; unsigned char header[crypto_secretstream_xchacha20poly1305_HEADERBYTES]; unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]; unsigned char m[MAX_CHUNK_SIZE]; unsigned char ad[MAX_AD_SIZE]; unsigned char ct[MAX_CHUNK_SIZE + crypto_secretstream_xchacha20poly1305_ABYTES]; char key_hex[sizeof(key) * 2 + 1]; char header_hex[sizeof(header) * 2 + 1]; char m_hex[sizeof(m) * 2 + 1]; char ad_hex[sizeof(ad) * 2 + 1]; char ct_hex[sizeof(ct) * 2 + 1]; unsigned long long m_len, ad_len, ct_len; unsigned char tag; while ((c = getopt(argc, argv, "hc:r")) != -1) { switch (c) { case 'c': num_chunks = atoi(optarg); break; case 'r': rekey = 1; break; case 'h': return usage(argc, argv); default: return 1; } } if (optind < argc) return usage(argc, argv); if (sodium_init() == -1) { exit(1); } /* output format: * { * "key": "hex", * "header": "hex", * "chunks": [ * { * "tag": 0, * "ad": "hex", * "message": "hex", * "ciphertext": "hex" * }, * ... * ] * } */ crypto_secretstream_xchacha20poly1305_keygen(key); CHK(crypto_secretstream_xchacha20poly1305_init_push(&state, header, key)); sodium_bin2hex(key_hex, sizeof key_hex, key, sizeof key); sodium_bin2hex(header_hex, sizeof header_hex, header, sizeof header); printf("{\n \"key\": \"%s\",\n \"header\": \"%s\",\n \"chunks\": [\n", key_hex, header_hex); for (c = 1 ; c <= num_chunks ; ++c) { tag = c == num_chunks ? crypto_secretstream_xchacha20poly1305_TAG_FINAL : rekey ? crypto_secretstream_xchacha20poly1305_TAG_REKEY : crypto_secretstream_xchacha20poly1305_TAG_MESSAGE; ad_len = randombytes_uniform(MAX_AD_SIZE); m_len = randombytes_uniform(MAX_CHUNK_SIZE - 1) + 1; randombytes_buf(m, m_len); randombytes_buf(ad, ad_len); CHK(crypto_secretstream_xchacha20poly1305_push( &state, ct, &ct_len, m, m_len, ad, ad_len, tag)); sodium_bin2hex(m_hex, m_len * 2 + 1, m, m_len); if (ad_len > 0) { sodium_bin2hex(ad_hex, ad_len * 2 + 1, ad, ad_len); } sodium_bin2hex(ct_hex, ct_len * 2 + 1, ct, ct_len); printf(" {\n" " \"tag\": %d,\n \"ad\": %s%s%s,\n" " \"message\": \"%s\",\n \"ciphertext\": \"%s\"\n" " }%s\n", tag, ad_len > 0 ? "\"" : "", ad_len > 0 ? ad_hex : "null", ad_len > 0 ? "\"" : "", m_hex, ct_hex, c < num_chunks ? "," : ""); } printf(" ]\n}\n"); return 0; } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/vectors/index.rst0000644000175100017510000000456415125531055016745 0ustar00runnerrunnerReference vectors ================= In addition to the policy of keeping any code path in PyNaCl covered by unit tests, the output from cryptographic primitives and constructions must be verified as being conformant to the reference implementations or standards. Imported reference vectors -------------------------- Wherever possible it is the PyNaCl project's policy to use existing reference vectors for primitives or constructions. These vectors should ideally be in their original format, but it is acceptable to make minimal changes to ease parsing at our discretion. Box construction ^^^^^^^^^^^^^^^^ The reference vector for testing the :py:class:`nacl.public.Box` implementation come from libsodium's ``test/default/box.c`` and ``test/default/box2.c`` and the corresponding expected outputs in ``test/default/box.exp`` and ``test/default/box2.exp`` SecretBox construction ^^^^^^^^^^^^^^^^^^^^^^ The reference vector for testing the :py:class:`nacl.secret.SecretBox` implementation come from libsodium's ``test/default/secretbox.c`` and the corresponding expected outputs in ``test/default/secretbox.exp`` chacha20poly1305 ^^^^^^^^^^^^^^^^ The reference vectors for both the legacy draft-agl-tls-chacha20poly1305 and the IETF ratified rfc7539 chacha20poly1305 constructions are taken from libressl version 2.5.5 tests/aeadtests.txt, excluding the shortened authentication tag vectors, since libsodium only supports full sized tags. xchacha20poly1305 ^^^^^^^^^^^^^^^^^ The reference vector for the xchacha20poly1305 construction is taken from the first test in libsodium's test/default/aead_xchacha20poly1305.c, which defines the parameters, and the corresponding expected output from aead_xchacha20poly1305.exp. siphash24 and siphashx24 ^^^^^^^^^^^^^^^^^^^^^^^^ The reference vectors for both the original and the 128 bit variants of the siphash-2-4 construction are taken from the reference code sources. In particular, the original expected results come from siphash's vectors.h, while the key and the input messages have been generated following the respective definitions in siphash's test.c. Custom generated reference vectors ---------------------------------- In cases where there are no standardized test vectors, or the available ones are not applicable to libsodium's implementation, test vectors are custom generated. .. toctree:: :glob: *_vectors bundled_library_build ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.6120865 pynacl-1.6.2/docs/vectors/python/0000755000175100017510000000000015125531066016416 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/vectors/python/argondriver.py0000644000175100017510000001103615125531055021311 0ustar00runnerrunner#!/usr/bin/python # import argparse import json import random import string import subprocess import sys class argonRunner: GOODCHARS = string.ascii_letters + string.digits def __init__(self, args): self.exe = args.exe self.mnsaltlen = args.mnsaltlen self.mnpwlen = args.mnpwlen self.mndgstlen = args.mndgstlen self.mnmem = args.mnmem self.mniters = args.mniters self.mxsaltlen = args.mxsaltlen self.mxpwlen = args.mxpwlen self.mxdgstlen = args.mxdgstlen self.mxmem = args.mxmem self.mxiters = args.mxiters self.encoded = args.encoded self.rng = random.SystemRandom() self.version = args.version self.construct = args.construct self.maxcount = args.n self.count = 0 def _runOnce(self, passwd, salt, dgst_len, maxmem, iters): argv = [ self.exe, salt.encode("ascii"), "-t", "{:2d}".format(iters), "-m", "{:2d}".format(maxmem), "-l", "{:3d}".format(dgst_len), "-v", self.version, ] if self.encoded: argv.append("-e") mode = "crypt" else: argv.append("-r") mode = "raw" if self.construct == "argon2i": argv.append("-i") elif self.construct == "argon2d": argv.append("-d") elif self.construct == "argon2id": argv.append("-id") p = subprocess.Popen( argv, stdin=subprocess.PIPE, stdout=subprocess.PIPE ) out, err = p.communicate(passwd.encode("ascii")) return dict( passwd=passwd, salt=salt, dgst_len=dgst_len, maxmem=2**maxmem, iters=iters, mode=mode, pwhash=out.decode("ascii").rstrip(), construct=self.construct, ) def _genSalt(self): sltln = self.rng.randint(self.mnsaltlen, self.mxsaltlen) chrs = [self.rng.choice(self.GOODCHARS) for x in range(sltln)] return "".join(chrs) def _genPw(self): pwln = self.rng.randint(self.mnpwlen, self.mxpwlen) chrs = [self.rng.choice(self.GOODCHARS) for x in range(pwln)] return "".join(chrs) def __next__(self): if self.count >= self.maxcount: raise StopIteration psw = self._genPw() slt = self._genSalt() mem = self.rng.randint(self.mnmem, self.mxmem) iters = self.rng.randint(self.mniters, self.mxiters) dgstln = self.rng.randint(self.mndgstlen, self.mxdgstlen) rs = self._runOnce(psw, slt, dgstln, mem, iters) self.count += 1 return rs def __iter__(self): return self next = __next__ if __name__ == "__main__": p = argparse.ArgumentParser() p.add_argument("-x", "--executable", dest="exe", required=True) p.add_argument( "-c", "--construction", dest="construct", type=str, default="argon2i" ) p.add_argument("-v", "--version", dest="version", type=str, default="13") p.add_argument( "-e", "--encoded", dest="encoded", default=False, action="store_true", ) p.add_argument( "-s", "--min-salt-len", dest="mnsaltlen", type=int, default=8 ) p.add_argument( "-S", "--max-salt-len", dest="mxsaltlen", type=int, default=8 ) p.add_argument( "-p", "--min-password-len", dest="mnpwlen", type=int, default=16 ) p.add_argument( "-P", "--max-password-len", dest="mxpwlen", type=int, default=16 ) p.add_argument( "-l", "--min-digest-len", dest="mndgstlen", type=int, default=64 ) p.add_argument( "-L", "--max-digest-len", dest="mxdgstlen", type=int, default=64 ) p.add_argument( "-m", "--min-memory-exponent", dest="mnmem", type=int, default=16 ) p.add_argument( "-M", "--max-memory-exponent", dest="mxmem", type=int, default=16 ) p.add_argument( "-t", "--min-time-opscount", dest="mniters", type=int, default=3 ) p.add_argument( "-T", "--max-time-opscount", dest="mxiters", type=int, default=3 ) p.add_argument("-n", "--count", dest="n", type=int, default=10) p.add_argument( "-w", "--output", dest="outfile", default=sys.stdout, type=argparse.FileType("w"), ) args = p.parse_args() res = [x for x in argonRunner(args)] json.dump(res, args.outfile, indent=2, separators=(",", ": ")) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/vectors/scrypt_vectors.rst0000644000175100017510000000320315125531055020714 0ustar00runnerrunnerscrypt reference vectors ^^^^^^^^^^^^^^^^^^^^^^^^ Libsodium exposes both a simplified scrypt KDF/password storage API which parametrizes the CPU and memory load in term of a opslimit parameter and a memlimit one, and a "traditional" low-level API parametrized in terms of a (N, r, p) triple. While we used the vectors from `RFC 7914`_ to test the traditional API, the simplified API is only implemented by libsodium, and therefore we just added a KDF generation check using the ascii encoded passphrase "The quick brown fox jumps over the lazy dog.", and verified the results were the same we could get from the version of hashlib.scrypt, as provided in python version 3.6 stdlib. .. code-block:: python >>> import hashlib >>> import nacl >>> import nacl.bindings >>> import nacl.pwhash.scrypt >>> pick_scrypt_params = nacl.bindings.nacl_bindings_pick_scrypt_params >>> nacl.pwhash.scrypt.kdf(32, ... b'The quick brown fox jumps over the lazy dog.', ... b"ef537f25c895bfa782526529a9b63d97", ... opslimit=20000, memlimit=100 * (2 ** 20)) b'\x10e>\xc8A8\x11\xde\x07\xf1\x0f\x98EG\xe6}V]\xd4yN\xae\xd3P\x87yP\x1b\xc7+n*' >>> n_log2, r, p = pick_scrypt_params(20000, 100 * (2 ** 20)) >>> print(2 ** n_log2, r, p) 1024 8 1 >>> hashlib.scrypt(b'The quick brown fox jumps over the lazy dog.', ... salt=b"ef537f25c895bfa782526529a9b63d97", ... n=1024, r=8, p=1, dklen=32) b'\x10e>\xc8A8\x11\xde\x07\xf1\x0f\x98EG\xe6}V]\xd4yN\xae\xd3P\x87yP\x1b\xc7+n*' .. _RFC 7914: https://tools.ietf.org/html/rfc7914 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/vectors/sealedbox_vectors.rst0000644000175100017510000000602415125531055021342 0ustar00runnerrunnerSealedBox reference vectors ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Since libsodium's tests do not provide reference data for the SealedBox construction, the implementation is verified with a ``sealbox_test_vectors`` utility program that produces and checks custom test vectors by making specific calls to libsodium API. To build the ``sealbox_test_vectors`` you need a ``C`` language compiler, a prebuilt libsodium library more recent than version 1.0.3 and the corresponding include headers. In a UNIX-like programming environment you should then execute: .. code-block:: bash $ cc -o sealbox_test_vectors sealbox_test_vectors.c -lsodium -lc If you prefer using a locally compiled installation of the bundled sources, refer to :ref:`building-a-local-library` and then run: .. code-block:: bash $ cc -o sealbox_test_vectors sealbox_test_vectors.c \ ${SODIUMINCL} ${SODIUMLIB} -lsodium -lc Vector generation """"""""""""""""" When called with one or more command line arguments, ``sealbox_test_vectors`` will generate the number of hex-encoded vectors requested as first argument, with the optional second and third arguments influencing the length of the randomly generated messages: .. code-block:: bash $ ./sealbox_test_vectors 1 XXXX... XXXX... :XXXX... :XXXX... The second argument, if present, sets both a minimum and a maximum length on generated messages, overriding the default 128 bytes values respectively with the supplied value and with twice the supplied value. The third argument, if present, sets the maximum length of generated messages. Vector test """"""""""" When called without command line arguments, ``sealbox_test_vectors`` will parse and hex-decode the lines given as standard input and check if decoding the encrypted message will return the original message. A "OK"/"FAIL" tag will be appended to the input line to signify success/failure of the test. To check correct "round-trip" behavior, you can run ``sealbox_test_vectors`` as a test vector generator against itself: .. code-block:: bash $ ./sealbox_test_vectors 1 | ./sealbox_test_vectors XXXX... XXXX... :XXXX... :XXXX... OK If you want to check the vectors distributed with PyNaCl's sources, after setting the environment variable ``PYNACL_BASE`` to the directory where the unpacked source for PyNaCl has been extracted/cloned, you could run: .. code-block:: bash $ ./sealbox_test_vectors < ${PYNACL_BASE}/tests/data/sealed_box_ref.txt 77076d ... 8c86 OK Source code for the vector checker utility """""""""""""""""""""""""""""""""""""""""" The source code for ``sealbox_test_vectors`` is available inside the ``docs/vectors/c-source`` directory of PyNaCl distribution and can also be directly downloaded from :download:`sealbox_test_vectors.c <./c-source/sealbox_test_vectors.c>`. .. put the and... sentence under a ..only:: builder_html when readthedocs begins to correctly support the directive .. literalinclude:: c-source/sealbox_test_vectors.c :language: c :caption: sealbox_test_vectors.c ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/docs/vectors/secretstream_vectors.rst0000644000175100017510000000361715125531055022102 0ustar00runnerrunnersecretstream reference vectors ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Since libsodium's tests do not provide reference data for the secretstream construction, the implementation is verified with a ``secretstream_test_vector`` utility program that produces custom test vectors by making specific calls to the libsodium API. To build the ``secretstream_test_vector`` you need a ``C`` language compiler, a prebuilt libsodium library more recent than version 1.0.14 and the corresponding include headers. In a UNIX-like programming environment you should then execute: .. code-block:: bash $ cc -o secretstream_test_vector secretstream_test_vector.c -lsodium -lc If you prefer using a locally compiled installation of the bundled sources, refer to :ref:`building-a-local-library` and then run: .. code-block:: bash $ cc -o secretstream_test_vector secretstream_test_vector.c \ ${SODIUMINCL} ${SODIUMLIB} -lsodium -lc Vector generation """"""""""""""""" .. code-block:: bash $ ./secretstream_test_vector -h Usage: secretstream_test_vector [-c num_chunks] [-r] When called, the program will output a JSON dictionary containing ``key``, ``header``, and ``chunks``. The ``chunks`` is a list of individual messages passed to ``crypto_secretstream_xchacha20poly1305_push`` containing ``tag``, ``message``, ``ad`` and ``ciphertext`` keys. Source code for the vector checker utility """""""""""""""""""""""""""""""""""""""""" The source code for ``secretstream_test_vector`` is available inside the ``docs/vectors/c-source`` directory of PyNaCl distribution and can also be directly downloaded from :download:`secretstream_test_vector.c <./c-source/secretstream_test_vector.c>`. .. put the and... sentence under a ..only:: builder_html when readthedocs begins to correctly support the directive .. literalinclude:: c-source/secretstream_test_vector.c :language: c :caption: secretstream_test_vector.c ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.6120865 pynacl-1.6.2/licenses/0000755000175100017510000000000015125531066014265 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/licenses/LICENSE.libsodium.txt0000644000175100017510000000146715125531055020104 0ustar00runnerrunner/* * ISC License * * Copyright (c) 2013-2026 * Frank Denis * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/noxfile.py0000644000175100017510000000273315125531055014501 0ustar00runnerrunnerimport nox nox.options.reuse_existing_virtualenvs = True nox.options.default_venv_backend = "uv|virtualenv" @nox.session def tests(session: nox.Session) -> None: session.install(".[tests]") if session.posargs: tests = session.posargs else: tests = ["tests/"] session.run( "pytest", "-n", "auto", "--dist=worksteal", "--cov=nacl", "--cov=tests", "--cov-context=test", *tests, ) @nox.session def docs(session: nox.Session) -> None: session.install("doc8", ".[docs]") tmpdir = session.create_tmp() session.run( "sphinx-build", "-W", "-b", "html", "-d", f"{tmpdir}/doctrees", "docs", "docs/_build/html", ) session.run( "sphinx-build", "-W", "-b", "doctest", "-d", f"{tmpdir}/doctrees", "docs", "docs/_build/html", ) session.run( "sphinx-build", "-W", "-b", "linkcheck", "docs", "docs/_build/html" ) session.run("doc8", "README.rst", "docs/", "--ignore-path", "docs/_build/") @nox.session def meta(session: nox.Session) -> None: session.install("ruff", "check-manifest") session.run("ruff", "check", ".") session.run("ruff", "format", "--check", ".") session.run("check-manifest", ".") @nox.session def mypy(session: nox.Session) -> None: session.install(".[tests]", "mypy") session.run("mypy") ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/pyproject.toml0000644000175100017510000001045515125531055015377 0ustar00runnerrunner[build-system] # Must be kept in sync with `dependencies` below requires = [ "setuptools>=61.0.0,!=74.0.0", "wheel", "cffi>=1.4.1; platform_python_implementation != 'PyPy' and python_version < '3.9'", "cffi>=2.0.0; platform_python_implementation != 'PyPy' and python_version >= '3.9'", ] build-backend = "setuptools.build_meta" [project] dynamic = ["readme"] name = "PyNaCl" # Must be kept in sync with `src/nacl/__init__.py` version = "1.6.2" authors = [ {name = "The PyNaCl developers", email = "cryptography-dev@python.org"} ] description = "Python binding to the Networking and Cryptography (NaCl) library" license = {text = "Apache-2.0"} classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python :: Free Threading :: 3 - Stable", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", ] requires-python = ">=3.8" dependencies = [ "cffi>=1.4.1; platform_python_implementation != 'PyPy' and python_version < '3.9'", "cffi>=2.0.0; platform_python_implementation != 'PyPy' and python_version >= '3.9'", ] [project.optional-dependencies] tests = [ "pytest >=7.4.0", "pytest-cov >=2.10.1", "pytest-xdist >=3.5.0", "hypothesis>=3.27.0", ] docs = [ "sphinx<7", "sphinx_rtd_theme" ] [project.urls] "Homepage" = "https://github.com/pyca/pynacl" "Bug Tracker" = "https://github.com/pyca/pynacl/issues" "Documentation" = "https://pynacl.readthedocs.io" [tool.ruff] line-length = 79 exclude = ["src/libsodium"] [tool.mypy] show_error_codes = true warn_redundant_casts = true warn_incomplete_stub = true disallow_any_unimported = true disallow_any_expr = true # overridden to `false` inside `nacl.bindings` disallow_any_decorated = true disallow_any_explicit = true disallow_any_generics = true disallow_subclassing_any = true disallow_untyped_calls = true disallow_untyped_defs = true disallow_incomplete_defs = true check_untyped_defs = true disallow_untyped_decorators = true no_implicit_optional = true warn_unused_ignores = true warn_no_return = true warn_return_any = true # overridden to `false` inside `nacl.bindings` warn_unreachable = true no_implicit_reexport = true strict_equality = true files = [ "src/nacl", "tests", ] [[tool.mypy.overrides]] module = [ "nacl._sodium", ] ignore_missing_imports = true # Within `nacl.bindings`, all of the C functions exposed via cffi in # nacl._sodium return `Any` as far as mypy is concerned. It's not worth it to # stub the C functions or cast() their uses. But this means there are more # `Any`s floating around. So the more restrictive any checks we'd like to use # should only be turned on outside of `bindings`. [[tool.mypy.overrides]] module = [ "nacl.bindings.*", ] disallow_any_expr = false warn_return_any = false # Loosen some of the checks within the tests. Note that `tests.utils` passes with the # strict checks on, but it's included here in the list of modules with looser checks # to keep mypy's config simple(r). [[tool.mypy.overrides]] module = [ "tests.*", ] # Some library helpers types' involve `Any`, in particular `pytest.mark.parameterize` # and `hypothesis.strategies.sampledfrom`. disallow_any_expr = false disallow_any_decorated = false # It's not useful to annotate each test function as `-> None`. disallow_untyped_defs = false disallow_incomplete_defs = false [tool.coverage.run] branch = true relative_files = true source = ["nacl", "tests/"] [tool.coverage.paths] source = [ "src/nacl", "*.nox/*/lib*/python*/site-packages/nacl", "*.nox/*/lib*/pypy*/site-packages/nacl", "*.nox\\*\\Lib\\site-packages\\nacl", ] tests = ["tests/", "*tests\\"] [tool.coverage.report] exclude_also = [ "@abc.abstractmethod", "@typing.overload", "if typing.TYPE_CHECKING", ] [tool.coverage.html] show_contexts = true [tool.pytest.ini_options] addopts = "-r s --capture=no" console_output_style = "progress-even-when-capture-no" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.7460864 pynacl-1.6.2/setup.cfg0000644000175100017510000000033115125531066014276 0ustar00runnerrunner[metadata] license = Apache-2.0 license_files = LICENSE licenses/LICENSE.libsodium.txt [flake8] ignore = E203,E501,W503,W504 select = E,W,F,I application-import-names = nacl [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/setup.py0000644000175100017510000001351215125531055014172 0ustar00runnerrunner#!/usr/bin/env python # Copyright 2013 Donald Stufft and individual contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import errno import functools import glob import os import os.path import platform import shutil import subprocess import sys from sysconfig import get_config_vars from setuptools import Distribution, setup from setuptools.command.build_clib import build_clib as _build_clib from setuptools.command.build_ext import build_ext as _build_ext if platform.python_implementation() == "PyPy": if sys.pypy_version_info < (2, 6): raise RuntimeError( "PyNaCl is not compatible with PyPy < 2.6. Please " "upgrade PyPy to use this library." ) def here(*paths): return os.path.relpath(os.path.join(*paths)) def abshere(*paths): return os.path.abspath(here(*paths)) sodium = functools.partial(here, "src/libsodium/src/libsodium") sys.path.insert(0, abshere("src")) import nacl # noqa def use_system(): install_type = os.environ.get("SODIUM_INSTALL") if install_type == "system": # If we are forcing system installs, don't compile the bundled one return True else: # By default we just use the bundled copy return False class Distribution(Distribution): def has_c_libraries(self): return not use_system() class build_clib(_build_clib): def get_source_files(self): files = glob.glob(here("src/libsodium/*")) files += glob.glob(here("src/libsodium/*/*")) files += glob.glob(here("src/libsodium/*/*/*")) files += glob.glob(here("src/libsodium/*/*/*/*")) files += glob.glob(here("src/libsodium/*/*/*/*/*")) files += glob.glob(here("src/libsodium/*/*/*/*/*/*")) return files def build_libraries(self, libraries): raise Exception("build_libraries") def check_library_list(self, libraries): raise Exception("check_library_list") def get_library_names(self): return ["sodium"] def run(self): if use_system(): return # use Python's build environment variables build_env = { key: val for key, val in get_config_vars().items() if key in ("LDFLAGS", "CFLAGS", "CC", "CCSHARED", "LDSHARED") and key not in os.environ } os.environ.update(build_env) # Ensure our temporary build directory exists build_temp = os.path.abspath(self.build_temp) try: os.makedirs(build_temp) except OSError as e: if e.errno != errno.EEXIST: raise # Ensure all of our executable files have their permission set for filename in [ "src/libsodium/autogen.sh", "src/libsodium/configure", ]: os.chmod(here(filename), 0o755) make_command = os.environ.get("MAKE") or "make" if not shutil.which(make_command): raise Exception( "ERROR: The '%s' utility is missing from PATH" % make_command ) # Locate our configure script configure = abshere("src/libsodium/configure") # Run ./configure configure_flags = [ "--disable-shared", "--enable-static", "--disable-debug", "--disable-dependency-tracking", "--with-pic", ] if platform.system() == "SunOS": # On Solaris, libssp doesn't link statically and causes linker # errors during import configure_flags.append("--disable-ssp") if os.environ.get("SODIUM_INSTALL_MINIMAL"): configure_flags.append("--enable-minimal") subprocess.check_call( [configure] + configure_flags + ["--prefix", os.path.abspath(self.build_clib)], cwd=build_temp, ) make_args = os.environ.get("LIBSODIUM_MAKE_ARGS", "").split() # Build the library subprocess.check_call([make_command] + make_args, cwd=build_temp) # Check the build library subprocess.check_call( [make_command, "check"] + make_args, cwd=build_temp ) # Install the built library subprocess.check_call( [make_command, "install"] + make_args, cwd=build_temp ) class build_ext(_build_ext): def run(self): if self.distribution.has_c_libraries(): build_clib = self.get_finalized_command("build_clib") self.include_dirs.append( os.path.join(build_clib.build_clib, "include"), ) self.library_dirs.insert( 0, os.path.join(build_clib.build_clib, "lib64"), ) self.library_dirs.insert( 0, os.path.join(build_clib.build_clib, "lib"), ) return _build_ext.run(self) README = open("README.rst").read() INSTALL = open("INSTALL.rst").read() CHANGELOG = open("CHANGELOG.rst").read() setup( long_description="\n".join((README, INSTALL, CHANGELOG)), url=nacl.__uri__, package_dir={"": "src"}, packages=["nacl", "nacl.pwhash", "nacl.bindings"], package_data={"nacl": ["py.typed"]}, ext_package="nacl", cffi_modules=["src/bindings/build.py:ffi"], cmdclass={"build_clib": build_clib, "build_ext": build_ext}, distclass=Distribution, zip_safe=False, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.6050866 pynacl-1.6.2/src/0000755000175100017510000000000015125531066013247 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.7440863 pynacl-1.6.2/src/PyNaCl.egg-info/0000755000175100017510000000000015125531066016067 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289397.0 pynacl-1.6.2/src/PyNaCl.egg-info/PKG-INFO0000644000175100017510000002337115125531065017171 0ustar00runnerrunnerMetadata-Version: 2.4 Name: PyNaCl Version: 1.6.2 Summary: Python binding to the Networking and Cryptography (NaCl) library Home-page: https://github.com/pyca/pynacl/ Author-email: The PyNaCl developers License: Apache-2.0 Project-URL: Homepage, https://github.com/pyca/pynacl Project-URL: Bug Tracker, https://github.com/pyca/pynacl/issues Project-URL: Documentation, https://pynacl.readthedocs.io Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Programming Language :: Python :: Free Threading :: 3 - Stable Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3.14 Requires-Python: >=3.8 License-File: LICENSE License-File: licenses/LICENSE.libsodium.txt Requires-Dist: cffi>=1.4.1; platform_python_implementation != "PyPy" and python_version < "3.9" Requires-Dist: cffi>=2.0.0; platform_python_implementation != "PyPy" and python_version >= "3.9" Provides-Extra: tests Requires-Dist: pytest>=7.4.0; extra == "tests" Requires-Dist: pytest-cov>=2.10.1; extra == "tests" Requires-Dist: pytest-xdist>=3.5.0; extra == "tests" Requires-Dist: hypothesis>=3.27.0; extra == "tests" Provides-Extra: docs Requires-Dist: sphinx<7; extra == "docs" Requires-Dist: sphinx_rtd_theme; extra == "docs" Dynamic: description Dynamic: home-page Dynamic: license-file =============================================== PyNaCl: Python binding to the libsodium library =============================================== .. image:: https://img.shields.io/pypi/v/pynacl.svg :target: https://pypi.org/project/PyNaCl/ :alt: Latest Version PyNaCl is a Python binding to `libsodium`_, which is a fork of the `Networking and Cryptography library`_. These libraries have a stated goal of improving usability, security and speed. It supports Python 3.8+ as well as PyPy 3. .. _libsodium: https://github.com/jedisct1/libsodium .. _Networking and Cryptography library: https://nacl.cr.yp.to/ Features -------- * Digital signatures * Secret-key encryption * Public-key encryption * Hashing and message authentication * Password based key derivation and password hashing `Changelog`_ ------------ .. _Changelog: https://pynacl.readthedocs.io/en/latest/changelog/ Installation ============ Binary wheel install -------------------- PyNaCl ships as a binary wheel on macOS, Windows and Linux ``manylinux1`` [#many]_ , so all dependencies are included. Make sure you have an up-to-date pip and run: .. code-block:: console $ pip install pynacl Faster wheel build ------------------ You can define the environment variable ``LIBSODIUM_MAKE_ARGS`` to pass arguments to ``make`` and enable `parallelization`_: .. code-block:: console $ LIBSODIUM_MAKE_ARGS=-j4 pip install pynacl Linux source build ------------------ PyNaCl relies on `libsodium`_, a portable C library. A copy is bundled with PyNaCl so to install you can run: .. code-block:: console $ pip install pynacl If you'd prefer to use the version of ``libsodium`` provided by your distribution, you can disable the bundled copy during install by running: .. code-block:: console $ SODIUM_INSTALL=system pip install pynacl .. warning:: Usage of the legacy ``easy_install`` command provided by setuptools is generally discouraged, and is completely unsupported in PyNaCl's case. .. _parallelization: https://www.gnu.org/software/make/manual/html_node/Parallel.html .. _libsodium: https://github.com/jedisct1/libsodium .. [#many] `manylinux1 wheels `_ are built on a baseline linux environment based on Centos 5.11 and should work on most x86 and x86_64 glibc based linux environments. GNU Make (gmake) may be required for newer versions of PyNaCl. You can set the binary to use by setting the ``MAKE`` environment variable: .. code-block:: console $ MAKE=gmake pip install pynacl Changelog ========= 1.6.2 (2026-01-01) ------------------ * Updated ``libsodium`` to 1.0.20-stable (2025-12-31 build) to resolve ``CVE-2025-69277``. 1.6.1 (2025-11-10) ------------------ * The ``MAKE`` environment variable can now be used to specify the ``make`` binary that should be used in the build process. 1.6.0 (2025-09-11) ------------------ * **BACKWARDS INCOMPATIBLE:** Removed support for Python 3.6 and 3.7. * Added support for the low level AEAD AES bindings. * Added support for ``crypto_core_ed25519_from_uniform``. * Update ``libsodium`` to 1.0.20-stable (2025-08-27 build). * Added support for free-threaded Python 3.14. * Added support for Windows on ARM wheels. 1.5.0 (2022-01-07) ------------------ * **BACKWARDS INCOMPATIBLE:** Removed support for Python 2.7 and Python 3.5. * **BACKWARDS INCOMPATIBLE:** We no longer distribute ``manylinux1`` wheels. * Added ``manylinux2014``, ``manylinux_2_24``, ``musllinux``, and macOS ``universal2`` wheels (the latter supports macOS ``arm64``). * Update ``libsodium`` to 1.0.18-stable (July 25, 2021 release). * Add inline type hints. 1.4.0 (2020-05-25) ------------------ * Update ``libsodium`` to 1.0.18. * **BACKWARDS INCOMPATIBLE:** We no longer distribute 32-bit ``manylinux1`` wheels. Continuing to produce them was a maintenance burden. * Added support for Python 3.8, and removed support for Python 3.4. * Add low level bindings for extracting the seed and the public key from crypto_sign_ed25519 secret key * Add low level bindings for deterministic random generation. * Add ``wheel`` and ``setuptools`` setup_requirements in ``setup.py`` (#485) * Fix checks on very slow builders (#481, #495) * Add low-level bindings to ed25519 arithmetic functions * Update low-level blake2b state implementation * Fix wrong short-input behavior of SealedBox.decrypt() (#517) * Raise CryptPrefixError exception instead of InvalidkeyError when trying to check a password against a verifier stored in a unknown format (#519) * Add support for minimal builds of libsodium. Trying to call functions not available in a minimal build will raise an UnavailableError exception. To compile a minimal build of the bundled libsodium, set the SODIUM_INSTALL_MINIMAL environment variable to any non-empty string (e.g. ``SODIUM_INSTALL_MINIMAL=1``) for setup. 1.3.0 2018-09-26 ---------------- * Added support for Python 3.7. * Update ``libsodium`` to 1.0.16. * Run and test all code examples in PyNaCl docs through sphinx's doctest builder. * Add low-level bindings for chacha20-poly1305 AEAD constructions. * Add low-level bindings for the chacha20-poly1305 secretstream constructions. * Add low-level bindings for ed25519ph pre-hashed signing construction. * Add low-level bindings for constant-time increment and addition on fixed-precision big integers represented as little-endian byte sequences. * Add low-level bindings for the ISO/IEC 7816-4 compatible padding API. * Add low-level bindings for libsodium's crypto_kx... key exchange construction. * Set hypothesis deadline to None in tests/test_pwhash.py to avoid incorrect test failures on slower processor architectures. GitHub issue #370 1.2.1 - 2017-12-04 ------------------ * Update hypothesis minimum allowed version. * Infrastructure: add proper configuration for readthedocs builder runtime environment. 1.2.0 - 2017-11-01 ------------------ * Update ``libsodium`` to 1.0.15. * Infrastructure: add jenkins support for automatic build of ``manylinux1`` binary wheels * Added support for ``SealedBox`` construction. * Added support for ``argon2i`` and ``argon2id`` password hashing constructs and restructured high-level password hashing implementation to expose the same interface for all hashers. * Added support for 128 bit ``siphashx24`` variant of ``siphash24``. * Added support for ``from_seed`` APIs for X25519 key pair generation. * Dropped support for Python 3.3. 1.1.2 - 2017-03-31 ------------------ * reorder link time library search path when using bundled libsodium 1.1.1 - 2017-03-15 ------------------ * Fixed a circular import bug in ``nacl.utils``. 1.1.0 - 2017-03-14 ------------------ * Dropped support for Python 2.6. * Added ``shared_key()`` method on ``Box``. * You can now pass ``None`` to ``nonce`` when encrypting with ``Box`` or ``SecretBox`` and it will automatically generate a random nonce. * Added support for ``siphash24``. * Added support for ``blake2b``. * Added support for ``scrypt``. * Update ``libsodium`` to 1.0.11. * Default to the bundled ``libsodium`` when compiling. * All raised exceptions are defined mixing-in ``nacl.exceptions.CryptoError`` 1.0.1 - 2016-01-24 ------------------ * Fix an issue with absolute paths that prevented the creation of wheels. 1.0 - 2016-01-23 ---------------- * PyNaCl has been ported to use the new APIs available in cffi 1.0+. Due to this change we no longer support PyPy releases older than 2.6. * Python 3.2 support has been dropped. * Functions to convert between Ed25519 and Curve25519 keys have been added. 0.3.0 - 2015-03-04 ------------------ * The low-level API (`nacl.c.*`) has been changed to match the upstream NaCl C/C++ conventions (as well as those of other NaCl bindings). The order of arguments and return values has changed significantly. To avoid silent failures, `nacl.c` has been removed, and replaced with `nacl.bindings` (with the new argument ordering). If you have code which calls these functions (e.g. `nacl.c.crypto_box_keypair()`), you must review the new docstrings and update your code/imports to match the new conventions. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289397.0 pynacl-1.6.2/src/PyNaCl.egg-info/SOURCES.txt0000644000175100017510000012514115125531065017756 0ustar00runnerrunnerCHANGELOG.rst INSTALL.rst LICENSE MANIFEST.in README.rst noxfile.py pyproject.toml setup.cfg setup.py docs/Makefile docs/changelog.rst docs/conf.py docs/doing-a-release.rst docs/encoding.rst docs/exceptions.rst docs/hashing.rst docs/index.rst docs/install.rst docs/password_hashing.rst docs/public.rst docs/secret.rst docs/signing.rst docs/utils.rst docs/_static/ed25519.png docs/api/hash.rst docs/api/hashlib.rst docs/api/pwhash.rst docs/vectors/argon2_vectors.rst docs/vectors/blake2_vectors.rst docs/vectors/bundled_library_build.rst docs/vectors/index.rst docs/vectors/scrypt_vectors.rst docs/vectors/sealedbox_vectors.rst docs/vectors/secretstream_vectors.rst docs/vectors/c-source/sealbox_test_vectors.c docs/vectors/c-source/secretstream_test_vector.c docs/vectors/python/argondriver.py licenses/LICENSE.libsodium.txt src/PyNaCl.egg-info/PKG-INFO src/PyNaCl.egg-info/SOURCES.txt src/PyNaCl.egg-info/dependency_links.txt src/PyNaCl.egg-info/not-zip-safe src/PyNaCl.egg-info/requires.txt src/PyNaCl.egg-info/top_level.txt src/bindings/build.py src/bindings/crypto_aead.h src/bindings/crypto_box.h src/bindings/crypto_core.h src/bindings/crypto_generichash.h src/bindings/crypto_hash.h src/bindings/crypto_kx.h src/bindings/crypto_pwhash.h src/bindings/crypto_scalarmult.h src/bindings/crypto_secretbox.h src/bindings/crypto_secretstream.h src/bindings/crypto_shorthash.h src/bindings/crypto_sign.h src/bindings/randombytes.h src/bindings/sodium_core.h src/bindings/utils.h src/bindings/minimal/crypto_core.h src/bindings/minimal/crypto_pwhash.h src/bindings/minimal/crypto_scalarmult.h src/bindings/minimal/crypto_shorthash.h src/libsodium/.gitignore src/libsodium/AUTHORS src/libsodium/CITATION.cff src/libsodium/ChangeLog src/libsodium/LICENSE src/libsodium/Makefile.am src/libsodium/Makefile.in src/libsodium/README.markdown src/libsodium/THANKS src/libsodium/aclocal.m4 src/libsodium/appveyor.yml src/libsodium/autogen.sh src/libsodium/azure-pipelines.yml src/libsodium/build-aux src/libsodium/build.zig src/libsodium/builds src/libsodium/ci src/libsodium/configure src/libsodium/configure.ac src/libsodium/contrib src/libsodium/dist-build src/libsodium/lgtm.yml src/libsodium/libsodium-uninstalled.pc.in src/libsodium/libsodium.pc.in src/libsodium/logo.png src/libsodium/m4 src/libsodium/packaging src/libsodium/regen-msvc src/libsodium/src src/libsodium/test src/libsodium/.github/workflows/autocloser.yml src/libsodium/.github/workflows/ci.yml src/libsodium/.github/workflows/cifuzz.yml src/libsodium/.github/workflows/codeql-analysis.yml src/libsodium/.github/workflows/dotnet-core.yml src/libsodium/build-aux/compile src/libsodium/build-aux/config.guess src/libsodium/build-aux/config.sub src/libsodium/build-aux/depcomp src/libsodium/build-aux/install-sh src/libsodium/build-aux/ltmain.sh src/libsodium/build-aux/missing src/libsodium/build-aux/test-driver src/libsodium/builds/.gitignore src/libsodium/builds/Makefile.am src/libsodium/builds/Makefile.in src/libsodium/builds/msvc src/libsodium/builds/msvc/build src/libsodium/builds/msvc/properties src/libsodium/builds/msvc/resource.h src/libsodium/builds/msvc/resource.rc src/libsodium/builds/msvc/version.h src/libsodium/builds/msvc/vs2010 src/libsodium/builds/msvc/vs2012 src/libsodium/builds/msvc/vs2013 src/libsodium/builds/msvc/vs2015 src/libsodium/builds/msvc/vs2017 src/libsodium/builds/msvc/vs2019 src/libsodium/builds/msvc/vs2022 src/libsodium/builds/msvc/vs2026 src/libsodium/builds/msvc/build/buildall.bat src/libsodium/builds/msvc/build/buildbase.bat src/libsodium/builds/msvc/properties/ARM64.props src/libsodium/builds/msvc/properties/Common.props src/libsodium/builds/msvc/properties/DLL.props src/libsodium/builds/msvc/properties/Debug.props src/libsodium/builds/msvc/properties/DebugDEXE.props src/libsodium/builds/msvc/properties/DebugDLL.props src/libsodium/builds/msvc/properties/DebugLEXE.props src/libsodium/builds/msvc/properties/DebugLIB.props src/libsodium/builds/msvc/properties/DebugLTCG.props src/libsodium/builds/msvc/properties/DebugSEXE.props src/libsodium/builds/msvc/properties/EXE.props src/libsodium/builds/msvc/properties/LIB.props src/libsodium/builds/msvc/properties/LTCG.props src/libsodium/builds/msvc/properties/Link.props src/libsodium/builds/msvc/properties/Messages.props src/libsodium/builds/msvc/properties/Output.props src/libsodium/builds/msvc/properties/Release.props src/libsodium/builds/msvc/properties/ReleaseDEXE.props src/libsodium/builds/msvc/properties/ReleaseDLL.props src/libsodium/builds/msvc/properties/ReleaseLEXE.props src/libsodium/builds/msvc/properties/ReleaseLIB.props src/libsodium/builds/msvc/properties/ReleaseLTCG.props src/libsodium/builds/msvc/properties/ReleaseSEXE.props src/libsodium/builds/msvc/properties/Win32.props src/libsodium/builds/msvc/properties/x64.props src/libsodium/builds/msvc/vs2010/libsodium src/libsodium/builds/msvc/vs2010/libsodium.import.props src/libsodium/builds/msvc/vs2010/libsodium.import.xml src/libsodium/builds/msvc/vs2010/libsodium.sln src/libsodium/builds/msvc/vs2010/libsodium/libsodium.props src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters src/libsodium/builds/msvc/vs2010/libsodium/libsodium.xml src/libsodium/builds/msvc/vs2012/libsodium src/libsodium/builds/msvc/vs2012/libsodium.import.props src/libsodium/builds/msvc/vs2012/libsodium.import.xml src/libsodium/builds/msvc/vs2012/libsodium.sln src/libsodium/builds/msvc/vs2012/libsodium/libsodium.props src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters src/libsodium/builds/msvc/vs2012/libsodium/libsodium.xml src/libsodium/builds/msvc/vs2013/libsodium src/libsodium/builds/msvc/vs2013/libsodium.import.props src/libsodium/builds/msvc/vs2013/libsodium.import.xml src/libsodium/builds/msvc/vs2013/libsodium.sln src/libsodium/builds/msvc/vs2013/libsodium/libsodium.props src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters src/libsodium/builds/msvc/vs2013/libsodium/libsodium.xml src/libsodium/builds/msvc/vs2015/libsodium src/libsodium/builds/msvc/vs2015/libsodium.import.props src/libsodium/builds/msvc/vs2015/libsodium.import.xml src/libsodium/builds/msvc/vs2015/libsodium.sln src/libsodium/builds/msvc/vs2015/libsodium/libsodium.props src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters src/libsodium/builds/msvc/vs2015/libsodium/libsodium.xml src/libsodium/builds/msvc/vs2017/libsodium src/libsodium/builds/msvc/vs2017/libsodium.import.props src/libsodium/builds/msvc/vs2017/libsodium.import.xml src/libsodium/builds/msvc/vs2017/libsodium.sln src/libsodium/builds/msvc/vs2017/libsodium/libsodium.props src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters src/libsodium/builds/msvc/vs2017/libsodium/libsodium.xml src/libsodium/builds/msvc/vs2019/libsodium src/libsodium/builds/msvc/vs2019/libsodium.import.props src/libsodium/builds/msvc/vs2019/libsodium.import.xml src/libsodium/builds/msvc/vs2019/libsodium.sln src/libsodium/builds/msvc/vs2019/libsodium/libsodium.props src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters src/libsodium/builds/msvc/vs2019/libsodium/libsodium.xml src/libsodium/builds/msvc/vs2022/libsodium src/libsodium/builds/msvc/vs2022/libsodium.import.props src/libsodium/builds/msvc/vs2022/libsodium.import.xml src/libsodium/builds/msvc/vs2022/libsodium.sln src/libsodium/builds/msvc/vs2022/libsodium/libsodium.props src/libsodium/builds/msvc/vs2022/libsodium/libsodium.vcxproj src/libsodium/builds/msvc/vs2022/libsodium/libsodium.vcxproj.filters src/libsodium/builds/msvc/vs2022/libsodium/libsodium.xml src/libsodium/builds/msvc/vs2026/libsodium src/libsodium/builds/msvc/vs2026/libsodium.import.props src/libsodium/builds/msvc/vs2026/libsodium.import.xml src/libsodium/builds/msvc/vs2026/libsodium.sln src/libsodium/builds/msvc/vs2026/libsodium/libsodium.props src/libsodium/builds/msvc/vs2026/libsodium/libsodium.vcxproj src/libsodium/builds/msvc/vs2026/libsodium/libsodium.vcxproj.filters src/libsodium/builds/msvc/vs2026/libsodium/libsodium.xml src/libsodium/ci/appveyor src/libsodium/ci/appveyor/libsodium.sln src/libsodium/ci/appveyor/libsodium.vcxproj src/libsodium/ci/appveyor/libsodium.vcxproj.filters src/libsodium/ci/appveyor/msvc-scripts src/libsodium/ci/appveyor/msvc-scripts/process.bat src/libsodium/ci/appveyor/msvc-scripts/rep.vbs src/libsodium/ci/appveyor/msvc-scripts/sodium.props src/libsodium/contrib/Findsodium.cmake src/libsodium/contrib/Makefile.am src/libsodium/contrib/Makefile.in src/libsodium/dist-build/Makefile.am src/libsodium/dist-build/Makefile.in src/libsodium/dist-build/android-aar.sh src/libsodium/dist-build/android-armv7-a.sh src/libsodium/dist-build/android-armv8-a.sh src/libsodium/dist-build/android-build.sh src/libsodium/dist-build/android-x86.sh src/libsodium/dist-build/android-x86_64.sh src/libsodium/dist-build/apple-xcframework.sh src/libsodium/dist-build/emscripten-symbols.def src/libsodium/dist-build/emscripten.sh src/libsodium/dist-build/generate-emscripten-symbols.sh src/libsodium/dist-build/macos.sh src/libsodium/dist-build/msys2-win32.sh src/libsodium/dist-build/msys2-win64.sh src/libsodium/dist-build/wasm32-wasi.sh src/libsodium/m4/ax_add_fortify_source.m4 src/libsodium/m4/ax_check_catchable_abrt.m4 src/libsodium/m4/ax_check_catchable_segv.m4 src/libsodium/m4/ax_check_compile_flag.m4 src/libsodium/m4/ax_check_define.m4 src/libsodium/m4/ax_check_gnu_make.m4 src/libsodium/m4/ax_check_link_flag.m4 src/libsodium/m4/ax_pthread.m4 src/libsodium/m4/ax_tls.m4 src/libsodium/m4/ax_valgrind_check.m4 src/libsodium/m4/ld-output-def.m4 src/libsodium/m4/libtool.m4 src/libsodium/m4/ltoptions.m4 src/libsodium/m4/ltsugar.m4 src/libsodium/m4/ltversion.m4 src/libsodium/m4/lt~obsolete.m4 src/libsodium/packaging/dotnet-core src/libsodium/packaging/nuget src/libsodium/packaging/dotnet-core/libsodium.pkgproj src/libsodium/packaging/dotnet-core/test.cs src/libsodium/packaging/nuget/.gitignore src/libsodium/packaging/nuget/package.bat src/libsodium/packaging/nuget/package.config src/libsodium/packaging/nuget/package.gsl src/libsodium/regen-msvc/libsodium.vcxproj src/libsodium/regen-msvc/libsodium.vcxproj.filters src/libsodium/regen-msvc/libsodium.vcxproj.filters.tpl src/libsodium/regen-msvc/libsodium.vcxproj.tpl src/libsodium/regen-msvc/regen-msvc.py src/libsodium/regen-msvc/tl_libsodium.vcxproj.filters.tpl src/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl src/libsodium/src/Makefile.am src/libsodium/src/Makefile.in src/libsodium/src/libsodium src/libsodium/src/libsodium/Makefile.am src/libsodium/src/libsodium/Makefile.in src/libsodium/src/libsodium/crypto_aead src/libsodium/src/libsodium/crypto_auth src/libsodium/src/libsodium/crypto_box src/libsodium/src/libsodium/crypto_core src/libsodium/src/libsodium/crypto_generichash src/libsodium/src/libsodium/crypto_hash src/libsodium/src/libsodium/crypto_kdf src/libsodium/src/libsodium/crypto_kx src/libsodium/src/libsodium/crypto_onetimeauth src/libsodium/src/libsodium/crypto_pwhash src/libsodium/src/libsodium/crypto_scalarmult src/libsodium/src/libsodium/crypto_secretbox src/libsodium/src/libsodium/crypto_secretstream src/libsodium/src/libsodium/crypto_shorthash src/libsodium/src/libsodium/crypto_sign src/libsodium/src/libsodium/crypto_stream src/libsodium/src/libsodium/crypto_verify src/libsodium/src/libsodium/include src/libsodium/src/libsodium/randombytes src/libsodium/src/libsodium/sodium src/libsodium/src/libsodium/crypto_aead/aegis128l src/libsodium/src/libsodium/crypto_aead/aegis256 src/libsodium/src/libsodium/crypto_aead/aes256gcm src/libsodium/src/libsodium/crypto_aead/chacha20poly1305 src/libsodium/src/libsodium/crypto_aead/xchacha20poly1305 src/libsodium/src/libsodium/crypto_aead/aegis128l/aead_aegis128l.c src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_aesni.c src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_aesni.h src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.h src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_common.h src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_soft.c src/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_soft.h src/libsodium/src/libsodium/crypto_aead/aegis128l/implementations.h src/libsodium/src/libsodium/crypto_aead/aegis256/aead_aegis256.c src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_aesni.c src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_aesni.h src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.h src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_common.h src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_soft.c src/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_soft.h src/libsodium/src/libsodium/crypto_aead/aegis256/implementations.h src/libsodium/src/libsodium/crypto_aead/aes256gcm/aead_aes256gcm.c src/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni src/libsodium/src/libsodium/crypto_aead/aes256gcm/armcrypto src/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c src/libsodium/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c src/libsodium/src/libsodium/crypto_aead/chacha20poly1305/aead_chacha20poly1305.c src/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/aead_xchacha20poly1305.c src/libsodium/src/libsodium/crypto_auth/crypto_auth.c src/libsodium/src/libsodium/crypto_auth/hmacsha256 src/libsodium/src/libsodium/crypto_auth/hmacsha512 src/libsodium/src/libsodium/crypto_auth/hmacsha512256 src/libsodium/src/libsodium/crypto_auth/hmacsha256/auth_hmacsha256.c src/libsodium/src/libsodium/crypto_auth/hmacsha512/auth_hmacsha512.c src/libsodium/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256.c src/libsodium/src/libsodium/crypto_box/crypto_box.c src/libsodium/src/libsodium/crypto_box/crypto_box_easy.c src/libsodium/src/libsodium/crypto_box/crypto_box_seal.c src/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305 src/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305 src/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c src/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_seal_curve25519xchacha20poly1305.c src/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c src/libsodium/src/libsodium/crypto_core/ed25519 src/libsodium/src/libsodium/crypto_core/hchacha20 src/libsodium/src/libsodium/crypto_core/hsalsa20 src/libsodium/src/libsodium/crypto_core/salsa src/libsodium/src/libsodium/crypto_core/softaes src/libsodium/src/libsodium/crypto_core/ed25519/core_ed25519.c src/libsodium/src/libsodium/crypto_core/ed25519/core_ristretto255.c src/libsodium/src/libsodium/crypto_core/ed25519/ref10 src/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5 src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51 src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/base.h src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/base2.h src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/constants.h src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/base.h src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/base2.h src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/constants.h src/libsodium/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h src/libsodium/src/libsodium/crypto_core/hchacha20/core_hchacha20.c src/libsodium/src/libsodium/crypto_core/hsalsa20/core_hsalsa20.c src/libsodium/src/libsodium/crypto_core/hsalsa20/ref2 src/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c src/libsodium/src/libsodium/crypto_core/salsa/ref src/libsodium/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c src/libsodium/src/libsodium/crypto_core/softaes/softaes.c src/libsodium/src/libsodium/crypto_generichash/blake2b src/libsodium/src/libsodium/crypto_generichash/crypto_generichash.c src/libsodium/src/libsodium/crypto_generichash/blake2b/generichash_blake2.c src/libsodium/src/libsodium/crypto_generichash/blake2b/ref src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2.h src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.h src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.h src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.h src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-avx2.h src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-sse2.h src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-sse41.h src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/generichash_blake2b.c src/libsodium/src/libsodium/crypto_hash/crypto_hash.c src/libsodium/src/libsodium/crypto_hash/sha256 src/libsodium/src/libsodium/crypto_hash/sha512 src/libsodium/src/libsodium/crypto_hash/sha256/cp src/libsodium/src/libsodium/crypto_hash/sha256/hash_sha256.c src/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c src/libsodium/src/libsodium/crypto_hash/sha512/cp src/libsodium/src/libsodium/crypto_hash/sha512/hash_sha512.c src/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c src/libsodium/src/libsodium/crypto_kdf/blake2b src/libsodium/src/libsodium/crypto_kdf/crypto_kdf.c src/libsodium/src/libsodium/crypto_kdf/hkdf src/libsodium/src/libsodium/crypto_kdf/blake2b/kdf_blake2b.c src/libsodium/src/libsodium/crypto_kdf/hkdf/kdf_hkdf_sha256.c src/libsodium/src/libsodium/crypto_kdf/hkdf/kdf_hkdf_sha512.c src/libsodium/src/libsodium/crypto_kx/crypto_kx.c src/libsodium/src/libsodium/crypto_onetimeauth/crypto_onetimeauth.c src/libsodium/src/libsodium/crypto_onetimeauth/poly1305 src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.h src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2 src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.h src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.h src/libsodium/src/libsodium/crypto_pwhash/argon2 src/libsodium/src/libsodium/crypto_pwhash/crypto_pwhash.c src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256 src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.h src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.h src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.h src/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long.c src/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long.h src/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-avx2.h src/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-avx512f.h src/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-ref.h src/libsodium/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c src/libsodium/src/libsodium/crypto_scalarmult/crypto_scalarmult.c src/libsodium/src/libsodium/crypto_scalarmult/curve25519 src/libsodium/src/libsodium/crypto_scalarmult/ed25519 src/libsodium/src/libsodium/crypto_scalarmult/ristretto255 src/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10 src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x src/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c src/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.h src/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c src/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.h src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts.S src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts_namespace.h src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.h src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe.h src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51.h src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.h src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S src/libsodium/src/libsodium/crypto_scalarmult/ed25519/ref10 src/libsodium/src/libsodium/crypto_scalarmult/ed25519/ref10/scalarmult_ed25519_ref10.c src/libsodium/src/libsodium/crypto_scalarmult/ristretto255/ref10 src/libsodium/src/libsodium/crypto_scalarmult/ristretto255/ref10/scalarmult_ristretto255_ref10.c src/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox.c src/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c src/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305 src/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305 src/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c src/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c src/libsodium/src/libsodium/crypto_secretstream/xchacha20poly1305 src/libsodium/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c src/libsodium/src/libsodium/crypto_shorthash/crypto_shorthash.c src/libsodium/src/libsodium/crypto_shorthash/siphash24 src/libsodium/src/libsodium/crypto_shorthash/siphash24/ref src/libsodium/src/libsodium/crypto_shorthash/siphash24/shorthash_siphash24.c src/libsodium/src/libsodium/crypto_shorthash/siphash24/shorthash_siphashx24.c src/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c src/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash_ref.h src/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c src/libsodium/src/libsodium/crypto_sign/crypto_sign.c src/libsodium/src/libsodium/crypto_sign/ed25519 src/libsodium/src/libsodium/crypto_sign/ed25519/ref10 src/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519.c src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c src/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign_ed25519_ref10.h src/libsodium/src/libsodium/crypto_stream/chacha20 src/libsodium/src/libsodium/crypto_stream/crypto_stream.c src/libsodium/src/libsodium/crypto_stream/salsa20 src/libsodium/src/libsodium/crypto_stream/salsa2012 src/libsodium/src/libsodium/crypto_stream/salsa208 src/libsodium/src/libsodium/crypto_stream/xchacha20 src/libsodium/src/libsodium/crypto_stream/xsalsa20 src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau src/libsodium/src/libsodium/crypto_stream/chacha20/ref src/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.c src/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.h src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.h src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.h src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u0.h src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u1.h src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u4.h src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u8.h src/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c src/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.h src/libsodium/src/libsodium/crypto_stream/salsa20/ref src/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.c src/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.h src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6 src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int src/libsodium/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c src/libsodium/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.h src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6.c src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6.h src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.h src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.h src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u0.h src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u1.h src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u4.h src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/u8.h src/libsodium/src/libsodium/crypto_stream/salsa2012/ref src/libsodium/src/libsodium/crypto_stream/salsa2012/stream_salsa2012.c src/libsodium/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012_ref.c src/libsodium/src/libsodium/crypto_stream/salsa208/ref src/libsodium/src/libsodium/crypto_stream/salsa208/stream_salsa208.c src/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208_ref.c src/libsodium/src/libsodium/crypto_stream/xchacha20/stream_xchacha20.c src/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20.c src/libsodium/src/libsodium/crypto_verify/verify.c src/libsodium/src/libsodium/include/Makefile.am src/libsodium/src/libsodium/include/Makefile.in src/libsodium/src/libsodium/include/sodium src/libsodium/src/libsodium/include/sodium.h src/libsodium/src/libsodium/include/sodium/core.h src/libsodium/src/libsodium/include/sodium/crypto_aead_aegis128l.h src/libsodium/src/libsodium/include/sodium/crypto_aead_aegis256.h src/libsodium/src/libsodium/include/sodium/crypto_aead_aes256gcm.h src/libsodium/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h src/libsodium/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h src/libsodium/src/libsodium/include/sodium/crypto_auth.h src/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha256.h src/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha512.h src/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h src/libsodium/src/libsodium/include/sodium/crypto_box.h src/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h src/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h src/libsodium/src/libsodium/include/sodium/crypto_core_ed25519.h src/libsodium/src/libsodium/include/sodium/crypto_core_hchacha20.h src/libsodium/src/libsodium/include/sodium/crypto_core_hsalsa20.h src/libsodium/src/libsodium/include/sodium/crypto_core_ristretto255.h src/libsodium/src/libsodium/include/sodium/crypto_core_salsa20.h src/libsodium/src/libsodium/include/sodium/crypto_core_salsa2012.h src/libsodium/src/libsodium/include/sodium/crypto_core_salsa208.h src/libsodium/src/libsodium/include/sodium/crypto_generichash.h src/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h src/libsodium/src/libsodium/include/sodium/crypto_hash.h src/libsodium/src/libsodium/include/sodium/crypto_hash_sha256.h src/libsodium/src/libsodium/include/sodium/crypto_hash_sha512.h src/libsodium/src/libsodium/include/sodium/crypto_kdf.h src/libsodium/src/libsodium/include/sodium/crypto_kdf_blake2b.h src/libsodium/src/libsodium/include/sodium/crypto_kdf_hkdf_sha256.h src/libsodium/src/libsodium/include/sodium/crypto_kdf_hkdf_sha512.h src/libsodium/src/libsodium/include/sodium/crypto_kx.h src/libsodium/src/libsodium/include/sodium/crypto_onetimeauth.h src/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h src/libsodium/src/libsodium/include/sodium/crypto_pwhash.h src/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2i.h src/libsodium/src/libsodium/include/sodium/crypto_pwhash_argon2id.h src/libsodium/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h src/libsodium/src/libsodium/include/sodium/crypto_scalarmult.h src/libsodium/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h src/libsodium/src/libsodium/include/sodium/crypto_scalarmult_ed25519.h src/libsodium/src/libsodium/include/sodium/crypto_scalarmult_ristretto255.h src/libsodium/src/libsodium/include/sodium/crypto_secretbox.h src/libsodium/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h src/libsodium/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h src/libsodium/src/libsodium/include/sodium/crypto_secretstream_xchacha20poly1305.h src/libsodium/src/libsodium/include/sodium/crypto_shorthash.h src/libsodium/src/libsodium/include/sodium/crypto_shorthash_siphash24.h src/libsodium/src/libsodium/include/sodium/crypto_sign.h src/libsodium/src/libsodium/include/sodium/crypto_sign_ed25519.h src/libsodium/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h src/libsodium/src/libsodium/include/sodium/crypto_stream.h src/libsodium/src/libsodium/include/sodium/crypto_stream_chacha20.h src/libsodium/src/libsodium/include/sodium/crypto_stream_salsa20.h src/libsodium/src/libsodium/include/sodium/crypto_stream_salsa2012.h src/libsodium/src/libsodium/include/sodium/crypto_stream_salsa208.h src/libsodium/src/libsodium/include/sodium/crypto_stream_xchacha20.h src/libsodium/src/libsodium/include/sodium/crypto_stream_xsalsa20.h src/libsodium/src/libsodium/include/sodium/crypto_verify_16.h src/libsodium/src/libsodium/include/sodium/crypto_verify_32.h src/libsodium/src/libsodium/include/sodium/crypto_verify_64.h src/libsodium/src/libsodium/include/sodium/export.h src/libsodium/src/libsodium/include/sodium/private src/libsodium/src/libsodium/include/sodium/randombytes.h src/libsodium/src/libsodium/include/sodium/randombytes_internal_random.h src/libsodium/src/libsodium/include/sodium/randombytes_sysrandom.h src/libsodium/src/libsodium/include/sodium/runtime.h src/libsodium/src/libsodium/include/sodium/utils.h src/libsodium/src/libsodium/include/sodium/version.h.in src/libsodium/src/libsodium/include/sodium/private/asm_cet.h src/libsodium/src/libsodium/include/sodium/private/chacha20_ietf_ext.h src/libsodium/src/libsodium/include/sodium/private/common.h src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10.h src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h src/libsodium/src/libsodium/include/sodium/private/implementations.h src/libsodium/src/libsodium/include/sodium/private/mutex.h src/libsodium/src/libsodium/include/sodium/private/softaes.h src/libsodium/src/libsodium/include/sodium/private/sse2_64_32.h src/libsodium/src/libsodium/randombytes/internal src/libsodium/src/libsodium/randombytes/randombytes.c src/libsodium/src/libsodium/randombytes/sysrandom src/libsodium/src/libsodium/randombytes/internal/randombytes_internal_random.c src/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c src/libsodium/src/libsodium/sodium/codecs.c src/libsodium/src/libsodium/sodium/core.c src/libsodium/src/libsodium/sodium/runtime.c src/libsodium/src/libsodium/sodium/utils.c src/libsodium/src/libsodium/sodium/version.c src/libsodium/test/Makefile.am src/libsodium/test/Makefile.in src/libsodium/test/constcheck.sh src/libsodium/test/default src/libsodium/test/quirks src/libsodium/test/default/Makefile.am src/libsodium/test/default/Makefile.in src/libsodium/test/default/aead_aegis128l.c src/libsodium/test/default/aead_aegis128l.exp src/libsodium/test/default/aead_aegis256.c src/libsodium/test/default/aead_aegis256.exp src/libsodium/test/default/aead_aes256gcm.c src/libsodium/test/default/aead_aes256gcm.exp src/libsodium/test/default/aead_aes256gcm2.c src/libsodium/test/default/aead_aes256gcm2.exp src/libsodium/test/default/aead_chacha20poly1305.c src/libsodium/test/default/aead_chacha20poly1305.exp src/libsodium/test/default/aead_chacha20poly13052.c src/libsodium/test/default/aead_chacha20poly13052.exp src/libsodium/test/default/aead_xchacha20poly1305.c src/libsodium/test/default/aead_xchacha20poly1305.exp src/libsodium/test/default/auth.c src/libsodium/test/default/auth.exp src/libsodium/test/default/auth2.c src/libsodium/test/default/auth2.exp src/libsodium/test/default/auth3.c src/libsodium/test/default/auth3.exp src/libsodium/test/default/auth5.c src/libsodium/test/default/auth5.exp src/libsodium/test/default/auth6.c src/libsodium/test/default/auth6.exp src/libsodium/test/default/auth7.c src/libsodium/test/default/auth7.exp src/libsodium/test/default/box.c src/libsodium/test/default/box.exp src/libsodium/test/default/box2.c src/libsodium/test/default/box2.exp src/libsodium/test/default/box7.c src/libsodium/test/default/box7.exp src/libsodium/test/default/box8.c src/libsodium/test/default/box8.exp src/libsodium/test/default/box_easy.c src/libsodium/test/default/box_easy.exp src/libsodium/test/default/box_easy2.c src/libsodium/test/default/box_easy2.exp src/libsodium/test/default/box_seal.c src/libsodium/test/default/box_seal.exp src/libsodium/test/default/box_seed.c src/libsodium/test/default/box_seed.exp src/libsodium/test/default/chacha20.c src/libsodium/test/default/chacha20.exp src/libsodium/test/default/cmptest.h src/libsodium/test/default/codecs.c src/libsodium/test/default/codecs.exp src/libsodium/test/default/core1.c src/libsodium/test/default/core1.exp src/libsodium/test/default/core2.c src/libsodium/test/default/core2.exp src/libsodium/test/default/core3.c src/libsodium/test/default/core3.exp src/libsodium/test/default/core4.c src/libsodium/test/default/core4.exp src/libsodium/test/default/core5.c src/libsodium/test/default/core5.exp src/libsodium/test/default/core6.c src/libsodium/test/default/core6.exp src/libsodium/test/default/core_ed25519.c src/libsodium/test/default/core_ed25519.exp src/libsodium/test/default/core_ristretto255.c src/libsodium/test/default/core_ristretto255.exp src/libsodium/test/default/ed25519_convert.c src/libsodium/test/default/ed25519_convert.exp src/libsodium/test/default/generichash.c src/libsodium/test/default/generichash.exp src/libsodium/test/default/generichash2.c src/libsodium/test/default/generichash2.exp src/libsodium/test/default/generichash3.c src/libsodium/test/default/generichash3.exp src/libsodium/test/default/hash.c src/libsodium/test/default/hash.exp src/libsodium/test/default/hash3.c src/libsodium/test/default/hash3.exp src/libsodium/test/default/index.html.tpl src/libsodium/test/default/kdf.c src/libsodium/test/default/kdf.exp src/libsodium/test/default/kdf_hkdf.c src/libsodium/test/default/kdf_hkdf.exp src/libsodium/test/default/keygen.c src/libsodium/test/default/keygen.exp src/libsodium/test/default/kx.c src/libsodium/test/default/kx.exp src/libsodium/test/default/metamorphic.c src/libsodium/test/default/metamorphic.exp src/libsodium/test/default/misuse.c src/libsodium/test/default/misuse.exp src/libsodium/test/default/onetimeauth.c src/libsodium/test/default/onetimeauth.exp src/libsodium/test/default/onetimeauth2.c src/libsodium/test/default/onetimeauth2.exp src/libsodium/test/default/onetimeauth7.c src/libsodium/test/default/onetimeauth7.exp src/libsodium/test/default/pre.js.inc src/libsodium/test/default/pwhash_argon2i.c src/libsodium/test/default/pwhash_argon2i.exp src/libsodium/test/default/pwhash_argon2id.c src/libsodium/test/default/pwhash_argon2id.exp src/libsodium/test/default/pwhash_scrypt.c src/libsodium/test/default/pwhash_scrypt.exp src/libsodium/test/default/pwhash_scrypt_ll.c src/libsodium/test/default/pwhash_scrypt_ll.exp src/libsodium/test/default/randombytes.c src/libsodium/test/default/randombytes.exp src/libsodium/test/default/run.sh src/libsodium/test/default/scalarmult.c src/libsodium/test/default/scalarmult.exp src/libsodium/test/default/scalarmult2.c src/libsodium/test/default/scalarmult2.exp src/libsodium/test/default/scalarmult5.c src/libsodium/test/default/scalarmult5.exp src/libsodium/test/default/scalarmult6.c src/libsodium/test/default/scalarmult6.exp src/libsodium/test/default/scalarmult7.c src/libsodium/test/default/scalarmult7.exp src/libsodium/test/default/scalarmult8.c src/libsodium/test/default/scalarmult8.exp src/libsodium/test/default/scalarmult_ed25519.c src/libsodium/test/default/scalarmult_ed25519.exp src/libsodium/test/default/scalarmult_ristretto255.c src/libsodium/test/default/scalarmult_ristretto255.exp src/libsodium/test/default/secretbox.c src/libsodium/test/default/secretbox.exp src/libsodium/test/default/secretbox2.c src/libsodium/test/default/secretbox2.exp src/libsodium/test/default/secretbox7.c src/libsodium/test/default/secretbox7.exp src/libsodium/test/default/secretbox8.c src/libsodium/test/default/secretbox8.exp src/libsodium/test/default/secretbox_easy.c src/libsodium/test/default/secretbox_easy.exp src/libsodium/test/default/secretbox_easy2.c src/libsodium/test/default/secretbox_easy2.exp src/libsodium/test/default/secretstream_xchacha20poly1305.c src/libsodium/test/default/secretstream_xchacha20poly1305.exp src/libsodium/test/default/shorthash.c src/libsodium/test/default/shorthash.exp src/libsodium/test/default/sign.c src/libsodium/test/default/sign.exp src/libsodium/test/default/siphashx24.c src/libsodium/test/default/siphashx24.exp src/libsodium/test/default/sodium_core.c src/libsodium/test/default/sodium_core.exp src/libsodium/test/default/sodium_utils.c src/libsodium/test/default/sodium_utils.exp src/libsodium/test/default/sodium_utils2.c src/libsodium/test/default/sodium_utils2.exp src/libsodium/test/default/sodium_utils3.c src/libsodium/test/default/sodium_utils3.exp src/libsodium/test/default/sodium_version.c src/libsodium/test/default/sodium_version.exp src/libsodium/test/default/stream.c src/libsodium/test/default/stream.exp src/libsodium/test/default/stream2.c src/libsodium/test/default/stream2.exp src/libsodium/test/default/stream3.c src/libsodium/test/default/stream3.exp src/libsodium/test/default/stream4.c src/libsodium/test/default/stream4.exp src/libsodium/test/default/verify1.c src/libsodium/test/default/verify1.exp src/libsodium/test/default/wasi-test-wrapper.sh src/libsodium/test/default/wintest.bat src/libsodium/test/default/xchacha20.c src/libsodium/test/default/xchacha20.exp src/libsodium/test/quirks/quirks.h src/nacl/__init__.py src/nacl/encoding.py src/nacl/exceptions.py src/nacl/hash.py src/nacl/hashlib.py src/nacl/public.py src/nacl/py.typed src/nacl/secret.py src/nacl/signing.py src/nacl/utils.py src/nacl/bindings/__init__.py src/nacl/bindings/crypto_aead.py src/nacl/bindings/crypto_box.py src/nacl/bindings/crypto_core.py src/nacl/bindings/crypto_generichash.py src/nacl/bindings/crypto_hash.py src/nacl/bindings/crypto_kx.py src/nacl/bindings/crypto_pwhash.py src/nacl/bindings/crypto_scalarmult.py src/nacl/bindings/crypto_secretbox.py src/nacl/bindings/crypto_secretstream.py src/nacl/bindings/crypto_shorthash.py src/nacl/bindings/crypto_sign.py src/nacl/bindings/randombytes.py src/nacl/bindings/sodium_core.py src/nacl/bindings/utils.py src/nacl/pwhash/__init__.py src/nacl/pwhash/_argon2.py src/nacl/pwhash/argon2i.py src/nacl/pwhash/argon2id.py src/nacl/pwhash/scrypt.py tests/__init__.py tests/test_aead.py tests/test_bindings.py tests/test_box.py tests/test_encoding.py tests/test_exc.py tests/test_generichash.py tests/test_hash.py tests/test_hashlib_scrypt.py tests/test_kx.py tests/test_public.py tests/test_pwhash.py tests/test_sealed_box.py tests/test_secret.py tests/test_secretstream.py tests/test_shorthash.py tests/test_signing.py tests/test_utils.py tests/utils.py tests/data/aegis128l.txt tests/data/aegis256.txt tests/data/aes256gcm.txt tests/data/blake2-kat.json tests/data/box_from_seed.txt tests/data/chacha20-poly1305-agl_ref.txt tests/data/chacha20-poly1305-ietf_ref.txt tests/data/crypto-test-vectors-blake2-nosalt-nopersonalization.txt tests/data/crypto-test-vectors-blake2-salt-personalization.txt tests/data/ed25519 tests/data/modular_crypt_argon2i_hashes.json tests/data/modular_crypt_argon2id_hashes.json tests/data/raw_argon2i_hashes.json tests/data/raw_argon2id_hashes.json tests/data/sealed_box_ref.txt tests/data/secretstream-test-vectors.json tests/data/xchacha20-poly1305-ietf_ref.txt././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289397.0 pynacl-1.6.2/src/PyNaCl.egg-info/dependency_links.txt0000644000175100017510000000000115125531065022134 0ustar00runnerrunner ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289396.0 pynacl-1.6.2/src/PyNaCl.egg-info/not-zip-safe0000644000175100017510000000000115125531064020313 0ustar00runnerrunner ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289397.0 pynacl-1.6.2/src/PyNaCl.egg-info/requires.txt0000644000175100017510000000043415125531065020467 0ustar00runnerrunner [:platform_python_implementation != "PyPy" and python_version < "3.9"] cffi>=1.4.1 [:platform_python_implementation != "PyPy" and python_version >= "3.9"] cffi>=2.0.0 [docs] sphinx<7 sphinx_rtd_theme [tests] pytest>=7.4.0 pytest-cov>=2.10.1 pytest-xdist>=3.5.0 hypothesis>=3.27.0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289397.0 pynacl-1.6.2/src/PyNaCl.egg-info/top_level.txt0000644000175100017510000000001515125531065020614 0ustar00runnerrunner_sodium nacl ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.6160865 pynacl-1.6.2/src/bindings/0000755000175100017510000000000015125531066015044 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/build.py0000644000175100017510000000337615125531055016524 0ustar00runnerrunner# Copyright 2013 Donald Stufft and individual contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import glob import os.path import sys from cffi import FFI __all__ = ["ffi"] HEADERS = sorted( glob.glob(os.path.join(os.path.abspath(os.path.dirname(__file__)), "*.h")) ) MINIMAL_HEADERS = sorted( glob.glob( os.path.join( os.path.abspath(os.path.dirname(__file__)), "minimal", "*.h" ) ) ) # Build our FFI instance ffi = FFI() for header in HEADERS: with open(header) as hfile: ffi.cdef(hfile.read()) source = [] # SODIUM_STATIC controls the visibility of symbols in the headers. (see # export.h in the libsodium source tree). If you do not set SODIUM_STATIC # when linking against the static library in Windows then the compile will # fail with no symbols found. if os.getenv("PYNACL_SODIUM_STATIC") is not None: source.append("#define SODIUM_STATIC") source.append("#include ") for header in MINIMAL_HEADERS: with open(header) as hfile: source.append(hfile.read()) if sys.platform == "win32": libraries = ["libsodium"] else: libraries = ["sodium"] # Set our source so that we can actually build our bindings to sodium. ffi.set_source("_sodium", "\n".join(source), libraries=libraries) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/crypto_aead.h0000644000175100017510000002107615125531055017513 0ustar00runnerrunner/* Copyright 2017 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ size_t crypto_aead_chacha20poly1305_ietf_keybytes(void); size_t crypto_aead_chacha20poly1305_ietf_nsecbytes(void); size_t crypto_aead_chacha20poly1305_ietf_npubbytes(void); size_t crypto_aead_chacha20poly1305_ietf_abytes(void); size_t crypto_aead_chacha20poly1305_ietf_messagebytes_max(void); size_t crypto_aead_chacha20poly1305_keybytes(void); size_t crypto_aead_chacha20poly1305_nsecbytes(void); size_t crypto_aead_chacha20poly1305_npubbytes(void); size_t crypto_aead_chacha20poly1305_abytes(void); size_t crypto_aead_chacha20poly1305_messagebytes_max(void); size_t crypto_aead_xchacha20poly1305_ietf_keybytes(void); size_t crypto_aead_xchacha20poly1305_ietf_nsecbytes(void); size_t crypto_aead_xchacha20poly1305_ietf_npubbytes(void); size_t crypto_aead_xchacha20poly1305_ietf_abytes(void); size_t crypto_aead_xchacha20poly1305_ietf_messagebytes_max(void); size_t crypto_aead_aegis256_keybytes(void); size_t crypto_aead_aegis256_nsecbytes(void); size_t crypto_aead_aegis256_npubbytes(void); size_t crypto_aead_aegis256_abytes(void); size_t crypto_aead_aegis256_messagebytes_max(void); size_t crypto_aead_aegis128l_keybytes(void); size_t crypto_aead_aegis128l_nsecbytes(void); size_t crypto_aead_aegis128l_npubbytes(void); size_t crypto_aead_aegis128l_abytes(void); size_t crypto_aead_aegis128l_messagebytes_max(void); size_t crypto_aead_aes256gcm_keybytes(void); size_t crypto_aead_aes256gcm_nsecbytes(void); size_t crypto_aead_aes256gcm_npubbytes(void); size_t crypto_aead_aes256gcm_abytes(void); size_t crypto_aead_aes256gcm_messagebytes_max(void); int crypto_aead_chacha20poly1305_ietf_encrypt(unsigned char *c, unsigned long long *clen, const unsigned char *m, unsigned long long mlen, const unsigned char *ad, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, const unsigned char *k); int crypto_aead_chacha20poly1305_ietf_decrypt(unsigned char *m, unsigned long long *mlen, unsigned char *nsec, const unsigned char *c, unsigned long long clen, const unsigned char *ad, unsigned long long adlen, const unsigned char *npub, const unsigned char *k); int crypto_aead_chacha20poly1305_encrypt(unsigned char *c, unsigned long long *clen, const unsigned char *m, unsigned long long mlen, const unsigned char *ad, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, const unsigned char *k); int crypto_aead_chacha20poly1305_decrypt(unsigned char *m, unsigned long long *mlen, unsigned char *nsec, const unsigned char *c, unsigned long long clen, const unsigned char *ad, unsigned long long adlen, const unsigned char *npub, const unsigned char *k); int crypto_aead_xchacha20poly1305_ietf_encrypt(unsigned char *c, unsigned long long *clen, const unsigned char *m, unsigned long long mlen, const unsigned char *ad, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, const unsigned char *k); int crypto_aead_xchacha20poly1305_ietf_decrypt(unsigned char *m, unsigned long long *mlen, unsigned char *nsec, const unsigned char *c, unsigned long long clen, const unsigned char *ad, unsigned long long adlen, const unsigned char *npub, const unsigned char *k); int crypto_aead_aegis256_encrypt(unsigned char *c, unsigned long long *clen_p, const unsigned char *m, unsigned long long mlen, const unsigned char *ad, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, const unsigned char *k); int crypto_aead_aegis256_decrypt(unsigned char *m, unsigned long long *mlen_p, unsigned char *nsec, const unsigned char *c, unsigned long long clen, const unsigned char *ad, unsigned long long adlen, const unsigned char *npub, const unsigned char *k); int crypto_aead_aegis128l_encrypt(unsigned char *c, unsigned long long *clen_p, const unsigned char *m, unsigned long long mlen, const unsigned char *ad, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, const unsigned char *k); int crypto_aead_aegis128l_decrypt(unsigned char *m, unsigned long long *mlen_p, unsigned char *nsec, const unsigned char *c, unsigned long long clen, const unsigned char *ad, unsigned long long adlen, const unsigned char *npub, const unsigned char *k); int crypto_aead_aes256gcm_is_available(void); int crypto_aead_aes256gcm_encrypt(unsigned char *c, unsigned long long *clen_p, const unsigned char *m, unsigned long long mlen, const unsigned char *ad, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, const unsigned char *k); int crypto_aead_aes256gcm_decrypt(unsigned char *m, unsigned long long *mlen_p, unsigned char *nsec, const unsigned char *c, unsigned long long clen, const unsigned char *ad, unsigned long long adlen, const unsigned char *npub, const unsigned char *k); ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/crypto_box.h0000644000175100017510000000614615125531055017412 0ustar00runnerrunner/* Copyright 2013 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ size_t crypto_box_secretkeybytes(); size_t crypto_box_publickeybytes(); size_t crypto_box_seedbytes(); size_t crypto_box_zerobytes(); size_t crypto_box_boxzerobytes(); size_t crypto_box_noncebytes(); size_t crypto_box_beforenmbytes(); size_t crypto_box_sealbytes(); size_t crypto_box_macbytes(); int crypto_box_keypair(unsigned char *pk, unsigned char *sk); int crypto_box_seed_keypair(unsigned char *pk, unsigned char *sk, const unsigned char *seed); int crypto_box(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *pk, const unsigned char *sk); int crypto_box_open(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *pk, const unsigned char *sk); int crypto_box_beforenm(unsigned char *k, const unsigned char *pk, const unsigned char *sk); int crypto_box_afternm(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *k); int crypto_box_open_afternm(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *k); int crypto_box_seal(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *pk); int crypto_box_seal_open(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *pk, const unsigned char *sk); int crypto_box_easy_afternm(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *k); int crypto_box_easy(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *pk, const unsigned char *sk); int crypto_box_open_easy_afternm(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *k); int crypto_box_open_easy(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *pk, const unsigned char *sk); ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/crypto_core.h0000644000175100017510000000355415125531055017552 0ustar00runnerrunner/* Copyright 2017 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ static const int PYNACL_HAS_CRYPTO_CORE_ED25519; size_t crypto_core_ed25519_bytes(); size_t crypto_core_ed25519_scalarbytes(void); size_t crypto_core_ed25519_nonreducedscalarbytes(void); int crypto_core_ed25519_is_valid_point(const unsigned char *p); int crypto_core_ed25519_from_uniform(unsigned char *p, const unsigned char *r); int crypto_core_ed25519_add(unsigned char *r, const unsigned char *p, const unsigned char *q); int crypto_core_ed25519_sub(unsigned char *r, const unsigned char *p, const unsigned char *q); int crypto_core_ed25519_scalar_invert(unsigned char *recip, const unsigned char *s); void crypto_core_ed25519_scalar_negate(unsigned char *neg, const unsigned char *s); void crypto_core_ed25519_scalar_complement(unsigned char *comp, const unsigned char *s); void crypto_core_ed25519_scalar_add(unsigned char *z, const unsigned char *x, const unsigned char *y); void crypto_core_ed25519_scalar_sub(unsigned char *z, const unsigned char *x, const unsigned char *y); void crypto_core_ed25519_scalar_mul(unsigned char *z, const unsigned char *x, const unsigned char *y); void crypto_core_ed25519_scalar_reduce(unsigned char *r, const unsigned char *s); ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/crypto_generichash.h0000644000175100017510000000374415125531055021103 0ustar00runnerrunner/* Copyright 2013-2017 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // blake2b size_t crypto_generichash_blake2b_bytes_min(); size_t crypto_generichash_blake2b_bytes_max(); size_t crypto_generichash_blake2b_bytes(); size_t crypto_generichash_blake2b_keybytes_min(); size_t crypto_generichash_blake2b_keybytes_max(); size_t crypto_generichash_blake2b_keybytes(); size_t crypto_generichash_blake2b_saltbytes(); size_t crypto_generichash_blake2b_personalbytes(); size_t crypto_generichash_statebytes(); /* * We use crypto_generichash_blake2b_state * as * a pointer to a opaque buffer, * therefore the following typedef makes sense: */ typedef void crypto_generichash_blake2b_state; int crypto_generichash_blake2b_salt_personal( unsigned char *out, size_t outlen, const unsigned char *in, unsigned long long inlen, const unsigned char *key, size_t keylen, const unsigned char *salt, const unsigned char *personal); int crypto_generichash_blake2b_init_salt_personal( crypto_generichash_blake2b_state *state, const unsigned char *key, const size_t keylen, const size_t outlen, const unsigned char *salt, const unsigned char *personal); int crypto_generichash_blake2b_update( crypto_generichash_blake2b_state *state, const unsigned char *in, unsigned long long inlen); int crypto_generichash_blake2b_final( crypto_generichash_blake2b_state *state, unsigned char *out, const size_t outlen); ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/crypto_hash.h0000644000175100017510000000205115125531055017534 0ustar00runnerrunner/* Copyright 2013 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // size_t crypto_hash_bytes(); size_t crypto_hash_sha256_bytes(); size_t crypto_hash_sha512_bytes(); int crypto_hash(unsigned char *out, const unsigned char *in, unsigned long long inlen); int crypto_hash_sha256(unsigned char *out, const unsigned char *in, unsigned long long inlen); int crypto_hash_sha512(unsigned char *out, const unsigned char *in, unsigned long long inlen); ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/crypto_kx.h0000644000175100017510000000317415125531055017242 0ustar00runnerrunner/* Copyright 2018 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ size_t crypto_kx_publickeybytes(void); size_t crypto_kx_secretkeybytes(void); size_t crypto_kx_seedbytes(void); size_t crypto_kx_sessionkeybytes(void); int crypto_kx_seed_keypair(unsigned char pk[32], unsigned char sk[32], const unsigned char seed[32]); int crypto_kx_keypair(unsigned char pk[32], unsigned char sk[32]); int crypto_kx_client_session_keys(unsigned char rx[32], unsigned char tx[32], const unsigned char client_pk[32], const unsigned char client_sk[32], const unsigned char server_pk[32]); int crypto_kx_server_session_keys(unsigned char rx[32], unsigned char tx[32], const unsigned char server_pk[32], const unsigned char server_sk[32], const unsigned char client_pk[32]); ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/crypto_pwhash.h0000644000175100017510000001350415125531055020110 0ustar00runnerrunner/* Copyright 2014 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ static const int PYNACL_HAS_CRYPTO_PWHASH_SCRYPTSALSA208SHA256; size_t crypto_pwhash_scryptsalsa208sha256_saltbytes(void); size_t crypto_pwhash_scryptsalsa208sha256_strbytes(void); size_t crypto_pwhash_scryptsalsa208sha256_bytes_min(void); size_t crypto_pwhash_scryptsalsa208sha256_bytes_max(void); size_t crypto_pwhash_scryptsalsa208sha256_passwd_min(void); size_t crypto_pwhash_scryptsalsa208sha256_passwd_max(void); size_t crypto_pwhash_scryptsalsa208sha256_opslimit_min(void); size_t crypto_pwhash_scryptsalsa208sha256_opslimit_max(void); size_t crypto_pwhash_scryptsalsa208sha256_memlimit_min(void); size_t crypto_pwhash_scryptsalsa208sha256_memlimit_max(void); size_t crypto_pwhash_scryptsalsa208sha256_opslimit_interactive(void); size_t crypto_pwhash_scryptsalsa208sha256_memlimit_interactive(void); size_t crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive(void); size_t crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive(void); const char *crypto_pwhash_scryptsalsa208sha256_strprefix(void); int crypto_pwhash_scryptsalsa208sha256_ll(const uint8_t * const passwd, size_t passwdlen, const uint8_t * salt, size_t saltlen, uint64_t N, uint32_t r, uint32_t p, uint8_t * buf, size_t buflen); /* #define crypto_pwhash_scryptsalsa208sha256_STRBYTES 102 */ int crypto_pwhash_scryptsalsa208sha256_str(char out[102], const char * const passwd, unsigned long long passwdlen, unsigned long long opslimit, size_t memlimit); int crypto_pwhash_scryptsalsa208sha256_str_verify(const char str[102], const char * const passwd, unsigned long long passwdlen); /* * argon2 bindings */ /* * general argon2 limits */ size_t crypto_pwhash_strbytes(void); size_t crypto_pwhash_saltbytes(void); size_t crypto_pwhash_bytes_min(void); size_t crypto_pwhash_bytes_max(void); size_t crypto_pwhash_passwd_min(void); size_t crypto_pwhash_passwd_max(void); /* * available algorithms identifiers */ int crypto_pwhash_alg_default(void); int crypto_pwhash_alg_argon2i13(void); int crypto_pwhash_alg_argon2id13(void); /* * argon2i recommended limits */ size_t crypto_pwhash_argon2i_memlimit_interactive(void); size_t crypto_pwhash_argon2i_memlimit_moderate(void); size_t crypto_pwhash_argon2i_memlimit_sensitive(void); size_t crypto_pwhash_argon2i_memlimit_min(void); size_t crypto_pwhash_argon2i_memlimit_max(void); size_t crypto_pwhash_argon2i_opslimit_min(void); size_t crypto_pwhash_argon2i_opslimit_max(void); size_t crypto_pwhash_argon2i_opslimit_interactive(void); size_t crypto_pwhash_argon2i_opslimit_moderate(void); size_t crypto_pwhash_argon2i_opslimit_sensitive(void); /* * argon2id recommended limits */ size_t crypto_pwhash_argon2id_memlimit_interactive(void); size_t crypto_pwhash_argon2id_memlimit_moderate(void); size_t crypto_pwhash_argon2id_memlimit_sensitive(void); size_t crypto_pwhash_argon2id_memlimit_min(void); size_t crypto_pwhash_argon2id_memlimit_max(void); size_t crypto_pwhash_argon2id_opslimit_min(void); size_t crypto_pwhash_argon2id_opslimit_max(void); size_t crypto_pwhash_argon2id_opslimit_interactive(void); size_t crypto_pwhash_argon2id_opslimit_moderate(void); size_t crypto_pwhash_argon2id_opslimit_sensitive(void); /* * libsodium's default argon2 algorithm recommended limits */ size_t crypto_pwhash_memlimit_interactive(void); size_t crypto_pwhash_memlimit_moderate(void); size_t crypto_pwhash_memlimit_sensitive(void); size_t crypto_pwhash_memlimit_min(void); size_t crypto_pwhash_memlimit_max(void); size_t crypto_pwhash_opslimit_min(void); size_t crypto_pwhash_opslimit_max(void); size_t crypto_pwhash_opslimit_interactive(void); size_t crypto_pwhash_opslimit_moderate(void); size_t crypto_pwhash_opslimit_sensitive(void); /* * Modular crypt string prefix for implemented argon2 constructions */ const char *crypto_pwhash_argon2i_strprefix(void); const char *crypto_pwhash_argon2id_strprefix(void); /* * crypto_pwhash raw constructs */ int crypto_pwhash(unsigned char * const out, unsigned long long outlen, const char * const passwd, unsigned long long passwdlen, const unsigned char * const salt, unsigned long long opslimit, size_t memlimit, int alg); /* * #define crypto_pwhash_argon2i_STRBYTES 128U * #define crypto_pwhash_STRBYTES crypto_pwhash_argon2i_STRBYTES */ int crypto_pwhash_str_alg(char out[128], const char * const passwd, unsigned long long passwdlen, unsigned long long opslimit, size_t memlimit, int alg); int crypto_pwhash_str_verify(const char str[128], const char * const passwd, unsigned long long passwdlen); int crypto_pwhash_str_needs_rehash(const char str[128], unsigned long long opslimit, size_t memlimit); ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/crypto_scalarmult.h0000644000175100017510000000257315125531055020771 0ustar00runnerrunner/* Copyright 2013 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ static const int PYNACL_HAS_CRYPTO_SCALARMULT_ED25519; size_t crypto_scalarmult_bytes(); size_t crypto_scalarmult_scalarbytes(); size_t crypto_scalarmult_ed25519_bytes(); size_t crypto_scalarmult_ed25519_scalarbytes(); int crypto_scalarmult_base(unsigned char *q, const unsigned char *n); int crypto_scalarmult(unsigned char *q, const unsigned char *n, const unsigned char *p); int crypto_scalarmult_ed25519(unsigned char *q, const unsigned char *n, const unsigned char *p); int crypto_scalarmult_ed25519_base(unsigned char *q, const unsigned char *n); int crypto_scalarmult_ed25519_noclamp(unsigned char *q, const unsigned char *n, const unsigned char *p); int crypto_scalarmult_ed25519_base_noclamp(unsigned char *q, const unsigned char *n); ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/crypto_secretbox.h0000644000175100017510000000314115125531055020610 0ustar00runnerrunner/* Copyright 2013 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ size_t crypto_secretbox_keybytes(); size_t crypto_secretbox_noncebytes(); size_t crypto_secretbox_zerobytes(); size_t crypto_secretbox_boxzerobytes(); size_t crypto_secretbox_macbytes(); size_t crypto_secretbox_messagebytes_max(); int crypto_secretbox(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *k); int crypto_secretbox_open(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *k); int crypto_secretbox_easy(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *k); int crypto_secretbox_open_easy(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *k); ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/crypto_secretstream.h0000644000175100017510000000471515125531055021323 0ustar00runnerrunner/* Copyright 2013-2018 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ size_t crypto_secretstream_xchacha20poly1305_abytes(void); size_t crypto_secretstream_xchacha20poly1305_headerbytes(void); size_t crypto_secretstream_xchacha20poly1305_keybytes(void); size_t crypto_secretstream_xchacha20poly1305_messagebytes_max(void); unsigned char crypto_secretstream_xchacha20poly1305_tag_message(void); unsigned char crypto_secretstream_xchacha20poly1305_tag_push(void); unsigned char crypto_secretstream_xchacha20poly1305_tag_rekey(void); unsigned char crypto_secretstream_xchacha20poly1305_tag_final(void); /* * We use crypto_secretstream_xchacha20poly1305_state * as * a pointer to an opaque buffer, * therefore the following typedef makes sense: */ typedef void crypto_secretstream_xchacha20poly1305_state; size_t crypto_secretstream_xchacha20poly1305_statebytes(void); void crypto_secretstream_xchacha20poly1305_keygen (unsigned char *k); int crypto_secretstream_xchacha20poly1305_init_push (crypto_secretstream_xchacha20poly1305_state *state, unsigned char *header, const unsigned char *k); int crypto_secretstream_xchacha20poly1305_push (crypto_secretstream_xchacha20poly1305_state *state, unsigned char *c, unsigned long long *clen_p, const unsigned char *m, unsigned long long mlen, const unsigned char *ad, unsigned long long adlen, unsigned char tag); int crypto_secretstream_xchacha20poly1305_init_pull (crypto_secretstream_xchacha20poly1305_state *state, const unsigned char *header, const unsigned char *k); int crypto_secretstream_xchacha20poly1305_pull (crypto_secretstream_xchacha20poly1305_state *state, unsigned char *m, unsigned long long *mlen_p, unsigned char *tag_p, const unsigned char *c, unsigned long long clen, const unsigned char *ad, unsigned long long adlen); void crypto_secretstream_xchacha20poly1305_rekey (crypto_secretstream_xchacha20poly1305_state *state); ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/crypto_shorthash.h0000644000175100017510000000227315125531055020622 0ustar00runnerrunner/* Copyright 2013 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ static const int PYNACL_HAS_CRYPTO_SHORTHASH_SIPHASHX24; // size_t crypto_hash_bytes(); size_t crypto_shorthash_siphash24_bytes(); size_t crypto_shorthash_siphash24_keybytes(); int crypto_shorthash_siphash24(unsigned char *out, const unsigned char *in, unsigned long long inlen, const unsigned char *k); size_t crypto_shorthash_siphashx24_bytes(); size_t crypto_shorthash_siphashx24_keybytes(); int crypto_shorthash_siphashx24(unsigned char *out, const unsigned char *in, unsigned long long inlen, const unsigned char *k); ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/crypto_sign.h0000644000175100017510000000466115125531055017562 0ustar00runnerrunner/* Copyright 2013 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ size_t crypto_sign_bytes(); // size_t crypto_sign_seedbytes(); size_t crypto_sign_publickeybytes(); size_t crypto_sign_secretkeybytes(); size_t crypto_sign_ed25519ph_statebytes(); int crypto_sign_keypair(unsigned char *pk, unsigned char *sk); int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk, const unsigned char *seed); int crypto_sign(unsigned char *sm, unsigned long long *smlen, const unsigned char *m, unsigned long long mlen, const unsigned char *sk); int crypto_sign_open(unsigned char *m, unsigned long long *mlen, const unsigned char *sm, unsigned long long smlen, const unsigned char *pk); int crypto_sign_ed25519_pk_to_curve25519(unsigned char *curve25519_pk, const unsigned char *ed25519_pk); int crypto_sign_ed25519_sk_to_curve25519(unsigned char *curve25519_sk, const unsigned char *ed25519_sk); /* * We use crypto_sign_ed25519ph_state * as * a pointer to a opaque buffer, * therefore the following typedef makes sense: */ typedef void crypto_sign_ed25519ph_state; int crypto_sign_ed25519ph_init(crypto_sign_ed25519ph_state *state); int crypto_sign_ed25519ph_update(crypto_sign_ed25519ph_state *state, const unsigned char *m, unsigned long long mlen); int crypto_sign_ed25519ph_final_create(crypto_sign_ed25519ph_state *state, unsigned char *sig, unsigned long long *siglen_p, const unsigned char *sk); int crypto_sign_ed25519ph_final_verify(crypto_sign_ed25519ph_state *state, unsigned char *sig, const unsigned char *pk); ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.6160865 pynacl-1.6.2/src/bindings/minimal/0000755000175100017510000000000015125531066016472 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/minimal/crypto_core.h0000644000175100017510000000410515125531055021171 0ustar00runnerrunner/* Copyright 2020 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef SODIUM_LIBRARY_MINIMAL static const int PYNACL_HAS_CRYPTO_CORE_ED25519 = 0; size_t (*crypto_core_ed25519_bytes)() = NULL; size_t (*crypto_core_ed25519_scalarbytes)(void) = NULL; size_t (*crypto_core_ed25519_nonreducedscalarbytes)(void) = NULL; int (*crypto_core_ed25519_is_valid_point)(const unsigned char *) = NULL; int (*crypto_core_ed25519_from_uniform)(unsigned char *p, const unsigned char *r) = NULL; int (*crypto_core_ed25519_add)(unsigned char *, const unsigned char *, const unsigned char *) = NULL; int (*crypto_core_ed25519_sub)(unsigned char *, const unsigned char *, const unsigned char *) = NULL; int (*crypto_core_ed25519_scalar_invert)(unsigned char *, const unsigned char *) = NULL; void (*crypto_core_ed25519_scalar_negate)(unsigned char *, const unsigned char *) = NULL; void (*crypto_core_ed25519_scalar_complement)(unsigned char *, const unsigned char *) = NULL; void (*crypto_core_ed25519_scalar_add)(unsigned char *, const unsigned char *, const unsigned char *) = NULL; void (*crypto_core_ed25519_scalar_sub)(unsigned char *, const unsigned char *, const unsigned char *) = NULL; void (*crypto_core_ed25519_scalar_mul)(unsigned char *, const unsigned char *, const unsigned char *) = NULL; void (*crypto_core_ed25519_scalar_reduce)(unsigned char *, const unsigned char *) = NULL; #else static const int PYNACL_HAS_CRYPTO_CORE_ED25519 = 1; #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/minimal/crypto_pwhash.h0000644000175100017510000000551715125531055021543 0ustar00runnerrunner/* Copyright 2020 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef SODIUM_LIBRARY_MINIMAL static const int PYNACL_HAS_CRYPTO_PWHASH_SCRYPTSALSA208SHA256 = 0; size_t (*crypto_pwhash_scryptsalsa208sha256_saltbytes)(void) = NULL; size_t (*crypto_pwhash_scryptsalsa208sha256_strbytes)(void) = NULL; size_t (*crypto_pwhash_scryptsalsa208sha256_bytes_min)(void) = NULL; size_t (*crypto_pwhash_scryptsalsa208sha256_bytes_max)(void) = NULL; size_t (*crypto_pwhash_scryptsalsa208sha256_passwd_min)(void) = NULL; size_t (*crypto_pwhash_scryptsalsa208sha256_passwd_max)(void) = NULL; size_t (*crypto_pwhash_scryptsalsa208sha256_opslimit_min)(void) = NULL; size_t (*crypto_pwhash_scryptsalsa208sha256_opslimit_max)(void) = NULL; size_t (*crypto_pwhash_scryptsalsa208sha256_memlimit_min)(void) = NULL; size_t (*crypto_pwhash_scryptsalsa208sha256_memlimit_max)(void) = NULL; size_t (*crypto_pwhash_scryptsalsa208sha256_opslimit_interactive)(void) = NULL; size_t (*crypto_pwhash_scryptsalsa208sha256_memlimit_interactive)(void) = NULL; size_t (*crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive)(void) = NULL; size_t (*crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive)(void) = NULL; const char *(*crypto_pwhash_scryptsalsa208sha256_strprefix)(void) = NULL; int (*crypto_pwhash_scryptsalsa208sha256_ll)(const uint8_t * const, size_t, const uint8_t *, size_t, uint64_t, uint32_t, uint32_t, uint8_t *, size_t) = NULL; /* #define crypto_pwhash_scryptsalsa208sha256_STRBYTES 102 */ int (*crypto_pwhash_scryptsalsa208sha256_str)(char [102], const char * const, unsigned long long, unsigned long long, size_t) = NULL; int (*crypto_pwhash_scryptsalsa208sha256_str_verify)(const char [102], const char * const, unsigned long long) = NULL; #else static const int PYNACL_HAS_CRYPTO_PWHASH_SCRYPTSALSA208SHA256 = 1; #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/minimal/crypto_scalarmult.h0000644000175100017510000000246115125531055022413 0ustar00runnerrunner/* Copyright 2020 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef SODIUM_LIBRARY_MINIMAL static const int PYNACL_HAS_CRYPTO_SCALARMULT_ED25519 = 0; size_t (*crypto_scalarmult_ed25519_bytes)() = NULL; size_t (*crypto_scalarmult_ed25519_scalarbytes)() = NULL; int (*crypto_scalarmult_ed25519)(unsigned char *, const unsigned char *, const unsigned char *) = NULL; int (*crypto_scalarmult_ed25519_base)(unsigned char *, const unsigned char *) = NULL; int (*crypto_scalarmult_ed25519_noclamp)(unsigned char *, const unsigned char *, const unsigned char *) = NULL; int (*crypto_scalarmult_ed25519_base_noclamp)(unsigned char *, const unsigned char *) = NULL; #else static const int PYNACL_HAS_CRYPTO_SCALARMULT_ED25519 = 1; #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/minimal/crypto_shorthash.h0000644000175100017510000000204215125531055022242 0ustar00runnerrunner/* Copyright 2020 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef SODIUM_LIBRARY_MINIMAL static const int PYNACL_HAS_CRYPTO_SHORTHASH_SIPHASHX24 = 0; size_t (*crypto_shorthash_siphashx24_bytes)() = NULL; size_t (*crypto_shorthash_siphashx24_keybytes)() = NULL; int (*crypto_shorthash_siphashx24)(unsigned char *, const unsigned char *, unsigned long long, const unsigned char *) = NULL; #else static const int PYNACL_HAS_CRYPTO_SHORTHASH_SIPHASHX24 = 1; #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/randombytes.h0000644000175100017510000000150115125531055017537 0ustar00runnerrunner/* Copyright 2013 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ size_t randombytes_seedbytes(); void randombytes(unsigned char * const buf, const unsigned long long buf_len); void randombytes_buf_deterministic(void * const buf, const size_t size, const unsigned char seed[32]);././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/sodium_core.h0000644000175100017510000000117615125531055017530 0ustar00runnerrunner/* Copyright 2013 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ int sodium_init(); ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/bindings/utils.h0000644000175100017510000000236715125531055016363 0ustar00runnerrunner/* Copyright 2013-2017 Donald Stufft and individual contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ void sodium_memzero(void * const pnt, const size_t len); int sodium_memcmp(const void * const b1_, const void * const b2_, size_t len); int sodium_mlock(void * const addr, const size_t len); int sodium_munlock(void * const addr, const size_t len); int sodium_pad(size_t *padded_buflen_p, unsigned char *buf, size_t unpadded_buflen, size_t blocksize, size_t max_buflen); int sodium_unpad(size_t *unpadded_buflen_p, const unsigned char *buf, size_t padded_buflen, size_t blocksize); void sodium_increment(unsigned char *n, const size_t nlen); void sodium_add(unsigned char *a, unsigned char *b, const size_t len); ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.6210866 pynacl-1.6.2/src/libsodium/0000755000175100017510000000000015125531066015236 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.5880866 pynacl-1.6.2/src/libsodium/.github/0000755000175100017510000000000015125531066016576 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.6220865 pynacl-1.6.2/src/libsodium/.github/workflows/0000755000175100017510000000000015125531066020633 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/.github/workflows/autocloser.yml0000644000175100017510000000125515125531055023537 0ustar00runnerrunnername: Autocloser on: [issues] jobs: autoclose: runs-on: ubuntu-latest steps: - name: Autoclose issues that did not follow issue template uses: roots/issue-closer@v1.2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} issue-close-message: "This issue was automatically closed because it did not follow the issue template. We use the issue tracker exclusively for bug reports and feature additions that have been previously discussed. However, this issue appears to be a support request. Please use the discussion forums for support requests." issue-pattern: ".*(do we replicate the issue|Expected behavior|raised as discussion|# Impact).*" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/.github/workflows/ci.yml0000644000175100017510000001402615125531055021752 0ustar00runnerrunnername: CI on: push: branches: [master, stable, next] pull_request: branches: [master, stable, next] workflow_dispatch: jobs: tcc: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Update packages list run: sudo apt-get update - name: Install dependencies run: | sudo apt-get install -y build-essential libtool autoconf automake tcc - name: Autogen run: ./autogen.sh -s - name: Compilation with tcc run: | env CC=tcc CFLAGS='-w' CPPFLAGS="-DDEV_MODE=1" ./configure --prefix=/tmp --disable-dependency-tracking --disable-shared || cat config.log make -j $(nproc) && make check && make install env CC=tcc CPPFLAGS='-I/tmp/include' LDFLAGS='-L/tmp/lib' LD_LIBRARY_PATH='/tmp/lib' ./test/constcheck.sh make uninstall make distclean zig: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Update packages list run: sudo apt-get update - name: Install Zig uses: mlugg/setup-zig@v2 with: version: 0.15.2 - name: Autogen run: ./autogen.sh -s - name: Compilation with zig run: | zig build zig build -Dtarget=x86_64-linux zig build -Dtarget=aarch64-linux zig build -Dtarget=x86-windows zig build -Dtarget=x86_64-windows zig build -Dtarget=aarch64-windows zig build -Dtarget=x86_64-macos zig build -Dtarget=aarch64-macos zig build -Dtarget=wasm32-wasi zig build -Doptimize=ReleaseFast rm -fr zig-cache zig-out regular: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Update packages list run: sudo apt-get update - name: Install dependencies run: sudo apt-get install -y build-essential libtool autoconf automake - name: Autogen run: ./autogen.sh -s - name: C99 compat check run: | env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking make -j $(nproc) CFLAGS='-g0' > /dev/null && cp src/libsodium/.libs/libsodium.so lib.so && make clean > /dev/null && make CFLAGS='-g0' CPPFLAGS='-DDEV_MODE=1 -DSODIUM_C99\(X\)=' > /dev/null && cp src/libsodium/.libs/libsodium.so lib-oldc.so && cmp lib.so lib-oldc.so && echo No binary changes && make clean > /dev/null make distcheck make distclean > /dev/null - name: Regular compilation run: | env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking --enable-minimal make -j $(nproc) make check ( echo '#include ' ; echo 'int main(void) { return sodium_init(); }' ) > /tmp/main.c && gcc -DDEV_MODE=1 -Isrc/libsodium/include -Isrc/libsodium/include/sodium $(find src -name '*.c' -o -name '*.S') /tmp/main.c make distclean > /dev/null check-globals: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Update packages list run: sudo apt-get update - name: Install dependencies run: sudo apt-get install -y build-essential libtool autoconf automake - name: Autogen run: ./autogen.sh -s - name: Check globals run: | if [ -x test/rename-globals.sh ]; then test/rename-globals.sh; fi other-comp: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Update packages list run: sudo apt-get update - name: Install dependencies run: sudo apt-get install -y build-essential libtool autoconf automake clang - name: Autogen run: ./autogen.sh -s - name: Compilation with g++ run: | env CC=g++ CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking make -j $(nproc) check make clean > /dev/null - name: Compilation with clang run: | env CC=clang CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking make -j $(nproc) check make clean > /dev/null other-arch: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Update packages list run: sudo apt-get update - name: Install dependencies run: sudo apt-get install -y build-essential libtool autoconf automake gcc-powerpc-linux-gnu - name: Autogen run: ./autogen.sh -s - name: Big-Endian PowerPC compilation run: | env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking --host=powerpc-linux-gnu make -j $(nproc) make clean > /dev/null wasi: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Install Zig uses: mlugg/setup-zig@v2 with: version: master - name: Install Wasmer uses: wasmerio/setup-wasmer@v3.1 - name: Build for wasi-core run: zig build -Dtarget=wasm32-wasi -Doptimize=ReleaseSafe - name: Run tests with Wasmer run: | cd zig-out/bin failed=0 for wasm in *.wasm; do name="${wasm%.wasm}" echo "[$name]" if ! wasmer run "$wasm" --mapdir=./:. 2>&1; then echo "*** [$name] FAILED" >&2 failed=1 fi done exit $failed android: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Update packages list run: sudo apt-get update - name: Install base dependencies run: sudo apt-get install -y libtool autoconf automake unzip - name: Autogen run: ./autogen.sh -s - name: Install Android NDK run: | mkdir /tmp/android && cd /tmp/android curl -o ndk.zip -L https://dl.google.com/android/repository/android-ndk-r29-linux.zip unzip ndk.zip && rm -f *.zip && mv android-ndk* ndk - name: Android compilation run: | env ANDROID_NDK_HOME=/tmp/android/ndk ./dist-build/android-aar.sh ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/.github/workflows/cifuzz.yml0000644000175100017510000000145415125531055022672 0ustar00runnerrunnername: CIFuzz on: push: branches: [stable, next] pull_request: branches: [stable, next] jobs: Fuzzing: runs-on: ubuntu-latest steps: - name: Build Fuzzers id: build uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master with: oss-fuzz-project-name: "libsodium" dry-run: false language: c++ - name: Run Fuzzers uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master with: oss-fuzz-project-name: "libsodium" fuzz-seconds: 300 dry-run: false language: c++ - name: Upload Crash uses: actions/upload-artifact@v4 if: failure() && steps.build.outcome == 'success' with: name: artifacts path: ./out/artifacts ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/.github/workflows/codeql-analysis.yml0000644000175100017510000000230215125531055024441 0ustar00runnerrunnername: "CodeQL scan" on: push: branches: [ "master stable next" ] pull_request: # The branches below must be a subset of the branches above branches: [ "master stable next" ] schedule: - cron: '0 17 * * 2' jobs: analyze: name: Analyze runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} permissions: actions: read contents: read security-events: write strategy: fail-fast: false matrix: language: [ 'c-cpp' ] steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} - run: | echo "Run, Build Application using script" ./autogen.sh -s env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking make -j $(nproc) check - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 with: category: "/language:${{matrix.language}}" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/.github/workflows/dotnet-core.yml0000644000175100017510000003257215125531055023610 0ustar00runnerrunnername: .NET Package on: push: branches: - stable - next permissions: id-token: write attestations: write contents: read jobs: build-windows-msvc: runs-on: windows-latest steps: - uses: actions/checkout@v4 - name: buildbase.bat run: buildbase.bat ..\vs2022\libsodium.sln 17 working-directory: builds/msvc/build/ shell: cmd - uses: actions/upload-artifact@v4 with: name: build-win-x64 path: bin/x64/Release/v143/dynamic/libsodium.dll - uses: actions/upload-artifact@v4 with: name: build-win-x86 path: bin/Win32/Release/v143/dynamic/libsodium.dll - uses: actions/upload-artifact@v4 with: name: build-win-arm64 path: bin/ARM64/Release/v143/dynamic/libsodium.dll build-others: runs-on: ubuntu-latest steps: - name: Install Zig uses: mlugg/setup-zig@v2 with: version: master - uses: actions/checkout@v4 - name: Build Android AAR run: sh ./dist-build/android-aar.sh - name: Extract android AAR file run: | mkdir -p extracted-aar unzip libsodium-*.aar -d extracted-aar - name: Upload Android arm64 uses: actions/upload-artifact@v4 with: name: build-android-arm64 path: extracted-aar/prefab/modules/sodium/libs/android.arm64-v8a/libsodium.so - name: Upload Android arm uses: actions/upload-artifact@v4 with: name: build-android-arm path: extracted-aar/prefab/modules/sodium/libs/android.armeabi-v7a/libsodium.so - name: Upload Android x64 uses: actions/upload-artifact@v4 with: name: build-android-x64 path: extracted-aar/prefab/modules/sodium/libs/android.x86_64/libsodium.so - name: Upload Android x86 uses: actions/upload-artifact@v4 with: name: build-android-x86 path: extracted-aar/prefab/modules/sodium/libs/android.x86/libsodium.so - name: build-linux-x64 run: | rm -fr zig-out .zig-cache; zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux-gnu.2.17 - name: tests run: cd zig-out/bin && ./run.sh - uses: actions/upload-artifact@v4 with: name: build-linux-x64 path: zig-out/lib/libsodium.so - name: Set up arm and aarch64 emulation environment run: | export DEBIAN_FRONTEND=noninteractive sudo apt-get update sudo apt-get install -y build-essential qemu-system binfmt-support qemu-user-static qemu-system-arm gcc-arm-linux-gnueabihf libc6-armhf-cross gcc-aarch64-linux-gnu libc6-arm64-cross sudo dpkg --add-architecture armhf sudo update-binfmts --enable qemu-arm sudo update-binfmts --display sudo ln -s /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.* /lib sudo dpkg --add-architecture arm64 sudo update-binfmts --enable qemu-aarch64 sudo update-binfmts --display sudo ln -s /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.* /lib - name: build-linux-arm run: | rm -fr zig-out .zig-cache; zig build -Doptimize=ReleaseFast -Dtarget=arm-linux-gnueabihf.2.23 - name: tests run: | cd zig-out/bin && env LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib ./run.sh - uses: actions/upload-artifact@v4 with: name: build-linux-arm path: zig-out/lib/libsodium.so - name: build-linux-arm64 run: | rm -fr zig-out .zig-cache; zig build -Doptimize=ReleaseFast -Dtarget=aarch64-linux-gnu.2.23 - name: tests run: | cd zig-out/bin && env LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib ./run.sh - uses: actions/upload-artifact@v4 with: name: build-linux-arm64 path: zig-out/lib/libsodium.so - name: build-linux-musl-x64 run: | rm -fr zig-out .zig-cache; zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux-musl - uses: actions/upload-artifact@v4 with: name: build-linux-musl-x64 path: zig-out/lib/libsodium.so - name: build-linux-musl-arm run: | rm -fr zig-out .zig-cache; zig build -Doptimize=ReleaseFast -Dtarget=arm-linux-musleabihf - uses: actions/upload-artifact@v4 with: name: build-linux-musl-arm path: zig-out/lib/libsodium.so - name: build-linux-musl-arm64 run: | rm -fr zig-out .zig-cache; zig build -Doptimize=ReleaseFast -Dtarget=aarch64-linux-musl - uses: actions/upload-artifact@v4 with: name: build-linux-musl-arm64 path: zig-out/lib/libsodium.so build-apple: runs-on: macos-latest steps: - uses: actions/checkout@v4 - name: configure run: ./configure - name: build-xcframework run: env LIBSODIUM_FULL_BUILD=1 LIBSODIUM_SKIP_SIMULATORS=1 dist-build/apple-xcframework.sh - uses: actions/upload-artifact@v4 with: name: build-macos path: libsodium-apple/macos/lib/libsodium.dylib - uses: actions/upload-artifact@v4 with: name: build-ios path: libsodium-apple/ios/lib/libsodium.a - uses: actions/upload-artifact@v4 with: name: build-tvos path: libsodium-apple/tvos/lib/libsodium.a - uses: actions/upload-artifact@v4 with: name: build-maccatalyst path: libsodium-apple/catalyst/lib/libsodium.a pack: runs-on: ubuntu-latest needs: - build-windows-msvc - build-apple - build-others container: image: mcr.microsoft.com/dotnet/sdk:6.0 env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: name: build-win-x64 path: .libsodium-pack/runtimes/win-x64/native/ - uses: actions/download-artifact@v4 with: name: build-win-x86 path: .libsodium-pack/runtimes/win-x86/native/ - uses: actions/download-artifact@v4 with: name: build-win-arm64 path: .libsodium-pack/runtimes/win-arm64/native/ - uses: actions/download-artifact@v4 with: name: build-linux-x64 path: .libsodium-pack/runtimes/linux-x64/native/ - uses: actions/download-artifact@v4 with: name: build-linux-arm64 path: .libsodium-pack/runtimes/linux-arm64/native/ - uses: actions/download-artifact@v4 with: name: build-linux-arm path: .libsodium-pack/runtimes/linux-arm/native/ - uses: actions/download-artifact@v4 with: name: build-linux-musl-x64 path: .libsodium-pack/runtimes/linux-musl-x64/native/ - uses: actions/download-artifact@v4 with: name: build-linux-musl-arm path: .libsodium-pack/runtimes/linux-musl-arm/native/ - uses: actions/download-artifact@v4 with: name: build-linux-musl-arm64 path: .libsodium-pack/runtimes/linux-musl-arm64/native/ - uses: actions/download-artifact@v4 with: name: build-macos path: .libsodium-pack/runtimes/osx-x64/native/ - uses: actions/download-artifact@v4 with: name: build-macos path: .libsodium-pack/runtimes/osx-arm64/native/ - uses: actions/download-artifact@v4 with: name: build-ios path: .libsodium-pack/runtimes/ios-arm64/native/ - uses: actions/download-artifact@v4 with: name: build-tvos path: .libsodium-pack/runtimes/tvos-arm64/native/ - uses: actions/download-artifact@v4 with: name: build-maccatalyst path: .libsodium-pack/runtimes/maccatalyst-x64/native/ - uses: actions/download-artifact@v4 with: name: build-maccatalyst path: .libsodium-pack/runtimes/maccatalyst-arm64/native/ - uses: actions/download-artifact@v4 with: name: build-android-arm64 path: .libsodium-pack/runtimes/android-arm64/native/ - uses: actions/download-artifact@v4 with: name: build-android-arm path: .libsodium-pack/runtimes/android-arm/native/ - uses: actions/download-artifact@v4 with: name: build-android-x64 path: .libsodium-pack/runtimes/android-x64/native/ - uses: actions/download-artifact@v4 with: name: build-android-x86 path: .libsodium-pack/runtimes/android-x86/native/ - name: Copy files run: cp AUTHORS ChangeLog LICENSE packaging/dotnet-core/libsodium.pkgproj .libsodium-pack/ - name: Create NuGet package run: dotnet pack -c Release .libsodium-pack/libsodium.pkgproj - uses: actions/upload-artifact@v4 with: name: nuget-package path: .libsodium-pack/bin/Release/*.nupkg - name: Attest Build Provenance uses: actions/attest-build-provenance@897ed5eab6ed058a474202017ada7f40bfa52940 with: subject-path: .libsodium-pack/bin/Release/*.nupkg build-test-binaries: runs-on: ubuntu-latest needs: - pack container: image: mcr.microsoft.com/dotnet/sdk:6.0 env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: name: nuget-package path: .libsodium-pack/ - name: dotnet new run: dotnet new console -n Tests -o .libsodium-test/ - name: dotnet add package libsodium run: dotnet add .libsodium-test/Tests.csproj package libsodium -s $PWD/.libsodium-pack - name: Copy files run: cp -f packaging/dotnet-core/test.cs .libsodium-test/Program.cs - name: dotnet publish linux-x64 run: dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishTrimmed=true working-directory: .libsodium-test/ - name: dotnet publish linux-arm run: dotnet publish -c Release -r linux-arm --self-contained true -p:PublishTrimmed=true working-directory: .libsodium-test/ - name: dotnet publish linux-arm64 run: dotnet publish -c Release -r linux-arm64 --self-contained true -p:PublishTrimmed=true working-directory: .libsodium-test/ - name: Move Build Output run: | mkdir .libsodium-builds mv .libsodium-test/bin/Release/net6.0/linux-arm/publish .libsodium-builds/linux-arm mv .libsodium-test/bin/Release/net6.0/linux-arm64/publish .libsodium-builds/linux-arm64 mv .libsodium-test/bin/Release/net6.0/linux-x64/publish .libsodium-builds/linux-x64 - uses: actions/upload-artifact@v4 with: name: test-builds path: .libsodium-builds/* include-hidden-files: true run-test-binaries-os-versions: runs-on: ubuntu-latest needs: - build-test-binaries strategy: matrix: arch: [ 'centos:8', 'debian:10' ] container: image: ${{ matrix.arch }} env: DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 steps: - uses: actions/download-artifact@v4 with: name: test-builds path: .libsodium-builds/ - name: Run x64 tests run: | chmod +x .libsodium-builds/linux-x64/Tests .libsodium-builds/linux-x64/Tests run-test-binaries-cross-plat: runs-on: ubuntu-22.04 needs: - build-test-binaries env: DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 strategy: matrix: include: - arch: x64 libs: /usr/lib - arch: arm libs: /usr/arm-linux-gnueabihf/lib - arch: arm64 libs: /usr/aarch64-linux-gnu/lib arch: [x64, arm, arm64] steps: - name: Set up build environment run: | export DEBIAN_FRONTEND=noninteractive # On virtualization systems such as the one used by WSL2, the ARM crypto extensions # don't work as expected. As a result, installing on Ubuntu fails during integrity # checks. As a workaround, the following command disables hardware acceleration for # gcrypt, which the apt-get command relies on. sudo mkdir -p /etc/gcrypt && echo all | sudo tee /etc/gcrypt/hwf.deny sudo apt-get update && sudo apt-get install -y qemu-system binfmt-support qemu-user-static qemu-system-arm gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu libc6-armhf-cross libc6-arm64-cross sudo dpkg --add-architecture armhf sudo dpkg --add-architecture arm64 sudo update-binfmts --enable qemu-aarch64 sudo update-binfmts --enable qemu-arm sudo update-binfmts --display sudo ln -s /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.* /lib sudo ln -s /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.* /lib - uses: actions/download-artifact@v4 with: name: test-builds path: .libsodium-builds/ - name: Run ${{ matrix.arch }} run: | chmod +x .libsodium-builds/linux-${{ matrix.arch }}/Tests env LD_LIBRARY_PATH=${{ matrix.libs }} .libsodium-builds/linux-${{ matrix.arch }}/Tests ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/.gitignore0000644000175100017510000000572115125531055017231 0ustar00runnerrunner!build .deps .dirstamp .done .DS_Store .libs .zig-cache *.bc *.done *.dSYM *.final *.gcda *.gcno *.i *.la *.lo *.log *.mem *.nexe *.o *.plist *.scan *.sdf *.status *.tar.* *.vs/ *.wasm *.wast *~ /bin/ /obj/ aclocal.m4 android-toolchain android-toolchain-* autom4te.cache build Build compile confdefs.h config.* configure configure.lineno coverage.info depcomp INSTALL install-sh libsodium-*.tar.bz2 libsodium-*.tar.gz libsodium-*.vcproj libsodium-*.vcproj.filters libsodium-*.vcxproj libsodium-*.vcxproj.filters libsodium-android-* libsodium-ios libsodium-js libsodium-js-* libsodium-nativeclient libsodium-nativeclient-* libsodium-osx libsodium-uninstalled.pc libsodium-wasm32-wasi libsodium-win32 libsodium-win64 libsodium.pc libtool ltmain.sh m4/argz.m4 m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 Makefile Makefile.in man/*.html man/Makefile.in missing src/libsodium/*.def src/libsodium/include/sodium/version.h stamp-* test-driver test/default/*.asm.js test/default/*.res test/default/*.trs test/default/aead_aegis128l test/default/aead_aegis256 test/default/aead_aes256gcm test/default/aead_aes256gcm2 test/default/aead_chacha20poly1305 test/default/aead_chacha20poly13052 test/default/aead_xchacha20poly1305 test/default/auth test/default/auth2 test/default/auth3 test/default/auth5 test/default/auth6 test/default/auth7 test/default/box test/default/box_easy test/default/box_easy2 test/default/box_seal test/default/box_seed test/default/box2 test/default/box7 test/default/box8 test/default/browser test/default/chacha20 test/default/codecs test/default/core_ed25519 test/default/core_ristretto255 test/default/core1 test/default/core2 test/default/core3 test/default/core4 test/default/core5 test/default/core6 test/default/ed25519_convert test/default/generichash test/default/generichash2 test/default/generichash3 test/default/hash test/default/hash3 test/default/kdf test/default/kdf_hkdf test/default/keygen test/default/kx test/default/metamorphic test/default/misuse test/default/onetimeauth test/default/onetimeauth2 test/default/onetimeauth7 test/default/pwhash_argon2i test/default/pwhash_argon2id test/default/pwhash_scrypt test/default/pwhash_scrypt_ll test/default/randombytes test/default/scalarmult test/default/scalarmult_ed25519 test/default/scalarmult_ristretto255 test/default/scalarmult2 test/default/scalarmult5 test/default/scalarmult6 test/default/scalarmult7 test/default/scalarmult8 test/default/secretbox test/default/secretbox_easy test/default/secretbox_easy2 test/default/secretbox2 test/default/secretbox7 test/default/secretbox8 test/default/secretstream_xchacha20poly1305 test/default/shorthash test/default/sign test/default/siphashx24 test/default/sodium_core test/default/sodium_utils test/default/sodium_utils2 test/default/sodium_utils3 test/default/sodium_version test/default/stream test/default/stream2 test/default/stream3 test/default/stream4 test/default/verify1 test/default/xchacha20 test/js.done testing Vagrantfile zig-cache zig-out ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/AUTHORS0000644000175100017510000001135415125531055016310 0ustar00runnerrunner Designers ========= argon2 Alex Biryukov Daniel Dinu Dmitry Khovratovich blake2 Jean-Philippe Aumasson Christian Winnerlein Samuel Neves Zooko Wilcox-O'Hearn chacha20 Daniel J. Bernstein chacha20poly1305 Adam Langley Yoav Nir curve25519 Daniel J. Bernstein curve25519xsalsa20poly1305 Daniel J. Bernstein ed25519 Daniel J. Bernstein Bo-Yin Yang Niels Duif Peter Schwabe Tanja Lange poly1305 Daniel J. Bernstein ristretto Mike Hamburg Henry de Valence Jack Grigg George Tankersley Filippo Valsorda Isis Lovecruft salsa20 Daniel J. Bernstein scrypt Colin Percival siphash Jean-Philippe Aumasson Daniel J. Bernstein Implementors ============ crypto_aead/aes256gcm/aesni Frank Denis crypto_aead/chacha20poly1305 Frank Denis crypto_aead/xchacha20poly1305 Frank Denis Jason A. Donenfeld crypto_auth/hmacsha256 Colin Percival crypto_auth/hmacsha512 crypto_auth/hmacsha512256 crypto_box/curve25519xsalsa20poly1305 Daniel J. Bernstein crypto_box/curve25519xchacha20poly1305 Frank Denis crypto_core/ed25519 Daniel J. Bernstein Adam Langley Frank Denis crypto_core/hchacha20 Frank Denis crypto_core/hsalsa20 Daniel J. Bernstein crypto_core/salsa crypto_generichash/blake2b Jean-Philippe Aumasson Christian Winnerlein Samuel Neves Zooko Wilcox-O'Hearn crypto_hash/sha256 Colin Percival crypto_hash/sha512 crypto_hash/sha512256 crypto_kdf Frank Denis crypto_kx Frank Denis crypto_onetimeauth/poly1305/donna Andrew "floodyberry" Moon crypto_onetimeauth/poly1305/sse2 crypto_pwhash/argon2 Samuel Neves Dmitry Khovratovich Jean-Philippe Aumasson Daniel Dinu Thomas Pornin crypto_pwhash/scryptsalsa208sha256 Colin Percival Alexander Peslyak crypto_scalarmult/curve25519/ref10 Daniel J. Bernstein crypto_scalarmult/curve25519/sandy2x Tung Chou crypto_scalarmult/ed25519 Frank Denis crypto_scalarmult/ristretto255 Frank Denis crypto_secretbox/xsalsa20poly1305 Daniel J. Bernstein crypto_secretbox/xchacha20poly1305 Frank Denis crypto_secretstream/xchacha20poly1305 Frank Denis crypto_shorthash/siphash24 Jean-Philippe Aumasson Daniel J. Bernstein crypto_sign/ed25519 Peter Schwabe Daniel J. Bernstein Niels Duif Tanja Lange Bo-Yin Yang crypto_stream/chacha20/ref Daniel J. Bernstein crypto_stream/chacha20/dolbeau Romain Dolbeau Daniel J. Bernstein crypto_stream/salsa20/ref Daniel J. Bernstein crypto_stream/salsa20/xmm6 crypto_stream/salsa20/xmm6int Romain Dolbeau Daniel J. Bernstein crypto_stream/salsa2012/ref Daniel J. Bernstein crypto_stream/salsa2008/ref crypto_stream/xchacha20 Frank Denis crypto_verify Frank Denis sodium/codecs.c Frank Denis Thomas Pornin Christian Winnerlein sodium/core.c Frank Denis sodium/runtime.h sodium/utils.c ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/CITATION.cff0000644000175100017510000000072015125531055017125 0ustar00runnerrunnercff-version: 1.2.0 title: libsodium message: >- If you use this software, please cite it using the metadata from this file. type: software authors: - given-names: Frank family-names: Denis orcid: 'https://orcid.org/0009-0008-4417-1713' repository-code: 'https://github.com/jedisct1/libsodium' url: 'https://libsodium.org' abstract: 'A modern, portable, easy-to-use cryptographic library.' keywords: - cryptography - library - nacl license: ISC ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/ChangeLog0000644000175100017510000010416015125531055017010 0ustar00runnerrunner* Version 1.0.20-stable - The Fil-C compiler is supported out of the box - MSVC 2026 (Visual Studio 2026) is now supported - Performance of AES256-GCM and AEGIS on ARM has been improved with some compilers - Android binaries have been added to the NuGet package - Windows ARM binaries have been added to the NuGet package - The Android build script has been improved. The base SDK is now 27c, and the default platform is 21, supporting 16 KB page sizes. - The library can now be compiled with Zig 0.15 and Zig 0.16 - Zig builds now generate position-independent static libraries by default on targets that support PIC - arm64e builds have been added to the XCFramework packages - XCFramework packages are now full builds instead of minimal builds - MSVC builds have been enabled for ARM64 - iOS 32-bit (armv7/armv7s) support has been removed from the XCFramework build script - Security: optblockers have been introduced in critical code paths to prevent compilers from introducing unwanted side channels via conditional jumps. This was observed on RISC-V targets with specific compilers and options. - Security: `crypto_core_ed25519_is_valid_point()` now properly rejects small-order points that are not in the main subgroup - `((nonnull))` attributes have been relaxed on some `crypto_stream*` functions to allow NULL output buffers when the output length is zero - A cross-compilation issue with old clang versions has been fixed - 16K page sizes are now supported on Android - JavaScript: support for Cloudflare Workers has been added - JavaScript: WASM_BIGINT is forcibly disabled to retain compatibility with older runtimes - A compilation issue with old toolchains on Solaris has been fixed - `crypto_aead_aes256gcm_is_available` is exported to JavaScript - libsodium is now compatible with Emscripten 4.x * Version 1.0.20 This point release includes all the changes from 1.0.19-stable, mainly addressing compilation issues and improvements to the .NET packages. * Version 1.0.19-stable - Building with `zig build` now requires Zig 0.12. - When using the traditional build system, -O3 is used instead of -Ofast. - Improved detection of the compiler flags required on aarch64. - Improved compatibility with custom build systems on aarch64. - apple-xcframework: VisionOS packages are not built if Xcode doesn't include that SDK. - `crypto_kdf_hkdf_sha512_statebytes()` was added. - When using Visual Studio, runtime CPU feature detection is now enabled on Windows/aarch64. - There were issues with C++ guards affecting usage of libsodium using Swift on Windows. This has been fixed. - Emscripten: `crypto_aead_aegis*()` functions are now exported in JavaScript builds - Emscripten: unsupported `--memory-init-file` option has been removed. - apple-xcframework: the minimal deployment target can be set to iOS 11+. - .NET packages now include precompiled libraries for Windows/arm64, iOS, TvOS and Catalyst. - .NET precompiled libraries now work on any CPUs, using only runtime feature detection. - SYSV assembly should not be used when targeting Windows (reported by @meiyese, thanks!) - Compatibility issues with LLVM 18 and AVX512 have been addressed. - GitHub attestation build provenance are now added to NuGet packages. - JavaScript tests can now use Bun as an alternative to Node. * Version 1.0.19 This release includes all the changes from 1.0.18-stable, as well as two additions: - New AEADs: AEGIS-128L and AEGIS-256 are now available in the `crypto_aead_aegis128l_*()` and `crypto_aead_aegis256_*()` namespaces. AEGIS is a family of authenticated ciphers for high-performance applications, leveraging hardware AES acceleration on `x86_64` and `aarch64`. In addition to performance, AEGIS ciphers have unique properties making them easier and safer to use than AES-GCM. They can also be used as high-performance MACs. - The HKDF key derivation mechanism, required by many standard protocols, is now available in the `crypto_kdf_hkdf_*()` namespace. It is implemented for the SHA-256 and SHA-512 hash functions. - The `osx.sh` build script was renamed to `macos.sh`. - Support for android-mips was removed. * Version 1.0.18-stable - Visual Studio: support for Windows/ARM64 builds has been added. - Visual Studio: AVX512 implementations are enabled on supported CPUs. - Visual Studio: an MSVC 2022 solution was added. - Apple XCFramework: support for VisionOS was added. - Apple XCFramework: support for Catalyst was added. - Apple XCFramework: building the simulators is now optional. - iOS: bitcode is not generated any more, as it was deprecated by Apple. - watchOS: support for arm64 was added. - The Zig toolchain can now be used as a modern build system to replace autoconf/automake/libtool/make/ccache and the compiler. This enables faster compilation times, easier cross compilation, and static libraries optimized for any CPU. - The Zig toolchain is now the recommended way to compile `libsodium` to WebAssembly/WASI(X). - libsodium can now be added as a dependency to Zig projects. - Memory fences were added to remove some gadgets that could be used alongside speculative loads. - The AES-GCM implementation was completely rewritten. It is now faster, and also available on aarch64, including Windows/ARM64. - Compatibility with CET instrumentation / IBT / Shadow Stack was added. - Emscripten: the `crypto_pwhash_*()` functions have been removed from Sumo builds, as they reserve a substantial amount of JavaScript memory, even when not used. - Benchmarks now use `CLOCK_MONOTONIC` if possible. - WebAssembly: tests can now run using Bun, WasmEdge, Wazero, wasm3 and wasmer-js. Support for WAVM and Lucet have been removed, as these projects have reached EOL. - .NET: the minimum supported macOS version is now 1.0.15; this matches Microsoft guidelines. - .NET: all the packages are now built using Zig, on all platforms. This allows us to easily match Microsoft's requirements, including supported glibc versions. However, on x86_64, targets are expected to support at least the AVX instruction set. - .NET: packages for ARM64 are now available. - C23 `memset_explicit()` is now used, when available. - Compilation now uses `-Ofast` or `-O3` instead of `-O2` by default. - Portability improvements to help compile libsodium to modern game consoles. - JavaScript: a default `unhandledRejection` handler is not set any more. - Slightly faster 25519 operations. - OpenBSD: leverage `MAP_CONCEAL`. * Version 1.0.18 - Enterprise versions of Visual Studio are now supported. - Visual Studio 2019 is now supported. - 32-bit binaries for Visual Studio 2010 are now provided. - A test designed to trigger an OOM condition didn't work on Linux systems with memory overcommit turned on. It has been removed in order to fix Ansible builds. - Emscripten: `print` and `printErr` functions are overridden to send errors to the console, if there is one. - Emscripten: `UTF8ToString()` is now exported since `Pointer_stringify()` has been deprecated. - Libsodium version detection has been fixed in the CMake recipe. - Generic hashing got a 10% speedup on AVX2. - New target: WebAssembly/WASI (compile with `dist-builds/wasm32-wasi.sh`). - New functions to map a hash to an edwards25519 point or get a random point: `core_ed25519_from_hash()` and `core_ed25519_random()`. - `crypto_core_ed25519_scalar_mul()` has been implemented for `scalar*scalar (mod L)` multiplication. - Support for the Ristretto group has been implemented for interoperability with wasm-crypto. - Improvements have been made to the test suite. - Portability improvements have been made. - `getentropy()` is now used on systems providing this system call. - `randombytes_salsa20` has been renamed to `randombytes_internal`. - Support for NativeClient has been removed. - Most `((nonnull))` attributes have been relaxed to allow 0-length inputs to be `NULL`. - The `-ftree-vectorize` and `-ftree-slp-vectorize` compiler switches are now used, if available, for optimized builds. * Version 1.0.17-stable - AVX512 detection has been improved. - A compilation option was added to enable retpoline support. - `-ftls-model=global-dynamic` is now set, if available. - Portability and documentation improvements. * Version 1.0.17 - Bug fix: `sodium_pad()` didn't properly support block sizes >= 256 bytes. - JS/WebAssembly: some old iOS versions can't instantiate the WebAssembly module; fall back to Javascript on these. - JS/WebAssembly: compatibility with newer Emscripten versions. - Bug fix: `crypto_pwhash_scryptsalsa208sha256_str_verify()` and `crypto_pwhash_scryptsalsa208sha256_str_needs_rehash()` didn't return `EINVAL` on input strings with a short length, unlike their high-level counterpart. - Added a workaround for Visual Studio 2010 bug causing CPU features not to be detected. - Portability improvements. - Test vectors from Project Wycheproof have been added. - New low-level APIs for arithmetic mod the order of the prime order group: `crypto_core_ed25519_scalar_random()`, `crypto_core_ed25519_scalar_reduce()`, `crypto_core_ed25519_scalar_invert()`, `crypto_core_ed25519_scalar_negate()`, `crypto_core_ed25519_scalar_complement()`, `crypto_core_ed25519_scalar_add()` and `crypto_core_ed25519_scalar_sub()`. - New low-level APIs for scalar multiplication without clamping: `crypto_scalarmult_ed25519_base_noclamp()` and `crypto_scalarmult_ed25519_noclamp()`. These new APIs are especially useful for blinding. - `sodium_sub()` has been implemented. - Support for WatchOS has been added. - getrandom(2) is now used on FreeBSD 12+. - The `nonnull` attribute has been added to all relevant prototypes. - More reliable AVX512 detection. - Javascript/Webassembly builds now use dynamic memory growth. * Version 1.0.16 - Signatures computations and verifications are now way faster on 64-bit platforms with compilers supporting 128-bit arithmetic (gcc, clang, icc). This includes the WebAssembly target. - New low-level APIs for computations over edwards25519: `crypto_scalarmult_ed25519()`, `crypto_scalarmult_ed25519_base()`, `crypto_core_ed25519_is_valid_point()`, `crypto_core_ed25519_add()`, `crypto_core_ed25519_sub()` and `crypto_core_ed25519_from_uniform()` (elligator representative to point). - `crypto_sign_open()`, `crypto_sign_verify_detached() and `crypto_sign_edwards25519sha512batch_open` now reject public keys in non-canonical form in addition to low-order points. - The library can be built with `ED25519_NONDETERMINISTIC` defined in order to use synthetic nonces for EdDSA. This is disabled by default. - Webassembly: `crypto_pwhash_*()` functions are now included in non-sumo builds. - `sodium_stackzero()` was added to wipe content off the stack. - Android: support new SDKs where unified headers have become the default. - The Salsa20-based PRNG example is now thread-safe on platforms with support for thread-local storage, optionally mixes bits from RDRAND. - CMAKE: static library detection on Unix systems has been improved (thanks to @BurningEnlightenment, @nibua-r, @mellery451) - Argon2 and scrypt are slightly faster on Linux. * Version 1.0.15 - The default password hashing algorithm is now Argon2id. The `pwhash_str_verify()` function can still verify Argon2i hashes without any changes, and `pwhash()` can still compute Argon2i hashes as well. - The aes128ctr primitive was removed. It was slow, non-standard, not authenticated, and didn't seem to be used by any opensource project. - Argon2id required at least 3 passes like Argon2i, despite a minimum of `1` as defined by the `OPSLIMIT_MIN` constant. This has been fixed. - The secretstream construction was slightly changed to be consistent with forthcoming variants. - The Javascript and Webassembly versions have been merged, and the module now returns a `.ready` promise that will resolve after the Webassembly code is loaded and compiled. - Note that due to these incompatible changes, the library version major was bumped up. * Version 1.0.14 - iOS binaries should now be compatible with WatchOS and TVOS. - WebAssembly is now officially supported. Special thanks to @facekapow and @pepyakin who helped to make it happen. - Internal consistency checks failing and primitives used with dangerous/out-of-bounds/invalid parameters used to call abort(3). Now, a custom handler *that doesn't return* can be set with the `set_sodium_misuse()` function. It still aborts by default or if the handler ever returns. This is not a replacement for non-fatal, expected runtime errors. This handler will be only called in unexpected situations due to potential bugs in the library or in language bindings. - `*_MESSAGEBYTES_MAX` macros (and the corresponding `_messagebytes_max()` symbols) have been added to represent the maximum message size that can be safely handled by a primitive. Language bindings are encouraged to check user inputs against these maximum lengths. - The test suite has been extended to cover more edge cases. - crypto_sign_ed25519_pk_to_curve25519() now rejects points that are not on the curve, or not in the main subgroup. - Further changes have been made to ensure that smart compilers will not optimize out code that we don't want to be optimized. - Visual Studio solutions are now included in distribution tarballs. - The `sodium_runtime_has_*` symbols for CPU features detection are now defined as weak symbols, i.e. they can be replaced with an application-defined implementation. This can be useful to disable AVX* when temperature/power consumption is a concern. - `crypto_kx_*()` now aborts if called with no non-NULL pointers to store keys to. - SSE2 implementations of `crypto_verify_*()` have been added. - Passwords can be hashed using a specific algorithm with the new `crypto_pwhash_str_alg()` function. - Due to popular demand, base64 encoding (`sodium_bin2base64()`) and decoding (`sodium_base642bin()`) have been implemented. - A new `crypto_secretstream_*()` API was added to safely encrypt files and multi-part messages. - The `sodium_pad()` and `sodium_unpad()` helper functions have been added in order to add & remove padding. - An AVX512 optimized implementation of Argon2 has been added (written by Ondrej Mosnáček, thanks!) - The `crypto_pwhash_str_needs_rehash()` function was added to check if a password hash string matches the given parameters, or if it needs an update. - The library can now be compiled with recent versions of emscripten/binaryen that don't allow multiple variables declarations using a single `var` statement. * Version 1.0.13 - Javascript: the sumo builds now include all symbols. They were previously limited to symbols defined in minimal builds. - The public `crypto_pwhash_argon2i_MEMLIMIT_MAX` constant was incorrectly defined on 32-bit platforms. This has been fixed. - Version 1.0.12 didn't compile on OpenBSD/i386 using the base gcc compiler. This has been fixed. - The Android compilation scripts have been updated for NDK r14b. - armv7s-optimized code was re-added to iOS builds. - An AVX2 optimized implementation of the Argon2 round function was added. - The Argon2id variant of Argon2 has been implemented. The high-level `crypto_pwhash_str_verify()` function automatically detects the algorithm and can verify both Argon2i and Argon2id hashed passwords. The default algorithm for newly hashed passwords remains Argon2i in this version to avoid breaking compatibility with verifiers running libsodium <= 1.0.12. - A `crypto_box_curve25519xchacha20poly1305_seal*()` function set was implemented. - scrypt was removed from minimal builds. - libsodium is now available on NuGet. * Version 1.0.12 - Ed25519ph was implemented, adding a multi-part signature API (`crypto_sign_init()`, `crypto_sign_update()`, `crypto_sign_final_*()`). - New constants and related accessors have been added for Scrypt and Argon2. - XChaCha20 has been implemented. Like XSalsa20, this construction extends the ChaCha20 cipher to accept a 192-bit nonce. This makes it safe to use ChaCha20 with random nonces. - `crypto_secretbox`, `crypto_box` and `crypto_aead` now offer variants leveraging XChaCha20. - SHA-2 is about 20% faster, which also gives a speed boost to signature and signature verification. - AVX2 implementations of Salsa20 and ChaCha20 have been added. They are twice as fast as the SSE2 implementations. The speed gain is even more significant on Windows, that previously didn't use vectorized implementations. - New high-level API: `crypto_kdf`, to easily derive one or more subkeys from a master key. - Siphash with a 128-bit output has been implemented, and is available as `crypto_shorthash_siphashx_*`. - New `*_keygen()` helpers functions have been added to create secret keys for all constructions. This improves code clarity and can prevent keys from being partially initialized. - A new `randombytes_buf_deterministic()` function was added to deterministically fill a memory region with pseudorandom data. This function can especially be useful to write reproducible tests. - A preliminary `crypto_kx_*()` API was added to compute shared session keys. - AVX2 detection is more reliable. - The pthreads library is not required any more when using MingW. - `contrib/Findsodium.cmake` was added as an example to include libsodium in a project using cmake. - Compatibility with gcc 2.x has been restored. - Minimal builds can be checked using `sodium_library_minimal()`. - The `--enable-opt` compilation switch has become compatible with more platforms. - Android builds are now using clang on platforms where it is available. * Version 1.0.11 - `sodium_init()` is now thread-safe, and can be safely called multiple times. - Android binaries now properly support 64-bit Android, targeting platform 24, but without breaking compatibility with platforms 16 and 21. - Better support for old gcc versions. - On FreeBSD, core dumps are disabled on regions allocated with sodium allocation functions. - AVX2 detection was fixed, resulting in faster Blake2b hashing on platforms where it was not properly detected. - The Sandy2x Curve25519 implementation was not as fast as expected on some platforms. This has been fixed. - The NativeClient target was improved. Most notably, it now supports optimized implementations, and uses pepper_49 by default. - The library can be compiled with recent Emscripten versions. Changes have been made to produce smaller code, and the default heap size was reduced in the standard version. - The code can now be compiled on SLES11 service pack 4. - Decryption functions can now accept a NULL pointer for the output. This checks the MAC without writing the decrypted message. - crypto_generichash_final() now returns -1 if called twice. - Support for Visual Studio 2008 was improved. * Version 1.0.10 - This release only fixes a compilation issue reported with some older gcc versions. There are no functional changes over the previous release. * Version 1.0.9 - The Javascript target now includes a `--sumo` option to include all the symbols of the original C library. - A detached API was added to the ChaCha20-Poly1305 and AES256-GCM implementations. - The Argon2i password hashing function was added, and is accessible directly and through a new, high-level `crypto_pwhash` API. The scrypt function remains available as well. - A speed-record AVX2 implementation of BLAKE2b was added (thanks to Samuel Neves). - The library can now be compiled using C++Builder (thanks to @jcolli44) - Countermeasures for Ed25519 signatures malleability have been added to match the irtf-cfrg-eddsa draft (note that malleability is irrelevant to the standard definition of signature security). Signatures with a small-order `R` point are now also rejected. - Some implementations are now slightly faster when using the Clang compiler. - The HChaCha20 core function was implemented (`crypto_core_hchacha20()`). - No-op stubs were added for all AES256-GCM public functions even when compiled on non-Intel platforms. - `crypt_generichash_blake2b_statebytes()` was added. - New macros were added for the IETF variant of the ChaCha20-Poly1305 construction. - The library can now be compiled on Minix. - HEASLR is now enabled on MinGW builds. * Version 1.0.8 - Handle the case where the CPU supports AVX, but we are running on an hypervisor with AVX disabled/not supported. - Faster (2x) scalarmult_base() when using the ref10 implementation. * Version 1.0.7 - More functions whose return value should be checked have been tagged with `__attribute__ ((warn_unused_result))`: `crypto_box_easy()`, `crypto_box_detached()`, `crypto_box_beforenm()`, `crypto_box()`, and `crypto_scalarmult()`. - Sandy2x, the fastest Curve25519 implementation ever, has been merged in, and is automatically used on CPUs supporting the AVX instructions set. - An SSE2 optimized implementation of Poly1305 was added, and is twice as fast as the portable one. - An SSSE3 optimized implementation of ChaCha20 was added, and is twice as fast as the portable one. - Faster `sodium_increment()` for common nonce sizes. - New helper functions have been added: `sodium_is_zero()` and `sodium_add()`. - `sodium_runtime_has_aesni()` now properly detects the CPU flag when compiled using Visual Studio. * Version 1.0.6 - Optimized implementations of Blake2 have been added for modern Intel platforms. `crypto_generichash()` is now faster than MD5 and SHA1 implementations while being far more secure. - Functions for which the return value should be checked have been tagged with `__attribute__ ((warn_unused_result))`. This will intentionally break code compiled with `-Werror` that didn't bother checking critical return values. - The `crypto_sign_edwards25519sha512batch_*()` functions have been tagged as deprecated. - Undocumented symbols that were exported, but were only useful for internal purposes have been removed or made private: `sodium_runtime_get_cpu_features()`, the implementation-specific `crypto_onetimeauth_poly1305_donna()` symbols, `crypto_onetimeauth_poly1305_set_implementation()`, `crypto_onetimeauth_poly1305_implementation_name()` and `crypto_onetimeauth_pick_best_implementation()`. - `sodium_compare()` now works as documented, and compares numbers in little-endian format instead of behaving like `memcmp()`. - The previous changes should not break actual applications, but to be safe, the library version major was incremented. - `sodium_runtime_has_ssse3()` and `sodium_runtime_has_sse41()` have been added. - The library can now be compiled with the CompCert compiler. * Version 1.0.5 - Compilation issues on some platforms were fixed: missing alignment directives were added (required at least on RHEL-6/i386), a workaround for a VRP bug on gcc/armv7 was added, and the library can now be compiled with the SunPro compiler. - Javascript target: io.js is not supported any more. Use nodejs. * Version 1.0.4 - Support for AES256-GCM has been added. This requires a CPU with the aesni and pclmul extensions, and is accessible via the crypto_aead_aes256gcm_*() functions. - The Javascript target doesn't use eval() any more, so that the library can be used in Chrome packaged applications. - QNX and CloudABI are now supported. - Support for NaCl has finally been added. - ChaCha20 with an extended (96 bit) nonce and a 32-bit counter has been implemented as crypto_stream_chacha20_ietf(), crypto_stream_chacha20_ietf_xor() and crypto_stream_chacha20_ietf_xor_ic(). An IETF-compatible version of ChaCha20Poly1305 is available as crypto_aead_chacha20poly1305_ietf_npubbytes(), crypto_aead_chacha20poly1305_ietf_encrypt() and crypto_aead_chacha20poly1305_ietf_decrypt(). - The sodium_increment() helper function has been added, to increment an arbitrary large number (such as a nonce). - The sodium_compare() helper function has been added, to compare arbitrary large numbers (such as nonces, in order to prevent replay attacks). * Version 1.0.3 - In addition to sodium_bin2hex(), sodium_hex2bin() is now a constant-time function. - crypto_stream_xsalsa20_ic() has been added. - crypto_generichash_statebytes(), crypto_auth_*_statebytes() and crypto_hash_*_statebytes() have been added in order to retrieve the size of structures keeping states from foreign languages. - The JavaScript target doesn't require /dev/urandom or an external randombytes() implementation any more. Other minor Emscripten-related improvements have been made in order to support libsodium.js - Custom randombytes implementations do not need to provide their own implementation of randombytes_uniform() any more. randombytes_stir() and randombytes_close() can also be NULL pointers if they are not required. - On Linux, getrandom(2) is being used instead of directly accessing /dev/urandom, if the kernel supports this system call. - crypto_box_seal() and crypto_box_seal_open() have been added. - Visual Studio 2015 is now supported. * Version 1.0.2 - The _easy and _detached APIs now support precalculated keys; crypto_box_easy_afternm(), crypto_box_open_easy_afternm(), crypto_box_detached_afternm() and crypto_box_open_detached_afternm() have been added as an alternative to the NaCl interface. - Memory allocation functions can now be used on operating systems with no memory protection. - crypto_sign_open() and crypto_sign_edwards25519sha512batch_open() now accept a NULL pointer instead of a pointer to the message size, if storing this information is not required. - The close-on-exec flag is now set on the descriptor returned when opening /dev/urandom. - A libsodium-uninstalled.pc file to use pkg-config even when libsodium is not installed, has been added. - The iOS target now includes armv7s and arm64 optimized code, as well as i386 and x86_64 code for the iOS simulator. - sodium_free() can now be called on regions with PROT_NONE protection. - The Javascript tests can run on Ubuntu, where the node binary was renamed nodejs. io.js can also be used instead of node. * Version 1.0.1 - DLL_EXPORT was renamed SODIUM_DLL_EXPORT in order to avoid collisions with similar macros defined by other libraries. - sodium_bin2hex() is now constant-time. - crypto_secretbox_detached() now supports overlapping input and output regions. - NaCl's donna_c64 implementation of curve25519 was reading an extra byte past the end of the buffer containing the base point. This has been fixed. * Version 1.0.0 - The API and ABI are now stable. New features will be added, but backward-compatibility is guaranteed through all the 1.x.y releases. - crypto_sign() properly works with overlapping regions again. Thanks to @pysiak for reporting this regression introduced in version 0.6.1. - The test suite has been extended. * Version 0.7.1 (1.0 RC2) - This is the second release candidate of Sodium 1.0. Minor compilation, readability and portability changes have been made and the test suite was improved, but the API is the same as the previous release candidate. * Version 0.7.0 (1.0 RC1) - Allocating memory to store sensitive data can now be done using sodium_malloc() and sodium_allocarray(). These functions add guard pages around the protected data to make it less likely to be accessible in a heartbleed-like scenario. In addition, the protection for memory regions allocated that way can be changed using sodium_mprotect_noaccess(), sodium_mprotect_readonly() and sodium_mprotect_readwrite(). - ed25519 keys can be converted to curve25519 keys with crypto_sign_ed25519_pk_to_curve25519() and crypto_sign_ed25519_sk_to_curve25519(). This allows using the same keys for signature and encryption. - The seed and the public key can be extracted from an ed25519 key using crypto_sign_ed25519_sk_to_seed() and crypto_sign_ed25519_sk_to_pk(). - aes256 was removed. A timing-attack resistant implementation might be added later, but not before version 1.0 is tagged. - The crypto_pwhash_scryptxsalsa208sha256_* compatibility layer was removed. Use crypto_pwhash_scryptsalsa208sha256_*. - The compatibility layer for implementation-specific functions was removed. - Compilation issues with Mingw64 on MSYS (not MSYS2) were fixed. - crypto_pwhash_scryptsalsa208sha256_STRPREFIX was added: it contains the prefix produced by crypto_pwhash_scryptsalsa208sha256_str() * Version 0.6.1 - Important bug fix: when crypto_sign_open() was given a signed message too short to even contain a signature, it was putting an unlimited amount of zeros into the target buffer instead of immediately returning -1. The bug was introduced in version 0.5.0. - New API: crypto_sign_detached() and crypto_sign_verify_detached() to produce and verify ed25519 signatures without having to duplicate the message. - New ./configure switch: --enable-minimal, to create a smaller library, with only the functions required for the high-level API. Mainly useful for the JavaScript target and embedded systems. - All the symbols are now exported by the Emscripten build script. - The pkg-config .pc file is now always installed even if the pkg-config tool is not available during the installation. * Version 0.6.0 - The ChaCha20 stream cipher has been added, as crypto_stream_chacha20_* - The ChaCha20Poly1305 AEAD construction has been implemented, as crypto_aead_chacha20poly1305_* - The _easy API does not require any heap allocations any more and does not have any overhead over the NaCl API. With the password hashing function being an obvious exception, the library doesn't allocate and will not allocate heap memory ever. - crypto_box and crypto_secretbox have a new _detached API to store the authentication tag and the encrypted message separately. - crypto_pwhash_scryptxsalsa208sha256*() functions have been renamed crypto_pwhash_scryptsalsa208sha256*(). - The low-level crypto_pwhash_scryptsalsa208sha256_ll() function allows setting individual parameters of the scrypt function. - New macros and functions for recommended crypto_pwhash_* parameters have been added. - Similarly to crypto_sign_seed_keypair(), crypto_box_seed_keypair() has been introduced to deterministically generate a key pair from a seed. - crypto_onetimeauth() now provides a streaming interface. - crypto_stream_chacha20_xor_ic() and crypto_stream_salsa20_xor_ic() have been added to use a non-zero initial block counter. - On Windows, CryptGenRandom() was replaced by RtlGenRandom(), which doesn't require the Crypt API. - The high bit in curve25519 is masked instead of processing the key as a 256-bit value. - The curve25519 ref implementation was replaced by the latest ref10 implementation from Supercop. - sodium_mlock() now prevents memory from being included in coredumps on Linux 3.4+ * Version 0.5.0 - sodium_mlock()/sodium_munlock() have been introduced to lock pages in memory before storing sensitive data, and to zero them before unlocking them. - High-level wrappers for crypto_box and crypto_secretbox (crypto_box_easy and crypto_secretbox_easy) can be used to avoid dealing with the specific memory layout regular functions depend on. - crypto_pwhash_scryptsalsa208sha256* functions have been added to derive a key from a password, and for password storage. - Salsa20 and ed25519 implementations now support overlapping inputs/keys/outputs (changes imported from supercop-20140505). - New build scripts for Visual Studio, Emscripten, different Android architectures and msys2 are available. - The poly1305-53 implementation has been replaced with Floodyberry's poly1305-donna32 and poly1305-donna64 implementations. - sodium_hex2bin() has been added to complement sodium_bin2hex(). - On OpenBSD and Bitrig, arc4random() is used instead of reading /dev/urandom. - crypto_auth_hmac_sha512() has been implemented. - sha256 and sha512 now have a streaming interface. - hmacsha256, hmacsha512 and hmacsha512256 now support keys of arbitrary length, and have a streaming interface. - crypto_verify_64() has been implemented. - first-class Visual Studio build system, thanks to @evoskuil - CPU features are now detected at runtime. * Version 0.4.5 - Restore compatibility with OSX <= 10.6 * Version 0.4.4 - Visual Studio is officially supported (VC 2010 & VC 2013) - mingw64 is now supported - big-endian architectures are now supported as well - The donna_c64 implementation of curve25519_donna_c64 now handles non-canonical points like the ref implementation - Missing scalarmult_curve25519 and stream_salsa20 constants are now exported - A crypto_onetimeauth_poly1305_ref() wrapper has been added * Version 0.4.3 - crypto_sign_seedbytes() and crypto_sign_SEEDBYTES were added. - crypto_onetimeauth_poly1305_implementation_name() was added. - poly1305-ref has been replaced by a faster implementation, Floodyberry's poly1305-donna-unrolled. - Stackmarkings have been added to assembly code, for Hardened Gentoo. - pkg-config can now be used in order to retrieve compilations flags for using libsodium. - crypto_stream_aes256estream_*() can now deal with unaligned input on platforms that require word alignment. - portability improvements. * Version 0.4.2 - All NaCl constants are now also exposed as functions. - The Android and iOS cross-compilation script have been improved. - libsodium can now be cross-compiled to Windows from Linux. - libsodium can now be compiled with emscripten. - New convenience function (prototyped in utils.h): sodium_bin2hex(). * Version 0.4.1 - sodium_version_*() functions were not exported in version 0.4. They are now visible as intended. - sodium_init() now calls randombytes_stir(). - optimized assembly version of salsa20 is now used on amd64. - further cleanups and enhanced compatibility with non-C99 compilers. * Version 0.4 - Most constants and operations are now available as actual functions instead of macros, making it easier to use from other languages. - New operation: crypto_generichash, featuring a variable key size, a variable output size, and a streaming API. Currently implemented using Blake2b. - The package can be compiled in a separate directory. - aes128ctr functions are exported. - Optimized versions of curve25519 (curve25519_donna_c64), poly1305 (poly1305_53) and ed25519 (ed25519_ref10) are available. Optionally calling sodium_init() once before using the library makes it pick the fastest implementation. - New convenience function: sodium_memzero() in order to securely wipe a memory area. - A whole bunch of cleanups and portability enhancements. - On Windows, a .REF file is generated along with the shared library, for use with Visual Studio. The installation path for these has become $prefix/bin as expected by MingW. * Version 0.3 - The crypto_shorthash operation has been added, implemented using SipHash-2-4. * Version 0.2 - crypto_sign_seed_keypair() has been added * Version 0.1 - Initial release. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/LICENSE0000644000175100017510000000146715125531055016251 0ustar00runnerrunner/* * ISC License * * Copyright (c) 2013-2026 * Frank Denis * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/Makefile.am0000644000175100017510000000045715125531055017276 0ustar00runnerrunnerACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ autogen.sh \ build.zig \ ChangeLog \ CITATION.cff \ LICENSE \ README.markdown \ THANKS SUBDIRS = \ builds \ contrib \ dist-build \ src \ test pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = @PACKAGE_NAME@.pc DISTCLEANFILES = $(pkgconfig_DATA) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/Makefile.in0000644000175100017510000007520715125531055017314 0ustar00runnerrunner# Makefile.in generated by automake 1.18.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2025 Free Software Foundation, Inc. # This Makefile.in 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. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_add_fortify_source.m4 \ $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ $(top_srcdir)/m4/ax_check_catchable_segv.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_check_define.m4 \ $(top_srcdir)/m4/ax_check_link_flag.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/ax_tls.m4 \ $(top_srcdir)/m4/ax_valgrind_check.m4 \ $(top_srcdir)/m4/ld-output-def.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = libsodium.pc libsodium-uninstalled.pc \ src/libsodium/include/sodium/version.h CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(srcdir)/libsodium-uninstalled.pc.in \ $(srcdir)/libsodium.pc.in $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/ltmain.sh \ $(top_srcdir)/build-aux/missing \ $(top_srcdir)/src/libsodium/include/sodium/version.h.in \ AUTHORS ChangeLog THANKS build-aux/compile \ build-aux/config.guess build-aux/config.sub build-aux/depcomp \ build-aux/install-sh build-aux/ltmain.sh build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -700 -exec chmod u+rwx {} ';' \ ; rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = -9 DIST_TARGETS = dist-bzip2 dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = \ find . \( -type f -a \! \ \( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGS_AESNI = @CFLAGS_AESNI@ CFLAGS_ARMCRYPTO = @CFLAGS_ARMCRYPTO@ CFLAGS_AVX = @CFLAGS_AVX@ CFLAGS_AVX2 = @CFLAGS_AVX2@ CFLAGS_AVX512F = @CFLAGS_AVX512F@ CFLAGS_MMX = @CFLAGS_MMX@ CFLAGS_PCLMUL = @CFLAGS_PCLMUL@ CFLAGS_RDRAND = @CFLAGS_RDRAND@ CFLAGS_SSE2 = @CFLAGS_SSE2@ CFLAGS_SSE3 = @CFLAGS_SSE3@ CFLAGS_SSE41 = @CFLAGS_SSE41@ CFLAGS_SSSE3 = @CFLAGS_SSSE3@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CWFLAGS = @CWFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLL_VERSION = @DLL_VERSION@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_VALGRIND_drd = @ENABLE_VALGRIND_drd@ ENABLE_VALGRIND_helgrind = @ENABLE_VALGRIND_helgrind@ ENABLE_VALGRIND_memcheck = @ENABLE_VALGRIND_memcheck@ ENABLE_VALGRIND_sgcheck = @ENABLE_VALGRIND_sgcheck@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ HAVE_AMD64_ASM_V = @HAVE_AMD64_ASM_V@ HAVE_AVX_ASM_V = @HAVE_AVX_ASM_V@ HAVE_CPUID_V = @HAVE_CPUID_V@ HAVE_TI_MODE_V = @HAVE_TI_MODE_V@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBTOOL_EXTRA_FLAGS = @LIBTOOL_EXTRA_FLAGS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGCONFIG_LIBS_PRIVATE = @PKGCONFIG_LIBS_PRIVATE@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SAFECODE_HOME = @SAFECODE_HOME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SODIUM_LIBRARY_MINIMAL_DEF = @SODIUM_LIBRARY_MINIMAL_DEF@ SODIUM_LIBRARY_VERSION = @SODIUM_LIBRARY_VERSION@ SODIUM_LIBRARY_VERSION_MAJOR = @SODIUM_LIBRARY_VERSION_MAJOR@ SODIUM_LIBRARY_VERSION_MINOR = @SODIUM_LIBRARY_VERSION_MINOR@ STRIP = @STRIP@ TEST_LDFLAGS = @TEST_LDFLAGS@ VALGRIND = @VALGRIND@ VALGRIND_ENABLED = @VALGRIND_ENABLED@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ valgrind_enabled_tools = @valgrind_enabled_tools@ valgrind_tools = @valgrind_tools@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ autogen.sh \ build.zig \ ChangeLog \ CITATION.cff \ LICENSE \ README.markdown \ THANKS SUBDIRS = \ builds \ contrib \ dist-build \ src \ test pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = @PACKAGE_NAME@.pc DISTCLEANFILES = $(pkgconfig_DATA) all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): libsodium.pc: $(top_builddir)/config.status $(srcdir)/libsodium.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ libsodium-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/libsodium-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ src/libsodium/include/sodium/version.h: $(top_builddir)/config.status $(top_srcdir)/src/libsodium/include/sodium/version.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) $(AM_V_at)$(MKDIR_P) "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-bzip3: distdir tardir=$(distdir) && $(am__tar) | bzip3 -c >$(distdir).tar.bz3 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.bz3*) \ bzip3 -dc $(distdir).tar.bz3 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) -$(am__rm_f) $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-bzip3 dist-gzip dist-lzip dist-shar \ dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \ distclean-generic distclean-libtool distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-pkgconfigDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/README.markdown0000644000175100017510000000726315125531055017745 0ustar00runnerrunner[![GitHub CI](https://github.com/jedisct1/libsodium/workflows/CI/badge.svg)](https://github.com/jedisct1/libsodium/actions) [![Coverity Scan Build Status](https://scan.coverity.com/projects/2397/badge.svg)](https://scan.coverity.com/projects/2397) [![Azure build status](https://jedisct1.visualstudio.com/Libsodium/_apis/build/status/jedisct1.libsodium?branchName=stable)](https://jedisct1.visualstudio.com/Libsodium/_build/latest?definitionId=3&branchName=stable) [![CodeQL scan](https://github.com/jedisct1/libsodium/workflows/CodeQL%20scan/badge.svg)](https://github.com/jedisct1/libsodium/actions) # ![libsodium](https://raw.github.com/jedisct1/libsodium/master/logo.png) Sodium is an easy-to-use software library that provides a wide range of cryptographic operations including encryption, decryption, digital signatures, and secure password hashing. It is a portable, cross-compilable, installable, and packageable fork of [NaCl](http://nacl.cr.yp.to/). While maintaining API compatibility, libsodium extends functionality to improve usability and simplify the development of secure applications. --- ## Key Features - **Encryption & Decryption:** Securely encrypt and decrypt data with modern algorithms. - **Digital Signatures:** Create and verify signatures to ensure data authenticity. - **Cross-Platform Compatibility:** Supported on Windows (MinGW and Visual Studio, x86, x64 and arm64), iOS, Android, JavaScript, and WebAssembly. - **User-Friendly API:** Designed to provide all core cryptographic operations while remaining easy to integrate into your projects. --- ## Documentation - [Installation](https://doc.libsodium.org/installation) - [Quickstart](https://doc.libsodium.org/quickstart) - [Full Documentation](https://doc.libsodium.org) - [Releases](https://download.libsodium.org/libsodium/releases/) - [Integrity Checking](https://doc.libsodium.org/installation#integrity-checking) --- ## Versioning libsodium uses a two-tier release system: - **Point releases** (e.g., 1.0.19, 1.0.20, 1.0.21) are tagged when new features are added or significant changes are made. - **Stable releases** are frequent maintainance updates between point releases. They fix minor issues while remaining fully compatible with their parent point release. No new features, no breaking changes. If your application depends on a specific point release, stable updates are safe to apply. Security fixes go to the `stable` branch immediately, with a new point release tagged shortly after. --- ## Contributors ### Code Contributors This project thrives thanks to the valuable contributions from our community. View all the [contributors](https://github.com/jedisct1/libsodium/graphs/contributors): Contributors ### Financial Contributors Your financial support helps us sustain and further develop libsodium. - [Become a Financial Contributor](https://opencollective.com/libsodium/contribute) #### Individuals Individual Contributors #### Organizations Support libsodium with your organization and gain visibility through your logo and website link. - [Support with Your Organization](https://opencollective.com/libsodium/contribute) Organization Contributor --- ## License This project is distributed under the [ISC license](https://en.wikipedia.org/wiki/ISC_license). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/THANKS0000644000175100017510000000436715125531055016161 0ustar00runnerrunnerSpecial thanks to people, companies and organizations having written libsodium bindings for their favorite programming languages: @alethia7 @artemisc @carblue @dnaq @ektrah @graxrabble @harleqin @joshjdevl @jrmarino @jshahbazi @lvh @neheb Adam Caudill (@adamcaudill) Alexander Ilin (@AlexIljin) Alexander Morris (@alexpmorris) Amit Murthy (@amitmurthy) Andrew Bennett (@potatosalad) Andrew Lambert (@charonn0) Bruce Mitchener (@waywardmonkeys) Bruno Oliveira (@abstractj) Caolan McMahon (@caolan) Chris Rebert (@cvrebert) Christian Hermann (@bitbeans) Christian Wiese (@morfoh) Christian Wiese (@morfoh) Colm MacCárthaigh (@colmmacc) David Parrish (@dmp1ce) Donald Stufft (@dstufft) Douglas Campos (@qmx) Drew Crawford (@drewcrawford) Emil Bay (@emilbayes) Eric Dong (@quantum1423) Eric Voskuil (@evoskuil) Farid Hajji (@fhajji) Frank Siebenlist (@franks42) Gabriel Handford (@gabriel) Geo Carncross (@geocar) Henrik Gassmann (BurningEnlightenment) Jachym Holecek (@freza) Jack Wink (@jackwink) James Ruan (@jamesruan) Jan de Muijnck-Hughes (@jfdm) Jason McCampbell (@jasonmccampbell) Jeroen Habraken (@VeXocide) Jeroen Ooms (@jeroen) Jesper Louis Andersen (@jlouis) Joe Eli McIlvain (@jemc) Jonathan Stowe (@jonathanstowe) Joseph Abrahamson (@tel) Julien Kauffmann (@ereOn) Kenneth Ballenegger (@kballenegger) Loic Maury (@loicmaury) Michael Gorlick (@mgorlick) Michael Gregorowicz (@mgregoro) Michał Zieliński (@zielmicha) Omar Ayub (@electricFeel) Pedro Paixao (@paixaop) Project ArteMisc (@artemisc) Rich FitzJohn (@richfitz) Ruben De Visscher (@rubendv) Rudolf Von Krugstein (@rudolfvonkrugstein) Samuel Neves (@sneves) Scott Arciszewski (@paragonie-scott) Stanislav Ovsiannikov (@naphaso) Stefan Marsiske (@stef) Stephan Touset (@stouset) Stephen Chavez (@redragonx) Steve Gibson (@sggrc) Tony Arcieri (@bascule) Tony Garnock-Jones (@tonyg) Y. T. Chung (@zonyitoo) Bytecurry Software Cryptotronix Facebook FSF France MaidSafe Paragonie Initiative Enterprises Python Cryptographic Authority (this list may not be complete, if you don't see your name, please submit a pull request!) Also thanks to: - Coverity, Inc. to provide static analysis. - FSF France for providing access to their compilation servers. - Private Internet Access for having sponsored a complete security audit. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/aclocal.m40000644000175100017510000014566315125531055017113 0ustar00runnerrunner# generated automatically by aclocal 1.18.1 -*- Autoconf -*- # Copyright (C) 1996-2025 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.72],, [m4_warning([this file was generated for autoconf 2.72. 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 'autoreconf'.])]) # Copyright (C) 2002-2025 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='1.18' 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.18.1], [], [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.18.1])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-2025 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}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$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-2025 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='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${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=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2025 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= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= 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-2025 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="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) 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=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; 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=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = 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" = 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=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/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 thus: # icc: Command line warning: ignoring option '-M'; no argument required # 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=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = 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" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != 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-2025 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=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`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=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? 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="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" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2025 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`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., 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='cygpath -w' else CYGPATH_W=echo 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_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])], [_AM_PROG_TAR([ustar])])])]) _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=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope 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 AC_REQUIRE([_AM_PROG_RM_F]) AC_REQUIRE([_AM_PROG_XARGS_N]) 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=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2025 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}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2025 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=. else am__leading_dot=_ 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-2025 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 Makefiles]) 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=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2025 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="#" am__quote= # 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=no 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='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="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-2025 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=${$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}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2025 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 option. 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-2025 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=yes 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=no break fi done # aligned with autoconf, so not including core; see bug#72225. rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM unset am_i]) if test "$am_cv_prog_cc_c_o" != 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="\$(top_srcdir)/compile \$(CC)" CC="$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) 2022-2025 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_RM_F # --------------- # Check whether 'rm -f' without any arguments works. # https://bugs.gnu.org/10828 AC_DEFUN([_AM_PROG_RM_F], [am__rm_f_notfound= AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) AC_SUBST(am__rm_f_notfound) ]) # Copyright (C) 2001-2025 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=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2025 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_SLEEP_FRACTIONAL_SECONDS # ---------------------------- AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl AC_CACHE_CHECK([whether sleep supports fractional seconds], am_cv_sleep_fractional_seconds, [dnl AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], [am_cv_sleep_fractional_seconds=no]) ])]) # _AM_FILESYSTEM_TIMESTAMP_RESOLUTION # ----------------------------------- # Determine the filesystem's resolution for file modification # timestamps. The coarsest we know of is FAT, with a resolution # of only two seconds, even with the most recent "exFAT" extensions. # The finest (e.g. ext4 with large inodes, XFS, ZFS) is one # nanosecond, matching clock_gettime. However, it is probably not # possible to delay execution of a shell script for less than one # millisecond, due to process creation overhead and scheduling # granularity, so we don't check for anything finer than that. (See below.) AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) AC_CACHE_CHECK([filesystem timestamp resolution], am_cv_filesystem_timestamp_resolution, [dnl # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `[ls -t conftest.ts[12]]` && { test "$[]*" != "X conftest.ts1 conftest.ts2" || test "$[]*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # 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". _AS_ECHO_UNQUOTED( ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], [AS_MESSAGE_LOG_FD]) AC_MSG_FAILURE([ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment.]) fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$[]2" = conftest.ts3 && test "$[]3" = conftest.ts2 && test "$[]4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ])]) # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) # This check should not be cached, as it may vary across builds of # different projects. 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=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_RESULT([no]) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_RESULT([no]) 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). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[]*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi test "$[]2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done AC_MSG_RESULT([$am_build_env_is_sane]) if test "$am_build_env_is_sane" = no; then AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ]) 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-2025 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 # ---------------- # Enable less verbose build rules support. AC_DEFUN([_AM_SILENT_RULES], [AM_DEFAULT_VERBOSITY=1 AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) 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=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no 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='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls dnl to AM_SILENT_RULES to change the default value. AC_CONFIG_COMMANDS_PRE([dnl case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi ])dnl ]) # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or # empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_REQUIRE([_AM_SILENT_RULES]) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])m4_newline dnl We intentionally force a newline after the assignment, since a) nothing dnl good can come of more text following, and b) that was the behavior dnl before 1.17. See https://bugs.gnu.org/72267. ]) # Copyright (C) 2001-2025 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 = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2025 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 = @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-2025 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=directory && $(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 works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${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=2097151 # 2^21 - 1 am_max_gid=$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=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test x$am_uid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) elif test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test x$gm_gid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) elif test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none 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=${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="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; 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=conftest.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=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR # Copyright (C) 2022-2025 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_XARGS_N # ---------------- # Check whether 'xargs -n' works. It should work everywhere, so the fallback # is not optimized at all as we never expect to use it. AC_DEFUN([_AM_PROG_XARGS_N], [AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' ])dnl AC_SUBST(am__xargs_n) ]) m4_include([m4/ax_add_fortify_source.m4]) m4_include([m4/ax_check_catchable_abrt.m4]) m4_include([m4/ax_check_catchable_segv.m4]) m4_include([m4/ax_check_compile_flag.m4]) m4_include([m4/ax_check_define.m4]) m4_include([m4/ax_check_link_flag.m4]) m4_include([m4/ax_pthread.m4]) m4_include([m4/ax_tls.m4]) m4_include([m4/ax_valgrind_check.m4]) m4_include([m4/ld-output-def.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]) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/appveyor.yml0000644000175100017510000000063015125531055017623 0ustar00runnerrunnerversion: 1.0.20.{build} os: Visual Studio 2022 environment: matrix: - platform: Win32 configuration: Debug - platform: Win32 configuration: Release - platform: x64 configuration: Debug - platform: x64 configuration: Release matrix: fast_finish: false init: msbuild /version build: parallel: true project: ci/appveyor/libsodium.vcxproj verbosity: normal ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/autogen.sh0000755000175100017510000000527715125531055017250 0ustar00runnerrunner#! /bin/sh args=$(getopt bfos "$@") if [ $? -ne 0 ]; then echo "Usage: autogen.sh [-b] [-f] [-o] [-s] [--]" echo echo "> -b: do not update the system detection scripts" echo "> -f: force the recreation of all autoconf scripts" echo "> -o: overwrite/downgrade system detection scripts" echo "> -s: setup an environment for developers" exit 2 fi force=false update_config=true overwrite_config=false dev_setup=false eval set -- "$args" while [ $# -ne 0 ]; do case $1 in -b) update_config=false ;; -f) force=true ;; -o) overwrite_config=true ;; -s) dev_setup=true ;; --) shift break ;; esac shift done if [ -s configure ]; then if [ "$force" != true ]; then echo "autoconf scripts already exist." >&2 exit 0 fi elif [ "$dev_setup" != true ]; then echo "A development environment was not created." exit 0 fi if glibtoolize --version >/dev/null 2>&1; then LIBTOOLIZE='glibtoolize' else LIBTOOLIZE='libtoolize' fi command -v command >/dev/null 2>&1 || { echo "command is required, but wasn't found on this system" exit 1 } command -v $LIBTOOLIZE >/dev/null 2>&1 || { echo "libtool is required, but wasn't found on this system" exit 1 } command -v autoconf >/dev/null 2>&1 || { echo "autoconf is required, but wasn't found on this system" exit 1 } command -v automake >/dev/null 2>&1 || { echo "automake is required, but wasn't found on this system" exit 1 } if [ "$overwrite_config" = false ]; then if [ -f build-aux/config.guess ]; then mv build-aux/config.guess build-aux/config.guess.stable fi if [ -f build-aux/config.sub ]; then mv build-aux/config.sub build-aux/config.sub.stable fi fi $LIBTOOLIZE --copy --install && aclocal && automake --add-missing --copy --force-missing --include-deps && autoconf && echo Done. if [ "$overwrite_config" = false ]; then if [ -f build-aux/config.guess.stable ]; then mv build-aux/config.guess.stable build-aux/config.guess fi if [ -f build-aux/config.sub.stable ]; then mv build-aux/config.sub.stable build-aux/config.sub fi fi [ "$update_config" = true ] && [ -z "$DO_NOT_UPDATE_CONFIG_SCRIPTS" ] && command -v curl >/dev/null 2>&1 && { echo "Downloading config.guess and config.sub..." curl -sSL --fail -o config.guess \ 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' && chmod +x config.guess && chmod +x build-aux/config.guess curl -sSL --fail -o config.sub \ 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' && chmod +x build-aux/config.sub && mv -f config.sub build-aux/config.sub echo "Done." } rm -f config.guess config.sub ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/azure-pipelines.yml0000644000175100017510000001303415125531055021074 0ustar00runnerrunnertrigger: - stable - next pr: none jobs: - job: "windows" pool: vmImage: "windows-latest" steps: - powershell: | cd builds\msvc\build & .\buildbase.bat ..\vs2026\libsodium.sln 18 displayName: Compile it all - powershell: | mkdir bin\include\sodium Copy-Item "src\libsodium\include\sodium\*.h" -Destination "bin\include\sodium" -Recurse Copy-Item "src\libsodium\include\*.h" -Destination "bin\include\" displayName: Copy header files - task: PublishBuildArtifacts@1 condition: not(canceled()) inputs: pathToPublish: bin artifactName: libsodium - job: "windows_2022" pool: vmImage: "windows-2022" steps: - powershell: | cd builds\msvc\build & .\buildbase.bat ..\vs2022\libsodium.sln 17 displayName: Compile it all - powershell: | mkdir bin\include\sodium Copy-Item "src\libsodium\include\sodium\*.h" -Destination "bin\include\sodium" -Recurse Copy-Item "src\libsodium\include\*.h" -Destination "bin\include\" displayName: Copy header files - task: PublishBuildArtifacts@1 condition: not(canceled()) inputs: pathToPublish: bin artifactName: libsodium - job: "windows_2019" pool: vmImage: "windows-2019" steps: - powershell: | cd builds\msvc\build & .\buildbase.bat ..\vs2019\libsodium.sln 16 displayName: Compile it all - powershell: | mkdir bin\include\sodium Copy-Item "src\libsodium\include\sodium\*.h" -Destination "bin\include\sodium" -Recurse Copy-Item "src\libsodium\include\*.h" -Destination "bin\include\" displayName: Copy header files - task: PublishBuildArtifacts@1 condition: not(canceled()) inputs: pathToPublish: bin artifactName: libsodium - job: mingw64 pool: vmImage: "windows-2019" steps: - powershell: | (New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2025-08-30/msys2-base-x86_64-20250830.sfx.exe", "sfx.exe") .\sfx.exe -y -o\ del sfx.exe displayName: Install MSYS2 - script: | set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem %CD:~0,2%\msys64\usr\bin\bash -lc %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Sydd filesystem" %CD:~0,2%\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' %CD:~0,2%\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' displayName: Update MSYS2 - script: | set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem %CD:~0,2%\msys64\usr\bin\pacman --noconfirm --needed -S base-devel mingw-w64-x86_64-toolchain %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Scc %CD:~0,2%\msys64\usr\bin\sed -i "s|#CacheDir.*|CacheDir=/c/Users/%USERNAME%/AppData/Local/Temp|g" /etc/pacman.conf displayName: Install Toolchain - script: | set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;%CD:~0,2%\msys64\usr\bin;%CD:~0,2%\msys64\bin set MSYS2_ROOT=%CD:~0,2%\msys64 set MSYSTEM=MINGW64 set CHERE_INVOKING=yes %MSYS2_ROOT%\cmd\msystem MINGW64 %CD:~0,2%\msys64\usr\bin\bash -lc dist-build/msys2-win64.sh env: CHERE_INVOKING: yes MSYS2_ARCH: x86_64 displayName: Compile libsodium - task: PublishBuildArtifacts@1 condition: not(canceled()) inputs: pathToPublish: libsodium-win64 artifactName: libsodium-win64 - job: mingw32 pool: vmImage: "windows-2019" steps: - powershell: | (New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2025-08-30/msys2-base-x86_64-20250830.sfx.exe", "sfx.exe") .\sfx.exe -y -o\ del sfx.exe displayName: Install MSYS2 - script: | set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem %CD:~0,2%\msys64\usr\bin\bash -lc %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Sydd filesystem" %CD:~0,2%\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' %CD:~0,2%\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' displayName: Update MSYS2 - script: | set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem %CD:~0,2%\msys64\usr\bin\pacman --noconfirm --needed -S base-devel mingw-w64-i686-toolchain %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Scc %CD:~0,2%\msys64\usr\bin\sed -i "s|#CacheDir.*|CacheDir=/c/Users/%USERNAME%/AppData/Local/Temp|g" /etc/pacman.conf displayName: Install Toolchain - script: | set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;%CD:~0,2%\msys64\usr\bin;%CD:~0,2%\msys64\bin set MSYS2_ROOT=%CD:~0,2%\msys64 set MSYSTEM=MINGW32 set CHERE_INVOKING=yes %MSYS2_ROOT%\cmd\msystem MINGW32 %CD:~0,2%\msys64\usr\bin\bash -lc dist-build/msys2-win32.sh env: CHERE_INVOKING: yes MSYS2_ARCH: x86_64 displayName: Compile libsodium - task: PublishBuildArtifacts@1 condition: not(canceled()) inputs: pathToPublish: libsodium-win32 artifactName: libsodium-win32 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1767289397.6230865 pynacl-1.6.2/src/libsodium/build-aux/0000755000175100017510000000000015125531066017130 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/build-aux/compile0000755000175100017510000001760015125531055020510 0ustar00runnerrunner#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2025-06-18.21; # UTC # Copyright (C) 1999-2025 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=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file unneeded_conversions # 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) UNNEEDED_CONVERSIONS, no # conversion will take place. func_file_conv () { file=$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*) if test -n "$MSYSTEM" && (cygpath --version) >/dev/null 2>&1; then # MSYS2 environment. file_conv=cygwin else # Original MinGW environment. file_conv=mingw fi ;; MSYS*) # Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell. file_conv=cygwin ;; CYGWIN*) # Cygwin environment. file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) # This is the optimization mentioned above: # If UNNEEDED_CONVERSIONS contains $file_conv, don't convert. ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -w "$file" || echo "$file"` ;; wine/*) file=`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=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.lo | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$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="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= 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 . GNU Automake home page: . General help using GNU software: . EOF exit $? ;; -v | --v*) echo "compile (GNU Automake) $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= 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=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$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=`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=`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=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%Y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/build-aux/config.guess0000755000175100017510000014306715125531055021461 0ustar00runnerrunner#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2024-07-27' # 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: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system '$me' is run on. Options: -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="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2024 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=" 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 $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # Just in case it came from the environment. GUESS= # 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. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c17 c99 c89 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #if defined(__ANDROID__) LIBC=android #else #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #elif defined(__LLVM_LIBC__) LIBC=llvm #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; 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". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$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=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) 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=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`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='-gnu' ;; *) release=`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. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/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=`/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=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; 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. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # 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 test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; 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. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like '4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # 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:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) 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=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int 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=`"$dummy"` then GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/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; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = 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="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if test "$HP_ARCH" = hppa2.0w then 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=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = 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=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; 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*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; 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:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-pc-managarm-mlibc" ;; *:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __ARM_EABI__ #ifdef __ARM_PCS_VFP ABI=eabihf #else ABI=eabi #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; esac fi GUESS=$CPU-unknown-linux-$LIBCABI ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; kvx:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; kvx:cos:*:*) GUESS=$UNAME_MACHINE-unknown-cos ;; kvx:mbr:*:*) GUESS=$UNAME_MACHINE-unknown-mbr ;; loongarch32:Linux:*:* | loongarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __i386__ ABI=x86 #else #ifdef __ILP32__ ABI=x32 #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in x86) CPU=i686 ;; x32) LIBCABI=${LIBC}x32 ;; esac fi GUESS=$CPU-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; 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. GUESS=i386-sequent-sysv4 ;; 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. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; 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. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; 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='' test -r /etc/.relid \ && OS_REL=.`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='.3' test -r /etc/.relid \ && OS_REL=.`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; } /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*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; ppc:Haiku:*:*) # Haiku running on Apple PowerPC GUESS=powerpc-apple-haiku ;; *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) GUESS=$UNAME_MACHINE-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *: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-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; *:Ironclad:*:*) GUESS=$UNAME_MACHINE-unknown-ironclad ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif int main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/build-aux/config.sub0000644000175100017510000011600715125531055021113 0ustar00runnerrunner#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2025 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale timestamp='2025-07-10' # 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"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # 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: # https://git.savannah.gnu.org/cgit/config.git/plain/config.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. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -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="\ GNU config.sub ($timestamp) Copyright 1992-2025 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=" 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 ;; *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 # Split fields of configuration type saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in cloudabi*-eabi* \ | kfreebsd*-gnu* \ | knetbsd*-gnu* \ | kopensolaris*-gnu* \ | ironclad-* \ | linux-* \ | managarm-* \ | netbsd*-eabi* \ | netbsd*-gnu* \ | nto-qnx* \ | os2-emx* \ | rtmk-nova* \ | storm-chaos* \ | uclinux-gnu* \ | uclinux-uclibc* \ | windows-* ) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) case $field1-$field2 in # Shorthands that happen to contain a single dash convex-c[12] | convex-c3[248]) basic_machine=$field2-convex basic_os= ;; decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Do not treat sunos as a manufacturer sun*os*) basic_machine=$field1 basic_os=$field2 ;; # Manufacturers 3100* \ | 32* \ | 3300* \ | 3600* \ | 7300* \ | acorn \ | altos* \ | apollo \ | apple \ | atari \ | att* \ | axis \ | be \ | bull \ | cbm \ | ccur \ | cisco \ | commodore \ | convergent* \ | convex* \ | cray \ | crds \ | dec* \ | delta* \ | dg \ | digital \ | dolphin \ | encore* \ | gould \ | harris \ | highlevel \ | hitachi* \ | hp \ | ibm* \ | intergraph \ | isi* \ | knuth \ | masscomp \ | microblaze* \ | mips* \ | motorola* \ | ncr* \ | news \ | next \ | ns \ | oki \ | omron* \ | pc533* \ | rebel \ | rom68k \ | rombug \ | semi \ | sequent* \ | sgi* \ | siemens \ | sim \ | sni \ | sony* \ | stratus \ | sun \ | sun[234]* \ | tektronix \ | tti* \ | ultra \ | unicom* \ | wec \ | winbond \ | wrs) basic_machine=$field1-$field2 basic_os= ;; tock* | zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # 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) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | delta-motorola | 3300-motorola | motorola-delta | motorola-3300) cpu=m68k vendor=motorola ;; # This used to be dpx2*, but that gets the RS6000-based # DPX/20 and the x86-based DPX/2-100 wrong. See # https://oldskool.silicium.org/stations/bull_dpx20.htm # https://www.feb-patrimoine.com/english/bull_dpx2.htm # https://www.feb-patrimoine.com/english/unix_and_bull.htm dpx2 | dpx2[23]00 | dpx2[23]xx) cpu=m68k vendor=bull ;; dpx2100 | dpx21xx) cpu=i386 vendor=bull ;; dpx20) cpu=rs6000 vendor=bull ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x"$basic_os" != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. obj= case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) saved_IFS=$IFS IFS="-" read kernel os <&2 fi ;; *) echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 exit 1 ;; esac case $obj in aout* | coff* | elf* | pe*) ;; '') # empty is fine ;; *) echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 exit 1 ;; esac # Here we handle the constraint that a (synthetic) cpu and os are # valid only in combination with each other and nowhere else. case $cpu-$os in # The "javascript-unknown-ghcjs" triple is used by GHC; we # accept it here in order to tolerate that, but reject any # variations. javascript-ghcjs) ;; javascript-* | *-ghcjs) echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os-$obj in linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ | linux-mlibc*- | linux-musl*- | linux-newlib*- \ | linux-relibc*- | linux-uclibc*- | linux-ohos*- ) ;; uclinux-uclibc*- | uclinux-gnu*- ) ;; ironclad-mlibc*-) ;; managarm-mlibc*- | managarm-kernel*- ) ;; windows*-msvc*-) ;; -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ | -uclibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; -kernel*- ) echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 exit 1 ;; *-kernel*- ) echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 exit 1 ;; *-msvc*- ) echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 exit 1 ;; kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) ;; vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; nto-qnx*-) ;; os2-emx-) ;; rtmk-nova-) ;; *-eabi*- | *-gnueabi*-) ;; ios*-simulator- | tvos*-simulator- | watchos*-simulator- ) ;; none--*) # None (no kernel, i.e. freestanding / bare metal), # can be paired with an machine code file format ;; -*-) # Blank kernel with real OS is always fine. ;; --*) # Blank kernel and OS with real machine code file format is always fine. ;; *-*-*) echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos* | *-solaris*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) vendor=ibm ;; *-ptx*) vendor=sequent ;; *-tpf*) vendor=ibm ;; *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; *-aux*) vendor=apple ;; *-hms*) vendor=hitachi ;; *-mpw* | *-macos*) vendor=apple ;; *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; *-vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "timestamp='" # time-stamp-format: "%Y-%02m-%02d" # time-stamp-end: "'" # End: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/build-aux/depcomp0000755000175100017510000005622415125531055020514 0ustar00runnerrunner#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2025-06-18.21; # UTC # Copyright (C) 1999-2025 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 . GNU Automake home page: . General help using GNU software: . EOF exit $? ;; -v | --v*) echo "depcomp (GNU Automake) $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=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`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=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz alpha=${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=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interference from the environment. gccflag= dashmflag= # 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" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = 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='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = 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='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc 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=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsolete pre-3.x GCC compilers. ## but also to in-use compilers like IBM 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=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? 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" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? 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 files 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" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? 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=$? 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=$base.d # For projects that build the same source file twice into different object # 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=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$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=$? # 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=`expr $i - 1` done fi i=`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" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? 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" = 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=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? 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" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? 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" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-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' otherwise. "$@" $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" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no 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=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`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 object. # 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" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " 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" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " 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' >> "$depfile" 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 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%Y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/build-aux/install-sh0000755000175100017510000003612215125531055021136 0ustar00runnerrunner#!/bin/sh # install - install a program, script, or datafile scriptversion=2025-06-18.21; # 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 the # 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, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # 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 not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # 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. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ 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 data modification 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. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -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 By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Report bugs to . GNU Automake home page: . General help using GNU software: ." while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 (GNU Automake) $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi 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=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$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 if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $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=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi 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=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibility 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. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # 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='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $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=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$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=true 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" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $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=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # 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 "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$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 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%Y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1767289389.0 pynacl-1.6.2/src/libsodium/build-aux/ltmain.sh0000644000175100017510000122322215125531055020752 0ustar00runnerrunner#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 # libtool (GNU libtool) 2.5.4 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2024 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. # 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 this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.5.4 package_revision=2.5.4 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_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 '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # 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=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # usable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # 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 returned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list in case some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_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 "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # 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. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$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=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`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=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; 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=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_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=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || 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_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$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= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$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=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution 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_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # 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). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" 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 () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # 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. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.5.4' # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd year=`date +%Y` cat < This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Originally written by Gordon Matzigkeit, 1996 (See AUTHORS for complete contributor listing) EOF exit $? } # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information --finish use operation '--mode=finish' --mode=MODE use operation mode MODE --no-finish don't update shared library cache --no-quiet, --no-silent print default informational messages --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --reorder-cache=DIRS reorder shared library cache for preferred DIRS --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_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 program 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=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' 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) version: $progname $scriptversion automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### 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 yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; 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=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$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="$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=`$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" != "$macro_revision"; then if test "$VERSION" != "$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 $VERSION $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 $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_reorder_cache=false opt_preserve_dup_deps=false opt_quiet=false opt_finishing=true opt_warning= nonopt= preserve_args= _G_rc_lt_options_prep=: # Shorthand for --mode=foo, 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 ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument '$1' for $_G_opt" exit_cmd=exit ;; esac shift ;; --no-finish) opt_finishing=false func_append preserve_args " $_G_opt" ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --reorder-cache) opt_reorder_cache=true shared_lib_dirs=$1 if test -n "$shared_lib_dirs"; then case $1 in # Must begin with /: /*) ;; # Catch anything else as an error (relative paths) *) func_error "invalid argument '$1' for $_G_opt" func_error "absolute paths are required for $_G_opt" exit_cmd=exit ;; esac fi shift ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { if $opt_warning; then $debug_cmd $warning_func ${1+"$@"} fi } # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host_os in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; 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=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # 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= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # 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 | func_generated_by_libtool_p } # 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=no 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=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # 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 () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # 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= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.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=$func_dirname_result/$objdir/${func_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 () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$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 () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = 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='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$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 () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`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_quoted_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/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$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=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= 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, and # $host is mingw, windows, cygwin, or some other w32 environment. Relies on a # correctly configured wine environment available, with the winepath program # in $build'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 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$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=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$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 name # 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 path 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 () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= 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 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$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 () { $debug_cmd 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=$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, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd 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" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$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 FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$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 # func_convert_delimited_path PATH ORIG_DELIMITER NEW_DELIMITER # Replaces a delimiter for a given path. func_convert_delimited_path () { converted_path=`$ECHO "$1" | $SED "s#$2#$3#g"` } # end func_convert_delimited_path ################################################## # $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 format. # 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 result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $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 () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$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=$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 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$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 () { $debug_cmd func_to_host_file_result=$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=`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 environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$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 set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$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=$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 installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$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 format. # 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 combinations, # the two new functions must follow this pattern, or func_init_to_host_path_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= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=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 () { $debug_cmd 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=$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 () { $debug_cmd func_to_host_path_result=$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=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$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 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`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 and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$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 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$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=$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 result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$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=$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=$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_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_reorder_shared_lib_cache DIRS # Reorder the shared library cache by unconfiguring previous shared library cache # and configuring preferred search directories before previous search directories. # Previous shared library cache: /usr/lib /usr/local/lib # Preferred search directories: /tmp/testing # Reordered shared library cache: /tmp/testing /usr/lib /usr/local/lib func_reorder_shared_lib_cache () { $debug_cmd case $host_os in openbsd*) get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` func_convert_delimited_path "$get_search_directories" ':' '\ ' save_search_directories=$converted_path func_convert_delimited_path "$1" ':' '\ ' # Ensure directories exist for dir in $converted_path; do # Ensure each directory is an absolute path case $dir in /*) ;; *) func_error "Directory '$dir' is not an absolute path" exit $EXIT_FAILURE ;; esac # Ensure no trailing slashes func_stripname '' '/' "$dir" dir=$func_stripname_result if test -d "$dir"; then if test -n "$preferred_search_directories"; then preferred_search_directories="$preferred_search_directories $dir" else preferred_search_directories=$dir fi else func_error "Directory '$dir' does not exist" exit $EXIT_FAILURE fi done PATH="$PATH:/sbin" ldconfig -U $save_search_directories PATH="$PATH:/sbin" ldconfig -m $preferred_search_directories $save_search_directories get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` func_convert_delimited_path "$get_search_directories" ':' '\ ' reordered_search_directories=$converted_path $ECHO "Original: $save_search_directories" $ECHO "Reordered: $reordered_search_directories" exit $EXIT_SUCCESS ;; *) func_error "--reorder-cache is not supported for host_os=$host_os." exit $EXIT_FAILURE ;; esac } # end func_reorder_shared_lib_cache # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal 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=target 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=no continue ;; -Xcompiler) arg_mode=arg # 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=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$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=$srcfile srcfile=$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=$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=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | windows* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; 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 warn = "$need_locks"; 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=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$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 warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "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" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; 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 warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "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" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $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 no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && 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=clean 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 passed 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=compile COMPILE-COMMAND... SOURCEFILE 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 -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file 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=execute 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 '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [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=install 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 installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link 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_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(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 symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -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 LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -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 libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -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 library 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 file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall 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 passed 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"; 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=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # If option '--reorder-cache', reorder the shared library cache and exit. if $opt_reorder_cache; then func_reorder_shared_lib_cache $shared_lib_dirs fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$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= case $file in *.la) func_resolve_sysroot "$file" file=$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= library_names= 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=$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=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= 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=$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=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else 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}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= 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=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $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" && $opt_finishing; 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="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && 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 if test "false" = "$opt_finishing"; then echo echo "NOTE: finish_cmds were not executed during testing, so you must" echo "manually run ldconfig to add a given test directory, LIBDIR, to" echo "the search path for generated executables." fi 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 '-LLIBDIR'" 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=LIBDIR eval flag=\"$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 finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_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_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_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=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. 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=$magic staticlibs= future_libdirs= current_libdirs= 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=$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= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "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=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Strip any trailing slash from the destination. func_stripname '' '/' "$libdir" destlibdir=$func_stripname_result func_stripname '' '/' "$destdir" s_destdir=$func_stripname_result # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` # 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" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$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 before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; 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" != "$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=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$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=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) 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 yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$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=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$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= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw* | *windows*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= 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=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$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=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$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=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$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=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && 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 () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$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 emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can'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 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$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_result'" $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=$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* | *windows* | *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" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *windows* | *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=$func_basename_result case $host in *cygwin* | *mingw* | *windows* | *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=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$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 case $host in i[3456]86-*-mingw32*) eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" ;; *) eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/__nm_//' >> '$nlist'" ;; esac } 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_symbol_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_symbol_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_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' 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[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi 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" >> "$output_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= 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=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= 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_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; 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=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # 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 () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]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 () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # 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 () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="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 () { $debug_cmd sharedlib_from_linklib_result=`$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 () { $debug_cmd match_literal=`$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/.*/====MARK====/ 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 /^====MARK====/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 /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # 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 that possess that section. Heuristic: eliminate # all those that 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_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 () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`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=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$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=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; 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 () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$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=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= 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_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $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="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # 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/windows # 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 where it is stored is # the $objdir directory. This is a cygwin/mingw/windows-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $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='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; 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=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $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=$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/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that 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= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$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 $PACKAGE) $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=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`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* | *-*-windows* | *-*-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=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw/windows when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$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=\`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='$outputname' progdir=\"\$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=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$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=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$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 #if defined _WIN32 && !defined __GNUC__ # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ _CRTIMP int __cdecl _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_platform || defined ... */ #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 #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) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == 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 (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "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 <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = 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 = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; 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) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; 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 = xstrdup (pathspec); char *p; int has_symlinks = 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) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\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 = realpath (pathspec, buf); if (tmp_pathspec == 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 != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\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 >= 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 = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != 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) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = 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 = 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 = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\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 = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw* | windows*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in 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 >= 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\035\036\037" #define SHELL_SPACE_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\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = 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 () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that 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=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= compile_rpath_tail= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= temp_rpath_tail= thread_safe=no vinfo= vinfo_number=no weak_libs= rpath_arg= single_module=$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 yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_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=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$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=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$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=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "argument to -rpath is not absolute: $arg" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$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=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes 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 allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_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=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$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]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-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-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && 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-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes 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. # -q