leopard-codec

Implementation of Reed-Solomon codes using leopard algorithm

1 unstable release

0.1.0 Apr 15, 2024

#722 in Encoding

Download history 4141/week @ 2024-07-27 3319/week @ 2024-08-03 4969/week @ 2024-08-10 4803/week @ 2024-08-17 2948/week @ 2024-08-24 3590/week @ 2024-08-31 4157/week @ 2024-09-07 3681/week @ 2024-09-14 3717/week @ 2024-09-21 4119/week @ 2024-09-28 4432/week @ 2024-10-05 3784/week @ 2024-10-12 3463/week @ 2024-10-19 7488/week @ 2024-10-26 5671/week @ 2024-11-02 5429/week @ 2024-11-09

23,093 downloads per month
Used in 5 crates (via celestia-types)

Apache-2.0

345KB
846 lines

Leopard codec

This is a Rust rewrite of a Go O(n*log n) implementation of Reed-Solomon codes, ported from the klauspost/reedsolomon, which is a port of the C++ library catid/leopard.

The original implementation is based on the paper:

S.-J. Lin, T. Y. Al-Naffouri, Y. S. Han, and W.-H. Chung,

"Novel Polynomial Basis with Fast Fourier Transform and Its Application to Reed-Solomon Erasure Codes"

IEEE Trans. on Information Theory, pp. 6284-6299, November, 2016.

Features support

The leopard algorithm uses either 8-bit or 16-bit Galois fields with Cantor basis. The 8-bit implementation should be used with up to 256 total shards and 16-bit when more shards are needed.

  • Encoding parity shards using 8-bit leopard algorithm
  • Reconstructing shards using 8-bit leopard algorithm
  • Encoding parity shards using 16-bit leopard algorithm
  • Reconstructing shards using 16-bit leopard algorithm

Dependencies

~0.4–0.9MB
~19K SLoC