stegocurve  1.1
Tool for plot easily the efficiency of code based steganography
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Typedefs | Functions
code.h File Reference

Mini librairy to manipulate error correcting codes paramaeters, which are important for code based steganography. More...

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "tools/definition.h"

Go to the source code of this file.

Data Structures

struct  CODE
 Structure where is managed the codes parameters. More...

Typedefs

typedef struct CODE Code

Functions

void malloc_codes (Code **C, const uint nb)
 Allocates C a codes array of size nb.
void free_codes (Code **C)
 desallocates C a codes array.
void init_code_WC (Code *C, const uint n, const uint k, const uint cr)
 Initialize the code and stegoscheme parameters in the worst case.
void init_code_AC (Code *C, const uint n, const uint k, const double a_cr)
 Initialize the code and stegoscheme parameters in the average case.
void update_code_WC (Code *C, const uint cr)
 Update the code and stegoscheme parameters for the worst case.
void update_code_AC (Code *C, const double a_cr)
 Update the code and stegoscheme parameters for the average case.
void init_generic_codes (Code *C, const uint start, const uint nb, void(*init_fct)(Code *, const uint))
 Generic function to initialize an array of codes.
uint get_len (const Code *C)
 Gives the length of the given code.
uint get_dim (const Code *C)
 Gives the dimension of the given code.
uint get_CR (const Code *C)
 Gives the covering radius of the given code.
uint get_codim (const Code *C)
 Gives the co-dimension of the given code.
double get_EE (const Code *C)
 Gives the embedding efficiency of the stegoscheme based on the given code.
double get_RP (const Code *C)
 Gives the relative payload of the stegoscheme based on the given code.
double get_ACR (const Code *C)
 Gives the average covering radius of the stegoscheme based on the given code.
double get_AEE (const Code *C)
 Gives the average embedding efficiency of the stegoscheme based on the given code.
void display_datum_WC (FILE *out, const Code *C)
 prints the relative payload and the embedding efficiency of the stegoscheme based on the code 'C' in the streamming file 'out', which permits to built the datafile to plot the curve in the worst case.
void display_datum_AC (FILE *out, const Code *C)
 prints the relative payload and the average embedding efficiency of the stegoscheme based on the code 'C' in the streamming file 'out', which permits to built the datafile to plot the curve in the average case.
void display_data_WC (FILE *out, const Code *C, const uint size)
 prints the relative payloads and the embedding efficiencies of the stegoschemes based on the codes array 'C' in the streamming file 'out', which build the datafile to plot the curve in the worst case.
void display_data_AC (FILE *out, const Code *C, const uint size)
 prints the relative payloads and the average embedding efficiencies of the stegoschemes based on the codes array 'C' in the streamming file 'out', which build the datafile to plot the curve in the average case.
void display_code_parameters (FILE *out, const Code *C)
 prints in the streamming file 'out' all parameter of the code and the associated stegoscheme.
void generic_codes_generic_cases (const char *filename, const uint start, const uint nb, void(*init_fct)(Code *, const uint, const uint), void(*display_fct)(FILE *, const Code *, const uint))
 Generic function which initialize any familly of codes and display the result with any appropriate functions.

Detailed Description

Mini librairy to manipulate error correcting codes paramaeters, which are important for code based steganography.

Author
Morgan Barbier morga.nosp@m.n.ba.nosp@m.rbier.nosp@m.@ens.nosp@m.icaen.nosp@m..fr
Version
1.0
Date
2014-10-15

stegocurve is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

stegocurve is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with stegocurve. If not, see http://www.gnu.org/licenses/.

Typedef Documentation

equivalent to struct CODE

Function Documentation

void display_code_parameters ( FILE *  out,
const Code C 
)

prints in the streamming file 'out' all parameter of the code and the associated stegoscheme.

Parameters
[out]outthe streaming file to write in
[in]Cthe code
void display_data_AC ( FILE *  out,
const Code C,
const uint  size 
)

prints the relative payloads and the average embedding efficiencies of the stegoschemes based on the codes array 'C' in the streamming file 'out', which build the datafile to plot the curve in the average case.

Parameters
[out]outthe streaming file to write in
[in]Cthe code
[in]sizethe number of codes in the array C
void display_data_WC ( FILE *  out,
const Code C,
const uint  size 
)

