decrypt.c File Reference

#include <stdlib.h>
#include <string.h>
#include "sizes.h"
#include "gf.h"
#include "poly.h"
#include "dicho.h"
#include "randomize.h"

Include dependency graph for decrypt.c:

Go to the source code of this file.

Functions

void sk_from_string (const unsigned char *sk)
void sk_free ()
void xor (unsigned long *a, unsigned long *b)
poly_t syndrome (const unsigned char *b)
int roots_berl_aux (poly_t sigma, int d, poly_t *tr_aux, poly_t *tr, int e, gf_t *res)
int roots_berl (poly_t sigma, gf_t *res)
int partition (int *tableau, int gauche, int droite, int pivot)
void quickSort (int *tableau, int gauche, int droite, int min, int max)
int decode (const unsigned char *b, int *e)
int decrypt_block (unsigned char *cleartext, unsigned char *ciphertext, const unsigned char *sk)
int decrypt_block_ss (unsigned char *message, unsigned char *ciphertext, const unsigned char *sk)

Variables

precomp_t cwdata
poly_t g
poly_t sqrtmod [NB_ERRORS]
gf_tLinv
unsigned long * coeffs


Function Documentation

int decode ( const unsigned char *  b,
int *  e 
)

int decrypt_block ( unsigned char *  cleartext,
unsigned char *  ciphertext,
const unsigned char *  sk 
)

Definition at line 292 of file decrypt.c.

References BITS_TO_BYTES, decode(), dicho_cw2b(), DIMENSION, ERROR_SIZE, ERROR_WEIGHT, LOG_LENGTH, NB_ERRORS, sk_free(), and sk_from_string().

Referenced by decrypt_block_ss(), and main().

Here is the call graph for this function:

int decrypt_block_ss ( unsigned char *  message,
unsigned char *  ciphertext,
const unsigned char *  sk 
)

Definition at line 330 of file decrypt.c.

References CLEARTEXT_LENGTH, decrypt_block(), and unrandomize().

Referenced by main().

Here is the call graph for this function:

int partition ( int *  tableau,
int  gauche,
int  droite,
int  pivot 
)

Definition at line 193 of file decrypt.c.

Referenced by quickSort().

void quickSort ( int *  tableau,
int  gauche,
int  droite,
int  min,
int  max 
)

Definition at line 205 of file decrypt.c.

References partition().

Referenced by decode().

Here is the call graph for this function:

int roots_berl ( poly_t  sigma,
gf_t res 
)

Definition at line 152 of file decrypt.c.

References EXT_DEGREE, gf_unit, NB_ERRORS, poly_addto_coeff, poly_alloc(), poly_calcule_deg(), poly_coeff, poly_free(), poly_set_coeff, poly_set_deg, poly_sqmod(), poly_sqmod_init(), and roots_berl_aux().

Referenced by decode().

Here is the call graph for this function:

int roots_berl_aux ( poly_t  sigma,
int  d,
poly_t tr_aux,
poly_t tr,
int  e,
gf_t res 
)

Definition at line 109 of file decrypt.c.

References EXT_DEGREE, gf_div, gf_exp, gf_mul, gf_square, NB_ERRORS, poly_addto_coeff, poly_alloc(), poly_calcule_deg(), poly_coeff, poly_deg, poly_free(), poly_gcd(), and poly_quo().

Referenced by roots_berl().

Here is the call graph for this function:

void sk_free (  ) 

Definition at line 59 of file decrypt.c.

References NB_ERRORS.

Referenced by decrypt_block().

void sk_from_string ( const unsigned char *  sk  ) 

Definition at line 35 of file decrypt.c.

References BITS_TO_LONG, CODIMENSION, coeffs, LENGTH, Linv, NB_ERRORS, poly_alloc_from_string(), and poly_set_deg.

Referenced by decrypt_block().

Here is the call graph for this function:

poly_t syndrome ( const unsigned char *  b  ) 

Definition at line 77 of file decrypt.c.

References BIT_SIZE_OF_LONG, BITS_TO_LONG, CODIMENSION, coeffs, EXT_DEGREE, LENGTH, NB_ERRORS, poly_alloc(), poly_calcule_deg(), poly_set_coeff, and xor().

Referenced by decode().

Here is the call graph for this function:

void xor ( unsigned long *  a,
unsigned long *  b 
)

Definition at line 69 of file decrypt.c.

References BITS_TO_LONG, and CODIMENSION.

Referenced by syndrome().


Variable Documentation

unsigned long* coeffs

Definition at line 33 of file decrypt.c.

Referenced by sk_from_string(), and syndrome().

Definition at line 4 of file cwdata.c.

Definition at line 31 of file decrypt.c.

Referenced by keypair(), and poly_randgen_irred().

Definition at line 32 of file decrypt.c.

Referenced by decode(), keypair(), and sk_from_string().

poly_t sqrtmod[NB_ERRORS]

Definition at line 31 of file decrypt.c.

Referenced by keypair().


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