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

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

Go to the source code of this file.

Macros

#define ADP_XOR_MSIZE   8
 
#define ADP_XOR_NMATRIX   8
 
#define ADP_XOR_NINPUTS   2
 
#define ADP_XOR_ISTATE   4
 
#define ADP_XOR_COLSUM   4
 
#define ADP_XOR_NORM   1.0 /(double)ADP_XOR_COLSUM
 

Functions

void adp_xor_alloc_matrices (gsl_matrix *A[2][2][2])
 
void adp_xor_free_matrices (gsl_matrix *A[2][2][2])
 
void adp_xor_normalize_matrices (gsl_matrix *A[2][2][2])
 
void adp_xor_print_matrices (gsl_matrix *A[2][2][2])
 
void adp_xor_print_matrices_sage (gsl_matrix *A[2][2][2])
 
void adp_xor_sf (gsl_matrix *A[2][2][2])
 
double adp_xor (gsl_matrix *A[2][2][2], const WORD_T da, const WORD_T db, const WORD_T dc)
 
double adp_xor_exper (const WORD_T da, const WORD_T db, const WORD_T dc)
 

Detailed Description

Header file for adp-xor.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_COLSUM   4

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

#define ADP_XOR_ISTATE   4

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

#define ADP_XOR_MSIZE   8

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

#define ADP_XOR_NINPUTS   2

Number of inputs to the XOR operation.

#define ADP_XOR_NMATRIX   8

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

#define ADP_XOR_NORM   1.0 /(double)ADP_XOR_COLSUM

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

Function Documentation

double adp_xor ( gsl_matrix *  A[2][2][2],
const WORD_T  da,
const WORD_T  db,
const WORD_T  dc 
)

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

Parameters
Atransition probability matrices for $\mathrm{adp}^{\oplus}$ computed with adp_xor_sf.
dafirst input difference.
dbsecond input difference.
dcoutput difference.
Returns
$\mathrm{adp}^{\oplus}(da,db \rightarrow db)$.
See Also
xdp_add
void adp_xor_alloc_matrices ( gsl_matrix *  A[2][2][2])

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

Parameters
Atransition probability matrices for $\mathrm{adp}^{\oplus}$.
See Also
adp_xor_free_matrices
double adp_xor_exper ( const WORD_T  da,
const WORD_T  db,
const WORD_T  dc 
)

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

Parameters
dafirst input difference.
dbsecond input difference.
dcoutput difference.
Returns
$\mathrm{adp}^{\oplus}(da,db \rightarrow db)$.
See Also
adp_xor
void adp_xor_free_matrices ( gsl_matrix *  A[2][2][2])

Free memory reserved by a previous call to adp_xor_alloc_matrices.

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

Transform the elements of A into probabilities.

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

Print the matrices for $\mathrm{adp}^{\oplus}$.

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

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

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

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

Parameters
Azero-initialized set of matrices.
Returns
Transition probability matrices A for $\mathrm{adp}^{\oplus}(da,db \rightarrow db)$.

$A[2][2][2] = A[da[i]][db[i]][dc[i]]$, where

  • $da[i]$ : the i-th bit of the first input difference.
  • $db[i]$ : the i-th bit of the second input difference.
  • $dc[i]$ : the i-th bit of the output difference.
See Also
xdp_add_sf