liberasurecode  1.6.1
Erasure Code API library
Macros | Functions | Variables
alg_sig.c File Reference
#include <dlfcn.h>
#include <alg_sig.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Macros

#define GALOIS_SINGLE_MULTIPLY   "galois_single_multiply"
 
#define GALOIS_UNINIT   "galois_uninit_field"
 

Functions

galois_single_multiply_func get_galois_multi_func (void *handle)
 
void stub_galois_uninit_field (int w)
 
galois_uninit_field_func get_galois_uninit_func (void *handle)
 
void * get_jerasure_sohandle ()
 
int load_gf_functions (void *sohandle, struct jerasure_mult_routines *routines)
 
static alg_sig_t * init_alg_sig_w8 (void *jerasure_sohandle, int sig_len)
 
static alg_sig_t * init_alg_sig_w16 (void *jerasure_sohandle, int sig_len)
 
alg_sig_t * init_alg_sig (int sig_len, int gf_w)
 
void destroy_alg_sig (alg_sig_t *alg_sig_handle)
 
static int compute_w8_alg_sig_32 (alg_sig_t *alg_sig_handle, char *buf, int len, char *sig)
 
static int compute_w16_alg_sig_64 (alg_sig_t *alg_sig_handle, char *buf, int len, char *sig)
 
static int compute_w16_alg_sig_32 (alg_sig_t *alg_sig_handle, char *buf, int len, char *sig)
 
static int compute_alg_sig_32 (alg_sig_t *alg_sig_handle, char *buf, int len, char *sig)
 
static int compute_alg_sig_64 (alg_sig_t *alg_sig_handle, char *buf, int len, char *sig)
 
int compute_alg_sig (alg_sig_t *alg_sig_handle, char *buf, int len, char *sig)
 

Variables

int valid_gf_w [] = { 8, 16, -1 }
 
int valid_pairs [][2] = { { 8, 32}, {16, 32}, {16, 64}, {-1, -1} }
 

Macro Definition Documentation

◆ GALOIS_SINGLE_MULTIPLY

#define GALOIS_SINGLE_MULTIPLY   "galois_single_multiply"

Definition at line 30 of file alg_sig.c.

◆ GALOIS_UNINIT

#define GALOIS_UNINIT   "galois_uninit_field"

Definition at line 31 of file alg_sig.c.

Function Documentation

◆ compute_alg_sig()

int compute_alg_sig ( alg_sig_t *  alg_sig_handle,
char *  buf,
int  len,
char *  sig 
)

Definition at line 425 of file alg_sig.c.

References compute_alg_sig_32(), and compute_alg_sig_64().

◆ compute_alg_sig_32()

static int compute_alg_sig_32 ( alg_sig_t *  alg_sig_handle,
char *  buf,
int  len,
char *  sig 
)
static

Definition at line 406 of file alg_sig.c.

References compute_w16_alg_sig_32(), and compute_w8_alg_sig_32().

Referenced by compute_alg_sig().

◆ compute_alg_sig_64()

static int compute_alg_sig_64 ( alg_sig_t *  alg_sig_handle,
char *  buf,
int  len,
char *  sig 
)
static

Definition at line 417 of file alg_sig.c.

References compute_w16_alg_sig_64().

Referenced by compute_alg_sig().

◆ compute_w16_alg_sig_32()

static int compute_w16_alg_sig_32 ( alg_sig_t *  alg_sig_handle,
char *  buf,
int  len,
char *  sig 
)
static

This is the loop to optimize. It is currently optimized enough : using Horner's alg., shortened mult. tables, and other tricks.

Definition at line 359 of file alg_sig.c.

Referenced by compute_alg_sig_32().

◆ compute_w16_alg_sig_64()

static int compute_w16_alg_sig_64 ( alg_sig_t *  alg_sig_handle,
char *  buf,
int  len,
char *  sig 
)
static

This is the loop to optimize. It is currently optimized enough : using Horner's alg., shortened mult. tables, and other tricks.

Definition at line 304 of file alg_sig.c.

Referenced by compute_alg_sig_64().

◆ compute_w8_alg_sig_32()

static int compute_w8_alg_sig_32 ( alg_sig_t *  alg_sig_handle,
char *  buf,
int  len,
char *  sig 
)
static

This is the loop to optimize. It is currently optimized enough : using Horner's alg., shortened mult. tables, and other tricks.

Definition at line 275 of file alg_sig.c.

Referenced by compute_alg_sig_32().

◆ destroy_alg_sig()

void destroy_alg_sig ( alg_sig_t *  alg_sig_handle)

Definition at line 246 of file alg_sig.c.

◆ get_galois_multi_func()

galois_single_multiply_func get_galois_multi_func ( void *  handle)

Definition at line 36 of file alg_sig.c.

References GALOIS_SINGLE_MULTIPLY.

Referenced by load_gf_functions().

◆ get_galois_uninit_func()

galois_uninit_field_func get_galois_uninit_func ( void *  handle)

Definition at line 52 of file alg_sig.c.

References GALOIS_UNINIT.

Referenced by load_gf_functions().

◆ get_jerasure_sohandle()

void* get_jerasure_sohandle ( )

Definition at line 67 of file alg_sig.c.

Referenced by init_alg_sig().

◆ init_alg_sig()

alg_sig_t* init_alg_sig ( int  sig_len,
int  gf_w 
)

Definition at line 216 of file alg_sig.c.

References get_jerasure_sohandle(), init_alg_sig_w16(), init_alg_sig_w8(), and valid_pairs.

◆ init_alg_sig_w16()

static alg_sig_t* init_alg_sig_w16 ( void *  jerasure_sohandle,
int  sig_len 
)
static

Definition at line 153 of file alg_sig.c.

References load_gf_functions().

Referenced by init_alg_sig().

◆ init_alg_sig_w8()

static alg_sig_t* init_alg_sig_w8 ( void *  jerasure_sohandle,
int  sig_len 
)
static

Definition at line 96 of file alg_sig.c.

References load_gf_functions().

Referenced by init_alg_sig().

◆ load_gf_functions()

int load_gf_functions ( void *  sohandle,
struct jerasure_mult_routines *  routines 
)

It is possible that the underlying Jerasure implementation is old (pre-jerasure.org). If so, there is not an uninit function, so these tests will fail.

Since nothing is using alg_sig at the moment, we stub the uninit function to unblock the tests. Once we plug the internal GF functions into alg_sig, this can jsut go away.

Definition at line 72 of file alg_sig.c.

References get_galois_multi_func(), get_galois_uninit_func(), and stub_galois_uninit_field().

Referenced by init_alg_sig_w16(), and init_alg_sig_w8().

◆ stub_galois_uninit_field()

void stub_galois_uninit_field ( int  w)

Definition at line 50 of file alg_sig.c.

Referenced by load_gf_functions().

Variable Documentation

◆ valid_gf_w

int valid_gf_w[] = { 8, 16, -1 }

Definition at line 33 of file alg_sig.c.

◆ valid_pairs

int valid_pairs[][2] = { { 8, 32}, {16, 32}, {16, 64}, {-1, -1} }

Definition at line 34 of file alg_sig.c.

Referenced by init_alg_sig().