Percy++
A C++ implementation of Private Information Retrieval (PIR) protocols
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
Classes | Public Member Functions | Static Public Member Functions | List of all members
RSDecoder< F, vec_F, FX, FXY, mat_F > Class Template Reference

Reed-Solomon Decoder. More...

#include <rsdecoder.h>

Public Member Functions

 RSDecoder ()
 GF2E Constructor. More...
 
 RSDecoder (const ZZ &p1, const ZZ &p2)
 ZZ_p Constructor. More...
 
bool Recover (dbsize_t bytes_per_word, nservers_t t, nservers_t h, const vector< nservers_t > &goodservers, const vector< vector< vec_F > > &values, const vec_F &server_indices, vector< vector< DecoderResult< F > > > &results, vector< std::set< dbsize_t > > &decoded, const vector< vec_F > &vec_interp_indices, const nqueries_t multi_only=0)
 The main method to do the Reed-Solomon Decoding. More...
 

Static Public Member Functions

static string append (const string &s, const F &wz, unsigned int bytes_per_word)
 A helper function to append an element of F to a string. More...
 
static void test_interpolate (unsigned short t, const vec_F &values, const vec_F &indices, const vector< unsigned short > &I, const vector< unsigned short > &G, unsigned short &numagree, unsigned short &numdisagree, vector< unsigned short > &vecagree, FX &phi)
 Interpolate some points I and check how many points G agree with the result. More...
 

Detailed Description

template<class F, class vec_F, class FX, class FXY, class mat_F>
class RSDecoder< F, vec_F, FX, FXY, mat_F >

Reed-Solomon Decoder.

The main RSDecoder class, genericized to work over different types of fields.

Template Parameters
FThe field used for decoding.
vec_FVectors over the field F.
FXUnivariate polynomials over the field F.
FXYBivariate polynomials over the field F.
mat_FMatrices over the field F.

Constructor & Destructor Documentation

RSDecoder ( )
inline

GF2E Constructor.

Call this constructor for GF2E. Be sure to call GF2E::init as well, with an appropriate polynomial modulus.

RSDecoder ( const ZZ &  p1,
const ZZ &  p2 
)
inline

ZZ_p Constructor.

Call this constructor for ZZ_p. p2 should be prime, and p1 should be either prime or 1. The modulus used is p1*p2.

Member Function Documentation

static string append ( const string &  s,
const F &  wz,
unsigned int  bytes_per_word 
)
static

A helper function to append an element of F to a string.

It's public and static so that EasyRecover can use it.

Parameters
sThe string to append to.
wzThe fields element to append to the string.
bytes_per_wordThe number of bytes each word uses.
Returns
The string s appended with wz.
bool Recover ( dbsize_t  bytes_per_word,
nservers_t  t,
nservers_t  h,
const vector< nservers_t > &  goodservers,
const vector< vector< vec_F > > &  values,
const vec_F &  server_indices,
vector< vector< DecoderResult< F > > > &  results,
vector< std::set< dbsize_t > > &  decoded,
const vector< vec_F > &  vec_interp_indices,
const nqueries_t  multi_only = 0 
)

The main method to do the Reed-Solomon Decoding.

Parameters
bytes_per_wordThe number of bytes each word uses.
tThe privacy level. I.e. the maximum number of servers that can collude without breaking privacy.
hThe number of honest servers.
goodserversThe indices of the servers that did not act up.
valuesThe server shares. Indexed by query then by word.
server_indicesThe indices used for server shares.
resultsThe decoding results for each query. Will be filled as decoding occurs.
decodedFor each query, the words that have been successfully decoded. Will be updated as decoding occurs.
vec_interp_indicesThe indices corresponding to each block requested.
multi_onlyThe number of queries that should only be processed using multi-query decoding. The first multi_only queries were previously attempted, were not successfully decoded and were saved for multi-query decoding.
Returns
Return true if all queries were decoded, false otherwise.
void test_interpolate ( unsigned short  t,
const vec_F &  values,
const vec_F &  indices,
const vector< unsigned short > &  I,
const vector< unsigned short > &  G,
unsigned short &  numagree,
unsigned short &  numdisagree,
vector< unsigned short > &  vecagree,
FX &  phi 
)
static

Interpolate some points I and check how many points G agree with the result.

Set phi to the degree-t polynomial which interpolates the (indices,values) pairs indexed by I. Check which (indices,values) pairs indexed by G agree and disagree with phi, and set numagree, numdisagree, and vecagree accordingly.

Parameters
tThe degree of the interpolating polynomial.
valuesThe values of the points.
indicesThe indices of the points.
IThe indices of the points to interpolate.
GThe indices of the points to check with phi.
numagreeNumber of points in G that agree with phi.
numdisagreeNumber of points in G that do not agree with phi.
vecagreeThe indices of the points in G that agree with phi.
phiThe interpolant.

The documentation for this class was generated from the following files: