YAARX: Yet Another ARX Toolkit  0.1
 All Data Structures Files Functions Variables Macros Pages
adp-xor-fi.hh File Reference

Header file for adp-xor-fi.cc: More...

Go to the source code of this file.

Macros

#define ADP_XOR_FI_MSIZE   4
 
#define ADP_XOR_FI_NINPUTS   2
 
#define ADP_XOR_FI_ISTATE   2
 
#define ADP_XOR_FI_NMATRIX   8
 
#define ADP_XOR_FI_COLSUM   2
 
#define ADP_XOR_FI_NORM   1.0 /(double)ADP_XOR_FI_COLSUM
 

Functions

void adp_xor_fixed_input_alloc_matrices (gsl_matrix *A[2][2][2])
 
void adp_xor_fixed_input_free_matrices (gsl_matrix *A[2][2][2])
 
void adp_xor_fixed_input_normalize_matrices (gsl_matrix *A[2][2][2])
 
void adp_xor_fixed_input_print_matrices_sage (gsl_matrix *A[2][2][2])
 
void adp_xor_fixed_input_sf (gsl_matrix *A[2][2][2])
 
double adp_xor_fixed_input (gsl_matrix *A[2][2][2], uint32_t a, uint32_t db, uint32_t dc)
 
double adp_xor_fixed_input_exper (const uint32_t a, const uint32_t db, const uint32_t dc)
 

Detailed Description

Header file for adp-xor-fi.cc:

Author
V.Velichkov, vesse.nosp@m.lin..nosp@m.velic.nosp@m.hkov.nosp@m.@uni..nosp@m.lu
Date
2012-2013

Macro Definition Documentation

#define ADP_XOR_FI_COLSUM   2

Sum of non-zero elements in one column of the $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$ matrices.

#define ADP_XOR_FI_ISTATE   2

Initial state for computing the $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$ S-function.

#define ADP_XOR_FI_MSIZE   4

Number of state values in the $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$ S-function.

#define ADP_XOR_FI_NINPUTS   2

Number of inputs to the XOR operation.

#define ADP_XOR_FI_NMATRIX   8

Number of $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$ matrices.

#define ADP_XOR_FI_NORM   1.0 /(double)ADP_XOR_FI_COLSUM

Normalization factor for the $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$ matrices.

Function Documentation

double adp_xor_fixed_input ( gsl_matrix *  A[2][2][2],
uint32_t  a,
uint32_t  db,
uint32_t  dc 
)

The additive differential probability (ADP) of $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$. Complexity: $O(n)$.

Parameters
Atransition probability matrices for $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$ computed with adp_xor_fixed_input_sf.
ainput value.
dbinput difference.
dcoutput difference.
Returns
$\mathrm{adp}^{\oplus}(a,db \rightarrow db)$.
void adp_xor_fixed_input_alloc_matrices ( gsl_matrix *  A[2][2][2])

Allocate memory for the transition probability matrices for $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$.

Parameters
Atransition probability matrices for $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$.
See Also
adp_xor_fixed_input_free_matrices
double adp_xor_fixed_input_exper ( const uint32_t  a,
const uint32_t  db,
const uint32_t  dc 
)

The additive differential probability (ADP) of $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$ computed experimentally over all inputs. Complexity: $O(2^{n})$.

Parameters
ainput value.
dbinput difference.
dcoutput difference.
Returns
$\mathrm{adp}^{\oplus}(a,db \rightarrow db)$.
See Also
adp_xor_fixed_input
void adp_xor_fixed_input_free_matrices ( gsl_matrix *  A[2][2][2])

Free memory reserved by a previous call to adp_xor_fixed_input_alloc_matrices.

Parameters
Atransition probability matrices for $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$.
void adp_xor_fixed_input_normalize_matrices ( gsl_matrix *  A[2][2][2])

Transform the elements of A into probabilities.

Parameters
Atransition probability matrices for $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$.
void adp_xor_fixed_input_print_matrices_sage ( gsl_matrix *  A[2][2][2])

Print the matrices for $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$ in a format readable by the computer algebra system Sage (http://www.sagemath.org/).

Parameters
Atransition probability matrices for $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$.
void adp_xor_fixed_input_sf ( gsl_matrix *  A[2][2][2])

S-function for $\mathrm{adp}^{\oplus}_{\mathrm{FI}}$: $\mathrm{adp}^{\oplus}(a,db \rightarrow db)$.

Parameters
Azero-initialized set of matrices.
Returns
Transition probability matrices A.

A[2][2][2] = A[a[i]][db[i]][dc[i]], where

  • a[i] : the i-th bit of the fixed input.
  • db[i] : the i-th bit of the input difference.
  • dc[i] : the i-th bit of the output difference.