Full Code of besser82/libxcrypt for AI

develop 174c24d6e87a cached
173 files
2.2 MB
582.0k tokens
489 symbols
1 requests
Download .txt
Showing preview only (2,326K chars total). Download the full file or copy to clipboard to get everything.
Repository: besser82/libxcrypt
Branch: develop
Commit: 174c24d6e87a
Files: 173
Total size: 2.2 MB

Directory structure:
gitextract_7it7gsxl/

├── .github/
│   └── workflows/
│       ├── codecov.yml
│       ├── codeql.yml
│       ├── config-matrix.yml
│       ├── coverity.yml
│       ├── distcheck.yml
│       └── memcheck.yml
├── .gitignore
├── .packit.yaml
├── .perlcriticrc
├── .perltidyrc
├── AUTHORS
├── COPYING.LIB
├── ChangeLog
├── LICENSING
├── Makefile.am
├── NEWS
├── README.md
├── THANKS
├── TODO.md
├── autogen.sh
├── build-aux/
│   ├── ci/
│   │   ├── ci-log-dependency-versions
│   │   ├── ci-log-logfiles
│   │   ├── clang-gcov-wrapper
│   │   ├── configure-wrapper
│   │   └── summarize-coverage
│   ├── m4/
│   │   ├── ax_append_compile_flags.m4
│   │   ├── ax_append_flag.m4
│   │   ├── ax_check_compile_flag.m4
│   │   ├── ax_check_vscript.m4
│   │   ├── ax_gcc_func_attribute.m4
│   │   ├── ax_require_defined.m4
│   │   ├── ax_valgrind_check.m4
│   │   ├── pkg_compat.m4
│   │   ├── zw_alignment.m4
│   │   ├── zw_automodern.m4
│   │   ├── zw_detect_asan.m4
│   │   ├── zw_endianness.m4
│   │   ├── zw_ld_wrap.m4
│   │   ├── zw_prog_perl.m4
│   │   ├── zw_simple_warnings.m4
│   │   └── zw_static_assert.m4
│   └── scripts/
│       ├── BuildCommon.pm
│       ├── check-perlcritic-config
│       ├── compute-symver-floor
│       ├── expand-selected-hashes
│       ├── gen-crypt-h
│       ├── gen-crypt-hashes-h
│       ├── gen-crypt-symbol-vers-h
│       ├── gen-libcrypt-map
│       ├── move-if-change
│       └── skip-if-exec-format-error
├── codecov.yml
├── configure.ac
├── doc/
│   ├── crypt.3
│   ├── crypt.5
│   ├── crypt_checksalt.3
│   ├── crypt_gensalt.3
│   ├── crypt_gensalt_ra.3
│   ├── crypt_gensalt_rn.3
│   ├── crypt_preferred_method.3
│   ├── crypt_r.3
│   ├── crypt_ra.3
│   └── crypt_rn.3
├── lib/
│   ├── alg-des-tables.c
│   ├── alg-des.c
│   ├── alg-des.h
│   ├── alg-gost3411-2012-const.h
│   ├── alg-gost3411-2012-core.c
│   ├── alg-gost3411-2012-core.h
│   ├── alg-gost3411-2012-hmac.c
│   ├── alg-gost3411-2012-hmac.h
│   ├── alg-gost3411-2012-precalc.h
│   ├── alg-gost3411-2012-ref.h
│   ├── alg-hmac-sha1.c
│   ├── alg-hmac-sha1.h
│   ├── alg-md4.c
│   ├── alg-md4.h
│   ├── alg-md5.c
│   ├── alg-md5.h
│   ├── alg-sha1.c
│   ├── alg-sha1.h
│   ├── alg-sha256.c
│   ├── alg-sha256.h
│   ├── alg-sha512.c
│   ├── alg-sha512.h
│   ├── alg-sm3-hmac.c
│   ├── alg-sm3-hmac.h
│   ├── alg-sm3.c
│   ├── alg-sm3.h
│   ├── alg-yescrypt-common.c
│   ├── alg-yescrypt-opt.c
│   ├── alg-yescrypt-platform.c
│   ├── alg-yescrypt.h
│   ├── byteorder.h
│   ├── crypt-bcrypt.c
│   ├── crypt-des-obsolete.c
│   ├── crypt-des.c
│   ├── crypt-gensalt-static.c
│   ├── crypt-gost-yescrypt.c
│   ├── crypt-md5.c
│   ├── crypt-nthash.c
│   ├── crypt-obsolete.h
│   ├── crypt-pbkdf1-sha1.c
│   ├── crypt-port.h
│   ├── crypt-scrypt.c
│   ├── crypt-sha256.c
│   ├── crypt-sha512.c
│   ├── crypt-sm3-yescrypt.c
│   ├── crypt-sm3.c
│   ├── crypt-static.c
│   ├── crypt-sunmd5.c
│   ├── crypt-yescrypt.c
│   ├── crypt.c
│   ├── crypt.h.in
│   ├── gen-des-tables.c
│   ├── hashes.conf
│   ├── libcrypt.map.in
│   ├── libcrypt.minver
│   ├── libxcrypt.pc.in
│   ├── util-base64.c
│   ├── util-gensalt-sha.c
│   ├── util-get-random-bytes.c
│   ├── util-make-failure-token.c
│   ├── util-xbzero.c
│   ├── util-xstrcpy.c
│   └── xcrypt.h.in
├── libxcrypt.spec.rpkg
├── rpkg.conf
├── rpkg.macros
└── test/
    ├── TestCommon.pm
    ├── alg-des.c
    ├── alg-gost3411-2012-hmac.c
    ├── alg-gost3411-2012.c
    ├── alg-hmac-sha1.c
    ├── alg-md4.c
    ├── alg-md5.c
    ├── alg-pbkdf-hmac-sha256.c
    ├── alg-sha1.c
    ├── alg-sha256.c
    ├── alg-sha512.c
    ├── alg-sm3-hmac.c
    ├── alg-sm3.c
    ├── alg-yescrypt.c
    ├── badsalt.c
    ├── badsetting.c
    ├── byteorder.c
    ├── checksalt.c
    ├── compile-strong-alias.c
    ├── crypt-badargs.c
    ├── crypt-gost-yescrypt.c
    ├── crypt-nested-call.c
    ├── crypt-sm3-yescrypt.c
    ├── crypt-too-long-phrase.c
    ├── des-cases.h
    ├── des-obsolete.c
    ├── des-obsolete_r.c
    ├── explicit-bzero.c
    ├── gensalt-bcrypt_x.c
    ├── gensalt-extradata.c
    ├── gensalt-nested-call.c
    ├── gensalt-nthash.c
    ├── gensalt.c
    ├── getrandom-fallbacks.c
    ├── getrandom-interface.c
    ├── ka-table-gen.py
    ├── ka-table.inc
    ├── ka-tester.c
    ├── preferred-method.c
    ├── short-outbuf.c
    ├── special-char-salt.c
    ├── symbols-compat.pl
    ├── symbols-renames.pl
    └── symbols-static.pl

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/workflows/codecov.yml
================================================
name: "Code coverage"

on:
  pull_request:
  push:

jobs:
  skip_duplicates:
    continue-on-error: true
    runs-on: ubuntu-24.04
    outputs:
      should_skip: ${{ steps.skip_check.outputs.should_skip }}
    steps:
      - id: skip_check
        uses: fkirc/skip-duplicate-actions@v5
        with:
          concurrent_skipping: 'same_content_newer'
          skip_after_successful_duplicate: 'true'
          paths_ignore: '["doc/**", "**/*.md", ".gitignore", "libxcrypt.spec.rpkg", ".packit.yaml", "rpkg.macros", "AUTHORS", "ChangeLog", "COPYING.LIB", "LICENSING", "NEWS", "README", "THANKS", "TODO"]'
          do_not_skip: '["workflow_dispatch", "schedule"]'

  O0-Buildflags:
    needs: skip_duplicates
    if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }}

    runs-on: ubuntu-24.04

    strategy:
      fail-fast: false
      matrix:
        compiler: [gcc, clang]
        config_opts:
          - "--enable-obsolete-api --enable-hashes=all --enable-failure-tokens"
          - "--enable-obsolete-api --enable-obsolete-api-enosys --enable-hashes=all --enable-failure-tokens"
          - "--disable-obsolete-api --enable-hashes=all --enable-failure-tokens"
          # --enable-hashes=strong can only be used with --disable-obsolete-api
          - "--disable-obsolete-api --enable-failure-tokens --enable-hashes=strong"
          # failure tokens only affect the generic code so there's no point
          # testing with all of the hashes; use descrypt only, to get coverage
          # of the --enable-obsolete-api code in this mode, and to get coverage
          # of an "only one hash enabled" configuration.
          - "--enable-obsolete-api --disable-failure-tokens --enable-hashes=descrypt"

    env:
      ac_cv_func_arc4random_buf: "no"
      CC: ${{ matrix.compiler }}
      CONFIG_OPTS: ${{ matrix.config_opts }}
      CFLAGS: "-O0 -g -fprofile-arcs -ftest-coverage"
      CXXFLAGS: "-O0 -g -fprofile-arcs -ftest-coverage"
      LDFLAGS: "--coverage"
      VERBOSE: 1

    steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Install packages
      run: |
        packages="lcov libltdl-dev"
        if [ "$CC" = clang ]; then
          # need 'llvm' for llvm-cov, as well as clang
          packages="$packages clang llvm"
        fi
        sudo apt-get install $packages

    - name: Versions of build tools
      id: build-tools
      run: ./build-aux/ci/ci-log-dependency-versions

    - name: Get nprocs
      run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV

    - name: Cache bootstrap
      id: cache
      uses: actions/cache@v4
      with:
        path: |
          INSTALL
          Makefile.in
          aclocal.m4
          config.h.in
          configure
          autom4te.cache/**
          build-aux/m4/libtool.m4
          build-aux/m4/ltoptions.m4
          build-aux/m4/ltsugar.m4
          build-aux/m4/ltversion.m4
          build-aux/m4/lt~obsolete.m4
          build-aux/m4-autogen/**
        key: autoreconf-${{ steps.build-tools.outputs.autotools-ver }}-${{ hashFiles('autogen.sh', 'configure.ac', 'Makefile.am', 'build-aux/m4/*.m4', 'build-aux/m4-autogen/**') }}

    - name: Bootstrap
      if: steps.cache.outputs.cache-hit != 'true'
      run: ./autogen.sh

    - name: Configure
      run: ./configure $CONFIG_OPTS

    - name: Build
      run: |
        make -j${{ env.NPROCS }} all
        make -j${{ env.NPROCS }} test-programs

    - name: Test
      run: make -j${{ env.NPROCS }} check

    - name: Summarize coverage data
      run: ./build-aux/ci/summarize-coverage coverage.info

    - name: Upload coverage data to Codecov
      uses: codecov/codecov-action@v5
      with:
        fail_ci_if_error: true
        files: coverage.info
        token: ${{ secrets.CODECOV_TOKEN }}
        verbose: true

    - name: Detailed error logs
      if: failure()
      run: ./build-aux/ci/ci-log-logfiles


================================================
FILE: .github/workflows/codeql.yml
================================================
name: "CodeQL static analysis"

on:
  push:
  pull_request:
  schedule:
    - cron: '31 3 * * 1'  # Monday at 3h31 UTC

jobs:
  skip_duplicates:
    continue-on-error: true
    runs-on: ubuntu-24.04
    outputs:
      should_skip: ${{ steps.skip_check.outputs.should_skip }}
    steps:
      - id: skip_check
        uses: fkirc/skip-duplicate-actions@v5
        with:
          concurrent_skipping: 'same_content_newer'
          skip_after_successful_duplicate: 'true'
          paths_ignore: '["doc/**", "**/*.md", ".gitignore", "libxcrypt.spec.rpkg", ".packit.yaml", "rpkg.macros", "AUTHORS", "ChangeLog", "COPYING.LIB", "LICENSING", "NEWS", "README", "THANKS", "TODO"]'
          do_not_skip: '["workflow_dispatch", "schedule"]'

  CodeQL:
    needs: skip_duplicates
    if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }}

    runs-on: ubuntu-24.04
    permissions:
      actions: read
      contents: read
      security-events: write

    env:
      ac_cv_func_arc4random_buf: "no"

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Install packages
      run: sudo apt-get install libltdl-dev

    - name: Initialize CodeQL
      uses: github/codeql-action/init@v3
      with:
        # CodeQL lumps C with C++.  Perl is not currently supported.
        languages: cpp, python

        # If you wish to specify custom queries, you can do so here or in a
        # config file.  By default, queries listed here will override any
        # specified in a config file.  Prefix the list here with "+" to use
        # these queries and those in the config file.
        #queries:
        # - ./path/to/local/query
        # - your-org/your-repo/queries@main

    - name: Versions of build tools
      id: build-tools
      run: ./build-aux/ci/ci-log-dependency-versions

    - name: Get nprocs
      run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV

    - name: Cache bootstrap
      id: cache
      uses: actions/cache@v4
      with:
        path: |
          INSTALL
          Makefile.in
          aclocal.m4
          config.h.in
          configure
          autom4te.cache/**
          build-aux/m4/libtool.m4
          build-aux/m4/ltoptions.m4
          build-aux/m4/ltsugar.m4
          build-aux/m4/ltversion.m4
          build-aux/m4/lt~obsolete.m4
          build-aux/m4-autogen/**
        key: autoreconf-${{ steps.build-tools.outputs.autotools-ver }}-${{ hashFiles('autogen.sh', 'configure.ac', 'Makefile.am', 'build-aux/m4/*.m4', 'build-aux/m4-autogen/**') }}

    - name: Bootstrap
      if: steps.cache.outputs.cache-hit != 'true'
      run: ./autogen.sh

    - name: Configure
      run: ./configure --enable-obsolete-api --enable-hashes=all

    - name: Build
      run: |
        make -j${{ env.NPROCS }} all
        make -j${{ env.NPROCS }} test-programs

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v3

    - name: Detailed error logs
      if: failure()
      run: ./build-aux/ci/ci-log-logfiles


================================================
FILE: .github/workflows/config-matrix.yml
================================================
name: "Config Matrix"

on:
   pull_request:
   push:

jobs:
  skip_duplicates:
    continue-on-error: true
    runs-on: ubuntu-24.04
    outputs:
      should_skip: ${{ steps.skip_check.outputs.should_skip }}
    steps:
      - id: skip_check
        uses: fkirc/skip-duplicate-actions@v5
        with:
          concurrent_skipping: 'same_content_newer'
          skip_after_successful_duplicate: 'true'
          paths_ignore: '["doc/**", "**/*.md", ".gitignore", "libxcrypt.spec.rpkg", ".packit.yaml", "rpkg.macros", "AUTHORS", "ChangeLog", "COPYING.LIB", "LICENSING", "NEWS", "README", "THANKS", "TODO"]'
          do_not_skip: '["workflow_dispatch", "schedule"]'

  build:
    needs: skip_duplicates
    if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }}

    runs-on: ubuntu-24.04

    strategy:
      fail-fast: false
      matrix:
        compiler: [gcc, clang]
        config_opts:
        # General-purpose configurations with the obsolete APIs present.
        - "--enable-obsolete-api --enable-hashes=all"
        - "--enable-obsolete-api --enable-hashes=all --enable-obsolete-api-enosys"
        - "--enable-obsolete-api --enable-hashes=all --disable-failure-tokens"
        - "--enable-obsolete-api --enable-hashes=all --enable-obsolete-api-enosys --disable-failure-tokens"
        - "--enable-obsolete-api --enable-hashes=all --disable-symvers"
        - "--enable-obsolete-api --enable-hashes=glibc"
        - "--enable-obsolete-api=glibc --enable-hashes=strong,glibc"

        # General-purpose configurations with the obsolete APIs absent.
        # Note that the obsolete APIs are always absent from the static library,
        # so --disable-shared implies --disable-obsolete-api.
        - "--disable-obsolete-api --enable-hashes=all"
        - "--disable-obsolete-api --enable-hashes=all --disable-shared"
        - "--disable-obsolete-api --enable-hashes=all --disable-static"
        - "--disable-obsolete-api --enable-hashes=all --disable-failure-tokens"
        - "--disable-obsolete-api --enable-hashes=all --disable-symvers"
        - "--disable-obsolete-api --enable-hashes=strong"

        # Configurations with only one hash enabled.  These exist to
        # detect build failures due to incorrect ifdeffage.
        - "--disable-obsolete-api --enable-hashes=bcrypt"
        - "--disable-obsolete-api --enable-hashes=bcrypt_a"
        - "--disable-obsolete-api --enable-hashes=bcrypt_x"
        - "--disable-obsolete-api --enable-hashes=bcrypt_y"
        - "--disable-obsolete-api --enable-hashes=bigcrypt"
        - "--disable-obsolete-api --enable-hashes=bsdicrypt"
        - "--disable-obsolete-api --enable-hashes=descrypt"
        - "--disable-obsolete-api --enable-hashes=gost-yescrypt"
        - "--disable-obsolete-api --enable-hashes=md5crypt"
        - "--disable-obsolete-api --enable-hashes=nt"
        - "--disable-obsolete-api --enable-hashes=scrypt"
        - "--disable-obsolete-api --enable-hashes=sha1crypt"
        - "--disable-obsolete-api --enable-hashes=sha256crypt"
        - "--disable-obsolete-api --enable-hashes=sha512crypt"
        - "--disable-obsolete-api --enable-hashes=sm3crypt"
        - "--disable-obsolete-api --enable-hashes=sm3-yescrypt"
        - "--disable-obsolete-api --enable-hashes=sunmd5"
        - "--disable-obsolete-api --enable-hashes=yescrypt"

    env:
      ac_cv_func_arc4random_buf: "no"
      CC: ${{ matrix.compiler }}
      CONFIG_OPTS: ${{ matrix.config_opts }}
      LDFLAGS: "-Wl,--no-undefined-version"

    steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Install packages
      run: |
        packages="libltdl-dev"
        if [ "$CC" = clang ]; then
          packages="$packages clang"
        fi
        sudo apt-get install $packages

    - name: Versions of build tools
      id: build-tools
      run: ./build-aux/ci/ci-log-dependency-versions

    - name: Get nprocs
      run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV

    - name: Cache bootstrap
      id: cache
      uses: actions/cache@v4
      with:
        path: |
          INSTALL
          Makefile.in
          aclocal.m4
          config.h.in
          configure
          autom4te.cache/**
          build-aux/m4/libtool.m4
          build-aux/m4/ltoptions.m4
          build-aux/m4/ltsugar.m4
          build-aux/m4/ltversion.m4
          build-aux/m4/lt~obsolete.m4
          build-aux/m4-autogen/**
        key: autoreconf-${{ steps.build-tools.outputs.autotools-ver }}-${{ hashFiles('autogen.sh', 'configure.ac', 'Makefile.am', 'build-aux/m4/*.m4', 'build-aux/m4-autogen/**') }}

    - name: Bootstrap
      if: steps.cache.outputs.cache-hit != 'true'
      run: ./autogen.sh

    - name: Configure
      run: ./build-aux/ci/configure-wrapper $CONFIG_OPTS

    - name: Build
      run: |
        make -j${{ env.NPROCS }} all
        make -j${{ env.NPROCS }} test-programs

    - name: Test
      run: make -j${{ env.NPROCS }} check

    - name: Detailed error logs
      if: failure()
      run: ./build-aux/ci/ci-log-logfiles


================================================
FILE: .github/workflows/coverity.yml
================================================
name: Coverity

# Coverity Scan gives relatively low-quality reports and has strict
# rate limits, so we only run it on the main branch on a schedule.
on:
  schedule:
    - cron: '31 3 * * 1'  # Monday at 3h31 UTC
  workflow_dispatch:

jobs:
  Coverity:
    runs-on: ubuntu-24.04

    env:
      ac_cv_func_arc4random_buf: "no"
      CVT_PROJECT: besser82/libxcrypt

    # Coverity doesn't have official Github Actions integration yet.
    # The steps below were kitbashed together from the contents of
    # https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh
    # plus some notions from
    # https://github.com/ruby/actions-coverity-scan/blob/master/.github/workflows/coverity-scan.yml
    steps:
    - name: Check for authorization
      env:
        CVT_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
      run: |
        if [ -z "$CVT_TOKEN" ]; then
          printf '\033[33;1mCoverity Scan token not available.\033[0m\n'
          exit 1
        fi
        AUTH_RES=$(curl -s --form project="$CVT_PROJECT" \
                           --form token="$CVT_TOKEN" \
                           https://scan.coverity.com/api/upload_permitted)
        if [ "$AUTH_RES" = "Access denied" ]; then
          printf '\033[33;1mCoverity Scan API access denied.\033[0m\n'
          printf 'Check project name and access token.\n'
          exit 1
        else
          AUTH=$(printf '%s' "$AUTH_RES" | ruby -e "
            require 'rubygems'
            require 'json'
            puts JSON[STDIN.read]['upload_permitted']
          ")
          if [ "$AUTH" = "true" ]; then
            echo ok
            exit 0
          else
            WHEN=$(printf '%s' "$AUTH_RES" | ruby -e "
              require 'rubygems'
              require 'json'
              puts JSON[STDIN.read]['next_upload_permitted_at']
            ")
            printf '\033[33;1mCoverity Scan access blocked until %s.\033[0m\n' \
              "$WHEN"
            exit 1
          fi
        fi

    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Install packages
      run: sudo apt-get install libltdl-dev

    - name: Download Coverity Build Tool
      env:
        CVT_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
      run: |
        echo Downloading Coverity tools...
        # Put the tools in the parent directory so the build can't
        # clobber them by accident.
        cd ..
        curl --no-progress-meter -o cov-analysis-linux64.tar.gz \
             --form token="$CVT_TOKEN" \
             --form project="$CVT_PROJECT" \
             https://scan.coverity.com/download/cxx/linux64
        echo Extracting...
        mkdir cov-analysis-linux64
        tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
        echo done.
        if [ -f cov-analysis-linux64/VERSION ]; then
          echo ::group::Coverity tool versions
          echo + cat cov-analysis-linux64/VERSION
          echo
          cat cov-analysis-linux64/VERSION
          echo ::endgroup::
        fi

    - name: Versions of build tools
      id: build-tools
      run: ./build-aux/ci/ci-log-dependency-versions

    - name: Get nprocs
      run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV

    - name: Cache bootstrap
      id: cache
      uses: actions/cache@v4
      with:
        path: |
          INSTALL
          Makefile.in
          aclocal.m4
          config.h.in
          configure
          autom4te.cache/**
          build-aux/m4/libtool.m4
          build-aux/m4/ltoptions.m4
          build-aux/m4/ltsugar.m4
          build-aux/m4/ltversion.m4
          build-aux/m4/lt~obsolete.m4
          build-aux/m4-autogen/**
        key: autoreconf-${{ steps.build-tools.outputs.autotools-ver }}-${{ hashFiles('autogen.sh', 'configure.ac', 'Makefile.am', 'build-aux/m4/*.m4', 'build-aux/m4-autogen/**') }}

    - name: Bootstrap
      if: steps.cache.outputs.cache-hit != 'true'
      run: ./autogen.sh

    - name: Configure
      run: ./configure --disable-werror --enable-obsolete-api --enable-hashes=all

    - name: Prepare build script
      run: |
        echo '#! /bin/sh' > cov_make.sh
        echo "make -j${{ env.NPROCS }} all" >> cov_make.sh
        echo "make -j${{ env.NPROCS }} test-programs" >> cov_make.sh
        chmod +x cov_make.sh

    - name: Build
      run: |
        export PATH=$(cd .. && pwd)/cov-analysis-linux64/bin:$PATH
        cov-build --dir cov-int ./cov_make.sh
        cov-import-scm --dir cov-int --scm git --log cov-int/scm_log.txt

    - name: Upload analysis results
      env:
        CVT_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
        CVT_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
      run: |
        tar czvf cov-int.tar.gz cov-int
        printf 'Uploading Coverity Scan Analysis results...\n'
        response=$(curl -s --write-out '\n%{http_code}\n' \
          --form project="$CVT_PROJECT" \
          --form token="$CVT_TOKEN" \
          --form email="$CVT_EMAIL" \
          --form file=@cov-int.tar.gz \
          --form version="${GITHUB_REF}" \
          --form description="${GITHUB_SHA}" \
          https://scan.coverity.com/builds)
        status_code=$(echo "$response" | sed -n '$p')
        if [ "$status_code" = "200" ] || [ "$status_code" = "201" ] ; then
          printf 'Upload complete.\n'
          exit 0
        else
          TEXT=$(echo "$response" | sed '$d')
          printf '\033[33;1mCoverity Scan upload failed:\033[0m\n%s.\n' "$TEXT"
          exit 1
        fi

    - name: Detailed error logs
      if: failure()
      run: ./build-aux/ci/ci-log-logfiles


================================================
FILE: .github/workflows/distcheck.yml
================================================
name: Distcheck

on:
  push:
  pull_request:
  schedule:
  - cron: '31 3 * * 1'  # Monday at 3h31 UTC

jobs:
  skip_duplicates:
    # continue-on-error: true # Uncomment once integration is finished
    runs-on: ubuntu-24.04
    outputs:
      should_skip: ${{ steps.skip_check.outputs.should_skip }}
    steps:
      - id: skip_check
        uses: fkirc/skip-duplicate-actions@v5
        with:
          concurrent_skipping: 'same_content_newer'
          skip_after_successful_duplicate: 'true'
          paths_ignore: '[]' # changes in any file can affect distcheck
          do_not_skip: '["workflow_dispatch", "schedule"]'

  Distcheck:
    needs: skip_duplicates
    if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }}

    runs-on: ubuntu-24.04

    strategy:
      fail-fast: false

    env:
      ac_cv_func_arc4random_buf: "no"
      VERBOSE: 1

    steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Install packages
      run: sudo apt-get install libltdl-dev

      # The distcheck build is run with the oldest version of perl we support,
      # in order to verify that we still support it.
    - name: Install Perl 5.14
      uses: shogo82148/actions-setup-perl@v1
      with:
        perl-version: '5.14'

      # 'make distcheck' runs perlcritic on all our Perl code.
      # Install exactly the set of critic-related CPAN distributions
      # documented in .perlcriticrc.
      # One perlcritic policy has a stealth dependency on aspell.
    - name: Install perlcritic and perltidy
      run: |
        sudo apt-get install aspell
        cpanm -S -M https://cpan.metacpan.org/ -n -i $(sed -Ene '
             s/^#[[:space:]]+([A-Z0-9]+\/.+\.tar\.gz)$/\1/p
             /^$/q
          ' .perlcriticrc)

    - name: Versions of build tools
      id: build-tools
      run: ./build-aux/ci/ci-log-dependency-versions

    - name: Get nprocs
      run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV

    - name: Cache bootstrap
      id: cache
      uses: actions/cache@v4
      with:
        path: |
          INSTALL
          Makefile.in
          aclocal.m4
          config.h.in
          configure
          autom4te.cache/**
          build-aux/m4/libtool.m4
          build-aux/m4/ltoptions.m4
          build-aux/m4/ltsugar.m4
          build-aux/m4/ltversion.m4
          build-aux/m4/lt~obsolete.m4
          build-aux/m4-autogen/**
        key: autoreconf-${{ steps.build-tools.outputs.autotools-ver }}-${{ hashFiles('autogen.sh', 'configure.ac', 'Makefile.am', 'build-aux/m4/*.m4', 'build-aux/m4-autogen/**') }}

    - name: Bootstrap
      if: steps.cache.outputs.cache-hit != 'true'
      run: ./autogen.sh

      # The configure options used in this step do not matter, we just need
      # the makefile to exist.
    - name: Configure
      run: ./configure

    - name: Test
      run: make -j${{ env.NPROCS }} distcheck

    - name: Detailed error logs
      if: failure()
      run: ./build-aux/ci/ci-log-logfiles


================================================
FILE: .github/workflows/memcheck.yml
================================================
name: Memory access checking

on:
  push:
  pull_request:

jobs:
  skip_duplicates:
    continue-on-error: true
    runs-on: ubuntu-24.04
    outputs:
      should_skip: ${{ steps.skip_check.outputs.should_skip }}
    steps:
      - id: skip_check
        uses: fkirc/skip-duplicate-actions@v5
        with:
          concurrent_skipping: 'same_content_newer'
          skip_after_successful_duplicate: 'true'
          paths_ignore: '["doc/**", "**/*.md", ".gitignore", "libxcrypt.spec.rpkg", ".packit.yaml", "rpkg.macros", "AUTHORS", "ChangeLog", "COPYING.LIB", "LICENSING", "NEWS", "README", "THANKS", "TODO"]'
          do_not_skip: '["workflow_dispatch", "schedule"]'

  Valgrind:
    needs: skip_duplicates
    if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }}

    runs-on: ubuntu-24.04

    strategy:
      fail-fast: false
      matrix:
        compiler: [gcc, clang]

    env:
      ac_cv_func_arc4random_buf: "no"
      CC: ${{ matrix.compiler }}
      LDFLAGS: "-Wl,--no-undefined-version"
      VERBOSE: 1

    steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Install packages
      run: sudo apt-get install clang libltdl-dev valgrind

    - name: Versions of build tools
      id: build-tools
      run: ./build-aux/ci/ci-log-dependency-versions

    - name: Get nprocs
      run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV

    - name: Cache bootstrap
      id: cache
      uses: actions/cache@v4
      with:
        path: |
          INSTALL
          Makefile.in
          aclocal.m4
          config.h.in
          configure
          autom4te.cache/**
          build-aux/m4/libtool.m4
          build-aux/m4/ltoptions.m4
          build-aux/m4/ltsugar.m4
          build-aux/m4/ltversion.m4
          build-aux/m4/lt~obsolete.m4
          build-aux/m4-autogen/**
        key: autoreconf-${{ steps.build-tools.outputs.autotools-ver }}-${{ hashFiles('autogen.sh', 'configure.ac', 'Makefile.am', 'build-aux/m4/*.m4', 'build-aux/m4-autogen/**') }}

    - name: Bootstrap
      if: steps.cache.outputs.cache-hit != 'true'
      run: ./autogen.sh

    - name: Configure
      run: ./build-aux/ci/configure-wrapper --enable-obsolete-api --enable-hashes=all --enable-valgrind-memcheck

    - name: Build
      run: |
        make -j${{ env.NPROCS }} all
        make -j${{ env.NPROCS }} test-programs

    - name: Test
      run: make -j${{ env.NPROCS }} check-valgrind-memcheck

    - name: Detailed error logs
      if: failure()
      run: ./build-aux/ci/ci-log-logfiles

  ASan-UBSan:
    needs: skip_duplicates
    if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }}

    runs-on: ubuntu-24.04

    strategy:
      fail-fast: false
      matrix:
        compiler: [gcc, clang]

    env:
      ac_cv_func_arc4random_buf: "no"
      CC: ${{ matrix.compiler }}
      DEB_BUILD_MAINT_OPTIONS: hardening=+all sanitize=+address,+leak,+undefined
      LDFLAGS: "-Wl,--no-undefined-version"
      VERBOSE: 1

    steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Install packages
      run: |
        packages="libltdl-dev"
        if [ "$CC" = clang ]; then
          packages="$packages clang"
        fi
        sudo apt-get install $packages

    - name: Versions of build tools
      id: build-tools
      run: ./build-aux/ci/ci-log-dependency-versions

    - name: Cache bootstrap
      id: cache
      uses: actions/cache@v4
      with:
        path: |
          INSTALL
          Makefile.in
          aclocal.m4
          config.h.in
          configure
          autom4te.cache/**
          build-aux/m4/libtool.m4
          build-aux/m4/ltoptions.m4
          build-aux/m4/ltsugar.m4
          build-aux/m4/ltversion.m4
          build-aux/m4/lt~obsolete.m4
          build-aux/m4-autogen/**
        key: autoreconf-${{ steps.build-tools.outputs.autotools-ver }}-${{ hashFiles('autogen.sh', 'configure.ac', 'Makefile.am', 'build-aux/m4/*.m4', 'build-aux/m4-autogen/**') }}

    - name: Bootstrap
      if: steps.cache.outputs.cache-hit != 'true'
      run: ./autogen.sh

    - name: Configure
      run: ./build-aux/ci/configure-wrapper --enable-obsolete-api --enable-hashes=all

    - name: Build
      run: |
        make -j${{ env.NPROCS }} all UNDEF_FLAG=
        make -j${{ env.NPROCS }} test-programs UNDEF_FLAG=

    - name: Test
      run: make -j${{ env.NPROCS }} check

    - name: Detailed error logs
      if: failure()
      run: ./build-aux/ci/ci-log-logfiles


================================================
FILE: .gitignore
================================================
# http://www.gnu.org/software/automake
/Makefile
/Makefile.deps
/Makefile.in
.deps/
.dirstamp
.libs/
/INSTALL

# http://www.gnu.org/software/autoconf
/aclocal.m4
/autom4te.cache
/config.cache
/config.h
/config.h.in
/config.log
/config.status
/configure
/crypt.h.in
/libtool
/libxcrypt.pc
/stamp-h1
/build-aux/m4/libtool.m4
/build-aux/m4/ltoptions.m4
/build-aux/m4/ltsugar.m4
/build-aux/m4/ltversion.m4
/build-aux/m4/lt~obsolete.m4
/build-aux/m4-autogen/*


# compiler output
*.gcda
*.gcno
*.la
*.lo
*.log
*.o
*.so
*.trs
*.T
/crypt.h
/crypt.h.stamp
/crypt-hashes.h
/crypt-hashes.h.stamp
/crypt-symbol-vers.h
/crypt-symbol-vers.h.stamp
/libcrypt.map
/libcrypt.map.stamp
gen-des-tables
test/alg-des
test/alg-gost3411-2012
test/alg-gost3411-2012-hmac
test/alg-hmac-sha1
test/alg-md4
test/alg-md5
test/alg-pbkdf-hmac-sha256
test/alg-sha1
test/alg-sha256
test/alg-sha512
test/alg-sm3
test/alg-sm3-hmac
test/alg-yescrypt
test/badsalt
test/badsetting
test/bigcrypt
test/byteorder
test/checksalt
test/compile-strong-alias
test/crypt-badargs
test/crypt-bcrypt
test/crypt-des
test/crypt-gost-yescrypt
test/crypt-kat
test/crypt-md5
test/crypt-nested-call
test/crypt-nthash
test/crypt-pbkdf1-sha1
test/crypt-scrypt
test/crypt-sha256
test/crypt-sha512
test/crypt-sm3-yescrypt
test/crypt-sunmd5
test/crypt-too-long-phrase
test/crypt-yescrypt
test/des-obsolete
test/des-obsolete_r
test/explicit-bzero
test/fcrypt-enosys
test/gensalt
test/gensalt-bcrypt_x
test/gensalt-nested-call
test/gensalt-nthash
test/gensalt-extradata
test/getrandom-fallbacks
test/getrandom-interface
test/ka-bcrypt
test/ka-bcrypt-a
test/ka-bcrypt-x
test/ka-bcrypt-y
test/ka-bigcrypt
test/ka-bsdicrypt
test/ka-descrypt
test/ka-gost-yescrypt
test/ka-md5crypt
test/ka-nt
test/ka-scrypt
test/ka-sha1crypt
test/ka-sha256crypt
test/ka-sha512crypt
test/ka-sm3crypt
test/ka-sm3-yescrypt
test/ka-sunmd5
test/ka-yescrypt
test/preferred-method
test/short-outbuf
test/special-char-salt
/xcrypt.h
/xcrypt.h.stamp

# backup-files
*~

# archives
*.tar*

# GnuPG keyrings
*.asc
*.gpg

# Valgrind
vgcore.*

# Patch
*.orig
*.rej

# Coverage
all_coverage.info
coverage.info

# Packit
libxcrypt.spec
libxcrypt-*.rpm
libxcrypt-*.srpm
libxcrypt-*.src.rpm
libxcrypt-*/
*/libxcrypt-*.rpm


