YAARX: Yet Another ARX Toolkit
0.1
|
Header file for xlp-add.cc: More...
Go to the source code of this file.
Functions | |
double | xlp_add_exper (const WORD_T ma, const WORD_T mb, const WORD_T mc, const WORD_T word_size) |
double | xlc_add (const WORD_T ma, const WORD_T mb, const WORD_T mc, const WORD_T word_size) |
int | xlc_add_sign (const WORD_T ma, const WORD_T mb, const WORD_T mc, const WORD_T word_size) |
double | xlp_add (const WORD_T ma, const WORD_T mb, const WORD_T mc, const WORD_T word_size) |
double | xlb_add (const WORD_T ma, const WORD_T mb, const WORD_T mc, const WORD_T word_size) |
WORD_T | get_masks_rev_ibit (const WORD_T ma, const WORD_T mb, const WORD_T mc, const WORD_T word_size, const WORD_T ibit) |
int | xlc_add_log2 (const uint32_t ma, const uint32_t mb, const uint32_t mc, const uint32_t word_size) |
Header file for xlp-add.cc:
|
inline |
Return the reverse of the ibit-th bit i.e. the bit at position (word_size - ibit - 1)-th of masks ma, mb and mc as an octal word: WORD_T word = (mc_i << 2) | (mb_i << 1) | (ma_i << 0);
double xlb_add | ( | const WORD_T | ma, |
const WORD_T | mb, | ||
const WORD_T | mc, | ||
const WORD_T | word_size | ||
) |
Compute the bias of the following linear approximation of modular addition:
(a . ma) ^ (b . mb) = (c . mc)
where (x . ma) denotes the dot product between the word x and the mask mx.
xlb is computed from xlp using the relation:
xlb = xlp - 1/2
ma | first input mask. |
mb | second input mask. |
mc | output mask. |
word_size | word size in bits |
|
inline |
Optimized version of xlc_add_nopt
if at state 0 halt (probability = 1/2, bias = 0)
if at state 0 halt (probability = 1/2, bias = 0)
|
inline |
The absolute XOR linear correlation of ADD ( ) Complexity: .
XLC is the correlation of the following linear approximation of modular addition, computed over the inputs a and b
(a . ma) ^ (b . mb) = (c . mc)
where (x . ma) denotes the dot product between the word x and the mask mx.
ma | first input mask. |
mb | second input mask. |
mc | output mask. |
word_size | word size in bits |
bias = prob - 1/2 corr = (2 * bias) = (2 * prob) - 1
Optimized version
int xlc_add_sign | ( | const WORD_T | ma, |
const WORD_T | mb, | ||
const WORD_T | mc, | ||
const WORD_T | word_size | ||
) |
Compute the sign of the XOR linear correlation of ADD ( )
ma | first input mask. |
mb | second input mask. |
mc | output mask. |
word_size | word size in bits |
double xlp_add | ( | const WORD_T | ma, |
const WORD_T | mb, | ||
const WORD_T | mc, | ||
const WORD_T | word_size | ||
) |
The XOR linear probability of ADD ( ) Complexity: .
XLP is the probability over the inputs a and b that the following equation holds:
(a . ma) ^ (b . mb) = (c . mc)
where (x . ma) denotes the dot product between the word x and the mask mx.
xlp is computed from xlc using the relation:
xlc = (2 * xlp) - 1
together with the fact that the sign of xlc is -1 iff HW((ma ^ mc) & (mb ^ mc)) is odd.
ma | first input mask. |
mb | second input mask. |
mc | output mask. |
word_size | word size in bits |
double xlp_add_exper | ( | const WORD_T | ma, |
const WORD_T | mb, | ||
const WORD_T | mc, | ||
const WORD_T | word_size | ||
) |
The XOR linear probability of ADD ( ) computed experimentally over all inputs. Complexity: .
XLP is the probability over the inputs a and b that the following equation holds:
(a . ma) ^ (b . mb) = (c . mc)
where (x . ma) denotes the dot product between the word x and the mask mx.
ma | first input mask. |
mb | second input mask. |
mc | output mask. |
word_size | word size in bits |