liberasurecode 1.8.0
Erasure Code API library
Loading...
Searching...
No Matches
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.

Referenced by __attribute__().

◆ 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.

Referenced by __attribute__().

◆ 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.

Referenced by __attribute__().

◆ 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.

Referenced by __attribute__().

◆ 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.

Referenced by __attribute__().

◆ 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.

Referenced by __attribute__().

Function Documentation

◆ __attribute__()

◆ gen_encoding_matrix()

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.

References gen_encoding_matrix().

Referenced by gen_encoding_matrix(), gen_encoding_matrix(), isa_l_rs_lrc_init(), and isa_l_rs_vand_inv_init().

◆ get_lrc_inverse_rows()

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.

References get_lrc_inverse_rows().

Referenced by get_lrc_inverse_rows(), isa_l_lrc_decode(), and isa_l_lrc_reconstruct().

◆ isa_l_lrc_decode()

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

◆ isa_l_lrc_get_decode_matrix()

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

◆ isa_l_lrc_get_reconstruct_matrix()

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

◆ isa_l_lrc_reconstruct()

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(), isa_l_lrc_get_reconstruct_matrix(), and isa_l_lrc_reconstruct().

Referenced by isa_l_lrc_reconstruct().

◆ isa_l_rs_lrc_check_reconstruct_fragments()

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

◆ isa_l_rs_lrc_init()

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(), and isa_l_rs_lrc_init().

Referenced by isa_l_rs_lrc_init().

◆ isa_l_rs_lrc_is_compatible_with()

bool isa_l_rs_lrc_is_compatible_with ( uint32_t version)
static

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 __attribute__(), and 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)
static bool isa_l_rs_lrc_is_compatible_with(uint32_t version)
static int isa_l_lrc_decode(void *desc, char **data, char **parity, int *missing_idxs, int blocksize)
static int isa_l_rs_lrc_check_reconstruct_fragments(void *desc, int *missing_idxs, int destination_idx)
static int isa_l_lrc_reconstruct(void *desc, char **data, char **parity, int *missing_idxs, int destination_idx, int blocksize)

Definition at line 851 of file isa_l_rs_lrc.c.

Referenced by __attribute__().