================================================
FILE: .packit.yaml
================================================
specfile_path: libxcrypt.spec

files_to_sync:
  - libxcrypt.spec
  - .packit.yaml

upstream_package_name: libxcrypt
upstream_project_url: https://github.com/besser82/libxcrypt
upstream_tag_template: v{version}
downstream_package_name: libxcrypt
dist_git_namespace: rpms
create_pr: True

actions:
  post-upstream-clone: "wget https://src.fedoraproject.org/rpms/libxcrypt/raw/main/f/libxcrypt.spec -O libxcrypt.spec"
  post-modifications: "sed -i -e 's!%bcond_with    bootstrap!%bcond_without bootstrap!g' -e 's!^Patch!#&!g' libxcrypt.spec"

jobs:
- job: upstream_koji_build
  trigger: commit
  metadata:
    branch: develop
    scratch: true
    targets: fedora-all

- job: upstream_koji_build
  trigger: pull_request
  metadata:
    scratch: true
    targets: fedora-all

- job: propose_downstream
  trigger: release


================================================
FILE: .perlcriticrc
================================================
# Perl::Critic configuration.  -*- conf -*-
#
# This .perlcriticrc expects precisely the following set of critic
# policies and related distributions to be installed, **and no others**:
#
#          SHANCOCK/Perl-Tidy-20210402.tar.gz
#          PETDANCE/Perl-Critic-1.140.tar.gz
#          DBOOK/Perl-Critic-Community-v1.0.0.tar.gz
#          KRYDE/Perl-Critic-Pulp-99.tar.gz
#          GUGOD/Perl-Critic-TooMuchCode-0.15.tar.gz
#
# Make sure to keep this list in sync with the CI configuration.
#
# In order to ensure stable lint results, we explicitly enable or
# disable every single policy from the policy packages we use, and we
# have an ancillary script (build-aux/scripts/check-perlcritic-config)
# that enforces that _all_ installed policies are mentioned and _all_
# mentioned policies are installed.

# Start from the empty set, but with severity maxed.
severity = 1
only = 1

# compilation-mode--compatible diagnostic formatting
verbose = %f:%l:%c: warning: %m (%p; %e)\n

# Policies are listed strictly in alphabetical order.
# Each disabled policy should be annotated with an explanation.

[-BuiltinFunctions::ProhibitBooleanGrep]
# The rationale for prohibiting boolean 'grep' is sensible
# (it doesn't short-circuit, which could be a huge waste of time)
# but the recommended alternative is 'any' from List::MoreUtils,
# which would be the only CPAN dependency we had.

[BuiltinFunctions::ProhibitComplexMappings]

[BuiltinFunctions::ProhibitLvalueSubstr]

[BuiltinFunctions::ProhibitReverseSortBlock]

[BuiltinFunctions::ProhibitShiftRef]

[BuiltinFunctions::ProhibitSleepViaSelect]

[BuiltinFunctions::ProhibitStringyEval]

[BuiltinFunctions::ProhibitStringySplit]

[BuiltinFunctions::ProhibitUniversalCan]

[BuiltinFunctions::ProhibitUniversalIsa]

[BuiltinFunctions::ProhibitUselessTopic]

[BuiltinFunctions::ProhibitVoidGrep]

[BuiltinFunctions::ProhibitVoidMap]

[BuiltinFunctions::RequireBlockGrep]

[BuiltinFunctions::RequireBlockMap]

[BuiltinFunctions::RequireGlobFunction]

[BuiltinFunctions::RequireSimpleSortBlock]

[ClassHierarchies::ProhibitAutoloading]

[ClassHierarchies::ProhibitExplicitISA]

[ClassHierarchies::ProhibitOneArgBless]

[CodeLayout::ProhibitFatCommaNewline]

[CodeLayout::ProhibitHardTabs]

[CodeLayout::ProhibitIfIfSameLine]

[CodeLayout::ProhibitParensWithBuiltins]

[CodeLayout::ProhibitQuotedWordLists]

[CodeLayout::ProhibitTrailingWhitespace]

[CodeLayout::RequireConsistentNewlines]

[CodeLayout::RequireFinalSemicolon]

[CodeLayout::RequireTidyCode]
perltidyrc = .perltidyrc

[CodeLayout::RequireTrailingCommaAtNewline]

[CodeLayout::RequireTrailingCommas]

[-Community::AmpersandSubCalls]
# Duplicates core or pulp policy.

[-Community::ArrayAssignAref]
# Duplicates core or pulp policy.

[-Community::BarewordFilehandles]
# Duplicates core or pulp policy.

[-Community::ConditionalDeclarations]
# Duplicates core or pulp policy.

[Community::ConditionalImplicitReturn]

[Community::DeprecatedFeatures]

[-Community::DiscouragedModules]
# FindBin works fine for our purposes, and we can't use CPAN modules.
# There is no option to ignore use of just one module
# (https://github.com/Grinnz/Perl-Critic-Community/issues/42)

[Community::DollarAB]

[-Community::Each]
# I don't agree with this style rule.

[Community::EmptyReturn]

[-Community::IndirectObjectNotation]
# Duplicates core or pulp policy.

[-Community::LexicalForeachIterator]
# Duplicates core or pulp policy.

[-Community::LoopOnHash]
# Duplicates core or pulp policy.

[Community::ModPerl]

[Community::MultidimensionalArrayEmulation]

[-Community::OpenArgs]
# Duplicates core or pulp policy.

[Community::OverloadOptions]

[-Community::POSIXImports]
# Duplicates core or pulp policy.

[-Community::PackageMatchesFilename]
# Duplicates core or pulp policy.

[Community::PreferredAlternatives]

[-Community::Prototypes]
# Duplicates core or pulp policy.

[-Community::StrictWarnings]
# Duplicates core or pulp policy.

[Community::Threads]

[-Community::Wantarray]
# I don't agree with this style rule.

[Community::WarningsSwitch]

[-Community::WhileDiamondDefaultAssignment]
# I don't agree with this style rule.

[Compatibility::ConstantLeadingUnderscore]

[Compatibility::ConstantPragmaHash]

[Compatibility::Gtk2Constants]

[Compatibility::PodMinimumVersion]

[Compatibility::ProhibitUnixDevNull]

[ControlStructures::ProhibitCStyleForLoops]

[ControlStructures::ProhibitCascadingIfElse]
max_elsif = 3

[ControlStructures::ProhibitDeepNests]

[ControlStructures::ProhibitLabelsWithSpecialBlockNames]

[ControlStructures::ProhibitMutatingListFunctions]

[ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions]

[-ControlStructures::ProhibitPostfixControls]
# I don't agree with this style rule.

[ControlStructures::ProhibitUnlessBlocks]

[ControlStructures::ProhibitUnreachableCode]

[ControlStructures::ProhibitUntilBlocks]

[ControlStructures::ProhibitYadaOperator]

[Documentation::PodSpelling]

[Documentation::ProhibitAdjacentLinks]

[Documentation::ProhibitBadAproposMarkup]

[Documentation::ProhibitDuplicateHeadings]

[Documentation::ProhibitDuplicateSeeAlso]

[Documentation::ProhibitLinkToSelf]

[Documentation::ProhibitParagraphEndComma]

[Documentation::ProhibitParagraphTwoDots]

[Documentation::ProhibitUnbalancedParens]

[Documentation::ProhibitVerbatimMarkup]

[Documentation::RequireEndBeforeLastPod]

[Documentation::RequireFilenameMarkup]

[Documentation::RequireFinalCut]

[Documentation::RequireLinkedURLs]

[Documentation::RequirePackageMatchesPodName]

[Documentation::RequirePodAtEnd]

[Documentation::RequirePodSections]

[-ErrorHandling::RequireCarping]
# This only makes sense for large libraries with lots of consumers.

[ErrorHandling::RequireCheckingReturnValueOfEval]

# All Freenode:: backward compatibility aliases are disabled.
# See https://github.com/Grinnz/Perl-Critic-Community/issues/41
[-Freenode::AmpersandSubCalls]
[-Freenode::ArrayAssignAref]
[-Freenode::BarewordFilehandles]
[-Freenode::ConditionalDeclarations]
[-Freenode::ConditionalImplicitReturn]
[-Freenode::DeprecatedFeatures]
[-Freenode::DiscouragedModules]
[-Freenode::DollarAB]
[-Freenode::Each]
[-Freenode::EmptyReturn]
[-Freenode::IndirectObjectNotation]
[-Freenode::LexicalForeachIterator]
[-Freenode::LoopOnHash]
[-Freenode::ModPerl]
[-Freenode::MultidimensionalArrayEmulation]
[-Freenode::OpenArgs]
[-Freenode::OverloadOptions]
[-Freenode::POSIXImports]
[-Freenode::PackageMatchesFilename]
[-Freenode::PreferredAlternatives]
[-Freenode::Prototypes]
[-Freenode::StrictWarnings]
[-Freenode::Threads]
[-Freenode::Wantarray]
[-Freenode::WarningsSwitch]
[-Freenode::WhileDiamondDefaultAssignment]

[InputOutput::ProhibitBacktickOperators]

[InputOutput::ProhibitBarewordFileHandles]

[InputOutput::ProhibitExplicitStdin]

[InputOutput::ProhibitInteractiveTest]

[InputOutput::ProhibitJoinedReadline]

[InputOutput::ProhibitOneArgSelect]

[InputOutput::ProhibitReadlineInForLoop]

[InputOutput::ProhibitTwoArgOpen]

[InputOutput::RequireBracedFileHandleWithPrint]

[-InputOutput::RequireBriefOpen]
# I can't find any explanation of what qualifies as "brief" and the
# diagnostic triggers on perfectly sensible code.

[InputOutput::RequireCheckedClose]

[InputOutput::RequireCheckedOpen]

[InputOutput::RequireCheckedSyscalls]
functions = :builtins
exclude_functions = print

[InputOutput::RequireEncodingWithUTF8Layer]

[Miscellanea::ProhibitFormats]

[Miscellanea::ProhibitTies]

[Miscellanea::ProhibitUnrestrictedNoCritic]

[Miscellanea::ProhibitUselessNoCritic]

[Miscellanea::TextDomainPlaceholders]

[Miscellanea::TextDomainUnused]

[Modules::ProhibitAutomaticExportation]

[Modules::ProhibitConditionalUseStatements]

[Modules::ProhibitEvilModules]

[Modules::ProhibitExcessMainComplexity]

[Modules::ProhibitModuleShebang]

[Modules::ProhibitMultiplePackages]

[Modules::ProhibitPOSIXimport]

[Modules::ProhibitUseQuotedVersion]

[Modules::RequireBarewordIncludes]

[Modules::RequireEndWithOne]

[Modules::RequireExplicitPackage]

[Modules::RequireFilenameMatchesPackage]

[Modules::RequireNoMatchVarsWithUseEnglish]

[-Modules::RequireVersionVar]
# This only makes sense for large libraries with lots of consumers.

[-NamingConventions::Capitalization]
# I don't agree with this style rule.

[NamingConventions::ProhibitAmbiguousNames]

[Objects::ProhibitIndirectSyntax]

[References::ProhibitDoubleSigils]

[RegularExpressions::ProhibitCaptureWithoutTest]

[-RegularExpressions::ProhibitComplexRegexes]
# The "complex" regexes are not that bad and splitting them up
# would only obscure the logic.

[-RegularExpressions::ProhibitEnumeratedClasses]
# I don't agree with this style rule.

[-RegularExpressions::ProhibitEscapedMetacharacters]
# I don't agree with this style rule.

[RegularExpressions::ProhibitFixedStringMatches]

[RegularExpressions::ProhibitSingleCharAlternation]

[RegularExpressions::ProhibitUnusedCapture]

[RegularExpressions::ProhibitUnusualDelimiters]

[RegularExpressions::ProhibitUselessTopic]

[RegularExpressions::RequireBracesForMultiline]

[-RegularExpressions::RequireDotMatchAnything]
# I don't agree with this style rule.

[-RegularExpressions::RequireExtendedFormatting]
# I don't agree with this style rule.

[-RegularExpressions::RequireLineBoundaryMatching]
# I don't agree with this style rule.

[Subroutines::ProhibitAmpersandSigils]

[Subroutines::ProhibitBuiltinHomonyms]

[-Subroutines::ProhibitExcessComplexity]
# The "complex" subroutines are not that bad and splitting them up
# would only obscure the logic.

[Subroutines::ProhibitExplicitReturnUndef]

[Subroutines::ProhibitManyArgs]

[Subroutines::ProhibitNestedSubs]

[Subroutines::ProhibitReturnSort]

[Subroutines::ProhibitSubroutinePrototypes]

[Subroutines::ProhibitUnusedPrivateSubroutines]

[Subroutines::ProtectPrivateSubs]

[Subroutines::RequireArgUnpacking]

[Subroutines::RequireFinalReturn]
terminal_funcs = fail skip error invocation_error subprocess_error

[TestingAndDebugging::ProhibitNoStrict]

[TestingAndDebugging::ProhibitNoWarnings]
allow = experimental::smartmatch experimental::re_strict

[TestingAndDebugging::ProhibitProlongedStrictureOverride]

[TestingAndDebugging::RequireTestLabels]

[TestingAndDebugging::RequireUseStrict]

[TestingAndDebugging::RequireUseWarnings]

[-TooMuchCode::ProhibitDuplicateLiteral]
# I don't agree with this style rule.

[TooMuchCode::ProhibitDuplicateSub]

[TooMuchCode::ProhibitExcessiveColons]

[TooMuchCode::ProhibitExtraStricture]

[TooMuchCode::ProhibitLargeBlock]

[TooMuchCode::ProhibitLargeTryBlock]

[TooMuchCode::ProhibitUnnecessaryScalarKeyword]

[-TooMuchCode::ProhibitUnnecessaryUTF8Pragma]
# We intentionally 'use utf8' in every file, regardless of whether it
# currently has non-ASCII characters in it.

[TooMuchCode::ProhibitUnusedConstant]

[TooMuchCode::ProhibitUnusedImport]

[TooMuchCode::ProhibitUnusedInclude]

[ValuesAndExpressions::ConstantBeforeLt]

[ValuesAndExpressions::NotWithCompare]

[ValuesAndExpressions::ProhibitArrayAssignAref]

[ValuesAndExpressions::ProhibitBarewordDoubleColon]

[ValuesAndExpressions::ProhibitCommaSeparatedStatements]

[ValuesAndExpressions::ProhibitComplexVersion]

[ValuesAndExpressions::ProhibitConstantPragma]

[ValuesAndExpressions::ProhibitDuplicateHashKeys]

[ValuesAndExpressions::ProhibitEmptyCommas]

[ValuesAndExpressions::ProhibitEmptyQuotes]

[ValuesAndExpressions::ProhibitEscapedCharacters]

[-ValuesAndExpressions::ProhibitFiletest_f]
# Doesn't understand the unusual, but unavoidable, uses of -f in this code
# (to identify executables without actually running them).

[ValuesAndExpressions::ProhibitImplicitNewlines]

[ValuesAndExpressions::ProhibitInterpolationOfLiterals]

[ValuesAndExpressions::ProhibitLeadingZeros]

[ValuesAndExpressions::ProhibitLongChainsOfMethodCalls]

[-ValuesAndExpressions::ProhibitMagicNumbers]
# I don't agree with this style rule.

[ValuesAndExpressions::ProhibitMismatchedOperators]

[ValuesAndExpressions::ProhibitMixedBooleanOperators]

[-ValuesAndExpressions::ProhibitNoisyQuotes]
# I don't agree with this style rule.

[ValuesAndExpressions::ProhibitNullStatements]

[ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters]

[ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator]

[ValuesAndExpressions::ProhibitUnknownBackslash]

[-ValuesAndExpressions::ProhibitVersionStrings]
# Version strings were only problematic in versions of Perl older than
# our minimum.

[ValuesAndExpressions::RequireConstantVersion]

[ValuesAndExpressions::RequireInterpolationOfMetachars]

[ValuesAndExpressions::RequireNumberSeparators]

[ValuesAndExpressions::RequireNumericVersion]

[ValuesAndExpressions::RequireQuotedHeredocTerminator]

[ValuesAndExpressions::RequireUpperCaseHeredocTerminator]

[ValuesAndExpressions::UnexpandedSpecialLiteral]

[Variables::ProhibitAugmentedAssignmentInDeclaration]

[Variables::ProhibitConditionalDeclarations]

[Variables::ProhibitLocalVars]

[Variables::ProhibitLoopOnHash]

[Variables::ProhibitMatchVars]

[Variables::ProhibitPackageVars]

[Variables::ProhibitPerl4PackageNames]

[-Variables::ProhibitPunctuationVars]
# I don't agree with this style rule.

[Variables::ProhibitReusedNames]

[Variables::ProhibitUnusedVariables]

[Variables::ProtectPrivateVars]

[-Variables::RequireInitializationForLocalVars]
# I'd *like* to disable this *only* for $_, where the whole point is
# that it gets written to (and read from) implicitly, but that's not
# possible.

[Variables::RequireLexicalLoopIterators]

[Variables::RequireLocalizedPunctuationVars]

[Variables::RequireNegativeIndices]


================================================
FILE: .perltidyrc
================================================
# perltidy configuration

--standard-error-output
--warning-output
--character-encoding=utf8
--converge

--continuation-indentation=4

--cuddled-else
--noblanks-before-comments
--noblanks-before-blocks
--paren-tightness=2            # no spaces inside parens
--brace-tightness=2            # no spaces inside braces
--square-bracket-tightness=2   # no spaces inside brackets


================================================
FILE: AUTHORS
================================================
The yescrypt code comes from yescrypt by Solar Designer <solar at
openwall.com>. It builds upon Colin Percival's scrypt.
See: http://openwall.com/yescrypt/ for reference.

The bcrypt hash module comes from crypt_blowfish, originally written
by Solar Designer <solar at openwall.com> and based on algorithms and
ideas by Niels Provos <provos at citi.umich.edu> and David Mazieres
<dm at lcs.mit.edu>.

The MD5, SHA256, and SHA512 hash modules, and the underlying
secure-hash primitives, were originally written by Ulrich Drepper
<drepper at cygnus.com> as part of the GNU C Library.  Other people
may also have contributed to them; our records are incomplete.

The DES hash module was originally FreeSec, written by David Burren
<davidb at werj.com.au> for the NetBSD project, and since extensively
modified by Geoffrey M. Rehmet, Mark R V Murray, and Zack Weinberg.

The NTHASH module comes from FreeBSD, originally written by Michael
Bretterklieber and based on the password hashing algorithm used by
the Windows NT LAN Manager (NTLM) from Microsoft Corporation to
provide easier compatibility with NT accounts.

The SUNMD5 hash module is a clean-room reimplementation by Zack Weinberg,
based on a specification written by Eli Collins for the Passlib project,
of an algorithm originally developed by Alec Muffett for use in Solaris 9.

The crypt and gensalt backends for yescrypt and gost-yescrypt are by
Vitaly Chikunov.

The implementation of the public interface (crypt, crypt_r, etc) is a
mashup of code from the GNU C Library with code from crypt_blowfish,
originally put together by Thorsten Kukuk and since completely
rewritten by Björn Esser and Zack Weinberg.

The above components were assembled into this library by Thorsten Kukuk
<kukuk at suse.de>, Björn Esser <besser82 at fedoraproject.org>, and
Zack Weinberg <zackw at panix.com>.


================================================
FILE: COPYING.LIB
================================================
                  GNU LESSER GENERAL PUBLIC LICENSE
                       Version 2.1, February 1999

 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

[This is the first released version of the Lesser GPL.  It also counts
 as the successor of the GNU Library Public License, version 2, hence
 the version number 2.1.]

                            Preamble

  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.

  This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it.  You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.

  When we speak of free software, we are referring to freedom of use,
not price.  Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.

  To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights.  These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.

  For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you.  You must make sure that they, too, receive or can get the source
code.  If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it.  And you must show them these terms so they know their rights.

  We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.

  To protect each distributor, we want to make it very clear that
there is no warranty for the free library.  Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.

  Finally, software patents pose a constant threat to the existence of
any free program.  We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder.  Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.

  Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License.  This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License.  We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.

  When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library.  The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom.  The Lesser General
Public License permits more lax criteria for linking other code with
the library.

  We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License.  It also provides other free software developers Less
of an advantage over competing non-free programs.  These disadvantages
are the reason we use the ordinary General Public License for many
libraries.  However, the Lesser license provides advantages in certain
special circumstances.

  For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard.  To achieve this, non-free programs must be
allowed to use the library.  A more frequent case is that a free
library does the same job as widely used non-free libraries.  In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.

  In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software.  For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.

  Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.

  The precise terms and conditions for copying, distribution and
modification follow.  Pay close attention to the difference between a
"work based on the library" and a "work that uses the library".  The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.

                  GNU LESSER GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".

  A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.

  The "Library", below, refers to any such software library or work
which has been distributed under these terms.  A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language.  (Hereinafter, translation is
included without limitation in the term "modification".)

  "Source code" for a work means the preferred form of the work for
making modifications to it.  For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.

  Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it).  Whether that is true depends on what the Library does
and what the program that uses the Library does.

  1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.

  You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.

  2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

    a) The modified work must itself be a software library.

    b) You must cause the files modified to carry prominent notices
    stating that you changed the files and the date of any change.

    c) You must cause the whole of the work to be licensed at no
    charge to all third parties under the terms of this License.

    d) If a facility in the modified Library refers to a function or a
    table of data to be supplied by an application program that uses
    the facility, other than as an argument passed when the facility
    is invoked, then you must make a good faith effort to ensure that,
    in the event an application does not supply such function or
    table, the facility still operates, and performs whatever part of
    its purpose remains meaningful.

    (For example, a function in a library to compute square roots has
    a purpose that is entirely well-defined independent of the
    application.  Therefore, Subsection 2d requires that any
    application-supplied function or table used by this function must
    be optional: if the application does not supply it, the square
    root function must still compute square roots.)

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.

In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

  3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library.  To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License.  (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.)  Do not make any other change in
these notices.

  Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.

  This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.

  4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.

  If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.

  5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library".  Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.

  However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library".  The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.

  When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library.  The
threshold for this to be true is not precisely defined by law.

  If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work.  (Executables containing this object code plus portions of the
Library will still fall under Section 6.)

  Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.

  6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.

  You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License.  You must supply a copy of this License.  If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License.  Also, you must do one
of these things:

    a) Accompany the work with the complete corresponding
    machine-readable source code for the Library including whatever
    changes were used in the work (which must be distributed under
    Sections 1 and 2 above); and, if the work is an executable linked
    with the Library, with the complete machine-readable "work that
    uses the Library", as object code and/or source code, so that the
    user can modify the Library and then relink to produce a modified
    executable containing the modified Library.  (It is understood
    that the user who changes the contents of definitions files in the
    Library will not necessarily be able to recompile the application
    to use the modified definitions.)

    b) Use a suitable shared library mechanism for linking with the
    Library.  A suitable mechanism is one that (1) uses at run time a
    copy of the library already present on the user's computer system,
    rather than copying library functions into the executable, and (2)
    will operate properly with a modified version of the library, if
    the user installs one, as long as the modified version is
    interface-compatible with the version that the work was made with.

    c) Accompany the work with a written offer, valid for at
    least three years, to give the same user the materials
    specified in Subsection 6a, above, for a charge no more
    than the cost of performing this distribution.

    d) If distribution of the work is made by offering access to copy
    from a designated place, offer equivalent access to copy the above
    specified materials from the same place.

    e) Verify that the user has already received a copy of these
    materials or that you have already sent this user a copy.

  For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it.  However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.

  It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system.  Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.

  7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:

    a) Accompany the combined library with a copy of the same work
    based on the Library, uncombined with any other library
    facilities.  This must be distributed under the terms of the
    Sections above.

    b) Give prominent notice with the combined library of the fact
    that part of it is a work based on the Library, and explaining
    where to find the accompanying uncombined form of the same work.

  8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License.  Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License.  However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.

  9. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Library or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.

  10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.

  11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all.  For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.

If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

  12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded.  In such case, this License incorporates the limitation as if
written in the body of this License.

  13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number.  If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation.  If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.

  14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission.  For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this.  Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.

                            NO WARRANTY

  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.

                     END OF TERMS AND CONDITIONS

           How to Apply These Terms to Your New Libraries

  If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change.  You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).

  To apply these terms, attach the following notices to the library.  It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

    <one line to give the library's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

