arith.h File Reference

#include "buff.h"

Include dependency graph for arith.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  distrib_t
struct  code_arith

Defines

#define PREC_TOTAL   32
#define PREC_INTER   ((2 * PREC_TOTAL) / 3)
#define PREC_PROBA   (PREC_TOTAL - PREC_INTER)
#define distrib_get_proba(d, i)   ((d).prob[(i) - (d).min])

Typedefs

typedef struct code_aritharith_t

Functions

arith_t arith_init (struct buff *b)
int coder (int i, distrib_t d, arith_t state)
int coder_uniforme (unsigned long i, unsigned long n, arith_t state)
int coder_bin_fin (int i, arith_t state)
int decoder (distrib_t d, int *lettre, arith_t state)
unsigned long decoder_uniforme (unsigned long n, unsigned long *lettre, arith_t state)
int decoder_bin_fin (arith_t state)
int tester_fin (arith_t state)
int tester_compteur (arith_t state)


Define Documentation

#define distrib_get_proba ( d,
 )     ((d).prob[(i) - (d).min])

#define PREC_INTER   ((2 * PREC_TOTAL) / 3)

#define PREC_PROBA   (PREC_TOTAL - PREC_INTER)

#define PREC_TOTAL   32

Definition at line 26 of file arith.h.


Typedef Documentation

typedef struct code_arith * arith_t


Function Documentation

arith_t arith_init ( struct buff b  ) 

Definition at line 69 of file arith.c.

References code_arith::buffer, code_arith::compteur, code_arith::max, code_arith::min, and PREC_INTER.

Referenced by dicho_b2cw(), and dicho_cw2b().

int coder ( int  i,
distrib_t  d,
arith_t  state 
)

Definition at line 137 of file arith.c.

References ajuster(), code_arith::buffer, bwrite_lock(), code_arith::compteur, distrib_get_proba, distrib_t::max, code_arith::max, code_arith::min, PREC_INTER, and PREC_PROBA.

Referenced by dicho_rec().

Here is the call graph for this function:

int coder_bin_fin ( int  i,
arith_t  state 
)

int coder_uniforme ( unsigned long  i,
unsigned long  n,
arith_t  state 
)

Definition at line 176 of file arith.c.

References ajuster(), code_arith::buffer, bwrite_lock(), code_arith::compteur, code_arith::max, code_arith::min, and PREC_INTER.

Referenced by dicho().

Here is the call graph for this function:

int decoder ( distrib_t  d,
int *  lettre,
arith_t  state 
)

int decoder_bin_fin ( arith_t  state  ) 

unsigned long decoder_uniforme ( unsigned long  n,
unsigned long *  lettre,
arith_t  state 
)

Definition at line 289 of file arith.c.

References ajuster(), blook(), bread_lock(), bstep(), code_arith::buffer, code_arith::compteur, code_arith::max, code_arith::min, and PREC_INTER.

Referenced by dichoinv().

Here is the call graph for this function:

int tester_compteur ( arith_t  state  ) 

int tester_fin ( arith_t  state  ) 


This work was partially suported by Europian Network of Excellence, ECRYPT; ECRYPT