# REISCH: Incorporating Lightweight and Reliable Algorithms into Healthcare Applications of WSNs
## 4 BLAKE family  
[PERSON] et al. [55] proposed a BLAKE hash algorithm to overcome the efficiency problems in previous hash algorithms. This algorithm offers several features such as simplicity, speed, and parallel operations in hardware and software implementations. It is immune to second preimage, side-channel and length-extension attacks. BLAKE implements HAIFA construction which is an enhanced version of Merkle-Damgard. This development of construction is accomplished by adding a salt and a counter to the algorithm stages to prevent security vulnerability for second preimage attacks in Merkle-Damgard. BLAKE's local wide-pipe structure also makes collision attacks impossible [47]. BLAKE uses the LAKE hash algorithm and compresses the message blocks in hash-tree constructions with [PERSON]'s stream cipher ChaCha, which is a variation of Salsa20-256. [PERSON] and [PERSON] [56] considered NIST, a BLAKE \begin{table}
\begin{tabular}{l l l l l l l l l l l} \hline \hline
**Algorithm** & **SHA1** & \multicolumn{3}{c}{**SHA2**} & \multicolumn{5}{c}{**SHA3**} \\ \hline MD & 160 & 224 & 256 & 384 & 512 & 224 & 256 & 384 & 512 \\ \hline Word size & 32 & 32 & 32 & 64 & 64 & 64 & 64 & 64 & 64 \\ \hline Block size & 512 & 512 & 512 & 1024 & 1024 & 1152 & 1088 & 832 & 576 \\ \hline Message size & \textless{}264 & \textless{}264 & \textless{}264 & \textless{}2128 & \textless{}2128 & - & - & - & - \\ \hline Iterations & 80 & 64 & 64 & 80 & 80 & 24 & 24 & 24 & 24 \\ \hline Security & 80 & 112 & 128 & 192 & 256 & 112 & 128 & 192 & 256 \\ \hline \multirow{3}{*}{Weak security} & Yes, practical & \multirow{3}{*}{\begin{tabular}{} \end{tabular} } & Yes, practical & \multirow{3}{*}{\
\begin{tabular}{} \end{tabular} } & Yes, theoretical & \multirow{3}{*}{
\begin{tabular}{} \end{tabular} } \\  & such as & & & & such as & \\ \cline{1-1}  & Collision and preimage & & preimage and length extension & & fault injection & \\ \hline Performance & Fast & Less & & & Lowest & \\ \hline Year & 1995 & 2004 & & & 2015 & \\ \hline Designer & NSA & & & & & [PERSON] and et al. \\ \hline Construction & Merkle–Damgárd & & & & Sponge & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of SHA family. Figure 2: The Merkle–Damgárd construction of SHA (0, 1 and 2) hash functions. of competing algorithms, in the final round of hash algorithms such as KECCAK. BLAKE supports several versions: 244, 256, 384, and 512. Subsequently, [PERSON] et al. [57] developed BLAKE2 to improve the speed in software implementation and to reduce memory. BLAKE2 has 32% less memory than BLAKE. In addition, BLAKE2 contains two versions, BLAKE2s and BLAKE2b, to be used with 32-bit and 64-bit platforms, respectively. Moreover, the authors developed the latest versions, BLAKE2 bp and BLAKE2 sp, to improve the speed of MD production during parallel processes. Table 2 shows the BLAKE family [50]. Figure 3 shows the architecture of the BLAKE hash function. In BLAKE, the message is divided into blocks, and the last block is padded with 1 followed by zeros to complete the last block size to 512 or 1024 bits. BLAKE consists of two parts: the compression function and iteration mode. The compression function consists of chain value, message blocks, salt value, and counter value. The BLAKE compression function uses three phases: initialization, round functions, and finalization. The initialization phase uses the chain value, salt, and counter to create a 4 \(\times\) 4 matrix, and produces a 16-word value for different initializing states (\(V\)). These states are entered into the round function (\(r\)) with parallel rounds in the phase of the round functions. The output of this phase is a new \(V\) that is used to generate the chain value for the finalization phase. In the finalization phase of the chain, salt and new state values are applied with \(\oplus\) operations to produce a new chain value. BLAKE is one of the fastest hash algorithms and has strong security [50; 58]. Recent research has pointed out that BLAKE is a suitable algorithm for source limited devices [59; 60].