This blogpost was written by Jowan Pittevils, who has explored hardware implementations of ForkSkinny. Thanks, Jowan!
The new design strategy that ForkSkinny uses (forking) gives rise to design choices that are inherent to this new way of encrypting data and that no ordinary block cipher offers. What follows is an exposition of some of the possible hardware architectures that can be used to implement a forked block cipher. The described implementations can be found here.
To easily comprehend the most important differences of the architectures, it is necessary to distinguish between the different rounds that happen inside the block cipher. For that reason, the number of rounds before the forking point will be called rinit and the number of rounds of both branches after the forking point will be referred to as r0 and r1, where r1 is the number of rounds of the branch that starts with the updated tweakey from the end of the other branch and the other branch uses r0 rounds.
There are many different ways a hardware implementation can calculate the two ciphertexts, but here we will focus mainly on area-efficiency. Two new (Restart and Retrace) area-focused architectures will be compared to a balanced (Forkreg) and a throughput-focused (Parallel) architecture. The 4 architectures explored are:
-Parallel: This implementation calculates the two branches simultaneously, in parallel.
-Forkreg: In this design, an extra block-sized register called the fork register is used to store the forkstate and to read this state once C0 (ciphertext 0) has been calculated.
-Restart: This architecture restarts from the beginning once C0 is ready to compute the other branch. The main drawback is that the plaintext-data must remain available for at least rinit + r0 rounds.
-Retrace: This architecture is more flexible than Restart. It allows for both encryption and decryption and the plaintext can be forgotten once the internal state has been loaded. This is accomplished by, once C0 has been calculated, decrypting the internal state back up to the point of the fork and then re-encrypting it to become C1.
Parallel
The most obvious way to implement ForkSkinny would be to calculate both states in parallel from the forking point on. This approach requires double the logic for the datapath of the round function, an extra internal state register to store the second branch and finally a bit of hardware that updates the tweakey to be r0 ahead of the oher tweakey. This is possible since there is a constant function f = TKSr1 (.) that can calculate the second branch tweakey from the first branch tweakey. Using this instead of a whole new tweakey state with datapath allows us to have a much more area-efficient design as the whole tweakey register does not need to be duplicated, as well as the LFSR and the permutation. The total number of rounds this approach needs to calculate the ciphertext is rinit + max(r0, r1), which is a good result: two ciphertexts are calculated in the same number of rounds that one ciphertext would take. When looking at area-efficiency, this design is worse than a serial implementation. However, it does not take up double as much area as one might assume when thinking of an implementation with dual parallelism.
For small messages, a round-based encryption-only Parallel ForkSkinny implementation can have higher throughput and area than the round-based encryption-only Skinny.
Fork register
Another option would be to store the internal state at the forking point in a separate, block-sized, register. Once the first ciphertext is computed, the forkstate can be loaded into the internal state registers and the computation can continue with the key state as it was at the end of the first branch. This approach is slower than the parallel one, but is obviously more area-efficient as all of the round-function logic (including a separate block-sized internal state register) gets replaced by one block-sized register and a block-sized multiplexer. Furthermore, no additional tweakey-updating logic is necessary. The number of rounds required to calculate the ciphertext is equal to rinit + r0 + r1. To achieve this architecture, a block-sized register and multiplexer need to be added to the hardware of Skinny, as well as the right control signals for the multiplexer and the write enable of the register. From the implementations results (figure 1), it is clear that the Forkreg approach is better than the parallel one area-wise, but because the parallel tweakey-state and updating logic can be implemented cheaply using the f = TKSr0 (.) function, the Forkreg area-improvement is not that pronounced.
For small messages, the encryption-only design of word-based and round-based Forkreg ForkSkinny can have a higher throughput than word-based and round-based Skinny.

