liberasurecode 1.6.3
Erasure Code API library
Loading...
Searching...
No Matches
Functions
isa_l_common.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "erasurecode.h"
#include "erasurecode_backend.h"
#include "erasurecode_helpers.h"
#include "erasurecode_helpers_ext.h"
#include "isa_l_common.h"

Go to the source code of this file.

Functions

int isa_l_encode (void *desc, char **data, char **parity, int blocksize)
 
static unsigned char * isa_l_get_decode_matrix (int k, int m, unsigned char *encode_matrix, int *missing_idxs)
 
static int get_num_missing_elements (int *missing_idxs)
 
static void mult_and_xor_row (unsigned char *to_row, unsigned char *from_row, unsigned char val, int num_elems, gf_mul_func gf_mul)
 
static unsigned char * get_inverse_rows (int k, int m, unsigned char *decode_inverse, unsigned char *encode_matrix, int *missing_idxs, gf_mul_func gf_mul)
 
int isa_l_decode (void *desc, char **data, char **parity, int *missing_idxs, int blocksize)
 
int isa_l_reconstruct (void *desc, char **data, char **parity, int *missing_idxs, int destination_idx, int blocksize)
 
int isa_l_min_fragments (void *desc, int *missing_idxs, int *fragments_to_exclude, int *fragments_needed)
 
int isa_l_element_size (void *desc)
 Return the element-size, which is the number of bits stored on a given device, per codeword.
 
int isa_l_exit (void *desc)
 
void * isa_l_common_init (struct ec_backend_args *args, void *backend_sohandle, const char *gen_matrix_func_name)
 

Function Documentation

◆ get_inverse_rows()

static unsigned char * get_inverse_rows ( int  k,
int  m,
unsigned char *  decode_inverse,
unsigned char *  encode_matrix,
int *  missing_idxs,
gf_mul_func  gf_mul 
)
static

Definition at line 107 of file isa_l_common.c.

References get_num_missing_elements(), and mult_and_xor_row().

Referenced by isa_l_decode(), and isa_l_reconstruct().

◆ get_num_missing_elements()

static int get_num_missing_elements ( int *  missing_idxs)
static

Definition at line 79 of file isa_l_common.c.

Referenced by get_inverse_rows(), and isa_l_decode().

◆ isa_l_common_init()

void * isa_l_common_init ( struct ec_backend_args *  args,
void *  backend_sohandle,
const char *  gen_matrix_func_name 
)

Generate ISA-L encoding matrix Note that this is an abstract func from each backend

Generate the tables for encoding

Definition at line 446 of file isa_l_common.c.

Referenced by isa_l_rs_cauchy_init(), and isa_l_rs_vand_init().

◆ isa_l_decode()

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

◆ isa_l_element_size()

int isa_l_element_size ( void *  desc)

Return the element-size, which is the number of bits stored on a given device, per codeword.

This is always 8 in ISA-L

Returns the size in bits!

Definition at line 427 of file isa_l_common.c.

◆ isa_l_encode()

int isa_l_encode ( void *  desc,
char **  data,
char **  parity,
int  blocksize 
)

Definition at line 39 of file isa_l_common.c.

◆ isa_l_exit()

int isa_l_exit ( void *  desc)

Definition at line 432 of file isa_l_common.c.

◆ isa_l_get_decode_matrix()

static unsigned char * isa_l_get_decode_matrix ( int  k,
int  m,
unsigned char *  encode_matrix,
int *  missing_idxs 
)
static

Definition at line 54 of file isa_l_common.c.

Referenced by isa_l_decode(), and isa_l_reconstruct().

◆ isa_l_min_fragments()

int isa_l_min_fragments ( void *  desc,
int *  missing_idxs,
int *  fragments_to_exclude,
int *  fragments_needed 
)

Definition at line 395 of file isa_l_common.c.

◆ isa_l_reconstruct()

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

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 283 of file isa_l_common.c.

References get_inverse_rows(), and isa_l_get_decode_matrix().

◆ mult_and_xor_row()

static void mult_and_xor_row ( unsigned char *  to_row,
unsigned char *  from_row,
unsigned char  val,
int  num_elems,
gf_mul_func  gf_mul 
)
static

Definition at line 90 of file isa_l_common.c.

Referenced by get_inverse_rows().