Fix lintian warning very-long-line-length-in-source-file (raised by Lintian v2.110.0)

Rationale:
The source file includes a line length that is well beyond the normally human made code line length.
This very long line length does not allow Lintian to do correctly some source file checks.
This line could also be the result of some text injected by a computer program, and thus could lead to FTBFS bugs.
Last but not least, long line in source code could be used to obfuscate the source code and to hide stuff like backdoors or security problems.
This commit is contained in:
Carles Fernandez 2021-10-29 14:26:55 +02:00
parent 0c988c5be3
commit f9911cbc3f
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
14 changed files with 11258 additions and 563 deletions

View File

@ -185,7 +185,95 @@ CheckOptions:
- key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit
value: '16'
- key: bugprone-unused-return-value.CheckedFunctions
value: 'std::async;std::launder;std::remove;std::remove_if;std::unique;std::unique_ptr::release;std::basic_string::empty;std::vector::empty;std::back_inserter;std::distance;std::find;std::find_if;std::inserter;std::lower_bound;std::make_pair;std::map::count;std::map::find;std::map::lower_bound;std::multimap::equal_range;std::multimap::upper_bound;std::set::count;std::set::find;std::setfill;std::setprecision;std::setw;std::upper_bound;std::vector::at;::bsearch;::ferror;::feof;::isalnum;::isalpha;::isblank;::iscntrl;::isdigit;::isgraph;::islower;::isprint;::ispunct;::isspace;::isupper;::iswalnum;::iswprint;::iswspace;::isxdigit;::memchr;::memcmp;::strcmp;::strcoll;::strncmp;::strpbrk;::strrchr;::strspn;::strstr;::wcscmp;::access;::bind;::connect;::difftime;::dlsym;::fnmatch;::getaddrinfo;::getopt;::htonl;::htons;::iconv_open;::inet_addr;::isascii;::isatty;::mmap;::newlocale;::openat;::pathconf;::pthread_equal;::pthread_getspecific;::pthread_mutex_trylock;::readdir;::readlink;::recvmsg;::regexec;::scandir;::semget;::setjmp;::shm_open;::shmget;::sigismember;::strcasecmp;::strsignal;::ttyname'
value: 'std::async;
std::launder;
std::remove;
std::remove_if;
std::unique;
std::unique_ptr::release;
std::basic_string::empty;
std::vector::empty;
std::back_inserter;
std::distance;
std::find;
std::find_if;
std::inserter;
std::lower_bound;
std::make_pair;
std::map::count;
std::map::find;
std::map::lower_bound;
std::multimap::equal_range;
std::multimap::upper_bound;
std::set::count;
std::set::find;
std::setfill;
std::setprecision;
std::setw;
std::upper_bound;
std::vector::at;
::bsearch;
::ferror;
::feof;
::isalnum;
::isalpha;
::isblank;
::iscntrl;
::isdigit;
::isgraph;
::islower;
::isprint;
::ispunct;
::isspace;
::isupper;
::iswalnum;
::iswprint;
::iswspace;
::isxdigit;
::memchr;
::memcmp;
::strcmp;
::strcoll;
::strncmp;
::strpbrk;
::strrchr;
::strspn;
::strstr;
::wcscmp;
::access;
::bind;
::connect;
::difftime;
::dlsym;
::fnmatch;
::getaddrinfo;
::getopt;
::htonl;
::htons;
::iconv_open;
::inet_addr;
::isascii;
::isatty;
::mmap;
::newlocale;
::openat;
::pathconf;
::pthread_equal;
::pthread_getspecific;
::pthread_mutex_trylock;
::readdir;
::readlink;
::recvmsg;
::regexec;
::scandir;
::semget;
::setjmp;
::shm_open;
::shmget;
::sigismember;
::strcasecmp;
::strsignal;
::ttyname'
- key: cert-dcl16-c.NewSuffixes
value: 'L;LL;LU;LLU'
- key: cert-msc51-cpp.DisallowedSeedTypes

View File

@ -566,12 +566,23 @@ The GPL implies that:
\li The licensed material may be analyzed or modified.
\li Modified material may be distributed under the same licensing terms but <b>do not</b> have to be distributed.
That means that modifications only have to be made available to the public if distribution happens. So it is perfectly fine to take the GNSS-SDR source code, modify it heavily and use it in a not distributed application / library. This is how companies like Google can run their own patched versions of Linux for example.
That means that modifications only have to be made available to the public if
distribution happens. So it is perfectly fine to take the GNSS-SDR source code,
modify it heavily and use it in a not distributed application / library. This is
how companies like Google can run their own patched versions of Linux for
example.
But what this also means is that non-GPL code cannot use GPL code. This means that you cannot modify / use GNSS-SDR, blend it with non-GPL code, and make money with the resulting software. You cannot distribute the resulting software under a non-disclosure agreement or contract. Distributors under the GPL also grant a license for any of their patents practiced by the software, to practice those patents in GPL software. You can sell a device that runs with GNSS-SDR, but if you distribute the code, it has to remain under GPL.
But what this also means is that non-GPL code cannot use GPL code. This means
that you cannot modify / use GNSS-SDR, blend it with non-GPL code, and make
money with the resulting software. You cannot distribute the resulting software
under a non-disclosure agreement or contract. Distributors under the GPL also
grant a license for any of their patents practiced by the software, to practice
those patents in GPL software. You can sell a device that runs with GNSS-SDR,
but if you distribute the code, it has to remain under GPL.
\section publications Publications and Credits
If you use GNSS-SDR to produce a research paper or Thesis, we would appreciate if you reference any of these articles to credit the GNSS-SDR project:
If you use GNSS-SDR to produce a research paper or Thesis, we would appreciate
if you reference any of these articles to credit the GNSS-SDR project:
\li \anchor Navitec2012 C. Fern&aacute;ndez-Prades, J. Arribas, L. Esteve, D. Pubill, P. Closas, <a href="http://www.cttc.es/publication/an-open-source-galileo-e1-software-receiver/" target="_blank"><i>An Open Source Galileo E1 Software Receiver</i></a>, in Proc. of the 6th ESA Workshop on Satellite Navigation Technologies (NAVITEC 2012), ESTEC, Noordwijk, The Netherlands, Dec. 2012.
\li J. Arribas, <a href="https://theses.eurasip.org/theses/449/gnss-array-based-acquisition-theory-and/" target="_blank"><i>GNSS Array-based Acquisition: Theory and Implementation</i></a>, PhD Thesis, Universitat Polit&egrave;cnica de Catalunya, Barcelona, Spain, June 2012.

View File