Also add information on how to contact you by electronic and paper mail.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary.  Here is a sample; alter the names:

  Yoyodyne, Inc., hereby disclaims all copyright interest in the
  library `Frob' (a library for tweaking knobs) written by James Random Hacker.

  <signature of Ty Coon>, 1 April 1990
  Ty Coon, President of Vice

That's all there is to it!


================================================
FILE: ChangeLog
================================================
2018-01-27  Zack Weinberg <zackw@panix.com>

	* Version 4.0.0 released.

	* This project no longer maintains a GNU-style ChangeLog file.
	See the Git commit history for detailed changes since 3.1.1.

2015-05-13  Björn Esser <besser82@fedoraproject.org>

	* release version 3.1.1

	* README.bcrypt: whitespace clean-up
	* src/crypt-private.h

	* configure.ac: add '--enable-Wno-cast-align' to silence 'cast
			increases required alignment'


2015-05-12  Björn Esser <besser82@fedoraproject.org>

	* release version 3.1.0

	* configure.ac: update upstream-contact

	* configure.ac: add './configure --enable-bootstrap' to skip some
			tests on initial build
	* src/Makefile.am

	* bootstrap.sh: add bootstrap-script

	* LICENSE.bcrypt: add LICENSE for bcrypt
	* Makefile.am

	* plugins/blowfish/Makefile.am: update crypt_blowfish to v1.3
	* plugins/blowfish/blowfish-test.c
	* plugins/blowfish/crypt_blowfish.c
	* plugins/blowfish/crypt_blowfish.h
	* plugins/blowfish/ow-crypt.h

	* configure.ac: add '-Wextra' to CFLAGS

	* plugins/md5/md5.c: fix '-Werror=strict-aliasing'
	* plugins/sha256/sha256.c
	* plugins/sha512/sha512.c

	* src/cert.c: fix '-Werror=unused-result'

	* configure.in --> configure.ac: update Autotools
	* Makefile.am
	* m4/
	* plugins/blowfish/Makefile.am
	* plugins/md5/Makefile.am
	* plugins/sha256/Makefile.am
	* plugins/sha512/Makefile.am
	* src/Makefile.am

2011-05-10  Thorsten Kukuk  <kukuk@suse.de>

	* release version 3.0.4

	* src/cert.c (get8): Don't save return value we never use.

2009-10-29  Thorsten Kukuk  <kukuk@suse.de>

	* release version 3.0.3

	* src/xcrypt.c (__xcrypt_gensalt_r): Fix memory leak [bnc#547893].

2008-11-04  Thorsten Kukuk  <kukuk@suse.de>

	* plugins/blowfish/blowfish-test.c (run): Fix compiler
	warnings [bnc#440134].

2008-09-28  Thorsten Kukuk  <kukuk@suse.de>

	* src/xcrypt-private.h: Add prototype for _xcrypt_gensalt_sha256_rn
	and _xcrypt_gensalt_sha512_rn.
	* src/crypt_gensalt.c: Add new gensalt functions.
	* src/xcrypt.c: Use gensalt functions for sha512 and sha256.
	* src/gensalt-test.c: Enable test cases for sha256 and sha512.

2008-07-16  Thorsten Kukuk  <kukuk@suse.de>

	* release version 3.0.2

	* src/xcrypt.c (__xcrypt_gensalt_r): Handle special
	MD5 case.
	* src/gensalt-test.c: New test case.
	* src/Makefile.am: Add gensalt-test as new test case.

2008-06-24  Thorsten Kukuk  <kukuk@suse.de>

	* release version 3.0.1

	* plugins/md5/md5.c: Fix undefined macros.
	* plugins/sha256/sha256.c: Likewise.
	* plugins/sha512/sha512.c: Likewise.

2008-02-15  Thorsten Kukuk  <kukuk@suse.de>

	* release version 3.0

	* plugins/*: Move all crypt related code into plugins.
	* plugins/sha256: New, $5$ aka sha256 hash.
	* plugins/sha512: New, $6$ aka sha512 hash.

	* src/sha.c: Removed.
	* src/sha-crypt.c: Likewise.

	* src/xcrypt.h: Add __nonnull.

	* src/crypt_util.c: Sync with glibc 2.7.

	* src/xcrypt.c: Load all hashes except DES dynamic.

	* src/Makefile.am: increase version of shared library.

2006-01-06  Thorsten Kukuk  <kukuk@suse.de>

	* release version 2.4

	* src/Makefile.am: Bump minor version number

	* src/crypt_gensalt.c: Sync with crypt_blowfish 1.0.

2005-09-18  Thorsten Kukuk  <kukuk@suse.de>

	* release version 2.3

	* src/x86.S: Remove.

	* src/crypt_blowfish.c: Don't use ASM on x86.

2004-06-18  Thorsten Kukuk  <kukuk@suse.de>

	* release version 2.2

	* src/md5-crypt.c (__md5_crypt): Check if realloc
	runs out of memory (from glibc CVS).

	* configure.in: Remove --noexecstack flag (compiler
	can do it better itself).

2003-11-14  Thorsten Kukuk  <kukuk@suse.de>

	* configure.in: Check for --noexecstack support

2003-10-16  Thorsten Kukuk  <kukuk@suse.de>

	* release version 2.1

	* COPYING: Add all different copyrights.

	* src/x86.S: Added, optimized, thread safe version for ix86.

	* src/crypt_blowfish.c: Use optimized assembler functions on ix86.

	* libxcrypt.spec: New.

2003-07-28  Thorsten Kukuk  <kukuk@suse.de>

	* release version 2.0

	* src/crypt_util.c: Include xcrypt-private.h only, add weak aliases.
	* src/wrapper.c: Likewise.

	* src/crypt_gensalt.c: Rename _crypt_* to _xcrypt_*
	* src/crypt_blowfish.c: Likewise.

	* src/crypt-entry.c: Include xcrypt-private.h.

	* src/crypt.c: Only include xcrypt-private.h.

	* src/xcrypt-private.h: Include xcrypt.h, undef xcrypt defines
	* src/xcrypt.h: Rename prototypes from crypt* to xcrypt* and
	add compat defines.

2003-01-16  Thorsten Kukuk  <kukuk@suse.de>

	* release version 1.4

	* src/blowfish-test.c: Add test with threads.

	* src/Makefile.am: Use AM_CFLAGS instead of CFLAGS,
	(blowfish_test_LDFLAGS): Add libpthread,
	(blowfish_test_CFLAGS): Define number of threads for test.
	* src/crypt_util.c: Don't define _LIBC for libc-lock.h,
	redefine __libc_lock_t with pthread_mutex_t.

	* src/crypt_blowfish.c: Sync with version 0.4.5

2003-01-10  Thorsten Kukuk  <kukuk@suse.de>

	* release version 1.3

2002-11-04  Thorsten Kukuk  <kukuk@suse.de>

	* src/crypt_util.c (__init_des_r): Sync with current glibc CVS
	(fix initialisation of internal data struct).

	* src/md5test.c (main): Sync with current glibc CVS (add test
	case for above crypt_util fix).


2002-10-21  Thorsten Kukuk  <kukuk@suse.de>

	* release version 1.2

	* src/crypt_util.c: undef _LIBC after inclusion of libc-lock.h
	* src/crypt_blowfish.c: Add support for hppa
	* configure.in: bump version number to 1.2

2002-05-27  Thorsten Kukuk  <kukuk@suse.de>

	* release version 1.1

	* src/sha.c: New file.
	* src/sha-crypt.c: New file.
	* src/md5-private.h: Renamed to ...
	* src/xcrypt-private.h: ... to this.
	* src/crypt_gensalt.c: Add dummy function for SHA1.
	* src/wrapper.c: Call SHA1 functions.

2002-05-14  Thorsten Kukuk  <kukuk@suse.de>

	* src/xcrypt.h: Add prototpyes for SHA1 functions.

	* src/wrapper.c: Don't include md5.h.

	* src/md5-crypt.c: Include xcrypt.h instead of md5.h.
	* src/md5test.c: Likewise.
	* src/md5.c: Likewise.

	* src/xcrypt.h: Add prototypes from md5.h.
	* src/md5.h: Removed.

2002-04-13  Thorsten Kukuk  <kukuk@suse.de>

	* release version 1.0


================================================
FILE: LICENSING
================================================
# Detailed copyright and licensing information for libxcrypt

The overall license for libxcrypt is the GNU Lesser General Public
License, version 2.1 (or, at your option, any later version); see
the file COPYING.LIB for the full terms of this license.

Many individual files are under other licenses.  This file provides an
inventory of the copyright holders and licenses of all files in the
source tree.  For specific licensing terms consult the files themselves.

 * Copyright Thorsten Kukuk, Björn Esser, Zack Weinberg; LGPL (v2.1 or later):
   crypt.c, crypt-static.c, crypt-gensalt-static.c, crypt-port.h

 * Copyright Free Software Foundation, Inc.; LGPL (v2.1 or later):
   crypt.h, crypt-obsolete.h, crypt-md5.c,
   test-badsalt.c, test-crypt-nonnull.c, test-explicit-bzero.c

 * Copyright David Burren et al.; 3-clause BSD:
   alg-des.h, alg-des.c, alg-des-tables.c,
   crypt-des.c, crypt-des-obsolete.c, gen-des-tables.c

 * Public domain, written by Ulrich Drepper et al.:
   crypt-sha256.c, crypt-sha512.c, crypt-sm3.c

 * Public domain, written by Solar Designer et al.:
   alg-md4.h, alg-md4.c, alg-md5.h, alg-md5.c,
   crypt-bcrypt.c, crypt-gensalt.c, test-crypt-bcrypt.c

 * Copyright Solar Designer, Colin Percival; 0-clause BSD:
   alg-yescrypt-common.c, alg-yescrypt-platform.c

 * Copyright Solar Designer, Colin Percival; 2-clause BSD:
   alg-sha256.c, alg-sha256.h, alg-yescrypt.h, alg-yescrypt-opt.c

 * Copyright Colin Percival; 2-clause BSD:
   alg-sha512.h, alg-sha512.c

 * Copyright Alexey Degtyarev; 2-clause BSD:
   alg-gost3411-2012-const.h, alg-gost3411-2012-core.c,
   alg-gost3411-2012-core.h, alg-gost3411-2012-precalc.h,
   alg-gost3411-2012-ref.h

 * Copyright Vitaly Chikunov, Björn Esser; 0-clause BSD:
   alg-gost3411-2012-hmac.c, alg-gost3411-2012-hmac.h,
   crypt-gost-yescrypt.c, test-alg-gost3411-2012.c,
   test-alg-gost3411-2012-hmac.c, test-crypt-gost-yescrypt.c,
   test-crypt-scrypt.c

 * Copyright Alexander Peslyak; 0-clause BSD:
   test-alg-yescrypt.c

 * Copyright Alexander Peslyak, Björn Esser; 0-clause BSD:
   crypt-scrypt.c

 * Copyright Björn Esser; 0-clause BSD:
   alg-sm3.c, alg-sm3.h, alg-sm3-hmac.h, alg-sm3-hmac.c,
   crypt-sm3-yescrypt.c, crypt-common.c, test-checksalt.c,
   test-compile-strong-alias.c, test/crypt-nested-call.c,
   test/gensalt-nested-call.c, test-gensalt-nthash.c,
   test-short-outbuf.c, test-special-char-salt.c

 * Copyright Michael Bretterklieber, Björn Esser et al.; 2-clause BSD:
   crypt-nthash.c

 * Copyright Zack Weinberg; 2-clause BSD:
   crypt-sunmd5.c

 * Public domain, written by Steve Reid et al.:
   alg-sha1.c, alg-sha1.h, test-alg-sha1.c

 * Copyright Juniper Networks, Inc.; 3-clause BSD:
   crypt-pbkdf1-sha1.c, crypt-pbkdf1-sha1.c

 * Copyright Björn Esser; 2-clause BSD:
   alg-hmac-sha1.c, alg-hmac-sha1.h, test-alg-hmac-sha1.c

 * Public domain, written by Zack Weinberg et al.:
   byteorder.h, randombytes.c, test-byteorder.c
   test-alg-pbkdf-hmac-sha256.c
   test-badsetting.c, test-crypt-badargs.c, test-getrandom-fallbacks.c,
   test-getrandom-interface.c, test-symbols-compat.sh,
   test-symbols-renames.sh, test-symbols-static.sh,
   build-aux/scripts/gen-crypt-h,
   build-aux/scripts/gen-crypt-symbol-vers-h,
   build-aux/scripts/gen-libcrypt-map,
   build-aux/scripts/skip-if-exec-format-error,
   build-aux/m4/zw_alignment.m4, build-aux/m4/zw_static_assert.m4,
   build-aux/m4/zw_endianness.m4, build-aux/m4/zw_ld_wrap.m4

 * Copyright Zack Weinberg and Free Software Foundation, Inc;
   GPL (v3 or later), with Autoconf exception:
   build-aux/m4/zw_automodern.m4, build-aux/m4/zw_simple_warnings.m4

 * Copyright <vt at altlinux.org>; 0-clause BSD:
   crypt-yescrypt.c, test-crypt-yescrypt.c

 * Copyright Kevin Cernekee; FSF All Permissive License:
   build-aux/m4/ax_check_vscript.m4

 * Copyright Maarten Bosmans; FSF All Permissive License:
   build-aux/m4/ax_append_compile_flags.m4

 * Copyright Guido U. Draheim, Maarten Bosmans;
   FSF All Permissive License:
   build-aux/m4/ax_append_flag.m4, build-aux/m4/ax_check_compile_flag.m4

 * Copyright Mike Frysinger; FSF All Permissive License:
   build-aux/m4/ax_require_defined.m4

 * Copyright Gabriele Svelto; FSF All Permissive License:
   build-aux/m4/ax_gcc_func_attribute.m4

 * Copyright Scott James Remnant, Dan Nicholson;
   GPL (v2 or later), with Autoconf exception:
   build-aux/m4/pkg_installdir_compat.m4

 * Copyright Tim Toolan; FSF All Permissive License:
   build-aux/m4/ax_compare_version.m4

 * Copyright Philip Withnall; FSF All Permissive License:
   build-aux/m4/ax_valgrind_check.m4

 * Copyright Steven G. Johnson, Daniel Richard G.;
   GPL (v3 or later), with Autoconf exception:
   build-aux/m4/ax_pthread.m4

 * Copyright Francesco Salvestrini; FSF All Permissive License:
   build-aux/m4/ax_prog_python_version.m4

 * Copyright Andrew Collier; FSF All Permissive License:
   build-aux/m4/ax_python_module.m4

 * Copyright holders unknown, no statement of license (all of these
   files are part of the testsuite and do not contribute to the
   installed library or its headers):
   test-alg-des.c, test-alg-md4.c (adaption of test-alg-md5.c),
   test-alg-md5.c, test-alg-sha256.c, test-alg-sha512.c, test-crypt-des.c,
   test-crypt-md5.c, test-crypt-sha256.c, test-crypt-sha512.c,
   test-des-cases.h, test-des-obsolete{,_r}.c, test-gensalt.c,
   test-crypt-nthash.c (adaption of test-crypt-des.c),
   test-crypt-sunmd5.c (adaption of test-crypt-des.c),
   test-crypt-pbkdf1-sha1.c (adaption of test-crypt-des.c)

 * The NEWS file formerly contained the following copyright assertions:

     Copyright 2002, 2003, 2004 SuSE Linux AG, Germany
     Copyright 2005, 2008, 2009 2011 SUSE LINUX Products GmbH, Germany
     Copyright 2015 Björn Esser

   These were meant to apply to the library as a whole rather than
   specific files or portions of files.


================================================
FILE: Makefile.am
================================================
#
# Copyright (c) 2002, 2007 SuSE Linux AG, Germany
#
# Author: Thorsten Kukuk <kukuk@suse.de>
#

AUTOMAKE_OPTIONS = \
	1.14 \
	dist-bzip2 \
	dist-xz \
	filename-length-max=99 \
	gnits \
	subdir-objects

ACLOCAL_AMFLAGS = -I build-aux/m4

AM_CPPFLAGS = -I$(srcdir)/lib
AM_CFLAGS = $(WARN_CFLAGS) $(OPTI_FLAGS)
AM_LDFLAGS = $(RELRO_FLAG) $(BINDNOW_FLAG)

SCRIPTS_AUX = $(srcdir)/build-aux/scripts
STAMP = echo timestamp >

@VALGRIND_CHECK_RULES@

TEST_EXTENSIONS = .pl

EXTRA_DIST = \
	LICENSING \
	THANKS \
	lib/alg-yescrypt-platform.c \
	lib/crypt.h.in \
	lib/hashes.conf \
	lib/libcrypt.map.in \
	lib/libcrypt.minver \
	lib/xcrypt.h.in \
	build-aux/scripts/BuildCommon.pm \
	build-aux/scripts/check-perlcritic-config \
	build-aux/scripts/compute-symver-floor \
	build-aux/scripts/expand-selected-hashes \
	build-aux/scripts/gen-crypt-h \
	build-aux/scripts/gen-crypt-hashes-h \
	build-aux/scripts/gen-crypt-symbol-vers-h \
	build-aux/scripts/gen-libcrypt-map \
	build-aux/scripts/move-if-change \
	build-aux/scripts/skip-if-exec-format-error \
	test/TestCommon.pm \
	test/symbols-compat.pl \
	test/symbols-renames.pl \
	test/symbols-static.pl

notrans_dist_man3_MANS = \
	doc/crypt.3 \
	doc/crypt_checksalt.3 \
	doc/crypt_gensalt.3 \
	doc/crypt_gensalt_ra.3 \
	doc/crypt_gensalt_rn.3 \
	doc/crypt_preferred_method.3 \
	doc/crypt_r.3 \
	doc/crypt_ra.3 \
	doc/crypt_rn.3
notrans_dist_man5_MANS = \
	doc/crypt.5

nodist_include_HEADERS = \
	crypt.h
nodist_noinst_HEADERS = \
	crypt-hashes.h \
	crypt-symbol-vers.h
noinst_HEADERS = \
	lib/alg-des.h \
	lib/alg-gost3411-2012-const.h \
	lib/alg-gost3411-2012-core.h \
	lib/alg-gost3411-2012-hmac.h \
	lib/alg-gost3411-2012-precalc.h \
	lib/alg-gost3411-2012-ref.h \
	lib/alg-hmac-sha1.h \
	lib/alg-md4.h \
	lib/alg-md5.h \
	lib/alg-sha1.h \
	lib/alg-sha256.h \
	lib/alg-sha512.h \
	lib/alg-sm3.h \
	lib/alg-sm3-hmac.h \
	lib/alg-yescrypt.h \
	lib/byteorder.h \
	lib/crypt-obsolete.h \
	lib/crypt-port.h \
	test/des-cases.h \
	test/ka-table.inc

if ENABLE_XCRYPT_COMPAT_FILES
nodist_include_HEADERS += xcrypt.h
endif

noinst_PROGRAMS = \
	lib/gen-des-tables

lib_LTLIBRARIES = \
	libcrypt.la

libcrypt_la_SOURCES = \
	lib/alg-des-tables.c \
	lib/alg-des.c \
	lib/alg-gost3411-2012-core.c \
	lib/alg-gost3411-2012-hmac.c \
	lib/alg-hmac-sha1.c \
	lib/alg-md4.c \
	lib/alg-md5.c \
	lib/alg-sha1.c \
	lib/alg-sha256.c \
	lib/alg-sha512.c \
	lib/alg-sm3.c \
	lib/alg-sm3-hmac.c \
	lib/alg-yescrypt-common.c \
	lib/alg-yescrypt-opt.c \
	lib/crypt-bcrypt.c \
	lib/crypt-des.c \
	lib/crypt-gensalt-static.c \
	lib/crypt-gost-yescrypt.c \
	lib/crypt-sm3-yescrypt.c \
	lib/crypt-md5.c \
	lib/crypt-nthash.c \
	lib/crypt-pbkdf1-sha1.c \
	lib/crypt-scrypt.c \
	lib/crypt-sha256.c \
	lib/crypt-sha512.c \
	lib/crypt-sm3.c \
	lib/crypt-static.c \
	lib/crypt-sunmd5.c \
	lib/crypt-yescrypt.c \
	lib/crypt.c \
	lib/util-base64.c \
	lib/util-gensalt-sha.c \
	lib/util-get-random-bytes.c \
	lib/util-make-failure-token.c \
	lib/util-xbzero.c \
	lib/util-xstrcpy.c

pkgconfig_DATA = libxcrypt.pc

# Install libcrypt.pc symlink to libxcrypt.pc file.
phony_targets = \
	install-data-hook-pkgconfig uninstall-hook-pkgconfig
install-data-hook: install-data-hook-pkgconfig
uninstall_hook_targets = \
	uninstall-hook-pkgconfig
install-data-hook-pkgconfig:
	cd $(DESTDIR)$(pkgconfigdir) && \
		$(LN_S) -f libxcrypt.pc libcrypt.pc
uninstall-hook-pkgconfig:
	-rm -f $(DESTDIR)$(pkgconfigdir)/libcrypt.pc

# Build libcrypt.so.2 if obsolete APIs are excluded, libcrypt.so.1 otherwise.
if ENABLE_OBSOLETE_API
libcrypt_la_VERSION = 2:0:1
else
libcrypt_la_VERSION = 2:0:0
endif

libcrypt_la_LDFLAGS = -version-info $(libcrypt_la_VERSION)

if HAVE_VSCRIPT
libcrypt_la_LDFLAGS += $(VSCRIPT_LDFLAGS),$(builddir)/libcrypt.map
APPLY_SYMVERS = yes
else
APPLY_SYMVERS = no
endif

libcrypt_la_LDFLAGS += $(UNDEF_FLAG) $(TEXT_RELOC_FLAG) $(AM_LDFLAGS)

libcrypt_la_CPPFLAGS = $(AM_CPPFLAGS) -DIN_LIBCRYPT

CONFIG_STATUS_DEPENDENCIES = lib/libcrypt.minver
EXTRA_libcrypt_la_DEPENDENCIES = libcrypt.map
CLEANFILES = \
	Makefile.deps Makefile.deps.T \
	libcrypt.map libcrypt.map.T libcrypt.map.stamp \
	crypt-symbol-vers.h crypt-symbol-vers.h.T crypt-symbol-vers.h.stamp \
	crypt-hashes.h crypt-hashes.h.T crypt-hashes.h.stamp \
	crypt.h crypt.h.T crypt.h.stamp \
	xcrypt.h xcrypt.h.T xcrypt.h.stamp \
	./*.gcda ./*.gcno \
	lib/*.gcda lib/*.gcno \
	test/*.gcda test/*.gcno

DISTCLEANFILES = .deps/*.Plo

# Force generated headers to be generated before any source files that
# might depend on them are compiled.
Makefile.deps: crypt.h crypt-hashes.h crypt-symbol-vers.h
	$(AM_V_GEN)LC_ALL=C echo "# Deps" > Makefile.deps.T
	$(AM_V_at)mv -f Makefile.deps.T Makefile.deps

# Almost everything depends on the generated headers; the generated
# headers depend on the Makefile; *most* changes to the Makefile won't
# affect the contents of the generated headers.  Arrange for the
# timestamps of the generated headers not to change if their contents
# haven't.  The rule idiom used here was borrowed from GCC's Makefile;
# in https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/Makefile.in;hb=HEAD
# search for the phrase "On the use of stamps".
AM_V_GENS = $(am__v_GENS_@AM_V@)
am__v_GENS_ = $(am__v_GENS_@AM_DEFAULT_V@)
am__v_GENS_0 = @echo "  GEN     " $(@:.stamp=);
am__v_GENS_1 =

libcrypt.map: libcrypt.map.stamp; @:
libcrypt.map.stamp: \
		lib/libcrypt.map.in $(SCRIPTS_AUX)/gen-libcrypt-map \
		$(SCRIPTS_AUX)/BuildCommon.pm Makefile
	$(AM_V_GENS)LC_ALL=C $(PERL) $(SCRIPTS_AUX)/gen-libcrypt-map \
	  SYMVER_MIN=$(SYMVER_MIN) \
	  SYMVER_FLOOR=$(SYMVER_FLOOR) \
	  COMPAT_ABI=$(COMPAT_ABI) \
	  $(srcdir)/lib/libcrypt.map.in > libcrypt.map.T
	$(AM_V_at)$(SCRIPTS_AUX)/move-if-change libcrypt.map.T libcrypt.map
	$(AM_V_at)$(STAMP) libcrypt.map.stamp

crypt-hashes.h: crypt-hashes.h.stamp; @:
crypt-hashes.h.stamp: \
		$(SCRIPTS_AUX)/gen-crypt-hashes-h $(SCRIPTS_AUX)/BuildCommon.pm \
		lib/hashes.conf Makefile
	$(AM_V_GENS)LC_ALL=C $(PERL) \
	  $(SCRIPTS_AUX)/gen-crypt-hashes-h \
	  $(srcdir)/lib/hashes.conf $(hashes_enabled) > crypt-hashes.h.T
	$(AM_V_at)$(SCRIPTS_AUX)/move-if-change crypt-hashes.h.T crypt-hashes.h
	$(AM_V_at)$(STAMP) crypt-hashes.h.stamp

crypt-symbol-vers.h: crypt-symbol-vers.h.stamp; @:
crypt-symbol-vers.h.stamp: \
		$(SCRIPTS_AUX)/gen-crypt-symbol-vers-h \
		$(SCRIPTS_AUX)/BuildCommon.pm \
		lib/libcrypt.map.in Makefile
	$(AM_V_GENS)LC_ALL=C $(PERL) \
	  $(SCRIPTS_AUX)/gen-crypt-symbol-vers-h \
	  $(APPLY_SYMVERS) \
	  SYMVER_MIN=$(SYMVER_MIN) \
	  SYMVER_FLOOR=$(SYMVER_FLOOR) \
	  COMPAT_ABI=$(COMPAT_ABI) \
	     $(srcdir)/lib/libcrypt.map.in > crypt-symbol-vers.h.T
	$(AM_V_at)$(SCRIPTS_AUX)/move-if-change crypt-symbol-vers.h.T crypt-symbol-vers.h
	$(AM_V_at)$(STAMP) crypt-symbol-vers.h.stamp

crypt.h: crypt.h.stamp; @:
crypt.h.stamp: \
		$(SCRIPTS_AUX)/gen-crypt-h $(SCRIPTS_AUX)/BuildCommon.pm \
		lib/crypt.h.in lib/hashes.conf config.h Makefile
	$(AM_V_GENS)LC_ALL=C $(PERL) \
	  $(SCRIPTS_AUX)/gen-crypt-h \
	  $(srcdir)/lib/crypt.h.in config.h \
	  $(srcdir)/lib/hashes.conf $(hashes_enabled) \
	  > crypt.h.T
	$(AM_V_at)$(SCRIPTS_AUX)/move-if-change crypt.h.T crypt.h
	$(AM_V_at)$(STAMP) crypt.h.stamp

xcrypt.h: xcrypt.h.stamp; @:
xcrypt.h.stamp: \
		$(SCRIPTS_AUX)/gen-crypt-h $(SCRIPTS_AUX)/BuildCommon.pm \
		lib/xcrypt.h.in config.h
	$(AM_V_GENS)LC_ALL=C $(PERL) \
	  $(SCRIPTS_AUX)/gen-crypt-h \
	  $(srcdir)/lib/xcrypt.h.in config.h \
	  > xcrypt.h.T
	$(AM_V_at)$(SCRIPTS_AUX)/move-if-change xcrypt.h.T xcrypt.h
	$(AM_V_at)$(STAMP) xcrypt.h.stamp

install_exec_hook_targets =

if ENABLE_XCRYPT_COMPAT_FILES
if ENABLE_STATIC
# Install libxcrypt.a symlink to libcrypt.a file.
phony_targets += \
	install-exec-hook-xcrypt-static uninstall-hook-xcrypt-static
install_exec_hook_targets += \
	install-exec-hook-xcrypt-static
uninstall_hook_targets += \
	uninstall-hook-xcrypt-static
install-exec-hook-xcrypt-static:
	cd $(DESTDIR)$(libdir) && \
		$(LN_S) -f libcrypt.a libxcrypt.a
uninstall-hook-xcrypt-static:
	-rm -f $(DESTDIR)$(libdir)/libxcrypt.a
endif

if ENABLE_SHARED
# Install libxcrypt.so symlink to libcrypt.so file.
phony_targets += \
	install-exec-hook-xcrypt-shared uninstall-hook-xcrypt-shared
install_exec_hook_targets += \
	install-exec-hook-xcrypt-shared
uninstall_hook_targets += \
	uninstall-hook-xcrypt-shared
install-exec-hook-xcrypt-shared:
	cd $(DESTDIR)$(libdir) && \
		$(LN_S) -f libcrypt.so libxcrypt.so
uninstall-hook-xcrypt-shared:
	-rm -f $(DESTDIR)$(libdir)/libxcrypt.so
endif
endif

if ENABLE_COMPAT_SUSE
# When we are being binary compatible, also install symbolic links to
# mimic SUSE's libowcrypt; any program that uses -lowcrypt in its
# build, or already has a NEEDED entry for libowcrypt.so.1, will be
# redirected to libcrypt.  The OW_CRYPT_1.0 symbol versions are already
# present in libcrypt.so.1.
#
# Caution: this hardwires the expected (so)names of the shared
# libraries involved, libcrypt.so.1 and libowcrypt.so.1.  (We should
# be able to get away with this because in any circumstance where the
# soname of libcrypt isn't libcrypt.so.1, ENABLE_OBSOLETE_API should
# be automatically turned off, and as best I can tell, SUSE only ever
# shipped libowcrypt.so.1.)
if ENABLE_OBSOLETE_API
if ENABLE_STATIC
phony_targets += \
	install-exec-hook-libstatic uninstall-hook-libstatic
install_exec_hook_targets += \
	install-exec-hook-libstatic
uninstall_hook_targets += \
	uninstall-hook-libstatic
install-exec-hook-libstatic:
	cd $(DESTDIR)$(libdir) && \
		$(LN_S) -f libcrypt.a libowcrypt.a
uninstall-hook-libstatic:
	-rm -f $(DESTDIR)$(libdir)/libowcrypt.a
endif
if ENABLE_SHARED
phony_targets += \
	install-exec-hook-libshared uninstall-hook-libshared
install_exec_hook_targets += \
	install-exec-hook-libshared
uninstall_hook_targets += \
	uninstall-hook-libshared
install-exec-hook-libshared:
	cd $(DESTDIR)$(libdir) && \
		$(LN_S) -f libcrypt.so libowcrypt.so && \
		$(LN_S) -f libcrypt.so.1 libowcrypt.so.1
uninstall-hook-libshared:
	-rm -f  $(DESTDIR)$(libdir)/libowcrypt.so \
		$(DESTDIR)$(libdir)/libowcrypt.so.1
endif
endif
endif

# The ka-* tests are first in this list because they are the slowest.
# The list should otherwise be kept in alphabetical order.

check_PROGRAMS = \
	test/ka-bcrypt \
	test/ka-bcrypt-a \
	test/ka-bcrypt-x \
	test/ka-bcrypt-y \
	test/ka-bigcrypt \
	test/ka-bsdicrypt \
	test/ka-descrypt \
	test/ka-gost-yescrypt \
	test/ka-md5crypt \
	test/ka-nt \
	test/ka-scrypt \
	test/ka-sha1crypt \
	test/ka-sha256crypt \
	test/ka-sha512crypt \
	test/ka-sm3crypt \
	test/ka-sm3-yescrypt \
	test/ka-sunmd5 \
	test/ka-yescrypt \
	test/alg-des \
	test/alg-gost3411-2012 \
	test/alg-gost3411-2012-hmac \
	test/alg-hmac-sha1 \
	test/alg-md4 \
	test/alg-md5 \
	test/alg-pbkdf-hmac-sha256 \
	test/alg-sha1 \
	test/alg-sha256 \
	test/alg-sha512 \
	test/alg-sm3 \
	test/alg-sm3-hmac \
	test/alg-yescrypt \
	test/badsalt \
	test/badsetting \
	test/byteorder \
	test/checksalt \
	test/compile-strong-alias \
	test/crypt-badargs \
	test/crypt-gost-yescrypt \
	test/crypt-nested-call \
	test/crypt-sm3-yescrypt \
	test/crypt-too-long-phrase \
	test/explicit-bzero \
	test/gensalt \
	test/gensalt-bcrypt_x \
	test/gensalt-extradata \
	test/gensalt-nested-call \
	test/gensalt-nthash \
	test/getrandom-fallbacks \
	test/getrandom-interface \
	test/preferred-method \
	test/short-outbuf \
	test/special-char-salt

# All of the known-answer tests are compiled from the same source file,
# with different macros defined.
test_ka_bcrypt_SOURCES		= test/ka-tester.c
test_ka_bcrypt_a_SOURCES	= test/ka-tester.c
test_ka_bcrypt_x_SOURCES	= test/ka-tester.c
test_ka_bcrypt_y_SOURCES	= test/ka-tester.c
test_ka_bigcrypt_SOURCES	= test/ka-tester.c
test_ka_bsdicrypt_SOURCES	= test/ka-tester.c
test_ka_descrypt_SOURCES	= test/ka-tester.c
test_ka_gost_yescrypt_SOURCES	= test/ka-tester.c
test_ka_md5crypt_SOURCES	= test/ka-tester.c
test_ka_nt_SOURCES		= test/ka-tester.c
test_ka_scrypt_SOURCES		= test/ka-tester.c
test_ka_sha1crypt_SOURCES	= test/ka-tester.c
test_ka_sha256crypt_SOURCES	= test/ka-tester.c
test_ka_sha512crypt_SOURCES	= test/ka-tester.c
test_ka_sm3crypt_SOURCES	= test/ka-tester.c
test_ka_sm3_yescrypt_SOURCES	= test/ka-tester.c
test_ka_sunmd5_SOURCES		= test/ka-tester.c
test_ka_yescrypt_SOURCES	= test/ka-tester.c

test_ka_bcrypt_CPPFLAGS		= $(AM_CPPFLAGS) -DTEST_bcrypt
test_ka_bcrypt_a_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_bcrypt_a
test_ka_bcrypt_x_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_bcrypt_x
test_ka_bcrypt_y_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_bcrypt_y
test_ka_bigcrypt_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_bigcrypt
test_ka_bsdicrypt_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_bsdicrypt
test_ka_descrypt_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_descrypt
test_ka_gost_yescrypt_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_gost_yescrypt
test_ka_md5crypt_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_md5crypt
test_ka_nt_CPPFLAGS		= $(AM_CPPFLAGS) -DTEST_nt
test_ka_scrypt_CPPFLAGS		= $(AM_CPPFLAGS) -DTEST_scrypt
test_ka_sha1crypt_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_sha1crypt
test_ka_sha256crypt_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_sha256crypt
test_ka_sha512crypt_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_sha512crypt
test_ka_sm3crypt_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_sm3crypt
test_ka_sm3_yescrypt_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_sm3_yescrypt
test_ka_sunmd5_CPPFLAGS		= $(AM_CPPFLAGS) -DTEST_sunmd5
test_ka_yescrypt_CPPFLAGS	= $(AM_CPPFLAGS) -DTEST_yescrypt

if ENABLE_KA_TABLE_GEN
if ENABLE_SHARED
# test/ka-table.inc can be regenerated by running test/ka-table-gen.py.
# This is very slow and requires nonstandard Python libraries and a shared
# library build of libcrypt already present in the build-tree, so we only
# do it when explicitly requested.
regen-ka-table: libcrypt.la
	$(PYTHON) $(srcdir)/test/ka-table-gen.py > ka-table.inc.T
	@if cmp -s ka-table.inc.T $(srcdir)/test/ka-table.inc; \
	then echo ka-table.inc is unchanged; rm ka-table.inc.T; \
	else echo mv -f ka-table.inc.T $(srcdir)/test/ka-table.inc; \
	mv -f ka-table.inc.T $(srcdir)/test/ka-table.inc; fi
phony_targets += regen-ka-table
CLEANFILES += ka-table.inc.T
endif
endif

if ENABLE_OBSOLETE_API
libcrypt_la_SOURCES += lib/crypt-des-obsolete.c
check_PROGRAMS += test/des-obsolete test/des-obsolete_r
endif

TESTS = $(check_PROGRAMS)

if ENABLE_STATIC
TESTS += test/symbols-static.pl test/symbols-renames.pl
endif

if ENABLE_OBSOLETE_API
TESTS += test/symbols-compat.pl
endif

AM_TESTS_ENVIRONMENT = \
    lib_la="./libcrypt.la"; \
    lib_map="$(srcdir)/lib/libcrypt.map.in"; \
    HAVE_CPP_dD="$(HAVE_CPP_dD)"; \
    SYMBOL_PREFIX="$(SYMBOL_PREFIX)"; \
    CC="$(CC)"; \
    CPP="$(CPP)"; \
    CPPFLAGS="$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)"; \
    CPPFLAGS="$${CPPFLAGS} $(AM_CPPFLAGS) $(CPPFLAGS)"; \
    CFLAGS="$(CFLAGS)"; \
    LDFLAGS="$(LDFLAGS)"; \
    NM="$(NM)"; \
    SHELL="$(SHELL)"; \
    export lib_la lib_map HAVE_CPP_dD SYMBOL_PREFIX; \
    export CC CPP CPPFLAGS CFLAGS LDFLAGS NM SHELL;

PL_LOG_COMPILER = $(PERL)
if CROSS_COMPILING
LOG_COMPILER = $(PERL) $(SCRIPTS_AUX)/skip-if-exec-format-error
endif

test/symbols-compat.log test/symbols-compat.trs: test/TestCommon.pm
test/symbols-renames.log test/symbols-renames.trs: test/TestCommon.pm
test/symbols-static.log test/symbols-static.trs: test/TestCommon.pm

COMMON_TEST_OBJECTS = libcrypt.la

test_badsalt_LDADD = $(COMMON_TEST_OBJECTS)
test_badsetting_LDADD = $(COMMON_TEST_OBJECTS)
test_gensalt_bcrypt_x_LDADD = $(COMMON_TEST_OBJECTS)
test_gensalt_nested_call_LDADD = $(COMMON_TEST_OBJECTS)
test_gensalt_nthash_LDADD = $(COMMON_TEST_OBJECTS)
test_gensalt_extradata_LDADD = $(COMMON_TEST_OBJECTS)
test_checksalt_LDADD = $(COMMON_TEST_OBJECTS)
test_des_obsolete_LDADD = $(COMMON_TEST_OBJECTS)
test_des_obsolete_r_LDADD = $(COMMON_TEST_OBJECTS)
test_crypt_badargs_LDADD = $(COMMON_TEST_OBJECTS)
test_crypt_nested_call_LDADD = $(COMMON_TEST_OBJECTS)
test_crypt_too_long_phrase_LDADD = $(COMMON_TEST_OBJECTS)
test_preferred_method_LDADD = $(COMMON_TEST_OBJECTS)
test_short_outbuf_LDADD = $(COMMON_TEST_OBJECTS)
test_special_char_salt_LDADD = $(COMMON_TEST_OBJECTS)

test_ka_bcrypt_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_bcrypt_a_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_bcrypt_x_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_bcrypt_y_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_bigcrypt_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_bsdicrypt_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_descrypt_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_gost_yescrypt_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_md5crypt_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_nt_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_scrypt_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_sha1crypt_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_sha256crypt_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_sha512crypt_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_sm3crypt_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_sm3_yescrypt_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_sunmd5_LDADD = $(COMMON_TEST_OBJECTS)
test_ka_yescrypt_LDADD = $(COMMON_TEST_OBJECTS)

# These tests call internal APIs that may not be accessible from the
# fully linked shared library.
# Refer to object files that are linked into libxcrypt with the
# qualified name, lib/libcrypt_la-foobar.lo, to prevent them from
# being compiled a second time.
test_gensalt_LDADD = \
	lib/libcrypt_la-util-xstrcpy.lo \
	$(COMMON_TEST_OBJECTS)
test_alg_des_LDADD = \
	lib/libcrypt_la-alg-des.lo \
	lib/libcrypt_la-alg-des-tables.lo \
	$(COMMON_TEST_OBJECTS)
test_alg_gost3411_2012_LDADD = \
	lib/libcrypt_la-alg-gost3411-2012-core.lo \
	lib/libcrypt_la-alg-gost3411-2012-hmac.lo \
	lib/libcrypt_la-util-xbzero.lo \
	$(COMMON_TEST_OBJECTS)
test_alg_gost3411_2012_hmac_LDADD = \
	lib/libcrypt_la-alg-gost3411-2012-core.lo \
	lib/libcrypt_la-alg-gost3411-2012-hmac.lo \
	lib/libcrypt_la-util-xbzero.lo \
	$(COMMON_TEST_OBJECTS)
test_alg_hmac_sha1_LDADD = \
	lib/libcrypt_la-alg-sha1.lo \
	lib/libcrypt_la-alg-hmac-sha1.lo \
	lib/libcrypt_la-util-xbzero.lo \
	$(COMMON_TEST_OBJECTS)
test_alg_md4_LDADD = \
	lib/libcrypt_la-alg-md4.lo \
	lib/libcrypt_la-util-xbzero.lo \
	$(COMMON_TEST_OBJECTS)
test_alg_md5_LDADD = \
	lib/libcrypt_la-alg-md5.lo \
	lib/libcrypt_la-util-xbzero.lo \
	$(COMMON_TEST_OBJECTS)
test_alg_pbkdf_hmac_sha256_LDADD = \
	lib/libcrypt_la-alg-sha256.lo \
	lib/libcrypt_la-util-xbzero.lo \
	$(COMMON_TEST_OBJECTS)
test_alg_sha1_LDADD = \
	lib/libcrypt_la-alg-sha1.lo \
	lib/libcrypt_la-util-xbzero.lo \
	$(COMMON_TEST_OBJECTS)
test_alg_sha256_LDADD = \
	lib/libcrypt_la-alg-sha256.lo \
	lib/libcrypt_la-util-xbzero.lo \
	$(COMMON_TEST_OBJECTS)
test_alg_sha512_LDADD = \
	lib/libcrypt_la-alg-sha512.lo \
	lib/libcrypt_la-util-xbzero.lo \
	$(COMMON_TEST_OBJECTS)
test_alg_sm3_LDADD = \
	lib/libcrypt_la-alg-sm3.lo \
	lib/libcrypt_la-util-xbzero.lo \
	$(COMMON_TEST_OBJECTS)
test_alg_sm3_hmac_LDADD = \
	lib/libcrypt_la-alg-sm3.lo \
	lib/libcrypt_la-alg-sm3-hmac.lo \
	lib/libcrypt_la-util-xbzero.lo \
	$(COMMON_TEST_OBJECTS)
test_alg_yescrypt_LDADD = \
	lib/libcrypt_la-alg-sha256.lo \
	lib/libcrypt_la-alg-yescrypt-common.lo \
	lib/libcrypt_la-alg-yescrypt-opt.lo \
	lib/libcrypt_la-util-base64.lo \
	lib/libcrypt_la-util-xbzero.lo \
	$(COMMON_TEST_OBJECTS)
test_crypt_gost_yescrypt_LDADD = \
	lib/libcrypt_la-alg-gost3411-2012-core.lo \
	lib/libcrypt_la-alg-gost3411-2012-hmac.lo \
	lib/libcrypt_la-alg-sha256.lo \
	lib/libcrypt_la-alg-yescrypt-common.lo \
	lib/libcrypt_la-alg-yescrypt-opt.lo \
	lib/libcrypt_la-crypt-yescrypt.lo \
	lib/libcrypt_la-util-base64.lo \
	lib/libcrypt_la-util-xbzero.lo \
	lib/libcrypt_la-util-xstrcpy.lo \
	$(COMMON_TEST_OBJECTS)
test_crypt_sm3_yescrypt_LDADD = \
	lib/libcrypt_la-alg-sm3.lo \
	lib/libcrypt_la-alg-sm3-hmac.lo \
	lib/libcrypt_la-alg-sha256.lo \
	lib/libcrypt_la-alg-yescrypt-common.lo \
	lib/libcrypt_la-alg-yescrypt-opt.lo \
	lib/libcrypt_la-crypt-yescrypt.lo \
	lib/libcrypt_la-util-base64.lo \
	lib/libcrypt_la-util-xbzero.lo \
	lib/libcrypt_la-util-xstrcpy.lo \
	$(COMMON_TEST_OBJECTS)

test_explicit_bzero_LDADD = \
	lib/libcrypt_la-util-xbzero.lo
test_getrandom_interface_LDADD = \
	lib/libcrypt_la-util-get-random-bytes.lo \
	lib/libcrypt_la-util-xbzero.lo
test_getrandom_fallbacks_LDADD = \
	lib/libcrypt_la-util-get-random-bytes.lo \
	lib/libcrypt_la-util-xbzero.lo


if HAVE_LD_WRAP
test_getrandom_fallbacks_LDFLAGS = \
  -Wl,--wrap,getentropy -Wl,--wrap,getrandom -Wl,--wrap,syscall \
  -Wl,--wrap,open -Wl,--wrap,open64 -Wl,--wrap,read -Wl,--wrap,close \
  $(AM_LDFLAGS)
endif

# CI sometimes wants to compile all the test programs but not run them.
test-programs: $(check_PROGRAMS)
phony_targets += test-programs

# Additional checks to run in `make distcheck'.
distcheck-hook:
	cd $(top_srcdir) && \
	  $(PERL) ./$(SCRIPTS_AUX)/check-perlcritic-config && \
	  perlcritic --quiet ./

