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

The ADD differential probability of left shift (LSH): $\mathrm{adp}^{\ll}$ and right shift (RSH): $\mathrm{adp}^{\gg}$. More...

#include "common.hh"
#include "adp-shift.hh"

Functions

double adp_lsh_exper (uint32_t da, uint32_t db, int l)
 
double adp_lsh (uint32_t da, uint32_t db, int l)
 
double adp_rsh_exper (const uint32_t da, const uint32_t db, const int r)
 
void adp_rsh_odiffs (uint32_t dx[4], const uint32_t da, int r)
 
double adp_rsh (uint32_t da, uint32_t db, int r)
 

Detailed Description

The ADD differential probability of left shift (LSH): $\mathrm{adp}^{\ll}$ and right shift (RSH): $\mathrm{adp}^{\gg}$.

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

Function Documentation

double adp_lsh ( uint32_t  da,
uint32_t  db,
int  l 
)

The ADD differential probability of $({\ll})$ (LSH). Complexity: $O(1)$.

Parameters
dainput difference.
dboutput difference.
lshift constant.
Returns
$\mathrm{adp}^{\ll}(l |~ da \rightarrow db)$.
See Also
adp_lsh_exper
double adp_lsh_exper ( uint32_t  da,
uint32_t  db,
int  l 
)

The ADD differential probability of $({\ll})$ (LSH) computed experimentally over all inputs. Complexity: $O(2^n)$.

Parameters
dainput difference.
dboutput difference.
lshift constant.
Returns
$\mathrm{adp}^{\ll}(l |~ da \rightarrow db)$.
See Also
adp_lsh
double adp_rsh ( uint32_t  da,
uint32_t  db,
int  r 
)

The ADD differential probability of $({\gg})$ (RSH). Complexity: $O(1)$.

Parameters
dainput difference.
dboutput difference.
rshift constant.
Returns
$\mathrm{adp}^{\gg}(r |~ da \rightarrow db)$.
See Also
adp_rsh_exper
Note
$db \in \{(da \gg 5), (da \gg 5) + 1, (da \gg 5) - 2^{n-5}, (da \gg 5) - 2^{n-5} + 1\}$.
double adp_rsh_exper ( const uint32_t  da,
const uint32_t  db,
const int  r 
)

The ADD differential probability of $({\gg})$ (RSH) computed experimentally over all inputs. Complexity: $O(2^n)$.

Parameters
dainput difference.
dboutput difference.
rshift constant.
Returns
$\mathrm{adp}^{\gg}(r |~ da \rightarrow db)$.
See Also
adp_rsh
void adp_rsh_odiffs ( uint32_t  dx[4],
const uint32_t  da,
int  r 
)

Compute the set of possible output differences dx after a right shift by r

Parameters
dainput difference.
rshift constant.
dxthe set of all 4 possible output differences.