Restart
For the last two ForkSkinny architectures explored here, the main goal is to get rid of the large register that stores the fork state in order to decrease the area-usage. Since the reason for implementing these architectures would be area-efficiency, they are only examined in a word-based design. One of the possibilities is to calculate both branches of the fork separately, first calculating one ciphertext (rinit + r1 rounds), then re-loading the plaintext into the internal state and calculating the other ciphertext (rinit + r1 + r0 rounds). This approach takes a total of 2*rinit + 2*r0 + r1 rounds to calculate the ciphertext. The extra r1 number of rounds arise from the updating of the tweakey to be at the end of the first branch when the second branch is started: when the cipher reaches the forking point for the second time, the tweakey gets updated in r1 rounds while the internal state stays untouched. This way of updating the tweakey can be replaced by using the f = TKSr0 (.) function once, but in practice this adds a large area-cost to a design with a focus on being area-efficient. Because of this, both the Restart and Retrace architectures do not use the fast forwarding of the tweakey state with f = TKSr0 (.).
A downside of using the Restart design is that the plaintext must be available when the calculation of the second ciphertext starts. This can be achieved either internally or externally. Internally this is done with an extra block-sized register. However, if an extra register is needed anyway, the fork register architecture is a better idea, requiring roughly the same area (one block-sized multiplexer and register) but skipping a whole rinit rounds. For this reason, it is assumed that the plaintext stays available externally for the whole calculation when using the Restart architecture.
In terms of area, the restart architecture comes closest of all encryption-only ForkSkinny implementations to normal Skinny, only requiring 270 more GE for the 64-192 version and 382 more for the 128-256 version. This is of course at the cost of throughput since Restart needs more rounds to process blocks of data. Since the other versions (64-64, 64-128, 128-128, 128-384) of Skinny cannot be compared directly they will be left out of the scope of this comparison. The critical path of the Restart architecture is very similar to that of the Forkreg architecture as the fork register is not part of the critical path. Which of the two has the smallest critical path depends on small differences between the two in control logic.
Retrace
The final architecture that seems to be viable is called the Retrace architecture. The idea here is to first calculate a single ciphertext, same as in the other architectures, but then to decrypt this ciphertext back to the forking point. Once this point has been reached, the tweakey gets updated, as in the Restart architecture, and then the second ciphertext gets calculated using the updated tweakey. One encryption takes rinit + 3*r0 + r1 rounds. Going from the encryption architecture to the decryption architecture is just a matter of controlling when the round function is traversed in the inverse direction and when in the forward direction.
As this design requires all of the multiplexers and logic that an encryption/decryption design would need, it is not the optimal choice when the only goal is to encrypt messages. When both encryption and decryption are required however, this design is superior in terms of area to both the Restart and the Forkreg design. It has less stringent requirements than Restart in that the plaintext does not need to stay available during the calculation and has better area-efficiency than the Forkreg design, as no extra register is required. For an encryption/decryption implementation, both the Restart and Forkreg implementation would need all the extra logic that Retrace inherently has, so in terms of area-efficiency Retrace will almost always be better.
Results
In the table below the most significant results, comparing the three area-efficient architectures to a Skinny implementation are shown. All results were obtained using the NanGate 45NM library for ASICS under normal operating conditions. The implementations were made as to provide a fair comparison. As such, no clock gating or latches were used, as well as a similar datapath size of one sixteenth of the block size. The throughput for encryption/decryption architectures is defined for decrypting messages. Note that for the ForkSkinny implementations, throughput is defined as a range instead of a fixed number. This is to account for the fact that for very short messages, the throughput is effectively doubled if both outputs of the forkcipher are used. As such, the range is defined as worst case (very long messages) to best case (very short messages). One last thing to note is that the Restart ForkSkinny-128-288 implementation uses less area than the Skinny-128-384 implementation. This is due to the fact that both ForkSkinny-128-192 and ForkSkinny-128-288 only need a half block-sized register to store the final block of the tweakey state, whereas Skinny-128-384 uses a full block-sized register to store the final part of the tweakey state.
Conclusion
From looking at the results from our implementations we can conclude that:
- In the Retrace architecture, the possibility to decrypt comes nearly for free in terms of area: there is only a very small area-difference between the encryption-only and encryption/decryption implementation. As the number of cycles for a decryption of the ForkReg and Retrace architecture are the same, an area-efficient design that must mainly decrypt messages and only rarely encrypt them should probably use the Retrace architecture.
- A significant difference between encryption-only and encryption/decryption Retrace architecture is the critical path, which does change by a large amount when going from encryption-only to encryption/decryption, especially for the 128-288 architecture.
- The encryption/decryption design of retrace can have higher throughput when decrypting messages (for small messages) than encryption/decryption Skinny. This is mainly due to the fact that decrypting requires the key to be updated before the real decryption can begin, which nearly doubles the amount of cycles for skinny and Forkreg ForkSkinny but the increase in cycles is (relatively speaking) less pronounced for Retrace ForkSkinny
- The area penalty of forking in an encryption/decryption implementation of ForkSkinny can be hidden almost entirely at the cost of cycles necessary to process message blocks.
