liberasurecode 1.8.0
Erasure Code API library
Loading...
Searching...
No Matches
Macros | Functions | Variables
isa_l_rs_lrc.c File Reference
#include <stdlib.h>
#include "erasurecode_backend.h"
#include "erasurecode_helpers.h"
#include "isa_l_common.h"

Go to the source code of this file.

Macros

#define ISA_L_RS_LRC_LIB_MAJOR   1
 
#define ISA_L_RS_LRC_LIB_MINOR   0
 
#define ISA_L_RS_LRC_LIB_REV   0
 
#define ISA_L_RS_LRC_LIB_VER_STR   "1.0"
 
#define ISA_L_RS_LRC_LIB_NAME   "isa_l_rs_vand"
 
#define ISA_L_RS_LRC_SO_NAME   "libisal" LIBERASURECODE_SO_SUFFIX ".so.2"
 

Functions

static int gen_encoding_matrix (isa_l_descriptor *desc, int m, int k)
 
static void * isa_l_rs_lrc_init (struct ec_backend_args *args, void *backend_sohandle)
 
static int isa_l_rs_lrc_check_reconstruct_fragments (void *desc, int *missing_idxs, int destination_idx)
 
static bool isa_l_rs_lrc_is_compatible_with (uint32_t version)
 
static unsigned char * get_lrc_inverse_rows (int k, int m, int min_range, int max_range, int missing_local_parity, unsigned char *decode_inverse, unsigned char *encode_matrix, struct ec_bm *missing_bm, gf_mul_func gf_mul)
 
static unsigned char * isa_l_lrc_get_decode_matrix (int k, int m, unsigned local_parity, unsigned char *encode_matrix, struct ec_bm *missing_bm, int *used_idxs, int *use_combined_parity)
 
static int isa_l_lrc_decode (void *desc, char **data, char **parity, int *missing_idxs, int blocksize)
 
static unsigned char * isa_l_lrc_get_reconstruct_matrix (int k, int m, unsigned local_parity, int destination_idx, unsigned char *encode_matrix, struct ec_bm *missing_bm, int *used_idxs, int *min_col, int *max_col, int *mx_size, int *missing_local_parity, int *use_combined_parity)
 
static int isa_l_lrc_reconstruct (void *desc, char **data, char **parity, int *missing_idxs, int destination_idx, int blocksize)
 
 __attribute__ ((visibility("internal")))
 

Variables

struct ec_backend_common backend_isa_l_rs_lrc
 
static struct ec_backend_op_stubs isa_l_rs_lrc_op_stubs
 

Macro Definition Documentation

◆ ISA_L_RS_LRC_LIB_MAJOR

#define ISA_L_RS_LRC_LIB_MAJOR   1

Definition at line 34 of file isa_l_rs_lrc.c.

◆ ISA_L_RS_LRC_LIB_MINOR

#define ISA_L_RS_LRC_LIB_MINOR   0

Definition at line 35 of file isa_l_rs_lrc.c.

◆ ISA_L_RS_LRC_LIB_NAME

#define ISA_L_RS_LRC_LIB_NAME   "isa_l_rs_vand"

Definition at line 38 of file isa_l_rs_lrc.c.

◆ ISA_L_RS_LRC_LIB_REV

#define ISA_L_RS_LRC_LIB_REV   0

Definition at line 36 of file isa_l_rs_lrc.c.

◆ ISA_L_RS_LRC_LIB_VER_STR

#define ISA_L_RS_LRC_LIB_VER_STR   "1.0"

Definition at line 37 of file isa_l_rs_lrc.c.

◆ ISA_L_RS_LRC_SO_NAME

#define ISA_L_RS_LRC_SO_NAME   "libisal" LIBERASURECODE_SO_SUFFIX ".so.2"

Definition at line 42 of file isa_l_rs_lrc.c.

Function Documentation

◆ __attribute__()

__attribute__ ( (visibility("internal"))  )

◆ gen_encoding_matrix()

static int gen_encoding_matrix ( isa_l_descriptor *  desc,
int  m,
int  k 
)
static

Should never happen as it's a proper Vandermonde matrix, but belt & bracers...

Now we're ready to build the encoding matrix: inv(A') * A. Save some multiplies by going straight to I for the start.

Definition at line 48 of file isa_l_rs_lrc.c.

Referenced by isa_l_rs_lrc_init().

◆ get_lrc_inverse_rows()

static unsigned char * get_lrc_inverse_rows ( int  k,
int  m,
int  min_range,
int  max_range,
int  missing_local_parity,
unsigned char *  decode_inverse,
unsigned char *  encode_matrix,
struct ec_bm *  missing_bm,
gf_mul_func  gf_mul 
)
static

Definition at line 301 of file isa_l_rs_lrc.c.

Referenced by isa_l_lrc_decode(), and isa_l_lrc_reconstruct().

