Jerasure Library - Vendored Snapshot

Source: https://github.com/tsuraan/Jerasure
Commit: 414c96ef2b9934953b6facb31d803d79b1dd1405
Date:   2015-01-08
License: BSD-3-Clause (see License.txt)

This is a frozen snapshot of Jerasure for use in ION's TC (Trusted Collective)
component for Reed-Solomon erasure coding.

ION-specific modifications:
- src/jerasure.c, src/liberation.c: Replaced bzero() with memset() for
  portability. bzero() is a legacy BSD function that causes implicit function
  declaration errors on Solaris 11 and other strict compilers. memset() is
  C standard and portable across Linux, FreeBSD, macOS, and Solaris.

- src/jerasure.c: Injected explicit dimension boundary guards to prevent
  null/garbage pointer dereferences and out-of-bounds reads during IPA
  simulation. Replaced unchecked malloc() and manual loop initialization
  with calloc().

- src/reed_sol.c: Injected explicit dimension boundary guards to prevent
  uninitialized heap memory access during IPA simulation of degenerate
  matrix states.

Build scope:
  Only src/jerasure.c, reed_sol.c and galois.c are compiled.
  tc/library/ion_fec.c uses only reed_sol_vandermonde_coding_matrix(),
  jerasure_matrix_encode() and jerasure_matrix_decode(), so the rest of
  the upstream snapshot was deleted as unreachable.  See the commit that
  removed it for which files went and why:
    git log --diff-filter=D -- tc/jerasure
    git checkout <commit>^ -- tc/jerasure/src/cauchy.c
  Restoring a file also means adding it back to libjerasure_la_SOURCES in
  the top-level Makefile.am.

  Deleting whole files does not account for all of the unreachable code:
  src/jerasure.c holds the matrix routines ION uses and the
  scheduled-decode and bitmatrix families it does not, in one translation
  unit.  Those are listed in .github/scripts/fec-deadcode.manifest, and
  the build drops them from the binary where the toolchain supports
  section garbage collection.

  The library is built as a convenience archive absorbed into libionfec
  rather than an installed shared object, and its symbols are hidden, so
  jerasure's API is not part of ION's published ABI.