@ -61,13 +61,38 @@ China Satellite Navigation Office, December 2016.
\subsection sbas Satellite Based Augmentation Systems (SBAS)
\li <b>Minimum Operational Performance Standards for Global Positioning System/Wide Area Augmentation System Airborne Equipment, DO-229D</b>, RTCA, Washington, DC, Dec. 13, 2006. The 'RTCA MOPS DO229D - appendix A' is the reference standard for WAAS/EGNOS application development. RTCA is an advisory committee of the US federal government, and issues standards for civil airborne equipment, among other duties. One such standard is MOPS 229D (Minimum Operational Performance Standards for Global Positioning System/Wide Area Augmentation System Airborne Equipment version D), which describes the implementation of satellite-based augmentation services (SBAS) for receivers designed for civil aviation use. An annex to DO229D contains the specifications for the SBAS signal and message. The RTCA provides regular updates to these standards. MOPS 229D is available for a fee from the <a href="https://my.rtca.org/nc__store?search=229D" target="_blank">RTCA website</a>.
\li <b>Minimum Operational Performance Standards for Global Positioning System/Wide Area Augmentation System Airborne Equipment, DO-229D</b>, RTCA, Washington, DC, Dec. 13, 2006.
The 'RTCA MOPS DO229D - appendix A' is the reference standard for WAAS/EGNOS
application development. RTCA is an advisory committee of the US federal
government, and issues standards for civil airborne equipment, among other
duties. One such standard is MOPS 229D (Minimum Operational Performance
Standards for Global Positioning System/Wide Area Augmentation System Airborne
Equipment version D), which describes the implementation of satellite-based
augmentation services (SBAS) for receivers designed for civil aviation use. An
annex to DO229D contains the specifications for the SBAS signal and message. The
RTCA provides regular updates to these standards. MOPS 229D is available for a
fee from the <a href="https://my.rtca.org/nc__store?search=229D"
target="_blank">RTCA website</a>.
\li <a href="https://www.gps.gov/technical/ps/2008-WAAS-performance-standard.pdf" target="_blank"><b>Global Positioning System Wide Area Augmentation System (WAAS) Performance Standard, 1st Edition</b></a>, Department of Transportation and Federal Aviation Administration, Oct. 31, 2008. This document defines the levels of performance the U.S. Government makes available to users of the GPS SPS augmented by the Wide Area Augmentation System.
\li <a href="https://www.gps.gov/technical/ps/2008-WAAS-performance-standard.pdf" target="_blank"><b>Global Positioning System Wide Area Augmentation System (WAAS) Performance Standard, 1st Edition</b></a>,
Department of Transportation and Federal Aviation Administration, Oct. 31, 2008.
This document defines the levels of performance the U.S. Government makes available to users of the GPS SPS augmented by the Wide Area Augmentation System.
\li <a href="https://egnos-user-support.essp-sas.eu/new_egnos_ops/documents/egnos-sdd/egnos-data-access-service-sdd" target="_blank"><b>EGNOS Data Access Service (EDAS) Service Definition Document. Revision 2.2</b></a>, European GNSS Agency (GSA), June, 2019. This is a complementary document to the RTCA DO229D, mentioned above. It describes the scope of services provided by the EGNOS EDAS Service to be used by end-users or Application Specific Service Providers. It details the general conditions relating to the use of the EGNOS service, a technical description of the Signal-in-Space (SIS), the reference receiver, environmental conditions, the service performance achieved and aspects relating to service provision.
\li <a href="https://egnos-user-support.essp-sas.eu/new_egnos_ops/documents/egnos-sdd/egnos-data-access-service-sdd" target="_blank"><b>EGNOS Data Access Service (EDAS) Service Definition Document. Revision 2.2</b></a>, European GNSS Agency (GSA), June, 2019.
This is a complementary document to the RTCA DO229D, mentioned above. It
describes the scope of services provided by the EGNOS EDAS Service to be used by
end-users or Application Specific Service Providers. It details the general
conditions relating to the use of the EGNOS service, a technical description of
the Signal-in-Space (SIS), the reference receiver, environmental conditions, the
service performance achieved and aspects relating to service provision.
\li <a href="https://egnos-user-support.essp-sas.eu/new_egnos_ops/documents/egnos-sdd/egnos-safety-life-service-sdd" target="_blank"><b>EGNOS Safety of Life Service Definition Document. Revision 3.3</b></a>, European GNSS Agency (GSA), Mar, 2019. The EGNOS Safety of Life (SoL) Service is provided openly and is freely accessible without any direct charge and is tailored to safety-critical transport applications in various domains, in particular for aviation applications. The service is thus compliant with the aviation APV-I (Approach with Vertical Guidance) requirements, as defined by ICAO in Annex 10, but may support also applications in other SoL domains.
\li <a href="https://egnos-user-support.essp-sas.eu/new_egnos_ops/documents/egnos-sdd/egnos-safety-life-service-sdd" target="_blank"><b>EGNOS Safety of Life Service Definition Document. Revision 3.3</b></a>, European GNSS Agency (GSA), Mar, 2019.
The EGNOS Safety of Life (SoL) Service is provided openly and is freely
accessible without any direct charge and is tailored to safety-critical
transport applications in various domains, in particular for aviation
applications. The service is thus compliant with the aviation APV-I (Approach
with Vertical Guidance) requirements, as defined by ICAO in Annex 10, but may
support also applications in other SoL domains.
\li <a href="https://egnos-user-support.essp-sas.eu/new_egnos_ops/documents/egnos-sdd/egnos-open-service-sdd" target="_blank"><b>EGNOS Open Service Service Definition Document. Revision 2.3</b></a>, European GNSS Agency (GSA), Sep., 2017.
@ -75,13 +100,19 @@ More information about EGNOS can be found through the <a href="https://egnos-use
\section standards Other Standards
\subsection rinex RINEX
The final output of a navigation receiver is usually its position, speed or other related physical quantities. However, the calculation of those quantities
are based on a series of measurements from one or more satellite constellations. Although receivers calculate positions in real time, in many cases it is
interesting to store intermediate measures for later post-processing. RINEX is the standard format that allows the management and disposal of the measures
generated by a receiver, as well as their off-line processing by a multitude of applications.
The final output of a navigation receiver is usually its position, speed or
other related physical quantities. However, the calculation of those quantities
are based on a series of measurements from one or more satellite constellations.
Although receivers calculate positions in real time, in many cases it is
interesting to store intermediate measures for later post-processing. RINEX is
the standard format that allows the management and disposal of the measures
generated by a receiver, as well as their off-line processing by a multitude of
applications.
\li The most common version at present is <a href="hftp://igs.org/pub/data/format/rinex212.txt" target="_blank"><b>RINEX: The Receiver Independent Exchange Format Version 2.12</b></a>, which enables storage of measurements from pseudorange, carrier-phase and Doppler systems for GPS, GLONASS, Galileo
along with data from EGNOS and WAAS satellite based augmentation systems (SBAS).
\li The most common version at present is <a href="hftp://igs.org/pub/data/format/rinex212.txt" target="_blank"><b>RINEX: The Receiver Independent Exchange Format Version 2.12</b></a>,
which enables storage of measurements from pseudorange, carrier-phase and Doppler systems for GPS,
GLONASS, Galileo along with data from EGNOS and WAAS satellite based
augmentation systems (SBAS).
\li The most recent version is <a href="ftp://igs.org/pub/data/format/rinex303.pdf" target="_blank"><b>RINEX: The Receiver Independent Exchange Format Version 3.03</b></a> published in July, 2015.
It includes Galileo and improves the handling of multi-constellation data files.
@ -90,34 +121,80 @@ It includes Galileo and improves the handling of multi-constellation data files.
\subsection nmea NMEA
The <a href="https://www.nmea.org/" target="_blank">National Marine Electronics Association </a> released the NMEA 0183 Interface Standard, which defines electrical signal requirements, data transmission protocol and time,
and specific sentence formats for a 4800-baud serial data bus. The standard is <a href="https://www.nmea.org/content/STANDARDS/NMEA_0183_Standard" target="_blank">available for purchase</a>.
The <a href="https://www.nmea.org/" target="_blank">National Marine Electronics Association</a>
released the NMEA 0183 Interface Standard, which defines electrical signal requirements, data transmission protocol and time,
and specific sentence formats for a 4800-baud serial data bus.
The standard is <a href="https://www.nmea.org/content/STANDARDS/NMEA_0183_Standard" target="_blank">available for purchase</a>.
\subsection kml KML
KML is an XML language focused on geographic visualization, including annotation of maps and images. Geographic visualization includes not only the presentation of graphical data on the globe, but also the control of the user's navigation in the sense of where to go and where to look.
Google submitted KML (formerly Keyhole Markup Language) to the Open Geospatial Consortium (OGC) to be evolved within the OGC consensus process with the following goal: KML Version 2.2 has been adopted as an OGC implementation standard.
KML is an XML language focused on geographic visualization, including annotation
of maps and images. Geographic visualization includes not only the presentation
of graphical data on the globe, but also the control of the user's navigation in
the sense of where to go and where to look. Google submitted KML (formerly
Keyhole Markup Language) to the Open Geospatial Consortium (OGC) to be evolved
within the OGC consensus process with the following goal: KML Version 2.2 has
been adopted as an OGC implementation standard.
\li Open Geospatial Consortium, Inc., <a href="https://portal.opengeospatial.org/files/?artifact_id=27810" target="_blank"><b>OGC KML Version 2.2.0</b></a>, April 2008.
\subsection cxx C++ Standards
The C++ programming language is standardized by the International Organization for Standardization (ISO), with the latest standard version ratified and published by ISO in December 2017 as ISO/IEC 14882:2017 (informally known as C++17). The list of supported C++ standards (the highest available is automatically selected by the CMake script):
The C++ programming language is standardized by the International Organization
for Standardization (ISO), with the latest standard version ratified and
published by ISO in December 2017 as ISO/IEC 14882:2017 (informally known as
C++17). The list of supported C++ standards (the highest available is
automatically selected by the CMake script):
<ul>
<li><strong>Draft C++23</strong>: Check the <a href="https://github.com/cplusplus/draft" target="_blank">C++ standard draft sources at GitHub</a>.</li>
<li><strong>C++20</strong>: The current ISO C++ standard is officially known as <em>ISO International Standard ISO/IEC 14882:2020(E) Programming languages C++</em>. You can get it from <a href="https://www.iso.org/standard/79358.html" target="_blank">ISO</a>, <a href="https://webstore.iec.ch/publication/68285" target="_blank">IEC</a> or <a href="https://webstore.ansi.org/Standards/ISO/ISOIEC148822020" target="_blank">ANSI</a>. The closest free working document available is <a href="https://github.com/cplusplus/draft/releases/download/n4868/n4868.pdf" target="_blank">N4868</a>.</li>
<li><strong>C++17</strong>: A former ISO C++ standard was officially known as <em>ISO International Standard ISO/IEC 14882:2017 Programming languages C++</em>. You can get it from <a href="https://www.iso.org/standard/68564.html" target="_blank">ISO</a>, <a href="https://webstore.iec.ch/publication/62162" target="_blank">IEC</a> or <a href="https://webstore.ansi.org/Standards/ISO/ISOIEC148822017" target="_blank">ANSI</a>. The closest free working document available is <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf" target="_blank">N4659</a>.</li>
<li><strong>C++14</strong>: A former ISO C++ standard was officially known as <em>ISO International Standard ISO/IEC 14882:2014 Programming languages C++</em>. You can get it from <a href="https://www.iso.org/standard/64029.html" target="_blank">ISO</a> or <a href="https://webstore.ansi.org/RecordDetail.aspx?sku=INCITS/ISO/IEC+14882:2014+(2016)" target="_blank">ANSI</a>. The closest free working document available is <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf" target="_blank">N4296</a>.</li>
<li><strong>C++11</strong>: An older ISO C++ standard was ISO/IEC 14882:2011. You can get it from <a href="https://www.iso.org/standard/50372.html" target="_blank">ISO</a>. The closest free working document available is <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf" target="_blank">N3337</a>.</li>
<li><strong>C++20</strong>: The current ISO C++ standard is officially known as <em>ISO International Standard ISO/IEC 14882:2020(E) Programming languages C++</em>.
You can get it from <a href="https://www.iso.org/standard/79358.html"
target="_blank">ISO</a>, <a
href="https://webstore.iec.ch/publication/68285" target="_blank">IEC</a>
or <a href="https://webstore.ansi.org/Standards/ISO/ISOIEC148822020"
target="_blank">ANSI</a>. The closest free working document available is
<a
href="https://github.com/cplusplus/draft/releases/download/n4868/n4868.pdf"
target="_blank">N4868</a>.</li>
<li><strong>C++17</strong>: A former ISO C++ standard was officially known as <em>ISO International Standard ISO/IEC 14882:2017 Programming languages C++</em>.
You can get it from <a href="https://www.iso.org/standard/68564.html"
target="_blank">ISO</a>, <a
href="https://webstore.iec.ch/publication/62162" target="_blank">IEC</a>
or <a href="https://webstore.ansi.org/Standards/ISO/ISOIEC148822017"
target="_blank">ANSI</a>. The closest free working document available is
<a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf"
target="_blank">N4659</a>.</li>
<li><strong>C++14</strong>: A former ISO C++ standard was officially known as <em>ISO International Standard ISO/IEC 14882:2014 Programming languages C++</em>.
You can get it from <a href="https://www.iso.org/standard/64029.html"
target="_blank">ISO</a> or <a
href="https://webstore.ansi.org/RecordDetail.aspx?sku=INCITS/ISO/IEC+14882:2014+(2016)"
target="_blank">ANSI</a>. The closest free working document available is
<a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf"
target="_blank">N4296</a>.</li>
<li><strong>C++11</strong>: An older ISO C++ standard was ISO/IEC 14882:2011.
You can get it from <a href="https://www.iso.org/standard/50372.html"
target="_blank">ISO</a>. The closest free working document available is <a
href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf"
target="_blank">N3337</a>.</li>
</ul>
\subsection protocols Positioning protocols in wireless communication networks
Cellular industry location standards first appeared in the late 1990s, with the <a href="https://www.3gpp.org/index.php" target="_blank">3rd generation partnership project (3GPP)</a> radio resource location services protocol (RRLP) technical specification 44.031 positioning protocol for GSM networks.
Today, RRLP is the de facto standardized protocol to carry GNSS assistance data to GNSS-enabled mobile devices, and the term "3GPP specification" now covers all GSM (including GPRS and EDGE),
W-CDMA and LTE (including LTE-A) specifications. Precisely, the label "LTE-A" is applied to networks compliant with LTE Release 10 and beyond, which fulfill the requirements issued by
the <a href="https://www.itu.int/en/ITU-R/Pages/default.aspx target="_blank">International Telecommunication Union Radiocommunication Sector (ITU-R)</a> in the global standard for international mobile telecommunications (IMT Advanced, also referred to as 4G)
access technologies.
Cellular industry location standards first appeared in the late 1990s, with the
<a href="https://www.3gpp.org/index.php" target="_blank">3rd generation partnership project (3GPP)</a>
radio resource location services protocol (RRLP)
technical specification 44.031 positioning protocol for GSM networks. Today,
RRLP is the de facto standardized protocol to carry GNSS assistance data to
GNSS-enabled mobile devices, and the term "3GPP specification" now covers all
GSM (including GPRS and EDGE), W-CDMA and LTE (including LTE-A) specifications.
Precisely, the label "LTE-A" is applied to networks compliant with LTE Release
10 and beyond, which fulfill the requirements issued by the
<a href="https://www.itu.int/en/ITU-R/Pages/default.aspx target="_blank">International Telecommunication Union Radiocommunication Sector (ITU-R)</a>
in the global standard for international mobile telecommunications
(IMT Advanced, also referred to as 4G) access technologies.
Control plane protocols:
@ -132,9 +209,12 @@ User plane protocols:
LTE Release 9 introduced extension hooks in LPP messages, so that the bodies external to 3GPP could extend the LPP feature set. OMA LPP extensions (LPPe), supported in SUPL 3.0, build on top of the 3GPP LPP reusing its procedures and data types.
Check the <a href="http://openmobilealliance.org/wp/index.html" target="_blank">OMA Specifications webpage</a> for updated information about LPP Extensions (LPPe) Specification.
\li The <a href="http://member.openmobilealliance.org/ftp/Public_documents/loc/Permanent_documents/OMA-TS-MLP-V3_5-20181119-D.zip" target="_blank"><b>OMA Mobile Location Protocol (MLP) V3.5</b></a> is an application-level protocol for getting the position of mobile stations (mobile phones, wireless personal digital assistants, etc.) independent
of underlying network technology. The MLP serves as the interface between a Location Server and a Location Services (LCS) Client.
This specification defines the core set of operations that a Location Server should be able to perform.
\li The <a href="http://member.openmobilealliance.org/ftp/Public_documents/loc/Permanent_documents/OMA-TS-MLP-V3_5-20181119-D.zip" target="_blank"><b>OMA Mobile Location Protocol (MLP) V3.5</b></a>
is an application-level protocol for getting the position of mobile stations
(mobile phones, wireless personal digital assistants, etc.) independent of
underlying network technology. The MLP serves as the interface between a
Location Server and a Location Services (LCS) Client. This specification defines
the core set of operations that a Location Server should be able to perform.
*/

View File

@ -8,11 +8,28 @@
.SH SYNOPSIS
\fBvolk_gnsssdr_profile\fR [OPTION]
.SH DESCRIPTION
The Vector-Optimized Library of Kernels of GNSS-SDR (VOLK_GNSSSDR) is a software library that provides developers with an interface to use Single Input - Multiple Data (SIMD) instructions, which are of special interest for operations that are in the receiver's critical path of the processing load.
The Vector-Optimized Library of Kernels of GNSS-SDR (VOLK_GNSSSDR) is a software
library that provides developers with an interface to use Single Input -
Multiple Data (SIMD) instructions, which are of special interest for operations
that are in the receiver's critical path of the processing load.
.TP
Processors providing SIMD instruction sets compute with multiple processing elements that perform the same operation on multiple data points simultaneously, thus exploiting data-level parallelism, an can be found in most modern desktop and laptop personal computers. In a nutshell, VOLK_GNSSSDR implements in assembly language optimized versions of computationally-intensive operations for different processor architectures that are commonly found in modern computers. In order to use the most optimized version for the specific processor(s) of the host machine running the software receiver (that is, the implementation than runs the fastest).
Processors providing SIMD instruction sets compute with multiple processing
elements that perform the same operation on multiple data points simultaneously,
thus exploiting data-level parallelism, an can be found in most modern desktop
and laptop personal computers. In a nutshell, VOLK_GNSSSDR implements in
assembly language optimized versions of computationally-intensive operations for
different processor architectures that are commonly found in modern computers.
In order to use the most optimized version for the specific processor(s) of the
host machine running the software receiver (that is, the implementation than
runs the fastest).
.TP
\fBvolk_gnsssdr_profile\fR is a program that tests all known VOLK_GNSSSDR kernels (that is, basic processing components like adders, multipliers, correlators, and much more) for each architecture supported by the host machine, measuring their performance. When finished, the profiler writes to $HOME/.volk_gnsssdr/volk_gnsssdr_config the best architecture for each VOLK_GSSSDR function. This file is read when using a function to know the best version to execute.
\fBvolk_gnsssdr_profile\fR is a program that tests all known VOLK_GNSSSDR
kernels (that is, basic processing components like adders, multipliers,
correlators, and much more) for each architecture supported by the host machine,
measuring their performance. When finished, the profiler writes to
$HOME/.volk_gnsssdr/volk_gnsssdr_config the best architecture for each
VOLK_GSSSDR function. This file is read when using a function to know the best
version to execute.
.SH OPTIONS
\fBvolk_gnsssdr_profile\fR takes the following options:
.TP
@ -38,7 +55,10 @@ Processors providing SIMD instruction sets compute with multiple processing elem
\.TP
Check https://gnss\-sdr.org for more information.
.SH HISTORY
This library was originally developed by Andres Cecilia Luque in the framework of the Summer of Code in Space program (SOCIS 2014) by the European Space Agency (ESA), and then integrated into \fBgnss-sdr\fR. This software is based on the VOLK library https://www.libvolk.org/
This library was originally developed by Andres Cecilia Luque in the framework
of the Summer of Code in Space program (SOCIS 2014) by the European Space Agency
(ESA), and then integrated into \fBgnss-sdr\fR. This software is based on the
VOLK library https://www.libvolk.org/
.SH BUGS
No known bugs.
.SH AUTHOR

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -291,7 +291,23 @@ ReedSolomon::ReedSolomon(const std::string& gnss_signal)
{244, 120, 86, 42, 110, 203, 209, 158, 119, 115, 207, 5, 104, 140, 138, 113, 25, 153, 59, 171, 105, 67, 136, 70, 30, 10, 203, 80, 13, 200, 172, 216},
{116, 64, 52, 174, 54, 126, 16, 194, 162, 33, 33, 157, 176, 197, 225, 12, 59, 55, 253, 228, 148, 47, 179, 185, 24, 138, 253, 20, 142, 55, 172, 88}};
d_genpoly_coeff = {88, 216, 195, 23, 111, 82, 79, 81, 62, 120, 249, 250, 11, 134, 209, 116, 69, 170, 208, 45, 249, 223, 4, 19, 120, 81, 182, 217, 44, 65, 93, 34, 118, 227, 112, 28, 65, 48, 244, 165, 242, 216, 121, 50, 171, 32, 217, 166, 133, 134, 4, 120, 54, 42, 13, 24, 95, 228, 173, 247, 80, 42, 89, 68, 81, 181, 112, 51, 118, 108, 243, 223, 18, 38, 230, 1, 28, 109, 131, 14, 234, 151, 21, 108, 7, 176, 236, 147, 175, 183, 66, 35, 178, 243, 36, 115, 255, 51, 36, 6, 120, 163, 59, 9, 214, 102, 109, 253, 152, 137, 1, 144, 124, 241, 143, 71, 91, 227, 28, 174, 13, 157, 78, 20, 192, 64, 130, 45, 39, 46, 229, 171, 193, 252, 43, 165, 88, 180, 179, 183, 88, 99, 219, 52, 210, 33, 160, 146, 22, 255, 111, 159, 7, 237, 145, 194, 68, 89, 231, 201, 224, 127, 5, 27, 112, 71, 165, 204, 236, 122, 119, 49, 212, 216, 151, 149, 53, 249, 57, 136, 85, 14, 19, 128, 135, 177, 179, 189, 164, 98, 220, 99, 241, 230, 188, 170, 148, 97, 121, 31, 253, 134, 43, 199, 81, 137, 82, 54, 47, 216, 172, 169, 123, 246, 153, 169, 32, 86, 128, 83, 5, 252, 251, 1};
d_genpoly_coeff = {88, 216, 195, 23, 111, 82, 79, 81, 62, 120, 249,
250, 11, 134, 209, 116, 69, 170, 208, 45, 249, 223, 4, 19, 120,
81, 182, 217, 44, 65, 93, 34, 118, 227, 112, 28, 65, 48, 244,
165, 242, 216, 121, 50, 171, 32, 217, 166, 133, 134, 4, 120, 54,
42, 13, 24, 95, 228, 173, 247, 80, 42, 89, 68, 81, 181, 112, 51,
118, 108, 243, 223, 18, 38, 230, 1, 28, 109, 131, 14, 234, 151,
21, 108, 7, 176, 236, 147, 175, 183, 66, 35, 178, 243, 36, 115,
255, 51, 36, 6, 120, 163, 59, 9, 214, 102, 109, 253, 152, 137,
1, 144, 124, 241, 143, 71, 91, 227, 28, 174, 13, 157, 78, 20,
192, 64, 130, 45, 39, 46, 229, 171, 193, 252, 43, 165, 88, 180,
179, 183, 88, 99, 219, 52, 210, 33, 160, 146, 22, 255, 111, 159,
7, 237, 145, 194, 68, 89, 231, 201, 224, 127, 5, 27, 112, 71,
165, 204, 236, 122, 119, 49, 212, 216, 151, 149, 53, 249, 57,
136, 85, 14, 19, 128, 135, 177, 179, 189, 164, 98, 220, 99, 241,
230, 188, 170, 148, 97, 121, 31, 253, 134, 43, 199, 81, 137, 82,
54, 47, 216, 172, 169, 123, 246, 153, 169, 32, 86, 128, 83, 5,
252, 251, 1};
}
else if (gnss_signal == "E1B")
{
@ -438,7 +454,23 @@ ReedSolomon::ReedSolomon(const std::string& gnss_signal)
d_shortening = 0; // shortening parameter
d_rows_G = 0;
d_columns_G = 0;
d_genpoly_coeff = {88, 216, 195, 23, 111, 82, 79, 81, 62, 120, 249, 250, 11, 134, 209, 116, 69, 170, 208, 45, 249, 223, 4, 19, 120, 81, 182, 217, 44, 65, 93, 34, 118, 227, 112, 28, 65, 48, 244, 165, 242, 216, 121, 50, 171, 32, 217, 166, 133, 134, 4, 120, 54, 42, 13, 24, 95, 228, 173, 247, 80, 42, 89, 68, 81, 181, 112, 51, 118, 108, 243, 223, 18, 38, 230, 1, 28, 109, 131, 14, 234, 151, 21, 108, 7, 176, 236, 147, 175, 183, 66, 35, 178, 243, 36, 115, 255, 51, 36, 6, 120, 163, 59, 9, 214, 102, 109, 253, 152, 137, 1, 144, 124, 241, 143, 71, 91, 227, 28, 174, 13, 157, 78, 20, 192, 64, 130, 45, 39, 46, 229, 171, 193, 252, 43, 165, 88, 180, 179, 183, 88, 99, 219, 52, 210, 33, 160, 146, 22, 255, 111, 159, 7, 237, 145, 194, 68, 89, 231, 201, 224, 127, 5, 27, 112, 71, 165, 204, 236, 122, 119, 49, 212, 216, 151, 149, 53, 249, 57, 136, 85, 14, 19, 128, 135, 177, 179, 189, 164, 98, 220, 99, 241, 230, 188, 170, 148, 97, 121, 31, 253, 134, 43, 199, 81, 137, 82, 54, 47, 216, 172, 169, 123, 246, 153, 169, 32, 86, 128, 83, 5, 252, 251, 1};
d_genpoly_coeff = {88, 216, 195, 23, 111, 82, 79, 81, 62, 120, 249,
250, 11, 134, 209, 116, 69, 170, 208, 45, 249, 223, 4, 19, 120,
81, 182, 217, 44, 65, 93, 34, 118, 227, 112, 28, 65, 48, 244,
165, 242, 216, 121, 50, 171, 32, 217, 166, 133, 134, 4, 120, 54,
42, 13, 24, 95, 228, 173, 247, 80, 42, 89, 68, 81, 181, 112, 51,
118, 108, 243, 223, 18, 38, 230, 1, 28, 109, 131, 14, 234, 151,
21, 108, 7, 176, 236, 147, 175, 183, 66, 35, 178, 243, 36, 115,
255, 51, 36, 6, 120, 163, 59, 9, 214, 102, 109, 253, 152, 137,
1, 144, 124, 241, 143, 71, 91, 227, 28, 174, 13, 157, 78, 20,
192, 64, 130, 45, 39, 46, 229, 171, 193, 252, 43, 165, 88, 180,
179, 183, 88, 99, 219, 52, 210, 33, 160, 146, 22, 255, 111, 159,
7, 237, 145, 194, 68, 89, 231, 201, 224, 127, 5, 27, 112, 71,
165, 204, 236, 122, 119, 49, 212, 216, 151, 149, 53, 249, 57,
136, 85, 14, 19, 128, 135, 177, 179, 189, 164, 98, 220, 99, 241,
230, 188, 170, 148, 97, 121, 31, 253, 134, 43, 199, 81, 137, 82,
54, 47, 216, 172, 169, 123, 246, 153, 169, 32, 86, 128, 83, 5,
252, 251, 1};
}
d_data_in_block = d_symbols_per_block - d_nroots;