# Target for generating a signed release tarball.
release: libxcrypt-$(VERSION).tar.xz.sha256sum libxcrypt-gpgkey.asc
phony_targets += release

libxcrypt-$(VERSION).tar.xz.asc: dist-xz
	$(GPG2) \
		--quiet \
		--armor \
		--detach-sign \
		--default-key F52E98007594C21D \
		--output libxcrypt-$(VERSION).tar.xz.asc.T \
		libxcrypt-$(VERSION).tar.xz
	$(AM_V_at)$(SCRIPTS_AUX)/move-if-change \
		libxcrypt-$(VERSION).tar.xz.asc.T \
		libxcrypt-$(VERSION).tar.xz.asc

libxcrypt-$(VERSION).tar.xz.sha256sum: libxcrypt-$(VERSION).tar.xz.asc
	$(SHA256SUM) \
		libxcrypt-$(VERSION).tar.xz \
		libxcrypt-$(VERSION).tar.xz.asc \
		> libxcrypt-$(VERSION).tar.xz.sha256sum.T
	$(AM_V_at)$(SCRIPTS_AUX)/move-if-change \
		libxcrypt-$(VERSION).tar.xz.sha256sum.T \
		libxcrypt-$(VERSION).tar.xz.sha256sum

libxcrypt-gpgkey.asc:
	$(GPG2) \
		--armor \
		--export \
		--export-options \
			export-minimal \
			F52E98007594C21D \
		> libxcrypt-gpgkey.asc.T
	$(AM_V_at)$(SCRIPTS_AUX)/move-if-change \
		libxcrypt-gpgkey.asc.T \
		libxcrypt-gpgkey.asc

CLEANFILES += \
	libxcrypt-$(VERSION).tar.xz.asc* \
	libxcrypt-$(VERSION).tar.xz.sha256sum* \
	libxcrypt-gpgkey.asc*

# Every object file depends on crypt-symbol-vers.h and crypt-hashes.h,
# which are generated files, so automatic dependency generation is not
# sufficient.
include $(builddir)/Makefile.deps

# Add additional targets
.PHONY: $(phony_targets)
install-exec-hook: $(install_exec_hook_targets)
uninstall-hook: $(uninstall_hook_targets)


================================================
FILE: NEWS
================================================
libxcrypt NEWS -- history of user-visible changes.

Please send bug reports, questions and suggestions to
<https://github.com/besser82/libxcrypt/issues>.

Version 4.5.3

