Threefish is a symmetric-key tweakable block cipher designed as part of the Skein hash function, an entry in the NIST hash function competition. Threefish uses no S-boxes or other table lookups in order to avoid cache timing attacks; its nonlinearity comes from alternating additions with exclusive ORs. In that respect, it is similar to Salsa20, TEA, and the SHA-3 candidates CubeHash and BLAKE. Threefish and the Skein hash function were designed by Bruce Schneier, Niels Ferguson, Stefan Lucks, Doug Whiting, Mihir Bellare, Tadayoshi Kohno, Jon Callas, and Jesse Walker. "Threefish is unpatented, and the source code is uncopyrighted and license-free; it is free for all uses."
Description of the cipher Threefish works on words of 64 bits (unsigned Little endian integers). w ∈ { 4 , 8 , 16 } {\displaystyle w\in \{4,8,16\}} is the number of plaintext words and also of key words. The tweak consists of two words. All additions and subtractions are defined modulo 2 64 {\displaystyle 2^{64}} .
Key schedule Threefish encrypts in r {\displaystyle r} rounds and uses r 4 + 1 {\displaystyle {\frac {r}{4}}+1} different round keys. After every four rounds, and before the first, w {\displaystyle w} round key words are added to the w {\displaystyle w} data words. To calculate the round keys an additional key word k w {\displaystyle k_{w}} is appended to the original key words k 0 , k 1 , … , k w − 1 {\displaystyle k_{0},k_{1},\dots ,k_{w-1}} . Also, an additional tweak word t 2 {\displaystyle t_{2}} is appended to the tweak words t 0 , t 1 {\displaystyle t_{0},t_{1}} .
k w = C ⊕ k 0 ⊕ k 1 ⊕ ⋯ ⊕ k w − 1 ; C = 0x1BD11BDAA9FC1A22 {\displaystyle k_{w}=C\oplus k_{0}\oplus k_{1}\oplus \dots \oplus k_{w-1};\quad C={\text{0x1BD11BDAA9FC1A22}}}
t 2 = t 0 ⊕ t 1 {\displaystyle t_{2}=t_{0}\oplus t_{1}}
The purpose of the seemingly arbitrary constant C {\displaystyle C} is to frustrate some attacks that take advantage of the relationship between k w {\displaystyle k_{w}} and the other keywords. The round key words k s , i {\displaystyle k_{s,i}} are now defined like this:
… excerpt ends here. Continue reading the full article.



