/*! \mainpage RQC: a Public-Key Encryption scheme
 *
 *  1. SUBMISSION OVERVIEW
 *  ----------------------
 *
 *  In order to fully understand this submission, one should note that RQC is a public-key encryption scheme submitted as a KEM for which NIST "standard conversion techniques" should be applied (see NIST FAQ#13). In addition, the aforementionned KEM is obtained by applying a conversion technique to a PKE. In order to avoid any confusion, we may refer to:
 *
 * - <b>RQC_PKE IND-CPA</b>: RQC PKE IND-CPA scheme due to \cite cryptoeprint:2016:1194.
 * - <b>RQC_KEM IND-CCA2</b>: RQC KEM IND-CCA2 scheme obtained by applying the transformation from \cite cryptoeprint:2017:604 to the RQC PKE IND-CPA scheme. It is the implementation provided.
 * - <b>RQC_PKE IND-CCA2</b>: RQC PKE IND-CCA2 scheme obtained by applying NIST "standard conversion techniques" to the RQC KEM IND-CCA2 scheme. It is the scheme submitted.<br />
 *
 * 
 * Both reference implementation and optimized implementation provided for this submission are the same. Three parameters sets denoted respectively RQC-128, RQC-192 and RQC-256 are provided as explained in the supporting documentation. Each parameter set folder is organized as follows:
 * 
 *  - <b>bin/</b>: Files generated during compilation
 *  - <b>doc/</b>: Technical documentation of the scheme
 *  - <b>lib/</b>: Third party libraries used 
 *  - <b>src/</b>: Source code of the scheme  
 *  - <b>doxygen.conf</b>: Documentation configuration file
 *  - <b>configure</b>: Configuration file
 *  - <b>Makefile</b>: Makefile
 *  
 *  <br />
 *  
 *  2. INSTALLATION INSTRUCTIONS
 *  ----------------------------
 *  
 *  <h3>2.1 Requirements</h3>
 *
 *  The following softwares and librairies are required: <b>cmake</b>, <b>make</b>, <b>gcc</b>, <b>openssl</b> and <b>gmp</b>.
 *
 *  <h3>2.2 Configuration Step</h3>
 *
 *  The configuration step aims to install the <b>mpfq</b> library that is used to perform finite field arithmetic \cite mpfq.
 *  
 *  Executing <b>sh ./configure</b> into the considered folder should install MPFQ automatically (script not generated using autotools). 
 * 
 *  Alternatively, one can manually:
 *  - Execute <b>cmake .</b> inside <b>lib/mpfq/mpfq-1.1/src</b> folder.
 *  - Execute <b>make gen-FIELD</b> inside <b>lib/mpfq/mpfq-1.1/src</b> folder with <b>FIELD</b> equal to <b>2_89</b>, <b>2_113</b> or <b>2_139</b> for RQC-128, RQC-192 or RQC-256 respectively.
 *  - Copy <b>lib/mpfq/mpfq-1.1/src/gf2n/libmpfq_FIELD.a</b> into <b>lib/mpfq/src</b> folder.
 *  - Copy <b>lib/mpfq/mpfq-1.1/src/include/mpfq/mpfq_FIELD.h</b> into <b>lib/mpfq/include</b> folder.
 *  - Copy <b>lib/mpfq/mpfq-1.1/src/include/mpfq/fixmp.h</b> into <b>lib/mpfq/include/mpfq</b> folder.
 *  - Copy <b>lib/mpfq/mpfq-1.1/src/include/mpfq/mpfq.h</b> into <b>lib/mpfq/include/mpfq</b> folder.
 *  - Copy <b>lib/mpfq/mpfq-1.1/src/include/mpfq/mpfq_gf2n_common.h</b> into <b>lib/mpfq/include/mpfq</b> folder.
 *
 *  <h3>2.3 Compilation Step</h3>
 *
 *  Let <b>X</b> denotes <b>128</b>, <b>192</b> or <b>256</b> depending on the parameter set considered. RQC can be compiled in three differents ways:
 *  - Execute <b>make rqcX</b> to compile a working example of the scheme. Run <b>bin/rqcX</b> to execute the scheme and display its performances.
 *  - Execute <b>make rqcX-kat</b> to compile the NIST KAT generator. Run <b>bin/rqcX-kat</b> to generate KAT files.
 *  - Execute <b>make rqcX-verbose</b> to compile a working example of the scheme in verbose mode. Run <b>bin/rqcX-verbose</b> to generate intermediate values.
 *
 *  During compilation, the following files are created inside the <b>bin/build</b> folder:
 *  - <b>hash.o</b>: A wrapper around openssl SHA512 implementation
 *  - <b>rng.o</b>: NIST rng
 *  - <b>libmpfq_FIELD.a</b> where <b>FIELD</b> equal to <b>2_89</b>, <b>2_113</b> or <b>2_139</b> for RQC-128, RQC-192 or RQC-256 respectively: MPFQ library files.
 *  - <b>ffi_field.o</b>: Functions to manipulate finite fields.
 *  - <b>ffi_elt.o</b>: Functions to manipulate finite fields elements.
 *  - <b>ffi_vec.o</b>: Functions to manipulate vectors over finite fields.
 *  - <b>parsing.o</b>: Functions to parse public key, secret key and ciphertext of the scheme.
 *  - <b>q_polynomial.o</b>: Functions to manipulate q_polynomials.
 *  - <b>gabidulin.o</b>: Functions to encode and decode messages using Gabidulin codes (either in normal mode or verbose mode).
 *  - <b>rqc.o</b>: The RQC PKE IND-CPA scheme (either in normal mode or verbose mode).
 *  - <b>kem.o</b>: The RQC KEM IND-CCA2 scheme (either in normal mode or verbose mode).
 *
 * <br />
 *
 *  3. DOCUMENTATION GENERATION
 *  ---------------------------
 *
 *  <h3>3.1 Requirements</h3>
 *
 *  The following softwares are required: <b>doxygen</b> and <b>bibtex</b>.
 *
 *  <h3>3.2 Generation Step</h3>
 * 
 *  - Run <b>doxygen doxygen.conf</b> to generate the code documentation
 *  - Browse <b>doc/html/index.html</b> to read the documentation
 *
 * <br />
 *
 *  4. ADDITIONAL INFORMATIONS
 *  --------------------------
 *
 *  <h3>4.1 Implementation overview</h3>
 *
 *  The <b>RQC_KEM IND-CCA2</b> scheme is defined in the api.h and parameters.h files and implemented in kem.c.
 *  The latter is based on the <b>RQC_PKE IND-CPA</b> scheme that is defined in rqc.h and implemented in rqc.c.
 *  The <b>RQC_PKE IND-CPA</b> scheme uses Gabidulin codes (see gabidulin.h and gabidulin.c) which relies on q-polynomials (see q_polynomial.h and q_polynomial.c).
 *  The files ffi.h, ffi_field.h, ffi_elt.h, ffi_vec.h, ffi_field.c, ffi_elt.c and ffi_vec.c provide the functions performing the various operations over finite fields required by the scheme.
 *  As public key, secret key and ciphertext can manipulated either with theirs mathematical representations or as bit strings, the files parsing.h and parsing.c provide functions to switch between these two representations.
 *  Finally, the files <b>hash.h</b>, <b>rng.h</b>, <b>hash.c</b> and <b>rng.c</b> (inside the <b>lib/</b> folder) contain respectively a wrapper around OpenSSL SHA512 implementation and the NIST random functions.  
 *
 *  <h3>4.2 Finite field interface</h3>
 *
 *  RQC is a rank-based scheme and as such heavily relies on finite field arithmetic. 
 *  We have provided an interface for finite fields (through files ffi.h, ffi_field.h, ffi_elt.h and ffi_vec.h) describing the various operations required by the scheme. 
 *  In this submission, the <b>f</b>inite <b>f</b>ield <b>i</b>nterface (<b>ffi</b>) is implemented using the MPFQ library \cite mpfq but one should note that RQC can work with any implementation of our finite field interface as long as its API is respected. 
 *  
 *  In the context of our ffi interface, a finite field always describes an extension of a binary field namely a finite field of the form GF(2^m).
 *  The ffi interface works as follows:
 *  - <b>ffi.h</b>: Constants that defines the considered finite field ;
 *  - <b>ffi_field.h</b>: Functions to initialize finite fields ;
 *  - <b>ffi_elt.h</b>: Functions to manipulate elements of GF(2^m) ;
 *  - <b>ffi_vec.h</b>: Functions to manipulate either vectors over GF(2^m).
 *  
 *  In our reference implementation, the considered fields are <b>GF(2^89)</b>, <b>GF(2^113)</b> and <b>GF(2^139)</b> for RQC-128, RQC-192 and RQC-256.
 *  In addition, the <b>ffi_field</b>, <b>ffi_elt</b> and <b>ffi_vec</b> types are respectively implemented as MPFQ <b>mpfq_2_X_field</b>, <b>mpfq_2_X_elt</b> and <b>mpfq_2_X_vec</b> types where <b>X</b> denotes <b>89</b>, <b>113</b> or <b>139</b>.
 *
 *  <h3>4.3 Public key, secret key, ciphertext and shared secret</h3>
 *
 *  The public key, secret key and ciphertext are respectively composed of (<b>h</b>, <b>s</b>), (<b>x</b>, <b>y</b>) and (<b>u</b>, <b>v</b>, <b>d</b>).
 *  The shared secret is the output of the hash of <b>m</b> using SHA512.
 *  In order to shorten the keys, the public key is stored as (<b>seed1</b>, <b>s</b>) and the secret key is stored as (<b>seed2</b>).
 *  To this end, the seed expander provided by the NIST was used along with 40 bytes long seeds. 
 *
 */
