Abstract
Modular exponentiation is a core computation in many public key cryptography algorithms, including RSA and ElGamal. In fact, the computational cost can be reduced by exploiting exponent structure. This study proposes Shared-Result Block Modular Exponentiation (SRBME) to decrease the cost in some cases. It extends result reuse from exponents composed of identical blocks to those containing repeated reference blocks and variant blocks. SRBME computes the reference-block power once. Furthermore, it constructs variant-block powers through differences between block values to share intermediate results and store prepared powers for positional reuse. If the modular inverse can be computed, negative differences can be handled using an inverse base. Mathematical proofs establish the correctness of intermediate-result reuse, variant-power construction, and positional reconstruction. SRBME required fewer modular multiplications than the LR-BE and RL-BE implementations in all tested configurations. When all blocks were nonzero and the block width, block count, reference value, and set of distinct variant values were fixed, changing the frequencies of the variant values left the operation counts unchanged. Across four selected 300-bit exponent configurations with five-bit blocks, SRBME reduced mean execution time by 16.52–18.64% relative to ASA. Both methods use the same reconstruction procedure. Further experiments show lower mean execution times in all positive-difference configurations at modulus sizes of 256 and 512 bits. These findings establish SRBME as a structure-aware modular exponentiation method. Using conventionally generated RSA keys, SRBME produced the expected result in all 180 test cases for the modular exponentiation step of direct RSA decryption. For CRT-RSA, SRBME can be used for the component modular exponentiations under the stated arithmetic conditions. However, experimental validation of a complete CRT-RSA implementation remains future work.