View File

@ -71,7 +71,8 @@ if(NOT benchmark_FOUND)
IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/Release/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_LINK_LIBRARIES "${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>benchmark${CMAKE_STATIC_LIBRARY_SUFFIX};${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>benchmark_main${CMAKE_STATIC_LIBRARY_SUFFIX}"
INTERFACE_LINK_LIBRARIES "${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>benchmark${CMAKE_STATIC_LIBRARY_SUFFIX};
${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/$<$<CONFIG:Debug>:Debug/>$<$<CONFIG:Release>:Release/>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo/>$<$<CONFIG:MinSizeRel>:MinSizeRel/>benchmark_main${CMAKE_STATIC_LIBRARY_SUFFIX}"
)
endif()
set_target_properties(benchmark::benchmark PROPERTIES

View File

@ -23,7 +23,14 @@
void bm_e1b_erasurecorrection_shortened(benchmark::State& state)
{
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
auto rs = std::make_unique<ReedSolomon>(60, 29, 1, 195, 0, 137);
@ -74,7 +81,9 @@ void bm_e1b_erasurecorrection_shortened(benchmark::State& state)
// Delete g_0
for (int i = 58; i < 73; i++)
{
erasure_positions.push_back(i + 137); // erasure position refers to the unshortened code, so we add 137
// erasure position refers to the unshortened code, so we
// add 137
erasure_positions.push_back(i + 137);
}
// Delete g_2
@ -99,7 +108,20 @@ void bm_e1b_erasurecorrection_shortened(benchmark::State& state)
void bm_e1b_erasurecorrection_unshortened(benchmark::State& state)
{
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 238, 77, 12,
72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157,
220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252,
165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25,
164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
auto rs = std::make_unique<ReedSolomon>(60, 29, 1, 195, 0, 137);
@ -150,7 +172,9 @@ void bm_e1b_erasurecorrection_unshortened(benchmark::State& state)
// Delete g_0
for (int i = 58; i < 73; i++)
{
erasure_positions.push_back(i + 137); // erasure position refers to the unshortened code, so we add 137
// erasure position refers to the unshortened code, so we
// add 137
erasure_positions.push_back(i + 137);
}
// Delete g_2
@ -175,10 +199,27 @@ void bm_e1b_erasurecorrection_unshortened(benchmark::State& state)
void bm_e6b_correction(benchmark::State& state)
{
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
128, 245, 87, 150, 58, 192, 66, 130, 179};
std::vector<uint8_t> encoded_input = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
// Introduce t = (n-k)/2 = 111 errors:
for (int i = 0; i < 222; i += 2)
@ -205,10 +246,27 @@ void bm_e6b_correction(benchmark::State& state)
void bm_e6b_erasure(benchmark::State& state)
{
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
128, 245, 87, 150, 58, 192, 66, 130, 179};
std::vector<uint8_t> encoded_input = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
// Introduce 223 erasures:
std::vector<int> erasure_positions;

File diff suppressed because one or more lines are too long

View File

@ -22,8 +22,20 @@
TEST(ReedSolomonE1BTest, EncodeWithPoly)
{
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
67, 199, 215, 162};
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74,
234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14,
197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108,
215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67,
199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49,
104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164,
17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9,
167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137,
242};
auto rs = std::make_unique<ReedSolomon>("E1B");
@ -36,8 +48,20 @@ TEST(ReedSolomonE1BTest, EncodeWithPoly)
TEST(ReedSolomonE1BTest, EncodeWithCustomPoly)
{
// ICD 2.0 Annex F
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
67, 199, 215, 162};
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74,
234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14,
197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108,
215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67,
199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49,
104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164,
17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9,
167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137,
242};
// Instantiate a ReedSolomon object with Galileo E1 (INAV) parameters
const int nroots = 60;
@ -46,7 +70,11 @@ TEST(ReedSolomonE1BTest, EncodeWithCustomPoly)
const int prim = 1;
const int fcr = 195;
const int shortening = 137;
const std::vector<uint8_t> genpoly_coeff = {1, 208, 42, 48, 76, 19, 41, 108, 167, 235, 166, 244, 186, 18, 124, 251, 79, 193, 14, 154, 6, 118, 19, 3, 122, 9, 187, 42, 131, 46, 66, 65, 62, 94, 101, 45, 214, 141, 131, 230, 102, 20, 63, 202, 36, 23, 188, 88, 169, 62, 73, 88, 152, 197, 231, 58, 101, 154, 190, 91, 193};
const std::vector<uint8_t> genpoly_coeff = {1, 208, 42, 48, 76, 19, 41, 108,
167, 235, 166, 244, 186, 18, 124, 251, 79, 193, 14, 154, 6, 118, 19, 3,
122, 9, 187, 42, 131, 46, 66, 65, 62, 94, 101, 45, 214, 141, 131, 230,
102, 20, 63, 202, 36, 23, 188, 88, 169, 62, 73, 88, 152, 197, 231, 58,
101, 154, 190, 91, 193};
auto rs = std::make_unique<ReedSolomon>(nroots, minpoly, prim, fcr, pad, shortening, genpoly_coeff);
@ -59,8 +87,20 @@ TEST(ReedSolomonE1BTest, EncodeWithCustomPoly)
TEST(ReedSolomonE1BTest, EncodeWithMatrix)
{
// ICD 2.0 Annex F
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
67, 199, 215, 162};
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74,
234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14,
197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108,
215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67,
199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49,
104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164,
17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9,
167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137,
242};
auto rs = std::make_unique<ReedSolomon>("E1B");
@ -73,8 +113,20 @@ TEST(ReedSolomonE1BTest, EncodeWithMatrix)
TEST(ReedSolomonE1BTest, EncodeWithCustomMatrix)
{
// ICD 2.0 Annex F
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
67, 199, 215, 162};
const std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74,
234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14,
197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108,
215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67,
199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49,
104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164,
17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9,
167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137,
242};
const int nroots = 60;
const int minpoly = 29;
@ -214,9 +266,20 @@ TEST(ReedSolomonE1BTest, EncodeWithCustomMatrix)
TEST(ReedSolomonE1BTest, DecodeNoErrors)
{
// ICD 2.0 Annex F
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
67, 199, 215, 162};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
// Instantiate a ReedSolomon object with Galileo E1 (INAV) parameters
const int nroots = 60;
@ -240,9 +303,20 @@ TEST(ReedSolomonE1BTest, DecodeNoErrors)
TEST(ReedSolomonE1BTest, Decode30Errors)
{
// ICD 2.0 Annex F
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
67, 199, 215, 162};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
// Introduce 30 non-consecutive errors
for (int i = 0; i < 60; i += 2)
@ -265,9 +339,20 @@ TEST(ReedSolomonE1BTest, Decode30Errors)
TEST(ReedSolomonE1BTest, Decode31Errors)
{
// ICD 2.0 Annex F
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
67, 199, 215, 162};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
// Introduce 31 errors (this should make the decoder to fail)
for (int i = 0; i < 62; i += 2)
@ -286,9 +371,20 @@ TEST(ReedSolomonE1BTest, Decode31Errors)
TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase1)
{
// ICD 2.0 Annex F
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
67, 199, 215, 162};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
std::vector<int> erasure_positions;
erasure_positions.reserve(60); // nroots is the maximum number of erasure positions
@ -340,9 +436,20 @@ TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase1)
TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase2)
{
// ICD 2.0 Annex F
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
67, 199, 215, 162};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
std::vector<int> erasure_positions;
erasure_positions.reserve(60); // nroots is the maximum number of erasure positions
@ -394,9 +501,20 @@ TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase2)
TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase3)
{
// ICD 2.0 Annex F
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
67, 199, 215, 162};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
std::vector<int> erasure_positions;
erasure_positions.reserve(60); // nroots is the maximum number of erasure positions
@ -447,9 +565,20 @@ TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase3)
TEST(ReedSolomonE1BTest, DecodeErasureCorrectionCase4)
{
// ICD 2.0 Annex F
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162};
const std::vector<uint8_t> information_vector = {147, 109, 66, 23, 234, 140,
74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218,
14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139,
108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80,
67, 199, 215, 162};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49, 89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155, 151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51, 147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215, 162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12, 228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104, 98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43, 204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
std::vector<uint8_t> code_vector = {147, 109, 66, 23, 234, 140, 74, 234, 49,
89, 241, 253, 169, 161, 89, 93, 75, 142, 83, 102, 98, 218, 14, 197, 155,
151, 43, 181, 9, 163, 142, 111, 8, 118, 21, 47, 135, 139, 108, 215, 51,
147, 185, 52, 17, 151, 97, 102, 238, 71, 83, 114, 47, 80, 67, 199, 215,
162, 238, 77, 12, 72, 235, 21, 148, 213, 230, 54, 183, 82, 49, 104, 12,
228, 150, 157, 220, 112, 236, 187, 63, 31, 175, 47, 210, 164, 17, 104,
98, 46, 252, 165, 194, 57, 26, 213, 14, 133, 176, 148, 34, 9, 167, 43,
204, 198, 25, 164, 233, 55, 153, 31, 237, 84, 212, 76, 137, 242};
std::vector<int> erasure_positions;
erasure_positions.reserve(60); // nroots is the maximum number of erasure positions

