An Efficient Parallel Algorithm for Skein Hash Functions

An Efficient Parallel Algorithm for Skein Hash Functions

AN EFFICIENT PARALLEL ALGORITHM FOR SKEIN HASH FUNCTIONS K´evin Atighehchi, Adriana Enache, Traian Muntean, Gabriel Risterucci ERISCS Research Group Universit´ede la M´editerran´ee Parc Scientifique de Luminy-Marseille, France email: [email protected] ABSTRACT by SHA-3: it may be parallelizable, more suitable for cer- Recently, cryptanalysts have found collisions on the MD4, tain classes of applications, more efficient to implement MD5, and SHA-0 algorithms; moreover, a method for find- on actual platforms, or may avoid some of the incidental ing SHA1 collisions with less than the expected calculus generic properties (such as length extension) of the Merkle- complexity has been published. The NIST [1] has thus de- Damgard construct ([10] [9]) that often results in insecure cided to develop a new hash algorithm, so called SHA-3, applications. which will be developed through a public competition [3]. This paper describes sequential and parallel algo- From the set of accepted proposals for the further steps of rithms for Skein cryptographic hash functions, and the the competition, we have decided to explore the design of analysis, testing and optimization thereof. Our approach an efficient parallel algorithm for the Skein [12] hash func- for parallelizing Skein uses the tree hash mode which cre- tion family. The main reason for designing such an algo- ates one virtual thread for each node of the tree, thus rithm is to obtain optimal performances when dealing with providing a generic method for fine-grain maximal paral- critical applications which require efficiently tuned imple- lelism. mentations on multi-core target processors. This prelimi- The paper is structured as following: Section 2 and nary work presents one of the first parallel implementation 3 give a brief description of Skein and a detailed descrip- and associated performance evaluation of Skein available tion of the associated Tree Mode, the Section 4 presents the in the literature. To parallelize Skein we have used the tree potential approaches for parallelism. Then we present the hash mode in which we create one virtual thread for each work done for parallelizing the hash algorithm: speedup, node of the tree. implementation description, testing and first elements of performance evaluation for basic platforms parallel im- KEY WORDS plementations. Finally, some recommendations for future Skein, SHA-3, parallel cryptographic algorithms, secure work are given in the last chapter. communicating systems. 1 Introduction 2 Brief description of Skein Skein [12] is a new family of cryptographic hash functions The structure of the Skein algorithm (Unique Block Itera- which is one of the candidates in the SHA-3 competition tion, UBI chaining) has its origin in the Sponge hash func- [15]. Its design combines speed, security, simplicity, and a tions [7][8]. great deal of flexibility in a modular package. Definition [8]: Let A be an alphabet group which rep- In 2005, security flaws were identified in SHA-1 resents both input and outputcharacters and let C be a finite [16][2], indicating that a stronger hash function is highly set whose elements represent the inner part of the state of a desirable. The NIST [1] then published four additional sponge. A sponge function takes as input a variable-length hash functions in the SHA family, named after their digest string p of characters of A that does not end with 0 and pro- length (in bits): SHA-224, SHA-256, SHA-384, SHA-512. duces an infinite output string z of characters of A . It is These are known as the SHA-2 family which does not share determined by a transformation f of A × C . the weakness of SHA-1. Skein acts like a sponge function: it takes a variable The SHA-3 project was announced in November length string of characters as its input and produces an infi- 2007 and was motivated by the collision attacks on com- nite output string (it can generate long output by using the monly used hash algorithms (MD5 and SHA-1). The new threefish block cipher in counter mode). The capacity of hash function is not linked to its predecessor, so that an the sponge function is replaced in Skein by a tweak which attack on SHA-2 is unlikely to be applicable to SHA-3. is unique for each block. Since the new proposals are intended to be a drop- A sponge function acts by absorbing and squeezing in replacement for the SHA-2 family of algorithms, some its input; these steps in Skein correspond to the process- properties of the SHA-2 family must be preserved. How- ing stage and the output function. The main difference be- ever, some new properties and features shall be provided tween sponge functions and UBI chaining is that the input chaining value for the UBIs of the output function is the • Full Skein: The general form of Skein admits key pro- same, while in the sponge function it depends on the previ- cessing, tree hashing and optional arguments (for ex- ous state. ample, personalization string, public key, key identi- Skein also has a configuration block that is processed fier, nonce, and so on). The tree mode replaces the before any other blocks. single UBI call which processes the message by a tree The hash functions in the Skein family use three dif- of UBI calls. ferent sizes for internal state : 256, 512 and 1024 bits: The result of the last UBI call (the root UBI call • Skein-512: the primary proposal; it should remain se- in the case of tree processing) is an input to the Output cure for the foreseeable future. function which generates a hash of desired size. • Skein-1024: the ultra-conservative variant. If some future attack managed to break Skein-512, it should The followings sections recall the two modes of Skein remain secure. Also, with dedicated hardware it can intended to be widely used, the Simple Hash mode and the run twice as fast as Skein-512. Hash Tree mode, a mode specifically designed for parallel implementations (see [12] for more information). • Skein-256: the low memory variant. It can be imple- mented using about 100 bytes of memory. 3 Simple Hash Mode Skein uses Threefish as a tweakable block cipher, with the UBI chaining mode to build a compression func- 3.1 Specification tion that maps an arbitrary input size to a fixed output size. For instance, Figure 6 shows a UBI computation for Skein- A simple Skein hash computation has the following inputs: 512 on a 166-byte (three blocks) input, which makes three calls to Threefish-512. Nb The internal state size, in bytes (32, 64 or 128). The core of Threefish is a non-linear mixing func- tion called MIX that operates on two 64-bit words. This No The output size, in bits. cipher repeats operations on a block a certain number of rounds (72 for Threefish-256 and Threefish-512, 80 for M The message to be hashed, a string of up to 299 − 8 Threefish-1024), each of these rounds being composed of bits (296 − 1 bytes). a certain number of MIX functions (2 for Threefish-256, 4 for Threefish-512 and 8 for Threefish-1024) followed by Let C be the configuration string for which Yl = Yf = a permutation. A subkey is injected every four rounds. Ym =0. We define: For a parallel implementation, each mix operation could be assigned to one thread since, for a given round, they ′ Nb K := 0 a string of Nb zerobytes (1) operate on different 128-bit blocks. In theory, we could G UBI K′,C,T 120 (2) achieve a maximum speedup of 2 with Threefish-256, 4 0 := ( cfg2 ) 120 with Threefish-512 and 8 with Threefish-1024 provided G1 := UBI(G0,M,Tmsg2 ) (3) that, at each round, waiting times (for instance for schedul- H := Output(G1,No) (4) ing) between threads are negligible, a permutation being performed at the end of each round. where H is the result of the hash. Skein is built with three basic elements: the block ci- pher (Threefish), the UBI, and an argument (containing a If the three parameters Yl, Yf and Ym are not all 0, configuration block and optional arguments). The config- then the straight UBI operation of the equation (3) is re- uration block is mainly used for tree hash, while optional placed by a tree of UBI operations as defined in the Section arguments make it possible to create different hash func- 4.1. tions for different purposes, all based on Skein. Skein can work in two modes of operation, which are built on chaining the UBI operations: 3.2 Remarks • Simple hash: Takes a variable sized input and returns UBI is a chaining mode for the Threefish cipher, so there the corresponding hash. It is a simple and reduced is no underlying parallelism other than that which can be version of the full Skein mode. For instance, with a obtained with the Threefish block encryption as explained hash process where the desired output size is equal to above. The Output operation of the equation (4) is in fact a the internal state size it consists of three chained UBI sequence of UBI operations iterated according to a counter functions, the first processes the configuration string, mode, thus the output operation can be done in parallel by the second the message and the last is used to supply assigning the UBI operations to each thread according to a the output. round robin arrangement. 4 Hash Tree Mode 3. If neither of these conditions holds, we create the next tree level. We split Ml into blocks 4.1 Specification Ml,0,Ml,1, ..., Ml,k−1, where all blocks are of size Nn, except the last which may be smaller.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    11 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us