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

Analysis of block cipher Speck [ePrint 2013/404]. More...

#include "common.hh"
#include "speck.hh"

Functions

uint32_t speck_compute_nkeywords (uint32_t word_size, uint32_t key_size)
 
uint32_t speck_get_keysize (uint32_t word_size)
 
void speck_get_rot_const (uint32_t word_size, uint32_t *alpha, uint32_t *beta)
 
uint32_t speck_compute_nrounds (uint32_t word_size, uint32_t nkey_words)
 
void speck_key_expansion (WORD_T key[SPECK_MAX_NROUNDS], uint32_t nrounds, uint32_t nkey_words, uint32_t alpha, uint32_t beta)
 
void speck_encrypt (WORD_T key[SPECK_MAX_NROUNDS], uint32_t nrounds, uint32_t alpha, uint32_t beta, WORD_T *x_in, WORD_T *y_in)
 
void speck_decrypt (WORD_T key[SPECK_MAX_NROUNDS], uint32_t nrounds, uint32_t alpha, uint32_t beta, WORD_T *x_in, WORD_T *y_in)
 

Detailed Description

Analysis of block cipher Speck [ePrint 2013/404].

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

Function Documentation

uint32_t speck_compute_nkeywords ( uint32_t  word_size,
uint32_t  key_size 
)

Compute the number of key words depending on the word size

Parameters
word_sizeword size
key_sizekey size in bits
uint32_t speck_compute_nrounds ( uint32_t  word_size,
uint32_t  nkey_words 
)

Compute the number of rounds for Speck and the index of the z-sequence

Parameters
word_sizeword size
nkey_wordsnumber of key words
Returns
number of rounds
void speck_encrypt ( WORD_T  key[SPECK_MAX_NROUNDS],
uint32_t  nrounds,
uint32_t  alpha,
uint32_t  beta,
WORD_T *  x_in,
WORD_T *  y_in 
)

Speck encryption procedure.

Parameters
keyexpanded key
nroundsnumber of rounds
alpharight rotation constant
betaleft rotation constant
x_infirst plaintext word
y_insecond plaintext word
uint32_t speck_get_keysize ( uint32_t  word_size)

Get the size of the key in bits depending on the word size

Parameters
word_sizeword size in bits
void speck_get_rot_const ( uint32_t  word_size,
uint32_t *  alpha,
uint32_t *  beta 
)

Get the rotation constants.

void speck_key_expansion ( WORD_T  key[SPECK_MAX_NROUNDS],
uint32_t  nrounds,
uint32_t  nkey_words,
uint32_t  alpha,
uint32_t  beta 
)

Speck key expansion procedure.

Parameters
keyoriginal key (with enough space for the expanded key)
nroundsnumber of rounds
nkey_wordsnumber of key words
alpharight rotation constant
betaleft rotation constant