◆ isa_l_lrc_decode()

static int isa_l_lrc_decode ( void *  desc,
char **  data,
char **  parity,
int *  missing_idxs,
int  blocksize 
)
static

Definition at line 459 of file isa_l_rs_lrc.c.

References get_lrc_inverse_rows(), and isa_l_lrc_get_decode_matrix().

◆ isa_l_lrc_get_decode_matrix()

static unsigned char * isa_l_lrc_get_decode_matrix ( int  k,
int  m,
unsigned  local_parity,
unsigned char *  encode_matrix,
struct ec_bm *  missing_bm,
int *  used_idxs,
int *  use_combined_parity 
)
static

Definition at line 383 of file isa_l_rs_lrc.c.

Referenced by isa_l_lrc_decode(), and isa_l_lrc_get_reconstruct_matrix().

◆ isa_l_lrc_get_reconstruct_matrix()

static unsigned char * isa_l_lrc_get_reconstruct_matrix ( int  k,
int  m,
unsigned  local_parity,
int  destination_idx,
unsigned char *  encode_matrix,
struct ec_bm *  missing_bm,
int *  used_idxs,
int *  min_col,
int *  max_col,
int *  mx_size,
int *  missing_local_parity,
int *  use_combined_parity 
)
static

Definition at line 595 of file isa_l_rs_lrc.c.

References isa_l_lrc_get_decode_matrix().

Referenced by isa_l_lrc_reconstruct().

◆ isa_l_lrc_reconstruct()

static int isa_l_lrc_reconstruct ( void *  desc,
char **  data,
char **  parity,
int *  missing_idxs,
int  destination_idx,
int  blocksize 
)
static

Get available elements and compute the inverse of their corresponding rows.

Get the row needed to reconstruct

Fill in the available elements

Copy pointer of buffer to reconstruct

Do the reconstruction

Definition at line 689 of file isa_l_rs_lrc.c.

References get_lrc_inverse_rows(), and isa_l_lrc_get_reconstruct_matrix().

◆ isa_l_rs_lrc_check_reconstruct_fragments()

static int isa_l_rs_lrc_check_reconstruct_fragments ( void *  desc,
int *  missing_idxs,
int  destination_idx 
)
static

Definition at line 229 of file isa_l_rs_lrc.c.

◆ isa_l_rs_lrc_init()

static void * isa_l_rs_lrc_init ( struct ec_backend_args *  args,
void *  backend_sohandle 
)
static

Generate the tables for encoding

Definition at line 124 of file isa_l_rs_lrc.c.

References gen_encoding_matrix().

◆ isa_l_rs_lrc_is_compatible_with()

static bool isa_l_rs_lrc_is_compatible_with ( uint32_t  version)
static

Definition at line 297 of file isa_l_rs_lrc.c.

References backend_isa_l_rs_lrc.

Variable Documentation

◆ backend_isa_l_rs_lrc

struct ec_backend_common backend_isa_l_rs_lrc

Definition at line 46 of file isa_l_rs_lrc.c.

Referenced by isa_l_rs_lrc_is_compatible_with().

◆ isa_l_rs_lrc_op_stubs

struct ec_backend_op_stubs isa_l_rs_lrc_op_stubs
static
Initial value:
= {
.EXIT = isa_l_exit,
.ISSYSTEMATIC = 1,
.ENCODE = isa_l_encode,
.DECODE = isa_l_lrc_decode,
.FRAGSNEEDED = isa_l_min_fragments,
.RECONSTRUCT = isa_l_lrc_reconstruct,
.ELEMENTSIZE = isa_l_element_size,
.ISCOMPATIBLEWITH = isa_l_rs_lrc_is_compatible_with,
.GETMETADATASIZE = get_backend_metadata_size_zero,
.GETENCODEOFFSET = get_encode_offset_zero,
.CHECKRECONSTRUCTFRAGMENTS = isa_l_rs_lrc_check_reconstruct_fragments,
}
static void * isa_l_rs_lrc_init(struct ec_backend_args *args, void *backend_sohandle)
Definition: isa_l_rs_lrc.c:124
static bool isa_l_rs_lrc_is_compatible_with(uint32_t version)
Definition: isa_l_rs_lrc.c:297
static int isa_l_lrc_decode(void *desc, char **data, char **parity, int *missing_idxs, int blocksize)
Definition: isa_l_rs_lrc.c:459
static int isa_l_rs_lrc_check_reconstruct_fragments(void *desc, int *missing_idxs, int destination_idx)
Definition: isa_l_rs_lrc.c:229
static int isa_l_lrc_reconstruct(void *desc, char **data, char **parity, int *missing_idxs, int destination_idx, int blocksize)
Definition: isa_l_rs_lrc.c:689

Definition at line 851 of file isa_l_rs_lrc.c.

Referenced by __attribute__().