A research team has demonstrated an algorithmic software implementation technique named compact-slicing that fundamentally reduces register allocation and execution latency for lightweight block ciphers running on resource-constrained microcontrollers. Deployed and measured on an ARM Cortex-M3 hardware platform, the method halves the number of constantly occupied processor registers while slashing execution time by double-digit percentages across standard lightweight cryptographic algorithms. In resource-constrained Internet of Things deployments spanning industrial automation, smart medical equipment, energy distribution, and connected smart homes, microcontrollers must continuously shield sensitive data exchanges from security breaches. However, conventional block ciphers such as the Advanced Encryption Standard often consume excessive computational and memory resources, forcing embedded systems to rely on specialized lightweight alternatives. While lightweight ciphers reduce theoretical complexity at the architectural specification stage, their practical execution on modest microcontrollers has persistently suffered from severe software implementation bottlenecks that compact-slicing directly overcomes.
The central obstacle in software implementations of lightweight block ciphers arises from bit-level linear permutations. In dedicated hardware circuits, bit permutations are achieved virtually cost-free through hardwired physical interconnects. Conversely, software microprocessors generally lack single-cycle bit-swap instructions, requiring extensive combinations of logical AND, OR, XOR, and bitwise shift instructions to shuffle individual bits across register banks. To accelerate software execution, developers traditionally employ bit-slicing techniques, grouping identical input bit positions from all substitution boxes into separate slices stored across individual processor registers to evaluate cryptographic S-boxes in parallel. Under conventional bit-slicing, a 64-bit plaintext state is partitioned into four 16-bit slices, each assigned to an independent 32-bit register. Consequently, half of the bit space within each 32-bit register sits idle during single-block encryption. Although processing two independent data blocks simultaneously can improve register utilization, resource-limited microcontrollers possess narrow register files, causing dual-block approaches to trigger costly register spills, elevated stack allocations, and excessive memory access operations that degrade real-time performance.
Compact-slicing addresses this structural inefficiency by exploiting both the operational consistency and the inherent mathematical periodicity of linear permutations. Rather than adhering to the rigid one-register-per-slice convention, compact-slicing packs multiple slices that undergo identical operations into the same wider physical register. When mapping an n-bit block cipher state with an l-bit S-box across t slices into registers of bit-width h, compact-slicing requires only n divided by h registers rather than l distinct registers whenever register width is at least double the slice width. This strategy fundamentally reduces constantly occupied register counts by at least 50 percent. Simultaneously, the framework evaluates the cyclic property of a linear bijection where repeated rounds eventually return to the identity permutation. By decomposing complex, multi-round permutations into composite sequences of simpler constituent permutations that each execute within minimal clock cycles, compact-slicing ensures that intermediate state bits align consistently into predictable column configurations that compact S-box routines evaluate with minimal realignment overhead.
The research team demonstrated the versatility of compact-slicing across both primary classes of cryptographic permutations: inter-slice permutations and intra-slice permutations. For the ISO/IEC 29192-2 standard cipher PRESENT, the linear permutation represents an inter-slice permutation that swaps bits across different slices. Under standard bit-slicing, direct evaluation of a single PRESENT permutation requires 127 clock cycles, whereas optimized SWAPMOVE decompositions require 48 cycles per round, and two-round unrolled techniques require 32 cycles per two-round block. Observing that the PRESENT permutation exhibits a period of three rounds, the investigators synthesized three specialized 64-bit linear permutations designated P0, P1, and P2 whose sequential composition forms the identity transformation. Merging slices zero and two into one 32-bit register and slices one and three into a second register, compact-slicing completes three consecutive rounds of linear permutation using merely five SWAPMOVE instructions on Cortex-M3, consuming only 20 clock cycles across three rounds while preserving precise structural bit alignment.
To evaluate intra-slice permutations where bit movements remain strictly confined within individual slices, the investigators applied compact-slicing to the 64-bit block cipher GIFT-64, an SPN primitive supporting 128-bit keys across 28 rounds. Standard bit-sliced GIFT-64 requires 37 clock cycles per round, totaling 1036 cycles solely for linear permutations across the complete cipher. While existing fix-slicing techniques hold one slice fixed over four-round cycles to achieve low permutation latency, fix-slicing cannot support inter-slice permutations and still dedicates four separate registers to individual slices. Because the GIFT-64 permutation possesses a period of four rounds, compact-slicing constructs four new permutations, PG0 through PG3, whose composition forms the identity operator. Concatenating slices zero and one into the first 32-bit register and slices two and three into the second register, compact-slicing utilizes cyclic shift routines to execute each linear permutation step in nine clock cycles, reducing total linear permutation execution to 252 cycles, a 75.7 percent reduction relative to the original bit-sliced baseline.
Because practical Internet of Things applications diverge significantly in available memory, the researchers established dual operational schemes covering both round-key pre-processing and dynamic real-time round-key updating. In pre-processing configurations where key scheduling takes place beforehand, all round keys are formatted prior to timed execution. For ultra-constrained environments lacking adequate random-access memory to store dozens of precomputed round keys, the team engineered real-time generation and cached key-scheduling procedures. In PRESENT, the three-round compact-slicing cycle adjusts round keys using dedicated bit-manipulation operations, reducing dynamic key-update latency to 370 cycles, a 22.9 percent savings over the 480 cycles required by prior two-round unrolled implementations. In GIFT-64, by fusing standard round-key updates with bit reordering to generate round keys in four-round blocks, compact-slicing completes the full key schedule in 298 cycles, achieving a 51.8 percent reduction compared to the 619 cycles demanded by fix-slicing key updates.
Empirical performance measurements were conducted using fully unrolled C99 implementations running on a physical STM32F103C8T6 microcontroller board equipped with an ARM Cortex-M3 processor clocked by an internal 8 MHz high-speed internal oscillator. The firmware was compiled using Keil uVision 5.38 and Arm Compiler 6.19 with optimization level -O1, prefetching enabled, zero flash wait states, and link-time optimization disabled. Latency was captured with hardware cycle precision utilizing the 32-bit DWT_CYCCNT register across 100 warm-up runs followed by 1000 logged experimental trials, yielding zero standard deviation across measurements. Functional accuracy was validated against three distinct sets of standard cryptographic test vectors. The experimental design comprehensively logged clock cycles, read-only memory code size, random-access memory consumption, peak register requirements, stack allocation depth, total instruction counts, and data bus load and store transactions.
Under the pre-processed round-key benchmark on Cortex-M3, compact-slicing delivered pronounced performance advantages over best-known implementations. When evaluating PRESENT, compact-slicing recorded an execution latency of 973 clock cycles, comprising 600 cycles for S-box substitution and 224 cycles for linear permutation. Compared to the leading two-round unrolled bit-sliced implementation by Reis and colleagues, compact-slicing reduced overall latency by 35.0 percent, lowered ROM code footprint by 35.3 percent to 3630 bytes, decreased RAM utilization by 15.8 percent to 256 bytes, curbed memory access transactions by 26.7 percent to 264 bytes, and cut peak register usage from 12 registers down to eight, a 33.3 percent reduction, while completely eliminating a 48-byte stack requirement. Relative to the unoptimized bit-sliced baseline, total execution latency dropped by 81.1 percent while single-block throughput expanded by 412.6 percent. For GIFT-64 with pre-processed keys, compact-slicing required 828 cycles, within 0.6 percent of specialized fix-slicing latency, while reducing RAM by 50.0 percent, peak registers by 38.5 percent, and memory transactions by 65.9 percent.
In the dynamic round-key update scenario, compact-slicing established substantial efficiency gains over competing techniques. For PRESENT, the real-time round-key generation variant consumed 2413 cycles, cutting execution latency by 21.2 percent, code size by 15.1 percent to 9332 bytes, and memory access traffic by 96.2 percent down to just 24 bytes compared to the unrolled benchmark, while requiring zero RAM for key storage. The cached-key PRESENT variant recorded 2607 cycles, achieving a 14.9 percent latency reduction and a 65.4 percent boost in two-block throughput. For GIFT-64, the real-time compact-slicing variant achieved an execution latency of 1020 cycles, outperforming fix-slicing by 24.1 percent while reducing ROM by 10.9 percent to 4014 bytes, peak registers by 7.7 percent, and memory bus access by 97.1 percent, while completely eliminating fix-slicing’s 224-byte RAM and 52-byte stack requirements. The cached GIFT-64 variant executed in 1127 cycles, surmounting fix-slicing latency by 16.1 percent.
The study also assessed portable performance on resource-constrained platforms lacking barrel shifters, such as basic RV32I RISC-V cores where shift operations cannot be inlined into arithmetic instructions. Under software-simulated shifts where SWAPMOVE instructions expand from four to six cycles, compact-slicing for PRESENT required 1304 cycles with key pre-processing, outperforming the unrolled implementation’s 1752 cycles by 25.5 percent. For GIFT-64 with dynamic key updates, compact-slicing achieved 1381 cycles for real-time generation and 1488 cycles for cached keys, maintaining 23.2 percent and 17.2 percent latency reductions over fix-slicing while sustaining a 50 percent cut in constantly occupied registers. Crucially, compact-slicing maintains strict resistance against timing-based side-channel attacks: across all implementations, control flow contains no secret-dependent conditional branches, loops execute over fixed, input-independent iteration counts, S-boxes are evaluated strictly via constant-time Boolean equations, and memory accesses remain completely invariant to secret key and plaintext values.
An ablation analysis performed under key pre-processing isolated the precise computational mechanisms driving these gains. In PRESENT, where single-block latency declined from 5137 to 973 cycles, a net reduction of 4164 cycles, permutation decomposition served as the primary contributor, cutting linear permutation latency from 3937 to 224 cycles and accounting for 89.17 percent of total cycle savings, while slice merging contributed 10.16 percent and unrolling contributed 0.67 percent. Conversely, in GIFT-64, where latency fell from 3708 to 828 cycles, slice merging constituted the dominant factor, contributing 1988 saved cycles or 69.03 percent of total improvement, while permutation decomposition accounted for 27.22 percent, register reuse provided 2.81 percent, and unrolling yielded 0.94 percent. The authors emphasize that compact-slicing is optimized specifically for single-block processing under constrained memory and does not target continuous high-throughput multi-block parallel workloads where multi-block bit-slicing excels, with future research directed toward exploring instruction-level parallelism and architectures featuring wider data paths.
Subject of Research: Software optimization of lightweight cryptographic linear permutations on resource-constrained microcontrollers
Article Title: Compact-slicing: a fast software implementation for linear permutation on IoT devices
Article References: Chen, W., Guo, Y., Liu, W., Yu, B., & Huang, Y. (2026). Compact-slicing: a fast software implementation for linear permutation on IoT devices. Journal of King Saud University Computer and Information Sciences, 38(10), Article 1048. https://doi.org/10.1007/s44443-026-01420-z
Image Credits: AI Generated
DOI: 10.1007/s44443-026-01420-z
Keywords: cryptography, compact-slicing, lightweight block ciphers, Internet of Things, microcontrollers, Cortex-M3, linear permutations, PRESENT cipher, GIFT-64, bit-slicing, register allocation, ARM architecture, embedded systems, software optimization, clock cycle reduction, data security
News Source: Denise Maddox. (November 23, 2026). Compact-Slicing Cuts Microcontroller Cryptography Latency and Halves Register Usage. Scienmag.