prints the relative payloads and the embedding efficiencies of the stegoschemes based on the codes array 'C' in the streamming file 'out', which build the datafile to plot the curve in the worst case.

Parameters
[out]outthe streaming file to write in
[in]Cthe code
[in]sizethe number of codes in the array C
void display_datum_AC ( FILE *  out,
const Code C 
)

prints the relative payload and the average embedding efficiency of the stegoscheme based on the code 'C' in the streamming file 'out', which permits to built the datafile to plot the curve in the average case.

Parameters
[out]outthe streaming file to write in
[in]Cthe code
void display_datum_WC ( FILE *  out,
const Code C 
)

prints the relative payload and the embedding efficiency of the stegoscheme based on the code 'C' in the streamming file 'out', which permits to built the datafile to plot the curve in the worst case.

Parameters
[out]outthe streaming file to write in
[in]Cthe code
void free_codes ( Code **  C)

desallocates C a codes array.

Parameters
[out]Ccodes array to desallocate
void generic_codes_generic_cases ( const char *  filename,
const uint  start,
const uint  nb,
void(*)(Code *, const uint, const uint init_fct,
void(*)(FILE *, const Code *, const uint display_fct 
)

Generic function which initialize any familly of codes and display the result with any appropriate functions.

Parameters
[in]filenamethe name of the output file
[in]startthe smallest parameter of the familly
[in]nbthe number of codes in the familly
[in]init_fctpointer on initialization function
[in]display_fctpointer on display function
double get_ACR ( const Code C)

Gives the average covering radius of the stegoscheme based on the given code.

Parameters
[in]Cthe error correcting code
Returns
average covering raius of the code as 'double'
double get_AEE ( const Code C)

Gives the average embedding efficiency of the stegoscheme based on the given code.

Parameters
[in]Cthe error correcting code
Returns
average embedding efficiency of the code as 'double'
uint get_codim ( const Code C)

Gives the co-dimension of the given code.

Parameters
[in]Cthe error correcting code
Returns
co-dimension of the code as 'uint'
uint get_CR ( const Code C)

Gives the covering radius of the given code.

Parameters
[in]Cthe error correcting code
Returns
covering radius of the code as 'uint'
uint get_dim ( const Code C)

Gives the dimension of the given code.

Parameters
[in]Cthe error correcting code
Returns
dimension of the code as 'uint'
double get_EE ( const Code C)

Gives the embedding efficiency of the stegoscheme based on the given code.

Parameters
[in]Cthe error correcting code
Returns
embedding efficiency as 'double'
uint get_len ( const Code C)

Gives the length of the given code.

Parameters
[in]Cthe error correcting code
Returns
length of the code as 'uint'
double get_RP ( const Code C)

Gives the relative payload of the stegoscheme based on the given code.

Parameters
[in]Cthe error correcting code
Returns
relative payload as 'double'
void init_code_AC ( Code C,
const uint  n,
const uint  k,
const double  a_cr 
)

Initialize the code and stegoscheme parameters in the average case.

Parameters
[out]Cthe code where we initialize the parameters
[in]nthe length of the code
[in]kthe dimension of the code
[in]a_craverage covering radius of the code
void init_code_WC ( Code C,
const uint  n,
const uint  k,
const uint  cr 
)

Initialize the code and stegoscheme parameters in the worst case.

Parameters
[out]Cthe code where we initialize the parameters
[in]nthe length of the code
[in]kthe dimension of the code
[in]crcovering radius of the code
void init_generic_codes ( Code C,
const uint  start,
const uint  nb,
void(*)(Code *, const uint init_fct 
)

Generic function to initialize an array of codes.

Parameters
[out]Cthe array of codes to initialize
[in]startthe smallest parameter
[in]nbthe size of the array
[in]init_fctthe function pointer to initialize the array
void malloc_codes ( Code **  C,
const uint  nb 
)

Allocates C a codes array of size nb.

Parameters
[out]Ccodes array to allocate
[in]nbthe size of the codes array
void update_code_AC ( Code C,
const double  a_cr 
)

Update the code and stegoscheme parameters for the average case.

Parameters
[in,out]Cthe code where we initialize the parameters
[in]a_craverage covering radius of the code
void update_code_WC ( Code C,
const uint  cr 
)

Update the code and stegoscheme parameters for the worst case.

Parameters
[in,out]Cthe code where we initialize the parameters
[in]crcovering radius of the code