View File

@ -23,11 +23,28 @@
TEST(ReedSolomonE6BTest, EncodeWithGenMatrix)
{
// input vector as defined in Galileo HAS ICD v1.2, Annex D
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179};
// Expected encoded output as defined in Galileo HAS ICD v1.2, Annex D
const std::vector<uint8_t> expected_output = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138,
20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84,
233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70,
96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198,
82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117,
45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71,
250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127,
46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
auto rs = std::make_unique<ReedSolomon>();
std::vector<uint8_t> encoded_output = rs->encode_with_generator_matrix(input);
@ -39,11 +56,28 @@ TEST(ReedSolomonE6BTest, EncodeWithGenMatrix)
TEST(ReedSolomonE6BTest, EncodeWithGenPoly)
{
// input vector as defined in Galileo HAS ICD v1.2, Annex D
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179};
// Expected encoded output as defined in Galileo HAS ICD v1.2, Annex D
const std::vector<uint8_t> expected_output = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138,
20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84,
233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70,
96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198,
82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117,
45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71,
250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127,
46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
auto rs = std::make_unique<ReedSolomon>();
std::vector<uint8_t> encoded_output = rs->encode_with_generator_poly(input);
@ -55,11 +89,28 @@ TEST(ReedSolomonE6BTest, EncodeWithGenPoly)
TEST(ReedSolomonE6BTest, EncodeWithCustomPoly)
{
// input vector as defined in Galileo HAS ICD v1.2, Annex D
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179};
// Expected encoded output as defined in Galileo HAS ICD v1.2, Annex D
const std::vector<uint8_t> expected_output = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138,
20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84,
233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70,
96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198,
82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117,
45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71,
250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127,
46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
const int nroots = 223;
const int minpoly = 29;
@ -67,7 +118,21 @@ TEST(ReedSolomonE6BTest, EncodeWithCustomPoly)
const int fcr = 1;
const int pad = 0;
const int shortening = 0;
const std::vector<uint8_t> genpoly_coeff = {88, 216, 195, 23, 111, 82, 79, 81, 62, 120, 249, 250, 11, 134, 209, 116, 69, 170, 208, 45, 249, 223, 4, 19, 120, 81, 182, 217, 44, 65, 93, 34, 118, 227, 112, 28, 65, 48, 244, 165, 242, 216, 121, 50, 171, 32, 217, 166, 133, 134, 4, 120, 54, 42, 13, 24, 95, 228, 173, 247, 80, 42, 89, 68, 81, 181, 112, 51, 118, 108, 243, 223, 18, 38, 230, 1, 28, 109, 131, 14, 234, 151, 21, 108, 7, 176, 236, 147, 175, 183, 66, 35, 178, 243, 36, 115, 255, 51, 36, 6, 120, 163, 59, 9, 214, 102, 109, 253, 152, 137, 1, 144, 124, 241, 143, 71, 91, 227, 28, 174, 13, 157, 78, 20, 192, 64, 130, 45, 39, 46, 229, 171, 193, 252, 43, 165, 88, 180, 179, 183, 88, 99, 219, 52, 210, 33, 160, 146, 22, 255, 111, 159, 7, 237, 145, 194, 68, 89, 231, 201, 224, 127, 5, 27, 112, 71, 165, 204, 236, 122, 119, 49, 212, 216, 151, 149, 53, 249, 57, 136, 85, 14, 19, 128, 135, 177, 179, 189, 164, 98, 220, 99, 241, 230, 188, 170, 148, 97, 121, 31, 253, 134, 43, 199, 81, 137, 82, 54, 47, 216, 172, 169, 123, 246, 153, 169, 32, 86, 128, 83, 5, 252, 251, 1};
const std::vector<uint8_t> genpoly_coeff = {88, 216, 195, 23, 111, 82, 79,
81, 62, 120, 249, 250, 11, 134, 209, 116, 69, 170, 208, 45, 249, 223, 4,
19, 120, 81, 182, 217, 44, 65, 93, 34, 118, 227, 112, 28, 65, 48, 244,
165, 242, 216, 121, 50, 171, 32, 217, 166, 133, 134, 4, 120, 54, 42, 13,
24, 95, 228, 173, 247, 80, 42, 89, 68, 81, 181, 112, 51, 118, 108, 243,
223, 18, 38, 230, 1, 28, 109, 131, 14, 234, 151, 21, 108, 7, 176, 236,
147, 175, 183, 66, 35, 178, 243, 36, 115, 255, 51, 36, 6, 120, 163, 59,
9, 214, 102, 109, 253, 152, 137, 1, 144, 124, 241, 143, 71, 91, 227, 28,
174, 13, 157, 78, 20, 192, 64, 130, 45, 39, 46, 229, 171, 193, 252, 43,
165, 88, 180, 179, 183, 88, 99, 219, 52, 210, 33, 160, 146, 22, 255,
111, 159, 7, 237, 145, 194, 68, 89, 231, 201, 224, 127, 5, 27, 112, 71,
165, 204, 236, 122, 119, 49, 212, 216, 151, 149, 53, 249, 57, 136, 85,
14, 19, 128, 135, 177, 179, 189, 164, 98, 220, 99, 241, 230, 188, 170,
148, 97, 121, 31, 253, 134, 43, 199, 81, 137, 82, 54, 47, 216, 172, 169,
123, 246, 153, 169, 32, 86, 128, 83, 5, 252, 251, 1};
auto rs = std::make_unique<ReedSolomon>(nroots, minpoly, prim, fcr, pad, shortening, genpoly_coeff);
@ -80,11 +145,28 @@ TEST(ReedSolomonE6BTest, EncodeWithCustomPoly)
TEST(ReedSolomonE6BTest, EncodeWithCustomMatrix)
{
// input vector as defined in Galileo HAS ICD v1.2, Annex D
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
const std::vector<uint8_t> input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179};
// Expected encoded output as defined in Galileo HAS ICD v1.2, Annex D
const std::vector<uint8_t> expected_output = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138,
20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84,
233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70,
96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198,
82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117,
45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71,
250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127,
46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
const int nroots = 223;
const int minpoly = 29;
@ -360,10 +442,27 @@ TEST(ReedSolomonE6BTest, EncodeWithCustomMatrix)
TEST(ReedSolomonE6BTest, DecodeNoErrors)
{
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
128, 245, 87, 150, 58, 192, 66, 130, 179};
std::vector<uint8_t> encoded_input = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
auto rs = std::make_unique<ReedSolomon>();
@ -377,10 +476,27 @@ TEST(ReedSolomonE6BTest, DecodeNoErrors)
TEST(ReedSolomonE6BTest, Decode1Error)
{
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
128, 245, 87, 150, 58, 192, 66, 130, 179};
std::vector<uint8_t> encoded_input = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
// Introduce 1 error:
encoded_input[23] = 0;
@ -396,10 +512,27 @@ TEST(ReedSolomonE6BTest, Decode1Error)
TEST(ReedSolomonE6BTest, Decode16Errors)
{
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
128, 245, 87, 150, 58, 192, 66, 130, 179};
std::vector<uint8_t> encoded_input = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
// Introduce 16 errors:
encoded_input[3] = 0;
@ -430,10 +563,27 @@ TEST(ReedSolomonE6BTest, Decode16Errors)
TEST(ReedSolomonE6BTest, Decode111Errors)
{
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
128, 245, 87, 150, 58, 192, 66, 130, 179};
std::vector<uint8_t> encoded_input = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
// Introduce t = (n-k)/2 = 111 errors:
for (int i = 0; i < 222; i += 2)
@ -452,17 +602,35 @@ TEST(ReedSolomonE6BTest, Decode111Errors)
TEST(ReedSolomonE6BTest, Decode111ErrorsCustomConstructor)
{
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
// clang-format on
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
128, 245, 87, 150, 58, 192, 66, 130, 179};
std::vector<uint8_t> encoded_input = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
// Introduce t = (n-k)/2 = 111 errors:
for (int i = 0; i < 222; i += 2)
{
encoded_input[i] = 0;
}
// clang-format off
int nroots = 223;
int minpoly = 29;
int prim = 1;
@ -479,8 +647,24 @@ TEST(ReedSolomonE6BTest, Decode111ErrorsCustomConstructor)
TEST(ReedSolomonE6BTest, Decode112Errors)
{
std::vector<uint8_t> encoded_input = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
// clang-format on
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
// Introduce 112 errors (this should make the decoder fail):
for (int i = 0; i < 224; i += 2)
@ -497,10 +681,27 @@ TEST(ReedSolomonE6BTest, Decode112Errors)
TEST(ReedSolomonE6BTest, Decode113ErrorsWithErasure)
{
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
128, 245, 87, 150, 58, 192, 66, 130, 179};
std::vector<uint8_t> encoded_input = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
// Introduce 113 errors:
for (int i = 0; i < 226; i += 2)
@ -511,7 +712,7 @@ TEST(ReedSolomonE6BTest, Decode113ErrorsWithErasure)
std::vector<int> erasure_positions{2, 4, 16, 18, 22, 54};
auto rs = std::make_unique<ReedSolomon>();
// clang-format off
int result = rs->decode(encoded_input, erasure_positions);
EXPECT_TRUE(result == 113);
std::vector<uint8_t> decoded(encoded_input.begin(), encoded_input.begin() + 32);
@ -521,10 +722,28 @@ TEST(ReedSolomonE6BTest, Decode113ErrorsWithErasure)
TEST(ReedSolomonE6BTest, DecodeErasure)
{
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179};
// clang-format on
const std::vector<uint8_t> expected_output = {71, 12, 25, 210, 178, 81, 243,
9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31,
128, 245, 87, 150, 58, 192, 66, 130, 179};
std::vector<uint8_t> encoded_input = {
71, 12, 25, 210, 178, 81, 243, 9, 112, 98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128, 245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20, 205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233, 137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96, 70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82, 168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45, 168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250, 242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46, 112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74, 136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232, 151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17, 218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236, 152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136, 16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0, 241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74, 224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
std::vector<uint8_t> encoded_input = {71, 12, 25, 210, 178, 81, 243, 9, 112,
98, 196, 203, 48, 125, 114, 165, 181, 193, 71, 174, 168, 42, 31, 128,
245, 87, 150, 58, 192, 66, 130, 179, 133, 210, 122, 224, 75, 138, 20,
205, 14, 245, 209, 187, 246, 228, 12, 39, 244, 238, 223, 217, 84, 233,
137, 168, 153, 8, 94, 26, 99, 169, 149, 203, 115, 69, 211, 43, 70, 96,
70, 38, 160, 1, 232, 153, 223, 165, 93, 205, 101, 170, 60, 188, 198, 82,
168, 79, 95, 23, 118, 215, 187, 136, 24, 99, 252, 3, 144, 166, 117, 45,
168, 239, 77, 42, 246, 33, 122, 97, 242, 236, 13, 217, 96, 186, 71, 250,
242, 177, 125, 87, 27, 13, 118, 181, 178, 12, 27, 66, 31, 74, 127, 46,
112, 127, 116, 122, 190, 71, 240, 95, 78, 194, 113, 80, 46, 126, 74,
136, 118, 133, 105, 176, 47, 230, 162, 195, 93, 157, 72, 119, 13, 232,
151, 200, 191, 143, 75, 161, 111, 29, 158, 16, 181, 165, 92, 39, 17,
218, 228, 58, 176, 233, 55, 211, 195, 73, 37, 137, 232, 241, 150, 236,
152, 153, 53, 74, 81, 91, 160, 244, 21, 95, 176, 179, 141, 39, 61, 136,
16, 58, 160, 51, 210, 31, 134, 63, 203, 96, 219, 44, 231, 61, 220, 0,
241, 220, 207, 17, 52, 150, 117, 54, 222, 128, 101, 213, 164, 234, 74,
224, 57, 246, 70, 27, 202, 229, 4, 243, 128, 211, 158, 199, 4};
// Introduce 223 erasures:
std::vector<int> erasure_positions;
@ -536,7 +755,7 @@ TEST(ReedSolomonE6BTest, DecodeErasure)
auto rs = std::make_unique<ReedSolomon>();
int result = rs->decode(encoded_input, erasure_positions);
// clang-format off
EXPECT_TRUE(result == 223);
std::vector<uint8_t> decoded(encoded_input.begin(), encoded_input.begin() + 32);
EXPECT_TRUE(expected_output == decoded);