#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "buff.h"
#include "arith.h"
#include "precomp.h"
Go to the source code of this file.
Data Structures | |
struct | elt |
Typedefs | |
typedef struct elt * | liste_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 [] |
unsigned long bino | ( | int | a, | |
int | b | |||
) |
unsigned long cw_coder | ( | int * | res, | |
int | t | |||
) |
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().
Definition at line 347 of file dicho.c.
References aux, code_arith::buffer, bwrite(), bwrite_bit(), bwrite_bits(), bwrite_changer_position(), bwrite_decaler_fin(), bwrite_unlocked(), coder_uniforme(), code_arith::compteur, dicho_rec(), buff::fin, liste_free(), precomp::m, elt::maximum, code_arith::min, elt::nombre, PREC_PROBA, elt::suivant, precomp::t, elt::taille, and elt::valeur.
Referenced by dicho_cw2b().
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().
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().
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().
Definition at line 489 of file dicho.c.
References bread(), bread_changer_position(), bread_decaler_fin(), bread_unlocked(), code_arith::buffer, cw_decoder(), decoder_uniforme(), dichoinv_rec(), elt::element, buff::fin, liste_free(), precomp::m, elt::maximum, elt::nombre, elt::pos, PREC_PROBA, elt::suivant, precomp::t, elt::taille, and elt::valeur.
Referenced by dicho_b2cw().
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().
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 | |||
) |
Definition at line 56 of file dicho.c.
Referenced by clear_precomp(), dicho_build_tree(), dicho_rec(), dicho_si_lb_rec(), dicho_si_rec(), dichoinv_rec(), precomp_build(), and write_precomp().
int l2 | ( | unsigned long | x | ) |
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().
int* aux |
Definition at line 42 of file dicho.c.
Referenced by decode(), dicho(), dicho_rec(), memory_compl(), poly_eeaux(), and poly_sqrtmod_init().
int max_bino[] = {0, 0, 0, 0, 0, 128, 64, 64, 32, 32, 32, 32, 32, 32, 32, 32, 32} |
unsigned long* table_bino[] |
Definition at line 69 of file dicho.c.
Referenced by bino(), cw_coder(), cw_decoder(), and inv_bino().