dicho.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "buff.h"
#include "arith.h"
#include "precomp.h"

Include dependency graph for dicho.c:

Go to the source code of this file.

Data Structures

struct  elt

Typedefs

typedef struct eltliste_t

Functions

double round (double)
int l2 (unsigned long x)
liste_t liste_alloc (liste_t s)
void liste_free (liste_t l)
int is_leaf (int m, int t)
unsigned long bino (int a, int b)
unsigned long cw_coder (int *res, int t)
int inv_bino (unsigned long x, int t)
void cw_decoder (unsigned long x, int t, int *res)
int dicho_rec (int *cw, int i, int s, arith_t state, precomp_t p)
int dicho (int *cw, arith_t state, precomp_t p)
int dichoinv_rec (int *cw, int i, int s, int x, arith_t state, precomp_t p)
int dichoinv (int *cw, arith_t state, precomp_t p)
int dicho_b2cw (unsigned char *input_message, int *cw, int start, int len, int m, int t, precomp_t p)
int dicho_cw2b (int *cw, unsigned char *output_message, int start, int len, int m, int t, precomp_t p)

Variables

liste_t liste_todo
liste_t liste_inv
int * aux
int max_bino [] = {0, 0, 0, 0, 0, 128, 64, 64, 32, 32, 32, 32, 32, 32, 32, 32, 32}
unsigned long * table_bino []


Typedef Documentation

typedef struct elt * liste_t


Function Documentation

unsigned long bino ( int  a,
int  b 
)

Definition at line 164 of file dicho.c.

References table_bino.

unsigned long cw_coder ( int *  res,
int  t 
)

Definition at line 168 of file dicho.c.

References table_bino.

Referenced by dicho_rec().

void cw_decoder ( unsigned long  x,
int  t,
int *  res 
)

Definition at line 229 of file dicho.c.

References inv_bino(), round(), and table_bino.

Referenced by dichoinv().

Here is the call graph for this function:

int dicho ( int *  cw,
arith_t  state,
precomp_t  p 
)

int dicho_b2cw ( unsigned char *  input_message,
int *  cw,
int  start,
int  len,
int  m,
int  t,
precomp_t  p 
)

Definition at line 628 of file dicho.c.

References arith_init(), bread(), bread_changer_position(), breadclose(), breadinit(), code_arith::buffer, dichoinv(), precomp::m, precomp::real_m, precomp::real_t, and precomp::t.

Referenced by encrypt_block().

Here is the call graph for this function:

int dicho_cw2b ( int *  cw,
unsigned char *  output_message,
int  start,
int  len,
int  m,
int  t,
precomp_t  p 
)

Definition at line 722 of file dicho.c.

References arith_init(), code_arith::buffer, bwrite(), bwrite_changer_position(), bwriteclose(), bwriteinit(), dicho(), precomp::m, precomp::real_m, precomp::real_t, and precomp::t.

Referenced by decrypt_block().

Here is the call graph for this function:

int dicho_rec ( int *  cw,
int  i,
int  s,
arith_t  state,
precomp_t  p 
)

Definition at line 286 of file dicho.c.

References aux, coder(), cw_coder(), leaf_info_t::deadbits, is_leaf(), precomp::leaf_info, liste_alloc(), leaf_info_t::maximum, elt::maximum, elt::nombre, precomp_get_distrib, elt::taille, and elt::valeur.

Referenced by dicho().

Here is the call graph for this function:

int dichoinv ( int *  cw,
arith_t  state,
precomp_t  p 
)

int dichoinv_rec ( int *  cw,
int  i,
int  s,
int  x,
arith_t  state,
precomp_t  p 
)

Definition at line 442 of file dicho.c.

References leaf_info_t::deadbits, decoder(), elt::element, is_leaf(), precomp::leaf_info, liste_alloc(), leaf_info_t::maximum, elt::maximum, elt::nombre, elt::pos, precomp_get_distrib, elt::taille, and elt::valeur.

Referenced by dichoinv().

Here is the call graph for this function:

int inv_bino ( unsigned long  x,
int  t 
)

Definition at line 207 of file dicho.c.

References max_bino, and table_bino.

Referenced by cw_decoder().

int is_leaf ( int  m,
int  t 
)

int l2 ( unsigned long  x  ) 

Definition at line 25 of file arith.c.

Referenced by adjust_delta(), ajuster(), and leaf_info().

liste_t liste_alloc ( liste_t  s  ) 

Definition at line 44 of file dicho.c.

References elt::suivant.

Referenced by dicho_rec(), and dichoinv_rec().

void liste_free ( liste_t  l  ) 

Definition at line 50 of file dicho.c.

References elt::suivant.

Referenced by dicho(), and dichoinv().

double round ( double   ) 

Referenced by cw_decoder(), and init_proba().


Variable Documentation

int* aux

Definition at line 42 of file dicho.c.

Referenced by decode(), dicho(), dicho_rec(), memory_compl(), poly_eeaux(), and poly_sqrtmod_init().

Definition at line 41 of file dicho.c.

Definition at line 40 of file dicho.c.

int max_bino[] = {0, 0, 0, 0, 0, 128, 64, 64, 32, 32, 32, 32, 32, 32, 32, 32, 32}

Definition at line 68 of file dicho.c.

Referenced by inv_bino().

unsigned long* table_bino[]

Definition at line 69 of file dicho.c.

Referenced by bino(), cw_coder(), cw_decoder(), and inv_bino().


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