Version 4.5.2
* Use a more portable implementation for our fallback implementation
  of explicit_bzero(); also get rid of the need for VLA in the new
  implementation (issue #212).
* Fix compilation of alg-sha1 with optimization level 3 for GCC v11
  and newer (issue #179).

Version 4.5.1
* Do not include undefined symbols in version-script (issue #181, #213).
* Fix build with clang-20+ on macOS (issue #216).

Version 4.5.0
* Implement the sm3crypt ($sm3$) hashing algorithm (issue #188).
* Implement the sm3-yescrypt ($sm3y$) hashing algorithm (issue #206).
* Fix the implementation of the crypt(3) functions and the crypt_gensalt(3)
  functions to not overwrite the output buffer too early. (issue #209).
* Fix the strcpy_or_abort() function to call abort() in -DNDEBUG builds.
* Add some more testcases.
* Several fixes for issues found by Coverity.

Version 4.4.38
* Fix several "-Wunterminated-string-initialization", which are seen by
  upcoming GCC 15.x (issue #194).
* Fix "-Wmaybe-uninitialized" in crypt.c, which is seen by GCC 13.3.0.
* Skip test/explicit-bzero if compiling with ASAN.
* Drop hard requirement for the pkg-config binary (issue #198).

Version 4.4.37
* Several fixes to the manpages (issue #185).
* Add binary compatibility for x86_64 GNU/Hurd (issue #189).
* Only test the needed makecontext signature during configure (issue #178).
* Fix -Werror=strict-overflow in lib/crypt-bcrypt.c, which is seen
  by GCC 4.8.5 (issue #197).

Version 4.4.36
* Fix left over bits failing with Perl v5.38.0 (issue #173).

Version 4.4.35
* Fix build with Perl v5.38.0 (issue #170).
* Fix build with MinGW-w(32|64).

Version 4.4.34
* Update build-aux/m4/ax_valgrind_check.m4 to v23.
* Optimize some cast operation for performance in
  lib/alg-yescrypt-platform.c.
* Add SHA-2 Maj() optimization proposed by Wei Dai in lib/alg-sha512.c.
* Explicitly clean the stack and context state after computation in
  lib/alg-gost3411-2012-hmac.c, lib/alg-hmac-sha1.c, and lib/alg-sha256.c
  (issue #168).

Version 4.4.33
* Fix -Werror=sign-conversion in lib/alg-yescrypt-platform.c.
  With commit 894aee75433b4dc8d9724b126da6e79fa5f6814b we introduced some
  changes to huge page handling, that show this error when building with
  GCC v12.2.1, and thus need a small fix.

Version 4.4.32
* Improvements to huge page handling in lib/alg-yescrypt-platform.c.
  When explicitly using huge pages, request the 2 MiB page size.
  This should fix the issue where on a system configured to use 1 GiB
  huge pages we'd fail on munmap() as we're only rounding the size up
  to a multiple of 2 MiB.  With the fix, we wouldn't use huge pages on
  such a system.  Unfortunately, now we also wouldn't use huge pages on
  Linux kernels too old to have MAP_HUGE_2MB (issue #152).

Version 4.4.31
* Fix -Werror=conversion in lib/alg-yescrypt-opt.c
  (issues #161 and #162).
* Add some SHA-2 Maj() optimization in lib/alg-sha256.c.
* Fix issues found by Covscan in test/getrandom-fallback.c.
* Fix -Werror=strict-overflow in lib/crypt-des.c, which is seen
  by GCC 12.x (issues #155 and #163).

Version 4.4.30
* configure: Restore ucontext api functionality check.
  In c3f01c72b303cbbb0cc8983120677edee2f3fa4b the use of the ucontext api
  in the main program was removed, and with it the configure check for it.
  However, the ucontext api is still used in the "explicit_bzero" test and
  thus this test still needs to be in place.
  See also: https://bugs.gentoo.org/838172
* configure: Restore the functionality of the '--disable-symvers' switch.
  Without this fix the build was simply broken, if symbol versioning was
  disabled for any reason, e.g. whether the compiler nor the linker
  supporting it, or if disabled on purpose by the user (issue #142).
* Fix variable name in crypt(3) for a datamember of 'struct crypt_data'
  (issue #153).

Version 4.4.29
* Add glibc-on-loongarch-lp64 (Loongson LA464 / LA664) entry to
  libcrypt.minver.  This was added in GNU libc 2.36.

Version 4.4.28
* Add glibc-on-or1k (OpenRISC 1000) entry to libcrypt.minver.
  This was added in GNU libc 2.35.

Version 4.4.27
* Limit the maximum amount of rbytes to 64 bytes (512 bits) for
  yescrypt, gost-yescrypt, and scrypt.  Also reflect this limit
  in the documentation (issue #145).

Version 4.4.26
* Fix compilation on systems with GCC >= 10, that do not support
  declarations with __attribute__((symver)).

Version 4.4.25
* Add support for Python 3.11 in the configure script.
* Stricter checking of invalid salt characters (issue #135).
  Hashed passphrases are always entirely printable ASCII, and do
  not contain any whitespace or the characters ':', ';', '*', '!',
  or '\'.  (These characters are used as delimiters and special
  markers in the passwd(5) and shadow(5) files.)

Version 4.4.24
* Add hash group for Debian in lib/hashes.conf.
  Debian has switched to use the yescrypt hashing algorithm as
  the default for new user passwords, so we should add a group
  for this distribution.
* Overhaul the badsalt test.
  Test patterns are now mostly generated rather than manually coded
  into a big table.  Not reading past the end of the “setting” part
  of the string is tested more thoroughly (this would have caught the
  sunmd5 $$ bug if it had been available at the time).
  Test logs are tidier.
* Add ‘test-programs’ utility target to Makefile.
  It is sometimes useful to compile all the test programs but not run
  them.  Add a Makefile target that does this.
* Fix incorrect bcrypt-related ifdeffage in test/badsalt.c.
  The four variants of bcrypt are independently configurable, but the
  badsalt tests for them were all being toggled by INCLUDE_bcrypt,
  which is only the macro for the $2b$ variant.
* Fix bigcrypt-related test cases in test/badsalt.c.
  The test spec was only correct when both or neither of bigcrypt and
  descrypt were enabled.
* Detect ASan in configure and disable incompatible tests.
  ASan’s “interceptors” for crypt and crypt_r have a semantic conflict
  with libxcrypt, requiring a few tests to be disabled for builds with
  -fsanitize-address.  See commentary in test/crypt-badargs.c for an
  explanation of the conflict, and the commentary in
  build-aux/m4/zw_detect_asan.m4 for why a configure test is required.
* Fix several issues found by Covscan in the testsuite.  These include:
  - CWE-170: String not null terminated (STRING_NULL)
  - CWE-188: Reliance on integer endianness (INCOMPATIBLE_CAST)
  - CWE-190: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
  - CWE-569: Wrong sizeof argument (SIZEOF_MISMATCH)
  - CWE-573: Missing varargs init or cleanup (VARARGS)
  - CWE-687: Argument cannot be negative (NEGATIVE_RETURNS)

Version 4.4.23
* Fix output calculation for gensalt_yescrypt_rn().
* Fix -Werror=conversion in lib/crypt-des-obsolete.c,
  test/des-obsolete.c, and test/des-obsolete_r.c.

Version 4.4.22
* The crypt_checksalt() function has been fixed to correctly return
  with 'CRYPT_SALT_INVALID', in case the setting, that is passed
  to be checked, represents an empty passphrase or an uncomputed
  setting for descrypt without any salt characters.

Version 4.4.21
* The crypt_checksalt() function will now return the value
  'CRYPT_SALT_METHOD_LEGACY' in case the setting, that is passed
  to be checked, uses a hashing method, which is considered to be
  too weak for use with new passphrases.

Version 4.4.20
* Fix build when the CFLAGS variable, that is passed into the
  configure script, has a leading whitespace character in it
  (issue #123).

Version 4.4.19
* Improve fallback implementation of explicit_bzero.
* Add glibc-on-CSKY, ARC, and RISCV-32 entries to libcrypt.minver.
  These were added in GNU libc 2.29, 2.32, and 2.33 respectively
  (issue #122).
* Do not build xcrypt.h if we’re not going to install it.
* Do not apply --enable-obsolete-api-enosys mode to fcrypt.
* Compilation fix for NetBSD.  NetBSD’s <unistd.h> declares encrypt
  and setkey to return int, contrary to POSIX (which says they return
  void).  Rename those declarations out of the way with macros.
* Compilation fixes for building with GCC 11.
  Basically fixes for explicit type-casting.
* Force update of existing symlinks during installation (issue #120).

Version 4.4.18
* Fix compilation errors on (Free)BSD (issue #110).
* Fix conversion error in lib/alg-gost3411-core.c, which is seen by
  some sensitive compilers.
* Convert build scripts to Perl.
  The minimum version of Perl required is 5.14.

Version 4.4.17
* Fix compilation error in 'alignas (type)' with older versions
  of glibc and/or gcc (issue #107).
* Salt string compatibility with generic implementations (issue #105).
  All other existing implementations of the md5crypt, sha256crypt,
  and sha512crypt hashing methods allow any ASCII character to be
  present in the salt string.
  We changed our implementation of these hash methods to be compliant
  with the general behaviour, except for the colon ':' character,
  which serves a special purpose in the Unix shadow file, and the
  newline '\n' character, since all parameters of the user data must
  be on the same line within the Unix shadow file.
* Fix for GCC 10.2 on s390x.

Version 4.4.16
* Add support for the e2k architecture.

Version 4.4.15
* The compatibility symbols crypt_gensalt_r, xcrypt, xcrypt_r,
  xcrypt_gensalt, and xcrypt_gensalt_r are deprecated further.
  (These are alternative names for crypt_gensalt_rn, crypt, crypt_r,
  crypt_gensalt, and crypt_gensalt_rn, respectively; there is no
  difference in behavior.)

  In an --enable-xcrypt-compat-files configuration, newly compiled
  programs can still use functions with these names if they include
  xcrypt.h, but a program that attempts to use one of these functions
  *without* including xcrypt.h will fail to link.  In particular, this
  means AC_CHECK_FUNCS([xcrypt]) will not detect xcrypt, because the
  test program generated by AC_CHECK_FUNCS does not include xcrypt.h.

  In a --disable-xcrypt-compat-files --enable-obsolete-api
  configuration, xcrypt.h is not installed and newly compiled programs
  cannot use functions with these names, but existing binaries that
  expect to find these symbols in a shared libcrypt.so.1 will still
  work.

  In a --disable-obsolete-api configuration, these symbols are not
  defined at all; moreover, --disable-obsolete-api now implies
  --disable-xcrypt-compat-files (which means xcrypt.h isn't installed).

Version 4.4.14
* Renamed bootstrap script: 'bootstrap' -> 'autogen.sh'.
  If building from a Git checkout instead of a tarball release,
  use './autogen.sh' to create the configure script.

Version 4.4.13
* libxcrypt now builds (including working tests) on Mac OSX.
* Speed up ka-sunmd5 by skipping most of the test phrases.
  ka-sunmd5 is slower than the entire rest of the testsuite put
  together, because the sunmd5 hash is Just That Slow and we have to do
  extra tests for it to ensure bug-compatibility.  No easy optimizations
  are possible and the difficult optimizations are not worth the
  engineering effort for this obsolete hash.  Instead, skip most of the
  test phrases.  See comments in test/ka-table-gen.py!h_sunmd5 for
  further explanation.

Version 4.4.12
* Another fix for GCC v10.x, which occurs on s390 architectures only.

Version 4.4.11
* Fixes for GCC v10.x (issue #95).
* Change how the known-answer tests are parallelized.

Version 4.4.10
* Fix ordering of hash methods in crypt-hashes.h when generated
  using gawk < 4.1.0.

Version 4.4.9
* Fix false positive finding from CovScan.

Version 4.4.8
* Add binary compatibility for GNU/Hurd and GNU/kFreeBSD.

Version 4.4.7
* LICENSING: Add missing files and update license information.
* Fix -Wformat in test/crypt-kat.c.

Version 4.4.6
* Make unalignment test really unaligned.

Version 4.4.5
* Fix alignment problem for GOST 34.11 (Streebog) in gost-yestcrypt.
  Some architectures in some circumstances do not allow unaligned
  memory access (such as ARM, MIPS, SPARC) triggering SIGBUS. This
  patch very crudely fixes this issue.
  Being unfixed this would trigger SIGBUS when password buffer is
  unaligned. Crash and fix are tested on UltraSparc T5 on GCC Compile
  farm.

Version 4.4.4
* The crypt_* functions will now all fail and set errno to ERANGE if
  their 'phrase' argument is longer than CRYPT_MAX_PASSPHRASE_SIZE
  characters (this is currently 512).  Formerly, longer passphrases
  would either be silently accepted, silently truncated, or the
  library would crash, depending on the hashing method.
* The NT hashing method no longer truncates passphrases at 128
  characters; Windows does not do this.  (The Windows login dialog
  _limits_ interactively entered passphrases to 127 characters.
  Passphrases set via the low-level API can be longer.)

Version 4.4.3
* Fix the value of SUNMD5_MAX_ROUNDS.
* Add generated C++-guards to <xcrypt.h>.
* Add --enable-obsolete-api-enosys configure option.
  If enabled, this option replaces the obsolete APIs (fcrypt,
  encrypt{,_r}, and setkey{,_r}) with stubs that set errno to
  ENOSYS and return without performing any real operations.
  This allows one to disable DEScrypt support while preserving
  POSIX compliance.
  For security reasons, the encrypt{,r} functions will also
  overwrite their data-block argument with random bits.
  The fcrypt function will always produce a failure token
  (*0 or *1), unless the library was also configured with
  --disable-failure-tokens, in which case it will always
  return NULL.

Version 4.4.2
* Add test-alg-yescrypt for improved coverage.
* Add x32 specific inline asm.

Version 4.4.1
* Change the output of the gensalt function for the NT hashing method
  ($3$) to output just its prefix ($3$) instead of a fake salt.
  The output buffer for the returned string must be at least 4 bytes
  long.
* Decrase the minimum required amount of random bytes for the NT
  hashing method to 1 byte, which is actually not used.
* The default linker flags now generate binaries with full read-only
  relocations (including full read-only re-mapping of the GOT), if
  supported by the linker and the system's native binary format.

Version 4.4.0
* Implement the crypt_preferred_method function.
  This function can be used as a convenience function to get the prefix
  of the preferred hash method.

Version 4.3.4
* --enable-hashes now supports 'fedora' as a group of hashing methods.
* Add aliases for xcrypt{,_r} and xcrypt_gensalt{,_r}.
  They were added for code compatibility with libxcrypt v3.1.1
  and earlier.
* Install the <xcrypt.h> header file, declaring the previously named
  aliases, and a symlink from libxcrypt.so to libcrypt.so, if a shared
  library is build.  For static libraries a corresponding symlink for
  the archive file will be installed.
  The installation of the compatibility files can be disabled by
  passing the '--disable-xcrypt-compat-files' flag to the configure
  script.
* Replace the prototype for the crypt_gensalt_r function with a
  declaration through a macro, so new compiled applications link
  against the identical crypt_gensalt_rn function directly.

Version 4.3.3
* Add an alias for crypt_gensalt_r.
  The function was available in older versions (v3.1.1 and earlier)
  of libxcrypt.  It has the same semantics and the same prototype as
  the crypt_gensalt_rn function.

Version 4.3.2
* Fix the gensalt function for the NT hashing method ($3$) to
  properly terminate its output string.  The output buffer for the
  returned string must be at least 30 bytes long.
* Remove the gensalt function for the bcrypt x variant ($2x$).
  This prefix was never intended for use when hashing new passphrases.
  The only use case originally intended was to manually edit '$2a$' to
  '$2x$' in passphrase hashes to knowingly take the risk yet enable
  users to continue to log in when upgrading systems with buggy bcrypt
  implementations to fixed versions.

Version 4.3.1
* Reduce the number of methods that can be the default for new hashes.
  We don’t want to accidentally encourage use of gost-yescrypt,
  scrypt, or the bug-compatibility bcrypt variants by people who do
  not have a specific need for them.
* sha256crypt ($5$) is not considered to be strong anymore.  Thus
  it was dropped from the STRONG and DEFAULT sets.
* The four variants of bcrypt ($2b$, $2a$, $2y$, $2x$) are now
  independently selectable at configure time.  The $2x$ variant has
  been dropped from the STRONG set, because it has a severe bug
  causing it to be easy to find collisions for some passwords.  The
  $2x$ and $2y$ variants have been dropped from the FreeBSD, NetBSD,
  OpenBSD, and Solaris compatibility sets, because those operating
  systems never supported those variants.

Version 4.3.0
* Implement the gost-yescrypt ($gy$) hashing algorithm.
* Remove all of the nonnull annotations, which are a questionable
  optimization that have caused problems in the past and may cause
  future problems on some systems.
* Rename all hash methods to match naming in John the Ripper.
* Make the configure switches --enable-obsolete-api and
  --enable-hashes process their arguments case-insensitively; for
  instance, "--enable-hashes=OpenBSD" and "--enable-hashes=openbsd"
  are now understood as synonymous.
* Fix gensalt for bigcrypt if descrypt hash method is not selected
  at compile time.
* Fix the bigcrypt hash method to reject too short settings and/or
  descrypt hashes with a truncated phrase.  Hashes with a setting
  shorter than 13 characters and phrases shorter than 8 characters
  are valid bigcrypt hashes, although they are identical with the
  output generated by descrypt under the same conditions.
  This only applies when the descrypt hash method is not selected
  at compile time.
* Implement crypt_checksalt, which can be used by portable users of
  libxcrypt to check whether the desired hash method is supported.
* Make a default prefix available whenever at least one strong hash
  is enabled.
* Fix the definition of 'CRYPT_GENSALT_IMPLEMENTS_DEFAULT_PREFIX'
  to reflect whether the default prefix is available or not.

Version 4.2.3
* Add bootstrap script.  If building from a Git checkout instead of a
  tarball release, use './bootstrap' to create the configure script.
* Use sha512 implementation from Colin Percival.  Thus we now have a
  sha512 implementation under the BSD license.
* Use md5 implementation from Alexander Peslyak.  Thus we now have a
  md5 implementation in the public domain.
* 'make dist' now generates bzip2 and xz compressed tarballs along
  with the default gzip compressed tarball.
* The group 'altlinux' has been renamed to 'alt' in --enable-hashes,
  as the ALTLINUX distribution has been rebranded to ALT some time ago.
* New tagged versions are automatically submitted for Coverity Scan:
  https://scan.coverity.com/projects/besser82-libxcrypt

Version 4.2.2
* Convert existing manpages to BSD mdoc format.

Version 4.2.1
* Fix tests for yescrypt and scrypt, when failure-tokens have been
  disabled.

Version 4.2.0
* Implement yescrypt ($y$) and scrypt ($7$) hashing algorithms.
* For scrypt the implemented gensalt function ensures every new hash
  is computed using at least 32 MiBytes of RAM.
* yescrypt is the new default method used for new hashes.
* --enable-hashes now supports additional groups of hashing methods:
  'altlinux', 'owl', and 'suse', which select the methods historically
  supported on those operating systems.
* Added 'XCRYPT_VERSION_*' macros.

Version 4.1.2
* Add optional 'check-valgrind' target to the Makefile.
* Replace crypt-sha{256,512}.c with an implementation in the Public
  Domain.
* Add alias man-pages for other crypt functions.
* Add configure option --disable-failure-tokens, which causes crypt
  and crypt_r to return NULL on failure, as crypt_rn and crypt_ra do,
  instead of a special "failure token".  Using this option improves
  compatibility with programs written on the assumption that, like
  most C library functions, crypt and crypt_r will return NULL on
  failure; but it breaks compatibility with programs that assume these
  functions never return NULL.  We're not sure which type of program
  is more common.  Please let us know if you encounter either.
* Improved handling of out-of-range cost parameters in gensalt.
  The behavior is now:
  - for hashes with a fixed cost parameter (DES/trad, DES/big, NTHASH,
    MD5/bsd), crypt_gensalt only accepts 0 as the rounds argument.
  - for hashes with a linear cost parameter (DES/bsdi, MD5/sun, SHA1,
    SHA256, SHA512), crypt_gensalt accepts 0 or any value in the range
    [1, ULONG_MAX] and clips it to the actual valid range for the hash
    function, if necessary.  In the case of DES/bsdi, even numbers
    become odd, as well.
  - for hashes with an exponential cost parameter (bcrypt),
    crypt_gensalt only accepts 0 or a value in the actual valid range.
  - the documented valid range for SHA1 is now [4, 4294967295] instead
    of [1, 4294967295].
  - all of this is tested.

Version 4.1.1
* --enable-hashes now supports additional groups of hashing methods:
  'freebsd', 'netbsd', 'openbsd', 'osx', and 'solaris', which select
  the hashes historically supported on those operating systems.
* Predictable behavior when arguments to crypt() are NULL or invalid
  (issue #15).
* Hash formats $5, $6, and $md5 once again allow an explicit rounds
  parameter specifying the default number of rounds (issue #16).
* The library no longer uses swapcontext(), for ease of debugging and
  better compatibility with hardening mechanisms like Intel CET
  (issue #18).
* Can now be built with versions of GNU ld older than 2.26.2.
* crypt_gensalt_ra no longer leaks memory on failure.

Version 4.1.0
* Fix spelling of SUSE.
* Lower the minimum required automake version to 1.14.
* Fix build with USE_SWAPCONTEXT turned off.
* Extend --enable-weak-hashes configure option to accept optional
  "glibc" parameter.  When specified, it enables only those of
  weak hashes that are supported by historic versions of the
  GNU libc.
* Fix the leak of obtained random bytes.
* Check expected output strings for deterministic methods.
* Fix memory leak in crypt_sha1crypt_rn.
* Fix read of random bytes out of bounds in gensalt_sha1crypt_rn.
* Make it possible to disable individual hashes at configure time.
  The default is --enable-hashes=all.  --enable-hashes=strong is the
  equivalent of the old --disable-weak-hashes.  You could even do
  --enable-hashes=bcrypt,des to get a binary-compatible libcrypt.so.1
  that still supports almost nothing other than bcrypt.
* Make salt validation pickier.
* Replace crypt-sunmd5.c with BSD-licensed cleanroom reimplementation.
* Make crypt_gensalt for $sha1 deterministic.
* Fix incorrect output-size computation in crypt_sha1crypt_rn.
* Add docs for SHA1, MD5/Sun, NTHASH.
* Introduce CRYPT_GENSALT_IMPLEMENTS_* feature test macros.
* Install libcrypt.pc symlink along with libxcrypt.pc.
* Extend --enable-obsolete-api configure option.
  Make vendor specific parts of compatibility ABI that are enabled by
  --enable-obsolete-api option configurable.
  This allows vendors to enable only those parts of compatibility ABI
  that are relevant to them.
* Extend overall test coverage.

Version 4.0.1
* Fixes for GCC v8.x
* Add symbol version for riscv64
* Fixed an uninitialized value in test-crypt-badsalt

Version 4.0.0
* Full binary backward compatibility with glibc libcrypt; all programs
  compiled with glibc libcrypt, including vendor-patched versions that
  include the Openwall extensions, should work with this libcrypt
  (however, programs compiled against this libcrypt will NOT work with
  glibc libcrypt).
* struct crypt_data is now only 32kB (from 128kB), and divided into a
  public-API section and a properly opaque internal section.
* New feature: supplying a null pointer as the "prefix" argument to
  any of the crypt_gencrypt functions will cause it to select the best
  available hash function (in this release, bcrypt in mode 'a').
  CAUTION: it must be a null pointer, not an empty string.  If you
  supply an empty string, that selects DES, which is the *worst*
  available hash function.
* New feature: supplying a null pointer as the "rbytes" argument to
  any of the crypt_gencrypt functions will cause it to acquire random
  bytes from the operating system.
* The legacy functions bigcrypt, fcrypt, encrypt, encrypt_r,
  setkey, and setkey_r are no longer available for use by new programs.
  All of these (except fcrypt, which was just another name for crypt)
  force the use of DES, which is no longer safe for any application.
* New configure option --disable-obsolete-api removes the above
  functions from the library.  Since this breaks compatibility with
  glibc's libcrypt, when this option is used the shared library will
  be libcrypt.so.2 instead of libcrypt.so.1, and all of the
  compatibility symbol versions for the crypt* functions will be
  omitted.  This option is the default on all operating systems where
  there is no GNU C Library to be compatible with.
* New configure option --disable-weak-hashes removes all support for
  DES and MD5 hashes from the library.  This option implies
  --disable-obsolete-api, and will prevent DES and MD5 password hashes
  from being *verified* -- accounts with such hashes are effectively
  locked.  It is intended for use in high-security new installations.
* Sensitive intermediate data is now thoroughly scrubbed from the
  stack and CPU registers before the crypt functions return to their
  callers.
* UFC-crypt has been replaced with FreeSec; this enables the reduction in
  size of crypt_data, and adds full support for BSD extended DES hashes.
* Extensive code cleanup and portability work.  The static library
  should now be buildable with any C99 compiler, although some
  features may not be available (notably acquiring random bytes from
  the operating system and scrubbing the stack).  The shared library
  does still require some GNU extensions for symbol versioning.
* The configure options --enable-Wno-cast-align and --enable-bootstrap
  are no longer necessary and have been removed.
* If building from a Git checkout instead of a tarball release, use
  'autoreconf -i' to create the configure script; autogen.sh has been
  removed.
* More thoroughly tested.

Version 3.1.1
* Add '--enable-Wno-cast-align' to silence 'cast increases required alignment'
* Whitespace clean-up

Version 3.1.0
* Update upstream-contact
* Add './configure --enable-bootstrap' to skip some tests on initial build
* Add bootstrap-script for Autotools
* Add LICENSE for bcrypt
* Update crypt_blowfish to v1.3
* Add '-Wextra' to CFLAGS
* Fix warnings generated by gcc 5.1.1
* Update Autotools

Version 3.0.4
* Fix warnings generated by gcc 4.6

Version 3.0.3
* Fix memory leak
* Fix compiler warnings

Version 3.0.2
* Fix generating salts for MD5

Version 3.0.1
* Fix build failures

Version 3.0
* Add sha256 and sha512 hashes
* Move all hashes into plugins

Version 2.4
* Sync with crypt_blowfish 1.0

Version 2.3
* Fix problems with gcc > 4.0

Version 2.2
* Fix realloc call in md5-crypt

Version 2.1
* Enable x86.S for i386 again

Version 2.0
* Rename all crypt* functions to xcrypt* to avoid clash with normal
  libcrypt from glibc

Version 1.4
* Fix compiling with glibc > 2.3.1
* Sync with crypt_blowfish 0.4.5

Version 1.3
* Sync with current glibc CVS (fix for not correct initialication of
  internal data structs)

Version 1.2
* Fix building with glibc 2.3.x
* Add support for HPPA

Version 1.1
* merge md5.h with xcrypt.h
* Add SHA1 functions and crypt

Version 1.0
* First release


================================================
FILE: README.md
================================================
[![Build matrix](https://github.com/besser82/libxcrypt/actions/workflows/config-matrix.yml/badge.svg)](https://github.com/besser82/libxcrypt/actions/workflows/config-matrix.yml)
[![Memcheck](https://github.com/besser82/libxcrypt/actions/workflows/memcheck.yml/badge.svg)](https://github.com/besser82/libxcrypt/actions/workflows/memcheck.yml)
[![Distcheck](https://github.com/besser82/libxcrypt/actions/workflows/distcheck.yml/badge.svg)](https://github.com/besser82/libxcrypt/actions/workflows/distcheck.yml)
[![COPR Build Status](https://copr.fedorainfracloud.org/coprs/besser82/libxcrypt_CI/package/libxcrypt/status_image/last_build.png)](https://copr.fedorainfracloud.org/coprs/besser82/libxcrypt_CI)
[![codecov](https://codecov.io/gh/besser82/libxcrypt/branch/develop/graph/badge.svg)](https://codecov.io/gh/besser82/libxcrypt)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/17073/badge.svg)](https://scan.coverity.com/projects/besser82-libxcrypt)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1ebaa2314aca4bab92e14130906d5096)](https://www.codacy.com/manual/besser82/libxcrypt?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=besser82/libxcrypt&amp;utm_campaign=Badge_Grade)

README for libxcrypt
====================

libxcrypt is a modern library for one-way hashing of passwords.  It
supports a wide variety of both modern and historical hashing methods:
yescrypt, gost-yescrypt, sm3-yescrypt, scrypt, bcrypt, sha512crypt,
sha256crypt, sm3crypt, md5crypt, SunMD5, sha1crypt, NT, bsdicrypt,
bigcrypt, and descrypt.
It provides the traditional Unix `crypt` and `crypt_r` interfaces, as
well as a set of extended interfaces pioneered by Openwall Linux,
`crypt_rn`, `crypt_ra`, `crypt_gensalt`, `crypt_gensalt_rn`, and
`crypt_gensalt_ra`.

libxcrypt is intended to be used by `login(1)`, `passwd(1)`, and other
similar programs; that is, to hash a small number of passwords during
an interactive authentication dialogue with a human.  It is not
suitable for use in bulk password-cracking applications, or in any
other situation where speed is more important than careful handling of
sensitive data.  However, it *is* intended to be fast and lightweight
enough for use in servers that must field thousands of login attempts
per minute.

Authorship and Licensing
------------------------

libxcrypt is currently maintained by Björn Esser and Zack Weinberg.
Many people have contributed to the code making up libxcrypt, often
under the aegis of a different project.  Please see the AUTHORS and
THANKS files for a full set of credits.

libxcrypt as a whole is licensed under the GNU Lesser General Public
License (version 2.1, or at your option, any later version).  However,
many individual files may be reused under more permissive licenses if
separated from the library.  Please see the LICENSING file for a
comprehensive inventory of licenses, and COPYING.LIB for the terms of
the LGPL.

Bug Reports, Feature Requests, Contributions, Etc.
--------------------------------------------------

libxcrypt is currently maintained at Github: the canonical repository
URL is <https://github.com/besser82/libxcrypt>.  Please file bug
reports at <https://github.com/besser82/libxcrypt/issues>.  This is
also the appropriate place to suggest new features, offer patches,
etc.  All your feedback is welcome and will eventually receive a
response, but this is a spare-time project for all of the present
maintainers, so please be patient.

Build Requirements and Instructions
-----------------------------------

To build from a tarball release, the tools required are the standard
Unix shell environment, a C compiler, and Perl (version 5.14 or
later).  Follow the generic build and installation instructions in the
file `INSTALL`.  There are several package-specific configure options;
run `./configure --help` for more detail on these options.
Run `man -l crypt.5` for more detail on the hashing algorithms that
can be enabled or disabled by `--enable-hashes`.  You can do both of
these things before building the software.

Building from a Git checkout additionally requires the Autotools
suite: `autoconf`, `automake`, `libtool`, and `pkg-config`.
Run `./autogen.sh` at the top level of the source tree, and then
follow the instructions in `INSTALL` (which is created by that command).

The oldest versions of Autotools components that are known to work
are: autoconf 2.69, automake 1.14, libtool 2.4.6, pkg-config 0.29.
If you test with an older version of one of these and find that it
works, please let us know.  We are not deliberately requiring newer
versions; we just can’t conveniently test older versions ourselves.

Portability Notes
-----------------

libxcrypt should be buildable with any ISO C1999-compliant C compiler,
with one critical exception: the symbol versioning macros in
`crypt-port.h` only work with compilers that implement certain GCC and
GNU Binutils extensions (`__attribute__((alias))`, GCC-style `asm`,
and `.symver`).

A few C2011 features are used; the intention is not to use any of them
without a fallback, but we do not currently test this.  A few POSIX
and nonstandard-but-widespread Unix APIs are also used; again, the
intention is not to use any of them without a fallback, but we do not
currently test this.  In particular, the crypt_gensalt functions may
not always be able to retrieve cryptographically-sound random numbers
from the operating system; if you call these functions with a null
pointer for the “rbytes” argument, be prepared for them to fail.

As of mid-2018, GCC and LLVM don’t support link-time optimization of
libraries that use symbol versioning.  If you build libxcrypt with
either of these compilers, do not use `-flto`.  See [GCC bug 48200][1]
for specifics; the problem is very similar for LLVM.  Because this is,
at its root, a set of missing compiler features, we expect link-time
optimization won’t work in other C compilers either, but we haven’t
tested it ourselves.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200

Compatibility Notes
-------------------

On Linux-based systems, by default libxcrypt will be binary backward
compatible with the libcrypt.so.1 shipped as part of the GNU C
Library.  This means that all existing binary executables linked
against glibc’s libcrypt should work unmodified with this library’s
libcrypt.so.1.  We have taken pains to provide exactly the same symbol
versions as were used by glibc on various CPU architectures, and to
account for the variety of ways in which the Openwall extensions were
patched into glibc’s libcrypt by some Linux distributions.  (For
instance, compatibility symlinks for SUSE’s “libowcrypt” are provided.)

However, the converse is not true: programs linked against libxcrypt
will not work with glibc’s libcrypt.  Also, programs that use certain
legacy APIs supplied by glibc’s libcrypt (`encrypt`, `encrypt_r`,
`setkey`, `setkey_r`, and `fcrypt`) cannot be *compiled* against
libxcrypt.

Binary backward compatibility can be disabled by supplying the
`--disable-obsolete-api` switch to `configure`, in which case libxcrypt
will install libcrypt.so.2 instead of libcrypt.so.1.  This
configuration is always used on all operating systems other than
Linux.  We are willing to consider adding binary backward
compatibility for other operating systems’ existing libcrypts, but we
don’t currently plan to do that work ourselves.

Individual hash functions may be enabled or disabled by use of the
`--enable-hashes` switch to `configure`.  The default is to enable all
supported hashes.  Disabling the traditional ‘des’ hash algorithm
implies `--disable-obsolete-api`.  Security-conscious environments
without backward compatibility constraints are encouraged to use
`--enable-hashes=strong`, which enables only the hash functions that
are strong enough to be safe for newly hashed passwords.

The original implementation of the SunMD5 hashing algorithm has a bug,
which is mimicked by libxcrypt to be fully compatible with hashes
generated on (Open)Solaris.  According to the only existing
[documentation of this algorithm][2], its hashes were supposed to have
the format `$md5[,rounds=%u]$<salt>$<checksum>`, and include only the
bare string `$md5[,rounds=%u]$<salt>` in the salt digest
step. However, almost all hashes encountered in production
environments have the format `$md5[,rounds=%u]$<salt>$$<checksum>`
(note the double $$).  Unfortunately, it is not merely a cosmetic
difference: hashes of this format incorporate the first $ after the
salt within the salt digest step, so the resulting checksum is
different.  The documentation hints that this stems from a bug within
the production implementation’s parser.  This bug causes the
implementation to return `$$`-format hashes when passed a
configuration string that ends with `$`.  It returns the intended
original format and checksum only if there is at least one letter
after the `$`, e.g. `$md5[,rounds=%u]$<salt>$x`.

The NT algorithm, in its original implementation, never came with any
`gensalt` function, because the algorithm does not use any.  libxcrypt
ships a bogus `gensalt` function for the NT algorithm, which simply
returns `$3$`.

glibc’s libcrypt could optionally be configured to use Mozilla’s NSS
library’s implementations of the cryptographic primitives md5crypt,
sha256crypt, and sha512crypt.  This option is not available in
libxcrypt, because we do not currently believe it is a desirable
option.  The stated rationale for the option was to source all
cryptographic primitives from a library that has undergone FIPS
certification, but we believe FIPS certification would need to cover
all of libxcrypt itself to have any meaningful value.  Moreover, the
strongest hashing methods, yescrypt and bcrypt, use cryptographic
primitives that are not available from NSS, so the certification
would not cover any part of what will hopefully be the most used code
paths.

[2]: https://dropsafe.crypticide.com/article/1389


================================================
FILE: THANKS
================================================
As mentioned in the README, many people have contributed to the code
making up libxcrypt, often under the aegis of a different project.  Of
the past contributors, we particularly wish to credit David Burren,
Ulrich Drepper, Alec Muffett, Colin Percival, Alexey Degtyarev, and
Thorsten Kukuk.

As well as the present maintainers, active contributors to the library
include Solar Designer, Dmitry V. Levin, and <vt at altlinux dot org>.

We would also like to extend our thanks in advance to everyone who
will, in the future, send us bug reports, suggestions, and contributions.

  -- The Authors.


================================================
FILE: TODO.md
================================================
to-do list for libxcrypt
------------------------

This list is categorized but not in any kind of priority order.
It was last updated 20 October 2018.

* Code cleanliness
  * Find and remove any code that still does dodgy things with type punning
  * Factor out all of the repetitive base64 code
  * Factor out the multiple implementations of HMAC and PBKDF

* Testsuite improvements
  * Investigate branch coverage
  * Do some API fuzz testing and add missing cases to the testsuite
  * Many of the `test-crypt-*.c` files repeat more or less the same
    code with different data, consider merging them

* Portability
  * Make sure the symbol versioning macros work with all of the
    compilers that anyone needs (they use GCC extensions that clang
    also supports).

* Hardening
  * bcrypt-like selftest/memory scribble for all hashing methods
    * how do we know the memory scribble is doing its job?
  * build out of the box with compiler hardening features turned on
  * something bespoke for not having to write serialization and
    deserialization logic for hash strings by hand, as this is
    probably the most error-prone part of writing a hashing method

  * the most sensitive piece of data handled by this library is a
    cleartext passphrase.  OS may have trusted-path facilities for
    prompting the user for a passphrase and feeding it to a KDF
    without its ever being accessible in normal memory.  investigate
    whether we can use these.

* Additional hashing methods
  * Argon2 <https://password-hashing.net/>
  * ...?

* Runtime configurability (in progress on the [crypt.conf branch][])
  * allow installations to enable or disable specific hash methods
    without rebuilding the library
  * make the default cost parameter used by `crypt_gensalt_*` for new
    hashes configurable
  * update the compiled-in defaults used by `crypt_gensalt_*` (not the
    defaults used when no explicit cost parameter is present in a
    hash; those can’t be changed without breaking existing stored hashes)
    * relevant benchmarking at
      <https://pthree.org/2016/06/28/lets-talk-password-hashing/>
  * offer a way to tune cost parameters for a specific installation
  * N.B. Solaris 11 has all of these features but our implementation will
    probably not match them (they have a `crypt.conf` but it’s not the
    same, and their `crypt_gensalt` is API-incompatible anyway).

[crypt.conf branch]: https://github.com/besser82/libxcrypt/tree/zack/crypt.conf

* Potential API enhancements:

  * Support for "pepper" (an additional piece of information, _not_
    stored in the password file, that you need to check a password)

  * Reading passphrases from the terminal is finicky and there are
    several competing, poorly portable, questionably sound library
    functions to do it (`getpass`, `readpassphrase`, etc) -- should we
    incorporate one?
    * If we do, should it know how to trigger the trusted-path
      password prompt in modern GUI environments? (probably)

  * Make the crypt and crypt_gensalt static state thread-specific?
    * Solaris 11 may have done this (its `crypt(3)` manpage describes
      it as MT-Safe and I don’t see any other way they could have
      accomplished that).
    * if allocated on first use, this would also shave 32kB of
      data segment off the shared library
    * alternatively, add a global lock and *crash the program* if we
      detect concurrent calls

  * Allow access to more of yescrypt’s tunable parameters and ROM
    feature, in a way that’s generic enough that we could also use it
    for e.g. Argon2’s tunable parameters

  * Other yescrypt-inspired features relevant to using this library to
    back a “dedicated authentication service,” e.g. preallocation of
    large blocks of scratch memory
    * the main obstacles here are that `struct crypt_data` has a fixed
      size which is either too big or too small depending how you look
      at it, and no destructor function

* Permissive relicensing, to encourage use beyond the GNU ecosystem?
  * Replace crypt-md5.c with original md5crypt from FreeBSD?
  * Other files subject to the (L)GPL are crypt.c, crypt-static.c,
    crypt-gensalt-static.c, crypt-obsolete.h, crypt-port.h,
    test-badsalt.c.  It is not clear to me how much material originally
    assigned to the FSF remains in these files.
    Several of them are API definitions and trivial wrappers that
    could not be meaningfully changed without breaking them (so are
    arguably uncopyrightable).
  * Most of the test suite lacks any license or even authorship
    information.  We would have to track down the original authors.


================================================
FILE: autogen.sh
================================================
#!/bin/sh
#
# Copyright (C) 2018 Björn Esser <besser82@fedoraproject.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.

set -efu
LANG=C

run_cmd()
{
  echo "autogen: running: $@"
  "$@"
}

if [ -d .git ]; then
  run_cmd git clean -dfX
fi

run_cmd autoreconf -fiv -Wall,error


================================================
FILE: build-aux/ci/ci-log-dependency-versions
================================================
#! /bin/sh
set -e

# Record certain build tool versions for use as a cache key.
autotools_ver=

# Log the identities and versions of the build tools.
for tool in \
    "${CC-cc}" \
    "${NM-nm}" \
    "${AUTOCONF-autoconf}" \
    "${AUTOMAKE-automake}" \
    "${LIBTOOLIZE-libtoolize}" \
    "${PKG_CONFIG-pkg-config}" \
    "${PERL-perl}" \
    "${CPANM-cpanm}" \
    "${PERLCRITIC-perlcritic}" \
    "${PERLTIDY-perltidy}" \
    "${PYTHON-python3}" \
    "${GCOV-gcov}" \
    "${LCOV-lcov}" \
    "${LLVM_COV-llvm-cov}" \
    "${VALGRIND-valgrind}"
do
    # $tool might include mandatory command-line arguments.
    # Interpret it the same way Make would.
    set fnord $tool; shift # word-split $tool and load it into "$@"

    echo ::group::"$1"
    if command -V "$1"; then
        echo + "$@" --version
        "$@" --version
    fi
    echo ::endgroup::

    case "$1" in
        (*autoconf*)
            autotools_ver="${autotools_ver}ac$("$@" --version 2>&1 |
              sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}'
            )"
            ;;

        (*automake*)
            autotools_ver="${autotools_ver}am$("$@" --version |
              sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}'
            )"
            ;;

        (*libtoolize*)
            autotools_ver="${autotools_ver}lt$("$@" --version |
              sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}'
            )"
            ;;

        (*pkg-config*)
            autotools_ver="${autotools_ver}pk$("$@" --version |
              sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}'
            )"
            ;;

        (*python*)
            echo ::group::passlib
            "$@" -c '
try:
  import passlib
  import os.path
  print("passlib is " + os.path.dirname(passlib.__file__))
  print("passlib: version " + passlib.__version__)
except ModuleNotFoundError:
  print("passlib is not installed")
'
            echo ::endgroup::
            ;;
    esac
done

set fnord; shift  # clear $@
echo "autotools-ver=$autotools_ver" >> $GITHUB_OUTPUT
exit 0


================================================
FILE: build-aux/ci/ci-log-logfiles
================================================
#! /bin/sh

generate_secure_token() {
    echo head --bytes 64 /dev/urandom | sha512sum --binary | cut --fields 1 --delimiter ' '
}

dump_log () {
    if [ -s "$1" ]; then
        stop_command_token="$(generate_secure_token)"
        echo "::group::$1"
        echo "::stop-commands::$stop_command_token"
        cat "$1"
        echo "::$stop_command_token::"
        echo '::endgroup::'
        unset stop_command_token
    fi
}

dump_log config.log
find . -name 'test-suite*.log' -printf '%P\n' | while read -r ts; do
    dump_log "$ts"
done


================================================
FILE: build-aux/ci/clang-gcov-wrapper
================================================
#! /bin/sh
exec llvm-cov gcov "$@"


================================================
FILE: build-aux/ci/configure-wrapper
================================================
#!/bin/bash

export DEB_BUILD_MAINT_OPTIONS="${DEB_BUILD_MAINT_OPTIONS:-hardening=+all optimize=-lto}"

export CPPFLAGS="${CPPFLAGS} $(dpkg-buildflags --get CPPFLAGS)"
export CFLAGS="${CFLAGS} $(dpkg-buildflags --get CFLAGS)"
export CXXFLAGS="${CXXFLAGS} $(dpkg-buildflags --get CXXFLAGS)"
export LDFLAGS="${LDFLAGS} $(dpkg-buildflags --get LDFLAGS)"

$PWD/configure "$@"


================================================
FILE: build-aux/ci/summarize-coverage
================================================
#! /bin/sh
set -e

case "$CC" in
    (*clang*)
        GCOV=$(pwd)/build-aux/ci/clang-gcov-wrapper ;;
    (*)
        GCOV=gcov ;;
esac

unpruned=$(mktemp --tmpdir all-coverage.XXXXXXXXXX.info)
trap 'rm -f "'"$unpruned"'"' 0

set -x
# Merge all of the gcov output into one overview file using lcov,
# then prune data for the tests themselves, and for system libraries.

lcov --gcov-tool "$GCOV" --rc branch_coverage=1 \
     --directory . --output-file "$unpruned" \
     --capture

lcov --gcov-tool "$GCOV" --rc branch_coverage=1 \
     --directory . --output-file "$1" --ignore-errors unused \
     --remove "$unpruned" '/usr/*' '*test*' '*gen-des-tables*'


================================================
FILE: build-aux/m4/ax_append_compile_flags.m4
================================================
# ============================================================================
#  https://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
# ============================================================================
#
# SYNOPSIS
#
#   AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
#   For every FLAG1, FLAG2 it is checked whether the compiler works with the
#   flag.  If it does, the flag is added FLAGS-VARIABLE
#
#   If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
#   CFLAGS) is used.  During the check the flag is always added to the
#   current language's flags.
#
#   If EXTRA-FLAGS is defined, it is added to the current language's default
#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
#   force the compiler to issue an error when a bad flag is given.
#
#   INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
#   NOTE: This macro depends on the AX_APPEND_FLAG and
#   AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
#   AX_APPEND_LINK_FLAGS.
#
# LICENSE
#
#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved.  This file is offered as-is, without any
#   warranty.

#serial 7

AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
for flag in $1; do
  AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4])
done
])dnl AX_APPEND_COMPILE_FLAGS


================================================
FILE: build-aux/m4/ax_append_flag.m4
================================================
# ===========================================================================
#      https://www.gnu.org/software/autoconf-archive/ax_append_flag.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
#
# DESCRIPTION
#
#   FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
#   added in between.
#
#   If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
#   CFLAGS) is used.  FLAGS-VARIABLE is not changed if it already contains
#   FLAG.  If FLAGS-VARIABLE is unset in the shell, it is set to exactly
#   FLAG.
#
#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
#
# LICENSE
#
#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved.  This file is offered as-is, without any
#   warranty.

#serial 8

AC_DEFUN([AX_APPEND_FLAG],
[dnl
AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
AS_VAR_SET_IF(FLAGS,[
  AS_CASE([" AS_VAR_GET(FLAGS) "],
    [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
    [
     AS_VAR_APPEND(FLAGS,[" $1"])
     AC_RUN_LOG([: FLAGS="$FLAGS"])
    ])
  ],
  [
  AS_VAR_SET(FLAGS,[$1])
  AC_RUN_LOG([: FLAGS="$FLAGS"])
  ])
AS_VAR_POPDEF([FLAGS])dnl
])dnl AX_APPEND_FLAG


================================================
FILE: build-aux/m4/ax_check_compile_flag.m4
================================================
# ===========================================================================
#  https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
#   Check whether the given FLAG works with the current language's compiler
#   or gives an error.  (Warnings, however, are ignored)
#
#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
#   success/failure.
#
#   If EXTRA-FLAGS is defined, it is added to the current language's default
#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
#   force the compiler to issue an error when a bad flag is given.
#
#   INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
#   macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
#
# LICENSE
#
#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved.  This file is offered as-is, without any
#   warranty.

#serial 6

AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
  ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
  AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
    [AS_VAR_SET(CACHEVAR,[yes])],
    [AS_VAR_SET(CACHEVAR,[no])])
  _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
AS_VAR_IF(CACHEVAR,yes,
  [m4_default([$2], :)],
  [m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_COMPILE_FLAGS


================================================
FILE: build-aux/m4/ax_check_vscript.m4
================================================
# ===========================================================================
#     https://www.gnu.org/software/autoconf-archive/ax_check_vscript.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_CHECK_VSCRIPT
#
# DESCRIPTION
#
#   Check whether the linker supports version scripts.  Version scripts are
#   used when building shared libraries to bind symbols to version nodes
#   (helping to detect incompatibilities) or to limit the visibility of
#   non-public symbols.
#
#   Output:
#
#   If version scripts are supported, VSCRIPT_LDFLAGS will contain the
#   appropriate flag to pass to the linker.  On GNU systems this would
#   typically be "-Wl,--version-script", and on Solaris it would typically
#   be "-Wl,-M".
#
#   Two Automake conditionals are also set:
#
#    HAVE_VSCRIPT is true if the linker supports version scripts with
#    entries that use simple wildcards, like "local: *".
#
#    HAVE_VSCRIPT_COMPLEX is true if the linker supports version scripts with
#    pattern matching wildcards, like "global: Java_*".
#
#   On systems that do not support symbol versioning, such as Mac OS X, both
#   conditionals will be false.  They will also be false if the user passes
#   "--disable-symvers" on the configure command line.
#
#   Example:
#
#    configure.ac:
#
#     AX_CHECK_VSCRIPT
#
#    Makefile.am:
#
#     if HAVE_VSCRIPT
#     libfoo_la_LDFLAGS += $(VSCRIPT_LDFLAGS),@srcdir@/libfoo.map
#     endif
#
#     if HAVE_VSCRIPT_COMPLEX
#     libbar_la_LDFLAGS += $(VSCRIPT_LDFLAGS),@srcdir@/libbar.map
#     endif
#
# LICENSE
#
#   Copyright (c) 2014 Kevin Cernekee <cernekee@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 2

# _AX_CHECK_VSCRIPT(flag, global-sym, action-if-link-succeeds, [junk-file=no])
AC_DEFUN([_AX_CHECK_VSCRIPT], [
  AC_LANG_PUSH([C])
  ax_check_vscript_save_flags="$LDFLAGS"
  echo "V1 { global: $2; local: *; };" > conftest.map
  AS_IF([test x$4 = xyes], [
    echo "{" >> conftest.map
  ])
  LDFLAGS="$LDFLAGS -Wl,$1,conftest.map"
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[int show, hide;]], [])], [$3])
  LDFLAGS="$ax_check_vscript_save_flags"
  rm -f conftest.map
  AC_LANG_POP([C])
]) dnl _AX_CHECK_VSCRIPT

AC_DEFUN([AX_CHECK_VSCRIPT], [

  AC_ARG_ENABLE([symvers],
    AS_HELP_STRING([--disable-symvers],
                   [disable library symbol versioning [default=auto]]),
    [want_symvers=$enableval],
    [want_symvers=yes]
  )

  AS_IF([test x$want_symvers = xyes], [

    dnl First test --version-script and -M with a simple wildcard.

    AC_CACHE_CHECK([linker version script flag], ax_cv_check_vscript_flag, [
      ax_cv_check_vscript_flag=unsupported
      _AX_CHECK_VSCRIPT([--version-script], [show], [
        ax_cv_check_vscript_flag=--version-script
      ])
      AS_IF([test x$ax_cv_check_vscript_flag = xunsupported], [
        _AX_CHECK_VSCRIPT([-M], [show], [ax_cv_check_vscript_flag=-M])
      ])

      dnl The linker may interpret -M (no argument) as "produce a load map."
      dnl If "-M conftest.map" doesn't fail when conftest.map contains
      dnl obvious syntax errors, assume this is the case.

      AS_IF([test x$ax_cv_check_vscript_flag != xunsupported], [
        _AX_CHECK_VSCRIPT([$ax_cv_check_vscript_flag], [show],
	                  [ax_cv_check_vscript_flag=unsupported], [yes])
      ])
    ])

    dnl If the simple wildcard worked, retest with a complex wildcard.

    AS_IF([test x$ax_cv_check_vscript_flag != xunsupported], [
      ax_check_vscript_flag=$ax_cv_check_vscript_flag
      AC_CACHE_CHECK([if version scripts can use complex wildcards],
                     ax_cv_check_vscript_complex_wildcards, [
        ax_cv_check_vscript_complex_wildcards=no
        _AX_CHECK_VSCRIPT([$ax_cv_check_vscript_flag], [sh*], [
        ax_cv_check_vscript_complex_wildcards=yes])
      ])
      ax_check_vscript_complex_wildcards="$ax_cv_check_vscript_complex_wildcards"
    ], [
      ax_check_vscript_flag=
      ax_check_vscript_complex_wildcards=no
    ])
  ], [
    AC_MSG_CHECKING([linker version script flag])
    AC_MSG_RESULT([disabled])

    ax_check_vscript_flag=
    ax_check_vscript_complex_wildcards=no
  ])

  AS_IF([test x$ax_check_vscript_flag != x], [
    VSCRIPT_LDFLAGS="-Wl,$ax_check_vscript_flag"
    AC_SUBST([VSCRIPT_LDFLAGS])
  ])

  AM_CONDITIONAL([HAVE_VSCRIPT],
    [test x$ax_check_vscript_flag != x])
  AM_CONDITIONAL([HAVE_VSCRIPT_COMPLEX],
    [test x$ax_check_vscript_complex_wildcards = xyes])

]) dnl AX_CHECK_VSCRIPT


================================================
FILE: build-aux/m4/ax_gcc_func_attribute.m4
================================================
# ===========================================================================
#  https://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE)
#
# DESCRIPTION
#
#   This macro checks if the compiler supports one of GCC's function
#   attributes; many other compilers also provide function attributes with
#   the same syntax. Compiler warnings are used to detect supported
#   attributes as unsupported ones are ignored by default so quieting
#   warnings when using this macro will yield false positives.
#
#   The ATTRIBUTE parameter holds the name of the attribute to be checked.
#
#   If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_<ATTRIBUTE>.
#
#   The macro caches its result in the ax_cv_have_func_attribute_<attribute>
#   variable.
#
#   The macro currently supports the following function attributes:
#
#    alias
#    aligned
#    alloc_size
#    always_inline
#    artificial
#    cold
#    const
#    constructor
#    constructor_priority for constructor attribute with priority
#    deprecated
#    destructor
#    dllexport
#    dllimport
#    error
#    externally_visible
#    fallthrough
#    flatten
#    format
#    format_arg
#    gnu_format
#    gnu_inline
#    hot
#    ifunc
#    leaf
#    malloc
#    noclone
#    noinline
#    nonnull
#    noreturn
#    nothrow
#    optimize
#    pure
#    sentinel
#    sentinel_position
#    unused
#    used
#    visibility
#    warning
#    warn_unused_result
#    weak
#    weakref
#    symver
#
#   Unsupported function attributes will be tested with a prototype
#   returning an int and not accepting any arguments and the result of the
#   check might be wrong or meaningless so use with care.
#
# LICENSE
#
#   Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved.  This file is offered as-is, without any
#   warranty.

#serial 13

AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
    AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1])

    AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [
        AC_LINK_IFELSE([AC_LANG_PROGRAM([
            m4_case([$1],
                [alias], [
                    int foo( void ) { return 0; }
                    int bar( void ) __attribute__(($1("foo")));
                ],
                [aligned], [
                    int foo( void ) __attribute__(($1(32)));
                ],
                [alloc_size], [
                    void *foo(int a) __attribute__(($1(1)));
                ],
                [always_inline], [
                    inline __attribute__(($1)) int foo( void ) { return 0; }
                ],
                [artificial], [
                    inline __attribute__(($1)) int foo( void ) { return 0; }
                ],
                [cold], [
                    int foo( void ) __attribute__(($1));
                ],
                [const], [
                    int foo( void ) __attribute__(($1));
                ],
                [constructor_priority], [
                    int foo( void ) __attribute__((__constructor__(65535/2)));
                ],
                [constructor], [
                    int foo( void ) __attribute__(($1));
                ],
                [deprecated], [
                    int foo( void ) __attribute__(($1("")));
                ],
                [destructor], [
                    int foo( void ) __attribute__(($1));
                ],
                [dllexport], [
                    __attribute__(($1)) int foo( void ) { return 0; }
                ],
                [dllimport], [
                    int foo( void ) __attribute__(($1));
                ],
                [error], [
                    int foo( void ) __attribute__(($1("")));
                ],
                [externally_visible], [
                    int foo( void ) __attribute__(($1));
                ],
                [fallthrough], [
                    void foo( int x ) {switch (x) { case 1: __attribute__(($1)); case 2: break ; }};
                ],
                [flatten], [
                    int foo( void ) __attribute__(($1));
                ],
                [format], [
                    int foo(const char *p, ...) __attribute__(($1(printf, 1, 2)));
                ],
                [gnu_format], [
                    int foo(const char *p, ...) __attribute__((format(gnu_printf, 1, 2)));
                ],
                [format_arg], [
                    char *foo(const char *p) __attribute__(($1(1)));
                ],
                [gnu_inline], [
                    inline __attribute__(($1)) int foo( void ) { return 0; }
                ],
                [hot], [
                    int foo( void ) __attribute__(($1));
                ],
                [ifunc], [
                    int my_foo( void ) { return 0; }
                    static int (*resolve_foo(void))(void) { return my_foo; }
                    int foo( void ) __attribute__(($1("resolve_foo")));
                ],
                [leaf], [
                    __attribute__(($1)) int foo( void ) { return 0; }
                ],
                [malloc], [
                    void *foo( void ) __attribute__(($1));
                ],
                [noclone], [
                    int foo( void ) __attribute__(($1));
                ],
                [noinline], [
                    __attribute__(($1)) int foo( void ) { return 0; }
                ],
                [nonnull], [
                    int foo(char *p) __attribute__(($1(1)));
                ],
                [noreturn], [
                    void foo( void ) __attribute__(($1));
                ],
                [nothrow], [
                    int foo( void ) __attribute__(($1));
                ],
                [optimize], [
                    __attribute__(($1(3))) int foo( void ) { return 0; }
                ],
                [pure], [
                    int foo( void ) __attribute__(($1));
                ],
                [sentinel], [
                    int foo(void *p, ...) __attribute__(($1));
                ],
                [sentinel_position], [
                    int foo(void *p, ...) __attribute__(($1(1)));
                ],
                [returns_nonnull], [
                    void *foo( void ) __attribute__(($1));
                ],
                [unused], [
                    int foo( void ) __attribute__(($1));
                ],
                [used], [
                    int foo( void ) __attribute__(($1));
                ],
                [visibility], [
                    int foo_def( void ) __attribute__(($1("default")));
                    int foo_hid( void ) __attribute__(($1("hidden")));
                    int foo_int( void ) __attribute__(($1("internal")));
                    int foo_pro( void ) __attribute__(($1("protected")));
                ],
                [warning], [
                    int foo( void ) __attribute__(($1("")));
                ],
                [warn_unused_result], [
                    int foo( void ) __attribute__(($1));
                ],
                [weak], [
                    int foo( void ) __attribute__(($1));
                ],
                [weakref], [
                    static int foo( void ) { return 0; }
                    static int bar( void ) __attribute__(($1("foo")));
                ],
                [symver], [
                    __attribute__(($1("foo@2.0"))) void bar( void ) {}
                ],
                [
                 m4_warn([syntax], [Unsupported attribute $1, the test may fail])
                 int foo( void ) __attribute__(($1));
                ]
            )], [])
            ],
            dnl GCC doesn't exit with an error if an unknown attribute is
            dnl provided but only outputs a warning, so accept the attribute
            dnl only if no warning were issued.
            [AS_IF([grep -q -e -Wattributes -e -Wunknown-attributes -e error -e warning conftest.err],
                [AS_VAR_SET([ac_var], [no])],
                [AS_VAR_SET([ac_var], [yes])])],
            [AS_VAR_SET([ac_var], [no])])
    ])

    AS_IF([test yes = AS_VAR_GET([ac_var])],
        [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FUNC_ATTRIBUTE_$1), 1,
            [Define to 1 if the system has the `$1' function attribute])], [])

    AS_VAR_POPDEF([ac_var])
])


================================================
FILE: build-aux/m4/ax_require_defined.m4
================================================
# ===========================================================================
#    https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_REQUIRE_DEFINED(MACRO)
#
# DESCRIPTION
#
#   AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
#   been defined and thus are available for use.  This avoids random issues
#   where a macro isn't expanded.  Instead the configure script emits a
#   non-fatal:
#
#     ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
#
#   It's like AC_REQUIRE except it doesn't expand the required macro.
#
#   Here's an example:
#
#     AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
#
# LICENSE
#
#   Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 2

AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
  m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
])dnl AX_REQUIRE_DEFINED


================================================
FILE: build-aux/m4/ax_valgrind_check.m4
================================================
# ===========================================================================
#    https://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_VALGRIND_DFLT(memcheck|helgrind|drd|sgcheck, on|off)
#   AX_VALGRIND_CHECK()
#
# DESCRIPTION
#
#   AX_VALGRIND_CHECK checks whether Valgrind is present and, if so, allows
#   running `make check` under a variety of Valgrind tools to check for
#   memory and threading errors.
#
#   Defines VALGRIND_CHECK_RULES which should be substituted in your
#   Makefile; and $enable_valgrind which can be used in subsequent configure
#   output. VALGRIND_ENABLED is defined and substituted, and corresponds to
#   the value of the --enable-valgrind option, which defaults to being
#   enabled if Valgrind is installed and disabled otherwise. Individual
#   Valgrind tools can be disabled via --disable-valgrind-<tool>, the
#   default is configurable via the AX_VALGRIND_DFLT command or is to use
#   all commands not disabled via AX_VALGRIND_DFLT. All AX_VALGRIND_DFLT
#   calls must be made before the call to AX_VALGRIND_CHECK.
#
#   If unit tests are written using a shell script and automake's
#   LOG_COMPILER system, the $(VALGRIND) variable can be used within the
#   shell scripts to enable Valgrind, as described here:
#
#     https://www.gnu.org/software/gnulib/manual/html_node/Running-self_002dtests-under-valgrind.html
#
#   Usage example:
#
#   configure.ac:
#
#     AX_VALGRIND_DFLT([sgcheck], [off])
#     AX_VALGRIND_CHECK
#
#   in each Makefile.am with tests:
#
#     @VALGRIND_CHECK_RULES@
#     VALGRIND_SUPPRESSIONS_FILES = my-project.supp
#     EXTRA_DIST = my-project.supp
#
#   This results in a "check-valgrind" rule being added. Running `make
#   check-valgrind` in that directory will recursively run the module's test
#   suite (`make check`) once for each of the available Valgrind tools (out
#   of memcheck, helgrind and drd) while the sgcheck will be skipped unless
#   enabled again on the commandline with --enable-valgrind-sgcheck. The
#   results for each check will be output to test-suite-$toolname.log. The
#   target will succeed if there are zero errors and fail otherwise.
#
#   Alternatively, a "check-valgrind-$TOOL" rule will be added, for $TOOL in
#   memcheck, helgrind, drd and sgcheck. These are useful because often only
#   some of those tools can be ran cleanly on a codebase.
#
#   The macro supports running with and without libtool.
#
# LICENSE
#
#   Copyright (c) 2014, 2015, 2016 Philip Withnall <philip.withnall@collabora.co.uk>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved.  This file is offered as-is, without any
#   warranty.

#serial 23

dnl Configured tools
m4_define([valgrind_tool_list], [[memcheck], [helgrind], [drd], [sgcheck]])
m4_set_add_all([valgrind_exp_tool_set], [sgcheck])
m4_foreach([vgtool], [valgrind_tool_list],
           [m4_define([en_dflt_valgrind_]vgtool, [on])])

AC_DEFUN([AX_VALGRIND_DFLT],[
	m4_define([en_dflt_valgrind_$1], [$2])
])dnl

AC_DEFUN([AX_VALGRIND_CHECK],[
	AM_EXTRA_RECURSIVE_TARGETS([check-valgrind])
	m4_foreach([vgtool], [valgrind_tool_list],
		[AM_EXTRA_RECURSIVE_TARGETS([check-valgrind-]vgtool)])

	dnl Check for --enable-valgrind
	AC_ARG_ENABLE([valgrind],
	              [AS_HELP_STRING([--enable-valgrind], [Whether to enable Valgrind on the unit tests])],
	              [enable_valgrind=$enableval],[enable_valgrind=])

	AS_IF([test "$enable_valgrind" != "no"],[
		# Check for Valgrind.
		AC_PATH_PROG([VALGRIND],[valgrind])
		AS_IF([test "$VALGRIND" = ""],[
			AS_IF([test "$enable_valgrind" = "yes"],[
				AC_MSG_ERROR([Could not find valgrind; either install it or reconfigure with --disable-valgrind])
			],[
				enable_valgrind=no
			])
		],[
			enable_valgrind=yes
		])
	])

	AM_CONDITIONAL([VALGRIND_ENABLED],[test "$enable_valgrind" = "yes"])
	AC_SUBST([VALGRIND_ENABLED],[$enable_valgrind])

	# Check for Valgrind tools we care about.
	[valgrind_enabled_tools=]
	m4_foreach([vgtool],[valgrind_tool_list],[
		AC_ARG_ENABLE([valgrind-]vgtool,
		    m4_if(m4_defn([en_dflt_valgrind_]vgtool),[off],dnl
[AS_HELP_STRING([--enable-valgrind-]vgtool, [Whether to use ]vgtool[ during the Valgrind tests])],dnl
[AS_HELP_STRING([--disable-valgrind-]vgtool, [Whether to skip ]vgtool[ during the Valgrind tests])]),
		              [enable_valgrind_]vgtool[=$enableval],
		              [enable_valgrind_]vgtool[=])
		AS_IF([test "$enable_valgrind" = "no"],[
			enable_valgrind_]vgtool[=no],
		      [test "$enable_valgrind_]vgtool[" ]dnl
m4_if(m4_defn([en_dflt_valgrind_]vgtool), [off], [= "yes"], [!= "no"]),[
			AC_CACHE_CHECK([for Valgrind tool ]vgtool,
			               [ax_cv_valgrind_tool_]vgtool,[
				ax_cv_valgrind_tool_]vgtool[=no
				m4_set_contains([valgrind_exp_tool_set],vgtool,
				    [m4_define([vgtoolx],[exp-]vgtool)],
				    [m4_define([vgtoolx],vgtool)])
				AS_IF([`$VALGRIND --tool=]vgtoolx[ --help >/dev/null 2>&1`],[
					ax_cv_valgrind_tool_]vgtool[=yes
				])
			])
			AS_IF([test "$ax_cv_valgrind_tool_]vgtool[" = "no"],[
				AS_IF([test "$enable_valgrind_]vgtool[" = "yes"],[
					AC_MSG_ERROR([Valgrind does not support ]vgtool[; reconfigure with --disable-valgrind-]vgtool)
				],[
					enable_valgrind_]vgtool[=no
				])
			],[
				enable_valgrind_]vgtool[=yes
			])
		])
		AS_IF([test "$enable_valgrind_]vgtool[" = "yes"],[
			valgrind_enabled_tools="$valgrind_enabled_tools ]m4_bpatsubst(vgtool,[^exp-])["
		])
		AC_SUBST([ENABLE_VALGRIND_]vgtool,[$enable_valgrind_]vgtool)
	])
	AC_SUBST([valgrind_tools],["]m4_join([ ], valgrind_tool_list)["])
	AC_SUBST([valgrind_enabled_tools],[$valgrind_enabled_tools])

[VALGRIND_CHECK_RULES='
# Valgrind check
#
# Optional:
#  - VALGRIND_SUPPRESSIONS_FILES: Space-separated list of Valgrind suppressions
#    files to load. (Default: empty)
#  - VALGRIND_FLAGS: General flags to pass to all Valgrind tools.
#    (Default: --num-callers=30)
#  - VALGRIND_$toolname_FLAGS: Flags to pass to Valgrind $toolname (one of:
#    memcheck, helgrind, drd, sgcheck). (Default: various)

# Optional variables
VALGRIND_SUPPRESSIONS ?= $(addprefix --suppressions=,$(VALGRIND_SUPPRESSIONS_FILES))
VALGRIND_FLAGS ?= --num-callers=30
VALGRIND_memcheck_FLAGS ?= --leak-check=full --show-reachable=no
VALGRIND_helgrind_FLAGS ?= --history-level=approx
VALGRIND_drd_FLAGS ?=
VALGRIND_sgcheck_FLAGS ?=

# Internal use
valgrind_log_files = $(addprefix test-suite-,$(addsuffix .log,$(valgrind_tools)))

valgrind_memcheck_flags = --tool=memcheck $(VALGRIND_memcheck_FLAGS)
valgrind_helgrind_flags = --tool=helgrind $(VALGRIND_helgrind_FLAGS)
valgrind_drd_flags = --tool=drd $(VALGRIND_drd_FLAGS)
valgrind_sgcheck_flags = --tool=exp-sgcheck $(VALGRIND_sgcheck_FLAGS)

valgrind_quiet = $(valgrind_quiet_$(V))
valgrind_quiet_ = $(valgrind_quiet_$(AM_DEFAULT_VERBOSITY))
valgrind_quiet_0 = --quiet
valgrind_v_use   = $(valgrind_v_use_$(V))
valgrind_v_use_  = $(valgrind_v_use_$(AM_DEFAULT_VERBOSITY))
valgrind_v_use_0 = @echo "  USE   " $(patsubst check-valgrind-%-local,%,$''@):;

# Support running with and without libtool.
ifneq ($(LIBTOOL),)
valgrind_lt = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=execute
else
valgrind_lt =
endif

# Use recursive makes in order to ignore errors during check
check-valgrind-local:
ifeq ($(VALGRIND_ENABLED),yes)
	$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k \
		$(foreach tool, $(valgrind_enabled_tools), check-valgrind-$(tool))
else
	@echo "Need to reconfigure with --enable-valgrind"
endif

# Valgrind running
VALGRIND_TESTS_ENVIRONMENT = \
	$(TESTS_ENVIRONMENT) \
	env VALGRIND=$(VALGRIND) \
	G_SLICE=always-malloc,debug-blocks \
	G_DEBUG=fatal-warnings,fatal-criticals,gc-friendly

VALGRIND_LOG_COMPILER = \
	$(valgrind_lt) \
	$(VALGRIND) $(VALGRIND_SUPPRESSIONS) --error-exitcode=1 $(VALGRIND_FLAGS)

define valgrind_tool_rule
check-valgrind-$(1)-local:
ifeq ($$(VALGRIND_ENABLED)-$$(ENABLE_VALGRIND_$(1)),yes-yes)
ifneq ($$(TESTS),)
	$$(valgrind_v_use)$$(MAKE) check-TESTS \
		TESTS_ENVIRONMENT="$$(VALGRIND_TESTS_ENVIRONMENT)" \
		LOG_COMPILER="$$(VALGRIND_LOG_COMPILER)" \
		LOG_FLAGS="$$(valgrind_$(1)_flags)" \
		TEST_SUITE_LOG=test-suite-$(1).log
endif
else ifeq ($$(VALGRIND_ENABLED),yes)
	@echo "Need to reconfigure with --enable-valgrind-$(1)"
else
	@echo "Need to reconfigure with --enable-valgrind"
endif
endef

$(foreach tool,$(valgrind_tools),$(eval $(call valgrind_tool_rule,$(tool))))

A''M_DISTCHECK_CONFIGURE_FLAGS ?=
A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-valgrind

MOSTLYCLEANFILES ?=
MOSTLYCLEANFILES += $(valgrind_log_files)

.PHONY: check-valgrind $(addprefix check-valgrind-,$(valgrind_tools))
']

	AC_SUBST([VALGRIND_CHECK_RULES])
	m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([VALGRIND_CHECK_RULES])])
])


================================================
FILE: build-aux/m4/pkg_compat.m4
================================================
# pkg.m4 - Macros to locate and use pkg-config.   -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)

# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
# Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# 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.

# PKG_PROG_PKG_CONFIG_COMPAT([MIN-VERSION], [ACTION-IF-NOT-FOUND])
# ---------------------------------------------------------
# Backported from pkg-config 0.29.2.
#
# Search for the pkg-config tool and set the PKG_CONFIG variable to
# first found in the path. Checks that the version of pkg-config found
# is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
# used since that's the first version where most current features of
# pkg-config existed.
#
# If pkg-config is not found or older than specified, it will result
# in an empty PKG_CONFIG variable. To avoid widespread issues with
# scripts not checking it, ACTION-IF-NOT-FOUND defaults to aborting.
# You can specify [PKG_CONFIG=false] as an action instead, which would
# result in pkg-config tests failing, but no bogus error messages.
AC_DEFUN([PKG_PROG_PKG_CONFIG_COMPAT],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])

if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
	_pkg_min_version=m4_default([$1], [0.9.0])
	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
		AC_MSG_RESULT([yes])
	else
		AC_MSG_RESULT([no])
		PKG_CONFIG=""
	fi
fi
if test -z "$PKG_CONFIG"; then
	m4_default([$2], [AC_MSG_ERROR([pkg-config not found])])
fi[]
])

# PKG_INSTALLDIR_COMPAT([DIRECTORY])
# -------------------------
# Backported from pkg-config 0.27.
#
# Substitutes the variable pkgconfigdir as the location where a module
# should install pkg-config .pc files. By default the directory is
# $libdir/pkgconfig, but the default can be changed by passing
# DIRECTORY. The user can override through the --with-pkgconfigdir
# parameter.
AC_DEFUN([PKG_INSTALLDIR_COMPAT],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
    [pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
    [with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])


================================================
FILE: build-aux/m4/zw_alignment.m4
================================================
dnl Written by Zack Weinberg <zackw at panix.com> in 2017.
dnl To the extent possible under law, Zack Weinberg has waived all
dnl copyright and related or neighboring rights to this work.
dnl
dnl See https://creativecommons.org/publicdomain/zero/1.0/ for further
dnl details.
dnl
dnl Find out how to query and set data alignment.
dnl Currently knows about C11's _Alignas and _Alignof,
dnl and GCC's __attribute__ ((aligned)) and __alignof.
dnl
dnl Note: AC_PROG_CC_C11 includes a test for _Alignas and _Alignof,
dnl but not for <stdalign.h>, which we don't bother using anyway.
dnl
dnl Compatibility note: alignas (TYPE) does not work when alignas() is
dnl defined using __attribute__ ((aligned)).  Use alignas (alignof (TYPE))
dnl instead.
AC_DEFUN([zw_C_ALIGNAS],
  [AC_REQUIRE([AC_PROG_CC])
   AC_CACHE_CHECK([how to control data alignment], [zw_cv_c_alignas],
     [AS_IF([test x$ac_prog_cc_stdc = xc11],
        [zw_cv_c_alignas=_Alignas],
        [AC_COMPILE_IFELSE(
           [AC_LANG_PROGRAM([[
                int __attribute__((__aligned__(8))) global;
                struct __attribute__((__aligned__(8))) aggregate { int x, y; };
              ]], [[
                int __attribute__((__aligned__(8))) local;
              ]])],
           [zw_cv_c_alignas=__attribute__],
           [zw_cv_c_alignas=unknown])
        ])
     ])
   AS_IF([test x$zw_cv_c_alignas = x_Alignas],
            [zw_c_alignas_expr="_Alignas(n)"],
         [test x$zw_cv_c_alignas = x__attribute__],
            [zw_c_alignas_expr="__attribute__((__aligned__(n)))"],
         [AC_MSG_FAILURE([could not find a way to control data alignment])])
   AC_DEFINE_UNQUOTED([alignas(n)], [$zw_c_alignas_expr],
   [Define as a type specifier which sets the alignment of a variable or type
    to N bytes.  C11 alignas(TYPE) does not need to be supported.])
])

AC_DEFUN([zw_C_ALIGNOF],
  [AC_REQUIRE([AC_PROG_CC])
   AC_CACHE_CHECK([how to query data alignment], [zw_cv_c_alignof],
     [AS_IF([test x$ac_prog_cc_stdc = xc11],
        [zw_cv_c_alignof=_Alignof],
        [AC_COMPILE_IFELSE(
           [AC_LANG_PROGRAM([[
                struct agg { int x, y; };
                extern const char align_int[__alignof__(int)];
                extern const char align_agg[__alignof__(struct agg)];
              ]], [[
                double d;
                char align_var[__alignof__(d)];
              ]])],
           [zw_cv_c_alignof=__alignof__],
           [zw_cv_c_alignof=unknown])
        ])
     ])
   AS_IF([test x$zw_cv_c_alignof = x_Alignof],
            [zw_c_alignof_expr="_Alignof(thing)"],
         [test x$zw_cv_c_alignof = x__alignof__],
            [zw_c_alignof_expr="__alignof__(thing)"],
         [AC_MSG_FAILURE([could not find a way to query data alignment])])
   AC_DEFINE_UNQUOTED([alignof(thing)], [$zw_c_alignof_expr],
   [Define as an expression which evaluates to the alignment of THING.
    Must be computed at compile time (an "integer constant expression").])
])

AC_DEFUN([zw_C_MAX_ALIGN_T],
  [AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([zw_C_ALIGNOF])
   AC_CACHE_CHECK([for max_align_t in stddef.h], [zw_cv_c_max_align_t],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM([[
            #include <stddef.h>
          ]], [[
            max_align_t var;
            return alignof(var);
          ]])],
        [zw_cv_c_max_align_t=yes],
        [zw_cv_c_max_align_t=no])
     ])
   AS_IF([test x$zw_cv_c_max_align_t = xyes],
     [AC_DEFINE([HAVE_MAX_ALIGN_T], 1,
        [Define if stddef.h provides max_align_t.])
   ])
])


================================================
FILE: build-aux/m4/zw_automodern.m4
================================================
dnl Copyright 2017 Zack Weinberg <zackw at panix.com>.
dnl Partially based on Autoconf, copyright 1992-2017 Free Software Foundation.
dnl
dnl This program is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU General Public License as
dnl published by the Free Software Foundation, either version 3 of the
dnl License, or (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl GNU General Public License for more details.
dnl
dnl Under Section 7 of GPL version 3, you are granted additional
dnl permissions described in the Autoconf Configure Script Exception,
dnl version 3.0, as published by the Free Software Foundation.
dnl
dnl Because only two files in this source tree are released
dnl under GPLv3 with exceptions, neither the GPLv3 nor the exception are
dnl distributed with this source tree.  Copies can be retrieved from
dnl https://www.gnu.org/licenses/
dnl
dnl As of this writing (September 2017), Autoconf 2.70 is not yet released.
dnl Backport some improvements:
dnl  - switch AC_CHECK_HEADER to compile-only
dnl  - eliminate unnecessary tests in AC_INCLUDES_DEFAULT
dnl  - Darwin (OSX) support in AC_USE_SYSTEM_EXTENSIONS
dnl  - C11 mode by default in AC_PROG_CC, falling back to C99
AC_PREREQ([2.62])dnl earliest version with working m4_version_prereq
m4_version_prereq([2.70], [], [

  m4_define([AC_CHECK_HEADER], [_AC_CHECK_HEADER_COMPILE($@)])

  AC_DEFUN_ONCE([_AC_INCLUDES_DEFAULT_REQUIREMENTS],
[m4_divert_text([DEFAULTS],
[# Factoring default headers for most tests.
ac_includes_default="\
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif"
])]dnl
[AC_CHECK_HEADERS(
  [sys/types.h sys/stat.h strings.h inttypes.h stdint.h unistd.h],,,[/**/])]dnl
dnl For backward compatibility, provide unconditional AC_DEFINEs of
dnl HAVE_STDLIB_H, HAVE_STRING_H, and STDC_HEADERS.
[AC_DEFINE([HAVE_STDLIB_H], [1],
  [Always define to 1, for backward compatibility.
   You can assume <stdlib.h> exists.])]dnl
[AC_DEFINE([HAVE_STRING_H], [1],
  [Always define to 1, for backward compatibility.
   You can assume <string.h> exists.])]dnl
[AC_DEFINE([STDC_HEADERS], [1],
  [Always define to 1, for backward compatibility.
   You can assume the C90 standard headers exist.])])

  m4_define([AC_USE_SYSTEM_EXTENSIONS],
    m4_defn([AC_USE_SYSTEM_EXTENSIONS])[
    AH_VERBATIM([USE_SYSTEM_EXTENSIONS_270],
[/* Enable general extensions on OSX. */
#ifndef _DARWIN_C_SOURCE
# undef _DARWIN_C_SOURCE
#endif
])
    AC_DEFINE([_DARWIN_C_SOURCE])
  ])

dnl Prior to 2.70, AC_PROG_CC ends with an unconditional call to
dnl _AC_PROG_CC_C89.  Use this as an extension hook, replacing it with
dnl the logic that will be used in 2.70.
m4_define([_AC_PROG_CC_C89_original], m4_defn([_AC_PROG_CC_C89]))
m4_define([_AC_PROG_CC_C89], [dnl
dnl Set ac_prog_cc_stdc to the supported C version.
dnl Also set the documented variable ac_cv_prog_cc_stdc;
dnl its name was chosen when it was cached, but it is no longer cached.
_AC_PROG_CC_C11([ac_prog_cc_stdc=c11
                 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11],
  [_AC_PROG_CC_C99([ac_prog_cc_stdc=c99
                    ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99],
     [_AC_PROG_CC_C89_original([ac_prog_cc_stdc=c89
                       ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89],
                      [ac_prog_cc_stdc=no
                       ac_cv_prog_cc_stdc=no])])])
])
dnl Must also supply the definition of _AC_PROG_CC_C11.
dnl This is also taken verbatim from Autoconf trunk.
dnl I regret the bulk.
AC_DEFUN([_AC_PROG_CC_C11],
[_AC_C_STD_TRY([c11],
[[#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <wchar.h>
#include <stdio.h>

// Check varargs macros.  These examples are taken from C99 6.10.3.5.
#define debug(...) fprintf (stderr, __VA_ARGS__)
#define showlist(...) puts (#__VA_ARGS__)
#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
static void
test_varargs_macros (void)
{
  int x = 1234;
  int y = 5678;
  debug ("Flag");
  debug ("X = %d\n", x);
  showlist (The first, second, and third items.);
  report (x>y, "x is %d but y is %d", x, y);
}

// Check long long types.
#define BIG64 18446744073709551615ull
#define BIG32 4294967295ul
#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
#if !BIG_OK
  your preprocessor is broken;
#endif
#if BIG_OK
#else
  your preprocessor is broken;
#endif
static long long int bignum = -9223372036854775807LL;
static unsigned long long int ubignum = BIG64;

struct incomplete_array
{
  int datasize;
  double data[];
};

struct named_init {
  int number;
  const wchar_t *name;
  double average;
};

typedef const char *ccp;

static inline int
test_restrict (ccp restrict text)
{
  // See if C++-style comments work.
  // Iterate through items via the restricted pointer.
  // Also check for declarations in for loops.
  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
    continue;
  return 0;
}

// Check varargs and va_copy.
static bool
test_varargs (const char *format, ...)
{
  va_list args;
  va_start (args, format);
  va_list args_copy;
  va_copy (args_copy, args);

  const char *str = "";
  int number = 0;
  float fnumber = 0;

  while (*format)
    {
      switch (*format++)
        {
        case 's': // string
          str = va_arg (args_copy, const char *);
          break;
        case 'd': // int
          number = va_arg (args_copy, int);
          break;
        case 'f': // float
          fnumber = va_arg (args_copy, double);
          break;
        default:
          break;
        }
    }
  va_end (args_copy);
  va_end (args);

  return *str && number && fnumber;
}

// Check _Alignas.
char _Alignas (double) aligned_as_double;
char _Alignas (0) no_special_alignment;
extern char aligned_as_int;
char _Alignas (0) _Alignas (int) aligned_as_int;

// Check _Alignof.
enum
{
  int_alignment = _Alignof (int),
  int_array_alignment = _Alignof (int[100]),
  char_alignment = _Alignof (char)
};
_Static_assert (0 < -_Alignof (int), "_Alignof is signed");

// Check _Noreturn.
int _Noreturn does_not_return (void) { for (;;) continue; }

// Check _Static_assert.
struct test_static_assert
{
  int x;
  _Static_assert (sizeof (int) <= sizeof (long int),
                  "_Static_assert does not work in struct");
  long int y;
};

// Check UTF-8 literals.
#define u8 syntax error!
char const utf8_literal[] = u8"happens to be ASCII" "another string";

// Check duplicate typedefs.
typedef long *long_ptr;
typedef long in
Download .txt
gitextract_7it7gsxl/

├── .github/
│   └── workflows/
│       ├── codecov.yml
│       ├── codeql.yml
│       ├── config-matrix.yml
│       ├── coverity.yml
│       ├── distcheck.yml
│       └── memcheck.yml
├── .gitignore
├── .packit.yaml
├── .perlcriticrc
├── .perltidyrc
├── AUTHORS
├── COPYING.LIB
├── ChangeLog
├── LICENSING
├── Makefile.am
├── NEWS
├── README.md
├── THANKS
├── TODO.md
├── autogen.sh
├── build-aux/
│   ├── ci/
│   │   ├── ci-log-dependency-versions
│   │   ├── ci-log-logfiles
│   │   ├── clang-gcov-wrapper
│   │   ├── configure-wrapper
│   │   └── summarize-coverage
│   ├── m4/
│   │   ├── ax_append_compile_flags.m4
│   │   ├── ax_append_flag.m4
│   │   ├── ax_check_compile_flag.m4
│   │   ├── ax_check_vscript.m4
│   │   ├── ax_gcc_func_attribute.m4
│   │   ├── ax_require_defined.m4
│   │   ├── ax_valgrind_check.m4
│   │   ├── pkg_compat.m4
│   │   ├── zw_alignment.m4
│   │   ├── zw_automodern.m4
│   │   ├── zw_detect_asan.m4
│   │   ├── zw_endianness.m4
│   │   ├── zw_ld_wrap.m4
│   │   ├── zw_prog_perl.m4
│   │   ├── zw_simple_warnings.m4
│   │   └── zw_static_assert.m4
│   └── scripts/
│       ├── BuildCommon.pm
│       ├── check-perlcritic-config
│       ├── compute-symver-floor
│       ├── expand-selected-hashes
│       ├── gen-crypt-h
│       ├── gen-crypt-hashes-h
│       ├── gen-crypt-symbol-vers-h
│       ├── gen-libcrypt-map
│       ├── move-if-change
│       └── skip-if-exec-format-error
├── codecov.yml
├── configure.ac
├── doc/
│   ├── crypt.3
│   ├── crypt.5
│   ├── crypt_checksalt.3
│   ├── crypt_gensalt.3
│   ├── crypt_gensalt_ra.3
│   ├── crypt_gensalt_rn.3
│   ├── crypt_preferred_method.3
│   ├── crypt_r.3
│   ├── crypt_ra.3
│   └── crypt_rn.3
├── lib/
│   ├── alg-des-tables.c
│   ├── alg-des.c
│   ├── alg-des.h
│   ├── alg-gost3411-2012-const.h
│   ├── alg-gost3411-2012-core.c
│   ├── alg-gost3411-2012-core.h
│   ├── alg-gost3411-2012-hmac.c
│   ├── alg-gost3411-2012-hmac.h
│   ├── alg-gost3411-2012-precalc.h
│   ├── alg-gost3411-2012-ref.h
│   ├── alg-hmac-sha1.c
│   ├── alg-hmac-sha1.h
│   ├── alg-md4.c
│   ├── alg-md4.h
│   ├── alg-md5.c
│   ├── alg-md5.h
│   ├── alg-sha1.c
│   ├── alg-sha1.h
│   ├── alg-sha256.c
│   ├── alg-sha256.h
│   ├── alg-sha512.c
│   ├── alg-sha512.h
│   ├── alg-sm3-hmac.c
│   ├── alg-sm3-hmac.h
│   ├── alg-sm3.c
│   ├── alg-sm3.h
│   ├── alg-yescrypt-common.c
│   ├── alg-yescrypt-opt.c
│   ├── alg-yescrypt-platform.c
│   ├── alg-yescrypt.h
│   ├── byteorder.h
│   ├── crypt-bcrypt.c
│   ├── crypt-des-obsolete.c
│   ├── crypt-des.c
│   ├── crypt-gensalt-static.c
│   ├── crypt-gost-yescrypt.c
│   ├── crypt-md5.c
│   ├── crypt-nthash.c
│   ├── crypt-obsolete.h
│   ├── crypt-pbkdf1-sha1.c
│   ├── crypt-port.h
│   ├── crypt-scrypt.c
│   ├── crypt-sha256.c
│   ├── crypt-sha512.c
│   ├── crypt-sm3-yescrypt.c
│   ├── crypt-sm3.c
│   ├── crypt-static.c
│   ├── crypt-sunmd5.c
│   ├── crypt-yescrypt.c
│   ├── crypt.c
│   ├── crypt.h.in
│   ├── gen-des-tables.c
│   ├── hashes.conf
│   ├── libcrypt.map.in
│   ├── libcrypt.minver
│   ├── libxcrypt.pc.in
│   ├── util-base64.c
│   ├── util-gensalt-sha.c
│   ├── util-get-random-bytes.c
│   ├── util-make-failure-token.c
│   ├── util-xbzero.c
│   ├── util-xstrcpy.c
│   └── xcrypt.h.in
├── libxcrypt.spec.rpkg
├── rpkg.conf
├── rpkg.macros
└── test/
    ├── TestCommon.pm
    ├── alg-des.c
    ├── alg-gost3411-2012-hmac.c
    ├── alg-gost3411-2012.c
    ├── alg-hmac-sha1.c
    ├── alg-md4.c
    ├── alg-md5.c
    ├── alg-pbkdf-hmac-sha256.c
    ├── alg-sha1.c
    ├── alg-sha256.c
    ├── alg-sha512.c
    ├── alg-sm3-hmac.c
    ├── alg-sm3.c
    ├── alg-yescrypt.c
    ├── badsalt.c
    ├── badsetting.c
    ├── byteorder.c
    ├── checksalt.c
    ├── compile-strong-alias.c
    ├── crypt-badargs.c
    ├── crypt-gost-yescrypt.c
    ├── crypt-nested-call.c
    ├── crypt-sm3-yescrypt.c
    ├── crypt-too-long-phrase.c
    ├── des-cases.h
    ├── des-obsolete.c
    ├── des-obsolete_r.c
    ├── explicit-bzero.c
    ├── gensalt-bcrypt_x.c
    ├── gensalt-extradata.c
    ├── gensalt-nested-call.c
    ├── gensalt-nthash.c
    ├── gensalt.c
    ├── getrandom-fallbacks.c
    ├── getrandom-interface.c
    ├── ka-table-gen.py
    ├── ka-table.inc
    ├── ka-tester.c
    ├── preferred-method.c
    ├── short-outbuf.c
    ├── special-char-salt.c
    ├── symbols-compat.pl
    ├── symbols-renames.pl
    └── symbols-static.pl
Download .txt
SYMBOL INDEX (489 symbols across 88 files)

FILE: lib/alg-des.c
  function des_set_key (line 73) | void
  function des_set_salt (line 132) | void
  function des_crypt_block (line 150) | void

FILE: lib/alg-des.h
  type des_ctx (line 51) | struct des_ctx
  type des_ctx (line 58) | struct des_ctx
  type des_ctx (line 60) | struct des_ctx
  type des_ctx (line 62) | struct des_ctx

FILE: lib/alg-gost3411-2012-core.c
  function GOST34112012Cleanup (line 28) | void
  function GOST34112012Init (line 34) | void
  function pad (line 51) | static inline void
  function add512 (line 62) | static inline void
  function g (line 99) | static void
  function stage2 (line 148) | static inline void
  function stage3 (line 160) | static inline void
  function GOST34112012Update (line 185) | void
  function GOST34112012Final (line 223) | void

FILE: lib/alg-gost3411-2012-core.h
  type uint512_u (line 21) | typedef union uint512_u
  type GOST34112012Context (line 29) | typedef struct GOST34112012Context

FILE: lib/alg-gost3411-2012-hmac.c
  function gost_hash256 (line 28) | void
  function gost_hmac256 (line 38) | void

FILE: lib/alg-gost3411-2012-hmac.h
  type gost_hmac_256_t (line 30) | typedef struct

FILE: lib/alg-hmac-sha1.c
  function hmac_sha1_process_data (line 58) | void

FILE: lib/alg-md4.c
  function MD4_Init (line 186) | void MD4_Init(MD4_CTX *ctx)
  function MD4_Update (line 197) | void MD4_Update(MD4_CTX *ctx, const void *data, size_t size)
  function MD4_Final (line 237) | void MD4_Final(uint8_t result[16], MD4_CTX *ctx)

FILE: lib/alg-md4.h
  type MD4_u32plus (line 30) | typedef uint32_t MD4_u32plus;
  type MD4_CTX (line 32) | typedef struct {

FILE: lib/alg-md5.c
  function MD5_Init (line 207) | void MD5_Init(MD5_CTX *ctx)
  function MD5_Update (line 218) | void MD5_Update(MD5_CTX *ctx, const void *data, size_t size)
  function MD5_Final (line 258) | void MD5_Final(uint8_t result[16], MD5_CTX *ctx)

FILE: lib/alg-md5.h
  type MD5_u32plus (line 30) | typedef uint32_t MD5_u32plus;
  type MD5_CTX (line 32) | typedef struct {

FILE: lib/alg-sha1.c
  function sha1_do_transform (line 108) | static void
  function sha1_init_ctx (line 223) | void
  function sha1_process_bytes (line 237) | void
  type sha1_ctx (line 266) | struct sha1_ctx
  type sha1_ctx (line 288) | struct sha1_ctx

FILE: lib/alg-sha1.h
  type sha1_ctx (line 13) | struct sha1_ctx
  type sha1_ctx (line 22) | struct sha1_ctx
  type sha1_ctx (line 27) | struct sha1_ctx
  type sha1_ctx (line 32) | struct sha1_ctx

FILE: lib/alg-sha256.c
  function SHA256_Transform (line 104) | static void
  function SHA256_Pad (line 177) | static void
  function SHA256_Init (line 215) | void
  function _SHA256_Update (line 230) | static void
  function SHA256_Update (line 271) | void
  function _SHA256_Final (line 288) | static void
  function SHA256_Final (line 301) | void
  function SHA256_Buf (line 320) | void
  function _HMAC_SHA256_Init (line 346) | static void
  function HMAC_SHA256_Init (line 379) | void
  function _HMAC_SHA256_Update (line 399) | static void
  function HMAC_SHA256_Update (line 409) | void
  function _HMAC_SHA256_Final (line 426) | static void
  function HMAC_SHA256_Final (line 442) | void
  function HMAC_SHA256_Buf (line 464) | void
  function SHA256_Pad_Almost (line 483) | static int
  function PBKDF2_SHA256 (line 514) | void

FILE: lib/alg-sha256.h
  type SHA256_CTX (line 51) | typedef struct {
  type HMAC_SHA256_CTX (line 83) | typedef struct {

FILE: lib/alg-sha512.c
  function SHA512_Transform (line 117) | static void
  function SHA512_Pad (line 187) | static void
  function SHA512_Init (line 216) | void
  function SHA512_Update (line 235) | void
  function SHA512_Final (line 281) | void
  function SHA512_Buf (line 300) | void

FILE: lib/alg-sha512.h
  type SHA512_CTX (line 48) | typedef struct {

FILE: lib/alg-sm3-hmac.c
  function sm3_hmac_init (line 46) | void
  function sm3_hmac_update (line 71) | void
  function sm3_hmac_final (line 77) | void
  function sm3_hmac (line 94) | void
  function sm3_hmac_buf (line 104) | void

FILE: lib/alg-sm3-hmac.h
  type sm3_hmac_ctx_t (line 24) | typedef struct

FILE: lib/alg-sm3.c
  function sm3_be32enc_vect (line 63) | static void
  function sm3_be32dec_vect (line 82) | static void
  function sm3_transform (line 97) | static void
  function sm3_init (line 273) | void
  function _sm3_update (line 289) | static void
  function sm3_update (line 332) | void
  function sm3_pad (line 353) | static void
  function _sm3_final (line 388) | static void
  function sm3_final (line 401) | void
  function sm3_hash (line 421) | void
  function sm3_buf (line 438) | void

FILE: lib/alg-sm3.h
  type sm3_ctx (line 25) | typedef struct

FILE: lib/alg-yescrypt-common.c
  function atoi64 (line 98) | static inline uint32_t atoi64(uint8_t src)
  type encrypt_dir_t (line 256) | typedef enum { ENC = 1, DEC = -1 } encrypt_dir_t;
  function memxor (line 258) | static void memxor(unsigned char *dst, unsigned char *src, size_t size)
  function yescrypt_sha256_cipher (line 264) | static void yescrypt_sha256_cipher(unsigned char *data, size_t datalen,
  function N2log2 (line 568) | static uint32_t N2log2(uint64_t N)
  function crypto_scrypt (line 695) | int crypto_scrypt(const uint8_t *passwd, size_t passwdlen,

FILE: lib/alg-yescrypt-opt.c
  type salsa20_blk_t (line 133) | typedef union {
  function salsa20_simd_shuffle (line 141) | static inline void salsa20_simd_shuffle(const salsa20_blk_t *Bin,
  function salsa20_simd_unshuffle (line 157) | static inline void salsa20_simd_unshuffle(const salsa20_blk_t *Bin,
  function salsa20 (line 294) | static inline void salsa20(salsa20_blk_t *restrict B,
  function blockmix_salsa8 (line 388) | static void blockmix_salsa8(const salsa20_blk_t *restrict Bin,
  function blockmix_salsa8_xor (line 401) | static uint32_t blockmix_salsa8_xor(const salsa20_blk_t *restrict Bin1,
  type pwxform_ctx_t (line 648) | typedef struct {
  function blockmix (line 660) | static void blockmix(const salsa20_blk_t *restrict Bin,
  function integerify (line 816) | static inline uint32_t integerify(const salsa20_blk_t *B, size_t r)
  function smix1 (line 835) | static void smix1(uint8_t *B, size_t r, uint32_t N, yescrypt_flags_t flags,
  function smix2 (line 952) | static void smix2(uint8_t *B, size_t r, uint32_t N, uint64_t Nloop,
  function p2floor (line 1033) | static uint64_t p2floor(uint64_t x)
  function yescrypt_kdf_body (line 1167) | static int yescrypt_kdf_body(const yescrypt_shared_t *shared,
  function yescrypt_kdf (line 1403) | int yescrypt_kdf(const yescrypt_shared_t *shared, yescrypt_local_t *local,
  function yescrypt_init_shared (line 1453) | int yescrypt_init_shared(yescrypt_shared_t *shared,
  function yescrypt_binary_t (line 1529) | yescrypt_binary_t *yescrypt_digest_shared(yescrypt_shared_t *shared)
  function yescrypt_free_shared (line 1551) | int yescrypt_free_shared(yescrypt_shared_t *shared)
  function yescrypt_init_local (line 1556) | int yescrypt_init_local(yescrypt_local_t *local)
  function yescrypt_free_local (line 1562) | int yescrypt_free_local(yescrypt_local_t *local)

FILE: lib/alg-yescrypt-platform.c
  function init_region (line 88) | static inline void init_region(yescrypt_region_t *region)
  function free_region (line 94) | static int free_region(yescrypt_region_t *region)

FILE: lib/alg-yescrypt.h
  type yescrypt_region_t (line 62) | typedef struct {
  type yescrypt_region_t (line 70) | typedef yescrypt_region_t yescrypt_shared_t;
  type yescrypt_region_t (line 71) | typedef yescrypt_region_t yescrypt_local_t;
  type yescrypt_flags_t (line 87) | typedef uint32_t yescrypt_flags_t;
  type yescrypt_params_t (line 139) | typedef struct {
  type yescrypt_binary_t (line 150) | typedef union {

FILE: lib/byteorder.h
  function le32_to_cpu (line 14) | static inline uint32_t
  function be32_to_cpu (line 23) | static inline uint32_t
  function le64_to_cpu (line 32) | static inline uint64_t
  function be64_to_cpu (line 45) | static inline uint64_t
  function cpu_to_le32 (line 58) | static inline void
  function cpu_to_be32 (line 67) | static inline void
  function cpu_to_le64 (line 76) | static inline void
  function cpu_to_be64 (line 89) | static inline void

FILE: lib/crypt-bcrypt.c
  type BF_word (line 61) | typedef uint32_t BF_word;
  type BF_word_signed (line 62) | typedef int32_t BF_word_signed;
  type BF_word (line 74) | typedef BF_word BF_key[BF_N + 2];
  type BF_ctx (line 76) | typedef struct
  function BF_decode (line 394) | static int
  function BF_encode (line 423) | static void
  function BF_swap (line 461) | static void
  function BF_swap (line 466) | static void
  function BF_set_key (line 564) | static void
  type BF_data (line 693) | struct BF_data
  type BF_buffer (line 708) | struct BF_buffer
  type BF_buffer (line 715) | struct BF_buffer
  function BF_crypt (line 719) | static bool
  function BF_full_crypt (line 871) | static void
  function BF_gensalt (line 947) | static void
  function crypt_bcrypt_rn (line 984) | void
  function gensalt_bcrypt_rn (line 993) | void
  function crypt_bcrypt_a_rn (line 1003) | void
  function gensalt_bcrypt_a_rn (line 1012) | void
  function crypt_bcrypt_x_rn (line 1022) | void
  function gensalt_bcrypt_x_rn (line 1031) | void
  function crypt_bcrypt_y_rn (line 1045) | void
  function gensalt_bcrypt_y_rn (line 1054) | void

FILE: lib/crypt-des-obsolete.c
  type des_ctx (line 59) | struct des_ctx
  type des_ctx (line 59) | struct des_ctx
  type des_ctx (line 66) | struct des_ctx
  type crypt_data (line 67) | struct crypt_data
  type des_ctx (line 70) | struct des_ctx
  type des_ctx (line 72) | struct des_ctx
  function unpack_bits (line 80) | static void
  function pack_bits (line 92) | static void
  function do_setkey_r (line 111) | static void
  function setkey_r (line 124) | void
  function do_encrypt_r (line 140) | static void
  function encrypt_r (line 151) | void
  type des_ctx (line 179) | struct des_ctx
  function setkey (line 183) | void
  function encrypt (line 197) | void

FILE: lib/crypt-des.c
  type des_buffer (line 66) | struct des_buffer
  type des_buffer (line 73) | struct des_buffer
  function ascii_to_bin (line 77) | static inline int
  function des_gen_hash (line 99) | static void
  function crypt_descrypt_rn (line 145) | void
  function crypt_bigcrypt_rn (line 223) | void
  function crypt_bsdicrypt_rn (line 312) | void
  function gensalt_descrypt_rn (line 398) | void
  function gensalt_bigcrypt_rn (line 420) | void
  function gensalt_bsdicrypt_rn (line 447) | void

FILE: lib/crypt-gost-yescrypt.c
  type crypt_gost_yescrypt_internal_t (line 38) | typedef struct
  function gensalt_gost_yescrypt_rn (line 56) | void
  function crypt_gost_yescrypt_rn (line 87) | void

FILE: lib/crypt-md5.c
  type md5_buffer (line 47) | struct md5_buffer
  type md5_buffer (line 53) | struct md5_buffer
  function crypt_md5crypt_rn (line 59) | void
  function gensalt_md5crypt_rn (line 218) | void

FILE: lib/crypt-nthash.c
  type crypt_nt_internal_t (line 42) | typedef struct
  function crypt_nt_rn (line 56) | void
  function gensalt_nt_rn (line 109) | void

FILE: lib/crypt-obsolete.h
  type crypt_data (line 31) | struct crypt_data
  type crypt_data (line 38) | struct crypt_data

FILE: lib/crypt-pbkdf1-sha1.c
  function to64 (line 57) | static inline void
  function crypt_sha1crypt_rn (line 91) | void
  function gensalt_sha1crypt_rn (line 195) | void

FILE: lib/crypt-scrypt.c
  function check_salt_char (line 27) | static int
  function verify_salt (line 45) | static int
  function N2log2 (line 116) | static uint32_t
  function crypt_scrypt_rn (line 138) | void
  function gensalt_scrypt_rn (line 163) | void

FILE: lib/crypt-sha256.c
  type sha256_buffer (line 59) | struct sha256_buffer
  type sha256_buffer (line 67) | struct sha256_buffer
  function SHA256_Update_recycled (line 73) | static void
  function crypt_sha256crypt_rn (line 83) | void
  function gensalt_sha256crypt_rn (line 299) | void

FILE: lib/crypt-sha512.c
  type sha512_buffer (line 59) | struct sha512_buffer
  type sha512_buffer (line 67) | struct sha512_buffer
  function sha512_process_recycled_bytes (line 74) | static void
  function crypt_sha512crypt_rn (line 84) | void
  function gensalt_sha512crypt_rn (line 314) | void

FILE: lib/crypt-sm3-yescrypt.c
  type crypt_sm3_yescrypt_internal_t (line 37) | typedef struct
  function gensalt_sm3_yescrypt_rn (line 57) | void
  function crypt_sm3_yescrypt_rn (line 90) | void

FILE: lib/crypt-sm3.c
  type sm3_buffer (line 60) | struct sm3_buffer
  type sm3_buffer (line 68) | struct sm3_buffer
  function sm3_update_recycled (line 74) | static void
  function crypt_sm3crypt_rn (line 84) | void
  function gensalt_sm3crypt_rn (line 299) | void

FILE: lib/crypt-static.c
  type crypt_data (line 28) | struct crypt_data

FILE: lib/crypt-sunmd5.c
  function get_nth_bit (line 93) | static inline bool
  function muffet_coin_toss (line 101) | static bool
  function write_itoa64_4 (line 132) | static inline void
  function write_itoa64_2 (line 144) | static inline void
  function crypt_sunmd5_rn (line 155) | void
  function gensalt_sunmd5_rn (line 271) | void

FILE: lib/crypt-yescrypt.c
  type crypt_yescrypt_internal_t (line 27) | typedef struct
  function crypt_yescrypt_rn (line 37) | void
  function gensalt_yescrypt_rn (line 104) | void

FILE: lib/crypt.c
  type crypt_internal (line 32) | struct crypt_internal
  type crypt_internal (line 40) | struct crypt_internal
  type crypt_internal (line 40) | struct crypt_internal
  type crypt_internal (line 47) | struct crypt_internal
  type crypt_data (line 48) | struct crypt_data
  type crypt_internal (line 51) | struct crypt_internal
  type crypt_internal (line 53) | struct crypt_internal
  type hashfn (line 65) | struct hashfn
  type hashfn (line 77) | struct hashfn
  function is_des_salt_char (line 83) | static int
  type hashfn (line 93) | struct hashfn
  type hashfn (line 96) | struct hashfn
  function check_badsalt_chars (line 136) | static int
  function do_crypt (line 149) | static void
  type crypt_data (line 200) | struct crypt_data
  type crypt_data (line 207) | struct crypt_data
  type crypt_data (line 218) | struct crypt_data
  type crypt_data (line 221) | struct crypt_data
  type crypt_data (line 229) | struct crypt_data
  type crypt_data (line 237) | struct crypt_data
  type crypt_data (line 247) | struct crypt_data
  type crypt_data (line 256) | struct crypt_data
  type hashfn (line 310) | struct hashfn
  function crypt_checksalt (line 381) | int

FILE: lib/gen-des-tables.c
  function des_init (line 169) | static void
  function write_table_u8 (line 309) | static void
  function write_table_u32 (line 327) | static void
  function main (line 345) | int

FILE: lib/util-gensalt-sha.c
  function gensalt_sha_rn (line 18) | void

FILE: lib/util-get-random-bytes.c
  function get_random_bytes (line 57) | bool

FILE: lib/util-make-failure-token.c
  function make_failure_token (line 22) | void

FILE: lib/util-xbzero.c
  function NO_INLINE (line 37) | NO_INLINE void

FILE: lib/util-xstrcpy.c
  function strcpy_or_abort (line 29) | size_t

FILE: test/alg-des.c
  function v_print (line 16) | static void
  function report_failure (line 23) | static void
  function main (line 39) | int
  function main (line 74) | int

FILE: test/alg-gost3411-2012-hmac.c
  function dumphex (line 28) | static void
  function test_gost2012_hmac (line 38) | static int
  function main (line 65) | int
  function main (line 84) | int

FILE: test/alg-gost3411-2012.c
  function dumphex (line 28) | static void
  function test_gost2012_hash (line 38) | static int
  function test_gost2012_hash512 (line 68) | static int
  function main (line 106) | int
  function main (line 185) | int

FILE: test/alg-hmac-sha1.c
  function char_to_bin (line 55) | static int
  function main (line 90) | int
  function main (line 181) | int

FILE: test/alg-md4.c
  function report_failure (line 46) | static void
  function main (line 69) | int
  function main (line 105) | int

FILE: test/alg-md5.c
  function report_failure (line 53) | static void
  function main (line 76) | int
  function main (line 128) | int

FILE: test/alg-pbkdf-hmac-sha256.c
  type hmac_sha256_test (line 19) | struct hmac_sha256_test
  type hmac_sha256_test (line 27) | struct hmac_sha256_test
  type pbkdf2_hmac_sha256_test (line 103) | struct pbkdf2_hmac_sha256_test
  type pbkdf2_hmac_sha256_test (line 114) | struct pbkdf2_hmac_sha256_test
  function report_failure (line 172) | static void
  function test_hmac_sha256 (line 195) | static int
  function test_pbkdf2_hmac_sha256 (line 228) | static int
  function main (line 252) | int
  function main (line 263) | int

FILE: test/alg-sha1.c
  function bin_to_hex (line 30) | static void
  function main (line 42) | int
  function main (line 105) | int

FILE: test/alg-sha256.c
  function report_failure (line 62) | static void
  function main (line 85) | int
  function main (line 135) | int

FILE: test/alg-sha512.c
  function report_failure (line 85) | static void
  function main (line 112) | int
  function main (line 164) | int

FILE: test/alg-sm3-hmac.c
  type testcase (line 27) | struct testcase
  type testcase (line 38) | struct testcase
  function dumphex (line 93) | static void
  function test_sm3_hmac (line 103) | static int
  function main (line 130) | int
  function main (line 143) | int

FILE: test/alg-sm3.c
  function report_failure (line 88) | static void
  function main (line 111) | int
  function main (line 162) | int

FILE: test/alg-yescrypt.c
  function print_PBKDF2_SHA256_raw (line 60) | static void print_PBKDF2_SHA256_raw(const char *passwd, size_t passwdlen,
  function print_PBKDF2_SHA256 (line 80) | static void print_PBKDF2_SHA256(const char *passwd,
  function print_scrypt (line 93) | static void print_scrypt(const char *passwd, const char *salt,
  function print_yescrypt (line 116) | static void print_yescrypt(const char *passwd, const char *salt,
  function main (line 158) | int main(void)
  function main (line 459) | int

FILE: test/badsalt.c
  type valid_setting (line 42) | struct valid_setting
  type valid_setting (line 45) | struct valid_setting
  type valid_setting (line 48) | struct valid_setting
  type valid_setting (line 76) | struct valid_setting
  type valid_setting (line 77) | struct valid_setting
  type valid_setting (line 78) | struct valid_setting
  type valid_setting (line 79) | struct valid_setting
  type valid_setting (line 80) | struct valid_setting
  type valid_setting (line 81) | struct valid_setting
  type valid_setting (line 107) | struct valid_setting
  type invalid_setting (line 161) | struct invalid_setting
  type invalid_setting (line 166) | struct invalid_setting
  function vt_never (line 227) | static bool
  function vt_varsuffix (line 237) | static bool
  function vt_roundseq (line 245) | static bool
  function vt_sunmd5 (line 272) | static bool
  function vt_sm3 (line 281) | static bool
  function vt_sha2gnu (line 290) | static bool
  function vt_yescrypt (line 299) | static bool
  function print_setting (line 346) | static void
  function measure_setting (line 373) | static size_t
  function measure_settings (line 388) | static void
  function print_result (line 401) | static void
  function segv_handler (line 417) | static void
  function test_one_setting (line 438) | static bool
  function test_one_valid (line 501) | static bool
  function test_one_invalid (line 636) | static bool
  function do_tests (line 646) | static bool
  function main (line 663) | int

FILE: test/badsetting.c
  type testcase (line 21) | struct testcase
  type testcase (line 33) | struct testcase
  function print_escaped_string (line 215) | static void
  function report_error (line 232) | static void
  function test_one (line 260) | static void
  function test_single_characters (line 293) | static void
  function test_dollar_nonalphanum (line 316) | static void
  function main (line 339) | int

FILE: test/byteorder.c
  type test_32 (line 23) | struct test_32
  type test_64 (line 29) | struct test_64
  function test_le32 (line 37) | static int
  function test_be32 (line 84) | static int
  function test_le64 (line 131) | static int
  function test_be64 (line 188) | static int
  function main (line 245) | int

FILE: test/checksalt.c
  type testcase (line 22) | struct testcase
  type testcase (line 30) | struct testcase
  function main (line 148) | int

FILE: test/compile-strong-alias.c
  function addition (line 30) | int addition (int a, int b)
  function main (line 36) | int

FILE: test/crypt-badargs.c
  function segv_handler (line 89) | static void
  function expect_no_fault (line 98) | static void
  function expect_a_fault (line 115) | static void
  function check (line 130) | static void
  function test_crypt (line 151) | static void
  function test_crypt_r (line 159) | static void
  function test_crypt_rn (line 169) | static void
  function test_crypt_ra (line 180) | static void
  function do_tests (line 206) | static void
  function main (line 348) | int

FILE: test/crypt-gost-yescrypt.c
  function test_outer_hmac (line 37) | static void
  function test_crypt_raw (line 57) | static int
  function main (line 99) | int
  function main (line 143) | int

FILE: test/crypt-nested-call.c
  function main (line 81) | int

FILE: test/crypt-sm3-yescrypt.c
  function test_outer_hmac (line 37) | static void
  function test_crypt_raw (line 57) | static int
  function main (line 99) | int
  function main (line 143) | int

FILE: test/crypt-too-long-phrase.c
  function main (line 80) | int

FILE: test/des-cases.h
  type des_testcase (line 13) | struct des_testcase
  type des_testcase (line 20) | struct des_testcase

FILE: test/des-obsolete.c
  function expand (line 24) | static void
  function ex_print (line 40) | static void
  function pk_print (line 55) | static void
  function report_failure (line 62) | static void
  function main (line 78) | int
  function main (line 118) | int

FILE: test/des-obsolete_r.c
  function expand (line 24) | static void
  function ex_print (line 40) | static void
  function pk_print (line 55) | static void
  function report_failure (line 62) | static void
  function main (line 78) | int
  function main (line 118) | int

FILE: test/explicit-bzero.c
  function main (line 46) | int main(void)
  function NO_INLINE (line 113) | static NO_INLINE int
  function prepare_test_buffer (line 127) | static inline void
  function setup_no_clear (line 141) | static void
  function setup_ordinary_clear (line 148) | static void
  function setup_explicit_clear (line 156) | static void
  type test_expectation (line 164) | enum test_expectation
  type subtest (line 172) | struct subtest
  type subtest (line 178) | struct subtest
  type subtest (line 180) | struct subtest
  function test_coroutine (line 190) | static void
  function count_test_patterns (line 208) | static unsigned int
  function check_test_buffer (line 227) | static void
  function test_loop (line 278) | static void
  function main (line 297) | int

FILE: test/gensalt-bcrypt_x.c
  function main (line 26) | int
  function main (line 48) | int

FILE: test/gensalt-extradata.c
  type testcase (line 29) | struct testcase
  type testcase (line 41) | struct testcase
  function do_crypt_gensalt (line 94) | static int
  function do_check_equal (line 133) | static int
  function main (line 149) | int

FILE: test/gensalt-nested-call.c
  function main (line 83) | int
  function main (line 120) | int

FILE: test/gensalt-nthash.c
  function main (line 25) | int
  function main (line 59) | int

FILE: test/gensalt.c
  type testcase (line 337) | struct testcase
  type testcase (line 353) | struct testcase
  function main (line 465) | int

FILE: test/getrandom-fallbacks.c
  function main (line 32) | int
  function __wrap_getentropy (line 51) | int
  function __wrap_getrandom (line 70) | ssize_t
  function __wrap_syscall (line 96) | long
  function open_needs_mode (line 155) | static bool open_needs_mode(int flags)
  function __wrap_open (line 174) | int
  function __wrap_open64 (line 197) | int
  function __wrap_close (line 220) | int
  function __wrap_read (line 230) | ssize_t
  type subtest (line 253) | struct subtest
  type subtest (line 259) | struct subtest
  function main (line 286) | int

FILE: test/getrandom-interface.c
  function test_basic (line 26) | static void
  function test_fault (line 113) | static void
  function segv_handler (line 129) | static void
  function expect_no_fault (line 135) | static void
  function expect_a_fault (line 149) | static void
  function main (line 166) | int

FILE: test/ka-table-gen.py
  function h_descrypt (line 209) | def h_descrypt(phrase, rounds, salt):
  function h_bigcrypt (line 218) | def h_bigcrypt(phrase, rounds, salt):
  function h_bsdicrypt (line 235) | def h_bsdicrypt(phrase, rounds, salt):
  function h_md5crypt (line 244) | def h_md5crypt(phrase, rounds, salt):
  function h_nt (line 253) | def h_nt(phrase, rounds, salt):
  function h_sha1crypt (line 266) | def h_sha1crypt(phrase, rounds, salt):
  function h_sha256crypt (line 275) | def h_sha256crypt(phrase, rounds, salt):
  function h_sha512crypt (line 284) | def h_sha512crypt(phrase, rounds, salt):
  function h_sunmd5 (line 299) | def h_sunmd5(phrase, rounds, salt):
  function h_bcrypt (line 339) | def h_bcrypt(phrase, rounds, salt):
  function h_bcrypt_y (line 346) | def h_bcrypt_y(phrase, rounds, salt):
  function h_bcrypt_a (line 374) | def h_bcrypt_a(phrase, rounds, salt):
  function h_bcrypt_x (line 452) | def h_bcrypt_x(phrase, rounds, salt):
  function h_scrypt (line 474) | def h_scrypt(phrase, rounds, salt):
  function xcrypt_crypt (line 518) | def xcrypt_crypt(phrase, setting):
  function h_sm3crypt (line 530) | def h_sm3crypt(phrase, rounds, salt):
  function yescrypt_gensalt (line 534) | def yescrypt_gensalt(ident, rounds, salt):
  function h_yescrypt (line 545) | def h_yescrypt(phrase, rounds, salt):
  function h_gost_yescrypt (line 549) | def h_gost_yescrypt(phrase, rounds, salt):
  function h_sm3_yescrypt (line 553) | def h_sm3_yescrypt(phrase, rounds, salt):
  function strneq_7bit (line 713) | def strneq_7bit (p1, p2, limit):
  function buggy_expand_BF_key (line 743) | def buggy_expand_BF_key(phrase):
  function sign_extension_collision_p (line 763) | def sign_extension_collision_p(p1, p2):
  function equivalent_sunmd5_settings_p (line 766) | def equivalent_sunmd5_settings_p(s1, s2):
  function collision_expected (line 796) | def collision_expected(p1, p2, s1, s2):
  function report_unexpected_collision (line 847) | def report_unexpected_collision(p1, p2, s1, s2, expected):
  function generate_phrase_setting_combs (line 861) | def generate_phrase_setting_combs():
  function worker_compute_one (line 867) | def worker_compute_one(args):
  function c_hex_escape (line 886) | def c_hex_escape(s):
  function format_case (line 893) | def format_case(phrase, setting, expected):
  function main (line 899) | def main():

FILE: test/ka-tester.c
  type testcase (line 40) | struct testcase
  type testcase (line 47) | struct testcase
  function print_escaped (line 61) | static void
  function begin_error_report (line 81) | static void
  function report_result (line 93) | static int
  function calc_hashes_crypt (line 145) | static int
  function calc_hashes_crypt_r_rn (line 163) | static int
  function calc_hashes_crypt_ra_recrypt (line 196) | static int
  function main (line 225) | int

FILE: test/preferred-method.c
  function main (line 24) | int

FILE: test/short-outbuf.c
  type testcase (line 24) | struct testcase
  type testcase (line 30) | struct testcase
  function main (line 37) | int

FILE: test/special-char-salt.c
  type testcase (line 32) | struct testcase
  type testcase (line 38) | struct testcase
  function fprint_not_printable_as_hex (line 1073) | static void
  function main (line 1111) | int
  function main (line 1154) | int
Condensed preview — 173 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,444K chars).
[
  {
    "path": ".github/workflows/codecov.yml",
    "chars": 3933,
    "preview": "name: \"Code coverage\"\n\non:\n  pull_request:\n  push:\n\njobs:\n  skip_duplicates:\n    continue-on-error: true\n    runs-on: ub"
  },
  {
    "path": ".github/workflows/codeql.yml",
    "chars": 3050,
    "preview": "name: \"CodeQL static analysis\"\n\non:\n  push:\n  pull_request:\n  schedule:\n    - cron: '31 3 * * 1'  # Monday at 3h31 UTC\n\n"
  },
  {
    "path": ".github/workflows/config-matrix.yml",
    "chars": 5078,
    "preview": "name: \"Config Matrix\"\n\non:\n   pull_request:\n   push:\n\njobs:\n  skip_duplicates:\n    continue-on-error: true\n    runs-on: "
  },
  {
    "path": ".github/workflows/coverity.yml",
    "chars": 5625,
    "preview": "name: Coverity\n\n# Coverity Scan gives relatively low-quality reports and has strict\n# rate limits, so we only run it on "
  },
  {
    "path": ".github/workflows/distcheck.yml",
    "chars": 3025,
    "preview": "name: Distcheck\n\non:\n  push:\n  pull_request:\n  schedule:\n  - cron: '31 3 * * 1'  # Monday at 3h31 UTC\n\njobs:\n  skip_dupl"
  },
  {
    "path": ".github/workflows/memcheck.yml",
    "chars": 4511,
    "preview": "name: Memory access checking\n\non:\n  push:\n  pull_request:\n\njobs:\n  skip_duplicates:\n    continue-on-error: true\n    runs"
  },
  {
    "path": ".gitignore",
    "chars": 2221,
    "preview": "# http://www.gnu.org/software/automake\n/Makefile\n/Makefile.deps\n/Makefile.in\n.deps/\n.dirstamp\n.libs/\n/INSTALL\n\n# http://"
  },
  {
    "path": ".packit.yaml",
    "chars": 817,
    "preview": "specfile_path: libxcrypt.spec\n\nfiles_to_sync:\n  - libxcrypt.spec\n  - .packit.yaml\n\nupstream_package_name: libxcrypt\nupst"
  },
  {
    "path": ".perlcriticrc",
    "chars": 13550,
    "preview": "# Perl::Critic configuration.  -*- conf -*-\n#\n# This .perlcriticrc expects precisely the following set of critic\n# polic"
  },
  {
    "path": ".perltidyrc",
    "chars": 375,
    "preview": "# perltidy configuration\n\n--standard-error-output\n--warning-output\n--character-encoding=utf8\n--converge\n\n--continuation-"
  },
  {
    "path": "AUTHORS",
    "chars": 1848,
    "preview": "The yescrypt code comes from yescrypt by Solar Designer <solar at\nopenwall.com>. It builds upon Colin Percival's scrypt."
  },
  {
    "path": "COPYING.LIB",
    "chars": 26530,
    "preview": "                  GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 2.1, February 1999\n\n Copyright (C) 19"
  },
  {
    "path": "ChangeLog",
    "chars": 6047,
    "preview": "2018-01-27  Zack Weinberg <zackw@panix.com>\n\n\t* Version 4.0.0 released.\n\n\t* This project no longer maintains a GNU-style"
  },
  {
    "path": "LICENSING",
    "chars": 5862,
    "preview": "# Detailed copyright and licensing information for libxcrypt\n\nThe overall license for libxcrypt is the GNU Lesser Genera"
  },
  {
    "path": "Makefile.am",
    "chars": 22071,
    "preview": "#\n# Copyright (c) 2002, 2007 SuSE Linux AG, Germany\n#\n# Author: Thorsten Kukuk <kukuk@suse.de>\n#\n\nAUTOMAKE_OPTIONS = \\\n\t"
  },
  {
    "path": "NEWS",
    "chars": 27759,
    "preview": "libxcrypt NEWS -- history of user-visible changes.\n\nPlease send bug reports, questions and suggestions to\n<https://githu"
  },
  {
    "path": "README.md",
    "chars": 9972,
    "preview": "[![Build matrix](https://github.com/besser82/libxcrypt/actions/workflows/config-matrix.yml/badge.svg)](https://github.co"
  },
  {
    "path": "THANKS",
    "chars": 596,
    "preview": "As mentioned in the README, many people have contributed to the code\nmaking up libxcrypt, often under the aegis of a dif"
  },
  {
    "path": "TODO.md",
    "chars": 4647,
    "preview": "to-do list for libxcrypt\n------------------------\n\nThis list is categorized but not in any kind of priority order.\nIt wa"
  },
  {
    "path": "autogen.sh",
    "chars": 1094,
    "preview": "#!/bin/sh\n#\n# Copyright (C) 2018 Björn Esser <besser82@fedoraproject.org>\n#\n# Redistribution and use in source and binar"
  },
  {
    "path": "build-aux/ci/ci-log-dependency-versions",
    "chars": 2005,
    "preview": "#! /bin/sh\nset -e\n\n# Record certain build tool versions for use as a cache key.\nautotools_ver=\n\n# Log the identities and"
  },
  {
    "path": "build-aux/ci/ci-log-logfiles",
    "chars": 545,
    "preview": "#! /bin/sh\n\ngenerate_secure_token() {\n    echo head --bytes 64 /dev/urandom | sha512sum --binary | cut --fields 1 --deli"
  },
  {
    "path": "build-aux/ci/clang-gcov-wrapper",
    "chars": 35,
    "preview": "#! /bin/sh\nexec llvm-cov gcov \"$@\"\n"
  },
  {
    "path": "build-aux/ci/configure-wrapper",
    "chars": 372,
    "preview": "#!/bin/bash\n\nexport DEB_BUILD_MAINT_OPTIONS=\"${DEB_BUILD_MAINT_OPTIONS:-hardening=+all optimize=-lto}\"\n\nexport CPPFLAGS="
  },
  {
    "path": "build-aux/ci/summarize-coverage",
    "chars": 659,
    "preview": "#! /bin/sh\nset -e\n\ncase \"$CC\" in\n    (*clang*)\n        GCOV=$(pwd)/build-aux/ci/clang-gcov-wrapper ;;\n    (*)\n        GC"
  },
  {
    "path": "build-aux/m4/ax_append_compile_flags.m4",
    "chars": 1765,
    "preview": "# ============================================================================\n#  https://www.gnu.org/software/autoconf-"
  },
  {
    "path": "build-aux/m4/ax_append_flag.m4",
    "chars": 1552,
    "preview": "# ===========================================================================\n#      https://www.gnu.org/software/autoco"
  },
  {
    "path": "build-aux/m4/ax_check_compile_flag.m4",
    "chars": 2104,
    "preview": "# ===========================================================================\n#  https://www.gnu.org/software/autoconf-a"
  },
  {
    "path": "build-aux/m4/ax_check_vscript.m4",
    "chars": 4717,
    "preview": "# ===========================================================================\n#     https://www.gnu.org/software/autocon"
  },
  {
    "path": "build-aux/m4/ax_gcc_func_attribute.m4",
    "chars": 8647,
    "preview": "# ===========================================================================\n#  https://www.gnu.org/software/autoconf-a"
  },
  {
    "path": "build-aux/m4/ax_require_defined.m4",
    "chars": 1218,
    "preview": "# ===========================================================================\n#    https://www.gnu.org/software/autoconf"
  },
  {
    "path": "build-aux/m4/ax_valgrind_check.m4",
    "chars": 8927,
    "preview": "# ===========================================================================\n#    https://www.gnu.org/software/autoconf"
  },
  {
    "path": "build-aux/m4/pkg_compat.m4",
    "chars": 3774,
    "preview": "# pkg.m4 - Macros to locate and use pkg-config.   -*- Autoconf -*-\n# serial 12 (pkg-config-0.29.2)\n\n# Copyright © 2004 S"
  },
  {
    "path": "build-aux/m4/zw_alignment.m4",
    "chars": 3544,
    "preview": "dnl Written by Zack Weinberg <zackw at panix.com> in 2017.\ndnl To the extent possible under law, Zack Weinberg has waive"
  },
  {
    "path": "build-aux/m4/zw_automodern.m4",
    "chars": 8940,
    "preview": "dnl Copyright 2017 Zack Weinberg <zackw at panix.com>.\ndnl Partially based on Autoconf, copyright 1992-2017 Free Softwar"
  },
  {
    "path": "build-aux/m4/zw_detect_asan.m4",
    "chars": 1044,
    "preview": "dnl Written by Zack Weinberg <zackw at panix.com> in 2021.\ndnl To the extent possible under law, Zack Weinberg has waive"
  },
  {
    "path": "build-aux/m4/zw_endianness.m4",
    "chars": 5529,
    "preview": "dnl Written by Zack Weinberg <zackw at panix.com> in 2018.\ndnl To the extent possible under law, Zack Weinberg has waive"
  },
  {
    "path": "build-aux/m4/zw_ld_wrap.m4",
    "chars": 1504,
    "preview": "dnl Written by Zack Weinberg <zackw at panix.com> in 2018.\ndnl To the extent possible under law, Zack Weinberg has waive"
  },
  {
    "path": "build-aux/m4/zw_prog_perl.m4",
    "chars": 1336,
    "preview": "# zw_prog_perl.m4  -*- autoconf -*-\n# serial 1\n#\n# inspired by, but shares no code with, ax_prog_perl_version.m4 by\n# Fr"
  },
  {
    "path": "build-aux/m4/zw_simple_warnings.m4",
    "chars": 4983,
    "preview": "# serial 1\ndnl Copyright 2017 Zack Weinberg <zackw at panix.com>.\ndnl Partially based on Autoconf, copyright 1992-2017 F"
  },
  {
    "path": "build-aux/m4/zw_static_assert.m4",
    "chars": 2825,
    "preview": "dnl Written by Zack Weinberg <zackw at panix.com> in 2017.\ndnl To the extent possible under law, Zack Weinberg has waive"
  },
  {
    "path": "build-aux/scripts/BuildCommon.pm",
    "chars": 22263,
    "preview": "# Written by Zack Weinberg <zackw at panix.com> in 2017 and 2020.\n# To the extent possible under law, Zack Weinberg has "
  },
  {
    "path": "build-aux/scripts/check-perlcritic-config",
    "chars": 2312,
    "preview": "#! /usr/bin/perl\n# Written by Zack Weinberg <zackw at panix.com> in 2021.\n# To the extent possible under law, Zack Weinb"
  },
  {
    "path": "build-aux/scripts/compute-symver-floor",
    "chars": 3137,
    "preview": "#! /usr/bin/perl\n# Written by Zack Weinberg <zackw at panix.com> in 2017 and 2020.\n# To the extent possible under law, Z"
  },
  {
    "path": "build-aux/scripts/expand-selected-hashes",
    "chars": 2366,
    "preview": "#! /usr/bin/perl\n# Written by Zack Weinberg <zackw at panix.com> in 2018 and 2020.\n# To the extent possible under law, Z"
  },
  {
    "path": "build-aux/scripts/gen-crypt-h",
    "chars": 3602,
    "preview": "#! /usr/bin/perl\n# Written by Zack Weinberg <zackw at panix.com> in 2017.\n# To the extent possible under law, Zack Weinb"
  },
  {
    "path": "build-aux/scripts/gen-crypt-hashes-h",
    "chars": 4181,
    "preview": "#! /usr/bin/perl\n# Written by Zack Weinberg <zackw at panix.com> in 2018 and 2020.\n# To the extent possible under law, Z"
  },
  {
    "path": "build-aux/scripts/gen-crypt-symbol-vers-h",
    "chars": 3954,
    "preview": "#! /usr/bin/perl\n# Written by Zack Weinberg <zackw at panix.com> in 2017 and 2021.\n# To the extent possible under law, Z"
  },
  {
    "path": "build-aux/scripts/gen-libcrypt-map",
    "chars": 1698,
    "preview": "#! /usr/bin/perl\n# Written by Zack Weinberg <zackw at panix.com> in 2017 and 2021.\n# To the extent possible under law, Z"
  },
  {
    "path": "build-aux/scripts/move-if-change",
    "chars": 2673,
    "preview": "#!/bin/sh\n# Like mv $1 $2, but if the files are the same, just delete $1.\n# Status is zero if successful, nonzero otherw"
  },
  {
    "path": "build-aux/scripts/skip-if-exec-format-error",
    "chars": 2862,
    "preview": "#! /usr/bin/perl\n# Run a test given as @ARGV, and then munge its exit code to 77 if it\n# failed because of an \"exec form"
  },
  {
    "path": "codecov.yml",
    "chars": 62,
    "preview": "ignore:\n  - \"lib/gen-des-tables.c\"\n  - \"test\"\n  - \"/usr/**/*\"\n"
  },
  {
    "path": "configure.ac",
    "chars": 18818,
    "preview": "# Process this file with autoconf to produce a configure script.\nm4_include([build-aux/m4/zw_automodern.m4])\nAC_INIT([xc"
  },
  {
    "path": "doc/crypt.3",
    "chars": 11379,
    "preview": ".\\\" Written and revised by Solar Designer <solar at openwall.com> in 2000-2011.\n.\\\" Revised by Zack Weinberg <zackw at p"
  },
  {
    "path": "doc/crypt.5",
    "chars": 13450,
    "preview": ".\\\" Written and revised by Solar Designer <solar at openwall.com> in 2000-2024.\n.\\\" Revised by Zack Weinberg <zackw at p"
  },
  {
    "path": "doc/crypt_checksalt.3",
    "chars": 2891,
    "preview": ".\\\" Written by Zack Weinberg <zackw at panix.com> in 2018.\n.\\\"\n.\\\" To the extent possible under law, the authors have wa"
  },
  {
    "path": "doc/crypt_gensalt.3",
    "chars": 6677,
    "preview": ".\\\" Written and revised by Solar Designer <solar at openwall.com> in 2000-2011.\n.\\\" Revised by Zack Weinberg <zackw at p"
  },
  {
    "path": "doc/crypt_gensalt_ra.3",
    "chars": 25,
    "preview": ".so man3/crypt_gensalt.3\n"
  },
  {
    "path": "doc/crypt_gensalt_rn.3",
    "chars": 25,
    "preview": ".so man3/crypt_gensalt.3\n"
  },
  {
    "path": "doc/crypt_preferred_method.3",
    "chars": 1580,
    "preview": ".\\\" Written by Björn Esser <besser82 at fedoraproject.org> in 2018.\n.\\\"\n.\\\" To the extent possible under law, the author"
  },
  {
    "path": "doc/crypt_r.3",
    "chars": 17,
    "preview": ".so man3/crypt.3\n"
  },
  {
    "path": "doc/crypt_ra.3",
    "chars": 17,
    "preview": ".so man3/crypt.3\n"
  },
  {
    "path": "doc/crypt_rn.3",
    "chars": 17,
    "preview": ".so man3/crypt.3\n"
  },
  {
    "path": "lib/alg-des-tables.c",
    "chars": 275952,
    "preview": "/*\n * FreeSec: libcrypt for NetBSD\n *\n * Copyright (c) 1994 David Burren\n * All rights reserved.\n *\n * Adapted for FreeB"
  },
  {
    "path": "lib/alg-des.c",
    "chars": 9046,
    "preview": "/*\n * FreeSec: libcrypt for NetBSD\n *\n * Copyright (c) 1994 David Burren\n * All rights reserved.\n *\n * Adapted for FreeB"
  },
  {
    "path": "lib/alg-des.h",
    "chars": 3105,
    "preview": "/*\n * FreeSec: libcrypt for NetBSD\n *\n * Copyright (c) 1994 David Burren\n * All rights reserved.\n *\n * Adapted for FreeB"
  },
  {
    "path": "lib/alg-gost3411-2012-const.h",
    "chars": 8983,
    "preview": "/*\n * Copyright (c) 2013, Alexey Degtyarev <alexey@renatasystems.org>.\n * All rights reserved.\n *\n * Iteration constants"
  },
  {
    "path": "lib/alg-gost3411-2012-core.c",
    "chars": 5352,
    "preview": "/*\n * Copyright (c) 2013, Alexey Degtyarev <alexey@renatasystems.org>.\n * All rights reserved.\n *\n * GOST R 34.11-2012 c"
  },
  {
    "path": "lib/alg-gost3411-2012-core.h",
    "chars": 1234,
    "preview": "/*\n * Copyright (c) 2013, Alexey Degtyarev <alexey@renatasystems.org>.\n * All rights reserved.\n *\n * $Id$\n */\n\n#ifndef _"
  },
  {
    "path": "lib/alg-gost3411-2012-hmac.c",
    "chars": 2706,
    "preview": "/* Copyright (C) 2018 vt@altlinux.org\n * Copyright (C) 2018 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistributio"
  },
  {
    "path": "lib/alg-gost3411-2012-hmac.h",
    "chars": 1830,
    "preview": "/* Copyright (C) 2018 vt@altlinux.org\n * Copyright (C) 2018 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistributio"
  },
  {
    "path": "lib/alg-gost3411-2012-precalc.h",
    "chars": 105711,
    "preview": "/*\n * Copyright (c) 2013, Alexey Degtyarev <alexey@renatasystems.org>.\n * All rights reserved.\n *\n * Precalculation of m"
  },
  {
    "path": "lib/alg-gost3411-2012-ref.h",
    "chars": 2039,
    "preview": "/*\n * Copyright (c) 2013, Alexey Degtyarev <alexey@renatasystems.org>.\n * All rights reserved.\n *\n * Portable and simple"
  },
  {
    "path": "lib/alg-hmac-sha1.c",
    "chars": 3937,
    "preview": "/*\n * Copyright (c) 2017, Björn Esser <besser82@fedoraproject.org>\n * All rights reserved.\n *\n * Redistribution and use "
  },
  {
    "path": "lib/alg-hmac-sha1.h",
    "chars": 1747,
    "preview": "/*\n * Copyright (c) 2017, Björn Esser <besser82@fedoraproject.org>\n * All rights reserved.\n *\n * Redistribution and use "
  },
  {
    "path": "lib/alg-md4.c",
    "chars": 7544,
    "preview": "/*\n * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.\n * MD4 Message-Digest Algorithm (RFC 1"
  },
  {
    "path": "lib/alg-md4.h",
    "chars": 1375,
    "preview": "/*\n * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.\n * MD4 Message-Digest Algorithm (RFC 1"
  },
  {
    "path": "lib/alg-md5.c",
    "chars": 8792,
    "preview": "/*\n * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.\n * MD5 Message-Digest Algorithm (RFC 1"
  },
  {
    "path": "lib/alg-md5.h",
    "chars": 1375,
    "preview": "/*\n * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.\n * MD5 Message-Digest Algorithm (RFC 1"
  },
  {
    "path": "lib/alg-sha1.c",
    "chars": 7864,
    "preview": "/*\nSHA-1 in C\nBy Steve Reid <sreid@sea-to-sky.net>\n100% Public Domain\n\n-----------------\nModified 7/98\nBy James H. Brown"
  },
  {
    "path": "lib/alg-sha1.h",
    "chars": 1164,
    "preview": "/*\n * This is an implementation of the National Institute of Standards\n * and Technology US Secure Hash Algorithm 1 (SHA"
  },
  {
    "path": "lib/alg-sha256.c",
    "chars": 17190,
    "preview": "/*-\n * Copyright 2005-2016 Colin Percival\n * Copyright 2016-2018,2021 Alexander Peslyak\n * All rights reserved.\n *\n * Re"
  },
  {
    "path": "lib/alg-sha256.h",
    "chars": 4218,
    "preview": "/*-\n * Copyright 2005-2016 Colin Percival\n * All rights reserved.\n *\n * Redistribution and use in source and binary form"
  },
  {
    "path": "lib/alg-sha512.c",
    "chars": 9569,
    "preview": "/*-\n * Copyright 2005 Colin Percival\n * Copyright (c) 2015 Allan Jude <allanjude@FreeBSD.org>\n * Copyright 2021, 2022 Al"
  },
  {
    "path": "lib/alg-sha512.h",
    "chars": 2774,
    "preview": "/*-\n * Copyright 2005 Colin Percival\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, wi"
  },
  {
    "path": "lib/alg-sm3-hmac.c",
    "chars": 3082,
    "preview": "/* Copyright (C) 2024 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribution and use in source and binary forms, "
  },
  {
    "path": "lib/alg-sm3-hmac.h",
    "chars": 1719,
    "preview": "/* Copyright (C) 2024 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribution and use in source and binary forms, "
  },
  {
    "path": "lib/alg-sm3.c",
    "chars": 14057,
    "preview": "/*\n * Copyright (c) 2025 Björn Esser <besser82 at fedoraproject.org>\n * All rights reserved.\n *\n * Permission to use, co"
  },
  {
    "path": "lib/alg-sm3.h",
    "chars": 1826,
    "preview": "/*\n * Copyright (c) 2025 Björn Esser <besser82 at fedoraproject.org>\n * All rights reserved.\n *\n * Permission to use, co"
  },
  {
    "path": "lib/alg-yescrypt-common.c",
    "chars": 15568,
    "preview": "/*-\n * Copyright 2013-2018 Alexander Peslyak\n * All rights reserved.\n *\n * Redistribution and use in source and binary f"
  },
  {
    "path": "lib/alg-yescrypt-opt.c",
    "chars": 42925,
    "preview": "/*-\n * Copyright 2009 Colin Percival\n * Copyright 2012-2025 Alexander Peslyak\n * All rights reserved.\n *\n * Redistributi"
  },
  {
    "path": "lib/alg-yescrypt-platform.c",
    "chars": 3101,
    "preview": "/*-\n * Copyright 2013-2018,2022 Alexander Peslyak\n * All rights reserved.\n *\n * Redistribution and use in source and bin"
  },
  {
    "path": "lib/alg-yescrypt.h",
    "chars": 13422,
    "preview": "/*-\n * Copyright 2009 Colin Percival\n * Copyright 2013-2018 Alexander Peslyak\n * All rights reserved.\n *\n * Redistributi"
  },
  {
    "path": "lib/byteorder.h",
    "chars": 6514,
    "preview": "/* Functions to copy data between possibly-unaligned byte buffers\n   and machine integers, fixing the endianness.\n\n   Wr"
  },
  {
    "path": "lib/crypt-bcrypt.c",
    "chars": 39110,
    "preview": "/*\n * The crypt_blowfish homepage is:\n *\n *      http://www.openwall.com/crypt/\n *\n * This code comes from John the Ripp"
  },
  {
    "path": "lib/crypt-des-obsolete.c",
    "chars": 6684,
    "preview": "/*\n * FreeSec: libcrypt for NetBSD\n *\n * Copyright (c) 1994 David Burren\n * All rights reserved.\n *\n * Adapted for FreeB"
  },
  {
    "path": "lib/crypt-des.c",
    "chars": 14435,
    "preview": "/*\n * FreeSec: libcrypt for NetBSD\n *\n * Copyright (c) 1994 David Burren\n * All rights reserved.\n *\n * Adapted for FreeB"
  },
  {
    "path": "lib/crypt-gensalt-static.c",
    "chars": 1475,
    "preview": "/* Copyright (C) 2007-2017 Thorsten Kukuk\n\n   This library is free software; you can redistribute it and/or\n   modify it"
  },
  {
    "path": "lib/crypt-gost-yescrypt.c",
    "chars": 5690,
    "preview": "/* Copyright (C) 2018 vt@altlinux.org\n * Copyright (C) 2018 Björn Esser besser82@fedoraproject.org\n *\n * Redistribution "
  },
  {
    "path": "lib/crypt-md5.c",
    "chars": 7651,
    "preview": "/* One way encryption based on MD5 sum.\n   Compatible with the behavior of MD5 crypt introduced in FreeBSD 2.0.\n\n   Copy"
  },
  {
    "path": "lib/crypt-nthash.c",
    "chars": 4181,
    "preview": "/*-\n * Copyright (c) 1998-1999 Whistle Communications, Inc.\n * Copyright (c) 1998-1999 Archie Cobbs <archie@freebsd.org>"
  },
  {
    "path": "lib/crypt-obsolete.h",
    "chars": 1549,
    "preview": "/* Prototypes for obsolete functions in libcrypt.\n\n   Copyright (C) 1991-2017 Free Software Foundation, Inc.\n\n   This li"
  },
  {
    "path": "lib/crypt-pbkdf1-sha1.c",
    "chars": 8049,
    "preview": "/*\n * Copyright (c) 2004, Juniper Networks, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and bina"
  },
  {
    "path": "lib/crypt-port.h",
    "chars": 18703,
    "preview": "/* Portability glue for libcrypt.\n\n   Copyright 2007-2017 Thorsten Kukuk and Zack Weinberg\n   Copyright 2018-2019 Björn "
  },
  {
    "path": "lib/crypt-scrypt.c",
    "chars": 6169,
    "preview": "/* Copyright (C) 2013 Alexander Peslyak\n * Copyright (C) 2018 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribut"
  },
  {
    "path": "lib/crypt-sha256.c",
    "chars": 10009,
    "preview": "/* One way encryption based on the SHA256-based Unix crypt implementation.\n *\n * Written by Ulrich Drepper <drepper at r"
  },
  {
    "path": "lib/crypt-sha512.c",
    "chars": 10806,
    "preview": "/* One way encryption based on the SHA512-based Unix crypt implementation.\n *\n * Written by Ulrich Drepper <drepper at r"
  },
  {
    "path": "lib/crypt-sm3-yescrypt.c",
    "chars": 5717,
    "preview": "/* Copyright (C) 2024 Björn Esser besser82@fedoraproject.org\n *\n * Redistribution and use in source and binary forms, wi"
  },
  {
    "path": "lib/crypt-sm3.c",
    "chars": 9850,
    "preview": "/* One way encryption based on the SHA256-based Unix crypt implementation.\n *\n * Written by Ulrich Drepper <drepper at r"
  },
  {
    "path": "lib/crypt-static.c",
    "chars": 1439,
    "preview": "/* Copyright (C) 2007-2017 Thorsten Kukuk\n   Copyright (C) 2019 Björn Esser\n\n   This library is free software; you can r"
  },
  {
    "path": "lib/crypt-sunmd5.c",
    "chars": 10976,
    "preview": "/* Copyright (c) 2018 Zack Weinberg.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, wi"
  },
  {
    "path": "lib/crypt-yescrypt.c",
    "chars": 5244,
    "preview": "/* Copyright (C) 2018 vt@altlinux.org\n *\n * Redistribution and use in source and binary forms, with or without\n * modifi"
  },
  {
    "path": "lib/crypt.c",
    "chars": 12005,
    "preview": "/* High-level libcrypt interfaces.\n\n   Copyright 2007-2017 Thorsten Kukuk and Zack Weinberg\n   Copyright 2018-2025 Björn"
  },
  {
    "path": "lib/crypt.h.in",
    "chars": 11186,
    "preview": "/* High-level libcrypt interfaces.\n\n   Copyright (C) 1991-2017 Free Software Foundation, Inc.\n\n   This library is free s"
  },
  {
    "path": "lib/gen-des-tables.c",
    "chars": 11847,
    "preview": "/*\n * FreeSec: libcrypt for NetBSD\n *\n * Copyright (c) 1994 David Burren\n * All rights reserved.\n *\n * Adapted for FreeB"
  },
  {
    "path": "lib/hashes.conf",
    "chars": 3333,
    "preview": "# This file is read by expand-selected-hashes and gen-crypt-hashes-h.\n# It lists, for each supported hash algorithm, the"
  },
  {
    "path": "lib/libcrypt.map.in",
    "chars": 2172,
    "preview": "# This file is processed by gen-libcrypt-map to produce the versions\n# map file for libxcrypt.\n# symbol default_version "
  },
  {
    "path": "lib/libcrypt.minver",
    "chars": 4403,
    "preview": "# This file defines the minimum symbol version number used by the\n# system-provided libcrypt, for each CPU and OS where "
  },
  {
    "path": "lib/libxcrypt.pc.in",
    "chars": 374,
    "preview": "#############################################\n#####   Pkg-Config file for libxcrypt   #####\n############################"
  },
  {
    "path": "lib/util-base64.c",
    "chars": 1274,
    "preview": "/* Copyright (C) 2018-2021 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribution and use in source and binary fo"
  },
  {
    "path": "lib/util-gensalt-sha.c",
    "chars": 2548,
    "preview": "/*\n * Written by Solar Designer and placed in the public domain.\n * See crypt-bcrypt.c for more information.\n *\n * This "
  },
  {
    "path": "lib/util-get-random-bytes.c",
    "chars": 4398,
    "preview": "/* Retrieval of cryptographically random bytes from the operating system.\n *\n * Written by Zack Weinberg <zackw at panix"
  },
  {
    "path": "lib/util-make-failure-token.c",
    "chars": 1557,
    "preview": "/* Copyright (C) 2018-2019 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribution and use in source and binary fo"
  },
  {
    "path": "lib/util-xbzero.c",
    "chars": 1990,
    "preview": "/* Copyright (C) 2018-2019 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribution and use in source and binary fo"
  },
  {
    "path": "lib/util-xstrcpy.c",
    "chars": 1641,
    "preview": "/* Copyright (C) 2018-2019 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribution and use in source and binary fo"
  },
  {
    "path": "lib/xcrypt.h.in",
    "chars": 2494,
    "preview": "/* libxcrypt interfaces for code compatibility.\n\n   Copyright (C) 2018 Björn Esser <besser82@fedoraproject.org>\n\n   Redi"
  },
  {
    "path": "libxcrypt.spec.rpkg",
    "chars": 13473,
    "preview": "# Build with new api?\n%if 0%{?fedora} || 0%{?rhel} > 8\n%bcond_without new_api\n%else\n%bcond_with    new_api\n%endif\n\n\n# Bu"
  },
  {
    "path": "rpkg.conf",
    "chars": 53,
    "preview": "[rpkg]\nuser_macros = \"${git_props:root}/rpkg.macros\"\n"
  },
  {
    "path": "rpkg.macros",
    "chars": 2548,
    "preview": "function filter_tags {\n    grep -E \"^$1[^-]+$\"\n}\n\nfunction latest_merged_tag {\n    if [ \"$LEGACY_GIT\" ]; then\n        gi"
  },
  {
    "path": "test/TestCommon.pm",
    "chars": 9473,
    "preview": "# Written by Zack Weinberg <zackw at panix.com> in 2020.\n# To the extent possible under law, Zack Weinberg has waived al"
  },
  {
    "path": "test/alg-des.c",
    "chars": 1552,
    "preview": "/*\n * This crypt(3) validation program shipped with UFC-crypt\n * is derived from one distributed with Phil Karns PD DES "
  },
  {
    "path": "test/alg-gost3411-2012-hmac.c",
    "chars": 2601,
    "preview": "/* Copyright (C) 2018 vt@altlinux.org\n * Copyright (C) 2018 Björn Esser besser82@fedoraproject.org\n *\n * Redistribution "
  },
  {
    "path": "test/alg-gost3411-2012.c",
    "chars": 7330,
    "preview": "/* Copyright (C) 2018 vt@altlinux.org\n * Copyright (C) 2018 Björn Esser besser82@fedoraproject.org\n *\n * Redistribution "
  },
  {
    "path": "test/alg-hmac-sha1.c",
    "chars": 5262,
    "preview": "/*\n * Copyright (c) 2017, Björn Esser <besser82@fedoraproject.org>\n * All rights reserved.\n *\n * Redistribution and use "
  },
  {
    "path": "test/alg-md4.c",
    "chars": 2472,
    "preview": "#include \"crypt-port.h\"\n#include \"alg-md4.h\"\n\n#include <stdio.h>\n\n#if INCLUDE_nt\n\nstatic const struct\n{\n  const char *in"
  },
  {
    "path": "test/alg-md5.c",
    "chars": 3273,
    "preview": "#include \"crypt-port.h\"\n#include \"alg-md5.h\"\n\n#include <stdio.h>\n\n#if INCLUDE_md5crypt || INCLUDE_sunmd5\n\nstatic const s"
  },
  {
    "path": "test/alg-pbkdf-hmac-sha256.c",
    "chars": 9275,
    "preview": "/* Test HMAC_SHA256 and PBKDF2_HMAC_SHA256 implementations.\n *\n * Written by Zack Weinberg <zackw at panix.com> in 2018."
  },
  {
    "path": "test/alg-sha1.c",
    "chars": 2549,
    "preview": "/*\n * SHA-1 in C\n * By Steve Reid <sreid@sea-to-sky.net>\n * 100% Public Domain\n*/\n\n#include \"crypt-port.h\"\n#include \"alg"
  },
  {
    "path": "test/alg-sha256.c",
    "chars": 3813,
    "preview": "#include \"crypt-port.h\"\n#include \"alg-sha256.h\"\n\n#include <stdio.h>\n\n#if INCLUDE_sha256crypt || INCLUDE_scrypt || INCLUD"
  },
  {
    "path": "test/alg-sha512.c",
    "chars": 5560,
    "preview": "#include \"crypt-port.h\"\n#include \"alg-sha512.h\"\n\n#include <stdio.h>\n\n#if INCLUDE_sha512crypt\n\nstatic const struct\n{\n  co"
  },
  {
    "path": "test/alg-sm3-hmac.c",
    "chars": 5255,
    "preview": "/* Copyright (C) 2018, 2024, 2025 Björn Esser besser82@fedoraproject.org\n *\n * Redistribution and use in source and bina"
  },
  {
    "path": "test/alg-sm3.c",
    "chars": 5168,
    "preview": "/*\n * Copyright (C) 2024 Tianjia Zhang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, "
  },
  {
    "path": "test/alg-yescrypt.c",
    "chars": 13924,
    "preview": "/*-\n * Copyright 2013-2018 Alexander Peslyak\n * All rights reserved.\n *\n * Redistribution and use in source and binary f"
  },
  {
    "path": "test/badsalt.c",
    "chars": 26589,
    "preview": "/* Test rejection of ill-formed password hashes.\n   Copyright (C) 2012-2018 Free Software Foundation, Inc.\n   This file "
  },
  {
    "path": "test/badsetting.c",
    "chars": 9475,
    "preview": "/* Test rejection of ill-formed setting strings.\n\n   Written by Zack Weinberg <zackw at panix.com> in 2018.\n   To the ex"
  },
  {
    "path": "test/byteorder.c",
    "chars": 7987,
    "preview": "/* Test the functions defined in byteorder.h.\n *\n * Written by Zack Weinberg <zackw at panix.com> in 2017.\n *\n * No copy"
  },
  {
    "path": "test/checksalt.c",
    "chars": 10837,
    "preview": "/* Copyright (C) 2018-2021 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribution and use in source and binary fo"
  },
  {
    "path": "test/compile-strong-alias.c",
    "chars": 1462,
    "preview": "/* Copyright (C) 2018 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribution and use in source and binary forms, "
  },
  {
    "path": "test/crypt-badargs.c",
    "chars": 12886,
    "preview": "/* Test passing invalid arguments to crypt*().\n\n   Written by Zack Weinberg <zackw at panix.com> in 2018.\n   To the exte"
  },
  {
    "path": "test/crypt-gost-yescrypt.c",
    "chars": 4069,
    "preview": "/* Copyright (C) 2018 vt@altlinux.org\n * Copyright (C) 2018 Björn Esser besser82@fedoraproject.org\n *\n * Redistribution "
  },
  {
    "path": "test/crypt-nested-call.c",
    "chars": 4681,
    "preview": "/*\n * Copyright (c) 2025 Björn Esser <besser82 at fedoraproject.org>\n * All rights reserved.\n *\n * Permission to use, co"
  },
  {
    "path": "test/crypt-sm3-yescrypt.c",
    "chars": 4042,
    "preview": "/* Copyright (C) 2018 vt@altlinux.org\n * Copyright (C) 2018, 2024 Björn Esser besser82@fedoraproject.org\n *\n * Redistrib"
  },
  {
    "path": "test/crypt-too-long-phrase.c",
    "chars": 4092,
    "preview": "/*\n * Copyright (c) 2025 Björn Esser <besser82 at fedoraproject.org>\n * All rights reserved.\n *\n * Permission to use, co"
  },
  {
    "path": "test/des-cases.h",
    "chars": 20116,
    "preview": "/*\n * These test vectors for the DES primitive block cipher are derived\n * from Phil Karns' PD DES package.  They are us"
  },
  {
    "path": "test/des-obsolete.c",
    "chars": 4557,
    "preview": "\n/*\n * This crypt(3) validation program shipped with UFC-crypt\n * is derived from one distributed with Phil Karns PD DES"
  },
  {
    "path": "test/des-obsolete_r.c",
    "chars": 4642,
    "preview": "\n/*\n * This crypt(3) validation program shipped with UFC-crypt\n * is derived from one distributed with Phil Karns PD DES"
  },
  {
    "path": "test/explicit-bzero.c",
    "chars": 10221,
    "preview": "/* Test that explicit_bzero block clears are not optimized out.\n   Copyright (C) 2016-2020 Free Software Foundation, Inc"
  },
  {
    "path": "test/gensalt-bcrypt_x.c",
    "chars": 1479,
    "preview": "/* Copyright (C) 2025 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribution and use in source and binary forms, "
  },
  {
    "path": "test/gensalt-extradata.c",
    "chars": 8025,
    "preview": "/* Test that the prefix argument to crypt_gensalt affects only the\n   choice of hashing method, not any of the parameter"
  },
  {
    "path": "test/gensalt-nested-call.c",
    "chars": 2933,
    "preview": "/*\n * Copyright (c) 2025 Björn Esser <besser82 at fedoraproject.org>\n * All rights reserved.\n *\n * Permission to use, co"
  },
  {
    "path": "test/gensalt-nthash.c",
    "chars": 1842,
    "preview": "/* Copyright (C) 2018 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribution and use in source and binary forms, "
  },
  {
    "path": "test/gensalt.c",
    "chars": 18219,
    "preview": "#include \"crypt-port.h\"\n\n#include <errno.h>\n#include <stdio.h>\n#include <stdlib.h>\n\nstatic const char *const entropy[] ="
  },
  {
    "path": "test/getrandom-fallbacks.c",
    "chars": 7406,
    "preview": "/* Test the fallback logic in get_random_bytes.\n\n   Written by Zack Weinberg <zackw at panix.com> in 2018.\n   To the ext"
  },
  {
    "path": "test/getrandom-interface.c",
    "chars": 5673,
    "preview": "/* Test the exposed interface of get_random_bytes.\n\n   Written by Zack Weinberg <zackw at panix.com> in 2018.\n   To the "
  },
  {
    "path": "test/ka-table-gen.py",
    "chars": 37034,
    "preview": "#! /usr/bin/python3\n# Compute test cases for ka-* tests.\n#\n# Written by Zack Weinberg <zackw at panix.com> in 2019.\n# To"
  },
  {
    "path": "test/ka-table.inc",
    "chars": 746782,
    "preview": "/* Known-answer tests for passphrase hashes.  -*- mode: c -*-\n   Automatically generated by ka-table-gen.py.\n   Do not e"
  },
  {
    "path": "test/ka-tester.c",
    "chars": 6990,
    "preview": "/* Test crypt() API with \"known answer\" hashes.\n\n   Written by Zack Weinberg <zackw at panix.com> in 2019.\n   To the ext"
  },
  {
    "path": "test/preferred-method.c",
    "chars": 4103,
    "preview": "/* Copyright (C) 2018 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribution and use in source and binary forms, "
  },
  {
    "path": "test/short-outbuf.c",
    "chars": 3086,
    "preview": "/* Copyright (C) 2018 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribution and use in source and binary forms, "
  },
  {
    "path": "test/special-char-salt.c",
    "chars": 92312,
    "preview": "/* Copyright (C) 2020-2021 Björn Esser <besser82@fedoraproject.org>\n *\n * Redistribution and use in source and binary fo"
  },
  {
    "path": "test/symbols-compat.pl",
    "chars": 4176,
    "preview": "#! /usr/bin/perl\n# Written by Zack Weinberg <zackw at panix.com> in 2017 and 2020.\n# To the extent possible under law, Z"
  },
  {
    "path": "test/symbols-renames.pl",
    "chars": 2802,
    "preview": "#! /usr/bin/perl\n# Written by Zack Weinberg <zackw at panix.com> in 2017 and 2020.\n# To the extent possible under law, Z"
  },
  {
    "path": "test/symbols-static.pl",
    "chars": 2539,
    "preview": "#! /usr/bin/perl\n# Written by Zack Weinberg <zackw at panix.com> in 2017 and 2020.\n# To the extent possible under law, Z"
  }
]

About this extraction

This page contains the full source code of the besser82/libxcrypt GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 173 files (2.2 MB), approximately 582.0k tokens, and a symbol index with 489 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!